samhuri.net/posts/2007/04/funny-how-code-can-be-beautiful.md
Sami Samhuri 007b1058b6
Migrate from Swift to Ruby (#33)
Replace the Swift site generator with a Ruby and Phlex implementation.
Loads site and projects from TOML, derive site metadata from posts.

Migrate from make to bake and add standardrb and code coverage tasks.

Update CI and docs to match the new workflow, and remove unused
assets/dependencies plus obsolete tooling.
2026-02-07 21:19:03 -08:00

2.5 KiB
Raw Blame History

Title Author Date Timestamp Tags
Funny how code can be beautiful Sami Samhuri 30th April, 2007 2007-04-30T07:07:00-07:00 haskell

While reading a Haskell tutorial I came across the following code for defining the Fibonacci numbers:

fib = 1 : 1 : [ a + b | (a, b) <- zip fib (tail fib) ]

After reading it a few times and understanding how it works I couldnt help but think how beautiful it is. I dont mean that its aesthetically pleasing to me; the beautiful part is the meaning and simplicity. Lazy evaluation is sweet.

Haskell is the most challenging real language I have tried to wrap my head around. I havent done much with any functional languages yet but they are truly fascinating. Im beginning to understand monads[1] but Im quite sure I dont see the whole picture yet.

Erlang looks like it may be more suited to real world apps so I would like to learn that some time. The pragmatic guys have a book on Erlang in the works, and I love every book of theirs which I have read.

Going deeper down the functional rabbit-hole youll find things like this polyglot quine, which absolutely blows my mind. I used to be impressed by the JAPH sigs or some of the various obfuscated contest winners but that first one definitely cleans the rest up with a perfect 10 in geekiness.

[1] The following links have all been helpful while trying to wrap my head around monads.