LoginSignup
5
1

More than 3 years have passed since last update.

macOSで vlang 0.0.12 使ってhello world

Last updated at Posted at 2019-06-20

ダウンロードできるようになってたので試してみました。

ダウンロード、展開

https://vlang.io/
上記サイトから、 v_macos.zip をダウンロードして展開します。
今回は面倒臭いので、~/Desktop/v_macos に展開しました。

brew で諸々インストール

READMEに従ってインストール

$ brew install glfw freetype curl

ファイルの準備

~/Desktop/v_macos/hello.v
fn main() {
        println('hello world')
}

上記ファイルを、展開したディレクトリにおきました。

コンパイル

パスとか通してないので、.を頭につける必要がありますが、以下のコマンドでコンパイルです。

~/Desktop/v_macos $ ./v hello.v 
Checking for updates... (soon this will only be done once per day)
V is up to date

実行

hello という実行ファイルが作成されているので叩きます。

~/Desktop/v_macos $ ./hello
hello world

その他

バイナリサイズですが以下でした

~/Desktop/v_macos $ ls -lah
... 50K  6 20 14:53 hello

vscodeのエクステンションはこちら
https://github.com/0x9ef/vscode-vlang

5
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
5
1