Recent Changes - Search:

Oktatás

* Programozás 1
  + feladatsor
  + GitHub oldal

* Szkriptnyelvek
  + feladatsor
  + quick link

Teaching

* Programming 1 (BI)
  ◇ exercises
  ◇ quick link

teaching assets


Félévek

* 2025/26/2
* archívum


Linkek

* kalendárium
* tételsorok
* jegyzetek
* szakdolgozat / PhD
* ösztöndíjak
* certificates
* C lang.
* C#
* D lang.
* Java
* Nim
* Nim2
  + exercises
* XC=BASIC
* old
  ◇C++, ◇Clojure, ◇Scala


[ edit | logout ]
[ sandbox | passwd ]

Install a REPL

Although Nim is a compiled language, it also has a REPL. (Shameless plug: I also wrote a simple REPL for the C language, see here).

Nim's REPL (which is a 3rd-party library) is called INim.

$ nimble install inim

$ inim
👑 INim 1.0.0
Nim Compiler Version 2.2.8 [Linux: amd64] at /home/jabba/.nimble/bin/nim
nim> 1+1
2 == type int
nim>

It's slow, because in the background it updates and compiles a Nim file, but it's still very useful if you quickly want to try something.

Remove a package

$ nimble uninstall inim

The secret REPL

Nim has a secret REPL:

$ nim secret
Hint: used config file '/home/jabba/.choosenim/toolchains/nim-2.2.8/config/nim.cfg' [Conf]
Hint: used config file '/home/jabba/.choosenim/toolchains/nim-2.2.8/config/config.nims' [Conf]
>>> 1+1
2: int literal(2)
>>>

To get GNU readline support (arrow keys, history, etc.), launch it with "rlwrap nim secret".

It's a hidden, undocumented and quite limited REPL, built into the nim compiler itself.

Nim has a virtual machine (VM), which is used for the compile-time macro evaluations, for instance. nim secret uses this VM. It has its own limitations, so I suggest using INim, which is a more full-featured REPL. However, you can also try nim secret and test its capabilities.

Cloud City

  

Blogjaim, hobbi projektjeim

* The Ubuntu Incident
* Python Adventures
* @GitHub
* heroku
* extra
* haladó Python
* YouTube listák


Debrecen | la France


[ edit ]

Edit - History - Print *** Report - Recent Changes - Search
Page last modified on 2026 March 19, 22:22