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)
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.
Thanks so much for the info and commentary!
If you do try it out, I'd be happy for any feedback on Freja! :)
I should mention that Windows support is currently a bit behind, so if you're on Windows I could fix that then comment here again when it's done. :)
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:
Except... without the rich standard library :)
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
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
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 :)
I always look forward to any and all PRs!
Edit: Yeah I haven't used it lately, I currently use roda + sequel now (ruby libraries).
I have limited time after work and I really want to get some "SaaS apps" up and running, so the trade-off was spend less time on libraries and more time on applications.
I’m currently working on ruby stuff on stream but maybe I won’t be able to stay away from Janet for long
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.
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
The http server used in Chidi is actually fairly new and I was not aware of it. It is part of the spork package. About two months ago I chatted with the creator of Janet about whether or not an http server will be added. He said it would not be added to core, but it looks like he added to spork about a month ago. It looks like it is a pure Janet implementation so there should be no licensing conflicts. I'll have to try it out.
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 )