TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

How to write Common Lisp in 2017 – an initiation manual

476 pointsby maccoabout 8 years ago

28 comments

hydandataabout 8 years ago
I started a big project at work using Common Lisp in 2017 and could not be happier. Sure, most nice features have trickled down to other languages, but they are rarely as nicely integrated. And Lisp still has many advantages that are not found elsewhere: Unmatched stability, on-demand performance, tunable compiler, CLOS, condition system, and Macros to name a few. It has its warts too but which language does not?<p>I found lack of high quality library documentation a bit annoying, but a non-issue, there were tests and&#x2F;or examples included in practically all of the libraries I have used so far.<p>Lastly, this rarely gets brought up, but I think Common Lisp has some of the best books available out of any programming language. The fact that it is so stable means that most of material, and code, from the end of 80&#x27;s and 90&#x27;s is quite relevant today, and new stuff is being written.<p>The biggest downside is that it makes JavaScript and Python revolting to work with. But I can still enjoy SML for example.
评论 #13981261 未加载
评论 #13985120 未加载
评论 #13981279 未加载
评论 #13987326 未加载
评论 #13982774 未加载
评论 #13981722 未加载
yarrelabout 8 years ago
I&#x27;d replace the first few steps with &quot;Install Roswell&quot; -<p><a href="https:&#x2F;&#x2F;github.com&#x2F;roswell&#x2F;roswell" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;roswell&#x2F;roswell</a><p>Roswell will install a Lisp and QuickLisp for you, and give you a single point of entry to install libraries, create and run code, and launch en editor (Emacs with Slime of course).<p>I can&#x27;t recommend it highly enough (I&#x27;m nothing to do with the project, just a very happy user).
评论 #13981057 未加载
Scarblacabout 8 years ago
I&#x27;m used to languages like Python, that have a number of files that are modules, and to start a program you run one of them as an entry point.<p>C programs consist of a lot of files that are compiled and linked into a binary executable.<p>Whenever I&#x27;ve tried to learn CL, I couldn&#x27;t really wrap my head around what the eventual program would be. You build an in-memory state by adding things to it, later dump it to a binary. How do you get an overview of what there is?<p>I&#x27;m just too used to my files, perhaps. Or I&#x27;m missing something.
评论 #13979935 未加载
评论 #13981387 未加载
评论 #13980102 未加载
评论 #13979715 未加载
评论 #13980651 未加载
评论 #13979660 未加载
评论 #13979634 未加载
评论 #13979662 未加载
评论 #13979675 未加载
kunabiabout 8 years ago
I&#x27;ve been working on a CL project for a couple of years. Was my first big stab at using CL for something other than a toy. Sbcl is a nice choice, but far from the only option. It has many tradeoffs. CL is not without its frustrations. Documentation that has not aged well. A community that can be less than welcoming. (in contrast to say the Racket community) Inconsistencies, e.g. first, nth, elt, getf, aref... However portability appears to be a strong point vs on the scheme scene. Single binary compilation on SBCL&#x2F;LW&#x2F;ACL&#x2F;CCL are great. Found GC to sbcl to be lacking on large garbage rates. Tended to promote garbage to a tenure that prevented it from being removed. It would max out 32GB of memory, even with explicit gc&#x27;s enabled between files. Where as the other implementations would stay below 4GB.<p>So ymmv.<p>Performance benchmarks using cl-bench really highlighted some strong points <a href="http:&#x2F;&#x2F;zeniv.linux.org.uk&#x2F;~ober&#x2F;clb" rel="nofollow">http:&#x2F;&#x2F;zeniv.linux.org.uk&#x2F;~ober&#x2F;clb</a> AWS Cloudtrail parser. <a href="https:&#x2F;&#x2F;github.com&#x2F;kunabi&#x2F;kunabi" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;kunabi&#x2F;kunabi</a>
评论 #13987213 未加载
pnathanabout 8 years ago
Hi, HN! I made this! Ask me any questions you like. I&#x27;ll try to respond as the workday progresses and I wait for deploys to complete!<p>paul@nathan.house if you want to email me instead. (or @p_nathan on Twitter, if that&#x27;s your thing).
评论 #13985095 未加载
评论 #13982105 未加载
评论 #13980733 未加载
znpyabout 8 years ago
Some notes based on my (brief) experience toying with Common Lisp:<p>* Why hasn&#x27;t anyone made a more eye-frendly version of the Common Lisp Hyper Spec ? Having good, easily-browsable documentation is a core-problem.<p>* The relation between the various native data-types were quite unclear to me.<p>* dealing with the external world was quite a mess. Many project&#x2F;libraries implementing only half of something and then got abandoned.<p>* some libraries had a compatibility matrix... with common lisp implementations. that seemed weird to me.
评论 #13980202 未加载
评论 #13980781 未加载
评论 #13980349 未加载
评论 #13980788 未加载
评论 #13984003 未加载
AlexCoventryabout 8 years ago
Can someone point me at an argument for why I&#x27;d want to write CL in 2017, given all the great alternatives available now?
评论 #13980222 未加载
评论 #13985033 未加载
评论 #13979862 未加载
评论 #13981250 未加载
评论 #13984522 未加载
评论 #13981246 未加载
agentultraabout 8 years ago
If you&#x27;re so inclined I&#x27;d make it a &quot;living document&quot; that gets updated as the state-of-the-art evolves. Writing CL in 2017 is not likely to change rapidly in the next decade but even compared to what writing CL was like 8 years ago it has changed enough.<p>Nice job.
评论 #13979377 未加载
评论 #13980229 未加载
TeMPOraLabout 8 years ago
While I remember - we need a refreshed SOTU for 2017. 2015 one[0] seems to be still mostly correct, but the CL scene is pretty active.<p>[0] - <a href="http:&#x2F;&#x2F;eudoxia.me&#x2F;article&#x2F;common-lisp-sotu-2015" rel="nofollow">http:&#x2F;&#x2F;eudoxia.me&#x2F;article&#x2F;common-lisp-sotu-2015</a>
mikelevinsabout 8 years ago
For people using macs, it&#x27;s probably worthwhile to mention CCL&#x27;s IDE, which you can easily build from within the CCL sources using (require :cocoa-application), or which you can get for free from the Mac App Store (it&#x27;s called &quot;Clozure CL&quot;).<p>It&#x27;s a little bit bare bones and a little bit perpetually unfinished, but it works and it gives you a Lisp-aware environment for editingand running Lisp code, and even has a few handy tools.
评论 #13983414 未加载
Grue3about 8 years ago
&gt;Repository for local libraries with the ASD files symlinked in<p>This method is so old, I can&#x27;t believe people are still doing this. You can easily setup ASDF to look in a subtree of a directory and never care about it finding your libraries again.<p>[1] <a href="https:&#x2F;&#x2F;common-lisp.net&#x2F;project&#x2F;asdf&#x2F;asdf.html#Configuring-ASDF-to-find-your-systems" rel="nofollow">https:&#x2F;&#x2F;common-lisp.net&#x2F;project&#x2F;asdf&#x2F;asdf.html#Configuring-A...</a>
edemabout 8 years ago
How does Common Lisp compares to Racket nowadays? I&#x27;ve seen a lot of activity but I can&#x27;t decide which one to try out. I only have time for one of them ATM.
评论 #13982370 未加载
评论 #13981987 未加载
评论 #13986172 未加载
lisperabout 8 years ago
If you have a Mac you should try Clozure Common Lisp (<a href="http:&#x2F;&#x2F;ccl.clozure.com" rel="nofollow">http:&#x2F;&#x2F;ccl.clozure.com</a>). It has an integrated IDE so you don&#x27;t have to futz with emacs and slime.<p>Also, this library smooths over some of CL&#x27;s rough edges:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;rongarret&#x2F;ergolib" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;rongarret&#x2F;ergolib</a>
gravypodabout 8 years ago
If this could have a &quot;start&quot; page and a &quot;next&quot; button that will take me from topic to topic in order I&#x27;d enjoy that.
ntdefabout 8 years ago
Ah yes this is exactly what I needed. I was recently trying to start a CL project but I had trouble wading through all the outdated material, especially with regards to including external packages. Thanks for putting this together!
评论 #13979638 未加载
GreyZephyrabout 8 years ago
Wondering if anyone has any experience using lisp for machine learning? I&#x27;m aware of mgl[0], but it seems to be abandoned. The lack any wrappers for tensor flow or caffe is also a bit surprising to me. The cliki page [1] is also unhelpful and out of date. Is machine learning on lisp dead or are there projects out there that I&#x27;m just not aware of?<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;melisgl&#x2F;mgl" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;melisgl&#x2F;mgl</a><p>[1] <a href="http:&#x2F;&#x2F;www.cliki.net&#x2F;machine%20learning" rel="nofollow">http:&#x2F;&#x2F;www.cliki.net&#x2F;machine%20learning</a>
评论 #13987548 未加载
juanreabout 8 years ago
I wrote in Common Lisp the star map generation software at the core of my startup, <a href="http:&#x2F;&#x2F;greaterskies.com" rel="nofollow">http:&#x2F;&#x2F;greaterskies.com</a>, and could not be happier. But now that it&#x27;s getting off the ground I wonder whether it may adversely impact my chances of being acquired. Are there any known examples of recent CL-based startups?
评论 #13984692 未加载
评论 #13984895 未加载
na85about 8 years ago
If emacs is an obstacle to Common Lisp in 2017, maybe what&#x27;s needed is a Lisp-interaction plugin for vi(m) (or whatever it is that vim uses in lieu of emacs modes). I don&#x27;t get the hype for modal editing but you can&#x27;t argue with the data clearly showing emacs users are in the minority.
评论 #13979947 未加载
评论 #13983594 未加载
评论 #13998792 未加载
评论 #13983764 未加载
评论 #13982856 未加载
评论 #13981229 未加载
maccoabout 8 years ago
If somebody is not comfortable to use emacs (I am), there is a atom plugin for use with CL: <a href="https:&#x2F;&#x2F;atom.io&#x2F;packages&#x2F;atom-slime" rel="nofollow">https:&#x2F;&#x2F;atom.io&#x2F;packages&#x2F;atom-slime</a><p>It doesn&#x27;t replace emacs, but it works as a first Lisp ide.
评论 #13980250 未加载
评论 #13980507 未加载
s_kilkabout 8 years ago
While people are directing their attention here:<p>Last year I looked into Common Lisp for a while, but got turned off when I found that there&#x27;s no distinction between the empty list and boolean false (or nil, in CL-speak).<p>I found this kinda weird and vaguely off-putting. I don&#x27;t want to write code to handle the diffence between, say, an empty array and false or null in deserialized JSON data.<p>Can anyone comment on whether this comes up as an actual issue in practice?
评论 #13980750 未加载
评论 #13981618 未加载
cody8295about 8 years ago
Probably the worst implementation of the 5-puzzle problem you can write.<p>Artificial Intelligence Assignment 1<p>Problem 09: Write GET-NEW-STATES to implement all possible movements of the empty tile for a given state.<p>CG-USER(151): (defun get-new-states (state) (setf new-states &#x27;()) (cond ((= 0 (first state)) (setf new-states (list (list (second state) 0 (third state) (fourth state) (fifth state) (sixth state)) (list (fourth state) (second state) (third state) 0 (fifth state) (sixth state))))) ((= 0 (second state)) (setf new-states (list (list (first state) (fifth state) (third state) (fourth state) 0 (sixth state)) (list 0 (first state) (third state) (fourth state) (fifth state) (sixth state)) (list (first state) (third state) 0 (fourth state) (fifth state) (sixth state))))) ((= 0 (third state)) (setf new-states (list (list (first state) 0 (second state) (fourth state) (fifth state) (sixth state)) (list (first state) (second state) (sixth state) (fourth state) (fifth state) 0)))) ((= 0 (fourth state)) (setf new-states (list (list 0 (second state) (third state) (first state) (fifth state) (sixth state)) (list (first state) (second state) (third state) (fifth state) 0 (sixth state))))) ((= 0 (fifth state)) (setf new-states (list (list (first state) 0 (third state) (fourth state) (second state) (sixth state)) (list (first state) (second state) (third state) 0 (fourth state) (sixth state)) (list (first state) (second state) (third state) (fourth state) (sixth state) 0)))) ((= 0 (sixth state)) (setf new-states (list (list (first state) (second state) 0 (fourth state) (fifth state) (third state)) (list (first state) (second state) (third state) (fourth state) 0 (fifth state)))))))<p>GET-NEW-STATES<p>CG-USER(152): (get-new-states &#x27;(1 2 3 4 5 0))<p>((1 2 0 4 5 3) (1 2 3 4 0 5))<p>CG-USER(153): (get-new-states &#x27;(1 2 3 4 0 5))<p>((1 0 3 4 2 5) (1 2 3 0 4 5) (1 2 3 4 5 0))<p>CG-USER(154): (get-new-states &#x27;(1 2 3 0 4 5))<p>((0 2 3 1 4 5) (1 2 3 4 0 5))<p>CG-USER(155): (get-new-states &#x27;(1 2 0 3 4 5))<p>((1 0 2 3 4 5) (1 2 5 3 4 0))<p>CG-USER(156): (get-new-states &#x27;(1 0 2 3 4 5))<p>((1 4 2 3 0 5) (0 1 2 3 4 5) (1 2 0 3 4 5))<p>CG-USER(157): (get-new-states &#x27;(0 1 2 3 4 5))<p>((1 0 2 3 4 5) (3 1 2 0 4 5))
throwaway7645about 8 years ago
&quot;Dear windows user, tell us how this is done for SBCL&quot;<p>Watch YouTube video from Baggers. It&#x27;s a lot more complicated than your average windows user will want to go through. Than you have to setup EMACS, quicklisp...etc. I never really new what quicklisp was doing and it made me nervous (I trust VS nuget).
评论 #13981223 未加载
评论 #13981231 未加载
评论 #13980863 未加载
评论 #13985049 未加载
tarrsalahabout 8 years ago
A newbie question please, How to deploy CL on production? I mean for long running programs.
评论 #13986591 未加载
killin_danabout 8 years ago
The biggest problem with lisp adoption imo is that the first step of every path begins with emacs.<p>Emacs needs to die for lisp to flourish in a more modern editor.<p>Light Table was a good start, but we need some power behind similar projects.<p>I always thought guilemacs was the obvious successor, but it still hasn&#x27;t happened.
评论 #13986290 未加载
评论 #13986272 未加载
评论 #13984996 未加载
quickoatsabout 8 years ago
i do not know how to message the guy &quot;Scott&quot; author of page, so i am putting this here.<p>in the &quot;LispWorks CL&quot; page, under &quot;Implementations&quot;, the &quot;Notes&quot; section elicidates a mystery about the Personal Edition not recognizing the lisp init files. This is actually a limitation in LispWorks Personal Edition which is described on the link provided to retrieve said edition.
评论 #13980166 未加载
评论 #13980281 未加载
leraxabout 8 years ago
NICE!
ConanRusabout 8 years ago
Short answer: don&#x27;t do that, use Clojure instead. It doesn&#x27;t have any of listed problems.
评论 #13979569 未加载
评论 #13979366 未加载
评论 #13979437 未加载
评论 #13981241 未加载
lenkiteabout 8 years ago
I wish an experienced LISPer would explain why should one use Common Lisp over a language like Golang. Golang now has <a href="https:&#x2F;&#x2F;github.com&#x2F;glycerine&#x2F;zygomys" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;glycerine&#x2F;zygomys</a> for scripting. For that matter, why would one choose Common Lisp over GNU guile ? (guile now supports fibers). What does Common Lisp offer for the working programmer that is an advantage over other languages ?
评论 #13979791 未加载
评论 #13979758 未加载
评论 #13979633 未加载
评论 #13979759 未加载
评论 #13979564 未加载
评论 #13979669 未加载