News for hackers. Stuff that matters.
Re:Deno on MDN by toastal on Monday August 23, 2021 @10:47AM (#28276574)
> Types

There are so many better options if you want a good type system (Elm, PureScript, Rescript, GHCjs, Scala.js, and many more). TypeScript is unsound, and necessarily by it's design, it has to take on weird issues to maintain compatibility with JavaScript (null/undefined, can run effect anywhere, a lot of codebases are filled with any types). Heck, TypeScript doesn't even come with ADTs and proper pattern matching.

Re:Deno on MDN by sieve on Monday August 23, 2021 @11:26AM (#28277292)
> There are so many better options if you want a good type system

I am looking for basic type checking to prevent me from doing stupid things and catching bugs at "compiletime" instead of runtime.

Typescript interfaces with their structural typing do the job just fine.

I think people are underestimating the power of ecosystem. I use JS daily. Deno allows me to use it on the server as well without doing crazy things.

You have been able to do something similar in Java for a very long time with Mozilla Rhino (and now GraalJs) but without the same level of comfort and convenience.

Re:Deno on MDN by iaml on Monday August 23, 2021 @11:37AM (#28277481)
> TypeScript doesn't even come with ADTs

You still can use them [0].

> proper pattern matching

[1] is pretty good.

[0] https://itnext.io/practical-introduction-to-algebraic-dataty...

[1] https://github.com/gvergnaud/ts-pattern

Re:Deno on MDN by toastal on Monday August 23, 2021 @01:26PM (#28279183)
They need to be first-class. Not means the ergonomics aren't great and it won't be the developer default because it requires a library. It's not good enough considering how fundamental these two are in many languages (it's even in Java now)
Re:Deno on MDN by irq-1 on Monday August 23, 2021 @12:51PM (#28278687)
Similarly: https://www.assemblyscript.org/

> A TypeScript-like language for WebAssembly.

> AssemblyScript targets WebAssembly's feature set specifically, giving developers low-level control over their code.

> Being a variant of TypeScript makes it easy to compile to WebAssembly without learning a new language.

> Integrates with the existing Web ecosystem - no heavy toolchains to set up. Simply npm install it!

Re:Deno on MDN by shadofx on Monday August 23, 2021 @01:22PM (#28279128)
So TypeScript is designed for the internet, and languages with good type systems are not.
Re:Deno on MDN by nightpool on Monday August 23, 2021 @01:44PM (#28279423)
This has nothing to do with the GP's comment, which was about local scripting (replacing "shell scripts and Java")
Re:Deno on MDN by IshKebab on Monday August 23, 2021 @10:55AM (#28276728)
Typescript definitely has some flaws but it also has some really powerful features that aren't found in any other type systems, like the ones you listed.

And in any case I don't think anyone is really saying "Use Deno because it has static type annotations". It's "Use Deno because it has static type annotations and is fast and easy to deploy and has a huge ecosystem and doesn't require a project setup file to use third party libraries and ..."