CentOs8に開発言語 nimをインストールしてHello Worldする
- 作成日 2020.02.05
- 更新日 2020.07.21
- nim
- hello world, nim

OSSの開発言語nimをcentos8にインストールしてHello Worldまでの環境構築手順
環境
- OS CentOS 8.0.1905 (Core)
- nim Version 1.0.4
インストール
## インストール
curl https://nim-lang.org/choosenim/init.sh -sSf | sh
情報を提供するか質問されるがnで問題なかったです
choosenim-init: Downloading choosenim-0.4.0_linux_amd64
Prompt: Can choosenim record and send anonymised telemetry data? [y/n]
... Anonymous aggregate user analytics allow us to prioritise
... fixes and features based on how, where and when people use Nim.
... For more details see: https://goo.gl/NzUEPf.
PATHを通します
export PATH=$HOME/.nimble/bin:$PATH
バージョンを確認
nim -v
<出力結果>
Nim Compiler Version 1.0.4 [Linux: amd64]
Compiled at 2019-11-27
Copyright (c) 2006-2019 by Andreas Rumpf
Hello Worldしてみる
hello.nimというファイルを下記のコードで作成します。
stdout.write("hello, world")
コンパイルして実行します
nim compile --run hello.nim
Hello Worldが表示されていることが確認できます。
Hint: used config file '/home/user/.choosenim/toolchains/nim-1.0.4/config/nim.cfg' [Conf]
Hint: system [Processing]
Hint: widestrs [Processing]
Hint: io [Processing]
Hint: hello [Processing]
Hint: [Link]
Hint: operation successful (14431 lines compiled; 0.200 sec total; 20.656MiB peakmem; Debug Build) [SuccessX]
Hint: /home/testuser/hello [Exec]
hello, world
helloというバイナリも作成されます
./hello
<出力結果>
hello, world
-
前の記事
Vue.js k-progressを使用してプログレスバーを実装する 2020.02.05
-
次の記事
Vue.js vue-treeselectの簡単な使い方 2020.02.05
コメントを書く