News for hackers. Stuff that matters.
Re:Rust vs. Go in 2023 by amedvednikov on Sunday August 13, 2023 @03:47AM (#37107613)
Both are great. And if Rust and Go had a baby, you'd get V (that's something that many V users say).

V takes Go as the base and adds missing features from Rust: immutability by default, result/sum types (no err != nil checks), map/filter/reduce, enums, C++ performance, etc:

https://vlang.io/compare#go

Re:Rust vs. Go in 2023 by danieldk on Sunday August 13, 2023 @04:24AM (#37107807)
Would be nice to add a short disclaimer that you are the author of the V language (at least it seems from your username, correct me if I'm wrong).

There are many new languages in the same space (Zig, Nim, V). However, if you use a language outside hobby projects, you are dependent on a language having a long-term healthy ecosystem. Of the newer native languages, only Rust, Go, and Swift have enough traction to bet your livelihood on.

In the end, having a rich ecosystem with good libraries and tools is going to leave a far bigger mark on productivity than relatively small differences between Rust, V, Zig, Nim, D, or whatever.

Re:Rust vs. Go in 2023 by amedvednikov on Sunday August 13, 2023 @04:29AM (#37107836)
True, Go has an amazing ecosystem. A great stdlib and libraries.

That's why we're working on Go2V, which will be able to fully translate Go code to V. (Having a language so similar to Go also helps.)

It's already been partially used in our translation of Go's crypto modules:

https://github.com/vlang/v/tree/master/vlib/crypto

Re:Rust vs. Go in 2023 by parabyl on Sunday August 13, 2023 @04:05AM (#37107702)
Spent a few months writing a pretty hefty Cqrs app in Go last year, had a fun but pretty unintuitive experience with rustlingss, and V really does seem like a cool in between! I look forward to taking it for a spin
Re:Rust vs. Go in 2023 by fuzztester on Sunday August 13, 2023 @03:58AM (#37107670)
>(no err != nil checks),

How does that work in practice? Example please.

Re:Rust vs. Go in 2023 by amedvednikov on Sunday August 13, 2023 @04:04AM (#37107700)
V uses Result types for handling errors, and the developer must handle them by propagating the error or breaking/returning or panicing.

For example:

  // os.v
  fn open(path string) !File {}

  // main.v
  file := os.open('out.txt') or { panic('failed to open: $err') }
  file := os.open('out.txt') or { return }
  file := os.open('out.txt')! // propagate the error
  if file := os.open('out.txt') {} // alternative scoped syntax
Re:Rust vs. Go in 2023 by fuzztester on Sunday August 13, 2023 @04:44AM (#37107906)
Thanks. Will check those out more.

V syntax looks somewhat clear.

Re:Rust vs. Go in 2023 by fuzztester on Sunday August 13, 2023 @04:59AM (#37108016)
Thanks.

V syntax looks somewhat clear.

Re:Rust vs. Go in 2023 by born-jre on Sunday August 13, 2023 @03:53AM (#37107642)
Love the hustle. :D
Re:Rust vs. Go in 2023 by kaba0 on Sunday August 13, 2023 @09:09AM (#37109682)
So V also has nothing to do with rust, the same way go also hasn’t. Both are high level languages, of which we have 1000s to choose, leaving rust and zig be modern low level languages that are no longer experimental/research.
Re:Rust vs. Go in 2023 by amedvednikov on Sunday August 13, 2023 @09:51AM (#37110054)
What kind of low level stuff can you do in rust/zig that you can't in V?

V works just fine for low level stuff, we have a full os/kernel written in V, which can already run g++ and doom.

Re:Rust vs. Go in 2023 by kaba0 on Sunday August 13, 2023 @10:07AM (#37110166)
Microsoft has a whole OS written in C#, lisp machines were also a thing, so nothing new. GC is not a problem for OSs.

But there are very few applications that do mandate a non-GCd language, like writing performant runtimes, deterministic workloads, etc.

Re:Rust vs. Go in 2023 by amedvednikov on Monday August 14, 2023 @02:15AM (#37118038)
So what kind of low level stuff can you do in rust/zig that you can't in V?

You don't have to use GC in V. It has optional manual management/autofree/arena.