Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.misc > #6825 > unrolled thread
| Started by | RS Wood <rsw@therandymon.com> |
|---|---|
| First post | 2015-02-26 11:48 +0000 |
| Last post | 2015-02-27 13:23 +0000 |
| Articles | 4 — 3 participants |
Back to article view | Back to comp.misc
kanaka/miniMAL: Lisp in <1kb javascript RS Wood <rsw@therandymon.com> - 2015-02-26 11:48 +0000
Re: kanaka/miniMAL: Lisp in <1kb javascript Marko Rauhamaa <marko@pacujo.net> - 2015-02-26 16:08 +0200
Re: kanaka/miniMAL: Lisp in <1kb javascript Matthew Carter <m@ahungry.com> - 2015-02-27 00:48 -0500
Re: kanaka/miniMAL: Lisp in <1kb javascript RS Wood <rsw@therandymon.com> - 2015-02-27 13:23 +0000
| From | RS Wood <rsw@therandymon.com> |
|---|---|
| Date | 2015-02-26 11:48 +0000 |
| Subject | kanaka/miniMAL: Lisp in <1kb javascript |
| Message-ID | <20150226114802.fe197ab3.rsw@therandymon.com> |
https://github.com/kanaka/miniMAL A Lisp implemented in < 1 KB of JavaScript with macros, TCO, interop and exception handling. //--clip miniMAL A Clojure inspired Lisp implemented in less than 1024 bytes of JavaScript. Rationale I originally started implementing a tiny Lisp interpreter as a quick hack to submit to the 2015 JS1K competition (demo 2209). However, I soon realized that I could fit far more functionality into 1024 bytes of JavaScript than I expected and so miniMAL was born as a "full-fledged" Lisp in its own right. The design of miniMAL started with mal (a Clojure-insipred pedagogical Lisp interpreter with implementations in over two dozen languages). And in fact, in the miniMAL repository you can see the incremental steps to build up the interpreter just like for each of the mal implementations. However, the syntax and functionality of miniMAL is fairly different from mal so it has become a standalone project. Usage There are several different ways to use miniMAL: Start a REPL: run the miniMAL REPL (read-eval-print-loop). Requires Node.js. ./miniMAL Run a miniMAL program: run a miniMAL program and then exit. Requires Node.js. ./miniMAL hello.json As a shebang script: add a shebang line to the top of your miniMAL program and turn it into an executable script. Requires Node.js. //--clip -- RS Wood <rsw@therandymon.com Posting to comp.misc, sci.misc, and misc.news.internet.discuss.
[toc] | [next] | [standalone]
| From | Marko Rauhamaa <marko@pacujo.net> |
|---|---|
| Date | 2015-02-26 16:08 +0200 |
| Message-ID | <87zj80epey.fsf@elektro.pacujo.net> |
| In reply to | #6825 |
RS Wood <rsw@therandymon.com>:
> A Clojure inspired Lisp implemented in less than 1024 bytes of
> JavaScript.
>
> [...]
> Requires Node.js.
Here's a complete Scheme implementation in mere 193 bytes of C:
========================================================================
#include <libguile.h>
static void inner_main (void *closure, int argc, char **argv)
{scm_shell (argc, argv);}
int main (int argc,char **argv)
{scm_boot_guile(argc,argv,inner_main,0);return 0;}
========================================================================
Requires libguile.so.
Marko
PS See <URL: http://www.gnu.org/software/guile/manual/html_node/A-Sample-Gui
le-Main-Program.html#A-Sample-Guile-Main-Program>
[toc] | [prev] | [next] | [standalone]
| From | Matthew Carter <m@ahungry.com> |
|---|---|
| Date | 2015-02-27 00:48 -0500 |
| Message-ID | <87ioenrjl3.fsf@ahungry.com> |
| In reply to | #6826 |
Marko Rauhamaa <marko@pacujo.net> writes:
> RS Wood <rsw@therandymon.com>:
>
>> A Clojure inspired Lisp implemented in less than 1024 bytes of
>> JavaScript.
>>
>> [...]
>> Requires Node.js.
>
> Here's a complete Scheme implementation in mere 193 bytes of C:
>
> ========================================================================
> #include <libguile.h>
> static void inner_main (void *closure, int argc, char **argv)
> {scm_shell (argc, argv);}
> int main (int argc,char **argv)
> {scm_boot_guile(argc,argv,inner_main,0);return 0;}
> ========================================================================
>
> Requires libguile.so.
>
>
> Marko
>
> PS See <URL: http://www.gnu.org/software/guile/manual/html_node/A-Sample-Gui
> le-Main-Program.html#A-Sample-Guile-Main-Program>
I couldn't imagine writing code in the miniMAL language linked in the
thread start - so many double quotes and square brackets.
Nice link for libguile.
--
Matthew Carter (m@ahungry.com)
http://ahungry.com
[toc] | [prev] | [next] | [standalone]
| From | RS Wood <rsw@therandymon.com> |
|---|---|
| Date | 2015-02-27 13:23 +0000 |
| Message-ID | <mcpr4s$ah$2@solani.org> |
| In reply to | #6828 |
On 2015-02-27, Matthew Carter <m@ahungry.com> wrote: > Marko Rauhamaa <marko@pacujo.net> writes: >> PS See <URL: >> http://www.gnu.org/software/guile/manual/html_node/A-Sample-Gui >> le-Main-Program.html#A-Sample-Guile-Main-Program> > > I couldn't imagine writing code in the miniMAL language linked in the > thread start - so many double quotes and square brackets. > > Nice link for libguile. I wasn't familiar with Guile so my question was 'is Guile a Lisp derivative?' You might take issue with my choice of the word 'derivative' but here at least is what I found on that site: //--clip Guile is an implementation of the Scheme programming language. Scheme (http://schemers.org/) is an elegant and conceptually simple dialect of Lisp, originated by Guy Steele and Gerald Sussman, and since evolved by the series of reports known as RnRS (the Revised^n Reports on Scheme). Unlike, for example, Python or Perl, Scheme has no benevolent dictator. There are many Scheme implementations, with different characteristics and with communities and academic activities around them, and the language develops as a result of the interplay between these. Guileās particular characteristics are that it is easy to combine with other code written in C it has a historical and continuing connection with the GNU Project it emphasizes interactive and incremental programming it actually supports several languages, not just Scheme. //--clip
[toc] | [prev] | [standalone]
Back to top | Article view | comp.misc
csiph-web