17 ms·
Not Lisp again (2009)
- hprotagonist 9y agoWeird lineage-jumping: Bill Siebert, in his other career as a hearing researcher, is my academic grandfather. His textbook on signals and systems is one of the two classics in the field -- i wonder, now, how much commonality there is between that and his LISP experience.
- deleted 9y ago[deleted]
- ASipos 9y ago2009 should be added to the title.
- bryanlarsen 9y agoWhy? It's an article written about an experience in 1983. The article's publish date is pretty irrelevant.
- taeric 9y agoI view the publish date as much to help people know if they had seen it already.
- cwyers 9y agoThe URL already says blogspot.com, that would be redundant.
- _ph_ 9y agoI was similarly impressed when reading the first chapter of SICP (https://mitpress.mit.edu/sicp/ https://mitpress.mit.edu/sicp/), which shows the same code examples. In a very few elegant lines, without explaining much syntax, some very fundamentals of computing are explained. I can only recommend to read the book, even if "Lisp programmer" is not on the career plan.
- pmoriarty 9y agoThe objections the author had way back in the day are no longer the objections programmers of mainstream languages have to Lisp today. Today the objections I hear are more along the lines of: 1 - All those parenthesis. (Still a top objection) 2 - Lisp doesn't look like or work like what I'm used to. 3 - Lisp doesn't have as many libraries as the most popular mainstream programming languages. 4 - There aren't nearly as many Lisp programmers, so it'll be hard to find more to join your project/company if you use Lisp. 5 - There aren't nearly as many Lisp jobs, so why bother learning Lisp if you're going to have a hard time finding work using it? 6 - Lisp is ancient, and anything that old is useless and primitive compared to new and shiny languages.
- emsy 9y agoFor me it's not the paranthesis, but that Lisp posts always show low level code. At least half of my programming is tying together high level services and libraries. I know how I can express those concepts succinctly in Java, C++, JS, Swift etc. I'd love to see some examples of Lisp for something like a REST controller, where I call services, repositories etc.
- chimeracoder 9y ago> At least half of my programming is tying together high level services and libraries. I know how I can express those concepts succinctly in Java, C++, JS, Swift etc. I'd love to see some examples of Lisp for something like a REST controller, where I call services, repositories etc. You should look at Racket. Racket is a Scheme-like[0] Lisp that aims to be "batteries-included". It includes things like a web-server out-of-the-box. [0] it is technically a hybrid of R5RS and R6RS, so pedants can argue over whether it is really "a Scheme" or not.
- klibertp 9y ago> whether it is really "a Scheme" or not It's not and it's not about being pedantic. Racket changed its name nearly a decade ago and, at that point, it already wasn't Scheme either. I have a post about where Racket (and Clojure) come from: https://klibert.pl/posts/clojure_and_racket_history.html https://klibert.pl/posts/clojure_and_racket_history.html
- TheApexTheater 9y agoI have to admit, the slightly misleading title got me. I'm currently going through SICP myself (albeit at a snail's pace), but it seems like the article's author and I both had the same initial objections to LISP, only to be blown away by its simplicity and expressiveness with a few keywords and lines of code. I'm still partial to other programming languages, but LISP holds a special place in my hard drive.
- taeric 9y agoThe derivative examples are almost magical to watch. I highly recommend that section for anyone interested.
- phailhaus 9y agoI'm having trouble understanding why the derivative example was so impressive to the author. Can someone explain? It seems trivial to do in any language where functions are first class citizens.
- jlongster 9y agoThis was back in 1983 where most (all?) other languages did not have first-class procedures. If you can imagine programming without them and then being exposed to that, it would be a big deal. We take them for granted today.
- AnimalMuppet 9y agoWell, in 1992 (IIRC), I did a numerical integration in C. For a "first class function", it just took a function pointer. That approach would have been available in C in 1983...
- jlongster 9y agoThat's not really the same thing at all. What's missing is the ability to close over values, which is a key part of first-class functions. You could not re-create the original example in C, which is to return a new function. You'd have to return some sort of object that keeps a reference to the function pointer, and provides a special mechanism for calling it, i.e. a poor man's closure.
- klibertp 9y ago> What's missing is the ability to close over values, which is a key part of first-class functions. This is not true. You can have first-class function which are not closures: every dynamically-scoped Lisp works that way, see Emacs Lisp without `lexical-binding: t` and the `lexical-let` implementation.
- vilhelm_s 9y ago
- c3534l 9y agoYeah, but it's goddamned ugly and unreadable. It considers repetition to be a design feature. If you're going to sell people on the benefits of functional programming, I think you should really be pushing more for SML or Haskell or something like that.
- deleted 9y ago[deleted]
- siscia 9y agoRepetition of what? I don't see any repetition on those snippets... What are you referring to?
- jasonkostempski 9y agoMaybe they had mistaken the breakdowns for user input? I did for a second.
- c3534l 9y agoEverything is nested in the form of (fn arg arg) and relies solely on indentation to create some modicum of differentiation.
- golergka 9y agoUnreadable? Personally, I think that Lisp has the clearest possible syntax - because it basically doesn't have any. It's just straight ASTs - something that I have to visualize myself in other languages wich have more syntax sugar.
- tromp 9y agoLisp has the minimal syntax for lists: (a b c d) where other languages require separating commas, but Haskell has minimal syntax for function application: f x y z with no parenthesis needed. (Technically, this is a triple application ((f x) y) z, masked by the convention of application being a left-associative binary operator.)
- Illniyar 9y agoa lot of people handwave the parenthesis and prefix notation as something you get used to, but it really is the thing that I think most people can't get a handle on. There's a reason why DSPs and languages that look like a real languages are sought after - it makes conversion between business logic/requirements to code easier. It makes maintenance easier - it's easy to make sure you made the right changes when the changes to your code looks like the changes to your business logic.
- deleted 9y ago[deleted]
- gimagon 9y agoWhat's DSP in this context?
- SomeHacker44 9y agoI'm guessing he meant DSLs.
- brlewis 9y agoOn the contrary, people not only get used to paren prefix notation, they quickly master it. Mastering operator precedence in your typical infix language is harder.
- pg314 9y agoAccording to RMS [1], even the secretaries in Bernie Greenberg's office were extending Emacs in Emacs Lisp. Nobody had told them what they were doing was programming and they were able to pick it up from a manual. The parentheses can't be that big an obstacle. [1] https://www.gnu.org/gnu/rms-lisp.en.html https://www.gnu.org/gnu/rms-lisp.en.html
- dwc 9y agoI would restate that as people not pushing through past their initial uncomfortable feelings and preferences. Similarly, of all the people who have ever tried Prolog only a small fraction got past the "this is weird" stage. Or Forth. This unwillingness to learn something more than slightly different is limiting, and usually expresses itself in other ways as well. That does NOT mean that such people aren't good developers. You do run risks asking them to work outside their comfort zone, though.
- kkylin 9y agoThe real power of this isn't just differentiating a given function; as others have pointed out, you can do this in, e.g., C with function pointers. Having first-class procedures and closures means you can actually return the derivative as a function. This lets you do things that the simple example doesn't show. For a physics example, see https://mitpress.mit.edu/sites/default/files/titles/content/sicm/book-Z-H-37.html#%_sec_Temp_235 https://mitpress.mit.edu/sites/default/files/titles/content/... : given a Hamiltonian (generalized energy) describing a mechanical system, you can automatically construct a function that computes the associated Hamiltonian vector field. Pass the vector field and an initial condition into a numerical integrator, and out pops the trajectory.
- kkylin 9y agoTo clarify, the relevance is that deriving the vector field from the Hamiltonian requires taking partial derivatives; see the linked section from Structure and Interpretation of Classical Mechanics (SICM) by Sussman and Wisdom w/ Mayer. Closures lets one do this by composing functions in a way that mirrors the mathematical structure. Note in the SICM implementation, the partial derivatives are computed exactly, not numerically, but the resulting ODEs are integrated numerically.
- gravypod 9y agoIf you're interested in the math-abilities of LISP you should check out Gerald Sussman's talk on Flexible Systems [0]. It's THE Sussman doing THE LISP. [0] - https://vimeo.com/151465912 https://vimeo.com/151465912
- kyberias 9y agoI wanted to try the examples. Installed MIT/GNU Scheme on Windows. It gives me some heap errors. There's a bug open about this from year 2010. I despise GNU software.
- a3n 9y agoRacket. https://en.wikipedia.org/wiki/Racket_(programming_language) https://en.wikipedia.org/wiki/Racket_(programming_language)
- cygned 9y agoInterestingly similar to the beginning of "Structure and interpretation of computer programs" - great book, by the way!
- jimbokun 9y agoYes, he is talking about taking the class of the same name, based on the book.
- dang 9y agoPrevious discussions: https://news.ycombinator.com/item?id=5375735 https://news.ycombinator.com/item?id=5375735 https://news.ycombinator.com/item?id=504667 https://news.ycombinator.com/item?id=504667
- RangerScience 9y ago> Slower than assembly? Maybe for table lookups, but who cares about something as mundane as that? I want to do magic. If I have to look up something in a table, maybe I'll use assembly code. Best line. Also, I wonder how Go compares? Can you do basically the exact same things?
- Nanshan 9y ago> An Introduction to Programming in Emacs Lisp > 1 List Processing > To the untutored eye, Lisp is a strange programming language. In Lisp code there are parentheses everywhere. Some people even claim that the name stands for "Lots of Isolated Silly Parentheses". But the claim is unwarranted. Someone show code in other programming languages want to show Lisp's parentheses is silly or other languages more elegant. BUT: I can't find any language can treat the code is data and the code is data AND: I can't find any except Lisp there is just one syntax ().