Here is an implementation of Arc-like compiler for .NET platform. It is relatively simple, and may contain some ideas that could be of interest to this community (e.g., a minimalistic intermediate core language, some compiler implementation techniques, etc.). The code is public domain, but it requires the latest MBase distribution to compile and run. Arc compiled code can be used standalone.
http://www.meta-alternative.net/techpreview.html
Your comments are welcome, please send them to info@meta-alternative.net
What license does MBase come with? Is it open source? (If not, is it guaranteed to always be free?)
Does this work with Mono? (And Linux?)
And where is the download link for MBase itself? I managed to get to the download for MBase-0.3-generic.zip by using links to old versions and changing the version number, but there wasn't any link leading there. And the readme mentioned a msi distribution, but I couldn't find that either.
-----
The compiler only supports a fairly small subset of Arc, so it isn't really usable on its own yet. But I am impressed with what I've seen of its performance, which I tested briefly using the factorial example from http://arclanguage.org/item?id=2455 .
Raw arc2: 27 seconds
Anarki: 25 seconds
Python: about 6 seconds
Mzscheme: about 1 second
Compiled MBase Arc: about 1 second
Dang.If this compiler gets continued support and actually begins to implement most of Arc, it could really go somewhere.
-----
And, yes, I am hoping to support pseudoArc. Such an early release was done to attract a community feedback and to raise a discussion around the minimalistic core language properties. pseudoArc is public domain - no license restrictions, so everybody can extend it. The best way would be to keep the core very simple and provide the rest of Arc functionality as a separate library.
-----
Now that I have had a little more time to play around with the pseudoArc compiler, I realize exactly how small a subset of the core has been implemented so far. (I mean, seriously, read is not a convenience.) I would definitely like to see a more full-featured implementation develop. (But seeing as I am not at all familiar with your MBase system, I don't think I would be of much help.)
-----
For this reason, I believe that use of "system" makes a mockery of the axiomatic construction, and has no place in the Arc core.
-----
Yeah, I know that doesn't fix the problems you mentioned, and yes, I run Windows so I do encounter those problems with the vanilla Arc releases. But we can't expect a offshoot implementation to do anything about the problem, we really need pg to solve the problem at the source.
-----
-----
Of course, I use Mac OS X, so it's not like I'm adversely impacted. But the point still stands.
-----
-----
But, some fundamental Arc features are not compatible with this core at all: zap (needs a strange memory model, not quite possible to implement efficiently in .NET, and, any way, is too non-functional) and mutable strings (that is easy to fix, if someone really needs mutable strings, I am not quite convienced). Also, numerical tower must be implemented in the core compiler (at least a parser must recognise all the variations and compiler backend must emit all the literals correctly), but it does not seem to be strictly specified for an original Arc so far.
Next release (to be available soon) will contain more of the basic functionality and a consistent .NET bindings framework. This must be enough to grow the language from the core.
What we really need is a formal definition for Arc operational and denotational semantics.
-----
See my description of setforms for more info on how it's all put together: http://arcfn.com/doc/setforms.html
-----
-----
Something like (= ((fn (x) (x 1)) str) #\A) should not work, right?
-----
This sample compiler generates .NET executables (DLLs and EXEs), but it is potentially retargetable, more backends will be provided later.
To run these binaries you will need either M$ .NET framework or Mono (versions from 1.4.x are ok, not sure about older ones). MBase is free and comes currently as a binary only distribution (no compiler is required). It will always be free, core parts may be open sourced (most likely under QPL) when the code cleanup is complete.
Techpreview page contains link to MBase-0.3-generic.zip, I'll try to highlight the link better, thank you for pointing to this issue.
MSI distributions normally comes in a week after the generic zip bundle.
-----
-----