Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-4041-

Static typing is security theater for programmers

Name: Anonymous 2014-06-25 16:01

http://blog.metaobject.com/2014/06/the-safyness-of-static-typing.html
Face it, Haskelitists: There are not a lot of bugs that can be caught by a type system. Such it up and use texting like the rest of us.

Name: Anonymous 2014-06-25 16:42

Static typing is not a religion that someone can evangelize for or against, it is a practical technique that is proven time and again in - you guessed it, practice. No need to read any crappy layman blogs, sir.

Name: Anonymous 2014-06-25 16:48

I agree that the benefits of static typing are vastly exaggerated by a bunch of weenies who masturbate to the Curry-Howard correspondence every morning, but using Java as an example against type systems is ridiculous.

Name: Anonymous 2014-06-25 16:59

I read this before. It's nonsense. The Milner quote is out of context, as usual.

Most of those errors can be encoded as type errors. The fact is nothing is a type error if you don't first encode things into types, and you get very far with that if your type system is status quo. He's basically complaining that we don't need Haskell because Java is such a steamer.

Name: Anonymous 2014-06-25 17:14

>>3
weenie
You have bad taste in programming. That, or do it as a job (idiot).

Name: Anonymous 2014-06-25 17:15

Static typing slows down prototyping. You have to use these "patterns", like inversion of control and Liskov (shalom!) substitution principle, which are never an issue with Lisp. Moreover, in case of garbage collected languages like Haskell or Java, static typing doesn't really provide an optimization, because GC requires tags to be present on objects. The only justified use of static typing is in C and assembly, where it helps accessing structs.

Name: Anonymous 2014-06-25 17:16

>>6

GC requires tags to be present on objects.
conservative GC doesn't require, but it is also slower and less robust.

Name: Anonymous 2014-06-25 17:46

>>5
I assure you I have a most excellent taste in programming. And indeed, I do program as a part of my job, a concept that appears to be foreign to the static typing Haskell ``elite''.

Name: Anonymous 2014-06-25 17:56

>>6
I'm just trying to find a statement in your post that wouldn't be complete unfounded bullshit.

Name: Anonymous 2014-06-25 17:57

>>9
I'm just trying to find a statement in your post that wouldn't be complete unfounded bullshit.

Name: Anonymous 2014-06-25 18:03

Q: How does one detect a Jew?
A: Jews have big 6-curved noses, bulging almond shaped eyes and tend to use statically typed languages. I.e. a lot of Jews use Haskell, inventors of Eiffel and C# are Jewish too!

Name: Anonymous 2014-06-25 18:34

>>11
I thought almond shaped eyes were a good aryan thing.

Name: Anonymous 2014-06-25 18:40

Name: Anonymous 2014-06-25 19:35

>>13
I don't think you know what ``almond shaped'' means.

Name: Anonymous 2014-06-25 19:48

>>13
I don't think you know what ``almond shaped'' means.

Name: Anonymous 2014-06-25 20:47

Static typing apologists think that if you use types as a design tools in your coding, then bugs will go away. I.e. to avoid division by zero, static typing zealot would introduce NonZeroInteger and then mediate between it and normal Integer. Lisp allows achieving the same by attaching the code to the interface into the code requiring non-zero input. So static typing basically sweeps bugs under the carpet by obfuscating code.

Name: Anonymous 2014-06-25 21:28

>>6
Static typing slows down prototyping
That premise is false. It's like saying variable assignment and library calls slows down prototyping. Sure, you can prototype with little preamble on some dynamic languages, but by doing so you are risking the effects of missing assignments required for the emulation of the prototype. So when you do not write all your requirements, you end up wasting more time overall trying to emulate the desired prototype.

With static typing, you are forced to write down your requirements, keeping you focused of the overall goal of the prototype.

In GC, it makes even more sense, because proper GCs should have a cache or readily usable types, making it easier to map when operating values.

Name: Anonymous 2014-06-25 21:35

>>16
types as a design tools in your coding, then bugs will go away
That premise is also false. It provides safety in the type system, not coding errors. A type system is not some magical thing that prevent coders from writing spaghetti.

Just to make sure this discussion does not delve into further drivel, speak with some background knowledge:
https://en.wikipedia.org/wiki/Type_system

Name: Anonymous 2014-06-26 3:00

>>17
What sort of person declares a variable to be an integer then goes on to use it as a string?

Name: Anonymous 2014-06-26 3:19

>>19
APPERS

Name: Anonymous 2014-06-26 5:27

APES

Name: Anonymous 2014-06-26 6:42

>>18
implying coders would use type-system verbosities explicitly to design safe programs, instead of fighting the typesystem and opening ways to circumvent it.

Name: Anonymous 2014-06-26 9:18

>>22
implying
please don't

Name: Anonymous 2014-06-26 12:17

>>22
I.e. Spaghetti code.

Name: Anonymous 2014-06-26 16:02

>>16
If you ever tried to use a statically-typed language in practice, you wouldn't spew that childish bullshit. Of course the type system can catch only the most trivial errors (like wrong order of arguments or mapping a function over a list twice in two different places), but these trivial errors make up the majority of your day-to-day errors. Static typing points the boring 90% of bugs out for you, so you have more time to think about the non-trivial bugs or flaws in your design.

And static typing is fast. Where with a unityped language you'd have to compile your program, run it, and wait for it to run the whole test suite, a fully statically typed language points out the type errors without even compiling anything! It's these fast turnaround speeds that make static typing so much better for rapid prototyping and refactoring.

Name: Anonymous 2014-06-26 16:31

>>25
Of course the type system can catch only the most trivial errors
What are you writing, C? Goddamn, learn F# or something. Or even C#.

Name: Anonymous 2014-06-26 16:45

>>26
The type systems that you mention can't even statically ensure that array indices are within bounds and that resources are disposed of correctly. So yes, they can catch only the most trivial "square peg in round hole" errors.

Name: Anonymous 2014-06-26 17:06

>>27
They can statically check that ACLs/credentials are enforced, statically check SQL queries, statically enforce taint checks and so on. Some type systems are turing complete, and can check anything that eventually does compile. You can do a lot of this in C, but then implicit coercion spoils everything.

Not all type systems can do static bounds-checking but dependent type systems can. Dependent types are halting equivalent in general, but I only need to concede the point if you can supply a useful program that is halting equivalent. It hasn't been done.

Hell, Xavier LeRoy wrote a verified C compiler with his Coq. From what I hear it admits no compiler bugs and won't emit code with UD.

Resource disposal is an odd complaint. C++ programmers and GC langs with poor type systems tend screw it up.

Name: Anonymous 2014-06-26 17:10

>>25

Theorem A: Units Testing catches all errors Static Typing does.
Theorem B: Static Typing doesn't catch most of the errors Units Testing catches.
Theorem C: Static Typing gets in the way, when you want to quickly prototype code and/or doesn't care if there are typing errors.
------
Corollary A: Static Typing is not a replacement for Unit Testing.
Corollary B: Units Testing is a replacement for Static Typing.
Corollary C: No reason bothering with Static Typing, when you have to do Unit Testing anyway.

Name: Anonymous 2014-06-26 17:17

>>29
And now for the proofs.

Name: Anonymous 2014-06-26 17:23

>>30

prove that 2+2 = 4

Name: Anonymous 2014-06-26 17:52

>>31
What a sublime and brilliant proof, professor!

Name: Anonymous 2014-06-26 17:53

>>28
Credentials? Taints? SQL queries? ENTERPRISE LEVEL TYPE SAFETY

Name: Anonymous 2014-06-26 18:53

>>31
With or without dependent types? I think the miniKanren folks can do it with a modified peano arithmetic.

Name: Anonymous 2014-06-26 20:25

>>34

use C++ templates.

Name: Anonymous 2014-06-26 20:29

If arbitrary values are allowed in dependent types, then deciding type equality may involve deciding whether two arbitrary programs produce the same result; hence type checking may become undecidable.
so basically dependent types are snake oil.

Name: Anonymous 2014-06-26 20:37

>>36
You do know that program evaluation is undecidable in general, right? By your logic software on the whole is snake oil.

Name: Anonymous 2014-06-26 23:23

>>31
Defining 2 as S(S(0)) and 4 as S(S(S(S(0)))), where S is the successor function and addition is defined as usual in the Peano arithmetic, we can prove that 2 + 2 = 4.

I don't know why I even bothered replying to your post.

Name: Anonymous 2014-06-26 23:37

>>38
Prove that S(S(0)) + S(S(0)) = S(S(S(S(0))))

Name: Anonymous 2014-06-26 23:54

>>39
It follows by the definition of addition.

Addition is defined recursively as:
[1] a + 0 = 0
[2] a + S(b) = S(a + b)


Thus we can perform the addition by using the definitions
S(S(0)) + S(S(0))
= S( S(S(0)) + S(0) ) (def 2)
= S( S(S(S(0))) + 0 ) (def 2)
= S( S(S(S(0))) ) (def 1)
= 4


Are you using me?

Name: Anonymous 2014-06-27 13:56

>>40
Prove that your definition of addition is consistent with my definition of addition.

Name: Anonymous 2014-06-27 14:00

>>40
Yeah, I think you're being trolled.

Name: Anonymous 2014-06-27 17:12

>>41
Provide us with your definition of addition.

Name: Anonymous 2014-06-27 17:45

It's a known fact that relativists/subjectivists always score lower on IQ test than everybody else.

Name: Anonymous 2014-06-27 22:01

It's a known fact that DIE IN A FIRE I FUCKING HATE YOU LE CRETIN DON'T MOCK ME SDSAKFHSKDJFHKDSJFHAKSDHFAKSHDFKJADSHF FUCK YOU *cocks shotgun*

Name: Anonymous 2014-06-28 4:02

>>45
KEINE THE COW

Name: Anonymous 2014-06-28 4:58

Programs are proofs, but only typed programs are useful proofs and only with regard to that which is expressed in types.

Tested programs can also be useful proofs, but testers aim for code coverage instead of spec and assumption coverage for some weird reason so they rarely ever prove anything useful.

Name: Anonymous 2014-06-28 6:17

>>47
Programs are programs, not proofs. Stop fucking doing this stupid shit. Next thing you're gonna say is that a computer is a homosexual nigger (you).

Name: Anonymous 2014-06-28 7:13

>>36
It's possible to keep it decidable, the only downside is requiring the programmer to declare types explicitly everywhere, which is a small price to pay for increased correctness guarantees.

Name: Anonymous 2014-06-28 7:49

>>48
You might not like the Curry-Howard correspondence, but it still exists.

It doesn't have anything to say anything about the GNAA, so I think maybe you have some things you need to work out.

Name: Anonymous 2014-06-28 10:48

>>46
DON'T MOCK KEINE SAFIKHDSFKLDJHADSJKLFHASDKJFHKASHFAJKDSFKDSA I FUCKING HATE YOU CRETIN DIE IN A FIRE

Name: Anonymous 2014-06-28 10:51

>>50
And it's still useless. What proofs are strcpy and memcpy equivalent to?

Name: Anonymous 2014-06-28 20:32

>>52
They're not well typed programs. But CompCert might have something to say about it: http://compcert.inria.fr/

Don't change these.
Name: Email:
Entire Thread Thread List