On Mon, Dec 31, 2012 at 4:08 AM, Greg Spurrier <
greg.s...@gmail.com> wrote:
> I'm pleased to announce the first release of my Ruby port of Shen: ShenRuby
> 0.1.0. It is pretty much just the REPL at this point, but it passes the Shen
> test suite, except for the "Qi interpreter - chapter 13" test case which
> fails due to stack overflow.
>
> Future releases will focus on supporting easy bi-directional interaction
> between Ruby and Shen and improving performance. The ultimate goal is making
> hybrid Ruby/Shen applications viable.
>
> If you are curious, you can find my blog post announcing the release at
>
http://sourcematters.org/2012/12/30/announcing-shenruby-0-1-0.html and the
> source code is available on GitHub at
>
https://github.com/gregspurrier/shen-ruby. If you have Ruby 1.9.3 installed,
> you can install ShenRuby and launch the repl with the commands:
>
> gem install shen-ruby
> srrepl
>
> To exit the REPL, execute '(quit)'.
>
> Any feedback and/or bug reports are warmly welcomed.
>
> Cheers,
> Greg
>
Excellent Greg. I'm playing with it and works very well so far. Great job! :)
Can I suggest you trap the INT signal to avoid the stack trace that is
printed when leaving the repl with Ctrl+C ?
something like:
Signal.trap("INT") { puts "Leaving..."; exit 1 }
Regarding the stack limits you mentioned before, the problem I had
with the Scheme port was that the 'do' implementation as implemented
by Shen doesn't allow the underlying implementation to optimize
tail-calls, what I did was to translate instances of
'(do <E1> <E2>)'
to
'(begin <E1> <E2>)'
in Scheme. This avoids the call to 'do' and makes <E2> be in tail
position so that the Scheme compiler can optimize it.
In the case of Ruby you can compile
'(do <E1> <E2>)'
to
'(<E1>; <E2>)'
but being that you use trampolines I don't think this will make any difference.
> --
> You received this message because you are subscribed to the Google Groups
> "Qilang" group.
> To view this discussion on the web visit
>
https://groups.google.com/d/msg/qilang/-/SO9rB8-g_Z4J.
> To post to this group, send email to
qil...@googlegroups.com.
> To unsubscribe from this group, send email to
>
qilang+un...@googlegroups.com.
> For more options, visit this group at
>
http://groups.google.com/group/qilang?hl=en.
--
BD