I want to check claims that V is very slow, by comparing it with Golang: https://christine.website/blog/v-vaporware-2019-06-23
The test from the source article uses 1.2 million lines. V can't compile this number of lines. Go used 25G RAM on my machine, and was compiling it ~30 mins before I interrupted this hopless process. Therefore I slightly modified the test: we'll compile only 49k lines of code.
print "package main"
print "import \"fmt\""
print "func main() {"
for i = 0, 49000, 1
do
print "fmt.Println(\"hello world\")"
end
print "}"
olegchir@OVERWATCH MINGW64 /c/temp
$ "C:\opt\lua-5.4.2_Win64_bin\lua54.exe" -v ./gen.lua > hello-world.go
First of all, run Golang on a file with an error to find the startup/warmup time
olegchir@OVERWATCH MINGW64 /c/temp
$ time "C:\Program Files\Go\bin\go.exe" build hello-world.go
hello-world.go:1:1: expected 'package', found Lua
real 0m1.075s
user 0m0.000s
sys 0m0.015s
One second warmup. Good. Now let's fix the source and compile.
time "C:\Program Files\Go\bin\go.exe" build hello-world-2.go
real 0m0.441s
user 0m0.015s
sys 0m0.000s
And this is the results for V compiler:
time "C:\opt\v_windows\v\v.exe" hello-world-3.v
real 0m1.497s
user 0m0.000s
sys 0m0.015s
V is 3 times slower than Go. But Go is a production-ready compiler, written by the whole world, including paid full-time Google developers. I think, V results are pretty impressive here.