Javascript is being superseded by Typescript

>Javascript is being superseded by Typescript
>more and more Python developers are using type annotations that were grudgingly approved by the language committee not too long ago
>Dart was launched as an unapologetically dynamic language (its creators even said they would never make it static). Just two years later, they bolted on a gradual typing system.
>and now, after years of obstinance, Matz has finally relented and agreed to include type annotations in Ruby
Is it truly the end for dynamically typed languages, or will the fashionistas in this industry reintroduce it in a fresh batch of meme languages 10 years from now?

Attached: sandboxing_cycle.png (544x589, 45K)

Other urls found in this thread:

en.wikipedia.org/wiki/Multiple_dispatch
vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/
twitter.com/NSFWRedditImage

>dynamic typing is dead

Thank GOD

Probably not, though I'd be glad if it was. TypeScript is definitely better than JS, even though Microshaft created it. I still hate both.

WebAssembly is the future. Of languages out there I want to succeed, I'd say D and Rust because they support real pointer arithmetic and are statically typed. C and C++ is fine too, but seems lots of faggots like to hate them so might need a fresh start.

Dynamic typing was born of an era where C++ faggots were saying real men don't use auto. It was an over-reaction to industry stubbornness.

In an era with smart IDEs / languages which automatically-type generics and local variables, the is no point in defaulting everything to a dynamic type, much less REQUIRING everything to be a dynamic type. It's just limiting.

>type annotations in Ruby
If you want Ruby with types, why not just use Crystal?

The fad now is actually optional typing. Picking and choosing where you want to use dynamic or static typing.

Because you can't use Ruby libraries from Crystal and the latter has no libraries. There are also non-trivial differences in syntax between the two.

The fuck is Typing?

This honestly. I think ocaml really does gradual typing very well and would rather have the flexibility of a gradual type system with good type inference.

No? The languages are still dynamically typed. Type annotations are just syntax sugar for putting this stuff at the top of every function:
if type(a) != string:
Throw TypeError()
if type(b) != int:
Throw TypeError()
# etc...

Dynamic typing was a giant mistake.

gradual typing is pretty comfy. would compilers and language servers of this current sophistication have been possible in the HW of the mid 90's or mid 00's?

Yes SML had this inferred typing with algebraic data types back in 80s. Haskell built on it, and Haskell is older than Java.

I love dynamic typing when I’m the only one touching the code, but as soon as anyone else gets involved I find that static typing can prevent headaches.
I suppose lots of the big companies feel this way, too, especially since they import so many poos.

Moving your fingers around the computer keyboard to generate sentences, equations, things like that

My B. what's old is new again.

no! type correctness is checked and enforced at compile time, idiot.

Isn't Python interpreted?

python type annotations are ignored by the interpreter altogether and have no effect on the program, not even what suggested. they only server documentation purposes for now.

Yes, but there exist static analysis tools like mypy and jedi that can catch type errors during development. VS Code integrates with mypy very nicely to flag erroneous code (e.g. missing methods, incorrect call signatures, variable assignments of the wrong type).

Yeah, who would have thought that actually knowing what kind of parameters/objects you're working with during development time is beneficial, huh? Nah, breh I would rather have 20+ lines of code in every function to check if the parameter is of a certain type or has a certain property.

Unless
en.wikipedia.org/wiki/Multiple_dispatch reborn as solution to generic meta programming, type language, algebraic types and High Kind type will become normal in programming.

Dynamic typing was born before 2011, or even C++ (eg. Lisp). Furthermore, auto is not dynamic typing, it’s type inference. OCaml also does type inference, but its type system is clearly not dynamic.

Setting the type of variable. Static typing means variables have their type declared when intialzed. Dynamic typed variables are never declared and the type of variable can change.

A language's type system being so disgusting that you require type inference to hide it is hardly better than dynamic typing itself.

Don't forget PHP and GDScript.
Now the next step is this vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/

You're right, OP, I'm waiting for my fully type checked Perl clone right now...

Languages are specifications not implementations. Being interpreted, compiled, or JIT compiled is a detail of an implementation of the language. And in Python’s case, there are all three: CPython is interpreted, PyPy is JIT compiled, and Cython in compiled.

No, it’s a sign of a sophisticated type system which can figure out most of the types on its own without you needing to baby sit it and declare all of them yourself.

is there math that fixes picrel

does anybody actually like dynamic typing
like i can think of all sorts of downsides and the only upside is saving a few keystrokes for data where the type doesn't matter or is obvious

Wake me up when Python finally catches up to PHP and enforces type hints at runtime.

>Javascript is being superseded by Typescript
I'll need a source for that.

All interpreted languages are by definition dynamically typed. Static typing only makes sense for compiled languages, where type information is lost in the compile binary; an int 0 is the same as a uint 0 once compiled.

You can have static type checkers for interpreted languages, but when the code is being interpreted it is dynamically typed by definition.

There is no such thing as a "compiled language" or "interpreted language". Compilers and interpreters are implementation strategies. You are confused because typically the design of a language means that one strategy is much more efficient than the other, and nearly everybody implementing the language chooses the more efficient strategy. But there's nothing stopping you from writing an interpreter for Haskell, which is very clearly a statically typed language.

On the other hand, Java and other static strong-type languages now have var/val so they can hang with the dynamic type gang too, Fucking everything is the same.

>Javascript is being superseded by Typescript
you wish

But if you interpret it, it becomes dynamically typed (unless you implement it as a JIT, in which case you're just compiling it). Static typing has implications for how values get stored in memory.

are webdevs not aware of the existence of statically typed languages? why are they making static variants of dynamic languages?

youve heard of stereotyping? typing is the same but not stereo. most people think typing is mono, but in fact you can do it with three or four speakers or more. it all depends on how many outputs your distro has.

But they work by type inference rather than lol nothing has a definite type, so tools don't automatically become useless when dealing with them.

>everyhting covered in C++11 happened in 2011
I can almost excuse your ignorance for how long C++0x was pushed back ad infinitum while it was nonetheless being widely used because people were tired of C++'s bullshit. Except you're trying to come off as more-informed historical analysis while completely missing the point and context of this shit.

>Except you're trying to come off as more-informed historical analysis while completely missing the point and context of this shit.
If you’re saying something so blatantly wrong, don’t get angry when people don’t undestand you.

>enforces type hints at runtime.

>All interpreted languages are by definition dynamically typed.

Which is why it only takes a kid sending a string instead of an integer to niggr.io's server to crash it.

It's decent if you want a quick script. If it's simple enough, you shouldn't run into too many problems. For production size code, you're fucked.

That's not how HTTP works.

How do you know I'm wrong if you don't understand me? Checkmate.

But it's cute how you try to piece together history through dates you find on wikipedia. Yeah, that thing that people were doing in academic circles a decade before anyone cared sure is indicative of the industry mood at the time.

If you're already using a dynamically typed language, giving it strong types might be easier than changing languages. And replacing JavaScript on the front-end is easier said than done.

>The fuck is Typing?
throw an error if types of data are incompatible. static typing means that types checked at compile time, dynamic typing means that types are checked at run time at additional overhead cost.

>Static typing has implications for how values get stored in memory.
Wrong again. Representation of values in memory is a property of an implementation. Static typing is a property of a language: it means the language spec defines a predicate on programs called "well-typedness", and requires conforming implementations to reject programs that are not "well-typed".

not the guy you talked to, but you are not suggesting that language features have no impact on the limits of an implementation in terms of efficiency, right? Because that's what I think he means, the way I read it.

Attached: 1554927180261.png (890x661, 166K)

See :
>typically the design of a language means that one strategy is much more efficient than the other

I don't think that's what the other guy is talking about when he says things like
>if you interpret it, it becomes dynamically typed
He's using "dynamically typed" to mean that the implementation stores type tags on all values and branches on them at run time. That's not how the term is usually defined, and following that definition produces nonsensical results, like declaring Haskell to be a dynamically typed language (GHC's runtime system stores type tags on all values and branches on them when it does pattern matching).

>He's using "dynamically typed" to mean that the implementation stores type tags on all values and branches on them at run time.
Mind you, that's not even true for all interpreters.

ah, I see what you mean. Never mind then.

fuck, that is even more confusing

Attached: 1541031480386.jpg (720x480, 33K)

>send data as a GET
>change one of the numbers to "your dad fucked your mom"
>server's dynamic content engine is python and calls a function
>combination of dynamic typecasting and programmers' laziness causes a runtime error that kills the engine
>server can't serve

>send data as a GET
>change one of the numbers to "your dad fucked your mom"
>improper use of atoi leads to a buffer overflow and ARCE

> Coupling your codebase to an IDE

Attached: 1408777838431.jpg (360x318, 21K)