Name: Anonymous 2018-10-12 17:08
So, why are you not using dependent types yet? Do you like your programs randomly crashing?
Please post about it.It was mostly vidya logic, so not very /prog/ relevant. Shit like not realizing that bumping numbers without touching the underlying mechanics will just lead to more tedious kiting.
I did something therefore it's fixed, thread over, issue closed, working as intendedthat is impossible to work with. With those people, you have to convince them emotionally, by licking their asses and trying to sneak your ideas as theirs.
buffer overflows and injectionsCan be prevented by dependent types.
but also logic bugsCan also be prevented by dependent types.
and race conditionsYou probably need linear types for that.
although it's harder for injections as they usually happen on the boundaries of languagesYou could have a dependent type like
system : (s : string) -> doesNotContainUnescapedQuotes s = True -> IO ()
logic bugs only theoretically canBuffer overflows are also logic bugs.
can't be done in general case (because of halting problem).Nice meme
by exploiting OS-level stuffDependent types can't prevent bugs in other programs.
doesNotContainUnescapedQuotesthat might be the only way to prevent shell injection but it's an anus-backwards approach when it comes to SQLi. the correct solution is not treating SQL queries as strings. see: parametrized queries.
Buffer overflows are also logic bugs.buffer overflows aren't really what security people would call logic bugs. this term refers to unintended consequences of a program's high-level design, not low-level details about programming language, calling convention and the processor architecture.
Nice memedependent types solve halting problem?
Dependent types can't prevent bugs in other programs.how would they prevent those bugs if an OS was written in a dependently typed language? that's a clear example of what I mean by 'logic bugs'
dependent types solve halting problem?Languages with dependent types tend to not be Turing complete. Moreover the halting problem is irrelevant for just about anything.
how would they prevent those bugs if an OS was written in a dependently typed language?Formal verification
Languages with dependent types tend to not be Turing complete.lets see these guys implement
Formal verificationwhich is non-trivial, time-intensive and doesn't even require dependent types. you can look at any bug and say '100k additional man-hours by guys with PhDs would have prevent it', but that's not saying much.