18 ms·
A Programming Language Underdog
- cshenton 8y agoDoes nim have a concurrency story yet? That’s what gave me pause last time I checked it out.
- dom96 8y agoYep. Concurrency is achieved via async await. Parallelism via `spawn`. Here is an example from my book that uses both: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim https://github.com/dom96/nim-in-action-code/blob/master/Chap...
- karmakaze 8y agoWhere is supporting use of multiple cores on the roadmap?
- mratsim 8y agoCompile with `--threads:on` and everything in the threadpool module are available. You can also use `CreateThread` for long-lived threads. Alternatively, you have an open-mp for loop that you can use with `||`: for i in 0||1000: doParallelSomething()
- ducklingslicks 8y agoI read the article. Still no idea what Nim is good for and why it's better than some other language.. and for which use cases?
- dom96 8y agoThis might sound strange but Nim is good for everything. From writing backend services to creating web apps running on the client side. I've built emulators, CLI apps, a full blown forum and much more in it. It's particularly great for systems programming tasks that require high performance and zero dependencies. For example, Status is currently writing an Ethereum 2.0 sharding client for resource-restricted devices[1] in Nim. Nim is also awesome if you've got an existing C or C++ codebase, the interop that Nim offers is one of the best (if not /the/ best), especially when it comes to C++ interop. As far as I'm concerned no other language can interoperate with C++ libraries as well as Nim can. 1 - https://github.com/status-im/nimbus https://github.com/status-im/nimbus
- iTokio 8y agoWhat are Nim’s main weaknesses?
- dom96 8y agoThese affect people in different ways but off the top of my head: - No Nim v1.0 yet, despite this we do our best to create a deprecation path for everything that's possible. - No big company like Google/Apple supporting the language. - Community is smaller than that of Go/Rust.
- nicoburns 8y agoA biggy is that it only really has a single developer, and no big corporate users. And relatedly the library ecosystem is relatively weak. It also has a GC, so it can't be used for really low-level stuff where that is a problem. It's looking pretty promising though. Especially if you are a fan of python's syntax.
- andrewchambers 8y agoThat is not totally true. Nim's own GC is written in Nim. You can turn the GC off.
- mratsim 8y agoI use Nim for Cuda, OpenCL and cache-sensitive/memory-bound multithreaded computation. You can mix and match manual memory management and GC-managed types in the same codebase.
- interfixus 8y agoTwo developers at least. One of whom is in this very thread. It's a concern, yes, but actually has been around for more than a decade, and is showing absolutely no sign of slowing down or going into hibernation. I have just seen a ... competing language team spending developer time on purging the code of what they call ableism. apparently it's now offensive to talk of a sanity check ot to facetiously refer to OCD in a comment. At least we may hope the Nim team lacks manpower for such idiocy.
- sidstling 8y agoI read the article, and I’ve been spending the past 20 minutes looking at the SPA framework. I’m still not sure what it is or why anyone would use it. It looks extremely complicated and verbose.
- antonkm 8y agoDon't know why you're being downvoted. I had the same experience reading through Karax GitHub. I might be spoiled by other docs.
- dom96 8y agoKarax needs a promotional website, badly. It's a really great SPA framework and IMO is totally competitive with React.
- vindarel 8y agoKarax is very promising to me. The Nim forum was re-built with it recently: https://github.com/nim-lang/nimforum https://github.com/nim-lang/nimforum However, it has no totally no documentation, and seems super alpha.
- jhbadger 8y agoI've played with it, and have written a basic fasta/fastq bioinformatics library in nim (https://github.com/jhbadger/nimbioseq https://github.com/jhbadger/nimbioseq) What I find appealing is that seems to reach the goal of "a compiled typed language that feels like a scripting language" more so than other similar languages like Kotlin and Swift. There is just so little "boilerplate" code that always seems to have to be included in compiled languages and yet it seems to generate decent smallish binaries (via C). There's also a Javascript backend for web development, but I haven't used that.
- JohnStrangeII 8y agoI've tried it out and read the Nim book, but I'm not using it for any larger project right now. So here is a biased opinion. Pros: Nim is about as easy to program as Python, has the same speed as C, a working FFI, and all the usual bells and whistles of modern "battery included" languages like a package manager with lots of packages. It is garbage collected, which is good -- about this, some will disagree, of course. It has nice high level constructs and doesn't attempt to reinvent OOP or something like that, the language is fairly straightforward. It also has a powerful macro programming facility, which is cumbersome to use though. Cons: The community is too small and so far has not attracted CS people or many professionals, and there is the usual bulk of abandoned or undocumented packages you get with these kind of languages (more on that below). It has a few controversial syntax choices (e.g. identifier case rules) and also a number of semantic misfeatures that ease compatibility with C. It has support for native threads but no Green threads like Go, and consequently also no Green thread -> OS scheduling that would be ideal. (You'd like the language to do some flow and dependency analysis and parallelize to Green threads automatically, which are then mapped to OS threads, but AFAIK only few experimental languages can do that by now.) Its garbage collector is not optimal and not as performant as Go's, I believe. It uses whitespace for blocks, like Python. Overall, Nim is a pretty good general-purpose programming language. I should say that I have a long-term interest in esoteric languages and have been working on my own for a while. However, my main use case is desktop application development and unfortunately so far there is not a single new language that I would really recommend for developing desktop applications, unless you're fine with bindings to some monstruous web interfaces (Elektron, Sciter, etc.) and want to program half of your application in Javascript. Rust, Go, Nim, Elixier, Julia, Crystal, etc. do not have GUI frameworks that are ready for prime-time use in production, except maybe for a few interfaces to web apps. Their native libraries (like Nimx for nim, duit for Go, Conrod for Rust) are unfinished, limited or simply too impractical, and bindings to Qt and wxWidgets are either undocumented, incomplete, or suffer from weird license restrictions (like a Go Qt binding I've taken a look at, I forgot its name). Some of the libraries also create monstrously large executables. For command-line tools you can use any of them, just like thousands of other languages. For web programming, you can also use them but then there is also Common Lisp, Racket and plenty of other languages good for that. For desktop applications with modern GUI, on the other hand, you will be too limited with any of these languages and constantly chase some incomplete bindings or try to figure out how the bindings work. (Most docs for bindings simply assume that you've used the respective library a thousand times in C or C++, in case of which you could, frankly speaking, probably safe yourself the trouble and do it in C or C++ anyway.) For this reason, I've decided to use Lazarus for my GUIs. Qt with C++ or Python is also a good choice. I also use Racket, but its native GUI is too limited, and still have hopes for Go.
- k__ 8y agoWhat Crystal is for Ruby devs, Nim is for Python devs, I guess.
- galfarragem 8y agoIn theory yes, in practice it's not that clear. You make a fast Rails in Crystal and a large percentage of Ruby community will jump in. In Python you can't do that, the community is fragmented. And you have already Julia..
- dom96 8y agoIn some ways, yes. But in practice Crystal is far closer to Ruby than Nim is to Python.
- keypusher 8y agoI like Nim, although I don't think it's great for everything and I do think it fills a particular niche. For me, that is a systems-programming language akin to Go or Rust with a familiar syntax. Coming primarily from Python, sometimes I need a language that is a) safe b) fast c) easily capable of producing a cross-platform executable. Nim provides all of these with a Pythonic syntax and style, and that is really the main reason I like it. It lacks the sponsorship and audience of the other two, but is still a well maintained language with an active community and all the core functionality you would likely expect. That being said, a few years ago I was a strong proponent of Nim, while today it is clear that Rust and Go have captured the mindshare and continue to grow momentum. In fact it becomes hard to recommend Nim when I think of where these 3 languages will likely be in 5 years.
- narimiran 8y agoA year ago I've started experimenting with Nim as a "faster Python" — put some declarations, change some keywords and you're ready to go — your "compiled Python" is now ~30x faster. Recently I've used Nim for the first time for an official project at my job (at university). Instead of doing a simulation with Python+Numpy, I've decided to do it with Nim, and just plot the results with matplotlib. The whole experience was very pleasant. Speaking of interoperability with Python, there is a great Nim library called Nimpy [0], which makes possible to use Nim as a more pleasant Cython — you can keep writing Python, and just use Nim for the intensive/slow stuff. [0] https://github.com/yglukhov/nimpy https://github.com/yglukhov/nimpy
- nundah_guy 8y agoExactly the same story with Dlang.
- JepZ 8y agoAnother interesting upcoming language ist JAI: https://inductive.no/jai/ https://inductive.no/jai/ Its purpose is to become a better C++ for game development (high performance, simplicity).
- mswift42 8y agoCan anyone explain what "designed for good programmers" means?
- krapp 8y ago> Can anyone explain what "designed for good programmers" means? It means "programmers who agree with Jonathan Blow and his opinions on what good programming is."
- walki 8y agoNo garbage collection.
- childintime 8y agoIn JAI you own the code, the data, the build system, everything. JAI runs at compile time, so you can introspect your code and generate custom builds or generate custom files, or structures, like dictionaries of similarly named functions. JAI doesn't implement abstractions (like objects or a GC) that might get in your way. JAI supports gradual refactoring and you can change your mind about the way memory is layed out ("AOS" (structs of arrays), delegates), and still use the same code. Want to shoot yourself in the foot with uninitialized variables? Fine! In general, if you know what you are doing, JAI will allow it. JAI is similar to C in spirit, but C is a rather poor implementation in comparison.
- AnIdiotOnTheNet 8y agoMany programming languages seem as though they are designed to force the programmer to be "safe", Rust's borrow checker is an example, but so is basically every GC-language ever. What Jon means by "designed for good programmers" is that the language design doesn't have this mindset that it needs to prevent the programmers from harming themselves, and instead focuses on allowing people who know what they're doing to be more productive doing it.
- eggy 8y agoI had tried Nim a few years ago, and I liked it, but I am more of a Lisp or C person. I am trying to learn Zig [1] which is intended to be a C replacement - no GC, manual memory management, but avoiding C's pitfalls. Just recently I have been playing with Terra [2] for low level stuff. I am a fan of underdog languages - J, picolisp, shen, xtlang (extempore). [3,4,5,6] [1] ziglang.org [2] terralang.org [3] jsoftware.com [4] picolisp.com [5] shenlanguage.org [6] extemporelang.github.io
- MaxBarraclough 8y agoI think Zig is the most promising of these - they've been able to do very cool stuff early on, such as outperforming C for certain problems, and generating absurdly small binaries. Last time I checked though they hadn't quite nailed their memory-management model and things were still in a state of flux.
- vmchale 8y agoEh, aside from embedded development binary size isn't really a problem. And at this point, having experience with ATS + Rust, the fact that the memory-management model is still wonky is kind of disappointing.
- peatmoss 8y agoIf Nim’s compile-to-c is attractive, and you like lisp, how about Chicken Scheme?: https://www.call-cc.org/ https://www.call-cc.org/ What little I’ve done is a pleasure. I like some of Racket’s post-Scheme language features better, but Chicken has a lot of Get Stuff Done libraries (eggs), and compiling a single executable is pretty killer. Racket will bundle up an executable pretty well too, but it’s hard to compete with Scheme -> C -> statically linked executable for some things.
- sdegutis 8y agoThe way Chicken Scheme compiles to C is pretty neat actually. It gets turned into a giant chain of function calls, so that the stack never actually returns. So this Chicken code: (foo) (bar) (qux) gets turned into this C code: foo(bar(qux())) When it hits the C stack's limit, it resets the stack and unwinds to the beginning, and starts over again. I think it was done this way to allow call/cc to work without having to use setjmp/longjmp.
- k__ 8y agoAll the languages mentioned got rather much publicity in the last years. Wouldn't call one of them obscure..
- skellock 8y agoI tried to phrase it as "wandering down the obscurity path" because I agree with what you're saying: they aren't obscure. They're just not the default choice.
- jarcane 8y agoI find the framing of “no big backers” kind of weird, considering they do have one big backer in a crypto currency startup that is providing the overwhelming majority of its funding. Sure it’s not the big coffers of Google, but it’s concerning that the entire language seemingly depends on the fates and desires of an incredibly volatile field. https://nim-lang.org/sponsors.html https://nim-lang.org/sponsors.html
- dom96 8y agoThis is a very recent development and it will only serve to accelerate development. But yes, we do have sponsorship now. I don't consider it at the same level as the likes of Google/Mozilla though. If it wasn't for those companies I doubt Rust/Go would be alive today. You've gotta give us some points for our persistence :)
- z0ltan 8y agoAgreed.
- enthus1ast 8y agothe last 8 years (or so) Nim lived withouth big bakers
- recursive 8y agoA total investment of $19k probably doesn't qualify as a "big backer" when comparing to things like swift and typescript.
- omnimus 8y agoIt is 19k a month.
- sparkie 8y agoIt is not only that the companies pushing those languages have lots of money, it's that they already have lots of users. Often, they publish their language as if it were an "upgrade" from what they were already using, with an even greater chance of success if it is compatible with existing ecosystem. On the other hand, a language like Nim is starting from scratch. They don't have a specific target audience. There is so much competition in that crowded space that languages which are roughly on par in features and use similar paradigms are fighting for the attention of the geeks who would actually take the time to look, rather than it being bestowed upon them by the people already providing their tools. Languages are not general purpose in the truest sense. They have their own little ecosystems where they're expected to be used and their proponents are often bubbled in that ecosystem. It's easier to migrate to a new language in your ecosystem than to move to a new ecosystem. Someone just hoping to solve a specific task will pick the tool that has an established history of being practical in that domain and won't take risks with new languages. Anyway, language choice is often about what's fashionable than what's worthwhile. Did we get stuck with Javascript because of it's superior features or big company backing it? People want to learn whatever is de rigueur, often to improve their job prospects. Does having Nim on your resume give you an edge? Personally, I've looked at Nim and find it interesting, but not novel enough that I feel I need to use it. What are the killer features that only Nim provides and you feel you can't do without them after using it?
- deleted 8y ago[deleted]
- decentrality 8y agoAt the time of me writing this, the link to nim at the top of the article is wrong. I let the author know, but it ought to be: https://nim-lang.org/ https://nim-lang.org/ The first reference to the FQDN ends with "-" before the TLD, apparently inadvertently.
- decentrality 8y agoRight on, it's fixed now.
- mratsim 8y agoBy removing the C standard lib and using a custom linker you can get the Hello World down to 150 bytes. Here is a fun read: https://hookrace.net/blog/nim-binary-size/ https://hookrace.net/blog/nim-binary-size/.
- marmaduke 8y agoOther than a sort of ELF golf why would dropping the C lib be useful?
- nickpsecurity 8y agoIn high-assurance fields, the mindset is all code is malicious, buggy garbage until proven otherwise by rigorous analysis. That means everything we include will cost us. If we don't use it, we don't include it by default to save us work.
- lylecubed 8y agoEmbedded development.
- vmchale 8y ago> ELF golf actually turns out to be important in embedded work
- steveklabnik 8y agoIncidentally, in Rust this kind of thing could get you 151 bytes out of Rust: http://mainisusuallyafunction.blogspot.com/2015/01/151-byte-static-linux-binary-in-rust.html http://mainisusuallyafunction.blogspot.com/2015/01/151-byte-... (linked in that post) But that was before 1.0. Updating the example and applying some more tweaks, it’s down to 145: https://github.com/tormol/tiny-rust-executable https://github.com/tormol/tiny-rust-executable
- Annatar 8y agoRust is also terribly overcomplicated and a mishmash salad of different languages, so much so that in the end, it's just simpler to call ld(1) on a .o file directly.
- Annatar 8y agoInteresting! Minus: yet another proprietary package manager, bypassing the operating system's software management subsystem (operational maintainability) Plus: finally a language which compiles to binary executable machine code. Plus: transpiles to multiple "backend" languages (but transpilers incur a performance penalty). Plus: can link with shared object libraries, thus having instantaneous integration choices with an enormous corpus of existing software. Plus: can turn off garbage collection, which is ideal for command line programs designed to be chained with the shell pipe mechanism.
- enthus1ast 8y agoi must admit that i'm not a big fan of nimble (nim's package manager; for a few reasons) but on the other site you have apt, pacman, yum, whatelsenot, afaik most of them are not even able to install two versions of the same library side by side. The situation is so bad that most applications these days are packed with `flatpack` or something else, because of the so broken linux package management... In contrast to eg. npm nimble is superfast.
- eeZah7Ux 8y ago> most of them are not even able to install two versions of the same library That's entirely by design. Distributions exist to provide a set of packages that are well tested, and work reliably, together. And then guarantee that such set will stay the same and receive timely security updates for 3 or 5 or more years so that people can reliably use it in production.
- enthus1ast 8y agoand in the real world you do configure; make install then ;) edit: or docker every one i've met so far, uses docker as a kind of "package manager". Database? Oh year use this docker image, elastic search & kibana? shure docker. What they actualy want most of the time is: an easy way to install this stacks, in an non ancient version, where i can actually use the stuff i need to use.
- peheje 8y agoReally excited to see Nim here on top of HN. I wish it would gain more traction. I like the pythonic syntax and easy 'fast code'.
- AsyncAwait 8y agoI like the concept of Nim, as in: fast, statically typed, inferred, compiled etc. but I do not enjoy whitespace-sensitive languages, so am keeping an eye on Crystal more than Nim. If that doesn't bother you, Nim is really neat.
- bbeonx 8y agoActually, I'm curious why people don't like white space sensitive languages. I get the tab v space thing, and there are certainly a couple of other down sides, but none of these seem like deal breakers to me. Given that python was the second language I learned, it's possible that I drank the coolaid early and I'm blind to some things that are truly egregious. So the question is: why do folks completely avoid a language for a single relatively bland syntactic feature? Is there some cost I'm not aware of, or is it just stylistic/aesthetic?
- krapp 8y agoTo me, braces are simpler and more explicit, but then I drank the C/C++ koolaid. Whitespace is intended for human readability, with spaces and tabs not having any implicitly contradictory meaning. In a whitespace sensitive language, you have to set your text editor to make those invisible characters visible to make certain to only use the correct invisible character, then employ multiple such characters based on the necessary level of indentation to do the work of a single set of braces.
- andybak 8y agoI know this has been said before but for me it's as simple as: "Format your code as you would have done anyway but just leave out the curly braces". It reduces rather than increases the number of things I have to think about.
- fnord77 8y agoI do not think all this language fragmentation is a good thing. A million little obscure languages that all at the end of the day do the same thing. Yeah, we need language research to keep devising new features and more efficient ways of programming, but this is different. I wish the world would get behind a couple well thought out languages that cover most programming needs (functional, systems/bare metal, scripting) and stick with those. I've seen some ridiculous and unsustainable stacks at some shops because everyone got to pick their favorite language. Then the morale of subsequent hires is in toilet because there's such a cognitive load to learn all these little crap languages. I feel like some of these languages come about because someone needed to do some task and didn't understand or take the time to learn how to do it in an existing language. Among the latest versions of the mainstream language, there is no programming paradigm you cannot do. And where these obscure languages REALLY fall down is tooling. Got debugger support for this? Got perftool support? No, of course you don't. With a small number of languages, work can be put into serious tooling, and fixing compiler bugs, rather than a few devs spread thin trying to keep up with the bugs in their hobby language.
- redleggedfrog 8y ago"I do not think all this language fragmentation is a good thing." I both agree and disagree with this. I love the creativity and imagination that goes into a language like nim. But at one time I thought the same about python! Sometime obscure little languages become important. On the other hand, the tooling statement is dead on. At the point I find out it doesn't have a step-through debugger I'm just reading the docs for fun and then moving on.
- skellock 8y agoSee, this is what I thought too. Turns out, by compiling to C or C++, you can use their toolchains. Debuggers, codecov, emscripten...
- ryanianian 8y ago"Can use" is different from "can use productively." Technically if it's compiled to C/C++ you can use gdb/lldb etc, BUT the compiled version may be so drastically different from the input that it's effectively useless to track down logic errors in the original.
- ColinWright 8y agoDoes it have arbitrary length integers? I've not been able to find any reference to such. Edit: OK, there's a library called "bigints" - it's not clear how "natural" the resulting code will be, but I might experiment.
- arc776 8y agoTry "StInt: A fast and portable stack-based multi-precision integer library in pure Nim" Being stack based and having some nice compile time evaluation features should make it very performant. Here: https://github.com/status-im/nim-stint https://github.com/status-im/nim-stint
- ColinWright 8y agoThat's excellent - thank you. Assume I'm not a complete numpty, but are there directions for: * Download * Install * Invoke ... anywhere? I'm not at all familiar with retrieving and installing libraries from git, nor with NIM and how/where to install code. All assistance gratefully received. Pointers to existing detailed instructions also very welcome. I can investigate all this myself with trial-and-error, but if someone's done it before it saves me the time and effort of making all the mistakes again. Thanks.
- mratsim 8y agoEasiest way to start with nim is via choosenim: https://github.com/dom96/choosenim https://github.com/dom96/choosenim then `nimble install https://github.com/status-im/nim-stint` https://github.com/status-im/nim-stint` Unfortunately I didn't have time to focus on documentation but the easiest way to get started with Stint is to check the tests: https://github.com/status-im/nim-stint/tree/master/tests https://github.com/status-im/nim-stint/tree/master/tests. The casts are there to check binary representation compatibility in the tests and are not needed otherwise. Alternatively you can check: - https://github.com/FedeOmoto/nim-gmp https://github.com/FedeOmoto/nim-gmp, A GMP wrapper (very low-level/C-like and not updated since 2015) - https://github.com/status-im/nim-decimal https://github.com/status-im/nim-decimal, a arbitrary-precision floating point wrapper to MpDecimal (used by python). Unfortunately it's very low-level/C-like at the moment.
- bjourne 8y agoWhat's the status of Nim's garbage collector? https://nim-lang.org/docs/gc.html https://nim-lang.org/docs/gc.html Last time Nim came up on HN someone said they were changing from reference counting to tracing. Also seems like the Nim developers are reluctant to make a choice here? GC is a show-stopper for some developers but an absolute necessity for others.
- yellowapple 8y agoMy impression from the article and docs is that Nim offers multiple choices specifically because garbage collection ain't one-size-fits-all.
- lylecubed 8y agoNim has multiple garbage collectors you can change at compile time. Here's the --gc option from the documentation. --gc:refc|v2|markAndSweep|boehm|go|none|regions I don't know if this is up to date or not. There's an open issue on github to improve the documentation on the garbage collector. https://github.com/nim-lang/Nim/issues/8802 https://github.com/nim-lang/Nim/issues/8802
- gtycomb 8y agoSince I have used Nim in a small team effort creating an enterprise data analysis application, let me put in a good word. The ease of coding and speed of execution was what caught our attention. I was expecting the worst (from past experiences with new languages) but we were so surprised that we could complete our project all in Nim. These are a few things that I love with Nim: - One's knowledge of Python jives really well with Nim. Thinking in Pythonic ways, a small number of constructs in Nim gets you a long way without gotchas that block you. For example you can easily integrate Numpy in minutes. - Statically typed, fast compilation, readable code, good module import system, binary executable that you can move around easily without installing anything more at distributed sites, and a built-in test and integration framework. - An efficient web server comes along, supports a practical and useful template system for small team web applications. Concurrency. Async dispatch/coroutines gives you back-end options to scale. - Nim's Postgres database client driver is glitch free, easy to use, and it turned out to be a real good work horse.
- billrobertson42 8y agoWhat about run-time safety? e.g. are the pointers? does it have builtin in array bounds checking? (Heck, does it even have arrays?)
- gtycomb 8y agoyes to all of these -- Nim also has those intrinsic benefits that statically checked and compiled languages bring. Arrays? As pleasantly nimble as Python arrays to say the least. Pointers are lengthy discussion, but suffice to say that pointers are smartly handled to avoid their pitfalls at runtime (while integrating with external C if you really need to) Time time and again as I went through using Nim, what really stuck with me was that the designers had thought through these practical matters so very well, and even in its current < 1 version the language is remarkably complete and robust for practical programmers.
- billrobertson42 8y agoThanks. That's very interesting. I don't suppose you're going to tell me that it has Clojure's amazing data structures too. :-)
- Cognitron 8y agoMight be nice for scripting games in Unreal Engine? Looks like someone else had the same idea: https://github.com/pragmagic/nimue4 https://github.com/pragmagic/nimue4
- nepeckman 8y agoNim is my favorite language right now. If you look at the different metrics that we use when discussing programming languages, it might not be the best of any category, but its "good enough" in every category. It might not have as powerful a type system as Haskell, but it's safe enough. It might not be as fast as C, but its fast enough. It might not be as easy as Python or Ruby, but it's pretty easy to get started with. It might not be the best web server / embedded / native UI language, but it can do all of those things. Its primarily procedural, but supports a lite version of FP and OOP, so you can program in a comfortable paradigm. It's truly a jack of all trades languages, and I think with a little time it might start mastering some.
- JasonFruit 8y agoThat's exactly how I've reached to the language when I've used it: it's a lot like Python, both superficially and philosophically. It's not the perfect language for anything, but it's pragmatism makes it so you don't have to know so many languages.
- vram22 8y agoWhat does it use for desktop UI dev?
- presscast 8y agoHow does Nim stack up against Go? I got the impression that Nim was very performant in the concurrency/parallelism space, but I'm wondering whether the switch is worth making.
- dom96 8y agoDepends what you're working on and whether you're happy with Go :)
- atombender 8y agoNim has a level of richness you won't find in Go. Optional GC, unions, enums, macros, compile-time function evaluation (so code generation and other compile-time magic can happen in Nim code instead of via reflection or the rather poor "go generate"), generics, async/await, real threads... Nim has much of Go's simplicity while managing to be a lot richer. But it's also less mature and has almost zero mindshare.
- atombender 8y agoI really like Nim, but one thing that's stopped me from using it for any recent project is the lack of Protobuf and gRPC support, which we use extensively. There are some Protobuf libraries, but they're all incomplete and unmaintained. Being able to generate code from gRPC proto files (either compile-time or runtime generation) is a must.
- dom96 8y agoSounds like a perfect Nim project for you ;) In all seriousness, I would love to write this myself... but I physically cannot pour my heart into any more Nim projects. We need more people to help us out!
- atombender 8y agoDefinitely a chicken/egg problem for nascent languages like Nim -- someone has to furnish the house before people can properly move in. The only way I could solve this and make Nim a viable language for these projects is to spend my spare time tinkering, and that's unlikely to happen. The situation is particularly problematic for something like gRPC where you really have to know Nim well to create a good tool. As cool as Nim is, I've gotten to a stage in my career where I just want tools that work. That's the attraction of Go these days (though Rust is looking nearly as good now) -- most libraries already exist, and you can focus on the task at hand, instead of being forced to invent a bunch of wheels first.
- bayesian_horse 8y agoThere is a race going on for the first language not being javascript being compiled to javascript/webassembly and actually worth using. No, coffee-script, typescript and the like don't really count, they are relatively thin layers. Several options are in the works. Implementations of Python and .Net (Blazor). Languages like Rust or Nim. The crucial point is that it needs to have a compelling framework like vuejs or react. Then the toolchain needs to be superb and result in small enough webassembly packages. No project is currently achieving this, to my knowledge. But the race is heating up!
- golergka 8y ago> No, coffee-script, typescript and the like don't really count, they are relatively thin layers. Why is being thin a disadvantage?
- bayesian_horse 8y agoBoth coffeescript and typescript have a respectable following, and for good reason. But their data model is completely tied to javascript, and thus limited. Also they are pretty much stuck with javascripts performance. Basically, Webassembly was created for performance reasons. But you don't need Webassembly just to compile Javascript, Typescript and Coffee-script, and you can't use its benefits through these languages. On the other hand the performance of Webassembly, both in terms of size and speed, and they enable the use of other data models, like C, Python, Java, .Net or Rust. Webassembly gives us the chance to quit the memory management paradigms of javascript for other options, like manual management, ownership or various garbage collectors. But those advantages may not be good enough to justify leaving things like react or vuejs (or similar) behind, or glueing the new paradigms to those frameworks. Rust for example has a React-like framework for use in Webassembly.
- weavie 8y agoIn my opinion, that race has been won. Ocaml, or it's cousin ReasonMl are well worth looking into. Compile to JS with Bucklescript. Compelling frameworks are Bucklescript-Tea for an Elm like experience or Reason-React as a layer over React. Both frameworks are excellent.
- ngvrnd 8y agoThe tutorial starts with a quote from a song by Rammstein. "Der Mensch ist doch ein Augentier -- schöne Dinge wünsch ich mir." Humans are just creatures of the eye -- Beautiful things are what I want