The magic 8 ball at Christmas said "try #ocaml " so I did my usual "hello world" in it - the leibniz algorithm for approximating Pi.
Having to change the normal for loop to a recursive 'emulation' of a for loop because variables are immutable (wut ?) felt very alien...
Hmm.
=> More informations about this toot | More toots from walkerb@infosec.exchange
@walkerb Yeah, that's how a pilgrimage to the world of functional programming usually starts. 😂
=> More informations about this toot | More toots from richarddegenne@mastodon.online
@richarddegenne feels more math than code and I don't know that I like it.
I will pursue it some more.
=> More informations about this toot | More toots from walkerb@infosec.exchange
@walkerb Take your time. Took me a couple years before it finally clicked 😅
Having to "un-learn" most of the habits that come with imperative programming is tough, but it's worth it. It's a bit like traveling to a foreign country 😂
=> More informations about this toot | More toots from richarddegenne@mastodon.online
@walkerb it feels weird at first on the small scale (some local calculation or whatever) but when developing big programs, knowing that a function does not change its inputs make it much easier to reason about the code (and solves many concurrency problems too).
=> More informations about this toot | More toots from kototama@merveilles.town
@kototama its been decades since I wrote anything in a functional language.
Have another few things to write that I usually do when learning a new language (game of life, etc). Will see if my brain rebels less on those.
=> More informations about this toot | More toots from walkerb@infosec.exchange This content has been proxied by September (ba2dc).Proxy Information
text/gemini