Wow. Preemptive multitasking, graphical window management, POSIX-like, in a programming language that to my knowledge it hasn't yet been done in... and in just several months of work.
Thanks! Originally it only started as an experiment to see how far I could go making an OS in a high-level (higher than C at least) language, I was only planning to build a monotasking DOS system. Around this time, Andreas Kling started to show us his SerenityOS, which was one of the factors propelling me to reach this point. So shout outs to AK!
Yeah! It's pretty fun to develop an OS, albeit time consuming. You should check out the osdev wiki and the Intel/Seagate manuals, they should hopefully get you to the point where your OS can read/write/execute files, you should also take a look at how other kernels do things as a reference and actually implement them in your OS in a way that fits.
Maybe it's just because I come from Ruby, but Crystal seems like an amazing language. I'm interested why it seems to be getting little attention compared to Go, Rust, & Julia. It seems in the same league to me.
Kotlin and Swift have more obvious reasons for their adoption.
Oh wow someone actually posted this! Thanks a lot for the comments and criticisms guys, really means lot to me. Before I go I'll answer some questions, so ask them away!
I’ll echo what everyone else said - SUPER IMPRESSIVE and awe-inspiring work. Thanks for sharing it with the world.
I have one question: While I can read and understand each individual line of code you wrote (go Crystal!) and what each method does, etc., I’m at a total loss for how you knew what and how to build - big picture wise. Can you share a bit about your process for building the mental model of this? How do you know where to start, what modules to build, what’s needed / what’s already there, etc? What roadmap (if any) are you using?
I’m just amazed at how something like this comes together and would love to learn a bit more about the process a single dev uses to build it.
If so, it is definitely mind-bending. Makes me wonder what people mean about not being over-ambitious, "avoiding NIH", "worse is better", "minimizing technical risk", etc. Somehow one is made to feel (by no particular person, but by the composite emergent vibe) that there are a hundred and one reasons to be more conservative. I wonder how many people have the audacity to re-imagine their software ground-up, and the technical chops to actually implement it. The verve is refreshing. Kudos to the author, and also thanks.
Apparently they've also written a language, a static site generator in that language, a brainf*ck interpreter, and a markdown parser, among other things. Super impressive stuff. https://github.com/ffwff?tab=repositories
Two things that I immediately respected about Crystal's landing page [1]:
- It shows numerous code snippets covering various functionalities. Not just "Hello world" but code samples that give you a very solid flavor of the language.
- Its spinning logo can be manipulated with the mouse.
I've been following Crystal for long time (Shameless plug I've been running a geo-location service in production for years now https://gitlab.com/maxpert/crlocator and it works flawlessly). Despite the setbacks in past Crystal has continued to evolve and I am waiting for fully baked version 1. I am not surprised that Crystal can pull of something like running a complete operating system. Modern language landscape is getting populated and brings novel ideas (Rust, Zig, Golang, Julia); and Ruby's nice syntax with efficiency of compiled language IMOH still remains desirable for a lot of us.
Cool coincidence but nah. Maybe its a reference to the first angel in Evangelion? Maybe its a reference to Adam's wife? Maybe its best girl from Machikado Mazoku?
Crystal is a solid alternative to Go. I gave it a solid look when figuring out which language I should learn. The only reason Crystal didn't make it is because it's just missing some core features. The one that sticks out is there is no way to get the length of a channel last time I looked.
But this is impressive and I can't wait to see what's next
I have the same feeling as yours. I wish Crystal web server could be customisable, and lack of gRPC, HTTP/2 (only separate repo) and QUIC going to take more time to implement.
Out of the box, Crystal does garbage collection through the boehmgc library, however if you pass in some compiler flags you can get application to not use GC.
As for my OS, I wasn't gonna port libgc, and since I have prior knowledge of building a GC in rust (very badly!) I decided to make a tri-color concurrent, mostly precise (through compiler patches), garbage collector, in Crystal.
Interestingly apart from the ruby like syntax they seem to be quite different languages from my limited exposure, in terms of the domains they target (elixir - distributed systems, crystal - whatever go/rust are known for minus distributed systems?), the type system (dynamic vs static), deployment story (elixir - mix based, crystal - binary deployment), the standard libraries they leverage etc.
It seems the sum total of them covers a lot of ground from writing quick CLI apps to large distributed systems for developers familiar with Ruby.
I think Ruby developers are a lot more likely to switch to Crystal than Elixir. Elixir encourages a much more functional style than I think Ruby developers are used to.
So how would this compare performance wise to a lightweight linux with lxde? Can you run this on a raspberry pi and get good performance? What are the minimal memory requirements?
[+] [-] jchw|6 years ago|reply
There's no smoke and mirrors as far as I can tell. I dug back to the initial commit: https://github.com/ffwff/lilith/commit/c9fa1053dc6a22d630ee6... - and it's just bootstrapping to VGA.
Very well done, and inspiring. Makes me want to try OS dev again.
[+] [-] ffwff|6 years ago|reply
Thanks! Originally it only started as an experiment to see how far I could go making an OS in a high-level (higher than C at least) language, I was only planning to build a monotasking DOS system. Around this time, Andreas Kling started to show us his SerenityOS, which was one of the factors propelling me to reach this point. So shout outs to AK!
Yeah! It's pretty fun to develop an OS, albeit time consuming. You should check out the osdev wiki and the Intel/Seagate manuals, they should hopefully get you to the point where your OS can read/write/execute files, you should also take a look at how other kernels do things as a reference and actually implement them in your OS in a way that fits.
[+] [-] onlyrealcuzzo|6 years ago|reply
Kotlin and Swift have more obvious reasons for their adoption.
[+] [-] saagarjha|6 years ago|reply
[+] [-] mberning|6 years ago|reply
[+] [-] ffwff|6 years ago|reply
[+] [-] nlh|6 years ago|reply
I have one question: While I can read and understand each individual line of code you wrote (go Crystal!) and what each method does, etc., I’m at a total loss for how you knew what and how to build - big picture wise. Can you share a bit about your process for building the mental model of this? How do you know where to start, what modules to build, what’s needed / what’s already there, etc? What roadmap (if any) are you using?
I’m just amazed at how something like this comes together and would love to learn a bit more about the process a single dev uses to build it.
Thanks in advance!
[+] [-] martinesko36|6 years ago|reply
[+] [-] GordonS|6 years ago|reply
I very much look forward to reading through the code and learning more about it.
[+] [-] kburman|6 years ago|reply
- Any plan to release ISO for us to quickly run it in our local system?
[+] [-] ssivark|6 years ago|reply
2. Any other project ideas you are toying around with?
Kudos and cheers!
[+] [-] lanius|6 years ago|reply
[+] [-] mscasts|6 years ago|reply
[+] [-] martinesko36|6 years ago|reply
If so, this is crazy impressive.
[+] [-] ssivark|6 years ago|reply
[+] [-] tndl|6 years ago|reply
[+] [-] faissaloo|6 years ago|reply
[+] [-] hota_mazi|6 years ago|reply
- It shows numerous code snippets covering various functionalities. Not just "Hello world" but code samples that give you a very solid flavor of the language.
- Its spinning logo can be manipulated with the mouse.
[1] https://crystal-lang.org/
[+] [-] andrekandre|6 years ago|reply
[+] [-] kick|6 years ago|reply
For anyone unfamiliar:
https://crystal-lang.org/
[+] [-] sergiotapia|6 years ago|reply
[+] [-] maxpert|6 years ago|reply
[+] [-] pjmlp|6 years ago|reply
Homage to the Modula-2 OS, Lilith?
https://en.m.wikipedia.org/wiki/Lilith_(computer)
http://pascal.hansotten.com/niklaus-wirth/lilith/
[+] [-] ffwff|6 years ago|reply
Hint: asuka best girl.
[+] [-] pjmlp|6 years ago|reply
Wishes of a successful long term project.
I will be adding it to my OS list.
[+] [-] ksrm|6 years ago|reply
[+] [-] lykr0n|6 years ago|reply
Crystal is a solid alternative to Go. I gave it a solid look when figuring out which language I should learn. The only reason Crystal didn't make it is because it's just missing some core features. The one that sticks out is there is no way to get the length of a channel last time I looked.
But this is impressive and I can't wait to see what's next
[+] [-] todotask|6 years ago|reply
[+] [-] unknown|6 years ago|reply
[deleted]
[+] [-] Thaxll|6 years ago|reply
- libraries
- community
- support
The language itself is not even finish or properly tested.
[+] [-] skocznymroczny|6 years ago|reply
As a D user, I've been curious about Crystal for a while, but until it gets proper Windows support I won't be playing with it too much.
[+] [-] ffwff|6 years ago|reply
As for my OS, I wasn't gonna port libgc, and since I have prior knowledge of building a GC in rust (very badly!) I decided to make a tri-color concurrent, mostly precise (through compiler patches), garbage collector, in Crystal.
[+] [-] bbmario|6 years ago|reply
[+] [-] xbhdhdhd|6 years ago|reply
I wonder if Elixir and Crystal compete for ruby developers to pick up
[+] [-] abhijat|6 years ago|reply
It seems the sum total of them covers a lot of ground from writing quick CLI apps to large distributed systems for developers familiar with Ruby.
[+] [-] andykx|6 years ago|reply
[+] [-] yellowapple|6 years ago|reply
[+] [-] unixhero|6 years ago|reply
[+] [-] lostgame|6 years ago|reply
[+] [-] ksec|6 years ago|reply
[1] https://salt.bountysource.com/teams/crystal-lang
[+] [-] fsiefken|6 years ago|reply
[+] [-] saagarjha|6 years ago|reply
[+] [-] unknown|6 years ago|reply
[deleted]
[+] [-] gigatexal|6 years ago|reply
[+] [-] fit2rule|6 years ago|reply
Sure would be fun to write a content-creation app - i.e. DAW - for such an environment.
[+] [-] mrmonkeyman|6 years ago|reply
[deleted]