Live data from Hacker News

Nim 1.2

nim-lang.org

61–70 of 130 posts

Re: Nim 1.2

#62
post #44
post #41

Earlier quoted context omitted.

Can't find anything dark mode related on that page

There's a large button. It loads before the text does. When the text loads, you'll see in big letters, right next to the button, Dark Mode , italicization and all. If you click on the button, suddenly you get a very blue-purple dark mode experience.

Doesn't work on mobile.

Re: Nim 1.2

#63
post #49

Earlier quoted context omitted.

Do you think the gcc -std flag would exist if every distribution of gcc included a command to easily download alternate versions and swap them out depending on project configuration? -std seems more like a bandaid around a difficult install/config than a feature, in my opinion. Obviously nim is free to make implement whatever options they want, but it seems to me like every second spent triaging/fixing/etc bugs about…

Yes, the -std flag would definitely still exist: the thing being changed by that flag is a lot of stuff in the parser, some stuff in the standard library, and some semantics bits further towards the backend, but at some point the versions converge and go through the same optimisation pipeline. A pipeline that definitely has seen improvements in more recent versions, so it's totally worth it to use a new compiler with…

Also useful in the other direction: your code works now, but in C++17 that's a keyword so you'll have to rename it.

Re: Nim 1.2

#64

Dup is very interesting to me. Does that mean that in Nim all functions will be impure by default, and that it's considered idiomatic to modify the input? I guess it's nice that they're trying to make behavior consistent. It just seems like the opposite of the recent directions I've seen other languages take.

Mutating in place is often times faster and is more straightforward. I do feel Nim embraces mutation more than other recent languages.

Yeah, the 'discard' keyword is a pretty cool way to note that you're using a procedure only for its side effects.

Re: Nim 1.2

#65

Earlier quoted context omitted.

What advantage does it bring that Kotlin hasn't?

No JVM.

Look up Kotlin Native. It doesn't use a JVM (and compiles to native via LLVM).

There's also Kotlin JS, which targets the JS ecosystem, and comes with tools that let you import TypeScript type definitions into Kotlin, so you can easily interact with third-party JS modules.

A pure Kotlin library could easily be used on JS, JVM, and native/LLVM seamlessly. Which is pretty impressive. All your non-platform-dependent logic could be placed in a decoupled shared pure Kotlin library. Which avoid code duplication that is so common when you need web + iOS + Android client apps. (And the Intel Multi-OS Engine could be used to write your iOS app in Kotlin.)

Re: Nim 1.2

#66
post #17
post #10

I really with more people used NIM for web development. It really seems like the best of all worlds (e.g. perf, developer ergonomics, productivity, etc).

How would the dynamism and expressivity of something like Django port to Nim? I love the whole declarative paradigm of the Django forms and models API. Is Nim good at this kind of DSL-ish plasticity?

Poorly. Nim is not an object-oriented language.

You could certainly write an expressive web framework in nim, but a django/rails sort of paradigm is not the way.

Re: Nim 1.2

#67
post #48

Earlier quoted context omitted.

Kotlin support AOT so moot point

Not really. Kotlin/native is still super experimental and graal isn't exactly that easy either.

And somehow Nim has more support? This is a double standard non-sens. Btw you can address the startup time (which is reasonable btw, and x2 faster since kotlin 1.4-m1) without aot with tools like http://martiansoftware.com/nailgun/

Re: Nim 1.2

#68
post #42

Earlier quoted context omitted.

Having only played a little with both (Kotlin and Nim), I enjoy Kotlin syntax but overall it feels as heavy as Java (need to setup an IDE for even getting started, choose and understand some package manager, slow compile times, etc.) Nim feels as lightweight as Go, but with great syntax. The main thing holding me back now is the lack of libraries, but it's definitely on my radar.

Isn't an ide just a choice? You don't have to use intellij. There are vscode plugins. Don't you also need to understand the go package manager or Nim's? I don't see how this is different than learning Gradle.

Better than having to choose an IDE, is to not have to choose an IDE.

It’s pretty liberating to put some text in a single file, pass that file to a compiler, and have a single executable binary.

A devolved workflow I know.

Re: Nim 1.2

#69
post #34

Dup is very interesting to me. Does that mean that in Nim all functions will be impure by default, and that it's considered idiomatic to modify the input? I guess it's nice that they're trying to make behavior consistent. It just seems like the opposite of the recent directions I've seen other languages take.

I haven't played with nim for a few months, but only parameters with var will get mutated. I suspect you want to use someone else's cursed function and don't want to poison your blessed code

I see. I know nothing about Nim but I do see in their example they used var when declaring the function. This way seems like it's hidden to the consumer of the function but hopefully editor tooling helps with this.

Re: Nim 1.2

#70

Dup is very interesting to me. Does that mean that in Nim all functions will be impure by default, and that it's considered idiomatic to modify the input? I guess it's nice that they're trying to make behavior consistent. It just seems like the opposite of the recent directions I've seen other languages take.

Mutating in place is often times faster and is more straightforward. I do feel Nim embraces mutation more than other recent languages.

I'm not arguing either way, just noting that it's counter to what I've seen recently in other languages.
Post reply on HN