Live data from Hacker News

Nim versions 1.4.4 and 1.2.10

nim-lang.org

41–44 of 44 posts

Re: Nim versions 1.4.4 and 1.2.10

#41
post #40

Earlier quoted context omitted.

There is an official Nim plugin from JetBrains now. It won't be as polished as Java support for obvious reasons, but at least you can stick with your preferred environment.

In which editor? This would really help me. IdE support and no pandas/numpy are the main things holding me back from full nim adoption

There is NimData [1] and ggplotnim [2] and Arraymancer [3]. Also, neovim works well with the alaviss plugin [4], though it's not quite a full IDE. Most Nim coders use VS.

[1] https://github.com/bluenote10/NimData

[2] https://github.com/Vindaar/ggplotnim

[3] https://github.com/mratsim/Arraymancer

[4] https://github.com/alaviss/nim.nvim

Re: Nim versions 1.4.4 and 1.2.10

#42
post #2

One thing I'm missing in all these languages is 100% auto-completion like the one you have in Java or C#. I have yet to experience a single instance of Intellij not being able to auto-complete something or not do it completely. I know Nim and Rust have good VS Code plugins that do that to some extent but it is not something I can rely upon. Maybe I'm just spoiled.

nimsuggest and nim-mode work quite well in Emacs with auto-complete, go to definition, and find references. There's also an LSP server in the works IIRC.

If you want good auto-complete for less popular languages, you need to use an editor which is both popular enough and makes writing completers easy enough. From my experience, Emacs with company or auto-complete packages is just like that, and I have auto-completion set up for 10+ languages, but I'm sure there are other editors out there you could use.

Re: Nim versions 1.4.4 and 1.2.10

#43

How does Nim's static typing compared to TypeScript and (Simple) Haskell?

Comparable to TypeScript, but a little weaker in the advanced features. Nim object types and tuple types are similar to TypeScript interface definitions and just as light weight. The type inference is pretty similar, but Nim's is a little weaker. Nim also has object variants, which can achieve most of what I want out of union types. TypeScript has a pretty long list of advanced typing features, like key types, mapped…

Sorry, not just a little weaker. A _lot_ weaker. It lacks union and intersection types, and to my mind this is kind of inexcusable in a modern language. I'm not even talking about pattern matching, union types are simply necessary in an expression oriented language. It's that simple. Then, intersection types are the dual of union types.

(By the way, Rust lacks union types too, and it makes the language absolutely insufferable. Simply adding, say, a print statement as the last expression in one branch of an if statement changes that branches type, producing an error due to A/B type mismatches There is often no valid reason, e.g. in the case your branch isn't assigned to an expression. Even if it were, the type of that expression should be a union type: problem solved. It's so basic and so obvious, that Algol 68 got it right back in the 60s. Why on earth would you add discriminated unions but _not_ unions? It makes no sense.)

(I'm going to go off on a second tangent now: can we please just dust off the cool ideas in that language, like references represented in the type system, rather than replicating C++'s god-awful value categories and even _more_ reference squiggles? Consider how C++'s awfully complex [] move semantics could be expressed in that language!]).

[] https://www.reddit.com/r/cpp/comments/ll2azr/move_simply_sut...

Re: Nim versions 1.4.4 and 1.2.10

#44
post #29
post #2

One thing I'm missing in all these languages is 100% auto-completion like the one you have in Java or C#. I have yet to experience a single instance of Intellij not being able to auto-complete something or not do it completely. I know Nim and Rust have good VS Code plugins that do that to some extent but it is not something I can rely upon. Maybe I'm just spoiled.

If I don't remember how to use some function it's a sign that I have to read the documentation. The documentation can have important tips around performance, security & recommended usage patterns that I need to know. And if you don't remember a lot of methods it means you might be out of your league and need to read the documentation and go through a tutorial to understand what you are doing. Keyword, method and vari…

My feeling is we (developers) should be able to figure out how to use a function reliably and safely from just the signature for 95% of functions...if you can't then the API is badly written.
Post reply on HN