5 ms·
What is Nim, and what is the overarching design goal for Fusion? Thanks. I'm hoping these questions aren't too basic, I have no context whatsoever for understa
by coiailo 2y ago
What is Nim, and what is the overarching design goal for Fusion? Thanks.
I'm hoping these questions aren't too basic, I have no context whatsoever for understanding this so hope someone can explain.
- nick__m 2y agoNim is an awesome language that feels inspired by Ada and Python!
- cap11235 2y agoI think it is better described as C with metaprogramming frendliness
- deleted 2y ago[deleted]
- netbioserror 2y agoBut it's secretly also a quirky Lisp, to quote Andreas himself.
- girvo 2y agoIt's macro system certainly makes it feel that way!
- netbioserror 2y agoI'd say it's moreso the referentially-transparent expression-based programming by default. You kind of have to opt-in to imperative programming, and it actively disincentivizes OOP.
- doctorhandshake 2y agoFrom the documentation of the project: https://0xc0ffee.netlify.app/osdev/01-intro.html https://0xc0ffee.netlify.app/osdev/01-intro.html
- khaledh 2y agoAs others mentioned, Nim is a statically typed programming language that compiles down to C, C++, and JavaScript. It has great C interop, which makes systems programming easy. As for why Nim, here's an excerpt from my accompanying site[0]: > Why Nim? It's one of the few languages that allow low-level systems programming with deterministic memory management (garbage collector is optional) with destructors and move semantics. It's also statically typed, which provides greater type safety. It also supports inline assembly, which is a must for OS development. Other options include C, C++, Rust, and Zig. They're great languages, but I chose Nim for its simplicity, elegance, and performance. As for the overall design goals of Fusion, I have high ambitions, which I list on the same page I referenced. I don't want to build another Unix-like OS; I'd like to experiment with fundamental issues in OS design, such as using a single-address space and capability-based security for protection. Another aspect I'm trying to explore is how processes/tasks are modeled, which I believe should be modeled as state machines with statically-typed channels to communicate between each other (this is not new, it's been done in Singularity OS[1]). There's rudimentary support in the kernel for channels and using them from user space, but it's still early. [0] https://0xc0ffee.netlify.app/osdev/01-intro.html https://0xc0ffee.netlify.app/osdev/01-intro.html [1] https://en.wikipedia.org/wiki/Singularity_(operating_system) https://en.wikipedia.org/wiki/Singularity_(operating_system)
- all2 2y agoAre you considering user-level abstractions other than files? Perhaps a plan9-like everything-is-a-file-system?
- khaledh 2y agoA file is a manufactured concept that has served us well for a long while. But I'm not convinced that it's the right abstraction for everything. Files are just binary blobs (even if they're text), with no uniform interface to interact with them other than open/read/write/close. In order to compose processes around files, they have to agree on a certain format (e.g. lines of text for most Unix commands); there's no structure other than what each process assumes it to be. My idea is that processes should compose in a statically typed manner, where opening a channel for reading gives you a Channel[T] to read entities of type T. Two sub-abstractions of Channel[T] would be Source[T] and Sink[T], where they can be used to read and write to any source/sink (including files) as long as there's a registered (de)serializer for T.