Live data from Hacker News

Janet – a Lisp-like functional, imperative programming language

github.com

11–20 of 143 posts

Re: Janet – a Lisp-like functional, imperative programming language

#11
I am a happy though very new Janet user. I started migrating my existing workflow optimization scripts (e.g. Git wrappers) to--and writing new ones--in Janet as of a few months ago. I used to use Perl but I switched to Janet as it is a much simpler language and VM, and being a Lisp is ~infinitely extensible.

Janet has os/ and file/ packages, as well as a PEG system which mostly stand in for the best features of Perl. Some low-level POSIX-specific operations (like daemonizing and forking) aren't practical but I can just use C for those.

I am also using it to teach my son very simple programming. He can't type well yet, so the terseness of the language helps (there are cryptic symbols but he likes learning their names and how to type them). Its REPL and functional style I feel help a lot too.

Re: Janet – a Lisp-like functional, imperative programming language

#14
post #8

Anything new happen with Janet? https://news.ycombinator.com/item?id=28255116 (August 2021) [114 Comments] https://news.ycombinator.com/item?id=23164614 (May 2020) [269 Comments]

Some interesting changes since August this year: - Threaded channels `ev/thread-chan` (`thread` has been deprecated [and removed in latest version [[1.18]]]) - JPM (Janet Package Manager) is now separate, not distributed together with Janet anymore - Janet binary can directly run image files with `-i`

[deleted]

Re: Janet – a Lisp-like functional, imperative programming language

#15

> Multithreading Does it have a global interpreter lock (GIL)?

> Each thread has its own Janet heap, which means threads behave more like processes that communicate by message passing.

https://janet-lang.org/docs/threads.html

Janet doesn’t seem to have shared-memory multithreading. Each thread runs independently, so a GIL should not be necessary.

Re: Janet – a Lisp-like functional, imperative programming language

#18
post #15

> Multithreading Does it have a global interpreter lock (GIL)?

> Each thread has its own Janet heap, which means threads behave more like processes that communicate by message passing. https://janet-lang.org/docs/threads.html Janet doesn’t seem to have shared-memory multithreading. Each thread runs independently, so a GIL should not be necessary.

Though you can share memory manually, i.e. in C but access it from Janet.

Re: Janet – a Lisp-like functional, imperative programming language

#19

This looks really interesting, going to check this out later today. Anyone using Janet for anything that would care to comment on their experience?

I'm making an editor, Freja, which is like a tiny Emacs with graphical support. Makes it fun to create gui apps and games. :)

Ultima Underworld inspired game I'm making for a game jam: https://youtu.be/1fWsV83P-S8

Demo of pixel editor: https://www.youtube.com/watch?v=KOBi805nxNc

Freja: https://github.com/Saikyun/freja

---

My experience has overall been very nice. I come from Clojure, and comparing to that:

- so nice and small! Clojure is great but has a lot of baggage from JVM, for good and bad

- very easy to get started interoping with C. You need to manually wrap libraries, but I think it's pretty easy. As a benefit, you are able to throw exceptions from C that can be catched from Janet. The C support is what sells me on Janet over Clojure

- repl:ing works well, but you can get tripped up by early binding and lack of namespaces. There are ways around it, but when coming from Clojure it was a bit hard to wrap my head around

- many libraries that you'd want are already wrapped, like http-servers and postgresql connections. But ofc this is an area that is thinner than older languages. It's decently easy to wrap C-libs though

- easy to understand data structures if you've used JS / Lua -- "everything is a hashmap" (but there are also arrays and strings)

Re: Janet – a Lisp-like functional, imperative programming language

#20

This looks really interesting, going to check this out later today. Anyone using Janet for anything that would care to comment on their experience?

I've been writing about my first impressions of the language here:

https://ianthehenry.com/posts/janet-game/

Not a whole lot of content yet, but I plan to keep going with it.

I am pretty firmly in the Haskell/OCaml "let me program with types" camp for most development, but it's a great to have a little scripting language to reach for instead of bash or Python or Perl. Using Janet (coming from Python) reminds me a bit of:

https://xkcd.com/353/

Except... without the rich standard library :)

Post reply on HN