News for hackers. Stuff that matters.
Re:Nim programming language by cjhanks on Tuesday April 18, 2017 @07:12PM (#14143900)
Which IDE?
Re:Nim programming language by kaushalmodi on Tuesday April 18, 2017 @10:00PM (#14144879)
Emacs.

I have the nim-mode and smart-compile packages installed, and I have bound F9 to compile the nim code in the current buffer, and run it in the emacs-inbuilt eshell.

I have configured so that the point and buffer switching 'does the right thing'.

- If the compilation fails, show the compilation buffer in the other window, and do not execute the binary, and keep the point in the code window.

- If the compilation passes, execute the binary in the other window.

- Now if the binary execution ends with showing the eshell prompt, move the point back to the other window (code window).

- If not, that is, if the eshell prompt does not show up, keep the point in the eshell buffer, because that most likely means that some user input is expected.

---

So my nim learning process goes as: type a code snippet, F9, type more, probably cause error, F9, fix that, F9, etc.

Config: [1] [2]

[1]: https://github.com/kaushalmodi/.emacs.d/blob/master/setup-fi...

[2]: https://github.com/kaushalmodi/.emacs.d/blob/master/setup-fi...

Re:Nim programming language by alphapapa on Wednesday April 19, 2017 @12:15AM (#14145393)
Hey, fancy meeting you here. :) Thanks for sharing that, I'll have to give it a try.
Re:Nim programming language by dom96 on Tuesday April 18, 2017 @07:16PM (#14143925)
A text editor[1] I wrote a while ago has a feature that allows you to compile and run any tab by pressing F5, even when that tab is not saved anywhere it will save it to /tmp and compile it for you.

It's a very simple feature that I'm sure can be implemented as a plugin in any IDE/Text editor. The Nim VS Code plugin sort of supports it, but the feature could be improved. (Nowadays, I wouldn't recommend using Aporia for various reasons).

1 - Aporia - https://github.com/nim-lang/Aporia

Re:Nim programming language by kaushalmodi on Wednesday April 19, 2017 @12:06PM (#14148761)
> Nowadays, I wouldn't recommend using Aporia for various reasons

On https://nim-lang.org/faq.html under "What about editor support?", Aporia is mentioned as the first option. Should it be moved lower in the list?

Anyways I use nim-mode in emacs, and it works great!

Re:Nim programming language by FridgeSeal on Tuesday April 18, 2017 @07:55PM (#14144217)
I've had success with vscode: I have it setup to build+run on save which has so far netted me very quick turnaround times for trying things out.

Admittedly I'm still doing super basic stuff at the moment.

Re:Nim programming language by partisan on Wednesday April 19, 2017 @09:31AM (#14147542)
Same here. It is a good combination and creating a build task for nim is super simple.
Re:Nim programming language by the_duke on Tuesday April 18, 2017 @08:25PM (#14144380)
I'm not sure this still works, but I wrote a nim playground a while ago that you can just run locally.

(Similar to http://play.rust-lang.org or https://play.go-lang.org).

https://github.com/theduke/nim-playground