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
- T - the person is a terrorist
- X - the person uses encrypted internet messaging
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.
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.
- - less boiler-plate: in addition to not requiring type annotations, Haskell even gets rid of parens; check
- - fast and easy start-up: you can compile it to native; check
- - REPL: check
- - no required compilation step: if you use runhaskell it looks like interpreted, check (thouch technically that's a lie, as it is for JITed scripting languages
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).
- - fast execution: ghc creates very efficient native code, check
- - static error detection: uhm, yes; though better than traditional languages, check
- - modularity: dunno what this means. Since there are modules in Haskell we call it check.
- - zero-overhead Java platform integration: unfortunately not. But since exactly when is Java-integration zero overhead?
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!
They appear to put enormous work into making their CV look good (like having publications in shitty journals, about shitty pseudo research). But they're not able to get anything done, because they have no skill whatsoever. Only on paper.
I don't want to use a stinky client, just because these people can't code their website properly.