top | item 31058910

Hello V-Lang

69 points| hackersreboot | 3 years ago |blog.hackersreboot.tech

183 comments

order

bheadmaster|3 years ago

Here are the summarized V features for anyone who dislikes salestalk:

    - small binaries and fast compilation
    - cross-platform support
    - cross-compilation
    - cross-platform drawing library (GDI+/Cocoa Drawing, OpenGL)
    - native GUI toolkits (V-UI)
    - value types
    - auto-free engine that adds necessary free() commands
    - C transpilation (both ways, allegedly emits human-readable C)
    - C foreign function interface ("V can call C Code and any language with C-interop can call V Code")
    - hot-code reloading (not mentioned how, but probably dynamic library hot swapping)
    - package manager
    - autoformatter
    - profiler
    - documentation-from-source generator
    - V-to-JavaScript/WASM transpilation
    - built-in testing framework
    - built-in web framework (vweb)
    - ORM ("you can just write V instead of SQL while interacting with databases")
Some tools in pure V:

    Vinix - An open-source Operating System that can already run GCC, Bash, V etc.
    Volt - A 300Kb native desktop client for Slack, Discord, Skype, Gmail, Twitter, Facebook, and more. (only supports MacOS at the moment)
    VSQL - A single-file SQL database written in pure V with no dependencies.
    Gitly - Open-source light and fast alternative to GitHub/GitLab, written entirely in V.
    Vorum - Right now it's a very basic forum/blogging software, but in the future, it will be a full-featured light alternative to Discourse. The V forum runs on Vorum.
    Vgram - A bot library for Telegram Bot API.

lawl|3 years ago

i'm pretty sure that half of these features don't work.

Such as the famous "autofree" where everyone doubted it could work and the solution now was.... to drop in boehm-gc.

for anyone unfamiliar with v, take everything on that list with a giant spoon full of salt.

Ristovski|3 years ago

I am still wondering why Volt, the native desktop client for Slack/Discord et al only supports MacOS when V boasts about cross-platform support and cross-compilation.

vlang1dot0|3 years ago

The reason V is so controversial is that it separates nearly everyone who looks at it into two diametrically opposed groups: those who have some experience or knowledge of programming language design and implementation and those who do not. The first group are generally the "detractors" and view every concession made to the impossible set of features as a reinforcement of their belief that the language cannot work as advertised. The second group sees every concession as a step closer to the eventual goals, sure that it's simply a matter of time and one more bug fix until the promised result is achieved.

Because of this dichotomy, there cannot be completely objective discussion about the language. I would strongly urge anyone thinking of spending time on V to first examine it closely and see if it holds up to detailed scrutiny. In my opinion, V does not and the author knows this but deliberately pretends otherwise for his own personal gain. Of course, you should not solely take my word for this any more than you should take Alex's to the contrary. Consider, if it really was so easy to build a language with the speed of C, the ease of use of Python and the simplicity of Go, why haven't those languages with orders of magnitude more funding simply done so? There are fundamental tradeoffs to language design and it's clear the author does not understand this.

The core problem with V is that while many language implementations tread a middle ground between the "just get an MVP out so users can give feedback; ship fast, ship often; as long as it works" engineering mindset and the "ivory tower" academic mindset, V picks the former while giving the finger to a burning pile of compiler books. The author appears willfully ignorant of the basic tecnhiques used to build compilers even going so far as to state that V won't use an abstract syntax tree because "AST is going to require lots of extra CPU power and RAM" [1]. The author later discovered that implementing an AST was actually necessary to make developing the compiler easier and made the compiler faster not slower as he originally proclaimed [2].

A few notes on the advertised feature list:

- cross-compilation

Cross compilation in V depends on having a C compiler toolchain present for the given target. That is to say, V's cross-compilation story is exactly the same at present as C's is. I'm sure some one will mention the "native backend" which has recently started to be able to build "hello world" without miscompilations. Until such time as it is able to build even slightly complex programs, this is a complete non-sequitur.

- native GUI toolkits

Native in this context means "compiled code", not that it uses the platform's native UI toolkit. V-UI draws it's own components to the screen and does not use native platform libraries at all other than to open a drawing surface.

- auto-free engine that adds necessary free() commands

Autofree does not work anywhere close to as well as advertised. Autofree will both leak memory in trivial programs [3] [4] [5] [6] as well as introduce use-after-free and double-free Undefined Behaviors [7] [8] [9] [10]. The autofree Ved demo required changes to Ved to work around autofree's broken state [11].

Autofree cannot work as well as advertised (90%+ of variables handled automatically, down from 100% orignally) without extensive inter-procedural analysis which doesn't exist [12] and would destroy V's compiler performance claims if it did. For anyone who still thinks there might be something to autofree, please explain how this logic for inserting a call to free could possibly be sound [13]:

    mut af := g.is_autofree && !g.is_builtin_mod && node.op == .assign && node.left_types.len == 1
  && (node.left[0] is ast.Ident || node.left[0] is ast.SelectorExpr)
- profiler

The profiler works by adding instrumentation calls to every function generated in your binary [14]. This can completely change the performance of your program and invalidates the results produced. No mention of this problem exists anywhere in the documentation.

In conclusion, people need to stop treating this as some kind of serious up-and-coming language and instead see it as the massive pile of poorly implemented hacks it is.

[1]: https://github.com/vlang/v/issues/1255#issuecomment-51356505...

[2]: https://github.com/vlang/v/issues/4128

[3]: https://github.com/vlang/v/issues/14033

[4]: https://github.com/vlang/v/issues/13821

[5]: https://github.com/vlang/v/issues/13539

[6]: https://github.com/vlang/v/issues/12201

[7]: https://github.com/vlang/v/issues/13554

[8]: https://github.com/vlang/v/issues/13398

[9]: https://github.com/vlang/v/issues/12455

[10]: https://github.com/vlang/v/issues/12453

[11]: https://github.com/vlang/ved/commits?author=medvednikov&befo...

[12]: https://github.com/vlang/v/search?q=is_autofree

[13]: https://github.com/vlang/v/blob/704e3c6e7275336b5b4f8da27438...

[14]: https://github.com/vlang/v/blob/3fa9128716cdc8a794b2ec0be4fb...

Normille|3 years ago

What a piss-poor excuse for an article! Reads like a press release; all puff and no down sides.

Anyone with any familiarity with the V project will know it's been mired in controversy from day 1, thanks to the [often hyperbolic] claims of its inventor. All of which seems to have passed the author of this article by, as he just gushingly repeats them unquestioningly.

Mind you, he does describe V as "all new", so maybe he missed all that previous discussion.

ibraheemdev|3 years ago

The article seems to have been written by:

> a 15 year old student who likes to code and blog

for some perspective :)

sieste|3 years ago

HN is usually an incredibly welcoming and encouraging community. Any criticisms are honest, sometimes harsh and maybe on the overly sceptical side, but mostly decent and civilised ... Unless Vlang comes up.

> What a piss-poor excuse for an article!

The article is no different from many new-sexy-js-framework blog posts I see here, but these never get that amount of hate. Why is that?

amedvednikov|3 years ago

Can you list the hyperbolic claims here please?

Micoloth|3 years ago

> thanks to the [often hyperbolic] claims of its inventor

To be fair.. I always see this in HN comments about V, and at this point it sounds just as a non-objective and prejudiced evaluation as the article is.

I agree that the article should have presented some downsides. But to start a discussion, how about presenting some valid criticisms?

Clearly people have worked on this project for a while. Have they completely failed to implement the “hyperbolic” claims? Or are they doing something good?

I’ve been intrigued about V for a while, i haven’t had the time to look into it yet.

I wish we had an objective discussion about it..

amedvednikov|3 years ago

If you'd like to check out more about V, here's the GitHub repo:

https://github.com/vlang/v

Very thorough documentation: https://github.com/vlang/v/blob/master/doc/docs.md

One of the coolest latest projects is the Vinix OS, written fully in V:

https://github.com/vlang/vinix

It's a POSIX OS that already runs libc, bash, GCC, g++, and Doom.

richbell|3 years ago

For anyone not aware, this is the creator of V.

It would be nice if you were upfront about this in your posts or profile, especially when you jump in to dismiss people's complaints about your project. https://news.ycombinator.com/item?id=25512003

hackersreboot|3 years ago

I actually did. I analysed as much as I could with major exams over my head. I am planning to try the os later. Also I would love if you could contact me at arpan@hackersreboot.tech for some talk.

kgeist|3 years ago

Last time I checked V-Lang looked amazing on paper but on closer evaluation many of the claimed features were only planned, crashed the compiler on trivial inputs, or simply were half-baked and didn't deliver on the promises (things like syntax errors from the underlying C backend, memory leaks etc. because transpilation was straightforward and lacked proper checks, hence the fast compilation speed). A few months ago I superficially skimmed through their GitHub repo and it left an impression that it's still a toy language with same problems as back in 2020, although with some improvements (but it's just my impression), many ideas being borrowed from Go and Rust. From what I also found odd is that the author is overly fixated on their transpilation speed for some reason (i.e. IIRC citing V -> C translation only, without the C -> binary part), they have a few repos written in V and one of the main selling points there is compilation speed as well - probably at the expense of other features, because they don't do deep analysis (hence C compiler errors on trivial inputs). It struck me as something odd because I find memory safety, thread safety and overall stability more important than a few saved seconds of compilation.

I will be more than happy to learn that I am wrong and the situation has considerably improved, but other than that infamous GitHub issue "The language is not what is promised", I haven't seen a more recent (as of 2022) objective, skeptical analysis of the language by someone from outside their community. Maybe someone has links?

amedvednikov|3 years ago

> citing V -> C translation only, without the C -> binary part

Not really, here's a benchmark of V compiling itself in 0.3 seconds that includes all steps (including the C -> binary part) and results in the compiler binary:

https://www.youtube.com/watch?v=pvP6wmcl_Sc

This video is linked on the home page.

> crashed the compiler on trivial inputs

We have thousands of tests, lots of big projects written in V (V itself is 220k loc, Vinix OS, Ved editor, Gitly, vsql etc), and they all work fine, no compiler errors.

Can you give an example of a trivial input resulting in a crash/C error?

The infamous "The language is not what is promised" you referenced has claims like "there's no way V is written in V", and "there's no way to do json serialization without an AST". These things are simply not true.

hackersreboot|3 years ago

Hey Guys, So I am the author of the article and it is about time I address the comments here. I just want to say that I just got to know about it, I used it and it felt good. I tested a lot of the features but ofc couldn't get them all. I know nothing of any controversies surrounding the language. Also, I am just starting out in writing so I might've not included some details or it might've looked like a "sales talk" but in all honesty I had written a section in the draft versions but forgot to include it. I am planning to write another post to address the issues of the language and my writing about it.

Thanks for reading and commenting. I appreciate it and hope to use these comments to improve myself as both a researcher and a writer. Thanks again!

bheadmaster|3 years ago

If I may offer a suggestion:

Focus on what information you're trying to convey and try to say it in the minimum amount of words. Prefer sentences that convey information ("V is has a 10MB compiler" - we learned the size of V compiler) to sentences that don't ("V-lang is an extraordinarily powerful language that can help you create a variety of applications" - we learned nothing, since "powerful" is subjective, and all languages can be used to write applications). That will help you focus on communicating your ideas clearly and tersely, which will make your articles much more attractive to technical readers.

Good luck with your research and writing!

sgt|3 years ago

Great. We rewrote our backend into D, then Arc, then into Go, and most recently into Rust. If V-lang is as good as it sounds, we'll need to ditch thousands of lines of pristine Rust code. HN-driven development methodology really has no mercy. /s

hackersreboot|3 years ago

I personally think Rust is one of the best and the most unique language in its form and will grow to play a far greater role in the dev world. I am just beginning to learn it and am most fascinated by it. Just published about "V" because new and independent ones like it also need our love and support to grow and mature as others have.

pxeger1|3 years ago

Tozen|3 years ago

You chose threads primarily from 2019. We are now in 2022. So threads and comments from 3 years ago are mostly not relevant. Some threads are even prior to Vlang ever being released (March 2019 comments versus release date of language in June 2019). To include persistently claiming Vlang is vaporware, despite it now having over 90 releases (at nearly a new one per week pace) and being well documented in terms of language and modules.

https://github.com/vlang/v/releases (releases) https://modules.vlang.io/ (modules) https://github.com/vlang/v/blob/master/doc/docs.md (documentation)

tony-allan|3 years ago

An interesting language that’s worth a look

https://vlang.io/ https://github.com/vlang/awesome-v

Rochus|3 years ago

It is indeed very astonishing why many people here have such a negative attitude towards this language.

christophilus|3 years ago

I took it for a spin recently and enjoyed the experience. The Postgres driver was woefully slow, compared to Golang (50 queries per second for a trivial query vs over 10k), which is the only reason my side project isn’t in V.

It’s a great language, though. Looking forward to using it in the future.

taylorius|3 years ago

That is a weird site. It's as if they're about to try to charge you for the actual info. on VLang. A real air of scamminess pervades - even though AFAIK it's entirely legit, of course.

goy|3 years ago

Will give a try once more ... Last time wasn't so great though.

Tozen|3 years ago

Why was this misspelled? Shouldn't it be Vlang (https://vlang.io/), not V-Lang?

hackersreboot|3 years ago

Ok, so I am the author of the article and I wanted to put it as "V" but wasn't differentiating for example in search and "Vlang" just didn't feel good.