Hacker News new | ask | show | jobs
by cheez 2479 days ago
They used Lisp to generate machine code. They didn't parse lisp at all. Imagine writing a library in your favorite language to do what they've done.
1 comments

They did parse it, albeit indirectly, by Racket’s reader. Co2 is a language, not a bunch of function calls, so it’s not quite the same as building a library in your favorite language. The article even gives examples of new syntax they produced.

Parsing Lisp in Lisp is so easy because it’s free.

you just need to implement read-syntax ...
I wasn't being sarcastic, it was very simple the way they've done it. https://docs.racket-lang.org/reference/Reading.html#%28def._...
I'm saying that there is a larger machinery behind it. It just looks simple.
Well ok but then technically a hello world is complex for the same reasons
> Parsing Lisp in Lisp is so easy because it’s free.

You just have to implement an s-expression reader.

Plus an interpreter, compiler or a code walker, which can actually parse the Lisp code.

> Parsing Lisp in Lisp is so easy because it’s free.

Are there any other languages that have this feature? I.E. where the data and the code are the same syntax?

Well, if there is new such language then it would be eventually called a lisp dialect.
Rebol springs to mind.