11 ms·
Based on my surface-level understanding of Nim, Go is much more comparable to Nim than it is Rust. I never understood the Rust-Go comparisons, since Rust is a s
by echelon 11y ago
Based on my surface-level understanding of Nim, Go is much more comparable to Nim than it is Rust. I never understood the Rust-Go comparisons, since Rust is a serious systems programming language. I would never use Go or Nim to replace C or C++ usage as I would Rust, but I might use Nim in place of Go or Java.
Does anyone with significant Nim experience care to lend some opinions? I don't want to start a flame war--I'm genuinely curious.
- kasey_junk 11y ago> Rust is a serious systems programming language I assume the distinction you are making about "serious" is around manual memory management and the GC? In which case, I think you are probably right in your bias. That said and while i have no experience with it, Nim claims to have a real-time GC mechanism builtin. That is they support a max pause time parameter. There have been other real-time GC systems out there before and they tend to work well for other definitions of "serious".
- k__ 11y agoI have the feeling, that "in the wild" most people replace JavaScript (Node.js), Python and Ruby with Go. Rust seems to be more of a C/C++ replacement.
- notacoward 11y agoIt would be really interesting if someone could collect statistics on which languages are used to replace code written in which others, in practice and not just in theory. Something that crawls GitHub, maybe, but I'm not sure exactly how to specify what it should look for. Any ideas?
- EugeneOZ 11y agoI replaced PHP with Rust and very happy about it.
- patates 11y agomay I ask, to do what? I think they don't claim to "be web" yet [0] and I doubt you were using PHP other than serving over http? [0] http://arewewebyet.com/ http://arewewebyet.com/
- steveklabnik 11y agoThis website is _extremely_ outdated, please don't take it as accurate.
- sbuttgereit 11y agoAgreed. That site was a good rundown at one point, but now it seems like a hurtful distraction. Are there any other good references for what the current state of these sorts of capabilities have reached? There are any number of crates out there for this sort of thing, but assessing usefulness seems dodgy at this point.
- steveklabnik 11y agoThere is one project but I'm not sure its truly launched yet so I don't want to talk about it.
- nachtigall 11y agoCan't anybody from the rust community take over this site? Creating a completely new site might be a fallback, but arewewebyet is referenced / linked very often and ranks high. https://github.com/teepee/arewewebyet https://github.com/teepee/arewewebyet looks abandoned.
- steveklabnik 11y agoWe have tried but the author has not gotten back the few times we've tried. Tried again today, check the issues there.
- gokr 11y agoNim compiles to very efficient C or C++ (or js) and most benchmarks shows Nim programs performance being almost the exact same as C/C++ - and often better than Rust. So... why not using it to replace C and C++? Since I have worked with Nim (and I use it to implement my own language) I would say "hell yes"! It is such an immensely better language and it integrates perfectly with those eco systems. The GC is a good one (or well, there are 5 to choose from) and it is for many, many applications not an issue. And before pcwalton drops in with his endless spamming about Nim not being safe, Nim being undefined etc etc (it's getting quite annoying), please spare us this time.
- Ygg2 11y ago> And before pcwalton drops in with his endless spamming about Nim not being safe, Nim being undefined Well, it is, isn't it? Is he wrong about Nim not being safe when not using Boehm GC? Does it not segfault when sending GC pointers between threads? He only jumps in, when someone claims Nim is safe or the sweet spot, or something equally wrong. Nim's pretty syntax comes with a price, just like Rust's safety comes with a different kind of price.
- gokr 11y agoAbout safe/undefined etc I think it has been answered before (there are probably more places): https://news.ycombinator.com/item?id=9643690 https://news.ycombinator.com/item?id=9643690 Personally I am quite sick and tired of that particular "take" on Nim - why not for once criticize other parts of the language? :)
- nickpsecurity 11y agoThanks for the link. The top comment's explanation, esp on GC, makes a lot of sense. Both specific keywords and a module-level declaration are rational ways of handling it. So long as it's clear to a person or program analyzing safety properties of a module then they can do what they need to do.
- pcwalton 11y ago
- gokr 11y agoBut... generally, I would say all these languages can replace each other (well, ok, perhaps not C) given the right circumstances. Nim has one nice thing going for it - and that is very good C/C++ integration. Rust has it's safety focus and novel memory model. Go has simplicity and tooling, and popularity. Java has enterprise-focus. All have good performance.
- bluejekyll 11y agoRust has extremely good FFI to C as well, if you were using that as a differentiation. No memory layout issues, etc like Go's issues. (Nothing against Nim, I haven't worked with it yet)
- biokoda 11y agoRust FFI is not nearly as simple as Nim's interface to C where you pretty much just call C functions.
- vvanders 11y agoThat's exactly Rust's FFI.
- deleted 11y ago[deleted]
- akiselev 11y agoIn its most basic form, yes, but because of Rust's safety guarantees it's not quite that simple. C functions can only be called from unsafe blocks and there is a lot to be desired when you have to pass strings back and forth (I don't know how well Nim handles this). It's also a bit harder to debug an FFI wrapper in Rust when you tell the compiler your code is safe but then make a mistake in how you use the unsafe C api. I strongly prefer Rust's safety but it's not quite the same as a blind FFI like Nim.
- 11y ago
- masklinn 11y ago> I never understood the Rust-Go comparisons Historical accident: they started surfacing around the same time, Go was originally described as a systems language (which it never was according to the usual meaning of the term) and Rust had more application-level features (built-in "GC pointer", green threads). As incorrect as it was, the initial… impression? — it's probably the wrong term but I don't have a better one — remained. Probably doesn't help that Rust also has a number of features Go is criticised for lacking (generics, non-nullable references, immutability support, …)
- chadzawistowski 11y ago> Go was originally described as a systems language (which it never was according to the usual meaning of the term) Fun fact! Go has roots in the Limbo[0] programming language, which runs in a VM, is garbage collected, has communication channels, and was used to write the Inferno[1] operating system, which is sort of a successor to Plan 9 (which is itself sort of a successor to Unix). [0] https://en.wikipedia.org/wiki/Limbo_programming_language https://en.wikipedia.org/wiki/Limbo_programming_language [1] http://www.vitanuova.com/inferno/ http://www.vitanuova.com/inferno/ https://en.wikipedia.org/wiki/Inferno_%28operating_system%29 https://en.wikipedia.org/wiki/Inferno_%28operating_system%29 http://c2.com/cgi/wiki?InfernoOs http://c2.com/cgi/wiki?InfernoOs