

Iron Scheme:  Scheme implementation running on .NET - iamelgringo
http://www.codeplex.com/IronScheme

======
Daemmerung
_Is this still true? Has .NET been sufficiently updated to allow full Scheme?_

This is no longer true: not because of any change in the VM, but because of a
new way to model first-class continuations. Qv "Continuations from Generalized
Stack Inspection",
[http://www.cs.brown.edu/~sk/Publications/Papers/Published/pc...](http://www.cs.brown.edu/~sk/Publications/Papers/Published/pcmkf-
cont-from-gen-stack-insp/) -

 _Implementing first-class continuations can pose a challenge if the target
machine makes no provisions for accessing and re-installing the run-time
stack. In this paper, we present a novel translation that overcomes this
problem. In the first half of the paper, we introduce a theoretical model that
shows how to eliminate the capture and the use of first-class continuations in
the presence of a generalized stack inspection mechanism._ [...] _Second, we
show how to use our new technique to copy and reconstitute the stack on
MSIL.Net using exception handlers. This establishes that Scheme's first-class
continuations can exist on non-cooperative virtual machines._

~~~
jmatt
I link to the same paper - different repository in my comment. Excellent
quote.

------
tjr
From <http://www.cs.uiowa.edu/~rjhansen/dotnet.html>

_I asked Professor Abelson whether Scheme could be represented in the .NET
virtual machine. His answer was a clear and unambiguous “no”. Most of the
language can be; but one of Scheme’s most useful and unique facilities,
continuations, cannot be modeled in .NET’s VM. It’s not that nobody’s done it
yet; it’s that it’s not possible._

Is this still true? Has .NET been sufficiently updated to allow full Scheme?

~~~
jmatt
Continuations are absolutely possible. This is absurd that your professor
isn't staying up to date. Especially considering he's teaching a PL class. See
Section 4.2 for academic "proof"
<http://www.ccs.neu.edu/scheme/pubs/icfp05-pcmkf.pdf>

When .NET clr and C# beta first came out, closures were said to be impossible!
C# 2.0 supports lexical closures and CPS (continuation passing style). So no
call/cc but most everything else. Most developers don't even know the
difference between closures and continuations to begin with. So I understand
the compiler team's reasons for not implementing continuations yet. But back
in 2001 - 2002 closures were said to be impossible too.

Mono has implemented continuations already... (of course)
[http://lists.ximian.com/pipermail/mono-devel-
list/2006-April...](http://lists.ximian.com/pipermail/mono-devel-
list/2006-April/017991.html)

.NET clr does not explicitly support them. Neither does the jvm. The jvm is
planning on explicitly adding support
<http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6655643>

There are plenty of things missing in the jvm (by design). That the clr has
and some of those have ended up being useful. I don't know how many developers
remember but the clr really pushed changes to the jvm. But that is for a
different thread.

Microsoft will support continuations and other advanced features as more
developers begin to use those coding styles. The more .NET scheme, python,
ruby developers the better. Or maybe the pressure will come from the web
development side where continuations are promising (weblocks, arc, seaside).

[EDIT: A few sentences and fixing grammar]

~~~
Zak
>This is absurd that your professor isn't staying up to date. Especially
considering he's teaching a PL class

The afformentioned professor Abelson is one of the authors of the Wizard Book.
A look at the above citation reveals that he made the statement in 2003, while
the paper your reference was published in 2005.

~~~
jmatt
Ya I've read it along with most anyone that has had an interest in programming
languages and went to school in the last 20 years. It doesn't make his
statement less absurd.

I was doing undergraduate research on .NET in 2003 and it was absurd when I
first heard it. Academics were upset that M$ made a pragmatic IL. One that
didn't support many advanced languages features. That didn't mean implementing
those features wasn't possible. It just meant it was yet another step back for
features making it to the M$ environment.

It should be noted that Parrot was getting a lot of talk back then. It would
be THE intermediate language for all languages dynamic or functional... Maybe
it makes sense to start pragmatic, like the jvm and .NET, and then add the
harder part later.

------
trezor
I must admit when Microsoft first introduced the .NET Framework and called
.NET-code "language independent", I thought it was a bit of a _grand_
statement and chuckled away, since that pretty much involved C# and Visual
Basic .NET.

Right now I think even _Microsoft_ is impressed with number of CLR compilers
and level of support the .NET Runtime has gathered. You have C++, C#, Visual
Basic, PHP, Perl, Python, Ruby, Cobol(!), LISP and the list just goes. And
with Scheme now, it just got a little bit longer.

I guess even among the open-source crowd there are significant numbers of
people who recognizes the _good_ products Microsoft delivers every now and
then :)

~~~
jmatt
Here is a mostly complete list of .NET languages.

<http://en.wikipedia.org/wiki/.NET_languages>

For all those Python coders - IronPython is usable in production now. It's
stable and the differences between cpython and ironpython are well documented.

~~~
Daemmerung
And for Schemes on .NET, in addition to the listed Common Larceny
(<http://www.ccs.neu.edu/home/will/Larceny/>) and IronScheme, there is also
Bigloo (<http://www-sop.inria.fr/mimosa/fp/Bigloo/>).

Common Larceny uses the pkcfm hack for its continuations, I believe, while
Bigloo continuations are more like IronScheme's ("Bigloo discourages the use
of call/cc" - from the manual).

Disclaimer: I have personal experience with neither system.

