6 ms·
What makes a modern Lisp? I am aware of Fennel and Jannet. Anyone havng experience with one of those or another one I am not aware of?
by jhoechtl 1y ago
What makes a modern Lisp? I am aware of Fennel and Jannet. Anyone havng experience with one of those or another one I am not aware of?
- xlii 1y agoHaving experience with many IMO it's all about value added. There might be concurrency, message passing (Janet) od global scope isolation (Fennel). Personally I had difficulty getting into Fennel, but no problems incorporating Janet into my flow even though the author is the same. I'm not a fan of hygienic macros though. I would add Clojure to the modern Lisps, too, which I find the most feature rich (even though had much more blast writing Janet).
- TacticalCoder 1y ago> I would add Clojure to the modern Lisps, too, which I find the most feature rich (even though had much more blast writing Janet). Yup. Clojure may not be the most lispy Lisp but it reaches: it works on top of the JVM (with super easy Java interop), it transpiles to JavaScript and I also use it to write script using Babashka (GraalVM/AOT native Clojure interpreter which starts in milliseconds, avoiding JVM startup time [notoriously slow for regular Clojure programs]). Being able to share code between Clojure and ClojureScript is really sweet. Clojure(Script) / Emacs (CIDER) / eglot (LSP client for Emacs): life is good!
- neutronicus 1y agoI know the homoiconicity purists hate the additional braces in Clojure, but I consider the literal vectors and hash tables a pretty big win over `#()` and the mess that is dealing with hash tables in CL.
- foxygen 1y ago"homoiconicity purists" is probably the wrong term, as Clojure is homoiconic. Probably "Lisp purists" would fit better.
- vindarel 1y agoFor CL hash-tables I can recommend serapeum's dict: (dict :a 1 :b 2) (it's an 'equal HT) With toggle-pretty-print-hash-table it will pretty-print its content, readably.
- tmtvl 1y agoCommon Lisp, which I would consider the most modern, has convenience features which most other languages (even other Lisps) lack. CLOS, macro expansion, and, of course, the condition system.
- terminalbraid 1y agoWhich lisps lack a macro expansion system?
- tmtvl 1y agoR7RS (small, at least) doesn't seem to have macro-expand. R6RS also doesn't appear to have it.
- kryptiskt 1y agoR6RS has syntax-case macros which is superior to Common Lisp macros in every respect, they're both hygienic and can be used to implement a sloppy macro system if one so wishes.
- tmtvl 1y agoI think we're talking past each other. I mean something like: (macroexpand '(when-let (foo (frob bar)) (jib foo))) ;; (let ((foo (frob bar))) ;; (when foo ;; (jib foo)))
- ashton314 1y ago`syntax-rules` is very good and you can do a whole lot with them. However, you are limited to template -> pattern transformations, and there are plenty of macros that you cannot write this way. (E.g. anything requiring a predicate on the source syntax that you can't express in the template language, etc.) For that, you need the full power of procedural macros. Racket improves on Scheme: its macros are fully hygienic whilst not being limited to template -> pattern transforms. See https://docs.racket-lang.org/guide/macro-transformers.html https://docs.racket-lang.org/guide/macro-transformers.html EDIT: syntax-case -> syntax-rules; R6RS specifies the latter—I believe the former is a Racket construct equivalent in power to `syntax-rules`.
- radiator 1y agoJanet (with one l) is modern because it is, well, new. It doesn't need to carry the historical baggage of Common Lisp. It has many data structures, a concurrency model, it is suitable for functional programming and for object-oriented programming. It has libraries for common tasks and is well documented.
- ritenuto 1y ago> Janet (with one l) Typo, it should be: “with one n” (as the earlier commenter wrote “Jannet”). It took me a while to parse this, I was searching for the nonexistent “l” embarrassingly long.
- giraffe_lady 1y agoI've used both they're both good. I use fennel more because I have to write a lot of lua and don't really like it. Fennel drops in easily, can share tables and functions both ways, and fixes a lot of lua's (non-tooling related) warts. Janet is also very good, I like it a lot I just don't have a ton of use for it. It's good as a high level scripting or glue language, but then so also are ruby, python, node, elixir, raku, and so on you probably already know several so it's hard to justify learning another. It's pleasant though. I think janet is actually an extremely strong lua competitor for embedding, it takes the best parts of lua's design on that front but also includes excellent tools for implementing parsers and DSLs (PEG lib in the language core! and macros) which is most of the time what you're embedding lua for in the first place. So basically janet is good to replace lua, and fennel is good when you can't replace lua. Re: lisp. I think the main thing about "modern" lisps is that they don't use a cons cell or linked list as the main data structure, though they still use it for code structure. These two (and also clojure) use hashmaps and arrays a lot more, and have lispy ways of interacting with them. Some nerds will say it's not really a lisp for this reason and to them I say "ok."