Rex
View this project on GitHub.
Just when you thought programming language implementations couldn't get any slower…along comes Rex! Rex is a functional programming language which has a rigid type system, uses prefix notation for function application, and has a Haskell-esque syntax.
Note that I wrote this before actually studying anything to do with programming language design or interpreter implementation, which explains its many shortcomings and idiosyncrasies.
Features:
- External libraries
- Runtime type-checking
- User-defined error handling (
catch
statements) - Python integration (if you can't write a function in Rex, write it in Python instead)
- Strings
- Hierarchical type structure
- Somewhat descriptive error messages
- Neat syntax
- Mind-numbingly slow computation speeds
Screenshots
Documentation
To do
- Types
- Chars
- Lists
- Change null to unit
- Errors
- More detailed error messages
- Line numbers for runtime errors
- Produce error when function is applied to too many arguments
- Misc
- Infix operators?
- Tail-call optimisation
- More debugging information with
-v
flag - Allow strings to be defined by either single or double quotes
- More detailed traceback stack
- Improve scope system (call function from specific library)
- Bug fixes
- Fix string escape characters
FAQ
- What is the secret to Rex's incredible sluggishness?
- Execution is implemented in Python as a recursive algorithm, ensuring several call stack operations per Rex function call. This was my first time writing an interpreter so I just wanted to get it working. If you try to render 3D graphics in Rex, don't complain when you find you get 0.01 frames per second. It's not meant to be fast.