Comment Re:You know the old saying... (Score 1) 437
It takes as much work to write safe code in Rust.
The upside is that the unsafe code will not compile under Rust.
It takes as much work to write safe code in Rust.
The upside is that the unsafe code will not compile under Rust.
You need to have your sarcasm detector checked.
Fortunately we can understand the processes within real people that lead to their actions. This is the reason that we safely let them drive cars, trains or fly planes.
I've written algorithms for machine learning, where I'm constantly doing things like multiplying 0 and infinity. And, depending on the situation it is totally clear what the correct result must be (either 0 or infinity).
Take for example computation of the entropy of a deterministic Bernoulli distribution: You have 1 * ln 1 + 0 * ln 0. The correct result is 0.
Mostly I am relying on the proper handling of infinity and NaN by the floating-point implementation; but sometimes I have to catch cases and correct the result by hand.
Going from 99.5 to 100.0 percent is extremely impressive, while going from 50.0 to 50.5 is probably just noise.
I was able to avoid casting completely for over two years while working in Scala. Certainly, the kind of work I did somehow supported this.
Only lately I had to resort to casting sometimes. But this happened only when dealing with rather complex types that abstract over nearly arbitrary computations. At one point you reach the ceiling of what is achievable with some fixed type system—and then you need casting.
I am now using shapeless for meta-programming, but I think this is the point where you yearn for more a expressive (dependently typed) type system than the one offered by Scala (or even Haskell). I hope the next generation of programming languages will make this practical.
What I really wanted to say: Just allowing casting does not mean loosing type safety. If you use casting and crash it's your fault.
The language is just not very type safe if you need to cast often during regular programming.
Casting is telling the compiler to do what you want. It's like saying "Shut up! I know what I'm doing, this thing is a XY pointer, even if you can't figure it out yourself."
In every language (which supports casting) you can make an error while casting by claiming something that isn't correct. Surprise!
You can prove things based on axioms and hypothesis. This works for theoretical settings like mathematics. In reality, even the most simple statement (like "This is an apple.") cannot be verified with certainty (what IS an apple?). Even if you do a DNA analysis of the genome of the object, you have uncertainty in the analysis, e.g. random misreadings of your equipment.
All you can do is be "pretty certain" about something. But that's not a proof.
Is it possible that using secure email services can be construed as an indicator of being a terrorist?
Take the experiment of drawing a random person. Define two events
If P(T|X) (probability of the person is a terrorist given he uses encryption) is larger than P(T) (probability of the person being a terrorist using no other evidence), I'd call the fact of using encryption an indicator of being a terrorist.
Any objections?
Of course the "indication strength" might be low. But I think the fact of using encryption increases my belief in someone being a terrorist. And taken together with other observations this might be enough to take according action.
It combines the strengths of dynamic scripting languages (less boiler-plate, fast and easy start-up, a REPL, no required compilation step).
Let's see whether the great dynamic scripting language Haskell also fulfills these points.
Now we see Haskell has all the advantages of dynamic scripting languages. How about the advantages of compiled languages?
with the strengths of traditional compiled languages (fast execution, static error detection, modularity, zero-overhead Java platform integration).
Which proves that Haskell has all the advantages of dynamic scripting languages, and most of the advantages of traditional compiled languages.
Btw., you can do the same using any other modern compiled language. This post wants to show the "advantages of dynamic scripting languages" have nothing to do with the languages being "dynamic" or "scripting", whatever that means.
Among the dynamic languages, only Erlang is more prone to concurrency errors. The regression analysis also shows that projects written in dynamic languages like CoffeeScript, TypeScript, Ruby, and Php have fewer concurrency errors
Now everyone knows that Erlang is bs for doing concurrent stuff, right? I do all my concurrency related programming in Ruby, as every other sane developer would do!
Air pollution is really making us pay through the nose.