8 ms·
Interesting to see a different side to the benefits of Deno. Personally, I find direct Typescript interpretation to be one of the best features. Typescript is
by obblekk 4y ago
Interesting to see a different side to the benefits of Deno.
Personally, I find direct Typescript interpretation to be one of the best features. Typescript is not necessarily a simple type system, but it is an expressive one:
- It has great type inference avoiding Java style codespam
- It has gradual typing, enabling "risky" type casts
- It has fully functional types, enabling the productivity and readability improvements from functions as data
- It is 10 seconds away from having dependent types
Typescript took most of the best programming language research from the past 20 years and popularized it in a way that actually makes js hackers more productive without getting too much in the way.
The only hard thing has been that js interpreters don't understand typescript, requiring an awkward transpilation step with weird symlinks and other hidden complexity that works 99% of the time, but wastes a lot of time when it doesn't work just right.
If Deno could just solve that, it would be a great improvement. If it's also faster (as claimed) that's even better. This article shows a lot of other ways in which small, simple improvements add up to a much better product.
Can't wait until it's production ready.
- SOLAR_FIELDS 4y agoIt’s hard to beat a pedigree like Anders’ for Typescript. He had Delphi and C# to cut his teeth on. I can’t imagine many other people that would be better qualified to design something pragmatic on top of the ugliness of JavaScript
- sabellito 4y agoThat's very true. I see other programming languages trying to add/enhance types now (ruby, python, go to some extent), and not having a beast like Anders on the team must make it tough to ship an amazing type system.
- SOLAR_FIELDS 4y agoI feel like pedigrees are somewhat underrated in software engineering. Everywhere I go there always seems to be some sort of egotistical “I can make the best thing”
- sabellito 4y agoWell, yes, and I've done that plenty myself haha I have the impression that many of us programmers have a hard time really accepting that different applications of programming require vastly different skillsets, so we often underestimate how hard things can be. For example, a software developer of 15 years probably doesn't have almost any of the necessary skills to make a new database server.
- SOLAR_FIELDS 4y agoExactly! I feel like one of the skills that levels you up from junior to senior engineer is learning never to utter the words “it will be easy”
- ElFitz 4y agoWell, that should be easy!
- kaba0 4y agoCreating a new language that interoperates with another is way different than retrofitting an existing language to add types.
- pjmlp 4y agoMissing Turbo Pascal and J++ on the list.
- fijiaarone 4y agoIf only handling types wasn’t so difficult and error prone. I suppose being able to manage types with human readable text files is a benefit, theoretically.
- mekster 4y agoWhat editor are you using?
- yashap 4y agoYeah, I’m a big fan of strong, static types, and was a big JS hater pre-ES6 (still a light JS hater), but I gotta say, TS is damn good. It really is almost as type safe as a classic strongly, statically typed language, and almost as productive “in the small” as a dynamically typed scripting language. If you don’t need systems language type performance, and don’t need true parallelism, it’s a pretty terrific choice. Starts out productive/simple in the early days of a project, stays productive/simple as it grows. Plus, if you’re doing “mobile apps + web app + RESTful services”, pretty nice that you can do it all in one language (assuming React Native on mobile), and that there’s no JSON related boilerplate.
- JoeyJoJoJr 4y agoDiscriminated unions are such a powerful feature that I would be very reluctant to choose another language that doesn’t have them.
- scns 4y ago"You can take those Algebraic Data Types from my cold dead hands" - Ron Minsky
- dgb23 4y agoThe nice thing about them is that you have been using them all the time if you do dynamic typing. They are the most natural way to encode structural information, especially across language/system boundaries. - Clojure’s multimethods (multiple dispatch) - Clojure spec’s “or” - JSON schema’s “anyOf” There’s likely more features and tools that are not strictly/statically discriminated/tagged unions, but in practice they help you to code that way. In TS this is IMO the best feature. In a sense it just adds tooling support on top of a coding style that is very close to dynamic typing.
- JoeyJoJoJr 4y agoIt is the way I always wanted to use JavaScript, but was too cumbersome to utilise without a good type system. My favourite use-case for discriminated unions is to represent all possible client events as a DU, as well as the entirety of the application state. This allows you to efficiently communicate with a backend over websockets via a very thin transport layer that only needs to handle one message type.
- pjmlp 4y agoCLOS multi-methods actually.
- nicky0 4y agoWhat did you mean by weird symlinks? I've been doing TypeScript a few years and havent had to interact with symlinks.
- flohofwoe 4y agoTypescript is great compared to plain JS, but they're really deep into diminishing returns area with type system features for a couple of years now. A lot less would be a lot more, because as of now Typescript lures otherwise entirely competent programmers into writing complex 'type system puzzles' which are entirely obscure to everybody except the person who wrote that code, and it takes a lot of discipline and experience to reist the lure and keep things simple.
- toastercat 4y agoI feel similarly to this, and often find when working on a TypeScript codebase that I get "distracted" by spending more time trying to get my types just perfect.
- pjmlp 4y agoI kind of agree, some Typescript projects look like Haskell envy (with all GHC extensions enabled).
- hbrn 4y agoI feel the same way, I lost amazing engineers to this weird typing obsession. Excessive typing is very costly and should be left to popular libraries that solve generic problems. This is where you get best bang for buck. It should not be present in your business code, high level business logic is rarely prone to type errors anyway. Static typing was always a means to an end, but unfortunately it was recently sold as a virtue and many people have bought it.
- wibblewobble124 4y agoTS has terrible type inference. At work I collect a list of the failures.