Revert "add `unsetenv`, `setenv`, `clearenv` to os module (#583)"
This reverts commit 6cb5eee1b2.
|3 weeks ago|
|.github||3 weeks ago|
|base64||3 weeks ago|
|builtin||3 weeks ago|
|compiler||3 weeks ago|
|examples||3 weeks ago|
|gg||3 weeks ago|
|gl||3 weeks ago|
|glfw||3 weeks ago|
|glm||3 weeks ago|
|gx||4 weeks ago|
|http||3 weeks ago|
|json||4 weeks ago|
|log||3 weeks ago|
|math||3 weeks ago|
|os||3 weeks ago|
|rand||3 weeks ago|
|stbi||3 weeks ago|
|sync||3 weeks ago|
|termcolor||3 weeks ago|
|thirdparty||4 weeks ago|
|time||3 weeks ago|
|.gitattributes||1 month ago|
|.gitignore||3 weeks ago|
|.travis.yml||3 weeks ago|
|CONDUCT.md||4 weeks ago|
|CodeStructure.md||4 weeks ago|
|LICENSE||1 month ago|
|README.md||3 weeks ago|
|azure-pipelines.yml||3 weeks ago|
Discord (primary community): https://discord.gg/n7c74HM
Installing V: https://github.com/vlang/v#installing-v-from-source
V 1.0 release is planned for December 2019.
GitHub marks V’s code as written in Go. It’s actually written in V, GitHub doesn’t support the language yet.
The compilation is temporarily slower for this release:
v -prod -o vto get faster compilation).
There’s some old hacky code written when V was 2 months old. All of it will be quickly cleaned up. There are ~500 lines of C code, which will be removed by the end of June.
You’ll need Clang or GCC. On macOS run
xcode-select --install if you don’t have XCode or XCode tools installed.
# You can clone V anywhere git clone https://github.com/vlang/v cd v/compiler make
Or build without make:
# Download the V compiler's source translated to C wget https://raw.githubusercontent.com/vlang/vc/master/v.c cc -std=gnu11 -w -o v v.c # Build it with Clang or GCC ./v -o v . # Use the resulting V binary to build V from V source ./v -o v . # Build the compiler again to make sure it works
That’s it! Now you have a V executable at
You can create a symlink so that it’s globally available:
sudo ln -s [path to V repo]/compiler/v /usr/local/bin/v
V works great on Windows Subsystem for Linux. The instructions are the same as above.
If you want to build v.exe on Windows without WSL, you will need Visual Studio. Microsoft doesn’t make it easy for developers. Mingw-w64 could suffice, but if you plan to develop UI and graphical apps, VS is your only option.
V temporarily can’t be compiled with Visual Studio. This will be fixed asap.
$ cd examples $ v run hello_world.v hello world $ v V 0.1.2 Use Ctrl-D to exit >>> println('hello world') hello world >>>
Now if you want, you can start tinkering with the compiler. If you introduce a breaking change and rebuild V, you will no longer be able to use V to build itself. So it’s a good idea to make a backup copy of a working compiler executable.
v hello_world.v && ./hello_world # or simply v run hello_world.v # this builds the program and runs it right away v word_counter.v && ./word_counter cinderella.txt v run news_fetcher.v v run tetris.v
In order to build Tetris and anything else using the graphics module, you will need to install glfw and freetype.
If you plan to use the http package, you also need to install libcurl.
macOS: brew install glfw freetype curl Ubuntu: sudo apt install libglfw3 libglfw3-dev libfreetype6-dev libcurl3-dev Arch: sudo pacman -S glfw-x11 curl freetype2
glfw and libcurl dependencies will be removed soon.