LoginSignup
6
2

More than 5 years have passed since last update.

AtomでNim

Last updated at Posted at 2018-01-29

やりたいこと

Nimで遊んでみようと思ったので、AtomでNimを書けるようにする。

結論

nimのパッケージをインストールするだけ
スクリーンショット 2018-01-30 08.15.51.png

もう少し詳しく(経緯とか)

NimのGithub Wikiを見ると、Atomのサポートについて書かれていました。
https://github.com/nim-lang/Nim/wiki/editor-support

リンク先を見てみると、NimbleNimsuggestをインストールする必要があると書いてあります。
https://github.com/russpowers/nim-atom

ただし、それぞれのReadmeを読んでみると、「Nimインストールしたら一緒にインストールされるよ」とのことなので、brew install nimしたら、Atomでnimのパッケージを探してインストールするだけ。
https://github.com/nim-lang/nimble
https://github.com/nim-lang/nimsuggest

Hello Worldしてみた

hello_world.nimを任意の場所に作って

echo "Hello, world"

-r(実行)オプションを付けてコンパイルするだけ。

$ nim c -r hello_world.nim
Hint: used config file '/usr/local/Cellar/nim/0.17.2/nim/config/nim.cfg' [Conf]
Hint: system [Processing]
Hint: hello_world [Processing]
CC: hello_world
CC: stdlib_system
Hint:  [Link]
Hint: operation successful (10984 lines compiled; 0.863 sec total; 17.938MiB peakmem; Debug Build) [SuccessX]
Hint: /Users/username/work/study/hello-nim/hello_world  [Exec]

Hello, world

Atomの画面上ではこんな感じです。

スクリーンショット 2018-01-30 08.18.40.png

アイコンの色がいい感じで好きです。(ミルククラウン?ただの王冠?)

6
2
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
6
2