6 ms·
Code as data is such a big deal that - whatever you say - I will never ever understand why we don't all do Lisps.
by patkai 9y ago
Code as data is such a big deal that - whatever you say - I will never ever understand why we don't all do Lisps.
- xstartup 9y agoWhat's the most popular Lisp in use today? Does it come with a static compile type checking?
- deleted 9y ago[deleted]
- reikonomusha 9y agoOne of the most popular Common Lisps is Steel Bank Common Lisp (SBCL) [0], which has some degree of compile time type checking and compile time type inference. [0] http://www.sbcl.org/ http://www.sbcl.org/
- sillysaurus3 9y agoRather than most popular, I propose using the most useful. That'd be Lumen. http://github.com/sctb/lumen http://github.com/sctb/lumen It's the only lisp that can interface seamlessly with any JS library you want. Just `npm i leftpad && LUMEN_HOST=node lumen` and type `(require 'leftpad)`. $ npm i leftpad $ LUMEN_HOST=node lumen > (require 'leftpad) function > ((require 'leftpad) "foo" 5) "00foo" Other lisps are nice, but they all try to build their own ecosystems instead of use existing infrastructure. So if you want to do webdev and run into a problem with the library, your only option is to fix it yourself or write your own, since most people don't use lisp for webdev. That brings us to Clojure: the prima facie "lisp for webdev". It's a good lisp, but it forces you into non-optional immutability. That's a feature for some and a burden for others. And it's very difficult to transpile into JS. In an era where size and speed matter due to bandwidth concerns, this is a severe limitation. That said, all of the lisps are a delight to use in their own way. Racket is fun to wrestle with, mostly to coerce it into doing what you want. SBCL is neat for doing archeology in -- you can run all kinds of interesting old programs. Elisp is fun because you can extend your editor to do anything you can imagine. Arc powers the website you're reading this on, and its underlying ideas are worth internalizing.
- bpicolo 9y ago> And it's very difficult to transpile into JS How so? The Clojurescript compiler works great and has a massive variety of libraries available, and optimizes well thanks to the closure compiler
- didibus 9y agoImmutability is optional in Clojure, though it is the default. Also I'm confused what you mean with size and speed mattering, ClojureScript does better then most by going through the Google Closure compiler for minification and dead code elimination.
- rcarmo 9y agoLumen seems interesting, but at a quick glance the GitHub repo has zero information as to how to install it and getting it to run. Is it an npm package/lua rock as well? (edit: it's all in the repo.) Follow-up: I don't see much in the way of interop documentation... Pointers?
- sillysaurus3 9y agoThe cool thing is, there's no interop. It's literally JS or Lua. Think of it like CoffeeScript -- there's no "interop" between CoffeeScript and JS. It's just JS. You can see what each expression compiles to by passing it through (print (compile (expand ...))) For example: > ((require 'leftpad) "foo" 5) "00foo" > (print (compile (expand '((require 'leftpad) "foo" 5)))) require("leftpad")("foo", 5) And of course, you can use macros to shorten this > (define-macro see (x) `(print (compile (expand ',x)))) (macro: function) > (fn (x) (+ x 1)) function > (see (fn (x) (+ x 1))) function (x) { return x + 1; } The best way to learn it is to read test.l and mess around with the expressions while running `make test` to see what breaks. If you have questions, be sure to reach out or post them here. The maintainer is also quite responsive to opening new issues.
- rcarmo 9y agoBy interop I mean how to interact with existing functions (fine, most of the above covers that) and syntax for accessing data structures (arrays, tables, etc.).
- flavio81 9y ago>What's the most popular Lisp in use today? At least if based in 2016 GitHub popularity: http://sogrady-media.redmonk.com/sogrady/files/2016/07/lang.rank_.Q316.plot-WM.png http://sogrady-media.redmonk.com/sogrady/files/2016/07/lang.... #1 Emacs Lisp #2 Common Lisp #3 Scheme #4 Racket Unless you consider Clojure a Lisp (yes it is, and no, it isn't...), in which case #1 would be Clojure, and then the others listed above.
- peatmoss 9y agoYou can mostly combine 3 & 4 on that list. Racket (formerly PLT Scheme) has moved beyond Scheme in many ways (language features, batteries), but is still exceptionally similar.
- cube2222 9y agoWhy would clojure not be considered a lisp? (I'm curious)
- flavio81 9y agoSee this subthread and answers by LispM: https://news.ycombinator.com/item?id=10207616 https://news.ycombinator.com/item?id=10207616
- throwaway7645 9y agoThere's a website article called "Clojure Sucks" that is written by a Common Lisp user who uses a symbolics lisp machine and has some interesting insight although it is very aggressive.
- thomastjeffery 9y agoIf you are interested in getting into lisp, I would recommend you start with Racket. Racket has several different languages (the main one called racket) that are all trivially interoperable. If you want static types, there is typed racket.
- baldfat 9y agoRacket is the best Lisp to learn for a few reasons: 1. It was designed to be a teaching language 2. Everything included. You get a great simple IDE and a ton of packages 3. Great teaching materials (I learned the most from HTDP than any other programming book and I have read a ton) a) How to Design Programs http://www.ccs.neu.edu/home/matthias/HtDP2e/ http://www.ccs.neu.edu/home/matthias/HtDP2e/ b) http://realmofracket.com/ http://realmofracket.com/ . Great book I learned a ton and especially when I went through the book with my 11 year old daughter 4. The great minds of Lisp are at Racket (Ever read Little Schemer?) 5. Racket keeps getting better and better with great modern ideas. It might have been born from Academia it has awesome real world legs. Just look how easy it is to deploy your program after you are done. 6. Best documentation system of any language. The documentation is code and it makes for great documents. http://docs.racket-lang.org/ http://docs.racket-lang.org/
- throwaway7645 9y agoRacket isn't near as fast as SBCL though. However, now that Chez Scheme is open source, Racket is in the process of leveraging that run time. Also I don't know, but would guess deployment is easier with SBCL as it can build a standalone executable (albeit it is very large due to saving the running image).
- reikonomusha 9y ago10-20 MB isn't large these days, especially when every iPhone app update is on the order of 60-200 MB.
- throwaway7645 9y agoI guess it's all based on perspective. Comparing to C, D, Nim...etc, it's huge. However, the mathematical model my company exports alone is 10-22 MB alone in just text or binary form (no code), so yeeeaaa I see what you're saying :)
- pjmlp 9y agoDepends if you mean free or commercial. For the free ones, there are already plenty of answers. For the commercial ones, that would be Allegro Common Lisp and LispWorks, both having a complete "Lisp Machine" like experience, given that they are around for a few decades.
- ACow_Adonis 9y agoAnother vote for Common Lisp here.
- icholy 9y ago5 years ago I was in the same boat. Now I'm in love with Go .. funny how things turn out ¯\_(ツ)_/¯
- jimbokun 9y agoWhat changed?
- pavement 9y agoLikely, employers and what is possible in the immediate day-to-day sense.
- lopatin 9y agoI currently love both Go and Lisp. They are the opposites of each other. And good for different things.
- gregman1 9y agoThey have still one thing in common - that are not oop!
- cube2222 9y agoWell, Go really is oop, it just favors composition over inheritance, but it's still oop. (Not stating this as a bad thing, just as a fact)
- kbp 9y agoMost Lisps have object systems; Common Lisp was the first ANSI-standardised language with one.
- cicero 9y agoIn most Lisps, objects are an option, as opposed to languages like Java.
- tzahola 9y agoIt’s too powerful for the average programmer. Hell, even javascript is too powerful, just look at how a >1 year old codebase looks like.