4 ms·
ToriLisp – an ersatz Lisp for tiny birds
- sillysaurusx 6y agoI'm disappointed this isn't literally a tool to communicate with birds, or alternatively a programming language designed for birds. Looks lovely though.
- felixr 6y agoI think you are looking for https://github.com/chirp-language https://github.com/chirp-language ;-)
- randallsquared 6y agoHm. 鳥> (read "(push [1] 'Z)") ;;=> [ "'push", [ "'list", 1 ], [ "'quote", "'Z" ] ] 鳥> (eval (read "(push [1] 'Z)")) ;;=> [ "'Z", 1 ] ...shouldn't the last line be either ;;=> [ 'Z, 1 ] or ;;=> [ [ "quote", "'Z" ], 1 ] ?
- akkartik 6y agoThe results are always Javascript literals. Javascript doesn't have symbols. So symbols are represented as strings starting with a single quote. Mildly confusing but seems easy to pick up.
- fogus 6y agoAs mentioned, JS does have Symbols and I started the language using them but moved away. At the moment symbols are encoded as "'foo" but I may change the prefix to something less confusing at a glance.
- zeckalpha 6y agoJS does have Symbols but they are relatively modern: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Symbol https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- felixr 6y agoThis title really confused me. First I read Tori as Tory. Then I did not realize that 'ersatz' has a slightly different meaning in English than it has in German. In German it just means replacement, so I was wondering what it would replace. And finally I did not get what 'tiny birds' are in this context. Can anyone enlighten me? [0] https://en.wikipedia.org/wiki/Tory https://en.wikipedia.org/wiki/Tory
- karatinversion 6y agoTori here seems to be the Japanese word, meaning bird, which has the kanji 鳥, used in the interpreter examples.
- mark_l_watson 6y agoHey Michael, very cool! I liked the support for currying (where you mapped the partial function (+ 10)).
- hencq 6y agoYeah, the automatic currying looks very nice. I was wondering how that works with optional arguments or rest arguments. At first glance I didn't see anything about that in the tutorial. It seems to me as a layman that auto-currying can only work with fixed arity functions, but I'm curious if that's indeed the case. Edit: I scanned the docs too quickly. It's answered there: > Unlike many Lisps, TL functions always expect a fixed number of arguments. For example, the + function shown above expects to receive 2 arguments and if it receives too many then and error occurs:
- akkartik 6y agoEven cooler: defining a function (and block) relies on currying. I think it's just syntax sugar.
- bjoli 6y agoI am of the opposite view. Mostly because I am world champion at forgetting to apply a function with enough arguments. I think partial applivation should be explicit, at least in dynamic languages where this is not enforced at compile-time.
- thurn 6y agoAre there any good examples of these minimal lisps which include typechecking? I'd personally like to learn more about incorporating that aspect, but it seems fairly uncommon.
- zeckalpha 6y agoHackett: https://github.com/lexi-lambda/hackett https://github.com/lexi-lambda/hackett Based on this paper: http://www.ccs.neu.edu/home/stchang/pubs/ckg-popl2017.pdf http://www.ccs.neu.edu/home/stchang/pubs/ckg-popl2017.pdf
- girvo 6y agoI highly recommend people check out Alexis’ other projects too. An excellent programmer, and great writer. https://lexi-lambda.github.io https://lexi-lambda.github.io