Re:Sild is a Lisp dialect
by kaosjester on Tuesday June 07, 2016 @01:49AM
(#11852644)
I'm pretty familiar with various approaches to implementing Lisp / Scheme, and seeing projects like this is almost heartbreaking. What's been done here (which I might call the "mechanical" approach to implementing Scheme) seems to attempt to emulate an underlying LISP machine instead of emulating the language itself, and that's fundamentally problematic because, for the most part, that's the wrong abstract machine. If the author took the time to work through the first four or five chapters of SICP, they'd have the knowledge to construct a much cleaner machine (based on CEK) that would, ultimately, end up far more performant and faithful to the end-goal semantics. All of this mucking about with allocation and free-cells for expressions and the like is orthogonal to building a LISP interpreter in C. (And, if the author is really interested in that sort of thing, the LISP machine is well-documented.)
If anyone else is interested in starting a project like this, getting down and dirty, I'd urge you to start with the first part of SICP and then move into Dybvig's dissertation (at http://agl.cs.unm.edu/~williams/cs491/three-imp.pdf), which directly and plainly describes multiple approaches to producing efficient, reliable Scheme implementations.
(Also, why doesn't this link to the Github page instead of the blog?)
Re:Sild is a Lisp dialect
by kemitchell on Tuesday June 07, 2016 @02:56AM
(#11852851)
I hear you on prior art. But for who does your heart break? What is here that you'd like to discourage?
Those interested in getting down and dirty are highly unlikely to suspend that impulse for MIT's old intro text and a dissertation from 1987. The author apparently rewrote this three times; so says README. Nothing lofty or pristine, precious as it may be, slots in for that experience.
A state of the art impl it isn't, but we all know where to find those. But I suspect the state of the author's art has improved markedly by the exercise. Maybe if we encourage him, he'll rewrite a few more times, and come up with something wonderful and strange. Maybe it will be a Scheme. Maybe it won't.
Re:Sild is a Lisp dialect
by jfo on Tuesday June 07, 2016 @11:14AM
(#11855033)
Author here. Thanks for this comment, as I said in the post this is exactly the kind of feedback I want.
I had read the first half or so of SICP before I started this project, but can't say that I really "got" it. Certainly a lot of lightbulbs had gone off, but I still had the feeling I was missing something. This project (and the two attempts that preceded it) was started with the knowledge that I didn't really know what the hell I was doing, at all. Each iteration got a little bit better and filled in more and more gaps. This is the first one that I can say is "done" in any meaningful sense, though there is a lot still to do if I ever wanted to make it useful or even reasonably performant (GC, TCO, etc...) . I fully intend to explore the concepts involved whether by implementing them into this language or by starting from scratch again, which I am definitely not above!
I agree that a lot of the mucking in this program isn't directly related to building a good scheme/lisp, but it was definitely relevant to my other main goal of becoming more proficient in C. I can report that that was a real success; I learned more about C from this than almost anything else I had done prior.
I will read that paper with interest, thank you for the link!
Re:Sild is a Lisp dialect
by DigitalJack on Tuesday June 07, 2016 @01:53AM
(#11852659)
I love projects like this. I'm a chip designer, and I feel very comfortable at that level, and low level programming like assembly. I used to be comfortable in C back in the day.
These days I feel like I don't have time for the nitty gritty details of programming anymore and only work in Clojure (with occasional forays into other languages to see "how goes the world").
I have a large intellectual gap between logic gates, assembly and a high level language like a lisp. I'd really like to attempt a project like this some day, but I mostly feel like those days are behind me.
Re:Sild is a Lisp dialect
by DigitalJack on Tuesday June 07, 2016 @12:50PM
(#11855740)
Now that's interesting. I believe I did come across this years ago, possibly before I started with clojure... I'll have to go through it again and see if I get more out of it now that I've been working with a lisp for a while.
Re:Sild is a Lisp dialect
by DigitalJack on Tuesday June 07, 2016 @11:43AM
(#11855234)
It's mostly recreational. I use it for my day job when I can though. I've got one internal project that makes heavy use of Clojure, but I'm sure I'll have to port it to python before releasing to the department just to make it less "scary" to the other hardware people.
I did a test port of part of the program early on. That was pretty eye opening. I hadn't realized how used to Clojure's immutable data structures I had become. That and working in a mostly side-effect free fashion.
I was transliterating to python, so I ended up doing some goofy things to keep my functions from having side effects on all the data structures passed in. Writing from scratch would have been fine, but I don't want to take the time. Plus someone else can take the transliterated version and re-write in a pythonic way.
Re:Sild is a Lisp dialect
by pklausler on Tuesday June 07, 2016 @11:54AM
(#11855319)
Recommendation: please go read Simon Peyton-Jones' "The Implementation of Functional Programming Languages". It's highly accessible, assumes little prior knowledge, and reads pretty quickly. Its focus is on non-strictly evaluated systems like Miranda and Haskell, but go read it anyway.
Re:Sild is a Lisp dialect
by jackdaniel on Tuesday June 07, 2016 @04:35AM
(#11853168)
Common Lisp is an ancestor of LISP and is more active every year. It puts its eggs in a "pragmatism" basket. Very good introductory book "Practical Common Lisp" by Peter Seibel[1].
Scheme is a lisp made from scratch. It bets on clarity, functional programming, minimalism and elegance. There is a perfect introductory book "Structure and Interpretation of Computer Programs"[2] which is a worth read even if you don't want to program in Scheme in the future.
I haven't used Clojure, but from what I've heard it's a modern functional lisp which bets on parallelism and interop between environments.
There are more lisp dialects like PicoLisp, but I know about them even less than about the Clojure, so you'll have to investigate options by yourself. I'm a Common Lisp programmer, so I can recommend that – "the profound enlightenment experience", as Eric Raymond put it.
Re:Sild is a Lisp dialect
by jackdaniel on Tuesday June 07, 2016 @11:56AM
(#11855343)
I know that Racket is so much more right now, but I've put it in the "Scheme box" in my mind. Is it technically incorrect to treat Racket as Scheme on batteries?
Re:Sild is a Lisp dialect
by baldfat on Tuesday June 07, 2016 @01:16PM
(#11855931)
Absolutely. It really is "A Programing Language for Programing Languages" It is an excellent environment for defining well contained scheme subsets and other languages and using them seamlessly. But Racket has become its own beast and is very different from Scheme now and the reason for the name change from Scheme PTL.
Re:Sild is a Lisp dialect
by zdkl on Wednesday June 08, 2016 @06:46AM
(#11861304)
In a lot of ways, Clojure feels like the python of lisps. It pretends (very well I must say) to be dead simple but lets you get into "the nitty gritty details of programming" as another commenter put it, if you need to/know how.
Re:Sild is a Lisp dialect
by sklogic on Tuesday June 07, 2016 @04:21AM
(#11853127)
For handling function call frames you may consider compiling your Lisp code a bit before interpretation - do an explicit lambda lifting with an explicit closure allocation. This way you'd be free to kill each frame after a call.
If anyone else is interested in starting a project like this, getting down and dirty, I'd urge you to start with the first part of SICP and then move into Dybvig's dissertation (at http://agl.cs.unm.edu/~williams/cs491/three-imp.pdf), which directly and plainly describes multiple approaches to producing efficient, reliable Scheme implementations.
(Also, why doesn't this link to the Github page instead of the blog?)
Those interested in getting down and dirty are highly unlikely to suspend that impulse for MIT's old intro text and a dissertation from 1987. The author apparently rewrote this three times; so says README. Nothing lofty or pristine, precious as it may be, slots in for that experience.
A state of the art impl it isn't, but we all know where to find those. But I suspect the state of the author's art has improved markedly by the exercise. Maybe if we encourage him, he'll rewrite a few more times, and come up with something wonderful and strange. Maybe it will be a Scheme. Maybe it won't.
I had read the first half or so of SICP before I started this project, but can't say that I really "got" it. Certainly a lot of lightbulbs had gone off, but I still had the feeling I was missing something. This project (and the two attempts that preceded it) was started with the knowledge that I didn't really know what the hell I was doing, at all. Each iteration got a little bit better and filled in more and more gaps. This is the first one that I can say is "done" in any meaningful sense, though there is a lot still to do if I ever wanted to make it useful or even reasonably performant (GC, TCO, etc...) . I fully intend to explore the concepts involved whether by implementing them into this language or by starting from scratch again, which I am definitely not above!
I agree that a lot of the mucking in this program isn't directly related to building a good scheme/lisp, but it was definitely relevant to my other main goal of becoming more proficient in C. I can report that that was a real success; I learned more about C from this than almost anything else I had done prior.
I will read that paper with interest, thank you for the link!
(The blog was what got submitted, tells the story of the project, and links to the Github page, so I think it's fine.)
I'm going to go with: Eastern Khumi language (ISO 639-3: cek), Kukish language of Burma
https://en.wikipedia.org/wiki/Eastern_Khumi_language
These days I feel like I don't have time for the nitty gritty details of programming anymore and only work in Clojure (with occasional forays into other languages to see "how goes the world").
I have a large intellectual gap between logic gates, assembly and a high level language like a lisp. I'd really like to attempt a project like this some day, but I mostly feel like those days are behind me.
http://repository.readscheme.org/ftp/papers/ai-lab-pubs/AIM-...
I did a test port of part of the program early on. That was pretty eye opening. I hadn't realized how used to Clojure's immutable data structures I had become. That and working in a mostly side-effect free fashion.
I was transliterating to python, so I ended up doing some goofy things to keep my functions from having side effects on all the data structures passed in. Writing from scratch would have been fine, but I don't want to take the time. Plus someone else can take the transliterated version and re-write in a pythonic way.
(EDIT: Link to free copy from the author: http://research.microsoft.com/en-us/um/people/simonpj/papers...)
Cool project, I'll have a look at it!
Scheme is a lisp made from scratch. It bets on clarity, functional programming, minimalism and elegance. There is a perfect introductory book "Structure and Interpretation of Computer Programs"[2] which is a worth read even if you don't want to program in Scheme in the future.
I haven't used Clojure, but from what I've heard it's a modern functional lisp which bets on parallelism and interop between environments.
There are more lisp dialects like PicoLisp, but I know about them even less than about the Clojure, so you'll have to investigate options by yourself. I'm a Common Lisp programmer, so I can recommend that – "the profound enlightenment experience", as Eric Raymond put it.
[1] http://www.gigamonkeys.com/book/
[2] https://www.mitpress.mit.edu/sicp/full-text/book/book.html
You probably mean a descendant
And in English!