Live data from Hacker News

μLithp - a Lisp in 27 lines of Ruby

fogus.github.com

41–50 of 104 posts

Re: μLithp - a Lisp in 27 lines of Ruby

#42
post #37
post #27

Earlier quoted context omitted.

I'm not exactly a programmer. Could you explain how Lisp can be simple and powerful?

A lisp program's code can be manipulated by the program itself. Lisp programs are self-aware. It's a bit mind-bending, but from this simple foundation comes the power to easily create and assimilate ever higher-level abstractions (which is what programming is really all about). Parts of a program can be used as a template for creating other parts as needed. You can assemble these parts and shape the language into som…

Thanks for your explanation.

I know a bit about programming but it only comes down to PHP or jQuery variables, functions, and loops. Lisp looks very interesting and I had already heard about it (through pg obviously). It might just be the language that will fascinate me if I ever took programming more seriously.

Re: μLithp - a Lisp in 27 lines of Ruby

#43
post #5
post #3

I think this is a neat project and a nice demonstration of how Lisp-influenced Ruby is. However, whenever people post "Lisp in Ruby" stories, I always hope that it'll be a "Clojure in Ruby" implementation. I am surprised no-one has done it yet.

Apart from using the JVM, what is the advantage of Clojure over other Lisp dialects?

Clojure has cleaner syntax and matches the expectations of people used to languages that assume an underlying POSIX-like operating system.

Re: μLithp - a Lisp in 27 lines of Ruby

#45
post #35

Earlier quoted context omitted.

Why would anyone? Clojure runs on the JVM which supports native os threads, concurrent garbage collection, etc, for one thing. Different tools for different purposes.

The JVM also takes 100MB to startup a Web server. Maybe I want to use less ram?

[deleted]

Re: μLithp - a Lisp in 27 lines of Ruby

#46
post #37
post #27

Earlier quoted context omitted.

I'm not exactly a programmer. Could you explain how Lisp can be simple and powerful?

A lisp program's code can be manipulated by the program itself. Lisp programs are self-aware. It's a bit mind-bending, but from this simple foundation comes the power to easily create and assimilate ever higher-level abstractions (which is what programming is really all about). Parts of a program can be used as a template for creating other parts as needed. You can assemble these parts and shape the language into som…

> code=data

This is a really good explanation, and I just want to add a small bit to it, having had to use Lisp as a primary language quite recently due to some AI projects in cognitive modeling. One thing that I've found personally is that by understanding Lisp, you can essentially gain a deep understanding of every __other__ programming language.

If I had the chance to do my entire Computer Science career over again, I would have learned Lisp as my first language, and then compared every other subsequent language against it. Because of the deep symmetry between code and data, it is one of the easiest languages for implementing and re-implementing programming language features on top of.

Re: μLithp - a Lisp in 27 lines of Ruby

#47
Before this devolves into another farcical, Lisp arm-chair punditry: at 9 operators it's pretty much a kernel untyped lambda-calculus with pairs. And just that.

The implementation is as trivial as the concept is profound. The discussion should be about the lambda-calculus, not Lisp, which is a far more complex beast. And much less about Lisp dialects, Greenspun's, or the usual BS topics that invariably appear on any L-word thread.

Re: μLithp - a Lisp in 27 lines of Ruby

#49
post #47

Before this devolves into another farcical, Lisp arm-chair punditry: at 9 operators it's pretty much a kernel untyped lambda-calculus with pairs. And just that. The implementation is as trivial as the concept is profound. The discussion should be about the lambda-calculus, not Lisp, which is a far more complex beast. And much less about Lisp dialects, Greenspun's, or the usual BS topics that invariably appear on any…

If I had a little more time I would have written the uLithp eval in uLithp. The stark simplicity of that never fails to take my breath away.

Re: μLithp - a Lisp in 27 lines of Ruby

#50

Yeah, 27 lines. Unless you count the ~120 lines of sexpistol. https://github.com/aarongough/sexpistol

My s-expression reader is 34 lines. https://github.com/fogus/ulithp/blob/master/src/reader.rb

A minimal Lisp (the bare minimal) does not require sexprs though.

Post reply on HN