News for hackers. Stuff that matters.
Re:Incrementally migrating over one million lines of code fr... by setr on Wednesday February 06, 2019 @04:28PM (#19100173)
I believe the general idea with gradual typing is that

1) It's faster to write the initial proof of concept with a dynamic language

2) It's common that the proof of concept becomes sufficiently big/stable that it turns into the final codebase

3) Gradual typing makes the path from PoC to real codebase smoother, instead of re-implementing in another language.

Point 1 is contentious of course, but that argument isn't relevant here. It is believed, and that belief becomes practice.

An example of point 2 might be OSH of the oil shell, which doesn't use mypy I believe, but was originally written in python with the intent to rewrite in C++, and eventually decided it was too costly to rewrite (somehow he decided that ripping apart the python VM would be the more fruitful path... and apparently he's making good progress there).

So basically, the usecase of mypy is when you're making the decision of continuing with python, or rewriting. Sometimes rewriting was part of the strategy from the start, other times a script just grew into a full-fledged program over time, but mypy's primary goal wouldn't be to introduce from the start.

Another usecase I've personally done is having the typing available to me from the start, but not actually making use of it until I reached a particularly nasty section of code. And so that particular chunk becomes (reasonably) statically typed, while the rest of the program remains standard python.

Although in that case I used a library that enforced typechecking at runtime rather than mypy (the library was typeguard iirc), which I only enabled on test runs (it slowed down the program significantly).

Re:Incrementally migrating over one million lines of code fr... by xiaodai on Wednesday February 06, 2019 @04:40PM (#19100307)
If you want gradual typing for a smoother ride and performance then just choose Julia. Seriously.
Re:Incrementally migrating over one million lines of code fr... by happy_man on Wednesday February 06, 2019 @06:55PM (#19101491)
Let's wait a couple of years until Julia stabilizes itself before suggesting is ready for production
Re:Incrementally migrating over one million lines of code fr... by setr on Wednesday February 06, 2019 @10:25PM (#19102742)
Stabilization and proliferation of libraries; afaik its ecosystem is currently only really fulfilled for numpy/scipy/ml workloads
Re:Incrementally migrating over one million lines of code fr... by happy_man on Thursday February 07, 2019 @01:09AM (#19103386)
Seems Julia developers and evangelists main objective is to "kill Python", am I wrong?
Re:Incrementally migrating over one million lines of code fr... by setr on Thursday February 07, 2019 @02:41AM (#19103696)
They can have whatever goals they wish, but regardless, having an ecosystem like .net or python requires a critical mass of users; and once you have that, the language goals don’t even matter; they’ll just have libraries for everything, whether they like it or not.
Re:Incrementally migrating over one million lines of code fr... by xiaodai on Wednesday February 06, 2019 @07:31PM (#19101780)
Sound advice. But i am sure it's fine to gp head first