Janet looks really interesting. Especially with how easy to embed it is.
If I understand it correctly creating DSLs in it should also be very easy with its macro and PEG feature?
If I understand it correctly creating DSLs in it should also be very easy with its macro and PEG feature?
: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.
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!