4 ms·
I can probably answer the LISP question; the Core LISP Languages is incredibly simple. It has only 8 or so keywords you really need and 5 syntax forms (probably
by tscs37 10y ago
I can probably answer the LISP question; the Core LISP Languages is incredibly simple. It has only 8 or so keywords you really need and 5 syntax forms (probably wrong, I don'T have the exact numbers in my head)
It comes with very few special forms and makes no difference between a variable, function or macro. Everything is same-y.
- zeveb 10y ago> It comes with very few special forms and makes no difference between a variable, function or macro. Everything is same-y. That's true of Scheme, not Lisp (Lisp has rather more special forms, and definitely makes distinctions between variables, functions and macros), but it is indeed why Scheme is so popular in compiler classes.
- tscs37 10y agoYou're right, I always confuse the many forms of LISP to some certain degree...
- DonaldFisk 10y agoScheme is a Lisp. Lisp is nowadays a language family, built upon a common core: both programs and data are nested lists of symbols; the interpreter executes by recursively calling eval and apply functions.
- duaneb 10y agoI think you mean lisp-1 (or something). Lisp as a whole is a, erm, genus of languages.
- kazinator 10y agoYeah, if you ignore the reader, garbage collector, hash table implementation, vectors, object system, stack unwinding, representation of closures, etc, etc. all you're left with is a handful of special forms. Unicode support? Why, practically just a footnote; leave that to the summer students.
- tscs37 10y ago>Reader Not quite sure what you mean there. If you are talking about the Lexer, it's also rather simple since LISP doesn't need lookahead. Everything is in prefix notation. >Garbage Collector Which can be incredibly simple since you only have the persistent global scope and the list local scope, so you only discard data that goes out of scope. There are no references Heck, you could probably just write the Garbage Collector in LISP too. >Hash Table LISP-family languages usually aren't called LISP for being Hash Table Processors. There are only lists. >Vectors, Object System, Stack Unwinding, Closures Not needed either, you can macro Vectors, you can macro the Object System, you have lists, not a stack and closures are a basic property of the language last I checked. >Unicode --------- LISP is a rather simple language since you can write a macro for almost everything, a minimal implementation only needs a couple keywords. Object Systems are usually implemented via macros. It is special because after implementing a minimal set, you can program the language itself to provide the rest. And I'd like you to name another language that is not assembler or original BASIC where you would not have to implement all this stuff while remaining as simple and expressive as LISP. I don't think you really need any of this complicated 1960s and later stuff. LISP is the second oldest programming language, it's really not complex.
- lispm 10y ago> Not quite sure what you mean there. The Reader is the thing which reads the many Lisp data structures: lists, symbols, floats, integers, strings, characters, vectors, arrays, structures, ... > Which can be incredibly simple since you only have the persistent global scope and the list local scope, so you only discard data that goes out of scope. There are no references Lisp has references. > Heck, you could probably just write the Garbage Collector in LISP too. Basically you can't. > LISP-family languages usually aren't called LISP for being Hash Table Processors. There are only lists. All Lisp have hash-tables since decades. Internally the symbol table is a hash-table in most Lisp implementations. > Not needed either, you can macro Vectors, you can macro the Object System, you have lists, not a stack and closures are a basic property of the language last I checked. You can't. You don't see to know what a macro is. If you only have linked lists, you can't make vectors. No macro will help you with that. > Object Systems are usually implemented via macros. They aren't. Object systems are a mix of new data structures, functions and some macros. In Common Lisp, the CLOS system is a layering of data structures, functions and only at the top are macros. Parts of CLOS then are defined in itself. > It is special because after implementing a minimal set, you can program the language itself to provide the rest. But it is not done that way. You won't implement arithmetic as a macro. > while remaining as simple and expressive as LISP. Once you have all that, Lisp is no longer simple. > LISP is the second oldest programming language, it's really not complex. Check the recent Scheme standard for some entertainment.