Hacker News new | past | comments | ask | show | jobs | submit login
Lisp with GC in 436 Bytes (justine.lol)
173 points by behnamoh 3 months ago | hide | past | favorite | 24 comments



anything on justine.lol makes me feel like a single celled organism. weirdly it feels good. there's so many things in each project, which spirit can be applied to many things. also love the fact always previous projects and code are either used or referenced to explain things. i am only in awe each time something is posted.


Related:

Show HN: Lisp with GC in 436 Bytes - https://news.ycombinator.com/item?id=29630293 - Dec 2021 (131 comments)


Justne.lol would love "The Computational Beauty of Nature". It has a github repo, with references to Mandelbrot, more fractals, atractors, and, of course, a Lisp and building blocks.


How small could this be if it was implemented on the SectorLambda VM (a sister project)? http://justine.lol/lambda/


Check out https://github.com/woodrush/lambdalisp which was written for my Blc VM.


Why does brainfuck not count as a real language?


This is a hilarious takeaway from this writeup.


It's a toy language or esoteric language, designed to just have fun designing weird languages. The point of Brainfuck is to make it difficult to write programs so writing them becomes a "fun" challenge. In contrast Lisp is a real language designed to make writing useful programs easier, and has been used for decades to write real useful programs.


> Lisp is a real language designed to make writing useful programs easier

This implementation is the opposite of this goal. They explicitly eschew this in favor of making something small. So, no error messages, no printer, no macros, none of the things that make lisp "real."

To the extend that BF is not real then this implementation of lisp isn't real either.


I don't know anything about Lisp really but they claim it can run "real" Lisp, and have a demo. Are you saying this is a lie?


I challenge the definition of "real" as applied to _this_ implementation here.

It can run some programs made only of exceptionally limited forms. You can, of course, build the components like integer addition and subtraction yourself in the least efficient way possible; however, how is this any different from the situation in BF?

They themselves also say this: "The code above is a LISP within a LISP within a LISP: three levels. You can use this technique to implement missing features like macros."


I demonstrated in the blog post that SectorLISP can run real programs that John McCarthy and his crew wrote back in the 60's for his IBM 703 LISP 1.5 system. See https://justine.lol/sectorlisp2/proof.html where, with only light modifications to the original source code, I got his theorem prover working on SectorLISP, which uses Wang's algorithm. The original source code is here for comparison: https://justine.lol/sectorlisp2/wang.job.txt


It was written as an example for the LISP I Programmers Manual. The algorithm itself is not particularly powerful and this implementation can only return a singular true or false value. I wouldn't necessarily call this a "real" program as McCarthy was trying to demonstrate how to translate logical forms into s-expressions more than anything.

I'm not saying any of this to be critical of this team's implementation, more so to defend the notion that brainfuck is just as "real." Or, if brainfuck is "not real" then this particular implementation isn't for more or less the same reasons.


btw, thank you for this beautiful project.


The thing is, it wasn't used for developing and debugging the demo code.

In the Lisp world, there exist small interpreters whose only job is to boostrap implementations. They are not used for developing any of the code they run; it is assumed to be correct. Handling of conditions that don't occur can be left out.

Definitely, this has its place.


Right but nobody claimed this was a fully featured implementation, just that it can run a real language. Which it can.


It exists. It evaluates lisp code. Therefore it is real.


Brainfuck isn't maximizing difficulty, it's just a turing tarpit, maximizing a narrow definition of simplicity. If you want to see a language that maximizes difficulty, take a look at INTERCAL or Malbolge.


But brainfuck is Turing complete so you can bootstrap a LISP interpreter from brainfuck, thus making it "real"


That's really missing the point of this challenge.


I mean, the Lisp here technically uses the same approach - it runs just enough Lisp to boostrap the remaining functionality on top of what is provided.


It's excellent for teaching Turing completeness and Turing machines


Define "real"


It uses AT&T syntax. Yuck!




Consider applying for YC's W25 batch! Applications are open till Nov 12.

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

Search: