2 ms·
How is it for data exploration? Can you run things in a repl?
by wodenokoto 3y ago
How is it for data exploration? Can you run things in a repl?
- netbioserror 3y agoIt has a very rudimentary REPL in the form of `nim secret`; however, the compiler internals are being revamped a bit in the coming versions to make room for full-featured incremental compilation and REPL support.
- netbioserror 3y agoSorry, to answer your question about data exploration, quite good. Reading files is a single procedure call which slurps into strings. Parsing JSON (or Datamancer parsing CSV) is a single procedure call. Nim objects and most compound data structures such as JsonNodes and DataFrames have printing support build in, using the `$` proc which is the language's equivalent to `toString()` and should be defined on every type possible. In short: It's great.
- archargelod 3y agoFor REPL you have three options: - [0] `nim secret` : code is interpreted with Nim's vm. It is limited to compile-time evaluations (e.g. no C/C++ interop). - [1] `nlvm r` : nlvm backend supports JIT compilation and repl-like interface was added in latest release. - [2] inim : supports all nim code, but it's not really a true repl. It adds code to a file and recompiles it (you can see the source file with `ctrl+x`). I'd recommend to use it with clang compiler, because it's a bit faster than gcc in my experience. It's the best option right now. And I use it almost daily. First two options have rudimentary input system. But you can get command history and left-right navigation by wrapping them with rlwrap (should be preinstalled on most *nixes): `rlwrap nim secret`, `rlwrap nlvm r`. There are plans to support incremental compilation for the next Nim release (it is currently broken). That would improve inim and other repls experience significantly. [0]: https://nim-lang.org/docs/manual.html#restrictions-on-compileminustime-execution https://nim-lang.org/docs/manual.html#restrictions-on-compil... [1]: https://forum.nim-lang.org/t/10697 https://forum.nim-lang.org/t/10697 [2]: https://github.com/inim-repl/INim https://github.com/inim-repl/INim