r/programming • u/crazyjoker96 • May 09 '22
Vlang as a scripting language for docker image entry point
https://vincenzopalazzo.medium.com/422e6a9d64ed13
u/Innf107 May 09 '22
For those that aren't aware, you might want to read this article before getting excited about V.
Granted, the article is almost three years old, but just looking at their documentation, it doesn't seem like a lot has changed.
V's marketing is still misleading and frankly dishonest.
My personal favourite example from their documentation (emphasis mine)
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).
This is an interesting definition of 'side effects'.
-20
u/AmitGold May 09 '22
It's a shame V isn't as popular as it should be. It's as simple as Go but with immutability by default, null safety and better error handling
21
May 09 '22
It’s so simple it doesn’t even manage memory, it just leaks! Genius solution if I may say so.
The things you listed aren’t major problems with Go. Sure it would be nice I guess, but V is far from being a real language still
21
May 09 '22
V is far from being a real language still
That’s a nice way of saying “it’s a Patreon grift”.
6
u/qq123q May 09 '22
Good that more people see it for what it is.
11
May 09 '22
There have been no substantial changes since the “V is for Vaporware” article. The pattern of overpromising and severely underdelivering is still pretty obvious.
3
u/Innf107 May 09 '22
Error handling is not a major problem with Go?
What would you consider "major problems with go" then?
2
May 09 '22
Some might find it an inconvenience with such an expressive way to handle errors, but it's not an issue for most, and far from a major issue. Most Go programmers I have spoken with regarding errors, mostly coworkers, have come to the conclusion that the error handling felt too expressive at first, but it's actually very easy to understand what happens under unwanted behavior due to the simplicity.
5
u/Innf107 May 10 '22 edited May 10 '22
Well, the issue with Go's error handlin is not that it is "too expressive".
One issue is, how easy it is to accidentally forget to handle errors, since one might just forget to check the returned error value.
If the error is rare, you're probably not going to run into the bug for a while and Go's "default values are good actually" approach means that it might take you a while to track the origin of the missed error case, since the garbage value returned instead (in case it's not a reference type, nil will probably blow up pretty quickly) might be a "valid" result for the remaining code, just not the one you wanted.
Even if you always make sure to handle every error, that is anything but expressive. Littering your code with hundreds of
if err != nil { return err }is just error prone and distracts from the actual logic.
Worst of all, this is part is pretty easy to solve! Just add an expression like
f()?expressions, whereE[f()?]is just transformed intox, err := f() if err != nil { return err } E[x](I swear I'm not a Rust shill, Rust's approach just fits extremely well here :) )
4
u/Strum355 May 09 '22
Its as unpopular as it is for very very good reasons. These downvotes arent for nothing
10
u/Venthe May 09 '22
Why one would choose Vlang over python in terms of scripting an entrypoint?
Note, that one of the benefits of shell (or python) is to have it humanly readable; so compilation is not a benefit here ;)