Wrapping a C++ header-only template library: https://github.com/status-im/nim-ttmath
Generating Cuda C++ Functor: https://github.com/mratsim/Arraymancer/blob/master/src/tenso...
i see no problem with this but i think JS is only ready for high school level applications too.
But... there's a loooooot of "high school level" applications out there in the world. And the way a language graduates up to the higher classes is getting tried out in the "lower criticality" systems, and getting experience.
I wouldn't try to build an S3 competitor in Nim right now, no matter how good it may look. But even a company building an S3 competitor in some other language could still have tons of other places Nim would be a fit.
All the usual static analysis tools, debuggers and even formal methods can be used on the generated C code.
Except they do, if the new untested language is qualitatively better than the old one. For example, a critical crypto algorithm in Firefox is written in F* and compiled to C: https://blog.mozilla.org/security/2017/09/13/verified-crypto... . The new implementation is formally verified free of certain classes of bugs (like buffer overflows), and significantly faster than the hand-written C implementation.
Because language age doesn't make a difference. People have to actually use the language, and this is a practical concern.
If you were choosing to put a high school football player or an NFL player on your team right now it'd be an easy choice, wouldn't it?
do they? is it in the rules of building languages and ecosystems that every new language has to be production ready from day 1? it is also possible that you can use it for hobby projects and that that's sufficient merit to talk about it and have posts about it too.
My point is, this is an actual deficiency that you need to consider when evaluating Nim, that isn't just a function of the language being new. For example, Zig is another option which puts any C libraries at your fingertips, without requiring bindings. If Nim had better interop (not just relatively good, but zero effort) this would no longer be a concern and you wouldn't need all of your libraries to be in Nim.
...
>However, the ecosystems are not at all comparable.
......?
Really?
https://github.com/VPashkov/awesome-nim
You can install Nim packages easily with nimble.
Also for people actually targeting production there is hufe dif. between say DB driver that is used in literally millions of projects and has a large number of active maintainers and DB driver written by 1 dude that has not commited any fixes in 12 month
https://github.com/kozross/awesome-c
I had initially written an application in Golang that effectively keeps our DNS records in sync with CloudFlare across ~100+ machines (A, AAAA, CNAME, etc). The application was simple enough to write in Golang but I still wasn't crazy about the error handling (if err != nil...) after every few lines, as well as the large binary size once compiled (although I understand the reason for its size).
To see if I could do better, I re-wrote the application in Nim, a language I've always had a lot of interest in. With the logic already figured out the code writing was quick and easy. I found the finished code to be cleaner and more concise and when it came time to compile I was excited to find a binary that was only 83kb in comparison to the 6mb binary of the Golang version.
Of course your miles may vary and there are many advantages/disadvantages to every language but I personally look forward to writing more Nim in the future :)
I actually suspect but haven't proven that I can make very memory or type 'safe' programs with Nim. I guess it goes back to practical necessity or reality for starters though. Do we need to or can we really prove that our programs are safe somehow? Is that something we generally need to the expense of everything else?
But Rust ergonomics have been getting better and in my opinion some of the Rust guarantees may put it in an elite category of languages along with Nim but for totally different reasons.
In my experience theoretical purity is largely independent of usability, which I find is more a function of the language's expressibility and the available abstractions (and how well those abstractions play together.)
Take Elm, Haskell and Agda/Idris as examples of four programming languages with strong theoretical foundations, that also vary widely in expressibility and usability
Elm is (imho) very usable even when teaching beginners unfamiliar with the ML-style syntax. The main abstraction is parametric polymorphism (generics in oop-terms), no subtyping with inheritance and no typeclass/interface mechanism. The language has a carefully crafted culture to maintain the beginner-friendliness of the language, explicitly at the expense of expressibility (but not usability.) I personally find elm to be an incredibly usable language, specifically because it's both simple and theoretically pure. Less to understand, for more gained reliability. More practically, I often prototype completely without type signatures, relying on type inference to make sure that I'm not doing anything nonsensical. The end result (for me at least) is the speed and ease of a dynamic language, with the reliability of a statically typed language.
Haskell (without GHC extensions) offers more abstractions and is consequently "less usable" in the sense that you need to understand more theory to use things like Higher Kinded Types and whatnot. By adding GHC extensions you can gradually ramp up the expressibility (by adding abstractions,) while at the same time making the language (slightly) more difficult to use. You can get almost all the way to dependent types which brings us to..
Agda and Idris offers an incredibly powerful mechanism for abstraction called dependent types, where you essentially program your type checker as a logic. But they are (somewhat infamously) difficult to use due to having to understand the consequences of having computations at the type-level (and beyond) and consequently at compile time.
If any of those are any less pure than the other it's probably Haskell, and that's more due to the ad hoc nature of the GHC extension system, which allows you to combine extensions in problematic ways that can hide impurity.
They all compile based on some type theory as a model of computation, but those type theories can vary widely in how complex they are to understand, but the level of complexity doesn't make anything more or less pure. All of them also offers some degree of escape hatch from their "theoretical purity"-prison. Elm has its ports for js interop, Haskell has unsafeIO and friends, Agda has FFI to both js and haskell depending on backend, and I'm guessing Idris has some way of doing this as well. In this sense Elm is probably the most pure.