/Express

The start of an interpreter

Primary LanguagePascal

Express

Currently this is a simple and experimental core of a scripting language.

The language design is mostly inspired by Python, JavaScript and some inspiration from Object Pascal.

Test me

  1. open cmd.exe in the same folder as main.exe
  2. run: main.exe path/to/file.xpr

Alternative last startup-argument: A number to set max length of printed bytecode.

So far we have

  • Operations:
    • := += -= *= /= &= |= ^=
    • = != < > <= >=
    • + - * ** / | & ^ shr shl
    • and or xor
  • Constructs: if..else for while repeat print
  • Branch statements: continue break return
  • Data types: int float bool list string char ... and the "lack" of a datatype: None
  • Script functions (the basics)
  • Methods supports local declarations, tho currently no closures (will error)
  • Special expressions: x if condition else y, more could be added.
  • Garbage collector - which might, or might not work properly...

Could be more stuff that I've failed to mention. But keep in mind that many feature added is probably iffy, and a lot of error handling is lacking..