News for hackers. Stuff that matters.
Re:Are dynamic languages going to replace static languages? ... by belorn on Wednesday August 04, 2021 @05:21AM (#28058930)
I do not want static types or unit test. I want integration tests, system test and regression tests, neither which are commonly found by doing trivial checks of correctness. The decision if an integer is stored as a 4 byte or 8 byte, big-endian or little-endian, should be up to the computer to decide. A test to verify that the right integer is sent to the function is something I shouldn't and do not want to be spending time on. The language should be competent enough to figure it out, and if it need to optimize, it should do so dynamically when such optimization is possible.

What I found problematic is that system and integration tests is generally relegated to be done outside of the programming process. It is instead the administrators job to write an extensive test system to verify that the program actually do the job that it was written for. You start to wish for a very different set of tool design when the programmer and administrator is the same person.

Re:Are dynamic languages going to replace static languages? ... by adwn on Wednesday August 04, 2021 @07:31AM (#28059749)
> The decision if an integer is stored as a 4 byte or 8 byte, big-endian or little-endian, should be up to the computer to decide.

What about the decision whether a function argument is an integer or a string? A floating-point value or an optional floating-point value? How could the compiler ever decide that?

The size of an integer is only a very, very small part of a modern static type system.

Re:Are dynamic languages going to replace static languages? ... by belorn on Wednesday August 04, 2021 @08:07AM (#28060007)
From a system and integration tests perspective, do you care if a function argument is an integer or a string? Is the question relevant to the customer requirements?

If a number is an int, float, large or what have you, the question I would ask is how many decimal points should be printed or if you divide 2 with 2, do you get 1 or 0.99999. A good language/compile should have sane defaults that works almost every time, while giving me options to override it if in testing it get an unexpected result where a human would disagree with the computer.

The source of tests should be the customer requirements, and types is just an set of automatic tests being applied on the code which has no direct connection to the customer requirements.

Re:Are dynamic languages going to replace static languages? ... by adwn on Wednesday August 04, 2021 @10:57AM (#28061738)
Wat.

I have no idea what you're going on about. The customer doesn't care about the particulars of your unit or integration tests, instead they care about whether your software works properly. A modern, powerful static type system is one tool that helps a developer achieve that goal of properly working software, and the developer absolutely should care about whether that function argument is an integer or a string.