Live data from Hacker News

Go channels, goroutines and GC available in Nim

forum.nim-lang.org

81–87 of 87 posts

Re: Go channels, goroutines and GC available in Nim

#81
post #32

Earlier quoted context omitted.

I think Nim is an impressive language that does a lot of things really well. I don't think the memory management is one of them. I believe that memory management and compilation to C are the only two major things I've ever talked about in regards to Nim, because I'm abstractly interested in those topics. If an article about thread-local deferred reference counting in Ruby hit the top of HN and the comments were talki…

And how do you do "memory management well"? Like Rust? You pay a high price in complexity and inflexibility for that juicy GC-less yet safe memory management. Ref counting is not superior or inferior to explicit, restrictive ownership semantics. Those are simply different trade-offs. Nim might be strictly inferior for writing a heavily multi-threaded web browser because of its memory management approach but that does…

"You pay a high price in complexity and inflexibility for that juicy GC-less yet safe memory management."

It's a price that a lot of people are willing to pay, because of how badly they want what they're paying for.

Nim and Rust have different goals, different tradeoffs, and overlapping target audiences. Having both is good. Making them fight is bad.

Re: Go channels, goroutines and GC available in Nim

#82

Earlier quoted context omitted.

I'm guessing because Nim gets portrayed as safe, or offers some safe features, but overall is not memory safe. Rust has worked very hard and gotten through the problem of having memory safety, with zero runtime cost and reasonably good language features. Since it's 2015, it seems fair to point out when a new language offers something neat, but in a way that isn't safe.

Nim is as safe as any other language. Perhaps it's not as safe as Rust but that brings specific trade offs most people dont wan't to deal with. I don't understand why people think that Nim is "terribly unsafe" when in reality it's like any other language

"Nim is as safe as any other language."

That is factually false.

"Perhaps it's not as safe as Rust"

And there even you have contradicted yourself.

"Perhaps it's not as safe as Rust but that brings specific trade offs most people dont wan't to deal with."

That much is true ... and can be said without telling falsehoods, like your first statement.

"I don't understand why people think that Nim is "terribly unsafe" when in reality it's like any other language"

You are confused by your own strawman.

Re: Go channels, goroutines and GC available in Nim

#83

Earlier quoted context omitted.

It has a feel of a scripting language, but as far as I can tell, it rather has the safety of C/C++, which I personally wouldn't call "safe like any other language".

Why not? I'm interested to know because in my opinion I don't see it any less safe than languages that don't have automatic memory management and/or languages like Rust.

"Why not?"

Because it isn't true.

"in my opinion I don't see it any less safe than languages that don't have automatic memory management"

Strawman ... the comment was about scripting languages.

"and/or languages like Rust"

Then it would be unwise to pay any attention to your opinion.

Re: Go channels, goroutines and GC available in Nim

#84

Earlier quoted context omitted.

I haven't done anything in Nim, but in C it's really easy to do bad things with pointers. You can deref a NULL, you can be sloppy about arithmetic, you can overflow a buffer, etc. Nim seems to emphasize using other features instead of pointers, but it still has them.

As stated before, there are ways to avoid them and ways that Nim will soon handle them, but do you know how many other languages deref a NULL pointer? Unlike C, this does not result in undefined behavior in means that it will execute something unsafe in Nim

"Unlike C, this does not result in undefined behavior "

Of course it does. If you turn off expensive runtime checks, you'll get SIGSEGVs. That doesn't happen in Rust, because it is semantically impossible to dereference NULL.

Re: Go channels, goroutines and GC available in Nim

#85
post #83

Earlier quoted context omitted.

Why not? I'm interested to know because in my opinion I don't see it any less safe than languages that don't have automatic memory management and/or languages like Rust.

"Why not?" Because it isn't true. "in my opinion I don't see it any less safe than languages that don't have automatic memory management" Strawman ... the comment was about scripting languages. "and/or languages like Rust" Then it would be unwise to pay any attention to your opinion.

> Because it isn't true

Did you not see the other person who just said that?

> Strawman ... the comment was about scripting languages.

I do not have a clue what you are trying to say...

Re: Go channels, goroutines and GC available in Nim

#86
post #84

Earlier quoted context omitted.

As stated before, there are ways to avoid them and ways that Nim will soon handle them, but do you know how many other languages deref a NULL pointer? Unlike C, this does not result in undefined behavior in means that it will execute something unsafe in Nim

"Unlike C, this does not result in undefined behavior " Of course it does. If you turn off expensive runtime checks, you'll get SIGSEGVs. That doesn't happen in Rust, because it is semantically impossible to dereference NULL.

Since when were we comparing Nim and Rust? yes Rust is more safe than Nim, but that comes with tradeoffs. You are obviously not reading the whole thread about me bringing up (multiple times) the fact that you can avoid these and will be even easier to avoid in the future.

Re: Go channels, goroutines and GC available in Nim

#87
post #82

Earlier quoted context omitted.

Nim is as safe as any other language. Perhaps it's not as safe as Rust but that brings specific trade offs most people dont wan't to deal with. I don't understand why people think that Nim is "terribly unsafe" when in reality it's like any other language

"Nim is as safe as any other language." That is factually false. "Perhaps it's not as safe as Rust" And there even you have contradicted yourself. "Perhaps it's not as safe as Rust but that brings specific trade offs most people dont wan't to deal with." That much is true ... and can be said without telling falsehoods, like your first statement. "I don't understand why people think that Nim is "terribly unsafe" when…

when --nilChecks:On become a thing, dereferencing null pointers will be like Java, a NilError (NullPointerException in Java). This is why I said it's as safe mainstream languages that dont have AMM but languages like Rust are safer than those mainstream languages. any others to point out?
Post reply on HN