
Janet – A dynamic language and bytecode VM - traderjane
https://github.com/janet-lang/janet
======
eggy
I like it, because I like Lisps, and it seems portable enough. I was looking
into Fennel, Urn, and Lumen, which are Lua-related Lisps, but given the small
size of Lua, put them in the same size bracket or lower as Janet.

On another note, I was excited to see 42 comments on this, but then realized
over half of them were on a thread of gender and PL names. Fair discussion I
guess, but I was hoping to geek out on the Lisp of it all!

------
tyingq
_" The entire language (core library, interpreter, compiler, assembler) is
about 200-300 kB"_

That's impressive. [Edit: It's not 200-300kB, closer to twice that in total. I
pulled it down and neither source nor build is that small]

Also, minor typo on the page: _" The language also bridging bridging"_

~~~
bakpakin
Author here

Yes, on most linux systems its closer to about 375 kB right now with the
default build. For some reason it is much smaller on macOS, and can be smaller
when built with -Os, and even smaller when built without the assembler, peg,
or in-binary documentation. You are right, it used to smaller but grew as I
added more features.

~~~
tyingq
Thanks. Not knocking it, was just curious. It's certainly still small for
what's delivered.

Probably smaller than the typical blog post on medium.

~~~
vanderZwan
Obligatory link to Maciej Cegłowski's _The Website Obesity Crisis_ [0]

> _These Apple sites exemplify what I call Chickenshit Minimalism. It 's the
> prevailing design aesthetic of today's web. I wrote an essay about this on
> Medium[1]. Since this is a fifty minute talk, please indulge me while I read
> it to you in its entirety:_

> _" Chickenshit Minimalism: the illusion of simplicity backed by megabytes of
> cruft."_

I just opened up that one-sentence, image-free blog-post, with uBlock, uMatrix
disabled. Without cache it pulled in 790 KiB - with cache it's still 108 KiB.

And it used to be worse:

> _I already talked about how bloated Medium articles are. That one-sentence
> essay is easily over a megabyte. It 's not just because of (pointless)
> javascript. There's also this big image in the page footer[2]. Because my
> article is so short, it's literally impossible to scroll down to see it, but
> with developer tools I can kind of make out what it is: some sort of
> spacesuit people with tablets and mobile phones._

> _It 's 900 kilobytes in size._

I hate Medium and their ilk with a passion.

[0]
[https://idlewords.com/talks/website_obesity.htm](https://idlewords.com/talks/website_obesity.htm)

[1] [https://medium.com/@mceglowski/chickenshit-
minimalism-846fc1...](https://medium.com/@mceglowski/chickenshit-
minimalism-846fc1412524)

[2]
[https://static.pinboard.in/ob/ob.082.jpg](https://static.pinboard.in/ob/ob.082.jpg)
(Cegłowski's archived copy of that once-mandatory 900 KiB footer)

------
4thaccount
Link to the actual site:

[https://janet-lang.org/](https://janet-lang.org/)

Looks like a neat project for sure.

------
nine_k
So, in short, it's a Lisp, apparently CL-leaning. On top of expected features,
it has fibers (aka coroutines, generators), parser generators that supersede
regular expressions, and destructuring on access.

------
m0th87
It looks like it uses setjmp/longjmp for error handling. Is there a way to
ensure Janet never calls setjmp/longjmp? If not, it won't be embeddable in
Rust (and maybe C++?) due to RAII.

~~~
kosinus
I ran into this earlier with Lua for different reason, and recently discovered
PHP does this too. Maybe we just need to find a way around it? I was thinking
of trying to bridge jumps with the Rust panic mechanism. (Basically try-catch
at each boundary.)

~~~
steveklabnik
I’m on my phone so I can’t get into it, but there were bugs around this with
lua and rust that got resolved, so there is _some_ way of dealing with this.

------
wenc
Fascinating project. Not many remember this, but one of the most successful
embedded commercial Lisps was AutoLisp [1], which was the "scripting language"
for AutoCAD.

My uncles who were engineers/draftsmen used to boast about the stuff they
could accomplish with AutoLisp. I didn't understand the power of Lisp until I
came across another embedded Lisp -- Emacs Lisp.

[1]
[https://en.wikipedia.org/wiki/AutoLISP](https://en.wikipedia.org/wiki/AutoLISP)

~~~
jes
I believe AutoLISP was derived from XLISP, a publicly available LISP written
by David Betz. I had a lot of fun with XLISP, and respected the quality of the
work done by Mr. Betz.

------
webkike
A struct based lisp is something I’ve been wanting for a long time. This I am
extremely interested in this project

------
_0ffh
This mildly reminds me of Pico [1], which is essentially Scheme semantics with
tables instead of lists, plus infix operators, and a few other bits of
syntactic sugar.

[1] [http://pico.vub.ac.be/](http://pico.vub.ac.be/)

------
bwidlar
I really like it, waiting for the C API documentation. Congrats to the author,
Calvin Rose. [1]

[1] [https://bakpakin.com](https://bakpakin.com)

------
st3fan
Not a single example program on the GitHub page or in the documentation.

~~~
sseth
I found several. See [https://github.com/janet-
lang/janet/tree/master/examples](https://github.com/janet-
lang/janet/tree/master/examples) for some.

------
bjourne
Dammit, Janet!

------
willart4food
Why Janet?

Why not Karen?

[https://knowyourmeme.com/memes/karen](https://knowyourmeme.com/memes/karen)

