a .NET hosted scripting language with a focus on meta-programming and embedded DSLs
Yesterday I published a new version of Prexonite. It sort-of replaces the fourth beta preview I had planned to ship earlier.
First, though, I have to disappoint you: There is not going to be anything like tab-completion in the near feature. Prexonite fully supports Unicode and I couldn't find a tab-completion library that supports non-ASCII character encoding. Although Prx.exe currently contains an experimental tab-completion solution, I refuse to enable it by default as long as it ignored my umlauts.
Yet another disappointment is, that Prexonie October07 does not yet contain the collection of scripts I plan to include in the Prexonite Standard Repository, but I promise you, to release them in the next edition.
"Did you actually change anything?"
… you might be wondering. In addition to the features announced in the last post, I have added/changed the following:
By addressing local variables using an index instead of looking up a name in a dictionary, the time required to access a local variable has measurably decreased. Specialized variants for all instructions dealing with local variables have been added. This is necessary because global code cannot take advantage of this feature. Also note that this optimization happens after the code has been emitted, so even assembler code takes advantage of the new access method.
When chaining functions that manipulate lists, I often found myself tediously counting brackets as the expressions got more and more sophisticated. Brackets don't scale very well, so a different way of chaining functions had to be found. While an actual 'chain' operator, like those found in many functional programming languages, might have been the solution, I went a different way.
I wanted pipe the result of one function into another function like it is done in shell scripts.
Instead of overloading the '|' operator though, I went with '>>
' and '<<
'.
function main =
::Console.ReadLine~Int>> [1,5,7,1,5].Insert(3)>>
map(x => 2*x)>> where(x => x mod 3 == 0) >>
foldl((l,r)=>l+r,"") >> println("[ ") << "] "
This sample reads an integer from stdin, inserts it after the third element in the list, which is then restricted to numbers divisible by three. The result is then concatenated and printed. Although the compiler allows multiple arguments to be added in the way, functions still can only return one value.
It might look like tuples are used but that's just a facade for plain vanilla arguments.
Prexonite already contains some extensions, that were previously part of the Standard Repository. Most notably the debug command and a set of benchmarking classes.
Also: Tomorrow I will hand in a paper I have been writing on for the past few months. 'Creating a programming language' is a short overview over the concepts of the implementation of a programming language, from its design over the compiler to the runtime environment.
As I cannot just print out the Prexonite source code (about 460 pages), the paper will point to the October07 release available from SealedSun.ch.
If you think, the new additions are worth an update, look for the October07
sources and binaries over on GitHub.