[racket] Hosting other languages on Racket

39 views
Skip to first unread message

Grant Rettke

unread,
Sep 21, 2010, 2:55:07 PM9/21/10
to racket
Hi,

Is there a precedent for hosting other languages on the Racket VM in
the same way that JRuby and Clojure live in the JVM or F# and
IronPython live on the CLR?

Is that interesting to users? Or implementers?

How technically difficult is it? (days/months/years)

Are there research opportunities there?

Best wishes,

Grant

--
http://www.wisdomandwonder.com/
ACM, AMA, COG, IEEE
_________________________________________________
For list-related administrative tasks:
http://lists.racket-lang.org/listinfo/users

Jay McCarthy

unread,
Sep 21, 2010, 3:02:09 PM9/21/10
to Grant Rettke, racket
We already have hosted Javascript, Algol 60, Datalog, R5RS, and R6RS.
In the past, we've had version of Java in the core. We have Python and
SML out there from people at Utah.

Jay

--
Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93

Sam Tobin-Hochstadt

unread,
Sep 21, 2010, 3:01:45 PM9/21/10
to Grant Rettke, racket
On Tue, Sep 21, 2010 at 2:55 PM, Grant Rettke <gre...@acm.org> wrote:
> Is there a precedent for hosting other languages on the Racket VM in
> the same way that JRuby and Clojure live in the JVM or F# and
> IronPython live on the CLR?

See the Algol60 experimental language, the #lang datalog language,
Dave Herman's javascript.plt planet package, etc.
--
sam th
sa...@ccs.neu.edu

Neil Van Dyke

unread,
Sep 21, 2010, 3:11:21 PM9/21/10
to Jay McCarthy, racket
Jay McCarthy wrote at 09/21/2010 03:02 PM:
> We already have hosted Javascript, Algol 60, Datalog, R5RS, and R6RS. In the past, we've had version of Java in the core. We have Python and SML out there from people at Utah.
>

Do these all translate to Racket syntax, and then the normal Racket
interpreter/compiler takes over? Or does anyone generate VM bytecode
directly?

--
http://www.neilvandyke.org/

Jay McCarthy

unread,
Sep 21, 2010, 3:14:39 PM9/21/10
to Neil Van Dyke, racket
I don't think any generate bytecode.

My personal opinion is that this is a sign of a good thing.

Languages target the JVM because targeting Java is so painful, so we
should not be surprised that people DON'T do it.

Targeting Racket is designed to be easy with the syntactic extension
system, so we should not be surprised that people do it.

However, I do hope that people find Blake's work on providing a Racket
API for the bytecode to be a convenient way to interact with bytecode
for the purpose of analysis and arbitrary generation.

Jay

On Tue, Sep 21, 2010 at 1:11 PM, Neil Van Dyke <ne...@neilvandyke.org> wrote:
> Jay McCarthy wrote at 09/21/2010 03:02 PM:
>>
>> We already have hosted Javascript, Algol 60, Datalog, R5RS, and R6RS. In
>> the past, we've had version of Java in the core. We have Python and SML out
>> there from people at Utah.
>>
>
> Do these all translate to Racket syntax, and then the normal Racket
> interpreter/compiler takes over?  Or does anyone generate VM bytecode
> directly?
>
> --
> http://www.neilvandyke.org/
>

--

Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93

Sam Tobin-Hochstadt

unread,
Sep 21, 2010, 3:14:47 PM9/21/10
to Neil Van Dyke, Jay McCarthy, racket
On Tue, Sep 21, 2010 at 3:11 PM, Neil Van Dyke <ne...@neilvandyke.org> wrote:
> Jay McCarthy wrote at 09/21/2010 03:02 PM:
>>
>> We already have hosted Javascript, Algol 60, Datalog, R5RS, and R6RS. In
>> the past, we've had version of Java in the core. We have Python and SML out
>> there from people at Utah.
>>
>
> Do these all translate to Racket syntax, and then the normal Racket
> interpreter/compiler takes over?

Yes.

>  Or does anyone generate VM bytecode
> directly?

Just Matthew. :) More seriously, the bytecode is harder to generate,
not more expressive (I think) and generating it loses you
optimizations. Jay has a student working on a bytecode generator, but
I believe that's still alpha-stage.
--
sam th
sa...@ccs.neu.edu

Jay McCarthy

unread,
Sep 21, 2010, 3:18:41 PM9/21/10
to Sam Tobin-Hochstadt, racket, Neil Van Dyke
On Tue, Sep 21, 2010 at 1:14 PM, Sam Tobin-Hochstadt <sa...@ccs.neu.edu> wrote:
> More seriously, the bytecode is harder to generate,
> not more expressive (I think) and generating it loses you
> optimizations.

I can only think of one optimization that runs on byte code. The byte
code is more expressive though, because you can represent things
(simple example: syntax objects) that you can't write down as Racket
source.

> Jay has a student working on a bytecode generator, but
> I believe that's still alpha-stage.

As of last week's Git version, we can bring in and emit every zo that
"raco setup" produces in a way compatible with the C. This suggests
that it's no longer alpha. Now we are using it for its intended
purpose (whole program compilation) which will be a good example of
its use.

Jay

--
Jay McCarthy <j...@cs.byu.edu>
Assistant Professor / Brigham Young University
http://teammccarthy.org/jay

"The glory of God is Intelligence" - D&C 93

Shriram Krishnamurthi

unread,
Sep 21, 2010, 3:18:42 PM9/21/10
to Neil Van Dyke, Jay McCarthy, racket
On the other hand, the fact that the bytecodes are wel-documented
(both text docs, as well as a Redex model) has been a huge boon to
apps that can rely on all these front-ends to do their job, and then
port just the back-end to other platforms.

For the reasons Jay explains, I'd be hard-pressed to imagine someone
wanting to compile a reasonably standard language directly to
bytecodes. Put differently, this is a "test case" of a language's
design, another one like its ability to express a meta-circular
interpreter.

Shriram

On Tue, Sep 21, 2010 at 3:11 PM, Neil Van Dyke <ne...@neilvandyke.org> wrote:

Neil Van Dyke

unread,
Sep 21, 2010, 3:27:33 PM9/21/10
to Jay McCarthy, racket
Jay McCarthy wrote at 09/21/2010 03:14 PM:
> I don't think any generate bytecode.
>
> My personal opinion is that this is a sign of a good thing.
>

Me too. Using Scheme as a target language was one of the reasons I
moved almost all my work to Scheme (maybe 9 years ago).

I wasted a shameful amount of time emitting Java in various projects in
'96-'00.

--
http://www.neilvandyke.org/

Grant Rettke

unread,
Sep 21, 2010, 4:35:53 PM9/21/10
to Neil Van Dyke, Jay McCarthy, racket
On Tue, Sep 21, 2010 at 2:27 PM, Neil Van Dyke <ne...@neilvandyke.org> wrote:
> Jay McCarthy wrote at 09/21/2010 03:14 PM:
>>
>> I don't think any generate bytecode.
>>
>> My personal opinion is that this is a sign of a good thing.
>>
>
> Me too.  Using Scheme as a target language was one of the reasons I moved
> almost all my work to Scheme (maybe 9 years ago).

When you say 'target language' do you mean using macros to generate Scheme?

Reply all
Reply to author
Forward
0 new messages