News for hackers. Stuff that matters.
Re:Diminishing returns of static typing by fulafel on Monday October 02, 2017 @11:31AM (#15384573)
Dynamic languages support this kind of tooling too - you can even have seamless data completion (eg. map/dictionary keys). The original Refactoring Browser was written for Smalltalk. Etc.

Of course there are cases where dynamic languages do worse, but it balances out I think.

Re:Diminishing returns of static typing by igouy on Monday October 02, 2017 @12:46PM (#15385416)
> The original Refactoring Browser was written for Smalltalk.

Unless you think original means Bill Opdyke's thesis work, where the tooling was written for C++ and written in CLOS.

http://www.laputan.org/pub/papers/opdyke-thesis.pdf

Re:Diminishing returns of static typing by cm2187 on Monday October 02, 2017 @11:57AM (#15384833)
But how can you offer any refactoring or auto-complete inside a function if you don't know what type to expect as an argument?
Re:Diminishing returns of static typing by actsasbuffoon on Monday October 02, 2017 @12:26PM (#15385211)
You can, but you may start to run into some limitations. Many languages have some version of type inference, which allows them to figure out the type of a thing, even though the programmer didn’t specify it.

C# has a very weak version of this with the auto keyword. Languages like Crystal take it much further by tracing the flow of data through the entire program. It generally works quite well, though there are a few edgecases that require explicit type annotations.

As for auto-completion, some languages feature designs that make it easy to offer auto completion even without type information. For instance, Elixir doesn’t have methods. You only have functions defined on modules, and it’s trivially easy to know what functions are defined on a module.

So it’s possible, but there are some limitations.

Re:Diminishing returns of static typing by TheDong on Monday October 02, 2017 @01:42PM (#15386014)
Type inference goes hand-in-hand with static typing. Those are not opposite things.

> C# .... Crystal

Both are fully statically typed languages with type inference. Those are unrelated to the argument the parent comment is making.

Re:Diminishing returns of static typing by andybak on Monday October 02, 2017 @06:54PM (#15388684)
> Type inference goes hand-in-hand with static typing.

That would imply there's no type inference possible with dynamic languages - either at "compile" time or run time.

(Wouldn't it also imply that static typing and strong typing are synonymous?)

Re:Diminishing returns of static typing by jaggederest on Monday October 02, 2017 @02:34PM (#15386515)
They still both allow generic arguments, in reduction, this means that they still have uncertainty.

I can and have built a totally untyped language within a fully statically typed language - nostrademons' Scheme-in-haskell exercise is a lot of fun.

You just have to define a Universal type and then back out of all that nasty compile-time nonsense. Everything is Univ and Univ is everything.

Re:Diminishing returns of static typing by bjz_ on Monday October 02, 2017 @01:25PM (#15385851)
Yes! If your language allows you to put constraints on those types you can specify what specific types have access to. For example in Rust:

    fn foo<T: Positioned>(x: &T) -> Point {
       x.position()
    }
Note that this doesn't work in languages that use templates for generics, like C++, where templates work more like compile-time duck typing.
Re:Diminishing returns of static typing by cm2187 on Monday October 02, 2017 @02:35PM (#15386527)
But, if I may, you are effectively statically typing your code.
Re:Diminishing returns of static typing by bjz_ on Monday October 02, 2017 @03:00PM (#15386820)
Oh wait, I misread the comment you were responding to. Oops!
Re:Diminishing returns of static typing by fulafel on Monday October 02, 2017 @12:12PM (#15385031)
In dynamic languages functions aren't typically overloaded by argument type.

For OO languages and methods it does get a little guesswork-y, and tools often offer a wider range of guesses than is correct for completion. But you can show the class along with the offered completion, so it's not too bad.