12 ms·
Lisp Quickstart
- weavie 10y agoI wish there was a tutorial on how to navigate through the endless sea of broken and undocumented third party libraries.
- nerdponx 10y agoSeriously. I just started looking into Common Lisp last weekend, and if it weren't for the active communities on Reddit and IRC, you'd get the impression that the language was abandoned some time in 2012.
- pchristensen 10y agoThat's around when Clojure passed CL and started drawing interest away from it.
- derrida 10y agoBut if you look at Clojure libraries, some of them were last updated in 2012. That's because clojure solves problems (& it's not that the maintainers have disappeared) :)
- deleted 10y ago[deleted]
- wtbob 10y agoPassed CL in buzz & hype, no doubt, but certainly not in power & suitability for large projects.
- guicho271828 10y agoA funny thing is: A typical response from CLers to this type of comment is "yes CL can handle large projects". There is a definition gap, though, where one imagines a project that is "large as in a company", i.e. a large project that involves many people, while another imagine that is "large as in a system", a project with a large SLOC. And they are sometimes mixed. CL can handle a large SLOC, as evidenced by the fact that the huge compiler such as SBCL itself is written in CL. But it won't be as popular as Java or C++ are, so it would become a problem when CL faces a project which is "large as in company".
- bitwize 10y agoBlub Advocate: CL isn't suited for the enterprise! Have you ever seen a CL project scale to a team of 100 developers? CLer: Your language isn't suited for the enterprise. You need a hundred developers to do what we do with five.
- lispm 10y agoSBCL is not really that large in LOC, though it has some complexity. It's a mid-sized Lisp program with some complexity, since it implements a type inferencing native compiler with backends for various platforms. SBCL itself was derived and simplified from the CMUCL implementation. There are some CL code bases with millions of lines. But even a million line in todays terms is not much for some companies which are using other languages. If we look back, the operating system and basic environment (GUI, IDE, basic apps) of the Lisp Machine OS was around 500 kloc. Later versions with more stuff and some applications were nearing 2 Mloc. The commercial CL companies (Franz, Harlequin/LispWorks, Lucid, Xerox, TI, LMI, Apple, Goldhill, DEC, ...) usually should have developed code bases with +1MLOC already in the 80s / early 90s. Some Common Lisp based CAD software was/is in the range of 5-10 MLoc. Some application code might be much larger. For example Boeing has whole jet aircrafts designed in Lisp using the now discontinued iCAD application. > so it would become a problem when CL faces a project which is "large as in company". Common Lisp has been used in environments with up to 300 developers. This is not really a large number, but a larger number of what people typically think of a Lisp project. Symbolics, the Lisp Machine company, had at max 1000 employees - with probably a third of that software developers. Lucent developed network switches in the 80s/90s with 100+ Lisp developers. ITA was developing their flight search engine with a 100+ team with a lot Lisp developers. There are also smaller companies with a long history - for example Cyc is being developed using Lisp since thirty years. One problem was/is finding these people. An old saying was that there were more Lisp Machines than developers able to use them. Today it would be even more of a problem, since the number of interesting Lisp projects at universities is smaller than what we had in the 80s/90s. Thus fewer students get in contact. Probably a good idea to visit the European Lisp Symposium in Brussels, April 2017. Meet some fellow Lisp users from academia, industry, ... http://www.european-lisp-symposium.org/editions/2017/ http://www.european-lisp-symposium.org/editions/2017/
- juki 10y agoCommon Lisp is a very stable language. The standard hasn't changed in twenty years, so (unlike many other languages) old code is still perfectly good. Libraries that haven't been updated in a decade still work just as well as they did a decade ago.
- nerdponx 10y agoThis is nice to know. Do Quicklisp packages typically come with test suites? At least then I can check if a package will work before I commit to using it.
- guicho271828 10y agoYes, almost certainly, except very fresh new libraries.
- juki 10y agoTypically yes. You should be able to run the test suite through ASDF. For example CL-USER> (ql:quickload :trivia) ... loads ... CL-USER> (asdf:test-system :trivia) ... test output ... But unfortunately not all libraries set up their test-ops properly. You can usually find a readme at ~/quicklisp/dists/quicklisp/software/... which might have instructions for running tests.
- felideon 10y agoYou can also check out cl-test-grid[1] and its results[2]. It shows every quicklisp library tested against every (?) CL distribution. [1] https://github.com/cl-test-grid/cl-test-grid https://github.com/cl-test-grid/cl-test-grid [2] https://common-lisp.net/project/cl-test-grid/library/ https://common-lisp.net/project/cl-test-grid/library/
- aidenn0 10y agoNot only do many of the do, it is common practice for release candidates of asdf, sbcl (and probably other implementations) to run those tests against release candidates as a regression test.
- 10y ago
- _delirium 10y agoMy subjective impression regarding third-party libraries specifically is that if anything, the situation has improved a lot in the past 5 years, mainly due to Quicklisp becoming the de-facto standard. Now there's a curated collection of libraries that are tested to work across multiple CL implementations, pull dependencies properly, etc., instead of the previous mess of manually downloading .tar.gz from random places on the internet.
- Jimmy 10y agoLisp has always been like that. Seriously, always.
- fiddlerwoaroof 10y agoThis might be helpful http://eudoxia.me/article/common-lisp-sotu-2015 http://eudoxia.me/article/common-lisp-sotu-2015
- weavie 10y agoSo one of the first recommendations on that site is for the Clack family. The first link to clacklisp.org has now started pointing to the github project. For a long while before that it was just dead. Clack, whilst being a great concept suffers from a lack of documentation. What documentation is there is confusing. It seems Clack has in the past couple of years been split out into a separate project - Lack. There's no documentation around as to why this has been done. I can't find details on how to write middleware for it. I need to look through the source. I'm trying to get Ningle working. The Redis session middleware seems broken. It doesn't seem thread safe at all. I seem to have other problems with by body parameters being mutated as it passes through the middleware. I have gotten very close to just dropping Clack and moving onto raw Huchentoot or Allegro serve, but it saddens me that a project with such promise shouldn't get the love it deserves so I will probably persist and hopefully help to improve the project. Don't get me wrong, I love Common Lisp as a language and use it daily. But problems like this are just standard.
- fiddlerwoaroof 10y agoI agree about the lack of documentation being a major pain point in the ecosystem. As far as web projects goes, this looks promising: https://github.com/Shirakumo/radiance https://github.com/Shirakumo/radiance Shinmera puts a lot of effort into finishing his libraries and documenting them well, so I expect that this library would be nicer to use than many of the alternatives.
- aidenn0 10y agoYeah, I am liking clack and I really need to get off my butt and write a tutorial or something for it. It's much less complicated than it looks. However, I agree that much of the middleware that ships with it is at a level I would call "Proof of concept" rather than "Production ready."
- _ph_ 10y agoThe Lisp library ecosystem is not as organized as that for some other languages. But, quicklisp succeeded in giving a good central point and simple access to libraries. Some reasons for the situation are historic, but some result from the fact that there is not a canonical Lisp implementation as for languages like python, java or perl. The commercial Lisp implementations (and most open source ones) ship with their own set of supporting libraries, so you are less dependent on third-party libraries to get stuff done. But to everyone who wants to get started with Lisp, I can only recommend not to focus on libraries first. Between what the language includes (especially Common Lisp), and what the implementation ships with, you should be set up to do a lot of serious programming. If there is anything, which you cannot do with the default environment and with what you cannot implement faster yourself, then its time to use quicklisp to add the missing pieces. But having written some pretty large Common Lisp programs myself, they tend to depend on only a very few external libraries.
- daliwali 10y agoIf you are really in a hurry and can't commit to learning the hundreds of forms in Common Lisp, Scheme is a minimalist alternative. The entire language has only a few forms on which make up everything else.
- fao_ 10y agoSpecifically, chicken scheme, which has a lot of nice complete add-ons and a few other features that schemes normally lack.
- brudgers 10y agoDisclaimer: I like Scheme and love Racket but have an ongoing exercise in Common Lisp. [1] Common Lisp has the advantage of having done a pretty good job at the hard problem of naming things and so ordinary activities have names with regular semantics like |remove| and |remove-if| -- generally |some-name| tests against a value and |some-name-if| tests against a predicate. Functions on sequences have keywords as supporting parts of speech that make it possible to state intent rather than write an implementation -- Common Lisp contains several domain specific languages that have proven to be useful. One way to learn them is to read Steele's, Common Lisp: the language. It's not that a programmer can't write their own version of |copy-tree| and a naive implementation is fairly easy. It's not but nominally more difficult or verbose than writing it in a Scheme or Clojure. The difference is that Common Lisp's built in |copy-tree| is probably sophisticated for performance and robustness reasons. Schemes come out of a pedagogical context and there not having a built-in |copy-tree| can be a feature because of what people may learn by its absence. Racket's Student Languages push this toward the limit. To put it another way, Assembly Code has fewer constructs than Python, but often there is an advantage that comes with Python's higher level abstractions. [1] Why the hurry: http://norvig.com/21-days.html http://norvig.com/21-days.html
- jlarocco 10y agoStrongly agree. There's more stuff in Common Lisp, but once I learned the concepts behind how the naming worked, a lot of them didn't need to be learned as much as I just assumed they were there. The "standard library" is large, but really well thought out. Writing in Scheme, I'd often need to implement functions that I knew were already in CL, so Scheme ends up being more work in the long run. And it's not like a person needs to memorize all of the language constructs before using it. The REPL in Slime is incredibly helpful in discovering functions and verifying how they work, and Stack Overflow or web search can be really helpful finding out if a particular function is built-in or not.
- TurboHaskal 10y agoJust print this, even if you won't ever use CL http://clqr.boundp.org/ http://clqr.boundp.org/ It is a quick reference guide consisting on a set of pages that can be stacked together to form a little booklet. Beautiful to look at. I wish I had this for other languages and cannot recommend it enough.
- walabaloo 10y agoThat's really interesting, I've always loved the thought of hand bound books, especially "homemade". Are you aware of any other projects like this?
- Arcsech 10y agoThere's Julia Evans' Zines[0], although they're a different style than the linked guide. I have them printed and pinned to my cube wall. [0] http://jvns.ca/zines/ http://jvns.ca/zines/
- zeveb 10y agoThat is really awesome — I recommend that anyone who's interested in programming languages in general take a quick look!
- dangom 10y agoImpressive. Not only Lisp, but the LaTeX as well. Had never seen anything like the formatting of section 8 before - mind blowing. Thanks for sharing.
- kazinator 10y agoIt is reminiscent to a syntax diagram: https://en.wikipedia.org/wiki/Syntax_diagram https://en.wikipedia.org/wiki/Syntax_diagram If we google for "syntax diagram" or "railroad diagram" there are better examples, like this one: https://i.stack.imgur.com/uDoc4.gif https://i.stack.imgur.com/uDoc4.gif We see all the "railroad paths" through the syntactic combinations. Because it's not a recursive grammar, it's practical to unfold everything in one diagram. Instead of bubbles and arrows, he marked it up with LaTeX nested parentheses in 2D. The whole guide is somewhat similar in flavor to the cheat sheets in mathematics books (trig identities, derivatives, integrals, useful equations, and so on).
- klibertp 10y ago> Closures are examples of powerful things which C++ simply cannot do. Not true anymore. This article seems rather old, considering it refers to Racket as "PLT Scheme" here: http://cs.gmu.edu/~sean/lisp/ http://cs.gmu.edu/~sean/lisp/, so it's at least 7 years old, possibly older.
- dang 10y agoFrom https://web.archive.org/web/20170215233309/http://cs.gmu.edu/~sean/lisp/LispTutorial.html https://web.archive.org/web/20170215233309/http://cs.gmu.edu... it looks like it dates from 2003 but was significantly extended last summer.
- techwizrd 10y agoIt is old. I remember Prof. Luke sending it to us when I took his class in Fall 2011.
- hellofunk 10y agoClosures in the functional programming sense don't really exist in C++. "Closing over" a value means something quite specific, and C++ captures don't do this; they merely copy by value or reference an outside entity. The only way to get close to it is if your C++ lambdas exclusively capture and thus increment the reference count of shared pointers only, and no other types. Not exactly idiomatic.
- ezy 10y agoI don't think this is correct. I'm not sure there are many people that would argue that C++11 doesn't have lexical closures just because its closures need to take into account the semantics of C++ itself. Anyone who says that, doesn't really understand how C++ is used, frankly. You said it yourself, if you specify generic close by value, you will get the behavior you want. If you know your closure won't outlive the stuff it closes over, you can capture by ref. If you need some other behavior, you use smart pointers and capture by value or mix and match based on what you're capturing. Just because C++ doesn't automatically figure it out for you isn't an argument against it having closures, any more than not a having bignum or rational built in means it can't do arithmetic.
- agentultra 10y agoI like the early introduction of the debugger. One of the more interesting features of CL, in my experience, is the conditions and restarts system... and built in debugger. One approach to development in CL is to evaluate a form you would like to have. You end up in the debugger. You write the implementation until the error goes away. Repeat until you have a working system... interactive, hate-driven development at its finest. In fact that's one of my favourite things about CL: it's so interactive that it almost never crashes. You can still interact with your program, see all of the data, debug it, and continue.
- deepaksurti 10y ago>> it's so interactive that it almost never crashes I learnt game programming and OpenGL from the ground up using CL. If it were not for CL, I probably would not have the patience to hang around. I used LispWorks OpenGL bindings and with vertical sync integration, live updates to a running OpenGL program after modifying the code is/was super fun. The biggest advantage I have found using CL is in learning hard topics as you at least have the language and the tooling get out of your way helping you focus on the problem at hand.
- brudgers 10y agoIn Common Lisp users use Common Lisp rather than users using programs written by programmers in <language x>. I think it comes directly from the idea of Lisp Machines where typing s-expressions was how users used the computer. That's radically different from Smalltalk and the Dynabook. Part of its mandate was to be used by children which by definition meant there was an assumption of substantial difference in cognitive capacity between end users and programmers. That's the intellectual model that's mostly won. It's distinct from a model in which the causal premise for differences in knowledge is expertise and experience.
- tdeck 10y agoIncidentally, this is one of the most interesting aspects of the "crank" operating system Temple OS, every program in the language is written in a variant of C that's compiled on the fly, and the shell itself is just a C REPL. I've never used it but found this article very interesting: http://www.codersnotes.com/notes/a-constructive-look-at-templeos/ http://www.codersnotes.com/notes/a-constructive-look-at-temp...
- WhitneyLand 10y agoDoes Lisp Suck? If HN had a FAQ this might be near the top. As new people go into CS they seem to be aesthetically drawn to, or repulsed by, Lisp. The irony is there is no objective truth so these two groups of people spend a lot of time supporting their arguments (google search will amaze you, even Paul Graham has been sucked into this) but it's not very common for people to change sides after their initial indoctrination. I have come to view this as one of few (only?) metaphysical topics seriously discussed in computer science. Someone on SO once said: 'the correct Lisp answer is more gnomic. Something like: "If you have to ask, you are not ready." Then if anyone questions further, the correct answer is either "yes" if it's an either/or question or "You are not ready."'
- acalderaro 10y agoI've always wondered why LISP was such a hot-topic of discussion for CS people. I'm not technical myself, but the idea of different computing languages being more/less efficient in certain tasks is interesting. I don't know how valid this is, since I've only spoken with a handful of Lispers, but it seems that they appreciate the freedom and lack of boundaries/rules/limits that Lisp provides. They talk about it like a language that can do anything, because it has no rules on what it can or cannot do. But at the same time, my friends also remind me that the lack of limits means that they are more accountable for every line of code, and that as a beginner, it'd be best for me to use something more structured (they always say Python) until I'm comfortable taking off the training wheels. Can anyone share their thoughts?
- aidenn0 10y agoSome languages are absolutely more efficient for certain tasks. Here are some probably not very contentions examples: If you pick Brainfuck for your language it will probably take you longer to write your program than Java. You will probably be able to write a network server in Go faster than you will be able to write it in assembly. Those may seem contrived, but if you start to compare things that could be actual business decisions it becomes much harder for everybody to remain objective. You also get to the point for which there may be no universal answer for each programmer. This is at least partly because many programming tasks are quite mundane, and so wouldn't be any faster/slower in general between, for example, Javascript and Lisp. You give them to me and I'll do it much faster in Lisp, while a javscript developer will do it much faster in javascript just because the task is simple enough that individual proficiency with the tools trumps any minor differences for such tasks.
- bitwize 10y agoSince Lisp flamewars are to the average Hackernews what catnip is to a cat, Hackernews pounces on a years-old quick-start guide to Lisp for university students who took AI as an elective to meet their major requirements, and who will likely end up hating Lisp with the fury of a thousand suns by the time they graduate. The Clojure Inquisition stops by to remind everybody that what really matters in programming languages is how many hipsters you can attract into your fan base.
- dang 10y agoWould you please stop making up generalizations about Hacker News to score rhetorical points? It indulges the desire to feel better than everybody else, which gets upvotes since (ironically) everybody loves having that indulged. Nevertheless it makes for a bad HN comment because its underlying message is just "Look at me." I recommend listening to https://www.youtube.com/watch?v=mmb7TU0OrOI https://www.youtube.com/watch?v=mmb7TU0OrOI instead. I emphasize this because you posted https://news.ycombinator.com/item?id=13943374 https://news.ycombinator.com/item?id=13943374 a few days ago, which was a particularly dismaying example. Comments like that basically activate a bug in human firmware to the detriment of substantive discussion.
- bitwize 10y agoOh please. My goal was not to score rhetorical points but to make HNers crack a smile in the style of http://n-gate.com/hackernews/ http://n-gate.com/hackernews/ If you think I'm being overbroad in my generalizations, of course I am. As they say, "That's the joke." I'll stop but only under protest, and with the note that I think HN administration is misreading the effect this has on people. (Hint: it's funny because the average Hackernews sees a little of themself in the n-gate posts, not because they feel smugly superior.)
- dang 10y agoOk, I obviously read your motive wrong (sorry!). Not sure I'm wrong about the effects on the threads, though.
- unknownsavage 10y agoThe lisp quickstart is indeed one of the key advantages of lsip: $ time sbcl --script hello.lisp Hello World! real 0m0.026s user 0m0.009s sys 0m0.013s Compared with languages with a much bigger starting curve: $ time node hello.js Hello World! real 0m0.113s user 0m0.052s sys 0m0.022s
- pjmlp 10y agoAnd you can AOT compile your Lisp code to pure native code, try that with JavaScript.
- TeMPOraL 10y agoMaybe a stupid question, but is AOT a new name for what just few years ago we used to call "normal" compilation?
- eatonphil 10y agoMaybe the point is that Javascript is JIT compiled?
- nickpsecurity 10y agoNo, lol, it's exactly normal compilation. It's a buzzword that differentiates languages without normal compilation (esp using VM's or interpreters) from special implementations of them that do support that. The latter have "AOT" compilation. Wikipedia states the difference is AOT compiles the bytecode of an existing VM. It's still just a compiler, though, given the end result is mostly the same.
- jeff_petersen 10y agoI suppose the contrast is with JIT compilation, which has a lot of mindshare now so it's valuable to make the distinction
- lacampbell 10y agoYeap. It's quite a common linguistic phenomenan, when a term like JIT stops being a fringe thing and enters mainstream discourse among an audience, what used to just be "normal" now gets a name. "Imperative programming" might be another one. IRL, think about how "cisgender" has entered into mainstream vocabulary in the past few years, or "heterosexual" many years before that.
- acheron 10y agoThe author posts to HN sometimes: https://news.ycombinator.com/user?id=SeanLuke https://news.ycombinator.com/user?id=SeanLuke (I was a grad student in one of his classes many years ago.)
- jidenna 10y agoI was always having these gut feelings about my partner cheating on me with her boss at work but i couldn't confront her about it because i didn't want to cause any problems where there's none. Then Contact World Best Hackers: They are Set of professionals that provide Quality Hacking Services. They have series of testimonies from Their clients Worldwide,they are Proficient in Hacking every areas of ICT which include: * Hack and access DATA FROM ANY COMPANY Web Sites, he hack hack into a company email account call log,Hack Visichat Room ? Hack Flash Chat Room ? Hack Ftp User & Pass ? Hack Database ? Hack Yahoo Mail ? Hack Gmail Id ? Hack Websites ? Hack FaceBook Account ? hack Vb Forum ? Hack WordPress Blog ? hack C C any country ? hack moneybroker ACCOUNT ? hack liberty Reverse Account ? hack paypal Account ? increase your credit score today? bypass Google phone verification, ? Hash Crack ? Hack Bank Account ? increase your credit score today,online game access?hack twitter?and listened to all his calls and upgrading result making changes in database,such as your college/university grades,Retrival of lost files,preventing you from been hacked or tracked,You can reach out to him for any hack related exploit {{alandavid76@tutanota dot com} for an effective service and consider your big problems solved..
- SeanLuke 10y agoOh my goodness. My old lisp tutorials are on HN again. Before anyone takes potshots, please understand that these tutorials have a very specific purpose: to get our AI students up and coding AI projects as quickly as possible given what they know (C++/Java). So instead of talking up front about the things that make Lisp special, I'm basically talking about how to write C in Lisp. Hence, the tutorials don't ever discuss CLOS, macros, advanced packages, conditions, streams, the type lattice, SLIME, ASDF, Quicklisp, indeed any installable packages at all. Because we get to many of those things, and the wonders of Lisp, later in the class.
- triclops200 10y agoI don't think I remember us covering quicklisp or ASDF, professor. :p
- SeanLuke 10y ago:-) Did both of them last year but not for 480.
- plg 10y agoWhat are some compelling examples of Lisp languages in use today in apps/situations/use-cases that we might all know about? A lot of people (likely mistakenly) think that it's just a language you learn in CS classes and then leave behind.
- to3m 10y agoEmacs.
- Jimmy 10y agoThis was to go-to answer when I started learning Lisp a decade ago. Glad to see nothing's changed.
- mtreis86 10y agoThis website: Arc
- m-j-fox 10y agoHa! Figures.
- bgruber 10y agowalmart (http://blog.cognitect.com/blog/2015/6/30/walmart-runs-clojure-at-scale http://blog.cognitect.com/blog/2015/6/30/walmart-runs-clojur...)
- lispm 10y agohttps://www.google.com/flights/ https://www.google.com/flights/
- lispm 10y agoIf you use microprocessors from companies like AMD and Intel, there is a good chance that parts of their design were checked with large amounts of Lisp code. Example: https://github.com/acl2/acl2/tree/master/books/rtl/rel11 https://github.com/acl2/acl2/tree/master/books/rtl/rel11 > This directory contains an ACL2 library of register-transfer logic, developed at AMD from 1995 to 2011, and at Intel from 2012 to the present, in support of the mechanical verification of the floating-point arithmetic units designed during those periods by the respective companies.
- muterad_murilax 10y agoWhy does CL feature an ascii rendering of the golden menorah?
- junke 10y agoNot all CL implementations, just CLisp. http://www.clisp.org/impnotes/faq.html#faq-menorah-why http://www.clisp.org/impnotes/faq.html#faq-menorah-why
- mark_l_watson 10y agoAn old write up, but it shows the style of repl programming. I have been using Common Lisp since the 1980s, and for me it is all about using a bottom up interactive programming style - same as programming in Haskell, Ruby, Python, Scala, etc.