lainchan / λ

Forth vs Oberon

array · 2021-10-31 18:47
I'm going to write an unconventional operating system. I want this operating system to be different so I will not be writing it in C. I'm trying to decide between Forth or Oberon. Which do you think would be better and why?
Demeere · 2021-10-31 19:28
>>28346 >write an unconventional operating system Try to explore a lot. Too many just ape UNIX. Also, everyone who is interested in operating systems should check out https://wiki.osdev.org/Main_Page >Oberon Is there even FOSS oberon that is alive? Also, pls post Oberon and Forth resources.
Trinity · 2021-10-31 19:53
>>28347 Forht Resources: https://www.reddit.com/r/Forth/wiki/index/ Oberon resources: https://gitlab.com/kamee/awesome-oberon As for if there is a FOSS Oberon I'm not entirely sure. I'm just curious which would be better on a technical level disregarding licenses.
cdr · 2021-10-31 21:03
>>28346 Please, make it something far from Unix. I want to see people trying some cool OS, not just another Unix-like.
McCarthy · 2021-10-31 21:17
Just contribute to Mezzano if you want your efforts to have a meaning.
Marly Krushkhova · 2021-10-31 21:57
>>28346 Forth is probably more reasonable, with gforth etc. meaning there's an actual active forth community and more online help. (see the forth subreddit vs the oberon one for comparison, forth gets daily posts, oberon monthly) There are two approaches, bootstrapping a forth or using gforth/some other compiled forth. By this I mean you can either do all the bootloading and write everything in compiled gforth or you could write the basic os up to a forth interpreter in c or something then go from there. I assume you want to take the pure forth approach though.
Acid Burn · 2021-10-31 22:07
Are you going to be doing it all yourself or getting other people in on it? >>28350 What is your idea of a cool OS? Realistically speaking.
Jens Hansen · 2021-10-31 22:33
>>28350 Trust me that is one of my main goals. As much as I love Unix I don't want to make just another Unix-like OS.
Lady Jessica · 2021-10-31 22:35
>>28353 I'll start working on it myself and will slowly get other people who are interested to help work on it.
Elliot Alderson · 2021-10-31 22:35
>>28353 Not him but unironically TempleOS had a cool idea but horrible execution. If you read some of the docs it talks of it being an os you'd run in a vm that would allow people to hack and explore like older machines to create an environment to restore the fun of programming. To me that's a cool idea and more general operating systems with interesting bases like lisp machines are also cool.
Cereal Killer · 2021-10-31 23:02
>>28356 That was actually the main goal Smalltalk. It became famous for OOP and message passing, but those were really just means to an end. The big idea was to have an operating environment that was very "human friendly", while also giving more or less complete control to the user.
The Fin · 2021-11-01 13:35
>OS You might be interested in Operating Systems: From 0 to 1 https://github.com/tuhdo/os01
Zhora · 2021-11-01 15:09
I'd go for Forth because it's trivial to bootstrap a forth system on bare metal. I don't know about oberon but it looks like it is much complexer to bootstrap an oberon compiler that runs on bare metal. As for the OS: make sure you don't end up with somehting that tries to be a UNIX or it will be a toy project forever. There's a lot of potential in hardware virtualization-using exokernel-style or paravirtualizing kernels. Ditch POSIX. It should be a compatibility layer at best. Drivers should be implemented in userspace.
Marly Krushkhova · 2021-11-01 19:25
>>28362 Forth also has the advantage more people can join te project. Using Oberon will be a higher threshold.
Sipho Nkosi · 2021-11-01 19:52
>>28346 I think Forth would be better choice. Also posting some Forth resources: >gForth implementation: https://www.gnu.org/software/gforth/ >Starting Forth: https://www.forth.com/starting-forth/ >Thinking Forth: http://thinking-forth.sourceforge.net
Turner · 2021-11-01 21:07
>>28346 forth is the choice
Donna Hawthorne · 2021-11-02 19:43
I'm curious as to how you'd go about making an operating system in Forth. There are loads of resources for how to do this in C, but I haven't found any for Forth. Are you just supposed to make a Forth interpreter in assembly and booting into that interpreter?
Miho Iwakura · 2021-11-02 19:52
>>28382 Forth can be compiled (in the traditional sense), e.g. gforth, which has words for asm. You could bootstrap and interpret as you suggested but that's needlessly inefficient.
Turner · 2021-11-02 20:11
>>28384 Do you have any resources on this? I can't seem to find any documents on how to compile a gforth program to a binary.
drop · 2021-11-03 02:22
>>28382 I am not OP but I've thought about this in the past. My own idea is to write most Forth words directly in assembly and even keep control structures as sort of "macros" where I can fill in the body between the low-level scaffolding. I don't know how efficient this would be in the long run, but it could be improved as needed, and would probably give me enough of a working system to go on and write the other parts.
Judge Fang · 2022-02-04 00:02
>>28382 I've written quite a few colorforths which are faster and smaller than standard forth Basically you make a word with the opcode and the use ,(comma) to store it where you've pointed your compile then you jump there. Gforth is complete ass tho, stick to assembler and then use your own forth to metacompile new versions. pic related
Elliot Alderson · 2022-02-04 00:08
>>29944 Or if you have colorforth you can just make a color that inlines a number like in pic related. The marineblue words are the opcodes for the ARM THUMB stored directly after a definition, when you call the word you're jumping into the assembled opcode. Its fairly straightforward.