News for hackers. Stuff that matters.
Re:Janet – A dynamic language and bytecode VM by tyingq on Sunday February 17, 2019 @12:04PM (#19185430)
"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"

Re:Janet – A dynamic language and bytecode VM by chubot on Sunday February 17, 2019 @12:31PM (#19185601)
I like what I see in Janet, but FWIW /usr/bin/lua5.2 on my Ubuntu machine is 199,576 bytes.

If you write in C without any dependencies, it will take tens of thousands of lines of code before you hit 200 KB :) And that's enough to implement many interpreted languages.

Although I will say that Micro Python is super impressive, because it's small and Python is a deceptively large language -- much bigger than Lua or Clojure.

The Unix port of Micro Python is 412,984 bytes on my machine, and I was only able to get CPython down to ~900 KB after removing many major pieces of functionality (unicode, complex numbers, almost all modules, etc.).

For comparison, /usr/bin/python2.7 on my machine is 3.5 MB, and /usr/bin/python3.5 is 4.4 MB. That's not a knock -- I've really used all that stuff at some point!

Hollowing Out the Python Interpreter http://www.oilshell.org/blog/2018/11/15.html

Re:Janet – A dynamic language and bytecode VM by tyingq on Sunday February 17, 2019 @01:24PM (#19185904)
Actually, I pulled down the repo and did a build. Janet is significantly larger than "200-300 kB" whether I'm counting just source, or built binaries+libs. So perhaps it's an old claim that needs to be updated.

Thanks for sharing re: MicroPython. Had a lot of fun with that over Christmas on a little ESP8266. It's a neat trick that it fits on such a tiny board.

Re:Janet – A dynamic language and bytecode VM by bakpakin on Sunday February 17, 2019 @01:58PM (#19186129)
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.

Re:Janet – A dynamic language and bytecode VM by tyingq on Sunday February 17, 2019 @02:01PM (#19186146)
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.

Re:Janet – A dynamic language and bytecode VM by vanderZwan on Monday February 18, 2019 @06:35AM (#19190016)
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

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

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

Re:Janet – A dynamic language and bytecode VM by cat199 on Sunday February 17, 2019 @03:45PM (#19186784)
> 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

clang vs gcc? elf vs mach-o? hmm. would be interesting to know.

Re:Janet – A dynamic language and bytecode VM by bakpakin on Sunday February 17, 2019 @05:22PM (#19187278)
Seems to be elf vs mach-o - clang on linux is more or less the same size, actually larger than gcc. Probably also some linking stuff on macosx vs. linux.
Re:Janet – A dynamic language and bytecode VM by yawaramin on Sunday February 17, 2019 @01:43PM (#19186024)
What OS are you on? I downloaded the latest release for Mac OS and the binary is 299KB and the library is 289KB.
Re:Janet – A dynamic language and bytecode VM by tyingq on Sunday February 17, 2019 @01:54PM (#19186098)
Linux x64, and my sizes are larger, but similar. Still small, but ~600k is probably closer to where it's at now in total.