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.

More »

The Philosophy behind: Auto-Dereferencing

This is the second article in the "Philosophy behind"-series, picking up a specialty of one of my projects and explaining how it came to be made. Last time I wrote about the "GetSet" concept in Prexonite Script

One major element in the design of Prexonite Script is the use of functions as first-class objects. It should be possible to write snippets like the following:

Prexonite Script:
  1. function Filter(list, ref predicate)
  2. {
  3.     var newList = new List;
  4.     foreach(var elem in list)
  5.     {
  6.         if(predicate(elem))
  7.             newList.Add(elem);
  8.     }
  9.     return newList;
  10. }

This piece of code defines a higher-order function Filter that creates a copy of a given input list only containing those elements that cause a given predicate (a function) to return true. Notice the ref keyword in the definition of the formal arguments and the fact that predicate is used in the code as if it was an actual function.

What exactly happens here? It can be explained in two ways: the official one and the real one.

More »