Live data from Hacker News

Nim 1.0

nim-lang.org

31–40 of 308 posts

Re: Nim 1.0

#31

Question (genuine, not trolling): what's the use-case for Nim regarding other languages? What are its pros/cons?

It's as easy as Python and as fast as C. That was my take when I looked at it and bought the book last year.

Re: Nim 1.0

#33
post #26

Congrats to the team! Could Nim be used to generate a framework for Xcode and the the same code be used in a Windows C++ or .NET project? I've been looking for ages for a cross platform solution that can be used to create dynamic or static libraries that isn't C++.

As far as I know, that should be doable. Nim can compile to Objective C as well as C++, and has a `when` statement that makes it easy to produce code for a specific OS or language target. Not an Xcode or .NET expert though, so not sure how difficult it is to hook into those platforms.

Re: Nim 1.0

#34

> Type identifiers should be in PascalCase [1] I don't get why some languages adopt the 'PascalCase for types' approach (which is fine), but then a bunch of the built-in types such as 'string', 'set', 'int64', etc. are lowercase... it's annoyingly inconsistent. [1] https://nim-lang.org/docs/nep1.html#introduction-naming-conv...

On the contrary, I feel that the stylistic [and sometimes semantic] separation of primitive and boxed types in languages (e.g., `byte` VS `Byte` in Java) improves the developer experience, in that I can very quickly dissect the type of value that I’m dealing with when reading the code.

In Java that difference matters a lot for performance: primitives are unboxed, objects are boxed. (Not as true now with auto boxing and escape analysis, but this was absolutely true in version 1.0.)

In C++ it can matter for correctness because primitives are uninitialized by default. But other types might be too and the standard library uses under_scores for things that are initialized on construction, so it's not a great example of this distinction.

Why do you care in other languages? In Rust for example I'm a little fuzzy on why I care if something is considered a primitive.

Re: Nim 1.0

#35
post #31

Question (genuine, not trolling): what's the use-case for Nim regarding other languages? What are its pros/cons?

It's as easy as Python and as fast as C. That was my take when I looked at it and bought the book last year.

> as fast as C

I mean, it actually is C, since the code is transpiled to C.

Re: Nim 1.0

#36
post #26

Congrats to the team! Could Nim be used to generate a framework for Xcode and the the same code be used in a Windows C++ or .NET project? I've been looking for ages for a cross platform solution that can be used to create dynamic or static libraries that isn't C++.

Without knowing any more specifics about your problem it seems like this would be possible in Nim. It is cross platform and can generate dynamic libraries across them. I guess you could somehow also set up a static library, but I've never tried that myself. So as long as your target language(s) have the ability to use dynamic libraries then Nim should be able to supply them.

Re: Nim 1.0

#37
post #9

Earlier quoted context omitted.

And it turns out Crystal 0.31 [1] is released! And it is ( or should be ) closing to 1.0 release as well, once Windows Support and MultiThreading matures. May be 2020? On the list of languages I only know the first few up to Zig, will need to check out the others. There is also one noticeable missing and that is Elixir. [1] https://crystal-lang.org/2019/09/23/crystal-0.31.0-released....

Curious why you're adding Elixir in this list ? It operates is in a completely different space than nim / zig, as far as I know (Not statically checked, heavy but powerful runtime, much "higher level" abstractions, etc...) Not to prevent you from trying it, of course - to each and everyone their own...

Not the same person, but I interpreted the preceding comments to be about programming languages in general, not just ones in the same space as Nim and Zig, and would agree that Elixir fits in that broader list.

Re: Nim 1.0

#38
Shameless plug, but by a nice coincidence, Manning has a discount on all printed books today. Among them is my book, Nim in Action, available for $25. If you're interested in Nim it's a great way to learn :)

It was published in 2017 but we've ensured Nim is compatible with it (all book examples are in Nim's test suite), so apart from some minor deprecation warnings all examples should continue to work.

Grab a copy here: https://manning.com/books/nim-in-action?a_aid=niminaction&a_...

Re: Nim 1.0

#39
post #9

Earlier quoted context omitted.

And it turns out Crystal 0.31 [1] is released! And it is ( or should be ) closing to 1.0 release as well, once Windows Support and MultiThreading matures. May be 2020? On the list of languages I only know the first few up to Zig, will need to check out the others. There is also one noticeable missing and that is Elixir. [1] https://crystal-lang.org/2019/09/23/crystal-0.31.0-released....

Curious why you're adding Elixir in this list ? It operates is in a completely different space than nim / zig, as far as I know (Not statically checked, heavy but powerful runtime, much "higher level" abstractions, etc...) Not to prevent you from trying it, of course - to each and everyone their own...

I'd say Elixir is certainly a member of list of languages people are considering bailing out of Python for.

Re: Nim 1.0

#40
post #30

Great! I love this language, so simple and powerful, so fast executables! I hope I don't spoil the party by asking: What's the status of GUI bindings?

WxWidgets works great, Gtk(2/3) also works great (both have macros that make actually creating UI's much easier than in most other languages). There is also wNim for making Windows UIs and NiGui for pure Nim cross platform UIs (that target the native toolkits). Apart from that there are various bindings to other toolkits, both meant to be embedded in games, and stand-alone things. There's even ways to use Nim code to power Electron apps.

So all in all I'd say it's pretty decent, but I still have plans for my own toolkit that would solve my personal gripes with creating cross platform UIs.

Post reply on HN