News for hackers. Stuff that matters.
Re:Show HN: Svelte NodeGUI, a lightweight Electron alternati... by jart on Friday March 05, 2021 @04:06PM (#26362110)
Help me build Cosmopolitan Libc. We're using modern compilers to build programs that are tinier and more portable than anything developers even as far back as the 70's or 80's were able to produce. https://justine.lol/cosmopolitan/howfat.html I built a LISP interpreter too, which makes Altair BASIC look bloated by comparison. https://github.com/jart/sectorlisp I will say that 20mb isn't too shabby if we judge the OP's project by Electron standards. If NodeGUI was pruned a bit more, it wouldn't be too far off from where Go is at right now for Hello World on the console. Although one does have to take into consideration that it assumes external dependencies are available such as V8 I assume? Does it statically build? One thing I'm curious about is I looked at the yarn lock file and I couldn't find Qt so I have no idea where it comes from.
Re:Show HN: Svelte NodeGUI, a lightweight Electron alternati... by kazinator on Friday March 05, 2021 @10:45PM (#26364991)
8 bit BASICs were extremely tightly coded and packed a lot of functionality. They had working garbage collection for strings, with useful string processing built on it. Programs could be interrupted to safely return to the prompt, and errors which terminated the program informed the user of the line number, e.g. "illegal quantity error in 210". The internal, tokenized representation of programs could be interactively edited to update the program, which could be saved to disk. BASICS also had floating-point support, with functions like LOG, EXP, SIN, COS, TAN, ATAN, ... Also arrays, including multi-dimensional ones.
Re:Show HN: Svelte NodeGUI, a lightweight Electron alternati... by jart on Saturday March 06, 2021 @08:20AM (#26367150)
Very impressive. But it didn't have a metacircular evaluator! sectorlisp does.
Re:Show HN: Svelte NodeGUI, a lightweight Electron alternati... by kazinator on Saturday March 06, 2021 @01:09PM (#26369241)
I see there is a metacircular evaluator in the repository (lisp.lisp), but I don't see where that is pulled into the image.

In the BASIC heyday, there existed compilers for BASIC (some of them written in BASIC). These didn't ship in the ROM images either, they were third-party apps.

Re:Show HN: Svelte NodeGUI, a lightweight Electron alternati... by pjmlp on Saturday March 06, 2021 @03:19AM (#26366001)
And the compiled ones also included some form of records.
Re:Show HN: Svelte NodeGUI, a lightweight Electron alternati... by kitd on Friday March 05, 2021 @04:37PM (#26362440)
I can't remember the precise mechanism, but IIRC the base NodeGUI pkg downloads and builds a minimal QT, and then links into it using NodeGUI/qode which hooks up the Node and Qt event loops.
Re:Show HN: Svelte NodeGUI, a lightweight Electron alternati... by caslon on Friday March 05, 2021 @04:57PM (#26362659)
If we're only interested in one/"not-Mac/Win/FreeBSD" of those platforms, how small could we get programs down to? Is forgoing certain platforms supported?

Also, there was a really fantastic question asked in the last Cosmopolitan thread, but it wasn't answered; what's the answer to it?

https://news.ycombinator.com/item?id=26294721

Re:Show HN: Svelte NodeGUI, a lightweight Electron alternati... by jart on Friday March 05, 2021 @05:20PM (#26362930)
If you uncheck the boxes on the "how fat" page I linked above, then static binaries for a single platform usually end up being 4kb. Most of that 4kb is padding nops to page size. The question you linked is now answered.
Re:Show HN: Svelte NodeGUI, a lightweight Electron alternati... by gravypod on Friday March 05, 2021 @10:06PM (#26364841)
Off topic but what did you use for emulating and visualizing your bootsector (blinkenlights.com) in here [0]. Looks much more convenient then QEMU which is what I used last time when doing ring 0 stuff in x86.

[0] - https://www.youtube.com/watch?v=hvTHZ6E0Abo

Re:Show HN: Svelte NodeGUI, a lightweight Electron alternati... by jart on Saturday March 06, 2021 @08:22AM (#26367161)
I used Blinkenlights to simulate x86 boot. I wrote it! https://justine.lol/blinkenlights/index.html
Re:Show HN: Svelte NodeGUI, a lightweight Electron alternati... by anthk on Friday March 05, 2021 @05:11PM (#26362824)
> built a LISP interpreter too,

Some friend of mine like it :D.

But I'd like that more if it was Scheme.