Live data from Hacker News

Glimmer.js: What’s the Deal with TypeScript?

medium.com

91–100 of 112 posts

Re: Glimmer.js: What’s the Deal with TypeScript?

#91
post #54
post #9

>At the end of the day, though, JavaScript is the language of the web. And when webassembly arrives that will be over, and Typescript will be deprecated. I can't wait for a better modern language like Haskell, Python, Livescript, etc.. built on top of webassembly. Then we can finally stop trying to fix Javascript's flaws with new language features.

To run python on WebAssembly you would have to compile the entire CPython executable, and every single dependency it has, into WebAssembly, then ship that giant executable with every page so you could then run Python code with it. You would then also most likely need a special library, which at some point someone will have to write or you'll have to write it yourself, to give Python a clean interface to the DOM. All…

But by the time you'll be able to do this, maybe most people have gigabit fiber and wifi. At some point in the future, a few megabytes isn't going to matter.

Re: Glimmer.js: What’s the Deal with TypeScript?

#92
post #43
post #19

Earlier quoted context omitted.

IMO I feel like it is going to be a challenge to integrate the GC of another language with the GC of the JavaScript/DOM, and if so we'll be keeping JavaScript going for a while.

WebAssembly doesn't have a GC, And I don't see any reason why the DOM should be subject to a JS GC.

Correct, but python (or haskell or java or whatever) running on top of WASM would, and there are plans to integrate WASM with the other GC's in the browser, however:

    "'compile the VM' strategies increase the size of 
     distributed code, lose browser devtools integration, can 
     have cross-language cycle-collection problems and miss 
     optimizations that require integration with the browser" [1].
My prev comment was speculative, but my point is that its not going to be a piece of cake to just drop another high-level language on-top of WASM and use it as a 'better' scripting language without having to pay some overhead costs, one being GC issues.

[1] https://github.com/WebAssembly/design/blob/master/FAQ.md#is-...

Re: Glimmer.js: What’s the Deal with TypeScript?

#94
post #8
post #6

What sold me on TypeScript was that it didn't just add features, it actively solved a problem I'd been experiencing. Once a JavaScript project scales beyond what can fit in your head, JS's initial productivity boost crumbles because you have to constantly double back and make sure your methods/constructors/etc. are correctly used, which properties are optional, etc... A lot of the debugging happens in runtime and god…

Have you tried Elm? Id love to know your experiences.

Elm is so amazing. It isn't as amazing when you just try out it's tutorial, but if you try to build an actual application in it, especially if you are a single programmer working on a project.

In my experience whenever I worked on a JS project on my own, there was an upper limit to how far I could keep writing the code on my own. After that, I had to spend time in doing other things (like writing Integration tests, lots and lots of unit tests, or refactor existing code because I realized that there are many issues unveiled).

But now, with Elm, it's like a whole set of unit tests are being written at the time of writing code which take care of plenty of common errors usually made due to lack of a good type system.

Add to that the usage of Maybe types (which are very beneficial in avoiding some UI antipatterns[1]), and the Reactive Programming pattern, I feel like I am writing a lot less code than what I am used to writing in JS projects.

I highly recommend Elm to anyone who wants to write a personal project, you'd see what benefits I'm talking about.

1. http://blog.jenkster.com/2016/06/how-elm-slays-a-ui-antipatt...

Re: Glimmer.js: What’s the Deal with TypeScript?

#95
post #59

Earlier quoted context omitted.

What would you replace the DOM with?

I honestly have no idea. It does so much that I don't know where you'd start - but I suspect that's also the problem. I remember seeing a demo of React Canvas a few years ago - basically, recreating a "DOM" of sorts inside a canvas tag - and the performance was crazy. Beautiful 60fps touch interactions. But, of course, it only does a tiny subset of what the DOM does. I'm still waiting for a good reason to use it myse…

I feel the same. Dunno wth we gonna do but we need something more performant.

Re: Glimmer.js: What’s the Deal with TypeScript?

#96

Earlier quoted context omitted.

Types are pretend in TypeScript and Flow the same way that types are pretend in any other typed language. Types are used at compile-time and not runtime in both cases.

Are they used at compile time with TS or Flow? I thought they were just stripped out.

Well, I assume they're at least used at type-checking time, which most people consider to be a subset of compile time.

Re: Glimmer.js: What’s the Deal with TypeScript?

#97
post #72
post #62

Well, if we already transpile ES7 to JS then why not tanspile TypeScript instead because of all the added benefits?

Because eventually in a couple of years you can take your ES7 code and remove the transpiration and it will all work seamlessly. Not so much with Typescript.

M$ can achieve world domination again by making the already opensourced Chakra engine run TypeScript directly w/o the need to transpile. Goodbye ES7, hello ES6 soon to be ES7 optionally typed superset.

Re: Glimmer.js: What’s the Deal with TypeScript?

#98
post #72
post #62

Well, if we already transpile ES7 to JS then why not tanspile TypeScript instead because of all the added benefits?

Because eventually in a couple of years you can take your ES7 code and remove the transpiration and it will all work seamlessly. Not so much with Typescript.

"Not transpiling" sounds like a marginal benefit, considering most apps are going to have a build step anyway.

Re: Glimmer.js: What’s the Deal with TypeScript?

#99
TypeScript is amazing, enough said. If you're building any application with any amount of code that has to be worked on by anyone other than yourself, you want to use TypeScript (I'd argue even for yourself, use it, it'll catch enough errors to pay for itself in spades). Coupled with editors like Visual Studio Code which are cross-plat and have first-class tooling for TS/JS, it just makes you objectively more productive both as a consumer and writer of Javascript. Even the most die-hard pessimists I've met love TypeScript once they try it.

Re: Glimmer.js: What’s the Deal with TypeScript?

#100
post #82
post #46

There's two things that really stand out for me on TypeScript. There are other positive attributes, but these are the two things I liked. The first is that it made some specific workflows a lot easier. In particular, I'm working on some pre-alpha libraries where there's movement on how the API interface is defined. TypeScript made that transition a lot easier. Yes, my testing would have eventually caught all the meth…

For google-ability, TypeScript has structural types, in contrast with Java which has nominal types.

Ah, thank you - that's a set of names that I need, in order to express my love for TypeScript.
Post reply on HN