The V Programming language

Simple, fast, safe, compiled language for developing maintainable software

:point_up: Sounds like Rust ? Is it really possible to give memory safety without ownership ? Anyway under the Safety section, memory is not listed:

Safety

Also No Undefined Behaviour is a tall claim, may be there are no plans to allow unsafe constructs. On the plus side, can this be the go-to language for WASM ?
But, I definitely envy the following claim:

image

3 Likes
  1. Does V have RAII? I’m reading the “memory management” (no GC) section, and am wondering whether there is an equiv to Rust/Drop or C++/destructors.

  2. In Rust, even if we ignore LLVM, can we get type checking to run at 1.2 millions / second / CPU core ?

  3. At 1.2 mil lines / second … we can basically use the compiler as a REPL.

  4. Are there nice bindings for using V as a scripting language for Rust? If the structs/types could match up, it’d be nice to code V in a live repl in a Rust app, and then gradually move code from V into Rust as the code matures.

1 Like

Does V use LLVM?
No. V compiles directly to machine code. It’s one of the main reasons it’s so light and fast. Right now only x64 architecture/Mach-O format are supported. Once V is open-sourced, other architectures and formats should be implemented relatively quickly.
V can also emit human readable C, which can then be compiled to run on any platform. This way the compilation speed is about 10 times slower (≈100k lines/second).

Any idea when WASM is coming?

For comparison, libsyntax parses 400k lines per second on my machine. If you were to also do macro expansion and type checking it would be much less.

The parsing benchmark is in the Syn repo — cargo bench --features full --bench rust

1 Like

Thanks for running the test. Throwing in macro expansion is probably unfair to Rust, as macro_rules can nest arbitrarily and procedural macros runs arbitrary Rust code.

Is type checking “just unification”, or is it much slower as due to traits-black-magic, the type checker may have to “backtrack” when doing type inference on complicated generics?

Given the nice ergonomics the language gives, it must have a non-negligible runtime, so the “fast” part of the language cannot be as fast as Rust’s. Other than that, the language seems to have picked nice ideas all around (at first glance it looks like go 2.0), and designed to be easily used as a script. I’ll thus give it a try as a scripting / fast prototyping languages :slight_smile:

A point that was not clear: are there algebraic data types, or is their |result> + |option> hybrid built-in?

Have you actually tried the released version? Have you managed to replicate the lines/second number?

The website was recently updated to put “WIP” next to just about every claimed feature, so I’d take everything with more than a few grains of salt.

10 Likes

Nope. I havn’t tried it. Just came up in a different discussion thread and wanted to bounce it with rustaceans. But before posting here I checked their community chat (in discord) which seem to be active.

Someone had a look at it and found it less exciting:

I had a quick glance but ran into problems and decided to wait …

8 Likes

Relevant followup:

3 Likes

FWIW, the rust playground also lets you run arbitrary commands as “root”, or at least what its container thinks is root. I did not try to escape further…

The post mentions using containers as a remedy; that would suggest that the author found this not to be using one.

But for me, the more relevant bit is the dilettantish way of sanitizing the code using regex or similar on the source code. Properly implemented, it would operate e.g. on the AST (if that compiler even uses one) or using a slightly modified backend that can’t emit C calls.

I’m actually quite disappointed from some members of out community response to this.

I don’t care about the language, the author, the claims of the author and etc., he has put time into this and he has shared it with the world.

Sadly the response and the constant attacks from various people, just shows that no matter how good of a community you’re in there are always people like that.

I’ve just wanted to share this observation and my disappointment.

Nevertheless the Rust community as a whole is my favorite one and a big Thank you for all of you making it possible, and I am not talking about the Technical part :blush:

4 Likes

Don’t want to give an example and point fingers, it’s suffice to say that there was a not-exactly-technical issue purely for mocking the situation that lead the issue skyrocketing to just purely mocking.

It wasn’t something big, but I think while the community grows we will start seeing trolls and people that talk BS from Rust side as well. I think we are doing a very good job for now and I hope things get even better in the future.

This post was flagged by the community and is temporarily hidden.

Moderator note: sigh. This thread is going off the rails. Meta discussion about meta discussion about V is off topic. Take it somewhere else.

10 Likes