What's the bare minimum #C89 needed to connect to the console in any OS and, in Windows (inc. XP), Linux & MacOS, enable raw mode? Asking for a friend.

Maybe there's a bare-bones framework out there for "give my app a terminal window and make the OS go away" that doesn't involve installing gigabytes of compiler suites and libraries :|

#programming

I'm looking at this tutorial to build a minimal text-editor in C: viewsourcecode.org/snaptoken/k I don't need the text-editor, I don't want to use C for that, but it does provide the bare minimum to get a raw-mode terminal and I could build a VM / Forth using that and then forget about the OS and work in script from there upwards.

Bear with me whilst I work this out; my head has been in a spin for a few days with the infinite possibilities and loose ends.

#Forth is almost wilfully, aggressively impenetrable. I respect it for what it achieves with so little but it's not for me. I realised that unlike #uxn, what I really want isn't a stack-machine but a register-machine.

People keep talking about making "simple" software but really what I keep seeing is toys. I see this in uxn with its 8-bit CPU and 64 KB program space, or Pico8 with its ridiculous 128x128 resolution and 32K token limit. Limits like these don't actually make software simple, it places a greater burden on the programmer to do really low-level engineering that's just a distraction from the program they want to write. You only have to try writing an 8-bit division routine from scratch once to know what a brutal multi-day excursion that can be. If the programmer is having to manually implement allocation and virtual memory -- things that should be completely transparent to the program -- that's not simpler software.

Simple software can be serious, can be a replacement for big, bloated software. My ideal VM would be 32 (or 64)-bits wide and assume it's running on top of an already existing OS that has hundreds of megs of RAM. Manual memory management and virtual-memory won't be the programmer's concern, they won't even have to deal with it directly. Even a 15 year old computer is going to be able to run a single VM burning up hundreds of megs with absolute ease.

#retrocomputing #retrodev #programming

Follow

@Kroc I think projects like Forth and uxn assume that hardware capable of running a typical but minimal OS and a C compiler won't be available for whatever reasons. Embedded computing adjacent. So, you can't complain about their lack of memory allocation etc.

Anything else you want probably can be done on Erlang, for which they nowadays seem to have a new implementation for 32-bit microcontrollers (atomvm).

Sign in to participate in the conversation
Qoto Mastodon

QOTO: Question Others to Teach Ourselves
An inclusive, Academic Freedom, instance
All cultures welcome.
Hate speech and harassment strictly forbidden.