Better HN
topnewbestaskshowjobs
Log inSign up

Pharohbot

209 karma · joined Oct 17, 2014 (12y ago) · 85 submissions

Submissions

1.

Of the emerging systems languages, which is the strongest language and why?(quora.com ↗)

3 points · by Pharohbot · 11y ago · discuss

comment 11y ago · link · parent

Well if you have decent tools to debug them, why should he be wary?

comment 11y ago · link · parent

Well the biggest concern for most is null pointers, so invoking not nil on the pointers would suffice for most

4.

Is Nim unsafe?(github.com ↗)

47 points · by Pharohbot · 11y ago · 38 comments

comment 11y ago · link · parent

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?

comment 11y ago · link · parent

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.

comment 11y ago · link · parent

> 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...

comment 11y ago · link · parent

I never said that Nim is safe/ doesnt have safe areas in the language. But at this stage of development with Nim, it really focuses on the Language goals rather than anything else right now. I have only stated multiple times through this thread that there are way to avoid this unsafetiness and ways that will help avoid these situations in the Future with Nim (nilChecks)

comment 11y ago · link · parent

As stated before in this thread, there _will_ be nil Checks in the future which will result in NilErrors or you can just annotate it with `not nil` right now and it will never be nil. You can also use -fsanitize flags with the clang backend to trap the null dereferences.

comment 11y ago · link · parent

I probably should have been more clear, but I think it's safe to say that unlike C/C++, Nim can handle these types of issues like other languages that deal with pointers (Java, Go etc) with control from the programmer. The only memory safe language I know is Rust, but I am probably wrong on that part, so that's why I singled out Rust on how It's safer than Nim.

comment 11y ago · link · parent

It really depends on how you define "safe". Nim will allow you to deref null pointers (unless you annotate it with `not nil`, then it can never be nil, this results in compile errors if it is) but if they are, it will be like Java and throw an exception if --nilChecks:On. The only language I know that makes pointers safe is Rust, with it's borrow checker and such, but that's a tradeoff I don't really want and the options Nim provides are better for my case.

comment 11y ago · link · parent

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

comment 11y ago · link · parent

Uhh that's not much of an answer...

comment 11y ago · link · parent

Yes Rust is more safe than Nim, I'm not arguing that. I'm also not arguing that Nim is as safe as languages with automatic memory management.

EDIT: Also, Nim is planning on turning those segfaults into runtime NilErrors and a nilChecks flag that will check for them at compile time, you can also avoid this by annotating Pointers with `not nil`

comment 11y ago · link · parent

Do you have any specific examples of these unsafetiness in Nim?

comment 11y ago · link · parent

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.

comment 11y ago · link · parent

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

comment 11y ago · link · parent

A more general approach to shared memory via lockable heaps is a feature Nim seems will implement soon.

19.

Nim by Example(nim-by-example.github.io ↗)

2 points · by Pharohbot · 11y ago · discuss

20.

What can Nim learn from Crystal(forum.nim-lang.org ↗)

2 points · by Pharohbot · 11y ago · discuss

comment 11y ago · link · parent

Sweeet

22.

Crystal: A Ruby-Inspired Compiled Language(crystal-lang.org ↗)

16 points · by Pharohbot · 11y ago · 2 comments

23.

JRuby+Truffle Overview and Tests(chrisseaton.com ↗)

2 points · by Pharohbot · 11y ago · discuss

24.

Very High Performance JRuby+Truffle/C Extenions(chrisseaton.com ↗)

1 points · by Pharohbot · 11y ago · discuss

comment 11y ago · link · parent

It's still the Ruby language, just a different run-time environment.

comment 11y ago · link · parent

The performance will be on par _before_ the final release of 9000, the final release should include the big performance boost
123