Why should I switch from my scheme of choice (guile) to Janet?
Why should I switch from my scheme of choice (guile) to Janet?
Fibers are very interesting, even used for error handling. I've not wrapped my head around PEGs yet.
To me the homoiconity of Lisp is mainly about code-as-data, the exact nature of the data doesn't matter to me that much as long as it's a first class citizen and enclosed in nicely balanced parenthesis (though sadly here Janet seems to have fallen to the temptations of the curly braces, and thus, is indeed heresy).
I will not give up my curly braces or square brackets.
Speaking of unconventional lisps, I enjoyed this recently:
https://github.com/vygr/ChrysaLisp/blob/master/docs/lisp/lis...
from Chris Hinsley, author of the (very) cool Chrysalisp operating system. Same author who wrote this in 1995:
I'd also like to be able to open up each example up on to the playground with the docs above it. (Currently you can just open the example in the playground) no docs right above it.
I did see a json file containing all site data at one point, I did think about using this as a data source for an llm to 'janet' correctly (because at the moment, they do not). This could be displayed/noted more prominently.
None of these are 'must have', just nice to have.
I would also make strings immutable, maybe like Guile's cow-strings, maybe blobs-with-cursors.
Definitely just copy Guile's delimited continuations.
I think I would just ignore most of r7rs, since I don't think it improves things for the progrmmer.
I do use racket, but for scripts I prefer guile. Guile-fibers is a lot neater than the racket parallelism situation, for example. And I can usually find the code responsible for what IAM trying to achieve in the implementation. I never became friends with racket. I remember trying to fix a bug, but I never found what I was looking for.
Getting superficially familiar with the guile codebase takes about an hour.
Then again, I am a classical musician and not a programmer.
I don't see fibers in the guile manual, just heavy weight threads. Is that a third party library? (The lack of a package manager to easily install such things is an issue with most Schemes; only chicken and chibi have anything like Racket's)
It does not use mutation, and should produce just as efficient code as the racket loops. It is also extensible (and easily portable to racket!). It is written almost exclusively in syntax-rules.
Guile fibers can be found here: https://codeberg.org/fibers/fibers
[1] https://github.com/emacs-mirror/emacs/blob/master/lisp/progm...
Actually, the opposite is the case. https://news.ycombinator.com/item?id=32316375
HN readers, don't fall into this trap and waste your time.
I like that it is a small language without dependencies. Have it installed everywhere, including in termux on my phone. Good for scripting.
Used to daydream about a native Clojure and Janet is close enough to that. Does not have everything, but the cost in size and dependencies is so much lower. It is simpler and easier and runs well even on a RPi Zero.
That being said, these days I use Clojure for both (I use babashka to run scripts: https://babashka.org/)
Its binaries are quite small, could wrap and embed raylib and a few small c libraries with no hassle. This makes distribution much easier.
For my simple 2d game jaylib (raylib) code.
ls -laoh build/app
-rwxr-xr-x 1 worthless 2.8M 27 Jul 17:28 build/app
otool -L ./build/app
./build/app:
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1356.0.0)
/System/Library/Frameworks/Cocoa.framework/Versions/A/Cocoa (compatibility version 1.0.0, current version 24.0.0)
/System/Library/Frameworks/CoreVideo.framework/Versions/A/CoreVideo (compatibility version 1.2.0, current version 706.41.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
/System/Library/Frameworks/OpenGL.framework/Versions/A/OpenGL (compatibility version 1.0.0, current version 1.0.0)
/System/Library/Frameworks/AppKit.framework/Versions/C/AppKit (compatibility version 45.0.0, current version 2674.3.0)
/System/Library/Frameworks/CoreFoundation.framework/Versions/A/CoreFoundation (compatibility version 150.0.0, current version 4034.0.0)
/System/Library/Frameworks/CoreGraphics.framework/Versions/A/CoreGraphics (compatibility version 64.0.0, current version 1951.0.4)
/System/Library/Frameworks/CoreServices.framework/Versions/A/CoreServices (compatibility version 1.0.0, current version 1226.0.0)
/System/Library/Frameworks/Foundation.framework/Versions/C/Foundation (compatibility version 300.0.0, current version 4034.0.0)
/usr/lib/libobjc.A.dylib (compatibility version 1.0.0, current version 228.0.0)
I believe those are pretty standard to have on most OSX machines, the situation is similar for my Linux system.The LLM's really can't deal with janet though, they seem to think its clojure and screw up a lot of things.