Interfacing with the Rubinius VM

81 views
Skip to first unread message

Josep M. Bach

unread,
May 3, 2011, 1:46:46 PM5/3/11
to rubini...@googlegroups.com
Hello there,

This might not be the right place to ask this (please tell me whether it should be better to post this in the IRC or wherever else), but here I go:

I'm going with my first try to interface a programming language with the Rubinius VM. For starters, my choice is Brainfuck, since it's a dead-simple language.

As far as I know, I only need a table of cells and a pointer, and almost map the BF tokens (>, <, +, -...) to the VM instructions. I am a bit lost, since I practically don't know where to start. I've seen in other projects there is a Generator class sublassing Rubinius::Generator, and each AST node implements a #bytecode method that calls the instructions on the generator. How does it work exactly? I don't know how to set an initial state (the table of cells and the pointer pointing to cell 0).

How would you implement this? Any feedback is appreciated :)

Thanks!

Kurt Stephens

unread,
May 3, 2011, 4:31:10 PM5/3/11
to rubini...@googlegroups.com
Write a Brainfuck-to-Ruby compiler.

> --
> --- !ruby/object:MailingList
> name: rubinius-dev
> view: http://groups.google.com/group/rubinius-dev?hl=en
> post: rubini...@googlegroups.com
> unsubscribe: rubinius-dev...@googlegroups.com

Chuck Remes

unread,
May 3, 2011, 5:28:43 PM5/3/11
to rubini...@googlegroups.com
On May 3, 2011, at 12:46 PM, Josep M. Bach wrote:

> How would you implement this? Any feedback is appreciated :)

I recommend taking a look at some of the other languages that have been implemented on top of rubinius and following their lead.

You can find a list here: http://rubini.us/projects/

The most active one is probably Fancy. Also, a brand new one (not on the list yet) is Poetics which is a start on implementing the CoffeeScript language.

Most, if not all, of the projects are on github.

cr


Josep M. Bach

unread,
May 14, 2011, 11:24:13 AM5/14/11
to rubini...@googlegroups.com
Thanks everyone! I'll take a deeper look :)
Reply all
Reply to author
Forward
0 new messages