Thinking about tacking into FORTH for the permacomputer project.
BASIC is good for certain applications with software preservation, but I think perhaps the project calls for a mix of languages--a cross pollination.
FORTH may be a better approach to deal with memory limitations and code density.
- replies
- 2
- announces
- 0
- likes
- 1
@vidak Did you look at tinylisp yet? https://merveilles.town/@akkartik/115583127011087051
Forth is certainly more efficient in memory use. On the other hand, I get the sense you already like Lisp? He's already gotten this Lisp working on a pocket computer. That's some indication of fit for your purpose.
> BASIC is good for certain applications with software preservation
Only if the software you're preserving is BASIC programs? 😂
@akkartik Lisp is good, but I also have requirement of extreme memory limitations, in addition to type-in programs, right now.
Lisp will come in time, but I think FORTH might be the best avenue to explore.
@vidak How little memory do you have? Notice that he did get it running on that pocket computer. The extras version has a 32KB heap by default.
I just spent a couple of days debugging a GC, and I appreciate even more now how rock solid tinylisp is in that respect. Trying to reproduce that is hard regardless of language, which is why I suggest using something good that already exists. Spend more time in the HLL, life is better there.
@akkartik @vidak the author's pocket computer cannot run a recursive fizzbuzz higher than (fizzbuzz 22) because the boxing clips the maximum number of cells in the (env), even with tail recursion.
I've explored Tiny-lisp for the past couple of weeks and it is quite memory hungry, it's not a good fit for 16-bit systems, and even in 32-bit systems without doubles, it's a bit tight.
@neauoire @akkartik 4 kilobytes, or 8 kilobytes system memory is about what i am looking at now.
in addition, pretty much all programs, utilities, etc will all come supplied on printed paper. i think lisp would be difficult to type in at 100+ lines.
unstructured basic is powerful in its own way, my main motivation is to try and get a text editor working with less effort--i seem to think that there may be powerful text editors written in FORTH that may be ported directly--on and distributed printed--to a potential system.
my main reasons for meandering so much through hardware is that i am trying to find the "easiest route to type-in programs". completely agree with you about living in the high level language land.
@vidak Ah, I didn't appreciate before how central type-in is for you.
@neauoire @akkartik current contenders for solving the problem are:
- 8K BASIC on a PDP-8 clone called the EDUC-8 (~AUD$1000 research and development to get to proof of concept)
- a KIM-1 clone called the PAL-1 (~AUD$100 on tindie), will be able to run entire KIM-1 ecosystem, for real.
- current solution: Stefan's Tiny BASIC, which is targeted for the arduino platform core, runs on any microcontroller, this is my most explored route (about AUD$30)
- FPGA, based on some chinese boards (about ~$50 to get a proper board)
@vidak But isn't that TinyBASIC several hundred lines of C per variant?
@akkartik depending on your compile time options, it goes from 2KB to 64KB system RAM
https://github.com/slviajero/tinybasic/blob/main/Basic2/IoTBasic/hardware.h#L392
you have been disbelieving before about this ( :
@vidak i always assumed that the desired permacomputer would prioritise safety, which is something that Forth is not compatible with by its nature.
When it comes to memory usage, though, Forth takes less memory mainly because it doesn't support the high-precision floats that Basic assumes. I'm sure a Basic program can take less memory if you could specify storage formats for the data structures used, some of the features enabling that are present in classic dialects, right?
@vidak This time I'm thinking about the type-in experience. I don't see how it can be better than tinylisp.