9 ms·
Getting Started with Lisp in 2019
- verisimilitudes 7y agoThis article would have someone believe Common Lisp is any other UNIX language, where near-meaningless UNIX configuration and other things abound. It indents the Lisp in an odd fashion, with closing parentheses on their own lines, and it doesn't mention the REPL but in one paragraph. As for Steve Losh's article, I don't recommend that one either; it recommends using a Discord server; it recommends using C libraries; it discusses performance and representation characteristics that are allowed, but not required, in interfacing with things such as graphics cards; and it has other characteristics that I don't believe someone new to Common Lisp would recognize it, so I don't recommend that article to novice Common Lispers.
- patrickmay 7y agoAgreed. Install SBCL, Quicklisp, Emacs, and bring up Practical Common Lisp in a browser, then start hacking. Roswell doesn't add any real value, in my opinion.
- eatonphil 7y agoI'm not a fan of Roswell or Portacle, personally, because I'm used to taking control of my setup. I try to stick with well-maintained distribution systems (e.g. Debian's .deb or the source itself if need be) otherwise upgrades tend to be complex, not well documented, and supported by few people. Additionally, as one new to Common Lisp, it is difficult to understand the abstraction layer at which Roswell & Portacle operate with respect to abstraction layers implicit to Common Lisp. I better understood these layers by installing SBCL myself and playing with Quicklisp (a package manager) and ASDF (a package definition library). I wrote about this a year ago [0]. It was confusing at first. But it became clearer after exploring and writing that post. Ultimately I don't find it very different than writing a Python library with setuptools. re: SLIME; I never ended up remembering the keyboard shortcuts as a CL hobbyist so I turned it off after a few uses and stuck with vanilla Lisp-mode. Parenthesis completion and auto-ident are the only two tools I expect of my text editor (vs. in a GUI, buttons take the place of keyboard shortcuts you must remember). I use Emacs at work and home but I hardly remember any extension shortcuts (as much as I want to benefit from projectile and magit). It even took me a few years before I felt comfortable using package-install vs. just `git clone`-ing new modes and adding their paths to my .emacs. For all these reasons, Portacle as a distribution isn't really my style. Roswell didn't solve anything for me either once I got familiar with ASDF and Quicklisp. Complacency on tool UX doesn't help a community. Roswell & Portacle may be a forward iteration on UX. But I also want to share the fundamentals (or at least N-1 layer down) and get other hobbyists comfortable there too. [0] http://notes.eatonphil.com/starting-a-minimal-common-lisp-project.html http://notes.eatonphil.com/starting-a-minimal-common-lisp-pr...
- TurboHaskal 7y agoI would recommend to ignore Roswell and just install SBCL or CCL from your package manager. For a quick Emacs setup with good defaults, use Spacemacs with the common-lisp layer. If you have never used Emacs I would just ask the LispWorks guys for an evaluation license. It's the closest thing to experiencing one of those Lisp environments of the 80s (Emacs doesn't come close). You'll be impressed.
- _emacsomancer_ 7y ago> ask the LispWorks guys for an evaluation license. It's the closest thing to experiencing one of those Lisp environments of the 80s (Emacs doesn't come close). Could you say something about what additional features LispWorks has that Emacs doesn't?
- mark_l_watson 7y agoI agree. Also, even though I usually favor using Emacs, VSCode with the common-lisp plugin is easy to install for beginners, so newbies should probably start there.
- reikonomusha 7y agoThis is the document [0] we maintain for new Lisp hackers at Rigetti, where we use Common Lisp to build open source quantum software development tools. Following that, here’s the rundown of some basic Lisp nomenclature and how to edit in Emacs [1]. The article isn’t bad, but it also doesn’t provide you with a sustainable way to develop Lisp; interactive and incremental development together form a great proportion of value of using the language in the first place. [0] https://github.com/rigetti/qvm/blob/master/doc/lisp-setup.md https://github.com/rigetti/qvm/blob/master/doc/lisp-setup.md [1] https://github.com/rigetti/qvm/blob/master/doc/editing-and-running.md https://github.com/rigetti/qvm/blob/master/doc/editing-and-r... (PRs are welcome!)
- adamnemecek 7y agoWhat are the advantages of lisp over julia?
- reikonomusha 7y ago- Array indices start at 0. :) [Half-joking.] - An excellent debugger and condition system! - Code won’t be broken in 20 years (which I value when developing things like compilers). There’s one standard, and several de facto standard extensions. - Almost 30 years of history, documentation, discussions, etc. Every corner of the language has been discussed to death. - Several stable, mature, and independent choices of open source implementation. - Implementations are written in Lisp all the way down. You can immediately jump to the definition of anything at any depth, and often edit or redefine to taste. (Example, I improved SBCL’s integer square root in my live image, and submitted a patch.) The only off-limits bits are a part of the runtime, like the garbage collector. - Several independent choices of commercial implementation and commercial support. - Generally easy to optimize and micro-optimize code. Easy to edit/disassemble/debug. - Easy to write assembly code with SBCL. - Fast start-up time, easy to compile into native executables. No JIT lags. - Excellent IDE support through Emacs and SLIME. Incremental development is real with Lisp, and absolutely not so with Julia. - Easy to dynamically generate and compile code at runtime. - Excellent metasyntactic programming facilities. (Macros, symbol macros, reader macros, ...) Negatives compared to Julia: - Poor support for numerical libraries and poor support for plotting, much to the chagrin of a scientific programmer like myself. - No hip website or hip foundation backing it. - Quiet community, with very broad interests. Not everybody is rallying around one theme in Lisp. You got database programmers, game programmers, scientific programmers, etc. This could be a positive, if the community were larger.
- pmoriarty 7y agoI was very fortunate that my university had a ton of old Lisp books, and after browsing through a bunch of them I found some really good ones and learned from those. Unfortunately, I don't remember the titles (though a book on CLOS stands out in my memory as being an excellent introduction to the awesome power of OO programming in Lisp), but if you have a university with a good comp sci library you may want to check it out. Parenthetically, I don't know if it's true but I'd heard that there have been more books published on Lisp than all books on other programming languages combined. I'd also recommend that anyone who starts out with Common Lisp give a modern Scheme (like Chicken, Racket, or Guile) a try. I found Scheme to be much more to my taste and once I learned it I viewed CL as quite backwards in many ways, so Scheme is what I use today if I can at all help it. Finally, newbies should check out Emacs and eLisp. eLisp is more primitive than either CL or Scheme, but it's still great when combined with Emacs, which you can customize and improve to your heart's content. In addition, there's a mountain of eLisp code to build on for you Emacs improvement projects. I came to eLisp after learning both CL and Scheme, so it was pretty easy to pick up, and that's what I'd recommend others do too, just so you first learn what Lisp is truly capable of.
- reikonomusha 7y agoCL has warts, but at least ANSI CL is portable across a dozen implementations, has an excellent IDE and debugger, and lots of other boring “practical” things. Scheme is fantastic, if you’re willing to write code that only works for one implementation.
- snazz 7y agoI love that both are feasible options. I’m still not sure which side of the Lisp-1 vs. Lisp-2 debate I’m on, but the fact that there are such great languages on both sides of the fence is wonderful. Also, Scheme communities are more focused; this property proved extremely important to me when I was writing a CHICKEN Scheme web app.
- pfdietz 7y agoScheme is a language in which the order of evaluation of arguments to a function call is not specified by the standard. There is no excuse for that.
- dtornabene 7y agoAdding my own disagreement about using either portacle or roswell. If you're running literally any widely used Linux distro, or {Free|Open}bsd you are a package install away from a working common lisp install. I've seen this come up alot in irc and reddit, this push to get people to use a C library (!) to get to common lisp, and its downright bizarre. If you're that bent on packaging and C, use Guile or Gambit. And if you're just a random person perusing this thread, just go download the simplest thing and get started, not slime (which is awesome) not Lem (which is fine), just lisp and a text editor
- snazz 7y agoYes. A detail that I found quite amusing about Roswell was that it segfaults on OpenBSD; the problem could have been altogether avoided by writing it in Lisp. I had to dismiss Lem because it seemed to depend on Roswell and Roswell was not going to cooperate. The entire point of Common Lisp is to make stuff work across implementations. You shouldn’t need to test five implementations on your development machine. The only time I can see something like Roswell (but not in its current form) being useful is an automated CI tool, but even then it isn’t really necessary.
- dtornabene 7y agoSo, due to someone taking the time on irc, I managed to get Lem installed on a box at some point recently sans roswell. It doesn't actually depend directly on it, though I think there are some things built on Lem that use roswell.
- p_l 7y agoThe problem is that for years distro-bundled Common Lisp was broken thanks to well meaning efforts in Debian. I'm speaking of "common-lisp-controller". Which led to some problems that made avoiding distro packaging the norm.
- dtornabene 7y agoYeah, people have and had problems with common-lisp-controller, I certainly have. That being said I'm not one to turn to the arms of C to solve an environmental problem, not when it can be done correctly, if with effort, from the host language itself
- mac_was 7y agoI can see Lisp is the ‘new’ React. Two years ago there were loads of articles about React, prior to that it was just Javascript. I can see people got enough of Javascript.
- iovrthoughtthis 7y agoLisp is like 50 years old.
- mac_was 7y agoSo what? Javascript is like 20 years old but there is definitely hype for Lisp now.
- Insanity 7y agoHN loves LISP, there's a LISP (the entire family of languages) article quite often. It's a joke that goes around here and there - the fascination with LISP in this community. Also, I would not say there is any more hype for lisp now than 3 years ago. It's still an esoteric language to most, and one that few people actually bother learning these days. All the javascript articles are more "practical" because a wide audience uses them, but Lisp is a language most people only use at home or at uni.
- deleted 7y ago[deleted]
- iovrthoughtthis 7y agoI’m not a fan of Roswell it’s self but I see the value. The LISP ecosystem is not bash centric as most languages today are. It wraps everything it’s own cli which, while powerful break the common interface that most developers today have become accustomed to. I know that I would have enjoyed a good bash cli interface for managing my lisp packages using some of the notions developed in ruby / python / javascript e.g. project local installs (quick-lisp i stalls packages globally by default), project lock files for versioning, package binaries / commands (things like Rake, Rspec, NPM run scripts). You can do all of this stuff with your lisp install it’s just more complicated and requires more steps.
- pvaldes 7y ago> use roswell or apt install cl-launch...
- madiathomas 7y agoEach time I see a LISP related article on Hacker News, I always ask myself why LISP is so popular only on HN. This is the only website where I hear about LISP. Is LISP popular on HN because it brings advantages to the table or is it popular because it looks cool to say you use it, or something else? Please help me understand. I am tempted to learn it but needs justification.
- badsavage 7y agoHN creator Paul Graham was really into Lisp. HN has been built with his own Lisp, Arc. HN attracted many experienced programmers and experienced programmers usually like Lisp, because Lisp dialects are simple, elegant and powerful.
- madiathomas 7y agoI understand the PG part but I don't agree with the experienced Programmers part. I know hundreds of experienced Programmers and zero of them are using LISP. I am one of them. They are using C, C++, C#, Java, JavaScript, PHP, Perl, Python etc. Anything but LISP. I won't even be surprised if LISP has a market share of less than 0.01%. Even in the US. Do you have examples of popular system built using LISP?
- reikonomusha 7y agoRigetti is a company that builds quantum computers and uses Lisp. * https://github.com/rigetti https://github.com/rigetti Google Flights is built on Lisp as well. * https://travel.stackexchange.com/questions/87540/google-flights-what-programming-language-is-used-in-the-google-flights-ita-so https://travel.stackexchange.com/questions/87540/google-flig... I don’t think the parent meant that experienced programmers are heavy users of Lisp, or that they use it as their main language, but rather they often know it and have an interest in it, even if it’s not paying their bills.
- madiathomas 7y agoOut of those 100s of Developers that I know, none is interested in learning LISP. Not even as a hobby. Experienced Developers have already chosen their tools and they focus on improving on those skills.