Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Post
  • Reply
Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Plorkyeran posted:

ideally you'd want to only ignore non-semantic whitespace changes, which does require language processing

don't use -w on Python code, I guess. pretending the user has some idea what's going on can simplify things

oh you mean like line ending stuff? working line by line makes most of that moot I think?

Adbot
ADBOT LOVES YOU

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
i was thinking more of wanting to see whitespace changes inside string literals but nowhere else, but i guess there's also languages where a+b is different from a + b and python

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Plorkyeran posted:

i was thinking more of wanting to see whitespace changes inside string literals but nowhere else, but i guess there's also languages where a+b is different from a + b and python

oh yeah, hmm

it's a blunt tool, just read the whole diff you pussy

Plorkyeran
Mar 22, 2007

To Escape The Shackles Of The Old Forums, We Must Reject The Tribal Negativity He Endorsed
it's certainly not a critical issue that torments me on a daily basis or anything. i'm just saying that the simple language-agnostic tools are merely okay and not a totally solved problem

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Plorkyeran posted:

it's certainly not a critical issue that torments me on a daily basis or anything. i'm just saying that the simple language-agnostic tools are merely okay and not a totally solved problem

"merely ok" is a pretty good situation, IMO. I think that's the case for most trades

JewKiller 3000
Nov 28, 2006

by Lowtax
there is a distinction worth making between type systems and other forms of static analysis. a type system is generally sound but incomplete: you may not be able to express what you want directly in the type system, but whatever you can express will be enforced without fail. in theory, a good static analysis should be both sound and complete, but due to rice's theorem you can't do anything non-trivial this way. in reality, commercial static analysis tools trade soundness for additional completeness: they'll find many types of errors, but there's no guarantee that for any type, every such error will be caught. this is mainly because being more sound involves generating a lot more false positives, which are annoying enough to the user that he may give up on the tool entirely. if the tool finds 1 of 2 errors in the code, well then that's 1 fewer error than you had before, and you don't know about the other one, so you're not gonna blame the tool. on the other hand, if the tool finds both errors but generates 100 false positives, the tool user must check all these false positives manually, and he's liable to just say "gently caress this"

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

JewKiller 3000 posted:

there is a distinction worth making between type systems and other forms of static analysis. a type system is generally sound but incomplete: you may not be able to express what you want directly in the type system, but whatever you can express will be enforced without fail. in theory, a good static analysis should be both sound and complete, but due to rice's theorem you can't do anything non-trivial this way. in reality, commercial static analysis tools trade soundness for additional completeness: they'll find many types of errors, but there's no guarantee that for any type, every such error will be caught. this is mainly because being more sound involves generating a lot more false positives, which are annoying enough to the user that he may give up on the tool entirely. if the tool finds 1 of 2 errors in the code, well then that's 1 fewer error than you had before, and you don't know about the other one, so you're not gonna blame the tool. on the other hand, if the tool finds both errors but generates 100 false positives, the tool user must check all these false positives manually, and he's liable to just say "gently caress this"

developer ergonomics matter, indeed

Mr. Glass
May 1, 2009

JewKiller 3000 posted:

there is a distinction worth making between type systems and other forms of static analysis. a type system is generally sound but incomplete: you may not be able to express what you want directly in the type system, but whatever you can express will be enforced without fail.

this is a good post and I had not considered this distinction

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

Mr. Glass posted:

"static analysis" is a euphemism for "hacky tools i have to use because my programming language doesn't have an expressive enough type system"

i'm sorry the project is not being done using your favorite language, but we're not rewriting the whole thing jut because you don't like it.

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

Mr. Glass posted:

this is a good post and I had not considered this distinction

:agreed:

JewKiller 3000
Nov 28, 2006

by Lowtax

Wheany posted:

i'm sorry the project is not being done using your favorite language, but we're not rewriting the whole thing jut because you don't like it.

that's fine, i'll go find another job then, there are plenty. enjoy working with all those fresh-out-of-college node.js wizards

i mean ok i understand if we're talking about linux or firefox or some other huge codebase that isn't going anywhere, but if you're starting a new project and you choose a language with no static type system (or a useless type system) then S M D H

my homie dhall
Dec 9, 2010

honey, oh please, it's just a machine

JewKiller 3000 posted:

there is a distinction worth making between type systems and other forms of static analysis. a type system is generally sound but incomplete: you may not be able to express what you want directly in the type system, but whatever you can express will be enforced without fail. in theory, a good static analysis should be both sound and complete, but due to rice's theorem you can't do anything non-trivial this way. in reality, commercial static analysis tools trade soundness for additional completeness: they'll find many types of errors, but there's no guarantee that for any type, every such error will be caught. this is mainly because being more sound involves generating a lot more false positives, which are annoying enough to the user that he may give up on the tool entirely. if the tool finds 1 of 2 errors in the code, well then that's 1 fewer error than you had before, and you don't know about the other one, so you're not gonna blame the tool. on the other hand, if the tool finds both errors but generates 100 false positives, the tool user must check all these false positives manually, and he's liable to just say "gently caress this"

Ty for this good post, Jew Killer 3000

suffix
Jul 27, 2013

Wheeee!

fritz posted:

i dont fully see what kind of type system would catch some of these errors: http://clang-analyzer.llvm.org/available_checks.html

just require all programs to be provably correct, nbd

comedyblissoption
Mar 15, 2006

JewKiller 3000 posted:

that's fine, i'll go find another job then, there are plenty. enjoy working with all those fresh-out-of-college node.js wizards

i mean ok i understand if we're talking about linux or firefox or some other huge codebase that isn't going anywhere, but if you're starting a new project and you choose a language with no static type system (or a useless type system) then S M D H
it's wierd that the industry feels like it's regressing and not learning anything as a whole by increasing adoption of dynamically typed languages

gonadic io
Feb 16, 2011

>>=

suffix posted:

just require all programs to be provably correct, nbd

and don't allow recursion on terms which aren't provably smaller

comedyblissoption
Mar 15, 2006

lisp is a cool dynamically typed language but it feels like its advantages besides metaprogramming have been long supplanted by statically typed languages

brap
Aug 23, 2004

Grimey Drawer
bbbut dynamically typed languages let me move fast!

Wheany
Mar 17, 2006

Spinyahahahahahahahahahahahaha!

Doctor Rope

JewKiller 3000 posted:

that's fine, i'll go find another job then, there are plenty. enjoy working with all those fresh-out-of-college node.js wizards

i mean ok i understand if we're talking about linux or firefox or some other huge codebase that isn't going anywhere, but if you're starting a new project and you choose a language with no static type system (or a useless type system) then S M D H

oh no, this project is nowhere near as big as firefox or linux, but it has been in production for a couple of years now. it works well and isn't a nightmare to maintain. but it needs to be maintained.

we're not rewriting the whole thing jut because you don't like it.

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

Wheany posted:

oh no, this project is nowhere near as big as firefox or linux, but it has been in production for a couple of years now. it works well and isn't a nightmare to maintain. but it needs to be maintained.

we're not rewriting the whole thing jut because you don't like it.

how big is it

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

comedyblissoption posted:

lisp is a cool dynamically typed language but it feels like its advantages besides metaprogramming have been long supplanted by statically typed languages

dynamic + strong typing is super nice (like in python and erlang, not like javascript). there's evidence that dynamic typing makes programming more productive compared to static.

and lots of applications doesn't need static typing because it'd be pointless optimization

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
also static type checking is redundant if you write tests, and you should write tests anyway yaddayadda

Notorious b.s.d.
Jan 25, 2003

by Reene

Symbolic Butt posted:

dynamic + strong typing is super nice (like in python and erlang, not like javascript). there's evidence that dynamic typing makes programming more productive compared to static.

and lots of applications doesn't need static typing because it'd be pointless optimization

first, python still relies on lame-rear end duck typing, i don't care how "strong" it is, it's pretty useless for enforcing my program invariants or static analysis

statically typed languages can still be highly interactive, and that's where i think the productivity gains lie. i demand a compiler AND an interpreter, motherfuckers. lisp, haskell, scala's designers understood this. p-lang designers didn't

Notorious b.s.d. fucked around with this message at 19:42 on Apr 11, 2015

Notorious b.s.d.
Jan 25, 2003

by Reene

comedyblissoption posted:

lisp is a cool dynamically typed language but it feels like its advantages besides metaprogramming have been long supplanted by statically typed languages

common lisp has a real static type system. it's completely optional, and therefore completely ignored

programmers are lazy assholes, so optional strong, static typing reduces to being weakly, dynamically typed when real-world users touch your language

Notorious b.s.d.
Jan 25, 2003

by Reene

Symbolic Butt posted:

also static type checking is redundant if you write tests, and you should write tests anyway yaddayadda

why the gently caress should i write a blizzard of extra tests? i'd rather just have more expressive code.

type systems are useful specifically because i don't need a shitload of extra unit tests to express my intended program invariants. the code itself says what is supposed to happen

lousy type systems ruby/perl/python make it extremely difficult to write expressive code. to build a robust codebase, you spend lots and lots of time writing tests that are not interesting to future readers.

Notorious b.s.d. fucked around with this message at 19:45 on Apr 11, 2015

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Symbolic Butt posted:

also static type checking is redundant if you write tests, and you should write tests anyway yaddayadda

lol

MononcQc
May 29, 2007

Notorious b.s.d. posted:

common lisp has a real static type system. it's completely optional, and therefore completely ignored

Does it have inference? Erlang's got an optional type system too, and it gets rather well used around even on codebases that don't annotate anything. The type declarations can be used in documentation, analysis, tests (as quickcheck/PropEr generators). In practice the language remains dynamic, but you get to find type errors that would otherwise show themselves at runtime before then.

my homie dhall
Dec 9, 2010

honey, oh please, it's just a machine

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

Notorious b.s.d. posted:

why the gently caress should i write a blizzard of extra tests? i'd rather just have more expressive code.

type systems are useful specifically because i don't need a shitload of extra unit tests to express my intended program invariants. the code itself says what is supposed to happen

lousy type systems ruby/perl/python make it extremely difficult to write expressive code. to build a robust codebase, you spend lots and lots of time writing tests that are not interesting to future readers.

you don't need "extra tests" or whatever, that's bad tdd mumbojumbo

assert(poop_type == type(butt())) <-- dumb testing by dumb people

I'm advocating for the kinds of testing that you need to write in any kind of language anyway (the ones that test nontrivial invariants you know), those will always give you the benefits of static type checking for free



realistically speaking, I can see it in a scenario where nobody writes any tests in your lovely company so you can be like "thank god AT LEAST I GOT STATIC TYPE CHECKING HERE". you're still hosed but you'd be more hosed with python in this case, mmyes

Arcsech
Aug 5, 2008

MononcQc posted:

Does it have inference? Erlang's got an optional type system too, and it gets rather well used around even on codebases that don't annotate anything. The type declarations can be used in documentation, analysis, tests (as quickcheck/PropEr generators). In practice the language remains dynamic, but you get to find type errors that would otherwise show themselves at runtime before then.

I do not know common lisp very well but I think it does

Erlang seems like it's kind of an exception, because if you're working with Erlang then you're most likely already experienced enough to know that being a lazy bastard now gets you in the deep poo poo later (esp. when you're working with complex stuff like distributed systems), so use type annotations, static analysis, etc. as much as possible

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

Symbolic Butt posted:

I'm advocating for the kinds of testing that you need to write in any kind of language anyway (the ones that test nontrivial invariants you know), those will always give you the benefits of static type checking for free

oh, well, im convinced

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

fart simpson posted:

oh, well, im convinced

glad that's sorted out

leftist heap
Feb 28, 2013

Fun Shoe
here lies static typing


killed by unit tests

leftist heap
Feb 28, 2013

Fun Shoe
i'm glad that the debate is over and i can now be ultra productive writing in a plang

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord
I don't even p-lang much anymore

I've been mostly writing C :toot:

...and debugging bash scripts :cry:

fritz
Jul 26, 2003

Symbolic Butt posted:

I don't even p-lang much anymore

I've been mostly writing C :toot:

i havent done any serious work in python for like 6 months now, it's been all c++ and java

Soricidus
Oct 21, 2010
freedom-hating statist shill

Symbolic Butt posted:

I'm advocating for the kinds of testing that you need to write in any kind of language anyway (the ones that test nontrivial invariants you know), those will always give you the benefits of static type checking for free
oh cool this argument again

please add "sufficiently good test suite" to the list of silver bullets alongside "sufficiently expressive type system" and "sufficiently smart compiler"

me, I'll carry on using all the crutches available to deal with the imperfect world I have to live in, where static typing remains useful

comedyblissoption
Mar 15, 2006

how long until a dynamically typed codebase invents its own system of ad hoc type documentation through comments or hungarian notation or statically typed transpiler

how many different ways do library authors end up documenting their types

DaTroof
Nov 16, 2000

CC LIMERICK CONTEST GRAND CHAMPION
There once was a poster named Troof
Who was getting quite long in the toof

comedyblissoption posted:

how long until a dynamically typed codebase invents its own system of ad hoc type documentation through comments or hungarian notation

how many different ways do library authors end up documenting their types

well, phpdoc and rdoc are things

p useful things, imo

Symbolic Butt
Mar 22, 2009

(_!_)
Buglord

Soricidus posted:

oh cool this argument again

don't gimmickshame please

Soricidus posted:

please add "sufficiently good test suite" to the list of silver bullets alongside "sufficiently expressive type system" and "sufficiently smart compiler"

me, I'll carry on using all the crutches available to deal with the imperfect world I have to live in, where static typing remains useful

I'm not even idealizing one supposed kind of "good testing suite" like those silver bullets. I'm saying that by mere virtue of having a testing suite at all already makes static type checking redundant.

and it's the 2010s, if you don't use vcs and write tests then I don't know what the gently caress

Adbot
ADBOT LOVES YOU

Soricidus
Oct 21, 2010
freedom-hating statist shill

Symbolic Butt posted:

I'm not even idealizing one supposed kind of "good testing suite" like those silver bullets. I'm saying that by mere virtue of having a testing suite at all already makes static type checking redundant.

:psyduck:

  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply