2 ms·
I understand "fast fart er 80" and it makes sense, but I think present tense "er" for mutable variables is super weird, and implies functional semantics in an i
by skrebbel 6mo ago
I understand "fast fart er 80" and it makes sense, but I think present tense "er" for mutable variables is super weird, and implies functional semantics in an imperative world. Like eg this:
endreleg fart er 80
This is weird! It can change but it is 80? Was it already? Will it forever? Should that maybe be "blir" instead? (pardon my nonexisting Nynorsk, I'm extrapolanorsking from Danish "bliver") Eg:
endrelig fart blir 80
So that later it can become a different value, eg
fart blir 90
And the imperative nature of this bit of code is immediately clear to the reader.
- atomfinger 6mo agoI have actually changes this in a newer version of the language. Now it is "låst" and "open", as in: låst fart er 80 open fartsgrense er 110 Mostly because the length difference between "endreleg" and "låst" triggered me.
- skrebbel 6mo agoYeah but my beef is not with “endrelig” but with “er”.
- atomfinger 6mo agoAh. I don't disagree with you per se, but I think we can look at it another way: See assignments as statements of fact. The sky is blue. Himmelen er blå. aka himmelen er blå. A statement of fact. Also, "blir" becomes yet another keyword. More keywords, more to remember. Not that this has been a real consideration or worry in Brunost so far. The design so far is very much "What I felt was okay that day". I do agree with the fact that this reads nicely: open fart er 80 fart blir 50
- skrebbel 6mo ago> See assignments as statements of fact. This makes sense in functional languages where variables can't change, but not in imperative languages like Brunost. When a fact changes halfway the story, it wasn't much of a fact. Himmelen er blå, inntil den blir rosa. I too like your final example.
- ggsp 6mo ago> extrapolanorsking <3