Earlier quoted context omitted.
Most of your list would probably remain intact. The main issue is that Go has a traditional garbage collector, and Nim has ARC, ORC, nogc, gogc, deferred reference counting, and more options for memory management.
Why are options a bad thing? What's the default? Is it reasonable?
Pros and Cons of Nim
71–80 of 86 posts
Re: Pros and Cons of Nim
#72Earlier quoted context omitted.
I'm hopeful that Kotlin/Native will improve in these areas (excepting the last one) but: * Faster compilation. * Tooling is less memory-hungry. * C++ interop. * Macros.
Tooling as in intellij/gradle? I doubt they'll ever use less memory.
Re: Pros and Cons of Nim
#73Earlier quoted context omitted.
Why use nim over Kotlin with AOT?
Kotlins stdlib is seriously lacking, at least the last time I looked at it, you couldn't even read a file without java.io.
As for multi platform io they are working on it https://github.com/Kotlin/kotlinx-io
Re: Pros and Cons of Nim
#74Earlier quoted context omitted.
Kotlins stdlib is seriously lacking, at least the last time I looked at it, you couldn't even read a file without java.io.
You can and you should use Java libs where appropriate. It's always nice to have pure idiomatic Kotlin but calling Java from Kotlin is already idiomatic. As for multi platform io they are working on it https://github.com/Kotlin/kotlinx-io
Re: Pros and Cons of Nim
#75Earlier quoted context omitted.
Why use nim over Kotlin with AOT?
I'm not familiar enough with Kotlin to give a real answer, but from what I do know the following might be relevant: * Backends: Nim compiles to JS both directly, and indirectly (emscripten) with various trade-offs (e.g. 64 bit ints require emscripten). It also compiles to C, C++ and Objective C giving you the simplest most efficient FFI to those languages one can hope for (including e.g. exception handling) while at…
It also compiles to C, C++ and Objective C giving you the simplest most efficient FFI to those languages one can hope for (including e.g. exception handling) while at the same time addressing the largest set of platforms (got a C compiler? you can use Nim). Wow, nim has implemented that much transpilers? This is kinda impressive but I would rather want a language that compile to Binary instead of compiling to another language, AND that offer nice FFI interop Kotlin has state of the art language interop through graalvm but here it does not qualify as native. For native interop it can be done but is subpar. But openjdk is working on a new API luckily.
Metaprogramming Interesting topic for sure! I've never learnt a LISP. I did use macros when I was doing C/C++ and honestly I don't get their advantages vs @Decorators() (pre compile time codegen) and they have a reputation of breaking IDEs Kotlin like Java can generate code/classes at runtime and has full support for reflection. Tangeant: Kotlin can mark any function as in/postfix which allows to easily create DSLs. Due to this Kotlin community has created a lot of elegant, declarative DSLs such as for testing.
Nim's async support (comparable to Python and C#) is a user-level library. Kotlinx.coroutines is the official library the language simply has to expose the keyword suspend.
So is, for example, pattern matching. Can Kotlin do that? Kotlin has some pattern matching features in its when keyword,but no it cannot currently destructure in when. But the subject is active and it should come in a following release, especially since Java is getting pattern matching. https://github.com/Kotlin/KEEP/pull/213
But if your point was that macros allows to modify the abstract syntax tree, Kotlin compiler plugin API offer much more power (you can modify anything anytime (the AST, the IR, the bytecode) It is arguably far harder to use than powerful macro but it does not prevent experimented guys from scalaifying Kotlin through https://github.com/arrow-kt/arrow-meta/issues They are bringing for example union types as an unofficial extension to the language. They could bring pattern matching earlier in theory.
Size: Nim compilation through C produces standalone and (relatively) tiny executables; it matters for embedded platforms. How does Kotlin fair in this respect?* I'm afraid kotlin is not made for such a use case but today even embedded platforms should have a few dozens of free MBs
Re: Pros and Cons of Nim
#76Re: Pros and Cons of Nim
#77While I rather like nim as a language, there's a few more cons that need to be considered for any real use of the language: - It has a bus/lottery factor of 1. The vast majority of all the changes were done by Araq and I have very little faith that the language would survive without him. This is even more pronounced with Zig (mentioned in comments here). - It has had some very embarrassing bugs after the 1.0 mileston…
Oh. That really surprised me, as I had assumed the bugbears I have as an occasional nim user were because it was developed for/on Windows primarily. Actually bothering to take a look seems to show me that isn't the case at all.
Bugbears such as the linking story on Linux¹, the argument handling², the style and verbosity of the compiler output, [a bunch of others]. Nothing show stopping to be fair, but a bunch of things that just seem out of place(and that always seem to require explanation when co-workers see a nim tool).
1. https://github.com/nim-lang/rfcs/issues/58
2. https://nim-lang.org/docs/parseopt.html , although alleviated by argparse to some extent.
Re: Pros and Cons of Nim
#78This feature is meant to make linking easier but it shouldn't have leaked into variability of a single module's sources.
Re: Pros and Cons of Nim
#79I'm a big fan of Nim, but I really wish it supported cyclic type declarations in separate files and out-of-order functions without forward declarations. As it is, I'm constantly structuring things around those limitations. Big projects often end up squeezed into a single huge file (or a few huge files).
consider `include` instead of `import` if you want to break things down to smaller files. Also, I'm with Araq on this one -- in my experience, every time I reached for a cyclic-cross-file-type-declaration, there was a much simpler acyclic solution I found later.
Re: Pros and Cons of Nim
#80It occurs to me that the although they were aimed at different uses cases the language that's actually closest to Nim today is Julia. Python-like syntax, compiled to native code, significant meta-programming capabilities, some native support for concurrency. The biggest difference seems to be the approach to types, since Julia is a dynamically typed language (with optional type annotations) and Nim is statically type…
Last I checked, Julia is not AOT compiled, and some people don't like Julia's startup time. For numerical computing however Julia wins hands own purely based on the community and libraries.