5 ms·
Not to go too far afield, but I agree that Nim is in that category and I'm curious what parts of it are confusing to you.
by GavinMcG 7y ago
Not to go too far afield, but I agree that Nim is in that category and I'm curious what parts of it are confusing to you.
- gingerBill 7y agoNim is a cool language but it does have a lot of things about it by default where it is not targeting itself as being a C alternative, such as garbage collection (by default). Nim is also a very complex language with numerous features to it making it a lot more complicated compared to C. So for someone who might like C might not like Nim. However, I recommend everyone try out as many languages to see what they like. Being that I am the Odin creator, I do think you should give Odin a go because it is much more focused on being a C alternative and tackling the kinds of problems it solves.
- Touche 7y agoI really like Nim but GC makes it a nonstarter for embedded devices. So to me Nim is in the same category as Go.
- beagle3 7y agoNim could always work without a GC, and it’s getting better at it all the time. Most of the standard library does depend on GC availability, but this is being worked on.
- Touche 7y agoYeah having 2 ecosystems where some stuff depends on GC and some stuff doesn't is always going to be a turnoff to me. Glad that Odin and Zig made the decision to not.
- ezquerra 7y agoThe nim team is currently working on removing the garbage collector by means of a new reference counting based “garbage collector mode” called “arc” (for automatic reference counting). You can get more info in the following link, where it is described as “plain old reference counting with optimizations thanks to move semantics”: https://forum.nim-lang.org/t/5734 https://forum.nim-lang.org/t/5734 The objective is to make nim suitable for embedded programming and other use cases for which garbage collection is a non starter. This new —gc:arc mode is already available in the nightly builds and the benchmarks are already impressive. I believe that the plan is to make arc the default “garbage collector mode” in nim 1.2.
- Touche 7y agoThat's cool but arc is a form of GC.
- gingerBill 7y agoOne of the issues with Nim is that ARC is still a form of automatic memory management, of which many domains do not want. This is why Odin has been designed to take advantage of custom allocators so that programmers have a huge control of how memory is allocated at all levels. And coupled with the `context` system, you can also have control over and track third-party code in how it allocates things. Custom allocators are a pleasure to use, and allow for so much control. Along with the temporary allocator, you can make Odin feel like it's a dynamic language whilst being extremely fast. Custom allocators are an under-utilitized thing in programming in general, and I hope more people release what is possible with them that is not possible with automatic memory management schemes.
- gavinray 7y agoHey, I am going to show my stupidity for a moment but I have to ask: Why is garbage collection considered a negative thing? I have no experience programming low-level languages, but I do follow and try new/obscure languages for fun. Zig, Nim and V were the few I found + tried first, but I learned about Odin and Scopes recently and found them both interesting.
- billforsternz 7y agoGarbage collection is not so much considered a negative thing, but a thing that's inappropriate for the embedded domain. The problem is that garbage collection entails some system code periodically scanning lists of memory allocations to identify stuff that's now garbage that can be recycled. Embedded Devs worry about the scheduling of that code, and how long it could take to run worst case, and whether it will spoil their real time guarantees. There are various mitigation strategies, but for good or evil many individuals and organisations apply a simple "no, we're not going to use GC ever" policy.
- pjmlp 7y agoGemalto, PTC, Aicas, microEJ, Astrobe seem pretty fine selling Java and Oberon based tooling and runtimes for embedded devices deployments across industrial automation, robotics and military. FSecure's foundry USB security key, runs bare metal Go, TamaGo.
- nimmer 7y agoThis is incorrect. Nim has 5 default GC methods and the upcoming automated reference counting. It runs even on the smallest microcontrollers.