Little Lisp interpreter
21–30 of 49 posts
Re: Little Lisp interpreter
#22Is there some reason why every code segment inside not one but two scrolling frames? And does anyone else dislike web design that (1) limits the text to a column a third of the page wide, and then (2) because this is too small, requires a horizontal scrollbar on code segments? For an explanation of a small Lisp interpreter (in Python) that uses sane web design, one might consider Norvig's http://norvig.com/lispy.html
I agree this page should be wider for posts like this.
Re: Little Lisp interpreter
#23Who needs a toy lisp? Can't we just lisp for real? Edit: Ok, ok. Now that the title of submission has been changed from "Toy Lisp Interpreter" to "Little Lisp Interpreter" my quip, having lost context doesn't make me smile anymore either.
Re: Little Lisp interpreter
#24This is the best beginner project.
Re: Little Lisp interpreter
#25Who needs a toy lisp? Can't we just lisp for real? Edit: Ok, ok. Now that the title of submission has been changed from "Toy Lisp Interpreter" to "Little Lisp Interpreter" my quip, having lost context doesn't make me smile anymore either.
As a learning experience is excellent. Lisp family languages are great for this since they are turing complete and with a pretty simple syntax.
Re: Little Lisp interpreter
#26Re: Little Lisp interpreter
#27Lisp implementation from one of the julialang devs
Re: Little Lisp interpreter
#28I think more useful for me would be "How to build a complex system and not accidentally write a toy Lisp interpreter".
(Last time I tried the latter the more vocal members of the user base complained so much the entire effort died. That was in 2000.)
Re: Little Lisp interpreter
#29Re: Little Lisp interpreter
#30https://github.com/breckinloggins/erlisp
I'm currently working on writing one in Haskell using the Scheme48 tutorial [1], though I'd eventually like to replace the evaluator with an F-Algebra[2] so I can learn about that.
https://github.com/breckinloggins/scheme48
As a side note, would any Haskellers be willing to look at the abstraction I did for parsing #-forms? I created an adhoc data structure:
hashLiteralInfo = [
('f', (Nothing, \_ -> Bool False)),
('t', (Nothing, \_ -> Bool True)),
('b', (Just $ many $ oneOf "01", Number . toInteger . fromBase 2)),
('o', (Just $ many $ oneOf "01234567", Number . toInteger . fromBase 8)),
('d', (Just $ many $ oneOf "0123456789", Number . toInteger . fromBase 10)),
('h', (Just $ many $ oneOf "0123456789abcdefABCDEF", Number . toInteger . fromBase 16))
]
And then the parser consumes that: parseHashLiteral :: Parser LispVal
parseHashLiteral = do
char '#'
c fail "Internal parse error: unregistered literal info"
Just (Nothing, f) -> return $ f "unneeded" -- I know there's a more idiomatic way to do that
Just (Just literalParser, f) -> do
digits
This works and is "abstracted", but doesn't feel idiomatic. Thoughts?[1] http://en.wikibooks.org/wiki/Write_Yourself_a_Scheme_in_48_H...
[2] http://bartoszmilewski.com/2013/06/10/understanding-f-algebr...