Live data from Hacker News

Janet – a Lisp-like functional, imperative programming language

github.com

111–120 of 143 posts

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

#111
post #106

Earlier quoted context omitted.

Damn, why don't we have programming environments with such capabilities today? (the kind @pjmlp mentioned "images, REPL with typo suggestions, OS wide debugging, code browser", etc." and so on) Not in the @pjmlp kind of availability ("Why you say that? There's this commercial language envinronment from a company in rural Austria that all of 100 companies use and all of 1000 people ever heard of that gives you exactly…

Because those features cost money to develop, and plenty of developers nowadays want to be paid, while refusing to pay for the work of others. So you get what is possible with long nights, weekends and abandoned university thesis after graduation, instead.

>Because those features cost money to develop, and plenty of developers nowadays want to be paid, while refusing to pay for the work of others.

Yes, but v8, Grail, the JVM, .NET takes lots of money to develop as well. Even Swift (despite Apple being stingy, so that is probably just a 5 person team force-fed Jolt Cola) costs a lot. But companies seem to pay for those, but not for those other styles/features.

To be frank, even if we had this technology, but it was a closed source, proprietary affair, I wouldn't want it anyway. That's another must-have feature in 2021 - and it's not just about "not wanting to pay" (I pay for IDEA subscription, for example). It's about what such a license would mean for corporate adoption, ability to tinker with it, reliance on a single vendor, and so on.

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

#112
post #30

Off topic: Is it just me or are there any others who find naming programming languages with women's names a bit weird? Julia, Janet, Eve... I understand the guy referring to his car as his "girlfriend" and give it a women's name. I just can't feel the same about tech. I guess this may be the nerd's way of immortalizing their sweetheart, but if I was a woman I'd rather prefer to be a car and not a programming language…

The julia language is claimed to not named after a woman, and it's considered to be against the community code of conduct to anthropomorphize it. People calling julia their girlfriend get asked to stop pretty quickly.

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

#114

Earlier quoted context omitted.

Good question :) I actually haven't had a good excuse to use the C API yet. When I need C I just code the entire tool in C, or use IPC.

Dumb question: Is IPC Inter-Process Communication? Or is it an unrelated tool?

> Is IPC Inter-Process Communication? Or is it an unrelated tool?

The former. Piping with the shell, or C subprocess hosted by the Janet script, or vice-versa.

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

#115
post #80
post #67

Earlier quoted context omitted.

Disclaimer: I've never used Janet, but I am pretty familiar with Clojure. In Clojure, there are lists, but the most common structure for sequential data is actually a vector [1], which works more-or-less as a slightly modified version of the Clojure version of a hashmap. Advantages of doing it this way is that you get log32 indexed lookup times (vs linear for lists), and you also get log32 [2] append-to-the-end seman…

Phil Bagwell's VList data structure seems really interesting as a way to avoid a bunch of the pitfalls of naive lists performance-wise - the paper's good fun and there seems to be an implementation in racket for anybody who wants to play with it.

The problem with a vlist is that it doesn’t maintain lisp list semantics. You can’t implement setcdr on a vlist. But you can with something like cdr-coding.

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

#116

Earlier quoted context omitted.

This is not correct, lisp operations on lists have always been to modify in place, with copying versions added later. The technology did not exist to do functional programming efficiently enough (and to some extent that technology still does not exist generally).

Simply false. For example, LISP 1.5 manual had this definition for UNION: (union (lambda (x y) (cond ((null x) y) ((member (car x) y) (union (cdr x) y)) (t (cons (car x) (union (cdr x) y)))))) It had a MAPLIST (today called MAPCAR): maplist[x;fn]=[null[x]->NIL; t->cons[fn[x];maplist[cdr[x];fn]]] Or APPEND: append[x;y] = [null[x] -> y; T -> cons[car[x]; append[cdr[x];y]]] Et cetera. Sure, it also had, say, NCONC. But…

[deleted]

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

#118
post #93

Earlier quoted context omitted.

I would say that if you're interested, go for it. My complaints about Janet are not too big. I feel like there are many ways to do some things, and they are all basically the same. Most of this excessive flexibility is inherited from Clojure. 1. It's never clear whether I need `cond` or can get by with `case` until I've waffled around a bit 2. I don't know whether to choose `if`, `and`, or `when`, for conditionals, b…

I'm pretty experienced with Clojure and here are my takes on those: 1. The Janet docs suggest `cond` as a replacement for if-if-else-else chains in other languages and `case` for `switch`-`case` blocks. That's a pretty good rule, although maybe you've already encountered that explanation? My main rule of thumb is that if the important value is "enum-y", representing a particular kind of thing or state, try `case`. If…

This is solid advice. :)

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

#119
post #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.…

> 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. The README briefly mention the C API. How easy is it to use it, and how easy is it to "lift" results from the C API into Janet? (e.g. wrapping an fd from the POSIX API into a file object…

It's easy to treat any C struct as an abstract object in Janet, then have functions that do specific things (e.g. write to the file, read from it, etc). You have to write some manual code, but it's generally not too bad.

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

#120
post #19

Earlier quoted context omitted.

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…

Freja looks really cool! Thanks for sharing it. I find these types of projects very inspiring. They bring back the wonder and joy that I felt when I first discovered computers in the early 80s. You felt like you were in control of a whole new world and anything was possible.

Thank you! That is exactly what I'm going for. :) My friend said "so you're just making basic?", haha.

I didn't get to experience C64 / Amiga era, but after having listened to 100s of interviews with swedish game developers it seems that the automatic (or even required) access to a coding environment sparked a lot of creativity and imagination. :) I hope Freja can capture at least a part of that.

Post reply on HN