
Lilith: x86-64 OS written in Crystal - hootbootscoot
https://github.com/ffwff/lilith
======
jchw
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.

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...](https://github.com/ffwff/lilith/commit/c9fa1053dc6a22d630ee62163d3504f4c003cea8)
\- and it's just bootstrapping to VGA.

Very well done, and inspiring. Makes me want to try OS dev again.

~~~
onlyrealcuzzo
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.

~~~
lmm
What's Crystal's unique selling point? It's older than Rust, Kotlin, Swift,
Nim, or even OCaml, and doesn't really offer anything they don't. More Ruby-
like syntax? Fine, but most people don't particularly like Ruby syntax.

~~~
shakna
> It's older than Rust, Kotlin, Swift, Nim, or even OCaml, and doesn't really
> offer anything they don't.

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.

~~~
k__
I think they meant younger.

But, yeah, besides the syntax familiarity for Ruby programmers it doesn't seem
offer much that the others do.

~~~
nine_k
Okay, port your existing Ruby code to a compiled language, giving it multiple
times the speed? Maybe three is a slight business opportunity here.

Also, give your developers a more productive language that can go where Ruby
can't (like OS development), which is 90% instantly recognizable — may also be
worth something?

~~~
lmm
Is it really so hard to port Ruby code to any of the languages I mentioned?
Even with Crystal you will still have to make changes to your code, is having
to use a slightly different syntax such a big difference? If you've got Ruby
code and you haven't already ported it, how badly do you need the speed?

~~~
EamonnMR
Mentally context switching between Ruby and any other language to do the
translation actually is kind of a hassle.

~~~
k__
I could imagine, that the subtle differences could get you ugly problems while
porting.

~~~
lmm
Won't the differences be more subtle and difficult if you use a language
that's syntactically Ruby-like but not actually Ruby?

------
ffwff
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!

~~~
mscasts
How old are you?

~~~
ffwff
shhh.

------
martinesko36
Is the dev a high school student? From their blog:
[https://fw.neocities.org/blog/5.html](https://fw.neocities.org/blog/5.html)

If so, this is crazy impressive.

~~~
tndl
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](https://github.com/ffwff?tab=repositories)

~~~
haunter
>Neural networks that learn to generate anime faces.

This is my favorite

------
hota_mazi
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.

[1] [https://crystal-lang.org/](https://crystal-lang.org/)

~~~
andrekandre
i really like that spinning crystal; its a small thing really, but i find it
very endearing

------
kick
This is really impressive! Crystal was just barely on my radar until now: it's
a lot higher up now.

For anyone unfamiliar:

[https://crystal-lang.org/](https://crystal-lang.org/)

~~~
sergiotapia
Crystal has the most badass color on Github. Solid black.

~~~
saagarjha
It's actually #000100.

------
maxpert
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](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.

------
pjmlp
I just missed it on my earlier comment.

Homage to the Modula-2 OS, Lilith?

[https://en.m.wikipedia.org/wiki/Lilith_(computer)](https://en.m.wikipedia.org/wiki/Lilith_\(computer\))

[http://pascal.hansotten.com/niklaus-
wirth/lilith/](http://pascal.hansotten.com/niklaus-wirth/lilith/)

~~~
ffwff
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?

Hint: asuka best girl.

------
pjmlp
Lovely, very inspiring to see "not yet another UNIX clone in C", in a language
like Crystal.

Wishes of a successful long term project.

I will be adding it to my OS list.

~~~
ksrm
Is your OS list public?

~~~
pjmlp
Yep, and easy to find with some Google-fu, however there you go.

[http://www.progtools.org/article_new.php?name=safe_systems&s...](http://www.progtools.org/article_new.php?name=safe_systems&section=compilers&type=tutorial)

------
lykr0n
Wow. That's impressive.

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

~~~
Thaxll
It's missing many things that make it a viable language:

\- libraries

\- community

\- support

The language itself is not even finish or properly tested.

~~~
todotask
I can only see 1,209 repos after using Crystal for close to a year, some are
no longer maintained.
[https://github.com/topics/crystal](https://github.com/topics/crystal)

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.

~~~
kimburgess
[https://crystalshards.xyz/](https://crystalshards.xyz/) is the de facto
aggregator of various libs for the language.

~~~
todotask
I’m aware of this nice site, but I think you are aware Kemal threw an
unfriendly message error when you reach to the last page? 100’s shards on each
page is rather slow and limited options to search, I would prefer to stick to
Github or self-host with Github API that supported some language.

[https://crystalshards.xyz/?&sort=updated&page=11](https://crystalshards.xyz/?&sort=updated&page=11)

------
skocznymroczny
How does memory management work in Crystal. Is it RC or GC or manual?

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
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.

~~~
samatman
Have you read Mike Pall's proposal for a quad-color collector in LuaJIT?[0]
That you took this approach leads me to think you'd find it interesting.

[0]: [http://wiki.luajit.org/New-Garbage-
Collector](http://wiki.luajit.org/New-Garbage-Collector)

~~~
ffwff
I've read up on how luajit does garbage collection (in fact the current
gc/allocator with allocation/marking bitmaps is inspired by his tri-color gc.
Apart from specifying when the GC should run, I won't be changing anything
about the core gc algorithm used in the project anytime soon.

------
bbmario
This is one of the most fun things I've seen in a while. Congrats.

------
xbhdhdhd
Just this morning I was pondering the same thing in Elixir.

I wonder if Elixir and Crystal compete for ruby developers to pick up

~~~
andykx
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.

~~~
tomc1985
Probably depends on the type of Ruby developer. As a Rails guy Elixir seems
more useful for my day-to-day but Crystal is indeed compelling.

------
unixhero
Crystal is soo good. I could read the code and understand it.

------
lostgame
What is that beautiful desktop wallpaper? any source?

~~~
sciolistse
There's a link at the bottom of the readme.

[https://www.pixiv.net/en/artworks/78375860](https://www.pixiv.net/en/artworks/78375860)

Seems to require login, though.

~~~
userbinator
View Source, and you can find the direct link...

[https://](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.)

------
ksec
For those who like Crystal, they have bountysource [1] to support their
development.

[1] [https://salt.bountysource.com/teams/crystal-
lang](https://salt.bountysource.com/teams/crystal-lang)

------
fsiefken
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?

~~~
saagarjha
I doubt this is usable for general purpose work; many filesystem interfaces
are unimplemented.

------
gigatexal
The name is great too! Just in time for co-marketing with Diablo 4 ;)

------
fit2rule
I wonder what the plan is for a media layer - audio and video streaming, etc?

Sure would be fun to write a content-creation app - i.e. DAW - for such an
environment.

------
arthurcolle
I don't even know what to say, but you are definitely the captain now.

------
RoutinePlayer
As admirable an accomplishment as this is, and as with many other projects
where the arenan is highly saturated, I feel the README should start with a
quick WHY? section. I'm truly not trying to dismiss the programmer's great
deed.

