6 ms·
It's about a month since I've started seriously diving into lisp. The last couple of weeks I've spent my days reading 'The joy of Clojure', Structure and Inter
by codeshaman 12y ago
It's about a month since I've started seriously diving into lisp.
The last couple of weeks I've spent my days reading 'The joy of Clojure', Structure and Interpretation of Computer programs, lots of tutorials and documentation, playing around in the repl + experimenting with all kinds of frameworks and libs in clojure (eg. Om).
I've spent today implementing the brainfuck interpreter in Racket.
I can't explain it, it's like something is calling me - 'learn lisp. now.'.
Given the amount of Lisp code read/written and the relative novelty of it, I'm dreaming lisp code and the arguments to functions are actual physical things, which are then mapped, reduced, recursed or expanded.
Literally, I think I'm going crazy.
I can fluently write x-platform C++, Javascript/CoffeeScript, Objective-C, Java, Pascal, VB and everything in between.
But never have I experienced this kind of mental strain/obsession as I do now with lisp.
But.
Seems like I'm not alone! Given the amount of lisp news lately on HN,
I fell like more and more people are going through what I'm going.
Seems like we here on HN follow a common mental pattern and suddenly everyone's talking/learning lisp.
As interesting as learning lisp is, this 'group preference' thing is even more interesting to observe.
- vidarh 12y agoIt's not so sudden. HN itself is written in a LISP [1], and Paul Graham's pre-YC claim to fame was Viaweb, a store platform written in LISP that became Yahoo Stores. This community has been above-average LISP friendly for a long time. LISP's also has a long history of popping up all over the place because they are extremely implementation-friendly (if you want to write a simple language; if you want to make things fast they get trickier, thought by no means impossible) given the simple syntax. So you'll also find a lot of people (like me) who don't really like LISPy languages, but who still end up dabbling with related technologies occasionally (my very-slowly-in-progress Ruby compiler uses s-expression syntax (though no LISP semantics to speak of) to express a tiny language to implement some of the lower-level plumbing to bootstrap the Ruby core classes, for example) [1] http://arclanguage.org/ http://arclanguage.org/
- Adlai 12y agoIt's spelled 'Lisp'. There has been zero overlap between people writing "LISP" and people writing lisp code for about half a century.
- juliangregorian 12y agoThat's really overstating it, especially seeing as Lisp has barely existed for half a century, and people like ESR call it "LISP" to this day.
- na85 12y agoAFAIK the allcaps "LISP" fell out of favour in 1984 when Common Lisp was introduced, and only the original Lisp implementation and Mac Lisp used the allcaps name. Much like Fortran (no longer FORTRAN), the acronyms became proper names in their own right.
- waterhouse 12y agoSomeone pointed out that Common Lisp is case-insensitive by default, so really they have no grounds to object to the name LISP. ;-)
- na85 12y agoEnglish is the relevant rule set here, not Lisp :)
- Adlai 12y agoThe CL reader by default[1] converts unescaped characters to uppercase, but only when parsing tokens. The CL printer by default[2] converts everything it prints to lowercase. CL people seem to adopt these conventions as well, although they have been known to :capitalize Lisp on occasion. [1] http://l1sp.org/cl/2.2 http://l1sp.org/cl/2.2 [2] http://l1sp.org/cl/*print-case* http://l1sp.org/cl/*print-case*
- lispm 12y agoCL-USER 30 > (eq '|LISP| '|Lisp|) NIL Common Lisp knows very well the difference between LISP and Lisp
- bsder 12y ago> LISP's also has a long history of popping up all over the place because they are extremely implementation-friendly This is a LIE. I get tired of hearing this over and over. Broken Lisps are easy to implement. Try implementing a real s-expression parser in C. I'll wait. For example, this library: http://sexpr.sourceforge.net/ http://sexpr.sourceforge.net/ takes 5000+ lines of code. And it doesn't even handle dotted pairs! (For good reason, handling dotted pairs without recursion is extremely difficult.) I have written entire languages in that number of lines. So, have many others. Lisp does not count as small.
- swhipple 12y agoI'll be the first to agree with you that most 'minimal' lisp implementations are going to be missing important features (efficiency, memory management, ..), but is the parsing of s-exprs comparatively a difficult task? At just a glance, it appears that the library is slurping the expression and avoiding recursion instead optimizing for speed, memory usage, and error reporting, but it seems like you could implement a recursive descent parser if you weren't as concerned with those. If the author took their same approach to parsing s-exprs for a grammar like C, I'm not sure how successful they would be. I haven't really looked at grammars / compilers in a long time, but I'm curious if I'm off-base in thinking s-exprs are relatively easy to parse. Some grammars like brainfuck or assembly would obviously be easier.
- gjgggk3 12y agoThere is nothing difficult about writing an s-expression parser. None of the plethora of Scheme interpreters out there get parsing wrong. Handling dotted pairs is rather trivial compared to, say, getting hygienic macros right. Or implementing call/cc. Quasiquote handling is not even that difficult.
- bsder 12y ago> There is nothing difficult about writing an s-expression parser. Really? Try it in C. The Scheme interpreters do very limited dotted-pair parsing until they bootstrap into scheme. There is a good reason for this. And this is before we even start dealing with things like circular references.
- PopsiclePete 12y agoEvery once in a while, I like to sit with a cup of hot tea or coffee, in my bathrobe, in read about Clojure. Algorithms, ideas, data structures - it's so .... just...clean and well thought out. There's something really nice about LISPs, and it's drawing me into it as well. I still do C#/Javascript/Java/whatever in my day job, but LISP is just...sexy. And for those that hate parens - Emacs paredit. Nuff said.
- striking 12y agoReminds me of this article: http://www.lambdassociates.org/blog/bipolar.htm http://www.lambdassociates.org/blog/bipolar.htm
- codeshaman 12y agoYes. I've read that article several times. I fit the description perfectly and I think it's one of the reasons I'm learning lisp now. It might be of use for the huge project that I'm about to start in the near future. I don't like the dark side, I hate to see all the beauty I create when I'm 'high' dribble through the impotent hands of the dark periods. But I've come to accept that this is how I am and always will be. My only way out of the hole is to try and steer clear of addictions and learn new stuff. Since I can't do anything of practical use during this period - nothing is exciting, the world is going to hell, I'm a failure and cannot do it, etc, I use the time to learn new stuff, read books on every possible subject and just try not to be too big of a drag on those around me. I've been here multiple times and I know that each 'down' period is followed by a rush of energy and creativity and I have to be prepared with knowledge and health so that I can apply it during my 'mental spring'. This is how I've created great stuff before and I will in the future. At least this is my hope. At the moment, learning lisp is a kind of psychotherapy that I apply to myself and it seems to be working, even though I have no idea what to do with that knowledge, it will soon all make sense.
- elliptic 12y agoThe GP article seems like self-congratulatory fluff. So, just to be clear, what you're saying is that you're brilliant and this is a problem?
- codeshaman 12y agoWhatever 'brilliant' is supposed to mean, when I try to apply that adjective towards myself I'm immediately reminded about the numerous times I've felt humbled by someone else's infinitely higher brilliance (be it a book, source code, mathematical expression, song, poem, movie, etc) and then I just feel stupid for trying to place myself even close to those I so deeply respect. Brilliant is impossible to be, what we can hope for is moments of 'brilliance', where one can come up with original solutions to problems. Ideas, revelations.. I do have those from time to time and it feels great. But as a human being, it does matter what and how you feel in between those moments of brilliance. And during a 'low' phase (which can last months, day after day), all your moments of brilliance are replaced with mental blocks, melancholy, cynicism and pessimism about everything and everyone. It's a very bad place to be, it's painful, the feeling of being a fraud, the way you disappoint yourself and others by not following through, the way you see your dreams and hopes drown in a sea of confusion and frustration. When everything you've earned/gained is slowly erased and you have to start again from step 1. Yeah, I think that's a problem. You either kill yourself, drink/drug yourself to death or find a way to cope with it. My solution is to just obsess on books/studying new stuff when the mental winter comes and try to stay away from the easy escapes.
- agumonkey 12y agoWhen you start to reach to point where metalevel, evaluation, transformation, compilation all fit into your mind you feel even weirder.
- markc 12y ago>But never have I experienced this kind of mental strain/obsession as I do now with lisp. That's why it's so valuable as a right of passage. If you've spent your career writing simple iterative imperative loops, suddenly you're a newb again with map/filter/reduce this, partial that, and recursion and lambdas and closures and finally after your 20th time staring, dazed at 3 measly lines of nested composed recursion - it all starts to flow, and boom, you have a new way of approaching every problem. And even if you don't live in the lispy functional realm after that you'll always be better off for having crossed that threshold.
- Dewie 12y ago* rite of passage
- eru 12y agoTry typed functional languages next. You'll be a newbie again.
- bunderbunder 12y agoIndeed. The language that would eventually become Racket was my first true love, but my first encounters with the ML family were revelatory as well. I'm wondering, though, if I should go back to Racket again and see if there's anything new to learn there now that I'm older and more used to infix notation. Knowing me, though, I'll probably just recklessly abuse hygienic macros until the sun burns out.
- cicero 12y agoVery true. I got into Racket three years ago and had an experience similar to the OP. Then I did some Clojure and I loved the data structures and destructuring, but I'm not too fond of the Java bits, although I understand the benefits. Now I'm learning Haskell, and it's another world again. I'm glad I took the route I did because the Haskell is coming a lot easier than it would have without the Racket/Clojure background. Right now I'm converting some old Clojure code from a couple of years ago into Haskell, and I much prefer the Haskell static type checking to the dynamic typing of Clojure. I still have a lot more to learn to get my Haskell powers up to what I could do in Clojure, but I think it's worth the work.
- wz1000 12y agoI went through a Lisp phase exactly like that. Currently I'm going through an extremely similar Haskell phase. I've learnt half a dozen languages before these two, but I've never experienced the satisfaction and obsession I've experienced with these two. My Lisp phase went on for the better part of a year, and I've been learning all the Haskell I can for 11 months now, but my obsession is still in full force. Haskell also turned me towards maths, and now I'm reading a book about category theory and a book about type theory.
- codeshaman 12y agoYeah, I feel that Haskell might also have this ability to energise a bored mind. The purity, the cleanliness, the power. Definitely on my list. This year, though, I feel will be the year of the 'great lisp project' for me.
- patrickmclaren 12y agoMy first exposure to Lisp was through a combination of Hacker News, SICP, and Paradigms of Artificial Intelligence. Also, there may have been a blog post by one of the Posterous (or a similar company) guys about getting started with SBCL for web services. At the time, although I could read the material, it seemed to require too much mentally to actually Get Things Done. I think it was a deep misunderstanding about how to structure a program that is independent of state. Later, after playing with Scala, amongst other languages, I came to understand that state exists in functional programs. It's not conjured up out of nowhere, spontaneously brought into existence, but rather, it exists as data, and it is the job of the program to direct the flow of data appropriately - like a plumbing system, so to speak.
- nickbauman 12y agoI had this experience, too, years ago. I felt like my brain was getting rewired. I loved it. I also noticed that I was thinking in Lisp relatively quickly. To this day when I have a really hard problem I want to solve I write the code in Lisp because it makes hard things easier to understand. Then I implement it in the language I'm using. You begin thinking "naturally" in Lisp because there's no syntax to memorize, it's all data and / or semantics. You can literally write the code in your head. Languages I've used for years and years don't do this to me like Lisp does. It also made me feel more confident about programming in other languages and not to get distracted by "fancy" syntax or features that are just warmed over scraps from the floor of Lisp's feast on the table.