This is such a weird complaint that it feels like engagement bait.
"Let x be equal to 4 in x * x" is a natural way to express a concept in English.
The equivalent OCaml code is:
let x = 4 in
x * x
I'm not sure how that qualifies as "sucks"?In fact, the `in` makes OCaml's scoping rules some of the easiest to follow. This is valid OCaml code:
let x = 4 in
let y = 3 in
let z = 2 in
x * y * z
let x = 5 in
let y = 6 in
let z = 7 in
x * y * z
The phrasing of "let x = 4 in <this expression>" makes it explicit where x is defined as 4, vs where it's instead (in a different expression) defined as 5.I have an easier time understanding scope in OCaml, which explicitly spells out its scoping rules in plain-English syntax, than I do in Rust or JavaScript, which use the deceptively-simple-looking braces but also wild concepts like lifetimes or hoisting.