News for hackers. Stuff that matters.
Re:GoKart: A static analysis tool for securing Go code by logical42 on Wednesday August 18, 2021 @07:39PM (#28228605)
You know what's fun?

Getting a nil where you are supposed to have an Optional.

Re:GoKart: A static analysis tool for securing Go code by mattnewton on Wednesday August 18, 2021 @08:42PM (#28229043)
Afaik this is impossible in swift and kotlin, only optional values can contain nill.
Re:GoKart: A static analysis tool for securing Go code by tbarbugli on Wednesday August 18, 2021 @10:16PM (#28229603)
Try Core Data with Swift and you will see that happening. Lazy objects (vaults) are mapped from objc into Swift and will happily crash on something like a = b where both are not optional.
Re:GoKart: A static analysis tool for securing Go code by mattnewton on Thursday August 19, 2021 @11:45AM (#28235299)
This is happening in objc code or in the swift part? I'm not terribly surprised though, my one experience with core data was miserable once we strayed even a little from the happy path and I ended up rolling my own since we didn't need full functionality anyways. And this was for an internal app, at Apple ┐( ∵ )┌
Re:GoKart: A static analysis tool for securing Go code by logical42 on Thursday August 19, 2021 @03:20PM (#28238119)
It's possible in Java.
Re:GoKart: A static analysis tool for securing Go code by mattnewton on Thursday August 19, 2021 @03:48PM (#28238458)
Right, because the language has the "million dollar mistake" of nullable references by default, which you cannot change without breaking code. And the original comment was bemoaning that Go choose to to have nullable references by default too.
Re:GoKart: A static analysis tool for securing Go code by rowanG077 on Wednesday August 18, 2021 @09:04PM (#28229187)
so... Just make that impossible. It's not like this is unprecedented at this point. It's a standard feature even C++ of all languages supports.
Re:GoKart: A static analysis tool for securing Go code by joshdev on Wednesday August 18, 2021 @07:45PM (#28228658)
Somebody has used Scala
Re:GoKart: A static analysis tool for securing Go code by still_grokking on Wednesday August 18, 2021 @08:51PM (#28229097)
More likely a Java lib form Scala than Scala as such.

In "pure" Scala (not in the FP sense, but just without mixing with Java) something like that is almost impossible.

Re:GoKart: A static analysis tool for securing Go code by marwis on Wednesday August 18, 2021 @09:55PM (#28229475)
Unless something drastically changed in Scala 3, there is nothing to protect you from null in Scala. In fact even Java is effectively safer thanks to all the null checking done by IntelliJ
Re:GoKart: A static analysis tool for securing Go code by still_grokking on Wednesday August 18, 2021 @10:11PM (#28229570)
Null is basically non-existent in idiomatic Scala. So technically you're right but besides calling Java libs there is only an infinitesimal small chance to get NPEs form Scala code. (Scala's NPE is the MatchException ;-)).

For Scala 3 there are improvements. It's "null safe" as long as you opt-in (modulo Java libs, and of course doing stupid things like casting a null to some other type).

https://docs.scala-lang.org/scala3/reference/other-new-featu...

Re:GoKart: A static analysis tool for securing Go code by joshdev on Monday August 23, 2021 @08:00AM (#28274550)
Idiomatic scala yes, but while on boarding engineers hit many cases, where they ended up returning null in places they shouldn’t.
Re:GoKart: A static analysis tool for securing Go code by still_grokking on Monday August 23, 2021 @04:31PM (#28281509)
So you actually complaining about people who don't know what they're doing? How is this related to Scala?

When you have people without clue on the team no language will safe you. You can also crash Haskell programs by throwing exceptions or just using List.head…

Re:GoKart: A static analysis tool for securing Go code by marwis on Monday August 30, 2021 @03:30AM (#28353466)
I'd say safety implies safety from incompetent developers. Similar to the use of the word in memory safety.