Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> 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.



The 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_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


I don't understand the rationale of people tying the state of being a "real Lisp" with cons cells. As if that were the only contribution lisp has made, instead of homoiconicity, REPL-focus, etc.

The polymorphic sequence abstraction in Clojure is the definitively modern way to manipulate data structures in a lisp family language nowadays. It retains `first` and `rest` as abstracted `car` and `cdr`, but in return all collections (vectors, lists, sets, and hashtables) work transparently with it.


What 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?


I 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.


"I mostly stick to using it as a gluing tool for shell scripts for now." You might like https://github.com/babashka/babashka then.


I'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.


Many 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.


I 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.


Some 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.


> 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.


> '(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) .


I stand corrected. I used Clojure briefly a few years ago, so I don't remember much. I even ran a REPL and checked if it's a valid syntax, but it didn't occur to me to check its type. Sorry!


R also has cons cells, called pairlists. They are generally only used for function arguments though.


> I don't think I ever heard anyone calling Prolog a Lisp though.

I guess we can agree that it's not a sufficient condition, but from my selection of languages you may consider that maybe I meant it as a necessary condition.

Another interesting separator is: does it include "Lisp" in its name? Scheme and Dylan don't. Maybe people don't use "Lisp" in the name to indicate that they intend the language to break away in some way from the Lisp tradition. In a similar way, Racket broke away from Scheme tradition, for example.

Kent Pitman, in his "Lambda the Ultimate Political Party" article, wrote that people have been writing programs to help transition code written in the older dialects to the new dialects. The fact that it's doable without expending too much energy also suggests close relationship. Some months ago I wrote some <100 lines of code, consisting mostly in a bunch of macros, to make a program using Flavors work on Common Lisp with CLOS. Are the people using Clojure, Janet, etc. doing this? Can they pick up an old program written in another Lisp dialect that's close to them and, with not too much fuss, make it run? Which dialect would that be?


  user=> (rest '(3 . 4))
  (. 4)

  user=> (second '(3 . 4))
  .

  user=> (nth '(3 . 4) 2)
  4


Yes, I was wrong, my bad :)




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: