4 ms·
I strongly concur with this. I'd like to point a very specific thing out, which you only implicitly refer to: homoiconicity Anything else, you can pretty mu
by btschaegg 9y ago
I strongly concur with this. I'd like to point a very specific thing out, which you only implicitly refer to:
homoiconicity
Anything else, you can pretty much bolt onto any other language, but that will never happen with homoiconicity. The language has to be built with it in mind, or you won't get it. Ever. It boggles my mind that there are almost no non-lisp-like languages that try to do this. If I had to guess, I'd assume that any language like this that could have been concieved was so similar to Lisp that it just wasn't worth reinventing the wheel.
It still makes me wonder though - here we are, the concept is 50 years old, and we're still bolting lexers together.
- kamaal 9y agoI think Perl 6 has this concept of using the language to modify itself. Not exactly through homoiconicity, but the concept is somewhat similar.
- b2gills 9y agosub infix:<d> ( $count, $faces ) { (1..$faces).roll($count) } # from this point on the language has changed to have a # new infix operator say 5 d 20; # (13 5 3 3 14) The Rakudo implementation also has macros and Slangs which are more powerful, but we want it to have a better interface; so they are not part of the Perl 6 spec yet.
- kazinator 9y agoHomoiconicity just means that procedures are stored in the same representation in which they are entered, or nearly (modulo tokenization and such). It was defined that way by the programmer who coined the term in the 1960's, and is well documented in the Wikipedia. POSIX shells are homoiconic; you can type set to see all the functions, which are printed in reformatted source code, that you can copy and paste. That could work in any interpreted language. Classic line number BASIC is homoiconic. You can LIST the lines of code. A Lisp is useful even if it isn't homoiconic (functions cannot be edited). ANSI Lisp has some loosely defined support for homoiconicity via the ed function. This isn't used much; actual Lisp environments have other means to recall and edit a function definition, such as an IDE with buffers or REPL with history. The term homoiconic doesn't really "nail it" when it comes to Lisp.