probably not a good decision to use `Esc` since browsers have default bindings for it. firefox exits fullscreen on `Esc`
The language. https://janet-lang.org/
If I understand it correctly creating DSLs in it should also be very easy with its macro and PEG feature?
Embedding is really easy, as is writing c modules. You can link shared, or use an amalgamated c file. Check out https://janet-lang.org/capi/embedding.html
Honestly I'm having just as much fun learning Janet as I am writing C modules and embeddings; Janet all the things!
:nonzero-int (* (range "19") (any (range "09")))
:int (+ "0" :nonzero-int)
:decimal (cmt (* (? (<- :int)) "." (<- (some (range "09")))) ,parse-decimal)
:fraction (cmt (\* (? (\* (number :nonzero-int) :s+)) (number :nonzero-int)
"/" (number :nonzero-int)) ,parse-fraction)
:integer (cmt (number :nonzero-int) ,parse-integer)
:num (+ :decimal :fraction :integer)
Janet basically just copies lua's C interop because it's the best part of lua. And then with PEGs and a solid macro system you're in a much better position for scripting, or defining a scripting environment, or a configuration DSL, or whatever you wanted a non-C language for.
The Janet language is named after an immortal being in The Good Place who helps mortals navigate the afterlife, hence the title.
It kinda surprised me that they ship the language with a PEG (parsing expression grammer) instead of a basic Regex engine.
This has been my wish for any programming language that ships a Regex library by default to also include a capable PEG.Janet is my first exposure to PEGs, so nothing to compare against but I love how powerful and easy they are. I have a better grasp of them in only a few months than dabbling over 20yrs with regex.
Also there is quite a bit of The Good Place callbacks within the Janet community; numerous 3rd party modules are named after characters, for example.
btw, I like the namesake, but a language named Janet is pretty much obligated to also prioritize control.
Thank you!
I like it.
I do think the macro example that is early in the book is a little overwhelming; if you can get past that everything is far easier. Whats great is that you can leave the author a comment right from the repl, so I did :)
It doesn't work in my browser - which is understandable because my computer is ancient - but sometimes when I want a break from study in the library I'll spend thirty minutes on a library computer playing in bauble there. I might get around to trying to figure out how the thing works, but the graphics you can make just fiddling with numbers is wild.
Long life to Janet.
error: script:16:1: compile error: unknown symbol twist
in evaluate [lib/evaluator.janet] on line 81, column 7
in bauble-evaluator/evaluate [lib/init.janet] on line 8, column 12
This was like four years ago, so maybe the ecosystem is better now. Or maybe scripting was the wrong ruler to measure Janet by. I don’t know but this post is making me want to reinstall it.
The docs are decent, though I agree there are still gaps in practical examples, this has been supplemented by https://janetdocs.com, which are linked as "community examples" per function
:( The turtles were real, not metaphorical: http://classicacorn.computinghistory.org.uk/8bit_focus/logo/...
(it fits the definition of metaphor 'One thing conceived as representing another; a symbol' but it has the feel of people saying "my niece thought the floppy disk save icon is a refrigerator because that's where you save leftover food" not realising that it was a real piece of fun/cute hardware many moons ago).
One thing I like about Guile is how much effort they've put into describing compatibility with the RNRS standards. Not sure how Schemey Janet actually is, but I'm curious to find out.
As a language, it's fine. I found the documentation pretty good and the language makes some very sensible decisions but I can't bring myself to use it for anything serious. The lack tooling makes it challenging.
Calvin Rose made Janet https://github.com/bakpakin and https://bakpakin.com/
Phil Hagelberg made Fennel https://git.sr.ht/~technomancy/fennel and https://technomancy.us/colophon
Anyway - Fennel and Janet look very interesting, and a large thank you to everyone involved!
> this book contains a repl, and you can summon it whenever you’d like by pressing the escape key on your keyboard. The book will then start downloading like a megabyte of JavaScript and WebAssembly, and once it’s done you will be able to try out Janet right here in the comfort of your browser. No need to install anything; no need to leave the comfort of this book website if you’d like to test something out.
> The repl is not just a repl, though. It is also a portal into conversation with me, the author. You can use the repl to report typos or factual errors, ask questions, or express confusion. I won’t be able to respond in the repl, but if you include some kind of contact information in your reports I will make an effort to follow up with you.
Besides Rhombus is still in the integration phase
It feels like a lisp - just without the S-expression syntax.
Also, having Rhombus doesn't mean Racket is abandonned. Far from it. Rhombus is built on top of Racket - and has gained a few nifty features in the process.