542 points · by hootbootscoot · 6y ago · 251 comments
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.
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.
We've marked your account legit so this won't happen again.
Not really, the kernel and any process written in crystal has a garbage collector, any other userspace process can manage memory however they want to.
Kotlin and Swift have more obvious reasons for their adoption.
For being a 5-year old indie language out of South America, I think it's doing quite well, and projects like this are good evidence of why.
Ruby is an outstandingly productive language. Copying the expressive syntax and ergonomics of Ruby into a fast, statically typed, compiled language with excellent C bindings is a very compelling idea.
This. I recall ages ago when I had to write a networked tool and had lots of freedom in choosing tools and languages (and time), so I picked this new thing called Ruby just because it looked so easy to understand. That was years before Ruby On Rails was introduced, so the language was pretty much unknown. After some time to grasp the basics I started to be productive; making changes or adding functionality or debugging became really fast, and in the end I recall thinking "if only this thing was nearly fast as C that would be wonderful". I believe that just happened. OK, maybe not 100% identical to Ruby or 100% on par with C speed wise, but just being close to that is a huge achievement. I only wish it was available for small embedded ARM boards like other interesting languages like Nim etc. Last time I checked, Crystal is bootstrapped, ie it requires itself to compile itself, which IMO doesn't help portability to new iron.
My sense from reading most peanut-gallery commentary that the biggest reasons it hasn’t taken off more (yet) are:
1. Real multi-threading (it’s now in alpha - but previously just had single-threaded concurrency - and sorry I might be getting that terminology wrong).
2. Windows support (I personally don’t care but I haven’t found a single thread talking about Crystal where someone doesn’t chime in and complain about this)
I have a feeling once it reaches 1.0 and those issues are addressed it’ll get a bit more attention. It deserves it!
WSL support maybe?
Rust essentially competes with C and C++ (and maybe D and Nim without their GCs), and the reason it gets hype is because it brings some unique features for that niche.
Go brought some unique features as well (goroutines done right), and it is pushed by a major player.
In Julia's niche, you only really have Julia and Fortran - sure there are many other languages used in that niche, but there are very very few languages exclusively designed for that niche.
C#, Kotlin and Swift are the system API languages of major platforms (MS, Apple, Android). Javascript is the language for the web.
What's Crystal for?
No, the system API of those systems is exposed in C, ObjC and C respectively.
You may be thinking about the most common language in those platforms nowadays (and their respective APIs).
The key is to be as fast as possible, as memory light as possible, and able to produce and speak to C ABI.
Why Erlang processes are not right?
I'm reading up on it and liking what I'm seeing so far. This could be a great Golang (which I detest) replacement for me when I need to write a small, native program. Also, the Ruby-esque syntax is a win. I've always thought Ruby was a nicer language than Python. Too bad Ruby never grew much of a dev community outside of Rails.
I don't think it was ever a major roadblock. The fix isn't pretty but it doesn't come up that often in practice.
That's it. That's why it fails to gain the traction it deserves.
Asked my friends to try it out and they love it too. Hopefully we can grow a bigger ecosystem for Crystal to make it a main stream programming language one day.
Crystal is only five years old.
Nim is 11, Rust is 9, Kotlin is 8, OCaml is 23 and Swift is 5.
Basically, Crystal is tied with Swift as the youngest.
What it offers right now is a simple porting process for those with Ruby codebases.
If you / most people don’t particularly like the Ruby-like syntax, then Crystal might not appeal to you. But I can assure you to those of us who like the syntax, the language is wonderful and super fun to work with.
Swift - crystal throws exceptions, swift explodes...
Ocaml - the functional approach is not for everyone.
Rust - I like rust a lot. But sometimes I want to write something quick and I'm happy to sacrifice some memory and speed to not have to deal with the ownership issues.
Nim - the most comparable, I guess it's syntax preference at that point
The selling point for Crystal is that it has a clean syntax that's easy for Ruby or Python developers to pick up (almost the same as Ruby), but compiles to standalone binaries that run really, really fast.
I mostly work in Python because the libraries are a lot more mature, but I use Crystal when I need to produce a standalone binary.
foo = ENV["FOO"]? || 10
I've noticed the slogan was change to "A language for humans and computers", what it really mean? Related to machine learning?
My impression that other than it was design to be as friendly as Ruby and fast as C. It's a lot helpful to have an FAQ if the Crystal team could provides.
As I see it, Go gets 70% of the attention, Rust 25% and Julia 5%. Crystal which doesn't have major backing (no Google, no Mozilla, and Julia has some MIT hackers behind it IIRC, plus the whole "data science" angle which is fashionable today), gets even less.
While it is possible to create and manage some rules, it is simpler not to fork at all.
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!
Currently it's pretty barren driver-wise, I currently have a FAT16 driver, a keyboard/mouse driver, some basic code to handle core architecture hardware and that's it. I really want to have CDROM support, a network driver (ne2k or e1000), an audio driver (sound blaster?) and an actual file system.
My roadmap is go with the flow. If I want a text editor, I'll focus on building a text editor. If I want to play doom I'll port doom (but I dont so I won't :^)
I very much look forward to reading through the code and learning more about it.
It's cleaner than a solid 90% of the code I've read over the years :)
- Any plan to release ISO for us to quickly run it in our local system?
The compiler also generates a null-terminated array of pointers pointing to the offsets of global variables.
No iso images yet, I haven't implemented iso9660 filesystem support, but it's coming soon?
2. Any other project ideas you are toying around with?
Kudos and cheers!
If so, this is crazy impressive.
It's safe to say that people who aren't aware of or ignore limits put out better work on average than people who don't.
Six weeks later, Dantzig’s statistic professor notified him that he had prepared one of his two “homework” proofs for publication, and Dantzig was given co-author credit on another paper several years later when another mathematician independently worked out the same solution to the second problem.
> When asked, “How could you possibly have done the first interactive graphics program, the first non-procedural programming language, the first object oriented software system, all in one year?” Ivan replied: “Well, I didn’t know it was hard.”
This is my favorite
- 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.
For anyone unfamiliar:
Homage to the Modula-2 OS, Lilith?
Hint: asuka best girl.
Wishes of a successful long term project.
I will be adding it to my OS list.
http://www.progtools.org/article_new.php?name=safe_systems&s...
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
- libraries
- community
- support
The language itself is not even finish or properly tested.
There are lacking of stories around the cloud computing or any large businesses has success with Crystal. They need more of those to gain support if they don’t want to remain in “uncharted territory” which mentioned in their interview.
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.
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.
I wonder if Elixir and Crystal compete for ruby developers to pick up
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.
Crystal has 1,209 repos https://github.com/topics/crystal
Ruby has 19,721 https://github.com/topics/ruby
For those who needs performance for specific tasks, the option is easy since it’s a small investment to learn Crystal but Elixir is mature.
If we are targeting DevOp, other languages has several advantage like Go for microservices and could be work within mobile app.
I'm trying to find an Elixir job right now and pretty much all of these comes with a RoR requirement. (also it seems some companies are moving from Elixir to Go).
As I'm mostly a PHP / Symfony guy I feel the disconnect, and at my current place people really don't care about Elixir at all. Basically Go and Node would be much better prospect for me.
https://www.pixiv.net/en/artworks/78375860
Seems to require login, though.
https:// i.pximg.net /img-original/img/2019/12/20/00/00/03/78375860_p0.png
(Deliberately made unclickable, because you will get a 403 unless you send the correct Referer.)
Sure would be fun to write a content-creation app - i.e. DAW - for such an environment.