Why Static Typing Came Back • Richard Feldman • GOTO 2022

preview_player
Показать описание
This presentation was recorded at GOTO Copenhagen 2022. #GOTOcon #GOTOcph

Richard Feldman - Functional Programming Language Expert & Author of “Elm in Action” @rtfeldman

RESOURCES

Richard

ABSTRACT
The 1990s birthed #Python, #Ruby, #PHP, and #JavaScript - dynamic programming languages that went on to be extremely popular. Today, each has a widely used static type-checker: #mypy, #Sorbet, #Hack, and #TypeScript. By #RedMonk rankings, the most popular languages released in the past 15 years have been TypeScript, Go, #Kotlin, #Swift, #Dart, and #Rust - all statically typed.

If a generation of popular dynamically typed languages grew out of dissatisfaction with 1990s-era statically typed languages, what changed? Is it a matter of fashion, and the pendulum will soon swing back to favoring dynamic again? Is gradual typing the future, because it promises the best of both worlds? If so, then why aren't Go, Kotlin, Swift, or Rust gradually typed? (Dart was originally, and later changed to static!)

Why has static typing made such a comeback in the past decade? And what does it mean for the future? This talk dives into all of these questions, and more! [...]

TIMECODES
00:00 Intro
01:00 Programming language rankings for Jan. 2022
02:04 What happened? - Outline
02:32 What made dynamic typing get big?
11:39 What changed?
38:22 What does this mean for the future?
49:36 Prediction
49:55 Summary
51:38 Outro

Download slides and read the full abstract here:

RECOMMENDED BOOKS

#StaticTyping #DynamicTyping #FunctionalProgramming #Roclang #Golang #Elmlang #Programming #ProgrammingLanguage #SoftwareEngineering #RichardFeldman

CHANNEL MEMBERSHIP BONUS
Join this channel to get early access to videos & other perks:

Looking for a unique learning experience?

SUBSCRIBE TO OUR CHANNEL - new videos posted almost daily.
Рекомендации по теме
Комментарии
Автор

Looking for books & other references mentioned in this video?
Check out the video description for all the links!

Want early access to videos & exclusive perks?

Question for you: What’s your biggest takeaway from this video? Let us know in the comments! ⬇

GOTO-
Автор

My personal problem with untyped languages is the following: If you get undocumented code (or the documentation is not up to date), you have no clue what the hell the code does. If functions with 3 parameters get called, and every parameter is some sort of list containing lists of lists of random stuff (looking at you, JS...), etc, you need hours and hours just to assert what the parameters should look like.

MarsCorporations
Автор

There's also the fact that static typing between application boundaries gives you statically-enforced contracts. As teams get bigger, this kind of contract enforcement becomes more valuable.

NXTangl
Автор

To be fair though, some of the problems with Java were actually dogmatic programming conventions rather than a requirement of the language or static typing.

jonnyso
Автор

@rtfeldman Have you seen Julia? It is a dynamically typed language (although with a design that uses type inference) that doesn't _require_ a runtime overhead. It also doesn't require runtime type checking, Julia _can_ do runtime type-checking if necessary, but it is not required, in fact most of the time we want to avoid that at all costs and only use it when needed.

inomo
Автор

This is a phenomenal breakdown and historical analysis - you helped me put together the some puzzle pieces that I've been trying to make sense of for years. Thank you for all of the work that you put into this talk.

ConnectionRefused
Автор

Here's something else that changed...

Web pages in the 90s were pretty simple by comparison to modern pages. And dynamically typed languages start to run into problems. Imagine your site is 1 million lines of code. It was written over a 10-year period by 20 developers. 15 of those people are long gone. And now you're looking at code you either haven't seen in eight years or may have never seen.

And static typing helps. A LOT. Function foo takes two arguments, and they are clearly defined. You don't have to guess. You know what it returns. You just KNOW. Furthermore, your compiler and your IDE know, too. You're not going to make stupid mistakes like use snake case instead of camel case. You're not going to use size when the function expects (or returns) count. You don't have to be an expert in function foo to at least use the right field names.

When your site is only 500 lines, that's just not a big deal, and that's what 1998 web sites were like. But that's no longer true.

The dynamically typed languages threw out the baby with the bath water. They did so because they were solving a different problem.

Statically typed forever, as far as I'm concerned, but I'm an old fart.

jplflyer
Автор

Now with Java record types and people dropping the stupid getter and setter nonsense, the Answer class implemented today is 1 line which includes equals and hashcode.

michaeljuliano
Автор

Static typing is a subcategory of static analysis. Being able to reason about you program without running it is priceless. You only need to write tests for things that you can't reason about statically
You only have bugs for stuff you can't check statically.
When you have a powerful type system, many problems can be reduced to a type check.
This is just the beginning, you have linters (that you can even write yourself) and DSLs, where you create mini languages that have the properties you are looking for.

The type system in C++ (and to some extent Java) was only there to help the compiler produce more efficient binaries it didn't care about correctness. It was functional languages like Haskell that pioneered using types for correctness.

FicoosBangaly
Автор

This hits a bunch of nails on the head that I had trouble identifying exactly. Really appreciate it. I have really enjoyed working with the newer statically typed languages, while the old ones (Java, C++) had many drawbacks, most of which you mentioned. The industry just went in a bad early direction. We can have a developer experience that is as good as Ruby with some statically typed languages now.

LoneIgadzra
Автор

Thanks, this is by far the best talk about dynamic and static typing ! Looking at the history and raison d'être of dynamic and static typing is a very good approach.

LouisSimonHoude
Автор

I really like "data oriented" typing, or the sort of gradual typing languages like Clojure/Script can take advantage of. I define a spec and from that I get automatic client side validation, server side validation, data transformation, and database schema generation.

bobbycrosby
Автор

I'm glad you ended up talking about it at around 33:24 because Delphi was indeed very fast across the board: the IDE was responsive even back then on the era's machines, compile time was very quick and compiled programs ran fast.

fredericbrown
Автор

I prototyped a vertical slice of a system in Python, and after much thought, made the move to Nim. Static type checking has ensured consistency and caught many an error in a system that is expanding in scope and complexity, but I've gotten this with almost NO ceremony. Refactors have become downright easy. I have some concise type definitions, and some helper functions which reach inside a variant type to grab dataframes and header types consistent across all variants; but the overwhelming majority of my code is business logic. It feels like Python, but with a compile step that catches issues. Nim also hates nulls and prefers stack allocation (going so far as to make dynamic types like objects/structs and sequences/hashmaps just "unique" pointers in the stack behind the scenes). Bonus points for static compilation with musl, which has made deployment trivially easy on just about any variant of Linux server.

nERVEcenter
Автор

23:49 it looks like the Roc `decode` function type annotation is incorrect, the function seems to return a `Result` type (`Ok`/`Err`) but is not annotated as such. Richard also skips past the ML language which was doing static typing with nearly zero ceremony using the same techniques that Roc does now, since the early 1970s 🙂
Re: considering build speed in language design–pioneered by Wirth in Pascal with its single-pass compiler. Turbo Pascal was famous for its build speed. Delphi is a Pascal variant.

yawaramin
Автор

One thing missing from the talk is any discussion about program size. For small programs, where a single programmer can understand the whole program, the extra error checking given by static typing isn't particularly helpful. If, however, you are working on a system consisting of millions of lines of code, developed by hundreds or thousands of programmers (e.g. a web browser), then you want as much error checking as possible as early as possible.

Another recent interesting change has been the move away from object orientation. I remember when, in the eighties, object orientation was the great new thing, yet now many new languages seem to have found good ways of providing most of the advantages of object orientation without the overheads.

anthonyberent
Автор

Seems like it was more of the heavy OO you had problems with rather than the static typing.

Don’t get me wrong, never been a fan of heavy OO, and I use static/dynamic languages depending on the task at hand, but most of the issues you bring up here seem to fall more with the obnoxious object model rather the typical model.

truefirstmagic
Автор

Great talk, and I agree with basically all of it. I almost thought gradual typing would be the future, but you convinced me otherwise with fantastic logic.

edsanville
Автор

I've been coding since 1975. I've known for about a half-century that static typing reduces debugging time because errors become apparent earlier in the debugging cycle. It's why static typing was invented. Almost every time I write something in Python, JS, Ruby, or PHP the excitement we felt that day rushes over me once again. Evidently the papyrus scrolls have been lost. I'm trying to remember who took the meeting notes but it was so long ago ...

michaelgfotiades
Автор

this talk needs to be given in strangeloop and the biggest clojure conference, take bodyguards with you

laughingvampire