5 ms·
I think many people that don't like lisp haven't spent much time with it. I personally do not like lisp. I took an artificial intelligence class where we wrote
by blueblob 13y ago
I think many people that don't like lisp haven't spent much time with it. I personally do not like lisp. I took an artificial intelligence class where we wrote search techniques in common lisp. One problem that I had with lisp is the end of my A* search had a massive number of parenthesis at the end. I think this would have been a little better if we were taught about common lisp structs earlier on. My next big problem was that I was coming from C where you occasionally put extra parenthesis in to group portions of code (sometimes necessary in macros or if statements). This is a very bad habit in lisp because it tries to call a function.
- dllthomas 13y agoThere've been dialects of Lisp where a single ] would close all outstanding open parentheses. Having never actually used one, I reserve judgment on whether this is a good or bad idea.
- AUmrysh 13y agoI think, just like any other syntactic sugar, it's fine if used with proper understanding of possible consequences. I'd like to see lisp use indention instead of parens like Python. I'm sure someone's done it and it isn't popular for some reason or another, but I think getting rid of the parens would go a long way to making people stop hating LISP.
- blueblob 13y agoI don't see how lisp could get rid of parends with indentation. Parends are used for function calls so you would then have to indent one extra level to call a function? If there was a workaround for the function calls, then it would also require every function to be written on a separate line, there would be no concept of a one liner.
- dllthomas 13y agoBuilding a tree with indentation is easy. You would need some method to distinguish between a one element list and a value, and some method of specifying an empty list (though you could just write nil). One option that leaves everything completely uniform is to use something that says "this starts a list", and then have the (zero or more) elements indented including the list head if present. If we use (), this would read like: () prin1 () * () + 3 4 7 Exceedingly vertical, obviously, if you don't allow inline parens at all. If you were, you could compress any run of lines by simply moving everything with no children into the parent parens. Applying that only to the deepest bit of the above, we'd get: () prin1 () * (+ 3 4) 7 Of course, the original could be transformed into actual lisp by simply moving end-parens: ( prin1 ( * ( + 3 4 ) 7 ) )
- sparkie 13y agoIndeed. A workaround would be to introduce some infix operators (there are various lisps that do so), so you could use something like '$' for function application and end up with a syntax like Haskell. Of course, this is a terrible idea and very un-lispy, because one of the key benefits of lisp is that it's simple to parse. Introducing infix operators destroys that simplicity. Another workaround, which I quite like, is to simply remove all the "lisp syntax" entirely, and edit a tree directly using a syntax directed editor.
- hajile 13y agoSome people have played with this idea http://readable.sourceforge.net/ http://readable.sourceforge.net/ http://www.informatimago.com/develop/lisp/com/informatimago/small-cl-pgms/m-expression/ http://www.informatimago.com/develop/lisp/com/informatimago/... In fact (if you didn't know) lisp M-expressions using whitespace and indentation existed long before python (though the original M-expression syntax idea was based on FORTRAN). The reason M-expressions aren't used in place of S-expressions is because people using lisp preferred and continue to prefer S-expressions.
- adwf 13y agoI think it just became irrelevant at some point. Every decent Lisp editor since the 80's will automatically match parens for you, so I don't even notice them anymore, unless I specifically need to do something special with them. Then when you add in other little features that you can do in emacs, like fading the parens close to background colour when you're not working on them, highlighting when you are, etc... It all adds up to make the old "parenthesis hell" a bit nonsense. I sometimes imagine that there must've been a stage when universities forced people to write Lisp in Notepad or something, or by hand maybe. I can't imagine how much that would drive me insane!
- eropple 13y agoConsider that most people writing Lisp or Scheme for schools are probably not using great editors. When I took a class with Scheme, the recommended editor was GEdit or Notepad++. It wasn't until I switched to Kate that I had colored parens.
- adwf 13y agoThat's quite a scary thought. It's like trying to program with one hand tied behind your back and only your little finger to poke out the keys...
- hajile 13y agoThis is simply the ignorance of academics. What they SHOULD be recommending for these languages is Vim or EMACS with EVIL (got to keep sane keybindings somehow). The problem is that many programmers and academics today are unwilling to take the time to learn the right tools for the job.
- blueblob 13y agoboth gedit and notepad++ have plugins for colored parens.
- frou_dh 13y agoI've enjoyed coming up with a Lisp-ish toy language and implementing an interpreter for it. I haven't yet used any kind of Lisp for a real project (and may never), but getting a grip on its concepts has, and continues to be, interesting.
- AUmrysh 13y agoI'd really like to learn to implement a basic lisp in assembly. Do you know of any resources for doing this?
- frou_dh 13y agoSorry, no. I used Go.
- ericbb 13y agoHere are a few, in no particular order: Ur-Scheme: http://canonical.org/~kragen/sw/urscheme/ http://canonical.org/~kragen/sw/urscheme/ An Incremental Approach to Compiler Construction: http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf PicoLisp: http://picolisp.com/5000/!wiki?home http://picolisp.com/5000/!wiki?home Lambda-the-Ultimate papers: http://library.readscheme.org/page1.html http://library.readscheme.org/page1.html SICP: http://mitpress.mit.edu/sicp/full-text/book/book.html http://mitpress.mit.edu/sicp/full-text/book/book.html LiSP: http://www.amazon.com/Lisp-Small-Pieces-Christian-Queinnec/dp/0521545668 http://www.amazon.com/Lisp-Small-Pieces-Christian-Queinnec/d... Maru: http://piumarta.com/software/maru/ http://piumarta.com/software/maru/ Edit: You might also enjoy Jonesforth (see jonesforth.S): http://git.annexia.org/?p=jonesforth.git;a=tree http://git.annexia.org/?p=jonesforth.git;a=tree
- sparkie 13y agoI can imagine people not liking lisp if they've used a dumb text editor to try writing it, but if using something a bit more intelligent like ParEdit+emacs, the closing parens become a non-issue, they're added for you, and you're given a nice set of commands to navigate around s-expressions.
- angersock 13y agoThere is a point beyond which the syntax of a language becomes unforgivable, even if you have an IDE to make it more palatable. Java, for example, is completely awful to write (I find) without the use of Eclipse or some similar tool. C and Ruby, by contrast, I'm happy to hack on in Vim.