Live data from Hacker News

The V Programming Language

vlang.io

141–150 of 308 posts

Re: The V Programming Language

#141
It's pretty unclear what its purpose is. The examples look somewhat like go (including something that looks like goroutines, right down to being called with `go`). So, what differentiates V from go, I guess? (Or whatever other language it views itself as competing with, if not go.)

Re: The V Programming Language

#142
Hm I looked around the repo, and there doesn't seem to be much there.

    $ find . -name '*.v'|xargs wc -l|sort -n
    ...
      314 ./glm/glm.v
      330 ./time/time.v
      338 ./builtin/utf8.v
      339 ./examples/tetris/tetris.v
      490 ./os/os.v
      630 ./compiler/scanner.v
      644 ./compiler/table.v
      712 ./gg/gg.v
      814 ./builtin/string.v
      845 ./compiler/main.v
      848 ./compiler/fn.v
     3216 ./compiler/parser.v
    12573 total

I'm a big fan of compact code, i.e. doing more with less... but I have been working on langauges for long enough to know that it takes surprisingly large amounts of code to do anything useful in this space.

If you discount the lexer and parser, it's like 8-9K lines of code, and it's hard to imagine much being done there. You can make a "toy" in that much code, but the gap to a production compiler is very wide (e.g. a minimum of 50K or 100K lines of code).

There is also this translation which is not in the repo:

    $ wc -l v.c
    15099 v.c
----

Also, this bootstrapping part looks pretty slick, except I get a core dump (on Ubuntu 16.04 with default GCC):

    $ time cc -w -o vc v.c  

    real    0m0.553s
    user    0m0.517s
    sys     0m0.035s

    ~/git/languages/v/compiler$ time ./vc -o v .
    Segmentation fault (core dumped)

    real    0m0.095s
    user    0m0.002s
    sys     0m0.000s

Re: The V Programming Language

#143

It's pretty unclear what its purpose is. The examples look somewhat like go (including something that looks like goroutines, right down to being called with `go`). So, what differentiates V from go, I guess? (Or whatever other language it views itself as competing with, if not go.)

You can read about differences here: https://vlang.io/compare

Re: The V Programming Language

#144
post #142

Hm I looked around the repo, and there doesn't seem to be much there. $ find . -name '*.v'|xargs wc -l|sort -n ... 314 ./glm/glm.v 330 ./time/time.v 338 ./builtin/utf8.v 339 ./examples/tetris/tetris.v 490 ./os/os.v 630 ./compiler/scanner.v 644 ./compiler/table.v 712 ./gg/gg.v 814 ./builtin/string.v 845 ./compiler/main.v 848 ./compiler/fn.v 3216 ./compiler/parser.v 12573 total I'm a big fan of compact code, i.e. doing…

[deleted]

Re: The V Programming Language

#145

It's pretty unclear what its purpose is. The examples look somewhat like go (including something that looks like goroutines, right down to being called with `go`). So, what differentiates V from go, I guess? (Or whatever other language it views itself as competing with, if not go.)

Compared to Go, taken from [1]

V is very similar to Go, and these are the things it improves upon:

- No global state

- No null

- No undefined values

- No err != nil checks (replaced by option types)

- Immutability by default

- Only one declaration style (a := 0)

- Much smaller runtime

- Much smaller binaries (a simple web server written in V is 65 KB vs 7 MB in Go)

- Zero cost C interop

- No GC

- Much faster serialization using codegen and no reflection

- Precompiled HTML templates unlike html/templates that have to be parsed on every request

- Fearless concurrency (no data race guarantee at compilation)

- Enums

- Generics (in July)

- String interpolation: println('$foo: $bar.baz')

- Stricter vfmt to ensure one coding style

- Centralised package manager

[1] https://vlang.io/compare

Re: The V Programming Language

#146
post #142

Hm I looked around the repo, and there doesn't seem to be much there. $ find . -name '*.v'|xargs wc -l|sort -n ... 314 ./glm/glm.v 330 ./time/time.v 338 ./builtin/utf8.v 339 ./examples/tetris/tetris.v 490 ./os/os.v 630 ./compiler/scanner.v 644 ./compiler/table.v 712 ./gg/gg.v 814 ./builtin/string.v 845 ./compiler/main.v 848 ./compiler/fn.v 3216 ./compiler/parser.v 12573 total I'm a big fan of compact code, i.e. doing…

Where did you find `v.c`?

Re: The V Programming Language

#147
It's amazing that one person can do all this. It really takes a huge amount of dedication, knowledge and high IQ to invent a language from scratch alone. I think he is trying to Rustify Golang which is a thing I always wanted to do before giving up entirely on Golang.

Re: The V Programming Language

#148
post #142

Hm I looked around the repo, and there doesn't seem to be much there. $ find . -name '*.v'|xargs wc -l|sort -n ... 314 ./glm/glm.v 330 ./time/time.v 338 ./builtin/utf8.v 339 ./examples/tetris/tetris.v 490 ./os/os.v 630 ./compiler/scanner.v 644 ./compiler/table.v 712 ./gg/gg.v 814 ./builtin/string.v 845 ./compiler/main.v 848 ./compiler/fn.v 3216 ./compiler/parser.v 12573 total I'm a big fan of compact code, i.e. doing…

Where did you find `v.c`?

URL is in the README

wget https://vlang.io/v.c

Re: The V Programming Language

#150
post #145

It's pretty unclear what its purpose is. The examples look somewhat like go (including something that looks like goroutines, right down to being called with `go`). So, what differentiates V from go, I guess? (Or whatever other language it views itself as competing with, if not go.)

Compared to Go, taken from [1] V is very similar to Go, and these are the things it improves upon: - No global state - No null - No undefined values - No err != nil checks (replaced by option types) - Immutability by default - Only one declaration style (a := 0) - Much smaller runtime - Much smaller binaries (a simple web server written in V is 65 KB vs 7 MB in Go) - Zero cost C interop - No GC - Much faster serializ…

> No GC How does that improve upon Go? Memory safety is much harder without a GC
Post reply on HN