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