6 ms·
I've never ventured into a lisp like language. Would you recommend starting with common lisp or is jumping into clojure ok? I have been in the JS, Java, Python
by fokinsean 9y ago
I've never ventured into a lisp like language. Would you recommend starting with common lisp or is jumping into clojure ok?
I have been in the JS, Java, Python world for a while and this looks like a language that could stretch my brain a little bit.
- justinhj 9y agoI learned scheme and emacs lisp before starting to use Common Lisp and then Clojure. There are differences between all of them but there's a big enough overlap you won't be wasting your time if you end up switching between them. Clojure is nice if you're already used to working with the JVM
- reikonomusha 9y agoIf you want your brain stretched, I recommend Common Lisp. The #1 issue for folks in my experience had been getting an environment set up. Emacs, SLIME, encodings, paredit, ... . It's a big barrier to entry.
- TeMPOraL 9y agoI agree (I know I had my issues with Emacs and SLIME when I started; being on Windows didn't particularly help). That said, for people who want to start with CL now, I'd recommend grabbing https://shinmera.github.io/portacle/ https://shinmera.github.io/portacle/. It's a portable Lisp IDE based off a pre-configured Emacs + SLIME + SBCL + Quicklisp + Git combo. I can confirm that it Just Works, out of the box.
- iak8god 9y agoPortacle looks very nice. Is anyone here aware of a similar plug & play Emacs-based IDE for Clojure?
- pjmlp 9y agoCider. https://cider.readthedocs.io/en/latest/ https://cider.readthedocs.io/en/latest/
- iak8god 9y agoI know about cider, but what I'm looking for is a decent, quick download & click to run environment that will let me play around with Clojure. Something you could hand to intro to programming students and have them writing code in a repl in sixty seconds.
- kornish 9y agoHaven't followed its development for a long while but Light Table might be what you're looking for: http://lighttable.com/ http://lighttable.com/
- iak8god 9y agoI'll check it out, thanks!
- Scarbutt 9y agohttps://sekao.net/nightlight/ https://sekao.net/nightlight/
- iak8god 9y agoThis looks nice & I'll check it out, but at first glance it doesn't seem to be as simple as what I'm looking for: "For Leiningen users... Add it to your ~/.lein/profiles.clj:" I truly want something that's not for "Leningen users" (or "Boot users") but for people who've never heard of any of those things and just need to start learning how to write code (in Clojure).
- brudgers 9y agoPortacle is a great project. My concern with it as a recommendation is that Lispbox was a great project too, until it wasn't...or rather that the enthusiasm of the maintainers of easy to use Common Lisp projects seems likely to be shorter lived than Common Lisp (though perhaps Github may make this less a potential problem). The fact that people get paid to improve and maintain the Racket ecosystem as part of their day jobs in academia is one of the reasons I recommend it for 'how should I start exploring Lisp' (versus learning Common Lisp). https://common-lisp.net/project/lispbox/ https://common-lisp.net/project/lispbox/
- TeMPOraL 9y ago> the enthusiasm of the maintainers of easy to use Common Lisp projects seems likely to be shorter lived than Common Lisp Not surprising, given that Common Lisp itself is pretty much immortal compared to the typical lifetime of things in our industry :). That said, I know what you mean. I started with Lispbox years ago, and it was already feeling its age back then. I agree with your observation. Sadly, the commercial CL scene seems pretty weak - the two big players (Franz and LispWorks) seem to mostly keep to themselves and focus on the commercial tools they offer.
- brudgers 9y agoOne of the 'legacy' features of the Common Lisp community is that it is socially acceptable to charge $2000 per year per seat for software. Though it is not something that I personally have a problem with, my view that paying for software is ok is not all that mainstream these days (imagine paying for a web browser). What I like about Common Lisp is that it is not in flux and so when I Google up a question, the information I get may be ten years old but it is highly likely to be correct. The price is that the format of the information may be more like a technical textbook than a blog or a StackOverflow answer.
- ohyes 9y agoRoswell solves this problem completely. Quick lisp solved it mostly, but Roswell is the finishing touch in my opinion. https://github.com/roswell/roswell https://github.com/roswell/roswell
- aerique 9y agoJust any text editor and reloading the file one's editing works fine as well: shell$ sbcl [... some editing ...] sbcl> (load "file.lisp") As for which Lisp. I advise Common Lisp since it's the most practical of the lot. Doesn't force you into a particular paradigm.
- flavio81 9y agoNo entry barrier anymore with Portacle. Download Portacle, it's a ready to use CL environment, which includes Emacs, SLIME, and the SBCL compiler. Works great! Zero configuration!
- vindarel 9y agoa bit late, but we also have an Atom plugin: https://atom.io/packages/atom-slime https://atom.io/packages/atom-slime !
- rurban 9y agoMy name is in this cookbook, so it's really old. Only a Common Lisp is a Common Lisp, Clojure not, Clozure yes. To stretch your brain also read SICP https://mitpress.mit.edu/sicp/full-text/book/book.html https://mitpress.mit.edu/sicp/full-text/book/book.html
- brudgers 9y agoI'd probably recommend Racket because it is a complete ecosystem in a single download and has many design elements that facilitate onboarding beginners. This is due to Racket (and Scheme in general) having forty plus years of history as teaching languages [though 'teaching language' does not mean a lack of power or unsuitability for production...e.g. Hacker News is built on the Racket ecosystem]. None of this is because Common Lisp is a bad language. However, it does show its age in so far as its approach to documentation and user expectations. Using Common Lisp is similar to using the Unix/Linux command line. The expectation is that the user is willing to read text files that read like man pages and work their way through deep technical documentation...or to put it another way, it is very common to use EMACS when coding Common Lisp [though commercial editors are available]. To me, Clojure reflects a lot of Common Lisp's assumptions about the user being a professional programmer...to the point EMACS is pretty much the default programming environment [though other environments are available that reflect Clojure's Java heritage]. Since I mentioned EMACS twice, EMACS Lisp is another Lisp that is well documented and easy to install (in addition to being a road to EMACS). While it may be called 'a scripting language', on contemporary hardware that doesn't mean much. Just about anything a person would write for learning will run sufficiently fast within EMACS using EMACS Lisp.
- lispm 9y agoThe forty years of a teaching language comes with a cost: zillions of incompatible implementtions and a language which was designed for teaching, retrofitted with more advanced stuff on top which integrate not very well. Common Lisp was designed early as a more practical language. Take for example error handling: Common Lisp has a nice error handling system integrated into the language since the mid 80s. Scheme never had something comparable specified in its standards. Sure you can add error handling on top, but it won't be integrated well into the wider language. There are many aspects where Scheme was underspecified for decades and efforts to redesign the core language were slow, controversial and not really providing nice results. Many Scheme designers wanted the language to be kept as small as possible (R5RS level). The R6RS design was controversial and R7RS 'large' is a very slow effort... In many ways, Common Lisp is as a practical Lisp language better designed than the average Scheme and Racket is just another Scheme going in its own direction. Actually if you read the Racket docs, it is a very complex system. One also could use the excellent Chez Scheme (which now is open source) or Chicken Scheme. The ideas of Racket onboarding beginners is also confusing: multiple languages with some integration mechanism with various degrees of different features and semantics. Much of that is not really needed, but a nice experiment in language modularity. Added to that an IDE which favors batch programming for beginners... In a teaching setting it helps reducing side-effects ... each 'Run' is a new program start.
- pmoriarty 9y agoI'd skip both of them and jump to Scheme. I've found Scheme to be far more elegant than Common Lisp or Clojure, far more modern and less clunky than CL, and you don't have to deal with the JVM or Java as you do with Clojure. Chicken Scheme is my favorite, but Racket or Guile would work too. Guile is good because Emacs is slowly transitioning to using it, and Racket for its great ecosystem. Chicken Scheme itself compiles down to C, so it's quite fast, portable, and light-weight. It also has a great ecosystem, library of eggs, and community. Others have mentioned Elisp, which emacs uses, and that's good too if you are interested in emacs. It would just be a shame to start with it and get the impression that that's the best that a Lisp-like language can offer when it's really rather primitive compared to a modern Scheme, Clojure, or CL. I myself learned Elisp last, after already learning CL and Scheme, and found doing so to be very easy after having learned the others. So I'd really recommend starting with one of the others and learning Elisp last, if you're in to emacs.
- brudgers 9y agoWhat is interesting about eLisp is that Emacs provides an environment where there are lots of low hanging reasons to write a little code in eLisp in order to tweek the Emacs editor to do something new...there's never a shortage of small, interesting, and relevant projects/problems at hand to address in eLisp (and the tooling for tackling that class of projects/problems is very good and always at hand). For exploring Lisps in general, such 'strange loops' around building tools do not seem quite as obvious obvious or natural. Particularly at small scale programs.
- Mediterraneo10 9y ago> Guile is good because Emacs is slowly transitioning to using it Emacs on Guile is nearly a one-man project that has been progressing in fits and starts, and it's not guaranteed that that branch will be adopted as the Emacs mainline. Basically, the Emacs devs are telling the Guile folks that the onus is on them to make something worth integrating into the Emacs core, and so far it's nowhere near that. But it's important to realize that Emacs on Guile is only about using Guile as the runtime for Emacs Lisp, as multiple languages can compile to Guile bytecode, not just Scheme. Even if Emacs on Guile happened, the user would not program in Scheme, but still in Emacs Lisp.
- sillysaurus3 9y agoAs an alternative to the traditional answers here, consider trying Lumen Lisp: https://github.com/sctb/lumen https://github.com/sctb/lumen It's self-hosted in JavaScript and Lua. It matches the JS runtime as closely as possible, so if you're comfortable with JS, Lumen is basically a wrapper around it. Think of it like CoffeeScript on steroids. There isn't a lot of documentation, but if you have any questions I'm happy to answer them.
- jarpineh 9y agoHi @sillysaurus3, I'll bite. Lumen looks interesting and I dug up some HN comments from over the years. Any example apps or sample code anywhere? What about host language access? I'd rather not give up using existing JS and Lua libraries. I can see there's REPL, but is it possible to have dynamic evaluation while running inside web browser? Have you used this inside Nginx's Lua module and/or OpenResty? Why not Python as one target host language? Lists and hashmaps (dictionaries) are pretty prevalent there and I believe continuously developed Lisp dialect is still missing. Thank you for this. I learned new things already.
- sillysaurus3 9y ago> What about host language access? I'd rather not give up using existing JS and Lua libraries. Easy: $ npm i leftpad $ LUMEN_HOST=node lumen > (require 'leftpad) function > ((require 'leftpad) "foo" 10) "0000000foo" > I can see there's REPL, but is it possible to have dynamic evaluation while running inside web browser? Yes, the entire codebase is only 3k lines. You can use browserify, or simply concatenate all the JS files together. Lumen is unopinionated. I've done this before, and I'm more than happy to set you up with a copy-pastable solution if you want. > Have you used this inside Nginx's Lua module and/or OpenResty? No, but there's no reason it wouldn't work. Here's an example of it working in a WASM Lua implementation: https://news.ycombinator.com/item?id=13900453 https://news.ycombinator.com/item?id=13900453 > Why not Python as one target host language? Lists and hashmaps (dictionaries) are pretty prevalent there and I believe continuously developed Lisp dialect is still missing. I've spent time on this! It's a difficult problem. In Lua and JS, you can attach keys and values to arrays. In other words, an array can also be a hashmap. Not so in Python -- or rather, not with the standard Python dict() type. And then you run into problems of interoperability and performance: if it's a non-standard type, other libraries run into problems consuming it. This is less true of Python than other languages, though, so I've been trying to find a happy medium. There are ways of using solely arrays, but it involves having some sort of Keyword type. A normal lisp has those, and typically they use '(a b :x 42) to create an "array" where the first two elements are "a" and "b" and the key "x" has value 42. You can do something similar for Python, and it's an active area of research for me. > Any example apps or sample code anywhere? This is Lumen's strength and weakness. Very few people know about Lumen because of a lack of examples and documentation. However, it's incredibly cool and quite mysterious, and I like that it has a very small following. It makes changing the language much easier. Here's an extensive example: https://github.com/sctb/motor https://github.com/sctb/motor Note that it won't run on the latest Lumen, because dot syntax was recently removed. You'll need to revert to commit `c146de`. But you see how easy it is to morph the language into whatever shape you want, and how powerful it can be.
- pnathan 9y agoCommon Lisp is great. :)
- taeric 9y agoAt the end of the day, it depends on what you are jumping in for. Either language will likely be fun and can get some work done. If you are only interested in getting into the syntax. It almost literally doesn't matter. If you are interested in learning a lot of tricks that you've probably not had a lot of exposure to, CL is almost certainly the more bountiful place to start.