[Mono-list] One Bug, Many questions

tom berger object@intellectronica.net
27 Aug 2002 13:06:58 +0100


I am working on a free scheme system (compiler + repl) for .Net/Mono.
Work is progressing well, and although the system is still far from
being complete (broken number system, some missing functions and syntax,
primitive lisp-like macro system) or efficient (the compiler reads
s-expressions and emits code in a single pass without any analysis, all
values are boxed), it already works nice on windows.

The cool thing about my compiler (modelled after kawa) is that it can be
invoked in runtime, so evaluating expressions from the console simply
compiles them and the runs the resulting code.

I. mcs compiles the system without a problem, but i still don't manage
to run it on mono (it works fine on windows). During compilation, when
calling (recursively) a code generation function, mono dies with the
following error :

** ERROR **: file jit.c: line 489 (mono_store_tree): assertion failed:
(s->svt != VAL_UNKNOWN)

Any ideas what could that be? I'm rather anxious to see the compiler
working on mono and I would like to provide as much assistance as
possible in eliminating these bugs but I don't really know how, so if
anyone has any ideas what is this thing (a 'not yet implemented', simply
a bug, my own bug - being ignored by the microsoft runtime) or how I can
help with debugging it please tell.

II. As part of the attempt to bring scheme to the world of .Net, I am
trying to support the Microsoft.Vsa interfaces, so scheme could easily
be used for ASP and as an extension language in applications. Mono still
doesn't have these interfaces, and I was wondering : Do you want to have
them? Is there any legal problem with them being part of the Microsoft
namespace and not part of the standard? I could probably contribute
them, it doesn't seem like much work. If not, are there any plans to
support any other script engine technology in mono?

III. One of the most important parts in the development going on is to
move to an intermediate abstract syntax tree representation so several
optimisations can be made (inlining, elimination of unnecessary
closures, tail calls, and more). At first, impressed by the rest of the
development infrastructure in .Net, I turned to use CodeDom, which
seemed to be a nice general solution for that problem. Very fast,
however, I found out that CodeDom is very incomplete. The biggest
problem for a functional language is that it only uses expressions, no
statements. CodeDom, designed to facilitate imperative languages like C#
and VB is statement based, and I had to create many of the relevant
expression types myself (which defeats the whole goal of having one AST
for all languages). Looking into the mcs and logo sources, I found out
that neither use CodeDom. Does anyone have any idea why, or could
possibly point me to any discussions on that matter (if there ever were
any). Do you know of any other good facility for source representation?

IV. Although scheme is in many aspects radically different than other
mainstream programming languages, it does share some properties with
many of the .Net languages. For instance, functions as first-class
values exist in javascript too (and if I'm not mistaken, also in VB). Is
anyone working on a free implementation of javascript or any other
language that could possibly communicate with scheme on a closer level
than just the CLS? I'm sure we could embrace and extend a little, to
allow for even greater language interoperability, with some attention.

V. Finally, if anyone has any ideas as to what they would like to see in
a system like this, please feel free. I would like to have a stable
environment before the end of the summer, so I can also share the source
with others and mature the system toward a useful development tool.