Prexonite Today #2
In the last month I have not finished anything, but implemented a lot.
Currently Prexonite is a working, 20'000-lines-of-code calculator library with support for subroutines.
The virtual machine correctly interprets all available instructions except for static CLR calls. The application object model represents everything except parameter type constraints and commands. The CSC5 compiler recognizes only GetSet (function calls, variable assignments) and return statements; you can however write your code in Assembler if you need to.
My list of priorities looks like this:
- Condition and loop statements
- CLR static calls
- Object creation
- Commands
- Initialize function (aka "global code")
- Variable references
- Function...
- references
- continuations
- Build block
- Embedded functions
- Inline functions
- Coroutines*
- Futuristic stuff:
- Subcoroutines
- Compiler optimizations
- Function inlineing
*Coroutines: I'm not sure if you have to explicitly declare a function to behave like a coroutine or not. As the generated code is identical only the instantiation, the stack context, would differ. Not having to declare coroutines as such would make the syntax and the programmers job a whole lot easier. The architecture would allow me to treat FunctionContexts (the StackContext for functions) like continuations and function references at the same time and therefor act as an implementation of coroutines.
I'm also a bit stuck with the syntax of static CLR calls and object creation. The full syntax would looks as follows:
Now this, of course, is not very intuitive and I would prefer the use of the static member operator "::"
But while this sample is unambiguous, something like
is not.
The simple solution is using a prefix to determine which environment to use and I would say "::" fits best:
You can also put a space between "new" and "::" if you like (CSC5 is a freeform language, remember). The syntax for static calls would be similar:
- //String = PType.String
- ~String.Escape(someValue);
- //String = System.String
- ::String.Format(someFormat, someValue);
- System::Text::Encoding::UTF8.GetBytes("Hello");
If the call starts with an imported namespace ("System" is imported by default), the call will be targeted at the CLR.
Discussion Area - Leave a Comment