5 ms·
I do really like Nim, being a sister to D lang with similar benefits. The language wars feels like it's getting hotter lately, and I'd live to see D/Nim make a
by jadbox 3y ago
I do really like Nim, being a sister to D lang with similar benefits. The language wars feels like it's getting hotter lately, and I'd live to see D/Nim make a comeback. If any language is going to see new traction, it's going to need to be a compelling alternative for Go/Rust/JS/Python/Java. I'm keeping an eye on Zig here too.
- winrid 3y agoJust needs good IDE support. That's always the issue. Do not like VSCode or the slowness of the Nim plugin. I think every "goto definition" scans the whole code base instead of using an index, so it's slow. I'm faster working in Java, verbosity be damned.
- michaelsbradley 3y agoYou may fare better hooking VSCode to nimlangserver: https://github.com/saem/vscode-nim#nim-lanugage-server-integration-experimental https://github.com/saem/vscode-nim#nim-lanugage-server-integ...
- winrid 3y agoThanks! Still don't want to use VSCode. I'd rather not use nim until there's a supported Clion plugin.
- memco 3y agoThere is a number plugin: https://plugins.jetbrains.com/plugin/15128-nim https://plugins.jetbrains.com/plugin/15128-nim. I haven’t tried it so don’t know how well it works.
- winrid 3y agoYes, as I said, a supported plugin. The author has not updated it since Jan so its not compatible anymore, and it's in beta at best.
- elcritch 3y agoI really enjoy writing code in Nim. The move to the new memory management system turns it into a true systems-language (comparable to C++ + SharedPtr's or Rust + ARC's everywhere). I've been working on a multi-threaded pure Nim GUI which runs 60fps like a charm and compiles down to a ~3MB binary with no deps outside the system UI libs! The other part is that Nim's strongly typed and compiles to native code but allows you to do dependent typing like things that lets you be flexible on types: type X = object Y = object Z = object NotXY = not (X | Y) proc doSomething(_: NotXY) = echo "hi!" edit: I forgot the mention, but NIR is cool and part of an overall initiative to improve the Nim compiler which will hopefully reduce bugs and improve performance. Plus hopefully enable native WASM support which would be handy for GUI stuff!
- mathisfun123 3y agoWhat is `object` here? Effectively a ⊤?
- elcritch 3y agoNope, it's just an empty object, aka an empty C struct. Generics would be like: type MyObject[T] = object val: int other: T
- mathisfun123 3y agoI don't get it - if empty object doesn't act as a top how does what you wrote demonstrate flexibility? Edit: oh X, Y, Z are singletons I guess? Still don't see the flexibility or dependent types?
- elcritch 3y ago> I don't get it - if empty object doesn't act as a top how does what you wrote demonstrate flexibility? To quote from Wikipedia: dependent types are used to encode logic's quantifiers like "for all" and "there exists". ... dependent types help reduce bugs by enabling the programmer to assign types that further restrain the set of possible implementations In my example the objects could be any object types, combination of types, or concepts. It allows you to encode logic at the type system level. If you use generics with the example above you can do things roughly like: type State = enum Open, Closed SomeObject[T: State] = object val: int SomeObjectOpen = not SomeObject[state.Close] proc close(obj: SomeObjectOpen) = ... You can do some simlar things in other languages, but it's hard and more limited and usually can't expressions.
- izoow 3y agoI’d love to see nim become more mainstream. I don’t have much experience with it, but I looked into it a few times and always found it super interesting.
- netbioserror 3y agoNim is incredibly pleasant for actually engineering software. In most scenarios it feels like compiled Python, and when you need it, you get really precise control. The preference for referentially-transparent procedures and stack-managed dynamic data is icing on the cake. You don't have to write just about any memory-semantic code in most business scenarios. Feels like a scripting language, runs 10-100x faster, and add the power of static types.
- ternaryoperator 3y agoI've never heard of Nim being a sister to D. Maybe to Python, but not D. Nim's home page acknowledges borrowing from Python, Ada, and Modula, as well as C/C++. I don't think D is part of the mix.
- winrid 3y agoNim is closer to D than Python IMO. The syntax is like Python, sure, but in terms of features it's very similar to D (statically typed, supports multiple GCs, fast compiler).
- klibertp 3y agoAs I understand, D is a pragmatic vision of how C++ could look like if it was not C++ (that is, not designed by committee, without decades of backward compat needed, without the need to support some exotic hardware, etc.) It aims to completely drop the "C with classes" heritage, bring OOP and FP together while integrating important concepts into the language (delegates instead of function pointers, strings instead of char arrays, slices instead of T[], etc.) While Nim indeed comes from Wirthian heritage instead of K&R heritage, its goals are pretty similar to D. You could say that Nim is for (Object)Pascal what D is for C(++). I think that's what the GP alluded to - not that Nim borrows directly from D or the other way around.
- jadbox 3y agoFor the internet archives, this was the correct interpretation. Apologies for the original ambiguity. Also, I believe the creators of Nim where active in D language forum conversations, and I had the impression the Nim authors where very well inspired from D's design.
- ksec 3y ago> being a sister to D lang with similar benefits. That is the fist time I hear this. Other than Python, I always felt Nim is more like Pascal and Ada.
- pjmlp 3y agoI don't see a value in Zig until they have a sound story for UAF. We should be getting back what Xerox PARC was already doing in systems programming with Mesa/Cedar, Interlisp-D and Smalltalk in terms of systems programming. This is where I see a value in languages like D and Nim, Swift, or even Go, regardless of the opinion on much systems it can be used for. Back in my day writig compilers, linkers and OS services was considered systems programming.
- jstimpfle 3y agoWhat were they doing? From all I can tell they require to hold down the shift key a lot, other than that it's hard to find good information how they offered anything not offered by contemporary ecosystems. Or how they offered a better set of tradeoffs in some situations than we can have today.
- jstimpfle 3y agoA fundamental problem that I see today ist that most systems end up being either too rigid or too unstructured. We always want guardrails but then we need ways to remove them. What sounds good in theory or looks amazing on a demo often becomes impractical in a realistic development setting. (There is a hint on something like that wrt. Mesa/Cedar on wikipedia. FWIW -- I've obviously never used it myself)
- pjmlp 3y agoEasy to find out when one cares, all the stuff is on Bitsavers and Computer History Museum sessions. A small taste, "Eric Bier demonstrates Cedar" https://www.computerhistory.org/collections/catalog/102781041 https://www.computerhistory.org/collections/catalog/10278104... Full graphics workstation in 1980's, implementated in a systems programming language using reference counting, with a tracing GC as cycle collector, with an object model partially implemented years later as OLE/COM.
- jstimpfle 3y agoWatching the video, thanks. But back to my question, what of those is missing today?
- ylluminate 3y agoV is doing really well as well. Very exciting times.