2021-02-10
1102
#rust
Shubham Kumar
33639
Feb 10, 2021 ⋅ 3 min read

Vlang vs. Rust: Comparing build languages

Shubham Kumar Software artist and internet cowboy!

Recent posts:

Error Handling In Rust A Comprehensive Guide

Error handling in Rust: A comprehensive tutorial

Learn to handle Rust errors efficiently to write cleaner, more maintainable Rust code and create a more user-friendly application.

Eze Sunday
Jul 18, 2024 ⋅ 10 min read
Exploring Actions And Request Rewriting In Astro

Exploring actions and request rewriting in Astro

Astro v4.8 ships with server actions and request rewriting. Let’s see how to use these long-awaited (though still experimental) features.

Ivaylo Gerchev
Jul 17, 2024 ⋅ 13 min read
Comparing Fiber Vs Gin For Go Web Development

Comparing Fiber vs. Gin for Go web development

Go Fiber and Gin are two popular Go frameworks that provide extensive toolkits for developing high-performance apps with modern features.

Temitope Oyedele
Jul 17, 2024 ⋅ 8 min read
Leveraging Typescript Branded Types For Stronger Type Checks

Leveraging TypeScript branded types for stronger type checks

Branded types in TypeScript allow us to write code more clearly, provide more type-safe solutions, and maintain our code more efficiently.

Rashedul Alam
Jul 16, 2024 ⋅ 5 min read
View all posts

14 Replies to "Vlang vs. Rust: Comparing build languages"

  1. V actually allows global variables through the – -enable-globals flags. It was added mostly for driver based work and not recommended in most cases – but it’s still there to use.

  2. Your comparison comes across very biased, please make sure you do your research. I am by no means an expert in rust (and no nothing about v), but you clearly are biased to v. For example you state “There is also no null or undefined in V” but also state ” A ? can be used in place of a function’s return type, letting it either return a value, an error, or a none”. Is none not a synonym null? This sounds eerily similar rust’s “Some” enum. Also ” Rust has a ways to go in reaching the outstanding speeds now available in the marketplace” you cannot blindly state this without data. Considering rust is being adopted into the linux kernel (where speed matters) i highly doubt this statement is true. See [1] for proper comparison rather than a vague comparison.

    [1] https://kornel.ski/rust-c-speed

  3. Forbidding global variables doesn’t magically provide you with any kind of safety. In this context, global variable can be seen as special implicit parameter to any function that uses it directly or indirectly. Any unsafety (memory related or caused by data races) that can be exploited with globals can be exploited with regular parameters.
    Speaking of unsafety the language is riddled with UBs kindly provided by C which it transpiles to. Plus data races UBs which are unfixable in general without severe changes to the language semantics. Plus memory model impossible to efficiently implement. Plus low quality of design and implementation: there’s probably not a single slightly complex feature that doesn’t break if you try something that’s not exactly covered by tests. Generics impl is simply a joke, but sure “we will support them soon”.
    One thing this “will lang” great in is how it got hyped to 20k stars on github and created a cult of followers that blindly follow their leader, defy reality and kill any critics on sight (https://imgur.com/a/vz49G5A). Truly amazing.

  4. This comparison looks biased.

    > “Rust and V top-notch languages for building software”

    Rust is being funded by some of the biggest software companies in the world, and used by many in production (Microsoft, Google, Amazon, Mozilla and Facebook at the start of the list). Rust is also being used by Android and Firefox, which are widely used and impactful technologies. There are people investing time and money on it, so you can feel safe learning it.

    V, on the other hand, is yet to prove anything, it’s actually unfair to compare it with Rust, the project page had some false claims (search for “V is for Vaporwave” if you want the explanation), because of that I don’t know if we should start trusting the informations on that page right away. As that incident gets older we can expect changes in the technology, and on the behavior of those involved.

    I really hope that V can grow to a point where it can be battle-tested and fairly compared with Rust.

  5. Comparison comes across very biased +1.

    For one, an overwhelming amount of attention is given to aspects in which V supposedly has an advantage, whereas where Rust is supposedly better it’s just glossed-over with one or two sentences. Also where is Rust code? You can’t write a “comparison” between V and Rust while only ever showing V code.

    And two, a huge part of any programming language is its ecosystem, which this article “conveniently forgets” to mention at all. Well, given the author’s apparent position on the matter, I’d say good call because there’s simply no comparison. Rustup, Cargo, crates.io, developer community, documentation, variety of build targets, etc. – all of which V simply doesn’t have an answer to.

    I’m sorry but at the moment I will pick Rust any day of the week. Maybe we can revisit this topic 10 years later or something.

  6. V doesn’t have a working memory management, it leaks memory at every possible occasion. Autofree is so unstable that even v compiler doesn’t use it. All v compiler code is full of `voidptr`; now tell me how is V more type and memory safe than Rust?

  7. Vlang is considered a threat to various corporate interests and those heavily invested in Rust and Go, so they are going hard on the attack and get angry when any flaws or alternatives are shown.

    By default, any new language “shaking the tree”, and trying to put the interests of common folk first (like cross-platform application building) is going to face heavy “directed” media criticism. Vlang is for the people and is progressing rapidly, as its GitHub shows.

  8. Yes True. People are going completely biased towards Rust. No doubt Rust is a great language. But we can see how Vlang goes 🙂

    Both languages has its own pros and cons.

  9. You are criticisms are a bit unfair.

    1. None is not the same as null. In languages like js, any variable can be set to null while V like in Rust
    uses a Union type to to express if a value can contain Some(value), None or an Err(msg). If a variable is not defined as a Result/Option type it cannot be None.

    2. I have been using V for a few months now and Rust for 2 years. Rust complilation speeds don’t come
    close to V. That said, it seems like Rust runtime speeds are slightly better.

  10. Without any anger, as some believe, please investigate V’s reality well and not just his unfulfilled or still-to-fulfill promises. Any new language has a difficult way to get its first users and spread its use and if they receive support from companies that use it, it helps them. But from that to thinking that one language poses a danger to another and conspiracies there is a long way to go.

    There is a interesting post: https://christine.website/blog/v-vaporware-2019-06-23
    Let’s apply the scientific method. Read it calmly and replicate the tests on your own. So perhaps they see that what there is, at least still, are promises.

    This article on the one hand only repeats the promises but does not seem to have put things to the test. But on the other, he also confuses some things and forgets others. Memory security is not just about releasing. That even the V compiler does not trust this automatic form yet. This is part of what ownership of Rust does. When memory stops being used, it frees it up, but just by the rules it follows and the lifetimes don’t fail, unlike V (yet).

    But in addition Rust offers memory security against data race, which V does not, so it does not offer memory security. Nor by lacking bounds checks. It only offers the “reference count” in compilation, like Rust, without the protections. Besides, as I said, it is not even used by V yet, and rightly so, it has memory leaks if you look at a hello world with valgrind, and it is the simplest example.

    Other developers have found command calls in their libraries (V), they don’t have them implemented. Or that by compilation in less than 1s they refer to transpiling to C, not the entire compilation. And yet, it does not meet those times or with powerful computers.

    Hopefully in the future it will have even more protections in memory, more speed of complete compilation, more comfortable to use because the compiler can suppose better, etc. But that has not yet come if you put it to the test and look at it yourself.

    With love, a user who expects a lot from V in the future, but I am aware of the present and the road ahead.

  11. This must be a joke. I use V and the goal is what the post tell, but anyone who really use V know almost are in development and with things to improve yet. And V can not protect from race conditions and not check array limits, etc. Then it has not memory safety. Even the auto-free fail but it only end with leaks but for shor run programs is not a big deal. That’s my case, I use V for my personal CLI tools as it’s not critical about safety.

    In the end it’s like a GC but in compile time, and even Rust has also that because ownership in the end is same but with more rules and fancy name, I like to see if in the future V can even improve what Rust give, then only with support to developers of V we’ll see. But this jokes and hype really don’t help to V, only make people to think this is vaporware as it needs more time, as the other languages needed.

  12. in the last version there is a change I believe,,”By default V does not allow global variables. However, in low level applications they have their place so their usage can be enabled with the compiler flag -enable-globals. Declarations of global variables must be surrounded with a __global ( … ) specification – as in the example above.”

  13. With Rust I spend a lot of time doing something simple or downloading an application. I have to wait for hours of compilation and downloading of libraries and sometimes the compilation fails due to incompatibility and we have to start over. Rust wants to reinvent the wheel and replaces parts of the OS I guess. When there is an OS made in Rust maybe things will be easier, but wasting time downloading libraries and compiling is very ugly for Rust, I can’t stand it.

Leave a Reply