News for hackers. Stuff that matters.
Re:Mint: A new language designed for building single page ap... by mikewarot on Monday March 29, 2021 @10:31PM (#26630734)
It says in the article that everything is immutable, which I found intriguing, but then I see this in the example at mint-lang

fun increment { next { counter = counter + 1 } }

Something doesn't add up.

Re:Mint: A new language designed for building single page ap... by kureikain on Tuesday March 30, 2021 @04:01AM (#26632176)
I don't know Mint but want to give a data point about that.

The `=` is rebinding, what that mean is the original value doesn't change. If you pass that counter variable somewhere, it has its original value. the `count = counter + 1` here mean that a new memory block is allocated, get a value, and the `counter` in this scope is point to it. The old value in the original memory block won't change.

At least, that's the case of Erlang/Elixir.

Re:Mint: A new language designed for building single page ap... by mikewarot on Tuesday March 30, 2021 @04:57PM (#26640379)
That's horrible... and yet I see exactly why it is needed for multi-threaded, multi-core systems.

Question: When is it safe to throw the old value away?

Re:Mint: A new language designed for building single page ap... by dragonwriter on Tuesday March 30, 2021 @01:41AM (#26631520)
Knowing zero about Mint, from the claim and snippet, I assume that “assignments” in a next-block set up bindings for a future state in terms of bindings for the current state. If so, it's not mutation where something could have a reference to the the old counter and have it swapped to the new one.
Re:Mint: A new language designed for building single page ap... by fggg444 on Monday March 29, 2021 @11:55PM (#26631129)
ha, that made me chuckle