Live data from Hacker News

Janet – a Lisp-like functional, imperative programming language

github.com

51–60 of 143 posts

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

#51

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 using it for some side projects, combined with htmx (htmx.org).

What I like:

1. The applications start really quickly, compared to Clojure.

2. It feels like I could learn everything about the language if I ever want to dive into the internals. With Clojure/Babashka I don't think that would be possible for me.

3. A bit vague, but it really feels nice to program in this language. I can easily get things to work, I can mess around in a REPL if I want to, and #4:

4. The community is great. Instead of searching on the internet, when I don't know how to do something, I ask a question on gitter / matrix and before long there's an answer from a more experienced person (sometimes even from the creator of the language).

5. The package manager (JPM) is really easy to use.

6. In terms of download size, Janet it tiny. But compared to Lua, it's way more "batteries included" due to the great standard library.

What could be better:

1. Tooling I guess, but that's logical for younger languages. I use Olical his "Conjure" Neovim plugin, which is great. I don't think it's possible to jump to the definition of a function name if my cursor is on it. Maybe that's normally done through LSP in Conjure, I'm not sure. I don't know if there are plans to add LSP support to Janet?

2. I just found out a couple of days ago that Janet has no `set` datastructure. You can work around this by using a hashmap where each key maps to a value of true, or you can use a library that adds the datastructure.

3. Not sure if this would have downsides in Janet, but something I really like about Clojure is that you can use a lot of standard library functions on all data types. In Janet sometimes you have to look up a function specific to a data type, where Clojure would be more agnostic - with functions that work on different datatypes in an expected way, and return a `sequence`.

4. Some library authors have the tendency to use "The Good Place" references in their library names. I know the name "Janet" is a reference to that series, and I know developers in all languages are always trying to be funny. But finding a library called "html" (by swlkr) is way more helpful than finding one named after some character from a series.

What I think I will like, but haven't tried yet:

1. Object Oriented Programming in Janet seems nice (https://janet-lang.org/docs/object_oriented.html).

2. PEG (Parsing Expression Grammars - https://janet-lang.org/docs/peg.html )

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

#52
post #21

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 wrote a few websites with it, notably: https://github.com/swlkr/janetdocs I also scraped together a large web framework and a small one: https://github.com/joy-framework/joy https://github.com/swlkr/osprey

Thanks for all of your work Sean. I've messed around a bit with Joy and have been keeping an eye on the development of the framework.

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

#53
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…

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

Why do you assume programming langauges with female coded names are because the creator is viewing it as a girlfriend?

Not all creators are heterosexual males (or otherwise oriented toward females as preferred or even acceptable romantic partners), and even those that are don’t necessarily view women exclusively through the lens of romantic involvement such that that would be the implication of a female name. Also, not all female-coded names are actually female in reference (Janet is named after a character that is expressly not a woman.)

> A programming language doesn't feel much anthropomorphizable to me, let alone lady-like.

Why “let alone lady-like”? Why are female-coded names a particular issue, if the problem is that programming languages aren't “anthropomorphizable”? (I don't actually think naming things after people is inherently about anthropomorphization; we do it to freeways and bridges and other things as an honor, not as anthropomorphization.)

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

#54

Maybe I'm just too pedantic, but this is not a functional language. Yes, you can write functional style code, but you can write functional style code in C, C++, Java, Python, JS, Ruby, Common Lisp, Scheme, etc etc. That does not make any of these languages 'functional'.

Functional doesn't really have a consistent definition, and you end up always with "yeah but"s in any discussion e.g. haskell isn't functional because C ffi and unsafePerformIO.

Point being, its very hard to say "X is or is not functional", as there isn't an objective consideration.

(FYI, I love Haskell and use it daily and write it professionally)

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

#55

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 use Janet most often as a glue for shell utilities using the sh package (https://github.com/andrewchambers/janet-sh). It's a great tool for building small containerized jobs. I think it has a ton of potential as the ecosystem grows and matures.

Some rough spots:

- No canonical http client. There are a few attempts at wrapping libcurl but nothing complete and well documented yet. However, the creator of Joy framework for Janet does have an http client library.

- The main http server circlet is MIT licensed, but it is built on top of Mongoose, which is GPL/paid commercial. Something to be aware of if you want to distribute binaries made with this library.

- I have never been successful getting any of the UI or drawing libraries to work.

- Naming of packages is a bit confusing even if you have watched the Good Place and are aware of all of the inside jokes.

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

#56
post #43

Earlier quoted context omitted.

I'm using your html library (a Clojure hiccup clone, sort of) and tw (tailwind) library, and often use janetdocs to find examples of how to use Janet functions. Thanks a lot man!

Hey! It's nice to see someone using the stack! What's funny about tw is that it was kind of like a ghetto tailwind jit before it was released! Janet can really help you move fast

Haha, I like that description: "ghetto tailwind jit".

From your blog it seems like you're not really using it yourself anymore, though?

I tried to add a styling thingy (sorry, really not familiar with the terminology) to `tw` to add support for "print" media queries (like this: https://tailwindcss.com/docs/breakpoints#styling-for-print), but didn't get it to work on the first try. If I do make it work I'll create a PR :)

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

#57

Maybe I'm just too pedantic, but this is not a functional language. Yes, you can write functional style code, but you can write functional style code in C, C++, Java, Python, JS, Ruby, Common Lisp, Scheme, etc etc. That does not make any of these languages 'functional'.

The main question for me is whether it has persistent data structures with structural sharing. If it has that, I'm happy to call it "functional." Without that it's hard to write efficient pure functions.

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

#58
post #34
post #18

Earlier quoted context omitted.

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

I wrote similar here: https://github.com/ahungry/janet-pobox although it probably needs updates to work with 1.18 and above.

Oh, that's really cool. :) Thanks for mentioning it.

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

#59
post #55

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 use Janet most often as a glue for shell utilities using the sh package ( https://github.com/andrewchambers/janet-sh ). It's a great tool for building small containerized jobs. I think it has a ton of potential as the ecosystem grows and matures. Some rough spots: - No canonical http client. There are a few attempts at wrapping libcurl but nothing complete and well documented yet. However, the creator of Joy framew…

> I have never been successful getting any of the UI or drawing libraries to work.

Have you tried jaylib (built on top of raylib)? I have gotten that to work well on macos, linux and windows. :)

> The main http server circlet is MIT licensed, but it is built on top of Mongoose, which is GPL/paid commercial. Something to be aware of if you want to distribute binaries made with this library.

While I haven't used it outside of development, chidi is MIT licensed. :) https://git.sr.ht/~pepe/chidi

Post reply on HN