Beginner Mistakes: Difference between revisions

→‎Memory usage: Forth: tiny but tricky + it takes time to shrink code
[unchecked revision][unchecked revision]
m (Grammar and formatting touch-ups. Meaning adjustment in Popularity section.)
(→‎Memory usage: Forth: tiny but tricky + it takes time to shrink code)
Line 82:
 
Sorry, that's probably impossible. An OS using such little memory will be almost unusable. Forget about filesystem drivers, disk drivers, usb drivers, etc. If you want to develop something small, just make a simple bootloader, not an OS.
 
You could try a native Forth; it's like a little OS with the kernel, command interpreter, and assembler all in one tiny binary! Parts of the kernel can even be scripted. You don't even need a filesystem, many Forths directly edit and load disk sectors. The catch is Forth is not light on skill. Writing good Forth is a whole other planet which you'll need to understand to get beyond the bare basics. Quite a lot of Forth fans are good at writing Forth interpreters but are poor Forth programmers. You'll need to be a good(-ish) Forth programmer to fit OS design concepts to Forth, or to figure out which concepts are not needed. If you can't do that, your OS will be ''much larger'' than it needs to be. ;)
 
It can take a lot of time and thought to figure out how to reduce code size. Charles Moore, inventor of Forth, wrote a CAD program which was structured around just 5 lines of code. When asked how long it took to write those 5 lines, he replied, "Ooh, about 2 years"!
 
=== OS Emulation ===
Anonymous user