in reply to Re: Introducing Scheme In Perl 6
in thread Introducing Scheme In Perl 6
Scheme running on MoarVM would be nice, to be sure, if only to prove that it can be done. It would be several orders of magnitude slower because modern Scheme compilers (like modern Lisps) compile to machine code.
Connecting to the interpreter thread is one function call, and unmarshalling back to Perl 6 is a very simple and fast callback, I expect that most of the time spent on a single invocation of $g.run('(+ 5 4)') is in the unmarshalling of the single SCM cons cell back to Perl 6.
As to being more productive, I suppose I could have taken several months to learn MoarVM, read R6RS, do two or three test implementations until I worked out the approach, lost D20 SAN implementing call/cc, and gotten for my efforts a trivial Scheme running hundreds of times slower than any actual working implementation, and then still would have to write the Perl 6 - Scheme bridge, this time on MoarVM.
Or I could take a few nights to read the GNU Guile docs, write a 200-line helper library, and get Perl 6 quickly talking to a fast, debugged, and more importantly working Scheme implementation. Perl 6 is -Ofun, and while doing all of the MoarVM backfill may be fun to some, and maybe if I get into it it'd be fun to me, but right now it's someone else's itch to scratch.
All in all, I'll take the NativeCall route, and let someone that knows the MoarVM innards and loves the challenge of building a new grammar, AST generator, compiler and debugging the entire toolchain do the work. Life's too short.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Introducing Scheme In Perl 6
by jdporter (Paladin) on Feb 01, 2016 at 15:44 UTC | |
by DrForr (Beadle) on Feb 02, 2016 at 00:39 UTC |