Hacker News new | past | comments | ask | show | jobs | submit login
ToriLisp – an ersatz Lisp for tiny birds (fogus.me)
71 points by grzm on Jan 1, 2021 | hide | past | favorite | 15 comments



This 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


Tori here seems to be the Japanese word, meaning bird, which has the kanji 鳥, used in the interpreter examples.


I'm disappointed this isn't literally a tool to communicate with birds, or alternatively a programming language designed for birds. Looks lovely though.


I think you are looking for https://github.com/chirp-language ;-)


Are 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.



I highly recommend people check out Alexis’ other projects too. An excellent programmer, and great writer.

https://lexi-lambda.github.io


Hey Michael, very cool!

I liked the support for currying (where you mapped the partial function (+ 10)).


Yeah, 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:


I 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.


Even cooler: defining a function (and block) relies on currying. I think it's just syntax sugar.


Hm.

    鳥>  (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 ]

?


The 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.


JS does have Symbols but they are relatively modern: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...


As 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: