Hacker Newsnew | comments | show | ask | jobs | submit | kinghajj's comments login

Rust, too!

Edit: Btw, I disagree with how the article categorizes Rust in comparison to Haskell. It shows that Rust has std::ptr::null, but neglects the fact that Haskell has Foreign.Ptr.nullPtr. Either both should be "5 stars" or both should be "4 stars".


Came here to say this. In fact, I think every language that they give 5 stars to has some form of "foreign pointer", "raw pointer", "unsafe pointer" or the like that is nullable, for FFI and other low level tasks.

I think that anything which has no null in normal, idiomatic code, outside of "unsafe", "ffi", or similar subsets, should get 5 stars. The distinction is really about whether you need to worry about any possible value, or any possible reference, being null, which you do in languages like C or Java where all references are nullable.

Giving Java and Rust the same 4 star rating because they both have some form of null and some form of Maybe/Option is a bit misleading. In Rust, Option is what you use in any normal code, and so you don't need to check for Null everywhere. In Java, it's the other way around; nullable references have existed since the beginning and are not segregated in any particular way, while Optional is a recent addition.

Likewise, I think that in Scala and Swift, null is only present for compatibility purposes, and idiomatic code does not use them. I'm not sure about F#. Clojure does use nil idiomatically, and also has '(), which may even count as "multiple NULLs" according to this rubric, though I guess that in Clojure '() is just treated as an empty list, rather than a null value like it is in other Lisps.


> Likewise, I think that in Scala and Swift, null is only present for compatibility purposes, and idiomatic code does not use them. I'm not sure about F#.

I believe though that with the exception of Swift, null can infect these language's quite easily via the FFI, and the guarantees aren't as strong. I haven't used them much though, so I could be wrong.


Yeah, I guess it depends on how often you use the FFI, and I'm not familiar enough with these languages in practice to know how often that comes up. Part of the point of each of these is that they can utilize an existing ecosystem in which null is common (Java/JVM for Scala, C#/CLR for F#, Objective-C/Cocoa for Swift).

I know that in practice in Rust, the general approach is to write safe wrapper around any C libraries you're using, so the use of nullable pointers is generally confined to those wrappers.


Author here. I didn't know that about Haskell.

Admittedly, the "rating" is pretty rough, maybe even a bad idea.

I've seen std::ptr::null more than I ever have Foreign.Ptr.nullPtr.

But really, both are usually used for compatibility with external libraries/programs/runtimes, not for idiomatic language programming.

Both great languages in my book :)


> I've seen std::ptr::null more than I ever have Foreign.Ptr.nullPtr.

Probably because we need to work with the C API a great deal right now, but that should change as more and more things are written in Rust. Still, the unsafe boundary helps by removing the ability to dereference a raw pointer in safe code - something that Haskell doesn't have.


FYI, I fixed it. std::ptr::null isn't really comparable, so I removed it. You can't really use it in Rust like you could in other languages.

Ya, all of the 4 star ones basically include it in their ffi compatibility layers. The five star ones do too.

Someone needs to get a death prediction market implemented. That should sway politicians' incentives pretty quickly.

Maybe by the time this is ready for production, the Mill will also be!

It's literally the next phrase in the sentence:

> because the demographic hit by this hack is the most politically & economically powerful demographic in the world....

They're saying that because those affected have the ability to actualize change, it's more likely that some action will be taken to further online privacy.


First, it's a misconception that anarchists are against governance. They're against the "state," a hierarchical form of government. They didn't have difficulty organizing for defense/violence--in fact, a common criticism of the Spanish anarchist movement was the appropriation of farm land by force. The failure was due to the coordinated efforts of both capitalist democracies and authoritarian communists to impede their efforts at maintaining their society. Most importantly, IIRC, steel shipments from the US were halted, which reduced their fighting ability.

The interesting part about that episode is that both the West and the USSR acted to bring them down. Authoritarians on either side were scared of the implications of a functional, libertarian socialist society.

They've publicly stated that they intend to produce their own chips, though. Regarding licensing the architecture (a la ARM), Ivan said during a talk that Intel's quarterly dividend was as much as ARM's yearly revenue. So I don't think that selling the entire company is even on their radar right now, unless you're really cynical and doubt that declared intention.

IMHO, the ethics are similar to the use of data obtained by German/Japanese scientists during WWII: the violation is on the persons who directly acquire the information; but, once obtained, those who receive it indirectly aren't ethically liable.

It just redirects to bing.com... I don't get it.

-----


...says someone who just used "we" in a too-general sense themselves!

-----

More

Applications are open for YC Winter 2016

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | DMCA | Apply to YC | Contact

Search: