The V Programming Language

I’ve just read “Is Zig the long awaited C replacement” and it cites: The V Programming Language seems to be a “fastly compiling” language.

Compilation speed benchmark

  • C 5.2s gcc test.c
  • C++ 1m 25s g++ test.cpp
  • Zig 10.1s zig build-exe test.zig
  • Nim 45s nim c test.nim
  • Rust Stopped after 30 minutes rustc test.rs
  • Swift Stopped after 30 minutes swiftc test.swift
  • D Segfault after 6 minutes dmd test.d
  • V 0.6s v test.v

I wrote a small program that generates 400 000 lines of code in several languages to benchmark their compilation speed.

#!/bin/bash
echo "
class FOO
create make
feature make
local i: INTEGER
do"
let i=0
while (( $i < 200000 ))
do
echo "
i := "$((++i))"
i.print_on(std_output) "
done
echo "
end
end -- class FOO
"
class FOO
create make
feature make
local i: INTEGER
do

  i := 1
  i.print_on(std_output) 

  i := 2
  i.print_on(std_output) 
....
end
end --class 

Liberty Eiffel is a trans-compile you know. It didn’t take too much to turn it into C but it run the C compiler underneath after 8 minutes is still compiling a 20mb behemoth it produced….

But the most urgent problem is that bootstrapping Liberty is still a mono-core script…

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.