5 ms·
Janet is a good option if you are looking for small binaries. Some people argue Janet is not really a lisp. Regardless, it has many lisp features you would ex
by frompdx 6y ago
Janet is a good option if you are looking for small binaries. Some people argue Janet is not really a lisp. Regardless, it has many lisp features you would expect like macros, is cross platform, and can produce statically linked binaries.
- klibertp 6y ago> Some people argue Janet is not really a lisp. Out of curiosity: on what basis? Janet is definitely a Lisp, although it's not the (Common) Lisp.
- aidenn0 6y agoMany people argue that Scheme is not a lisp, so the bar for "some people argue that X is not really a lisp" is fairly low.
- frompdx 6y agoI mostly add that some people argue it is not a lisp because frequently someone will comment saying Janet is not a lisp whenever I mention it in the context of other lisps.
- frompdx 6y agoThe arguments I have seen are based on Janet using arrays/tuples rather than cons cells. Here is the author addressing this on reddit a while back. https://old.reddit.com/r/programming/comments/aqwedz/janet_is_a_tiny_lisp_weighing_in_at_200300_kb_for/egjgw6z/ https://old.reddit.com/r/programming/comments/aqwedz/janet_i... The debate continues in the thread. Either way, I think Janet is very useful for situations where you want something lisp like and also want/need small executables. I've experimented with it quite a bit and have found it really useful for putting together cli apps. The sh package is really useful for gluing together other shell programs. https://github.com/andrewchambers/janet-sh https://github.com/andrewchambers/janet-sh
- klibertp 6y agoWhat a waste of time... It's like the "smug lisp weenies" of ages past somehow slipped into the modern era. Janet is a nice embeddable Lisp (that is: it belongs to the Lisp family of languages). I've been meaning to play with it, but concluded that the lack of (robust) stdlib would make it hard to use for standalone applications. Was it a problem for you in practice, or is the small stdlib enough for CLI apps?
- frompdx 6y agoI do wish there was an http client/server component in the stdlib. That's probably my biggest gripe at the moment. I think things are evolving in the right direction though. Recent updates have added an event loop module and have improved the net module. I can see a future where Janet becomes very useful for network programming. I think http in stdlib plus some growth in the third party package ecosystem will make Janet more viable. I mostly stick to using it as a gluing tool for shell scripts for now. So for my purposes it was fine for CLI apps assuming you are gluing together other cli apps. I could have avoided some gluing if Janet had it's own http client. I spent a while trying to dig into some of the packages and to be honest they just aren't there yet. I really wanted to experiment with building a desktop GUI in Janet but I found that it was too much effort to get started. Cljfx (clojure) and racket/gui both work out of the box with minimal effort.
- lenkite 6y ago"I mostly stick to using it as a gluing tool for shell scripts for now." You might like https://github.com/babashka/babashka https://github.com/babashka/babashka then.
- yumaikas 6y agoI've been using Janet quite a bit for small CLI apps. The stdlib is quite enough for basic CLI apps, especially when you use PEGs. Janet's event loop also makes it very handy for issuing a lot of subprocess calls. Janet has basic HTTP servers and clients, and there is an effort to shore it up there.
- 6y ago
- bluefox 6y agoSome languages that have CONS cells: Common Lisp, Emacs Lisp, Scheme, Dylan, Maclisp, Interlisp, AutoLisp, Lisp Machine Lisp, EuLisp, ISLisp, *Lisp, LeLisp, Lisp 1.5. Some languages that don't have CONS cells: Clojure, Janet, Julia, R. Of course, that is only one attribute, and may not be the most important one, but it's an interesting separating line. If you describe each language by a set of language feature attributes, you can perform some easy computations (e.g., Jaccard distance, or some clustering) to get more clue about how related these languages really are. I think Janet wouldn't fare so bad in relation to obvious Lisps, so I'm not strongly opposed to calling it a Lisp.
- klibertp 6y ago> Some languages that have CONS cells: Erlang and Prolog also use cons cells... Prolog is also homoiconic. I don't think I ever heard anyone calling Prolog a Lisp though. Also, Clojure has cons cells. '(3 . 4) is a valid expression in Clojure. Basically, this is an arbitrary, and rather unhelpful, classification. I don't find it interesting, but to each their own, I guess.
- harryposner 6y agouser=> (rest '(3 . 4)) (. 4) user=> (second '(3 . 4)) . user=> (nth '(3 . 4) 2) 4
- klibertp 6y agoYes, I was wrong, my bad :)
- lispm 6y ago> '(3 . 4) is a valid expression in Clojure True, just not a cons cell. It's a persistentList with three elements: 3, ., and 4. Clojure has a higher-level basic data-structure than the usual Lisp. In those Lisps cons cells are are nothing more than a two-element record, a few basic operations (CONS, CONSP, CAR, CDR, RPLACA, RPLACD) and a special data syntax for them: ( a . b ). In a typical Lisp, the dot is not a list element, but divides the car from the cdr. Additional there is simpler notation for (a . (b . nil)) in the form of (a b) .