5 ms·
These sorts of minimalist bare metal abstract PL articles are so thrilling to me. APL comes to mind. I wonder how high you can go with only 1MB say.
by agumonkey 5y ago
These sorts of minimalist bare metal abstract PL articles are so thrilling to me. APL comes to mind.
I wonder how high you can go with only 1MB say.
- tluyben2 5y agok9 [0], an APL like, is under 160KB and includes a database in that. [0] https://shakti.com https://shakti.com
- agumonkey 5y agoI shall gather all these projects on a wiki.
- p_l 5y agoL - an embedded subset of Common Lisp used in Roomba, ran in 1MB of ram total afaik including compiler and support OS.
- agumonkey 5y agooh wow, roombas still run this subset of CL ?? ps: ohh that paper was on the frontpage not long ago, I just didn't realize it was used in Roombas
- terafo 5y ago1MB is really a lot if you know what you're doing, what language you actually can't fit into 1MB of ram due to inherent specifics of language itself, not because interpreter/compiler doesn't optimize for such cases?
- pjmlp 5y agoA lot, we only had 640KB to play with on most MS-DOS, Amiga and Atari computers, and 8bits had 64-128 KB.
- agumonkey 5y agohmm but were there high level languages being usable on these ? I remember a CLISP impl on some atari (but I think the dev had a ram addon). all in all, I'd really love to have or make a 1MB minimalistic shell with a tiny lisp/prolog/smalltalk
- pjmlp 5y agoPlenty of them, here is a non-exaustive list. C, C++, Modula-2, Pascal, AMOS, Clipper, FoxPro, Turbo Basic, Quick Basic, Turbo Prolog, PC-Lisp, Native Oberon,...
- varjag 5y agoMost then existing HLLs were very usable in 640Kb. If you go down to 8-bits, while translators for many of these did exist the utility was rapidly diminishing. You'd essentially have system's native version of BASIC + assembler for anything practical. The rest were more of parlor tricks.
- abecedarius 5y agoIn that context Forth was quite practical. That was its heyday.
- guenthert 5y agoINTERLISP was available for the Atari 800 (which max'd out at 48KiB RAM).
- adrian_b 5y ago1 MB is huge. Keep in mind that IBM PC/XT had only 640 kB, but there were compilers and interpreters for any language, which were available for it. Moreover, before IBM PC, a CP/M computer with Zilog Z80 or Intel 8080 had usually only 32 kB or 48 kB, but you could use without problems Basic interpreters, Pascal, Fortran, Cobol and PL/M compilers and many others. However, in order to fit in 32 kB, the compilers themselves were typically written using a macro-assembler, and not in a high-level language. The C language became popular for such tasks somewhat later.
- User23 5y agoThe original Macintosh had 128k and managed to load a graphical OS and an app in that space. The ROM certainly helped, but it was quite a feat.
- Narishma 5y ago> Keep in mind that IBM PC/XT had only 640 kB And that's the maximum (without bank switching schemes like EMS). The first version had only 64 KB. There were even plans for a 16 KB version with no disk drive but I don't think it was ever released.
- int_19h 5y agoThe base model of ZX Spectrum only had 16 Kb, but it was enough for it to run BASIC. And then there's FORTH, which is tiny even in a naive implementation, but can be taken to extremes as well: https://pygmy.utoh.org/3ins4th.html https://pygmy.utoh.org/3ins4th.html
- akkartik 5y agoAssuming you mean static code size, my Mu project currently supports an interpreted Lisp (macros, fewer parens, infix) implemented in a compiled memory-safe low-level language without _any_ C in 450KB. The "runtime library" (mostly in the safe low-level language) requires 120KB. Without unit tests, the binary sizes drop down to 200KB and 30KB respectively, which gives you some sense of the space devoted to tests in each case. As the tests hint, Mu doesn't do anything to try to reduce code size. It's small just by focusing on the essentials. What's left is written for ease of comprehension. (An example of "essentials": Mu still cannot free memory. I run my programs in Qemu with 2GB which seems to suffice.) More details: https://github.com/akkartik/mu https://github.com/akkartik/mu
- agumonkey 5y agothe variable/register idea is neat, I always wanted some veneer on top of raw registries.. almost like a cpu monad
- jart 5y agoAuthor here. I assume you're referring to https://github.com/akkartik/mu/blob/main/shell/evaluate.mu https://github.com/akkartik/mu/blob/main/shell/evaluate.mu? It's hard for me to tell, since there's 819k lines of code in Mu according to find . -type f | grep -v '\.git' | xargs wc -l. Does it have lambda and support metacircular evaluation? If not, then why do you think it's LISP-like? If you do nothing to reduce code size, then why do you call it Mu? (I assume by "Mu" you're referring to what UNICODE calls the MICRO SIGN.) 30kb is two orders of a magnitude larger. I don't see how it's relevant to SectorLISP.
- akkartik 5y agoSorry to tramp over your thread! Mu isn't too related to SectorLISP, I was just responding to the side-discussion about what we can build in under 1MB. To answer your question, evaluate.mu does support lambda (I call it `fn`). My estimates of size were based on `ls -l a.bin` after `./translate shell/*.mu`. I actually didn't really think of the micro interpretation of 'mu' until years after I started the project. The interpretation I had in mind was https://en.wikipedia.org/wiki/Mu_(negative)#%22Unasking%22_the_question https://en.wikipedia.org/wiki/Mu_(negative)#%22Unasking%22_t...
- jacquesm 5y agoI wrote a full CAD/CAM suite for lathe/mill work in a few hundred K, working RAM was another 500K or so...
- agumonkey 5y agoHonestly you and people writing similarly small applications should gather and write a book. I don't know if I'm an alien but whenever I see frugal yet non trivial application my brain rejoyces.
- jacquesm 5y agoThis was back when 1 MB was considered and amazing amount of memory. It took two years to write this, about 50K lines of high level code and another 10K or so of assembly. Today you would approach such a project in a completely different way, you'd use much more time to make it look pretty and just that part would probably be much larger than the whole package that I wrote. The funny thing is that even so many years later the original software is still in use in some places and there is a whole company centered around that core that has been re-written a couple of times to keep it up to date and to expand its functionality. I highly doubt the present day version would fit in something that small. What's interesting to me is that that old stuff tended to be super productive to work with, zero distractions, just some clearly defined task in a clearly defined environment, if it worked it was bullet proof. No hackers, SaaS, a million connectivity options and no eye candy. Just that one job to be done and done as good as the hardware would allow you to.
- agumonkey 5y agoBut that's exactly my point. I think we forgot to aim at super productive, zero distraction, lightweight. And it would be of high educative value to see this sort of work again. Both on the small scale details and the pragmatic value. The sad part to me is that most web apps reenact the same functions but in a css-transition-capable DOM. But functionally I'm not sure you get more.
- 5y ago
- bob29 5y agohttps://www.red-lang.org/p/about.html https://www.red-lang.org/p/about.html Almost as batteries-included as python.
- agumonkey 5y agoHa, I didn't know the whole distribution fit in 1MB. Thanks
- diskzero 5y agoI love Red and want to use it more. Sadly my professional life keeps giving me hardware that I can't run it on, so Red is getting marginalized. I wish I had more skill and time to help them out with the 32 to 64-bit transition. [1] [1] https://gitter.im/red/red?at=5e09152cd5a7f357e6a1af83 https://gitter.im/red/red?at=5e09152cd5a7f357e6a1af83