News for hackers. Stuff that matters.
Re:Lilith: x86-64 OS written in Crystal by nlh on Sunday December 22, 2019 @09:16PM (#21861042)
C bindings, strongly-typed, a great concurrency model, very fast, and Ruby-like syntax. That makes it a very unique and appealing language to me (and others).

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.

Re:Lilith: x86-64 OS written in Crystal by dragonwriter on Monday December 23, 2019 @12:12AM (#21861622)
> C bindings, strongly-typed, a great concurrency model, very fast, and Ruby-like syntax.

Ruby’s syntax is a great fit for Ruby’s semantics but—and Ruby is my personal favorite language—I don't see much point for it divorced from that. It's the one thing I like least about Elixir.

OTOH, Crystal looks like it may be close enough to Ruby semantics that Rubyish syntax is a plus rather than a misdirection and distraction.

Re:Lilith: x86-64 OS written in Crystal by cosarara on Monday December 23, 2019 @07:45AM (#21863269)
In what way is Elixir's syntax like Ruby's? It has "end" on blocks and string interpolation with "#{whatever}", but everything else is different. It's about as close to Ruby as Ruby is to Python (which is to say, not much).
Re:Lilith: x86-64 OS written in Crystal by onlyrealcuzzo on Monday December 23, 2019 @02:13PM (#21866310)
I think it really helps that you can write mostly functional code in Ruby by just chaining higher-order array functions, and you can use Pipes in Elixir to do this almost identically -- when you consider the fact that all the higher-order array functions have identical or very similar names and parameters in the two languages.

My Ruby code is like 95% chained higher-order array functions. My classes almost never have state. I'm basically writing functional code, and it seems like this is a pretty common paradigm in Ruby. I will say this was HEAVILY influenced by learning Elixir.

When not taking external libraries into account, my Elixir code (at least to me) seems almost identical to my Ruby code.

I think Python and Ruby are very close. But I personally think list comprehensions are un-intuitive and you can't easily chain higher-order array functions in Python.

So although I feel the spirit of my Ruby and Python code is identical, in no way do they look and feel identical. In the same way, I think my Elixir and Python are quite different.

Sample size of 1. I know. Just thought I'd share.

Re:Lilith: x86-64 OS written in Crystal by cosarara on Monday December 23, 2019 @02:39PM (#21866580)
Thanks for sharing! I think though that what you are referring to is not syntax but semantics. On both places you are chaining HO array functions, so the algorithm is pretty much the same, but the syntax you use is different in both places (pipes, dot).
Re:Lilith: x86-64 OS written in Crystal by pseudalopex on Tuesday December 24, 2019 @06:14AM (#21871245)
Python's ist comprehensions are just set builder notation with English keywords.
Re:Lilith: x86-64 OS written in Crystal by yellowapple on Monday December 23, 2019 @05:48PM (#21868183)
Having done lots of development in both Ruby and Elixir (both professionally and on my free time), I'd say the only substantial differences boil down to the following:

- Elixir has |> instead of method chaining

- Elixir uses "do [...] end" consistently for blocks (as opposed to Ruby omitting the "do" in front of function/module/class/etc. bodies)

- Elixir supports Erlang-style tuples on a syntax level while Ruby (AFAICT) does not

- Elixir supports Erlang-style pattern matching / destructuring while Ruby (last I checked) does not

- Elixir's a fair bit stricter about differentiating zero-argument function calls from variables (i.e. if it's ambiguous it'll complain)

That is to say, Elixir's syntax descends directly from Erlang and Ruby, just as Ruby's syntax descends directly from Eiffel and Perl, and it shows rather strongly. That should be unsurprising, given that Elixir is the creation of a (former?) Rails maintainer.

Re:Lilith: x86-64 OS written in Crystal by lmm on Sunday December 22, 2019 @11:37PM (#21861504)
> C bindings, strongly-typed, a great concurrency model, very fast

My point is that all this is normal, and all the languages I list have offered it for longer than Crystal.

Re:Lilith: x86-64 OS written in Crystal by jbverschoor on Monday December 23, 2019 @04:32AM (#21862474)
LLVM based, and in terms of performance, it's one of the fastests