Eh upvotes on proggit and doesn't afraid of anything.
Name:
Anonymous2008-12-15 12:17
Unless you enforce correctness, strong normalization or maybe uniqueness, don't bother. Making sure that trivial type errors never occur is fairly useless because they are easily found during testing, while it imposes quite a burden on the programmer by limiting the language. Dynamically checked contracts are much more versatile1 and, maybe most importantly, they are optional.
Static typing is dumb. Even if it does prevent run-time type errors (while creating a new class of compile-time type errors we can make), it does nothing to prevent invalid values, which are arguably the more common and problematic issue.
Name:
Anonymous2008-12-15 12:49
Vote up if you think reddit sucks
Name:
Flea Turd Operator2008-12-15 13:11
I vcant' find the vote button. how do i register m y account on the 4chan ?
Name:
Anonymous2008-12-15 13:13
Dynamic typing sucks in imperative languages. The only place it is useful is functional languages. The end.
In OO languages static typing provides way better performance than dynamic typing, and won't go away any time soon solely for that reason. All other arguments are bullshit.
In procedural languages static typing is usually shitty and gets in the way more than it helps. The reason there's no standard container library in C is that you'd have to typecast shit all the time like you did in java (but without the run-time checking), effectively rendering the type system useless. Typeless languages like Forth are clearly superior for "medium-level" programmimg.
In functional languages, I don't know if static typing in general is the way to go, but I do know that Haskell's type system allows you to do some very neat tricks while pretty much ensuring your will run correctly (with no unforeseen errors, that is).
Haskell is great. It fucking checks my type errors and I instantly know that if it passes the type checker, then my program will be bug-free. I can't wait for dons to add halt-detection support to GHC so I can tell which of my programs halt and which don't.
Name:
Anonymous2008-12-15 16:50
>>13 In OO languages static typing provides way better performance than dynamic typing
0/10
>>25
And you think that has something to do with the type system? Way to eliminate variables, faggot.
Name:
Anonymous2008-12-16 17:32
Of course it has something to do with the type system, you fucking moron. Dynamic dispatch through virtual table, which can only be done through static typing, is inherently faster than the fucking multiple hashtable lookup that is done in dynamicaly typed languages. Also, static typing allows for primitive types, and even a goddamn retard like yourself must know that a fucking primitive int type will always be fastes than an Integer object. Shut the fuck up, you fucking cunt.
Name:
Anonymous2008-12-16 17:43
>>27
It's like you think dynamic typing means no type inference and method inlining on the compiler's part is allowed.
Name:
Anonymous2008-12-16 17:47
I like fuck you fucking reddit readers
Name:
Anonymous2008-12-16 19:09
>>28
Nor runtime profiling and JIT with decision caching.
Name:
Anonymous2008-12-17 4:01
>>29 What's wrong with reddit? It's a good source of information.
Name:
Anonymous2008-12-17 5:22
>>28,30
The only dynamically typed language where type inference works well is Lisp (and Dylan, because it's Lisp), and only when you're sticking to the non-OO stuff. Runtime profiling, JIT compiling and method caching are done in every "high performance" virtual machine for dynamically typed OO languages (mostly Smalltalk VMs), and their performance are still crap when compared to, say, Java. You fucks want to believe in magic? Fine. Just don't fucking expect to use magic as an argument.
Name:
Anonymous2008-12-17 5:23
>>31 What's wrong with /b/? It's a good source of information.
Name:
Anonymous2008-12-17 5:47
>>32 The only dynamically typed language where type inference works well is Lisp
What.
Name:
Anonymous2008-12-17 5:52
>>27 a fucking primitive int type will always be fastes than an Integer object
[citation needed]
Name:
Anonymous2008-12-17 6:14
>>35
You sure you don't want to [Citation Needed] static typing allows for primitive types
? As if you must have a static language to unbox values in the compiler. Everybody does this, because it's fucking obvious.
Name:
Anonymous2008-12-17 6:38
This is turning out to be more successful than I ever imagined.
Name:
Anonymous2008-12-17 6:46
'-._,,,,.._______________.....___
`-,
`._
(
\ HAVE YOU IMPLEMENTED AN OBJECT SYSTEM TODAY?
\
`-_ '
`-..............._ ,
`-.._ _.-'
`'-----''
Name:
Anonymous2008-12-17 7:08
>>34
Part of the reason SBCL is so fast is type inference.
>>36
Unboxing values in the compiler is much less effective than already having them unboxed everywhere.
Name:
Anonymous2008-12-17 9:36
>>39 Unboxing values in the compiler is much less effective than already having them unboxed everywhere.
Effective in what sense? That's only true if you think compile time is a relevant metric for anything.
Name:
Anonymous2008-12-17 14:27
Both static typing and dynamic typing have their places. Dynamic typing is good if you want to "get shit done"--that's why "scripting languages" such as Python and Ruby use it. For larger projects, however, ensuring that types match can be important, and it can be helpful for the compiler to catch potential run-time errors at compile-time; Haskell does this brilliantly, and even though GHC's error messages can be hard to comprehend, they help you ensure that your program's types are logical.
Name:
Anonymous2008-12-17 14:46
Try telling this to generics in Java. During complication the type is erased and everything is treated as Object and then constantly boxed and unboxed in each scope you access them in.
>>42
Also the "erasure" process is confusing as hell. I don't know if it's possible to fuck up generics any worse than C++, but Java has definitely put in a good effort.
Name:
Anonymous2008-12-17 16:00
>>45
How are "generics" (I think you mean "templates") fucked-up in C++, other than taking a while to instantiate? The view of each instantiation of a template as a separate class makes sense to me.
Name:
Anonymous2008-12-17 17:32
>>40
Less effective in the sense that the compiler doesn't always know when something is a value and can be unboxed.