Comment by slimygrapes
3 years ago
The criticism re: purity is silly. It can still be useful to design a language that is “mostly pure” because you’re mostly not trying to fuck your self over. For example OCaml is “mostly pure” and it’s tremendously beneficial in terms of writing correct software, regardless of the IO escape hatch or the ‘a ref explicit mutability etc.
(I don’t care for V one way or the other though, and most of the results in the post are clearly bad, I just find this particular point to be absurd).
To be clear, there's nothing wrong with impure programming languages. I use them every single day. My complaint is that V claims to be pure and is actually impure. To my knowledge, OCaml makes no claim to functional purity.
"ML-derived languages like OCaml are "mostly pure". They allow side-effects through things like references and arrays, but by and large most of the code you'll write will be pure functional because they encourage this thinking. Haskell, another functional language, is pure functional. OCaml is therefore more practical because writing impure functions is sometimes useful."
https://ocaml.org/docs/functional-programming
> My complaint is that V claims to be pure...
"V is not a purely functional language however." (from V documentation)
https://github.com/vlang/v/blob/master/doc/docs.md#pure-func...
"A pure function is one without any side-effects."
https://ocaml.org/docs/functional-programming
"V functions are pure by default, meaning that their return values are a function of their arguments only, and their evaluation has no side effects (besides I/O)."
https://github.com/vlang/v/blob/master/doc/docs.md#pure-func...
It sure sounds to me like V is trying to claim that functions can be pure while still performing I/O.
6 replies →