This is a small 32bit (i586) kernel written using the Nim programming language.
I have been wanting to do this for a while but it wasn’t until people in the #nim IRC channel inquired about Nim OS dev and the rustboot kernel inspired me that I finally did it.
It doesn’t do much, but it doesn’t need to. Its purpose is to provide a starting point for anyone wishing to write an OS in Nim.
From the Wikipedia:
I’ve been dreaming of a language like this!! The benefits of C (my favorite programming language) with the ease of using a high level language.
Vala is another language like this, right? Any others?
Read my Lisp :
https://common-lisp.net/project/ecl/
https://github.com/sbp/hedgehog
http://www.newlisp.org/
Several Eiffel compilers use that model as well
I use Chicken Scheme daily http://www.call-cc.org/
https://www.reddit.com/r/programming/comments/2vvcbm/author_of_unix_…
And I felt his pain and did the same thing.
Nim has been a huge revelation – it’s simply the best systems programming language around these days.
No-nonsense, just works.
At a quick glance at the syntax/features it appears basically typical for newer languages like go/swift/rust. Could you give any direction as to why you’d want to choose Nim over these others?
Go – Not so straightforward to create bindings to C/C++ libraries (getting better recently though). Currently does not have the ability to operate without a garbage collector. Channels and Goroutines are nice abstractions. Good tooling.
Swift – Is currently OSX/iOS only for all practical purposes, but is well documented and obviously has good vendor support and excellent tooling (on OSX anyway).
Rust – Rapidly evolving so some of this is probably wrong now Main appeal I think is extreme memory safety without requiring a garbage collector (if you can grok it’s memory management model). It has a GC, but it is elective. Still not considered production ready yet.
Nim – Pythonish syntax. Superficially similar to Rust feature-wise. Garbage collection is baked in, but you can opt out if you wish (and give up memory safety). Seemingly more mature than Rust right now. Compiles to C so portability is excellent.
Note: I have personally only used Go a bit. Played with Rust and found it rather neat but hard to get my head around. Nim looks very cool to me, but have not tried it personally. Most of the info above is just regurgitated from various internet sources
Excuse my ignorance, but this is a “baremetal” HelloWorld. No more no less.
No kernel. Not new.
Though NIM is new (to me).
Add salt and pepper to the baremetal kernel, and you get a full system.
It is not a kernel at all. At least in my world a kernel does provide some minimum functions, like tasks creation and switching.
All this “kernel” does is a “hello world”.
Its a kernel in the sense that it is constructed like one. i.e. it is bootable on bare metal (or in this case on QEMU at least). That it doesn’t actually do anything is kind of the point – its the bare minimum you need to start writing an actual kernel that does stuff…
tl;dr Its a bootstrap template for a kernel written in Nim.
the person working on a os using rust
nim-xv6” rel=”nofollow”>https://github.com/ckkashyap/nim-xv6
hope this is refering to the same nim language.
You cant format the text in a link like that… Fixed them for you:
https://github.com/ckkashyap/rustix
https://github.com/ckkashyap/nim-xv6
Another language that compiles to C is ATS, and has the strongest type system of any systems or general purpose language that I know of:
http://www.ats-lang.org/
There’s an ARM-based OS that is over 14% ATS:
https://github.com/mrd/terrier