News for hackers. Stuff that matters.
Re:Deno will stop using TypeScript by echelon on Sunday June 21, 2020 @11:38AM (#23592581)
Why such a large, important project would want to drop static types is beyond me.

> TypeScript isn’t proving itself helpful to organize Deno code. On the contrary, the Deno team is experiencing the opposite effect. One of the issues mentioned is that they ended up with duplicate independent Body classes in two locations

This feels like process immaturity or unfamiliarity. Thousands of other projects manage to do just fine.

These folks are free to do what they want with their project, but this is not a good look, especially to those that are skeptical of the javascript ecosystem.

Re:Deno will stop using TypeScript by vimslayer on Sunday June 21, 2020 @11:45AM (#23592622)
Most of the project is and will still be written in Rust, a statically typed language, so saying that the "project" will drop static types is an overstatement. Based on the design document where the devs talk about this, the TS code in question is about 10k lines of glue code between Rust & userland JS/TS.
Re:Deno will stop using TypeScript by jsf01 on Sunday June 21, 2020 @11:58AM (#23592735)
If it’s only 10k lines of glue code how are they running into minutes long compiles?
Re:Deno will stop using TypeScript by pfraze on Sunday June 21, 2020 @12:20PM (#23592922)
Presumably that's what the Deno team is wondering
Re:Deno will stop using TypeScript by cjhopman on Sunday June 21, 2020 @03:29PM (#23594652)
Haven't looked at their build, but it's almost certainly the case that they are generating some sort of rust binding from the typescript code and the compilation times are actually from needing to recompile rust.
Re:Deno will stop using TypeScript by chmln on Sunday June 21, 2020 @12:21PM (#23592927)
10K is a lot of code.

As a maintainer of a popular 3k LOC typescript library, even at 1k LOC you start running into frequent type-related bugs with JavaScript

Re:Deno will stop using TypeScript by kiliancs on Sunday June 21, 2020 @01:39PM (#23593651)
Working on half a million LOC TypeScript codebase. All strict flags up, low-2-digit team size. We don't really run into many problems. TypeScript is not perfect, but developer happiness and productivity have definitely increased since we adopted it, and defect rates have dropped significantly --while increasing the size of the team & working on more features.
Re:Deno will stop using TypeScript by yawboakye on Sunday June 21, 2020 @01:45PM (#23593702)
Think of the change as a statically compiled language writing parts of their runtime with assembly or unsafe pointers. It’s not an indictment of TypeScript.
Re:Deno will stop using TypeScript by kiliancs on Sunday June 21, 2020 @01:55PM (#23593782)
My first impression of the reasons in the design doc is that the change is not well justified, but I also see the point you make; my response, though, was to the direct parent comment.
Re:Deno will stop using TypeScript by thegreatpeter on Sunday June 21, 2020 @03:18PM (#23594569)
I have a hard time believing that. We have 10k lines of typescript and that take forever to compile compared to 5x more of the ReasonML code we have that compiles instantly
Re:Deno will stop using TypeScript by petersellers on Sunday June 21, 2020 @03:28PM (#23594646)
You have a hard time believing that their team experienced more happiness and productivity with TS...because your ReasonML code compiles a lot faster than your TS code?
Re:Deno will stop using TypeScript by kohtatsu on Sunday June 21, 2020 @03:43PM (#23594764)
I've actually been (very) wary of adopting TypeScript once I learned of the multi-second compile times, even for tiny projects.

I had actually been watching Deno in case they solved any of that.

Re:Deno will stop using TypeScript by goostavos on Sunday June 21, 2020 @06:07PM (#23595791)
They become really frustrating as the project grows in size. Personally, it becomes really difficult to maintain productivity. As compile times tick up, I start bouncing over to other tabs rather than just twiddling my thumbs starring at a terminal. Then I realize I've been on Reddit for a half-hour.

I recently watched this talk by Johnathan Blow[0] where he talks about quality of life in programming languages and spends a fair amount of time talking about compile times and their effects.

I think we collectively need to re-align on being performance focused. Tools are simultaneously amazing but crummy at the same time.

[0] https://www.youtube.com/watch?v=uZgbKrDEzAs&t=2s

Re:Deno will stop using TypeScript by kiliancs on Sunday June 21, 2020 @08:53PM (#23596558)
I don't love the compile times, but I'll also say with TypeScript I tend to check the browser that often. TS also means simpler refactoring, for example.

Note also: * type checks can run in parallel, so they won't block your other build block * the tsc has been making gradual improvements to performance and techniques to improve compilation and type checking * there are speedy alternatives to the TypeScript compiler (tsc) (eg: https://sucrase.io) for transpilation

Re:Deno will stop using TypeScript by ithrow on Sunday June 21, 2020 @05:43PM (#23595662)
Much faster compiles times sounds like a good reason to me ;)
Re:Deno will stop using TypeScript by kiliancs on Sunday June 21, 2020 @04:14PM (#23595030)
I wasn't comparing to ReasonML, which I'm convinced is a very good choice.
Re:Deno will stop using TypeScript by kybernetikos on Sunday June 21, 2020 @01:24PM (#23593501)
I've worked on javascript codebases pushing half a million lines of code, and my memory is that we didn't run into type bugs all that often. The biggest downside was the lack of automated refactoring tools - this was many years ago now.

It did take quite a bit of discipline, but with a skilled team it really wasn't all that hard.

Re:Deno will stop using TypeScript by Yoric on Sunday June 21, 2020 @01:29PM (#23593552)
If your memory is good, I'm impressed.

> It did take quite a bit of discipline, but with a skilled team it really wasn't all that hard.

Out of curiosity, what was the turnover within the team? My personal experience is that static typing helps a lot when you're new to a codebase. Probably less so when everybody can recite the architecture in their sleep.

Re:Deno will stop using TypeScript by kybernetikos on Sunday June 21, 2020 @01:51PM (#23593754)
The turnover didn't start increasing until the 'javascript ecosystem' developed, and suddenly everyone wished that they were following the new community developed practices rather than the ones we'd be following for years. That lead to lots of factionalism within the team and a lot of unhappiness on all sides.
Re:Deno will stop using TypeScript by yawaramin on Sunday June 21, 2020 @04:08PM (#23594986)
> The biggest downside was the lack of automated refactoring tools

That's what a typechecker gives you–an automated enforcement mechanism for ruling out certain errors during refactoring.

Re:Deno will stop using TypeScript by subaru_shoe on Sunday June 21, 2020 @12:44PM (#23593130)
10k is a lot of code? No way that is a lot of code or at least it’s not a lot for senior devs.
Re:Deno will stop using TypeScript by timkam on Sunday June 21, 2020 @12:58PM (#23593281)
This certainly depends on what the code does and on the use case, i.e. on how critical reliability and performance are. 10k code in a simple web application prototype that will be trashed in 3 months is not "a lot", because it's not critical and piling up technical dept is not a problem. 10k code to specify the core algorithms in a mission-critical, long-living system is "a lot", or at least "much more", because it needs to be crafted and maintained with immense care.
Re:Deno will stop using TypeScript by jlg23 on Sunday June 21, 2020 @01:23PM (#23593491)
Unless one is paid in LOC I'd expect a senior dev to write less code than a novice...
Re:Deno will stop using TypeScript by recursive on Sunday June 21, 2020 @12:53PM (#23593226)
It's enough to benefit from types, assuming no large swathes of inline literals.
Re:Deno will stop using TypeScript by Dork1234 on Sunday June 21, 2020 @01:18PM (#23593440)
As someone who has maintained multiple legacy projects, 10k is not a lot of code. I normally run into single files in the 10k range, if it wasn't for NP++ and VSCode I would go insane just trying to scroll.
Re:Deno will stop using TypeScript by tigershark on Sunday June 21, 2020 @01:20PM (#23593463)
No, it’s not. 10k loc is a small project.
Re:Deno will stop using TypeScript by herogreen on Sunday June 21, 2020 @01:39PM (#23593647)
If compilation times are a problem with typescript I do not see how Rust will help.
Re:Deno will stop using TypeScript by darksaints on Sunday June 21, 2020 @01:47PM (#23593724)
Maybe that means it is not as bad as it sounds, but if it's true it makes no sense to me. How could you possibly have minutes of compile time on so few lines of code? The typescript compiler isn't that slow.

I've witnessed teams that have switched from static typing to dynamic typing before, due to complaints about compile times and a lack of ability. It doesn't take long before their testkit balloons and they spend 10x the time on testing, dwarfing any savings they made by eliminating compilation. Or worse, the code turns into something magical but untouchable, lest something break...eliminating the ability that they imagined they would get.

Re:Deno will stop using TypeScript by stefan_ on Sunday June 21, 2020 @12:09PM (#23592818)
Why is anyone in the world manually writing 10k lines of glue code? You don't need TS or JS, you need.. a computer.
Re:Deno will stop using TypeScript by jtdev on Sunday June 21, 2020 @12:11PM (#23592834)
Please, elaborate.
Re:Deno will stop using TypeScript by tzs on Sunday June 21, 2020 @12:47PM (#23593154)
I would guess that he means that when you have a lot of glue code it tends to be repetitive and so writing tools to write the glue code can be a win. Let's say you have implemented a service that exposes API X to its users, and let's say you have an internal service that provides the actual functionality you are trying to expose but uses API Y. Hence you need glue code that translates between X and Y.

There might be hundreds of API calls in X but the glue code is all going to be of the same general form: translate the X parameters to corresponding Y parameters, call the matching Y function, and then translate results back.

Within all these glue functions there will be a lot of common actions. X calls with integer parameters for instance might pass them as ASCII strings and Y might expect integers as 64-bit big-endian binary.

In this situation there is a good chance you can make a table that lists each X call, the types of its arguments and results, the Y call to map it to, and some flags to indicate that some things need special handling and what those are.

You can then have a program, probably a fairly short and straightforward program, that reads that table and writes out the glue code for you, sticking in comments marking places where you need to edit it to deal with those places marked as needing special handling.

Re:Deno will stop using TypeScript by andybak on Sunday June 21, 2020 @12:31PM (#23593015)
I suspect there might be more than one definition of "glue code" at play here.
Re:Deno will stop using TypeScript by BoorishBears on Sunday June 21, 2020 @01:33PM (#23593588)
Codegen?
Re:Deno will stop using TypeScript by kevsim on Sunday June 21, 2020 @12:12PM (#23592843)
Yeah, I tend to agree. After 18 months with TypeScript, I can't really imagine going away from it. After every single refactoring I do, I'm extremely grateful for proper typing. Not to mention sugar like null coalescing, etc.
Re:Deno will stop using TypeScript by IBCNU on Sunday June 21, 2020 @12:35PM (#23593056)
null coalescing is good, but I personally found that Typescript doesn't offer many advantages on a large team. I know it's not cool these days! But it just slows me down and if you're reasoning about functions I never run into that many production level issues with types, but maybe that's just my brain I dunno!
Re:Deno will stop using TypeScript by kevsim on Sunday June 21, 2020 @01:17PM (#23593428)
What is it about a large team that causes it to stop offering an advantage? If anything I’d expect it to be more useful as a code base grows in complexity
Re:Deno will stop using TypeScript by hellisothers on Sunday June 21, 2020 @01:31PM (#23593577)
Agreed, as the team gets larger and an given individual doesn’t necessarily know how everything works from memory the need to rely on the compiler and type safety should grow.
Re:Deno will stop using TypeScript by IBCNU on Monday June 22, 2020 @04:16PM (#23605889)
I guess it tends to be superseded by other forms of rot, people writing a bunch of tests that aren't against the critical path, money going down the drain... I agree, it _seems_ like what you say is true. I'm not a computer scientist, I'm just saying I've tried TS at a couple of shops, and as they team grows TS slows us down. Maybe it's just stochastic or random, but at the end of the day there's no academic "proof" types improve developer productivity. The only thing that sort of gets me is how everyone sort of assumes TS is 'best practice' but there's really no evidence besides gut feeling. My gut feeling is now telling me TS is not beneficial... I'd love to play devils advocate against my own position so feel free to tear me apart...
Re:Deno will stop using TypeScript by JamesBarney on Sunday June 21, 2020 @04:44PM (#23595257)
I consistently find types just so useful I don't know how anyone works without them.

Things like when this system was built all the code assumed social security could not be null. We now need to make the system able to handle a null social security system. What code do I change?

Do I need to null check the results of this value?

What does this function return and how can I be sure I'm handling all use cases?

Re:Deno will stop using TypeScript by mimixco on Sunday June 21, 2020 @11:41AM (#23592596)
Lisp is large, important, and also not statically typed. It's worked out ok for Lisp programmers. JS itself isn't strongly typed and is the most successful and important language in the world (probably in the history of programming), so that's two game-changers that don't require static typing.
Re:Deno will stop using TypeScript by foepys on Sunday June 21, 2020 @11:50AM (#23592669)
JavaScript is the most popular language solely because it's the only one that runs in webbrowsers natively. The language itself is not good, it's rather bad from a language designer's point of view.
Re:Deno will stop using TypeScript by BiteCode_dev on Sunday June 21, 2020 @12:04PM (#23592777)
Lisp is not popular.

Remove the browser practical monopoly, and JS popularity would vanish.

Re:Deno will stop using TypeScript by pfraze on Sunday June 21, 2020 @12:22PM (#23592943)
Browser monopoly led lots of devs to learn JS, then NodeJS showed that lots of devs want to keep using JS. It's actually possible for people to like it.

Also, languages are always a function of their ecosystems. You could argue, remove Apple products and Swift/ObjC would vanish.

Re:Deno will stop using TypeScript by NicoJuicy on Sunday June 21, 2020 @12:41PM (#23593111)
Nodejs showed that a lot of developers are lazy and want 1 language to learn
Re:Deno will stop using TypeScript by yawaramin on Sunday June 21, 2020 @04:15PM (#23595039)
Not developers; businesses. What do you think a business would prefer: hiring cheap ubiquitous JS devs and using them interchangeably for frontend and backend work, or hiring/training devs separately for backend stacks like Java?
Re:Deno will stop using TypeScript by vorpalhex on Sunday June 21, 2020 @12:54PM (#23593242)
Certainly you didn't go through the entire pro con list of Node over other languages and go "it must be developer laziness!"

Easy to reason about, great performance for most cases, simple to debug and write code for, a plethora of libraries, easy to ship, no need to have different teams for backend/frontend, and minimal tooling needed.

Re:Deno will stop using TypeScript by kbenson on Sunday June 21, 2020 @01:06PM (#23593361)
The only really unique thing JS is bringing to the table is that it also has a privileged position in the front end. Your list of benefits it provides boils down to stuff multiple large languages all have, and the one thing that means you can learn just JS.

GP comment was presented somewhat snarkily, but I'm not sure they're all that wrong.

Re:Deno will stop using TypeScript by hombre_fatal on Sunday June 21, 2020 @03:38PM (#23594731)
Yikes to see people assume so little about others. Why not ask people why they use Node instead of assuming the worst about them?

You don't think JS is obviously unique for its ubiquitous Promise, async/await, + async-everything abstraction. You tend to only get that in other languages (Rust, Python, Ruby) by limiting yourself to a fraction of the ecosystem.

Btw, what's lazy is making convenient uncharitable assumptions about others than just... asking.

This forum is full of people who could tell you why they still use JS after they analyze pros/cons of other languages.

Re:Deno will stop using TypeScript by kbenson on Sunday June 21, 2020 @05:15PM (#23595475)
I'm not entirely sure what you think I was saying. You refer to me assuming and being uncharitable in those assumptions, but I was responding to a specific list of items pointed out, and my own experience. I think you're actually assuming quite a bit about my comment.

> You don't think JS is obviously unique for its ubiquitous Promise, async/await, + async-everything abstraction. You tend to only get that in other languages (Rust, Python, Ruby) by limiting yourself to a fraction of the ecosystem.

A fraction like nodejs or whatever subset of NPM you decide to use?

Core JS is what you get in a browser. That includes async/await, but it's hardly ubiquitous in usage in the core.

The main distinction JS has over Perl, Python, Ruby etc is that it's in the browser, so you can assume almost everyone has it and it's accessible in some manner if they access a web property you are responsible for.

Re:Deno will stop using TypeScript by NicoJuicy on Sunday June 21, 2020 @04:02PM (#23594931)
I believe people here don't belong to the situation I mentioned.

You are here because you are interested and want to learn. You probably know more than 1 language.

But that is not the general developer. Most developers are lazy and at the end of the day, want to go back to their wife and kids ( for example).

Re:Deno will stop using TypeScript by yawaramin on Sunday June 21, 2020 @11:34PM (#23597167)
Yeah, and there's absolutely nothing wrong with that. It's the sign of a healthy work-life balance.

The real problem is that businesses don't want to train devs in the right tools for the jobs at hand, and are instead looking for the shortcut that will let them 'ship it'.

Re:Deno will stop using TypeScript by NicoJuicy on Monday June 22, 2020 @02:34AM (#23597781)
> Yeah, and there's absolutely nothing wrong with that. It's the sign of a healthy work-life balance.

I agree, never claimed otherwise.

Re:Deno will stop using TypeScript by vorpalhex on Sunday June 21, 2020 @01:40PM (#23593655)
Sure other languages have some pieces of the puzzle - python has tons of libraries and is easy to understand, golang has great performance and is easy to write, etc.

But I have yet to find a language that has the same set of features except JS. If you want to offer up an alternative, please do so.

Re:Deno will stop using TypeScript by BiteCode_dev on Sunday June 21, 2020 @02:01PM (#23593840)
JS has zero unique set of feature.

There is not a single feature in JS you can't find elsewhere, often better implemented.

If anything, the vast majority of scripting languages (Python, Ruby, PHP...) have more features than JS.

JS is so lacking in features that half of its ecosystem is dedicated to compensate for that (typescript, babel, webpack, undersacore...).

Re:Deno will stop using TypeScript by vorpalhex on Sunday June 21, 2020 @02:26PM (#23594075)
Sure and julia has the best matrices, python has the most flexible threading models, erlang has the best distributed runtime..

Yet one feature does not a language make. A language is the whole of it's behavior, and JS is a perfectly fine solution with a wide mix of good features.

Is it the fastest? No. The most performant? Not close. Does it have the best ability to write language parsers? No!

But it's not supposed to. It's a general purpose language that's well suited for a wide swath of cases.

Most languages have transpilers and utility libraries - and those are useful tools but also not meant to be part of a language. Even python has dozens of compilation tools depending on how you intend to distribute your code.

It's the mark of a poor intelligence that buys on pros only without considering cons. We must weigh not only our features but how well the average engineer can use it, how quickly we can produce features and how safe our code is, and how easily we can actually hire and train engineers.

JS is one of the most popular languages in the world. My 10 year old nephew can write it and do a decent job of it.

Re:Deno will stop using TypeScript by kbenson on Sunday June 21, 2020 @02:36PM (#23594162)
You're missing the point here, which is not that each of these languages has something JS does, it's that Perl, Python, Ruby etc all support all the same features, have large ecosystems of modules, are easy to use, etc.

JS is a fine language. It doesn't really bring anything new/different to the table (other than prototype inheritance, but that doesn't amount to much IMO), so the real differentiating factor is that it has a privileged position because of browsers.

Re:Deno will stop using TypeScript by hombre_fatal on Sunday June 21, 2020 @03:36PM (#23594719)
JS has a great future: first class ubiquitous promise + async-everything. Can't find that in Ruby/Python/PHP, you have to use something like Twisted/asyncio which limits you to a bolted on subset of the ecosystem, unlike in JS.

Very dishonest take btw.

Here's a forum of people who could tell you why they use JS instead of your $favelang, yet instead of trying to figure it out, you just assume everyone is lazy or a junior dev except for you.

You should be a little more suspicious of convenient little truths like that where you're the cool elite engineer protagonist and everyone else is a bumbling idiot.

I use JS on the server. Any questions for me?

Re:Deno will stop using TypeScript by BiteCode_dev on Sunday June 21, 2020 @04:31PM (#23595151)
Go and Erlang (or Elixir) both have a better async model, and are pretty much better designed on all points.

So for the rare cases where async does matter (and they are a niche, given even big names like facebook code behind async proxy and do long polling), there are still little reason to choose JS.

I can't think of a single mission where, if I were not being forced to use it, I would chose it over something else. And I say that while coding a LOT of JS all year long. Even training people regularly in the language.

I double down on my initial statement, if tomorrow JS is removed from the browser, it would die in a few years.

It's a badly designed language that has been accumulated fixes over the years to make it acceptable while never removing what's bad. It was so initially bad that half the ecosystem of JS exists to not code in JS (typescript, coffeescript, babel, jsx, webpack...).

And it has received that much of attention because we had no choice. Google spent millions to make a technical marvel of a JIT to run it at decent speed.

Any tech that would have had half the resources poured into it would today be the incarnation of skynet.

It's a language surviving on artificial life support than can do so because it has the best blackmail game of all time.

Re:Deno will stop using TypeScript by toohotatopic on Sunday June 21, 2020 @05:22PM (#23595527)
>Any tech that would have had half the resources poured into it would today be the incarnation of skynet.

Java?

Re:Deno will stop using TypeScript by BiteCode_dev on Monday June 22, 2020 @05:03AM (#23598435)
Good example.

The JVM is one of the most amazing piece of tech ever created. It's so good it supports not only what has been most the popular language in the world for years, but many newly popular languages like Kotlin or Closure. The perf have been optimized so much they are getting about 70% of C/C++, but with high level paradigms. It can pretty much do everything.

In fact, it runs on everything. It used to run on old school nokia phones. It runs on some credit cards! Despite being slowed down by patent trolling, Java found its way to more than half the modern mobile phones in the world throught Dalvik reimplementation.

It's everywhere.

Today, it is still ranking #2 on TIOBE and PYPL, despite having to leave with 2 decades of legacy design decisions and no monopoly.

Re:Deno will stop using TypeScript by NicoJuicy on Sunday June 21, 2020 @04:10PM (#23595000)
No, I'm experienced with node and other programming languages. I never said NodeJS is a bad language, that is not related to the statement i made.

I also didn't say everyone is lazy. I said a lot of developers.

Most people here do not belong to that use-case. As they are mostly here by interest and are willing to learn.

But most people, after work, don't do anything with their knowledge.

And are more willing to learn node as it's the same on the backend + frontend.

Or keep using what they already know, with no interest for other languages.

Re:Deno will stop using TypeScript by eitland on Sunday June 21, 2020 @02:14PM (#23593960)
> Easy to reason about,

I'd like to know what language you use as a baseline for this?

I made my first "real" Javascript code back in 2005 (a vector map system that worked in realtime) and I've been working mostly with frontend for the last 3 years so it is not lack of familiarity. In between that however I have programmed a lot of other languages, worked in a number of different teams, written new code, maintained old code and generally gotten some perspective on life.

That perspective has sent Javascript down my list of languages that are easy to reason about.

Re:Deno will stop using TypeScript by vorpalhex on Sunday June 21, 2020 @02:31PM (#23594118)
Event threading pulls out a huge amount of difficulty with semaphores, locks, thread safety, etc.

The lack of OO means no typecasting, inheritance models, interfaces, etc.

Arrays are fully dynamic, not type restricted and operate strictly by reference.

No memory mapping, manual garbage collection or even GC adjustments.

Suddenly the list of things someone has to understand to be a competent JS engineer is way smaller than a language like C or Java.

There are other languages that have a similar level of being easy to understand such as Python and Ruby, and they're good languages too but have a different set of tradeoffs.

Re:Deno will stop using TypeScript by eitland on Sunday June 21, 2020 @03:13PM (#23594527)
Have my upvote for the serious answer. Let's just say we have different opinions.

Here's my attempt to create something similar from my perspective:

- Being able to know to at any point what a variable can contain is very liberating. (Ok, you can define a list of Object that behaves just like a list in JS: "fully dynamic, not type restricted", but thankfully for people like me that is not common in Java anymore.)

- Knowing that the compiler has my back allows me to work faster.

- My preferred languages (Java, C#, TypeScript) together with version control allows me to refactor fearlessly.

Re:Deno will stop using TypeScript by vorpalhex on Monday June 22, 2020 @09:59AM (#23600250)
It's a tradeoff. Dynamic isn't "better" than typesafety, but it's generally easier to comprehend and reason about. Just yesterday, I was working on a C# script and encountered the following problem:

+ An engineer had written a script with a Dictionary of type <Transform, Material>. If you've touched Unity, you immediately caught the flaw: Transform's aren't unique enough keys and it's really easy to end up trying to add Duplicate keys, even though you really mean different objects.

+ So, since we don't care about uniqueness, shift from a Dictionary to a List. Except we have a problem, because we need to keep that Key->Value relation so we know what transforms get what materials. Well, we have a solution to that, it's yet-another-type called a KeyValuePair.

+ Well we're now nesting a generic KeyValuePair that needs type information inside of a list that is holding <KeyValuePair> objects, which also changes how we iterate through that list and add items to it.

+ In a language like JS, everything I just said doesn't matter at all because instead of using a Dictionary (Map in JS), we would of just said "Use a Set instead". Done.

Re:Deno will stop using TypeScript by BiteCode_dev on Sunday June 21, 2020 @01:59PM (#23593812)
> It's actually possible for people to like it.

If they started using PHP, without monopoly, they would not have switched to JS.

But plenty of people have switched from PHP to python or ruby.

> Also, languages are always a function of their ecosystems. You could argue, remove Apple products and Swift/ObjC would vanish.

Python, C and Java are not.

Re:Deno will stop using TypeScript by searchableguy on Sunday June 21, 2020 @12:36PM (#23593070)
I disagree on the current sentiment but agree that browser monopoly pushed js on people. If js didn't evolve over the last few years (since es5), I would have believed removing it from the browser would kill it.

Right now, you have options to avoid writing js at all. There might be some glue code in js but you can write vast majority of your code in other languages and target js. People still choose to write in js.

Purescript, elm, clojurescript, kotlin, bucklescript, and the list goes on. There is a to-js transpiler for every popular language. Why aren't they seeing more usage?

Re:Deno will stop using TypeScript by BiteCode_dev on Sunday June 21, 2020 @02:04PM (#23593861)
> Purescript, elm, clojurescript, kotlin, bucklescript, and the list goes on. There is a to-js transpiler for every popular language. Why aren't they seeing more usage?

Because a layer of indirection is a heavy price to pay.

If I could code in Python with zero cost in the browser, I would. Hell, I would code in Lua, Lisp or Ruby if that was the alternative.

Re:Deno will stop using TypeScript by CodeShmode on Sunday June 21, 2020 @01:42PM (#23593668)
Because for ecosystem and tooling JavaScript is the first class citizen. TypeScript was accepted as the defacto static typing system because it diverges so little, and valid JS is valid TS meaning example code can still be used close to verbatim.
Re:Deno will stop using TypeScript by shirshak55 on Sunday June 21, 2020 @01:00PM (#23593302)
tbh JS is popular only because of browser monopoly. JS became popular because of internet usage otherwise it would just die. It started with 1997 changed little at 1998 and 4th edition was even abandoned lol. and it took so long to evolve after that. in 2019 there was update and from 2015 we are seeing good progress. no we still cannot avoid because browser needs it. Hopefully wasm can replace but it still has long way to go.

So i don't subscribe to idea that js is not popular because of browser monopoly.

Re:Deno will stop using TypeScript by searchableguy on Sunday June 21, 2020 @01:01PM (#23593311)
I am not disagreeing with that?
Re:Deno will stop using TypeScript by efficax on Sunday June 21, 2020 @11:43AM (#23592608)
there's plenty of huge software projects in dynamically typed languages.

There are also huge classes of bugs that exist in these projects that a statically typed language completely eliminates!

If they're running into trouble from having to have types, it's almost certainly design and architecture issue and does not make me think that deno is going to be a solid project.

Re:Deno will stop using TypeScript by snarfy on Sunday June 21, 2020 @11:57AM (#23592727)
For dynamically typed languages, the idea is you make up for that class of bugs by incorporating TDD and having lots and lots of unit tests.

So, instead of waiting a minute for the typescript compiler, you wait for the engineer to write tests.

Re:Deno will stop using TypeScript by waheoo on Sunday June 21, 2020 @09:32PM (#23596726)
If youre doing tdd or writing tests like this you have bigger problems.

Type safety is easy in a dynamic language. Stop mutating variables and stop mixing types. Suddenly that whole class of errors evaporates. No need to test things that are impossible.

And for those times you want some magic in your life, nothing is stopping you, no need for generics, just proceed with caution and test accordingly.

Re:Deno will stop using TypeScript by gameswithgo on Sunday June 21, 2020 @12:50PM (#23593198)
and you wait a minute for the tests to run every time you commit a change
Re:Deno will stop using TypeScript by dboreham on Sunday June 21, 2020 @01:05PM (#23593344)
You could arrange to have a program write those tests for you based on your description of the project's data model. Oh wait...
Re:Deno will stop using TypeScript by kybernetikos on Sunday June 21, 2020 @01:33PM (#23593591)
You know what, that would already be better than most type systems.

Firstly, they'd be written in the same language that you are coding in, not a weird, half baked type language, that adds visual noise to your code.

Secondly, they'd have much more power to define meaningful and useful behaviour rather than being restricted to talk about correct behaviour via types.

Thirdly, they'd run when you wanted the tests to run, and you could tier different tests to run at different times, so they aren't all slowing you down while you're doing fast iteration.

I used to like types, but then I realised that what matters is how quickly you see the bug. Seeing it in your code editor is brilliant, but if it's slower in time than hitting control S and seeing the actual app in the other pane auto reload, and fail or not, then it's worse.

These days I look on the idea that you know the exact types of all data your program will interact with at the time you write your code as the same sort of mistake that we made when we thought we understood the deep inheritance hierarchies of the real world.

Re:Deno will stop using TypeScript by goostavos on Sunday June 21, 2020 @06:30PM (#23595894)
That's an interesting take. To some degree, I think I agreeing with you.

I write a lot of Purescript and a lot of Clojure. Purescript, being basically a Haskell variant, is about closing down every last little part of the system into types. You _do_ pick up a lot of visual noise for this (like `liftEffect` ugh...). Whereas Clojure, is the polar opposite. It's about keeping the system open, using large chunks of data, and having functions take/change what they need and pass along everything else none-the-wiser to what's present.

Bouncing back and forth between these two worlds, I think I've begun to lean towards the opinion that I really only care about strict types at the boundaries of my program and certain very specific checkpoints along the way (generally, something like a module/namespace boundary).

Clojure has Spec, but it misses the mark in my opinion because it doesn't solve refactoring. It's not (currently) instrumented enough to help the me as a human make changes to the code without also just "bumping into the guard rails" to try and figure out what I broke along the way.

A middle ground orthogonal type system sounds really appealing to me. "Type coverage" is an idea I've been kicking around. Something like Spec in Clojure, but more symbiotic with the host code such that it can tell you things _about_ your code and help in refactoring, symbol resolution, etc..

That's a lot of words, but tl;dr I think I agree with you : )

Re:Deno will stop using TypeScript by kybernetikos on Tuesday June 23, 2020 @05:16PM (#23620418)
Thanks for treating my comment charitably, and for adding your experience. Type systems often seem to bring out the extremist in otherwise reasonable developers.

It's quite obvious that there are downsides to types that most developers are missing - because most developers seem to feel that they get massive benefit from types, but empirical studies seem to show that if there really are benefits, they are not massive.

I see the downsides in a few ways - they open up another avenue for 'architecture astronauting', they are not in fact accurate representations of the real world in many situations - you're dealing with files, or messages coming in from the network which are not typed, and even when they are (e.g. databases), they can change under your code while you're running. That's not to mention the points I made above around usually being an entirely different, hobbled language that gets sprinkled through your source code. Types encourage people to build ridiculous code generation pipelines during build time, and builds getting larger and flakier are about the worst thing in the world for fast iteration. I find the Smalltalk approach of coding in a live image really interesting, and I worry that obsession with types are closing off that kind of future. There's also the fact that your language, and particularly your type system constrains what code you write - like a programming version of Sapir Whorf, and most type systems are bad at expressing very high levels of abstraction. Scala had to invent a documentation tool that hid the real types of things because the type signature of higher order functions like map and reduce were scaring people.

I was interested in your opinion of Spec, because I'm aware of it and find it interesting, but I don't do a lot of Clojure so I haven't really used it practically. I liked that it aimed to address more than just verification - schemas, object generation for property testing, these things are all closely related to the general concept.

I think your ideas about a middle ground type system seem very interesting.

I saw recently that there's a version of Nim 'DrNim' that incorporates the Z3 theorem prover which allows you to assert and prove much more interesting things than typical type systems. It sounds fascinating.

Re:Deno will stop using TypeScript by ptx on Sunday June 21, 2020 @02:45PM (#23594254)
If your application has any structure at all, you can often just run the tests for the part you're changing while you're working and committing locally. Once you're ready to push it you should probably run all the tests first even if your language has static types.
Re:Deno will stop using TypeScript by ptx on Sunday June 21, 2020 @02:42PM (#23594212)
> you wait for the engineer to write tests

Which, if we're doing TDD, involves no waiting at all, since it was already written before the implementation. Ideally anyway.

Re:Deno will stop using TypeScript by mimixco on Sunday June 21, 2020 @11:51AM (#23592674)
I didn't read that types were causing problems. My understanding was TS, itself, was causing problems. Specifically waiting around for it to compile.

Strong typing is from OOPS, itself an optional programming methodology. There are many JS programs that simply access other (JSON) objects directly without going through an interface. In these instances, typing is counterproductive.

One of the beautiful things about JS (and Lisp) is that variables and functions are interchangeable and, the case of JS, both can be accessed directly without worrying about an interface.

Re:Deno will stop using TypeScript by jackjeff on Sunday June 21, 2020 @12:06PM (#23592792)
Just use Typescript static types where it is useful. If you access a bunch of JSON objects and you don’t need the typing, you can always declare as ‘any’ and move on.

At the end of the day those type exist in JavaScript. If you access ‘first_name’ instead of ‘firstname’ it will not work. The difference is that typescript would let you know before running the code instead of getting an obscure runtime error.

Re:Deno will stop using TypeScript by austincheney on Sunday June 21, 2020 @12:59PM (#23593289)
Deno is having problems with TypeScript, but TypeScript is not the cause of that problem. The problem is a self inflicted issue of a name collision of their choosing.
Re:Deno will stop using TypeScript by jorams on Sunday June 21, 2020 @01:11PM (#23593397)
Slow compile times are very much a problem caused by TypeScript.
Re:Deno will stop using TypeScript by austincheney on Sunday June 21, 2020 @02:17PM (#23593999)
You can do any manner of stupid things to make any compiler of any language to behave slowly, but that doesn’t mean all compilers are slow. If you want better output don’t deliver garbage for input.
Re:Deno will stop using TypeScript by eitland on Sunday June 21, 2020 @01:53PM (#23593768)
My 3 year old laptop has no problems with TypeScript (neither Angular nor React), and I am a rather impatient guy when it comes to computers.

I'm honestly wondering: What are people doing to end up in a position where TypeScript compile times are a problem?

Re:Deno will stop using TypeScript by austincheney on Sunday June 21, 2020 @02:26PM (#23594076)
It is something to do with a class in their code named something similar to header conflicting with a same named definition in their index.d.ts file that is closely related to that class instance.

If they dropped use of classes, or differentiated the names of the two things in collision the problem would appear to be solved.

To turn that around and blame TypeScript as the point of failure is an extremely bad omen suggesting their code style opinions are more important than product delivery. I could live with that nonsense if this were a framework or some minor dependency, which this application is not.

Re:Deno will stop using TypeScript by thomasrognon on Sunday June 21, 2020 @02:34PM (#23594144)
My compile time went from seconds to minutes when I made a recursive immutable type (which I reverted of course). Overall, I still love typescript.

Edit for the curious, here's the monster type that caused such pathological build times...

  type ImmutablePrimitive = undefined | null | boolean | string | number | Function;
  export type Immutable<T> =
    T extends ImmutablePrimitive ? T :
    T extends [infer U]                                     ? readonly [Immutable<U>] :
    T extends [infer U, infer V]                            ? readonly [Immutable<U>, Immutable<V>] :
    T extends [infer U, infer V, infer X]                   ? readonly [Immutable<U>, Immutable<V>, Immutable<X>] :
    T extends [infer U, infer V, infer X, infer Y]          ? readonly [Immutable<U>, Immutable<V>, Immutable<X>, Immutable<Y>] :
    T extends [infer U, infer V, infer X, infer Y, infer Z] ? readonly [Immutable<U>, Immutable<V>, Immutable<X>, Immutable<Y>, Immutable<Z>] :
    T extends readonly [infer U]                                     ? readonly [Immutable<U>] :
    T extends readonly [infer U, infer V]                            ? readonly [Immutable<U>, Immutable<V>] :
    T extends readonly [infer U, infer V, infer X]                   ? readonly [Immutable<U>, Immutable<V>, Immutable<X>] :
    T extends readonly [infer U, infer V, infer X, infer Y]          ? readonly [Immutable<U>, Immutable<V>, Immutable<X>, Immutable<Y>] :
    T extends readonly [infer U, infer V, infer X, infer Y, infer Z] ? readonly [Immutable<U>, Immutable<V>, Immutable<X>, Immutable<Y>, Immutable<Z>] :
    T extends Array<infer U> ? ImmutableArray<U> :
    T extends ReadonlyArray<infer U> ? ImmutableArray<U> :
    T extends Map<infer K, infer V> ? ImmutableMap<K, V> :
    T extends ReadonlyMap<infer K, infer V> ? ImmutableMap<K, V> :
    T extends Set<infer M> ? ImmutableSet<M> :
    T extends ReadonlySet<infer M> ? ImmutableSet<M> :
    ImmutableObject<T>;
  type ImmutableArray<T> = ReadonlyArray<Immutable<T>>;
  type ImmutableMap<K, V> = ReadonlyMap<Immutable<K>, Immutable<V>>;
  type ImmutableSet<T> = ReadonlySet<Immutable<T>>;
  type ImmutableObject<T> = { readonly [K in keyof T]: Immutable<T[K]> };
Re:Deno will stop using TypeScript by tigershark on Sunday June 21, 2020 @01:32PM (#23593579)
No, it’s not counterproductive to access JSON objects using a predefined schema, it saves your ass in case of typos.
Re:Deno will stop using TypeScript by jlg23 on Sunday June 21, 2020 @01:32PM (#23593583)
> Lisp is large, important, and also not statically typed. It's worked out ok for Lisp programmers.

Lisp programmers use check-type[1] a lot, they proclaim[2] types for performance optimizations and they often deftype[3] if not only for code clarity. And then we have CLOS and its dispatching on types/classes...

[1] http://www.lispworks.com/documentation/HyperSpec/Body/m_chec... [2] http://www.lispworks.com/documentation/HyperSpec/Body/f_proc... [3] http://www.lispworks.com/documentation/HyperSpec/Body/m_deft...

Re:Deno will stop using TypeScript by damnyou on Sunday June 21, 2020 @12:55PM (#23593255)
Lisp is important for its intellectual contributions, not for its use in large production systems.
Re:Deno will stop using TypeScript by mimixco on Sunday June 28, 2020 @10:54AM (#23669103)
It's used for every airline reservation you've ever made. Also, it's used here on HN. And in Grammarly.
Re:Deno will stop using TypeScript by meowzero on Sunday June 21, 2020 @11:55AM (#23592702)
That's appeal to popularity. At least lisp is strongly typed. JS happened to be created first, and the world was stuck with it as Web grew and no other alternatives came out.
Re:Deno will stop using TypeScript by carapace on Sunday June 21, 2020 @02:26PM (#23594079)
> JS ... is the most successful and important language in the world (probably in the history of programming),

I object, C is that.

Re:Deno will stop using TypeScript by gameswithgo on Sunday June 21, 2020 @12:49PM (#23593185)
javascripts success is an accident of history and we have paid a heavy price for it
Re:Deno will stop using TypeScript by shirshak55 on Sunday June 21, 2020 @01:01PM (#23593315)
null is considered billion dollar mistake but in JS there is 2 null so the statement is not incorrect :P
Re:Deno will stop using TypeScript by jondubois on Sunday June 21, 2020 @04:11PM (#23595006)
>> This feels like process immaturity or unfamiliarity.

On the contrary, I think it shows great maturity in the decision making process. Many highly experienced developers have stayed away from TypeScript for reasons like those mentioned in the article (mostly to do with the build environment, source mapping, versioning complexity, etc...) These are very significant problems and not worth the small benefits which static typing brings.

Re:Deno will stop using TypeScript by Aeolun on Sunday June 21, 2020 @06:07PM (#23595789)
I just cannot consider this a reasonable stance.

There are places where no-typescript would be appropriate, but they’re vanishingly small. The idea that the benefits static typing brings are small is just laughable.

The reason this is such a hard choice is because static typing brings great benefits, so choosing to forgo that is not easy.

Re:Deno will stop using TypeScript by MiroF on Sunday June 21, 2020 @05:46PM (#23595675)
> not worth the small benefits which static typing brings.

pshh

Re:Deno will stop using TypeScript by recursive on Sunday June 21, 2020 @01:56PM (#23593787)
Further, even if they drop typescript, this particular problem won't go away. The solution to this problem is the same regardless of whether typescript is in play. It's odd to count it as a problem with typescript.
Re:Deno will stop using TypeScript by austincheney on Sunday June 21, 2020 @11:53AM (#23592696)
This is enough reason for me to completely forget Deno. They clearly cannot write code or organize it without using classes, which is the core of their current error. The fact that they would choose that stupidity over the organizational benefits of interfaces and static types is not something I can reconcile.
Re:Deno will stop using TypeScript by shirshak55 on Sunday June 21, 2020 @01:03PM (#23593334)
remember deno is written by same person who wrote node js so please don't judge immediately.
Re:Deno will stop using TypeScript by HideousKojima on Sunday June 21, 2020 @02:08PM (#23593903)
That's even more reason to disregard it then
Re:Deno will stop using TypeScript by austincheney on Sunday June 21, 2020 @02:32PM (#23594121)
The technical problem is a class name in their code conflicting with a same named definition in their index.d.ts file closely related to that class. If they stopped using classes or changed those names to not be in collision this problem would be cured, which indicates it’s an edge case in their code they could easily fix but choose not to. Knowing that and that they blame the TS compiler for their code problem is cause enough to be judgemental.

Knowing they are aware they could easily fix this issue themselves but are instead dumping TS is cause for hesitation to invest in the project.