Terse: A language with hi-level look-and-feel, low-level control (1995) [pdf]
terse.com
terse.com
Looks like it isn't under active development anymore.
Sometimes, I would like the ability to declare variables with automatic register assignment and stack allocation if necessary, but at other times I would like to explicitly choose their assigned register or act on registers directly.
HLA seems pretty close to what I want.
So, apart from Forth, any suggestion?
There's a computed goto, so you can build your own jumptables like this:
section "data" { align 4; jump_tab: bits32[] { L1, L2, L3 }; }
f (bits32 x) {
goto bits32[jump_tab + 4*x] targets L1, L2, L3;
L1: return (1);
L2: return (2);
L3: return (3);
}
This is a description of the language. I copied the above code from here.But I'm still open to jamming on Mu with somebody who knows more about OS development. Things like programming the PIC (https://en.wikipedia.org/wiki/Programmable_interrupt_control...) or testing against real hardware. For example, I'm kinda at an impasse with https://github.com/akkartik/mu/issues/52 and would really appreciate some advice from an expert.
I haven't done OSdev in 20+ years (https://github.com/1player/klesh), but I hope I can set aside some time to dive into mu seriously and maybe pick your brain a bit :) keep up the good work!
https://c9x.me/compile/ (c frontend: https://github.com/michaelforney/cproc)
https://github.com/sysprog21/shecc (this fundamentally targets risc-like architectures, but is very clearly written).
perhaps eventually a simple well-defined semantics will emerge (i think projects like the above already support more of a regehr-style c rather than iso).
"SubC is a fast and simple public domain compiler for a clean subset of the C programming language. It can compile itself and passes gcc -Wall -pedantic. Its internals are described in detail in the book Practical Compiler Construction. Note that SubC is a teaching vehicle rather than a production compiler."
https://t3x.org/subc/index.html
And when I say toys, I don't mean mean plastic, trivial items. I mean, I want to buy all of his books, download all of his tools, and collect the whole set, like Legos or other toys never did for me when I was a child.
- close to the CPU
- architecture independent
These 3 aspects are insanely hard to combine effectively.
Also is Forth 'close to the CPU'? It definitely is low-level.
If you want to focus on performance as well (as WASM does), well, then it becomes really challenging to find a middle ground that works on IA64 and a 6502 chip.
So I guess what I am looking for is WASM with less focus on performance and more on portability. Forth might be half a layer above the CPU, but is insanely portable and/or simple to implement from scratch, which is why I mentioned it.
You can see that the x86 registers are used to avoid SWAP instructions via register renaming. That's a sufficiently low level technique to qualify.
The thing with Forth for me, is a lack of typing - you need to keep a model of the stack in your head at all times. It should be possible to build that in to a Forth compiler but I've yet to finish a prototype.