Skip to content

A simple script to build the smallest Vlang executable possible

License

Notifications You must be signed in to change notification settings

SheatNoisette/vroom

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

vroom

A simple script to build the smallest Vlang executable possible. Please note that this may break executables or make cryptic errors. Also, this is a short PoC about executable optimization for V and it was not designed for production use.

Requirements

This script requires the following:

  • Vlang compiler
  • Clang
  • Strip utility

Usage

$ vroom [path/to/file.v or path/to/dir] -o [output_executable]

Example

$ vroom ./example.v -o example.elf

Size benchmarks

Using V 0.3.1 840370f as a baseline on x86_64.

Tool/Compiler Command Binary size
Vroom (clang/gc) vroom example -o example.elf 44 kB
V tcc v example -prod -gc none -o ex.elf 92 kB
clang 12.0.1 v example -prod -gc none -o s.c && clang -Oz s.c -o ex.elf 157 kB
gcc 11.2.1 v example -prod -gc none -o s.c && gcc -Os s.c -o ex.elf 177 kB

About

A simple script to build the smallest Vlang executable possible

Topics

Resources

License

Stars

Watchers

Forks