Live data from Hacker News

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

medium.com

71–80 of 112 posts

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

#71
post #2

I haven't used TypeScript extensively, but I feel that there should be more of a push (maybe there is, please correct me if I'm wrong) to introduce whatever functionality people deem worthy that exists in TypeScript and introduce it to JavaScript. You can already see the conflict happening as some people prefer Flow and others TypeScript. Perhaps later Google will throw their hat into the ring and introduce GScript.…

The flagship feature of TS is static typing. That will never exist in JS.

I'd never say never. As I'm sure you're aware, JavaScript has had statically typed arrays since WebGL was introduced.

https://developer.mozilla.org/en-US/docs/Web/JavaScript/Type...

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

#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.

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

#74
post #56
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.

>better ... language ... Python ES5 was a dumpster-fire. But ES2015+ is an amazing language. You just have to take the time to systematically study it. If you're choosing a language you'll spend thousands of hours with, you shouldn't use "initial learning curve" as sole criteria.

Amazing?

make an object:

in ESx:

  var myObject= {
  	a: {
  		b: {
  			c: {
  				d: 'some value'
  			}
  		}
  	}
  }; 
in Coffeescript or Livescript:

  myObject= a: b: c: d: 'some value'

now use it:

in ESx:

  console.log myObject.b.c.d			// crash, myObject.b does not exist
how to prevent?

  if ( myObject.hasOwnProperty('b') and myObject.b.hasOwnProperty('c') ){
  	console.log myObject.b.c.d		// undefined
  }
in Coffeescript or Livescript:

  console.log myObject.b?.c?.d		// undefined
I can write almost a book with too many of such examples. So, NO it's not an amazing language, I wrote for many years in it and it sucks all the way.

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

#75
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.

I'd take the experience of working with TypeScript over Python any day of the week. All the days really; every day.

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

#76

Ok, when Glimmer's motivation was only typechecking, why not just fb flow then?

You say "just fb flow" as if it's the default choice. If I were looking at project and community momentum, tooling, and adoption then TypeScript would seem like the obvious choice.

I'm curious why you think "why not just fb flow" for somebody who wants typed JS. It's certainly an option, but it hardly seems the go-to solution.

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

#77

Ok, when Glimmer's motivation was only typechecking, why not just fb flow then?

Having used both extensively, TS is simply the better choice. Flow has multiple large bugs and issues, which many would consider critical, open and unsolved on their GitHub repo for more than a year(!) [1][2][3]. [1] https://github.com/facebook/flow/issues/245 [2] https://github.com/facebook/flow/issues/869 [3] https://github.com/facebook/flow/issues/1528

I struggled with multiple blind spots in Flow in the past, but recently tried porting the same code to Flow and Typescript and I was surprised that Flow took less work than TypeScript. Flow 0.43.1 has become very fast and seems to need less type annotations compared to TypeScript with noImplicitAny enabled. I wonder whether Flow’s happily infers any without complaining or whether its program flow analysis remains more sophisticated.

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

#78
post #54

Earlier quoted context omitted.

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…

> 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. I mean, that's kind of already the case when you want to ship a Python project as a stand-alone package to run on the desktop. Alternatively, I could see a method of installing runtimes i…

I could see the plugin system working, but we're years away from that. So saying JS/TS will be deprecated soon is still pretty incorrect.

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

#79
post #54

Earlier quoted context omitted.

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…

> 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. I mean, that's kind of already the case when you want to ship a Python project as a stand-alone package to run on the desktop. Alternatively, I could see a method of installing runtimes i…

[deleted]

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

#80
post #71

Earlier quoted context omitted.

The flagship feature of TS is static typing. That will never exist in JS.

I'd never say never. As I'm sure you're aware, JavaScript has had statically typed arrays since WebGL was introduced. https://developer.mozilla.org/en-US/docs/Web/JavaScript/Type...

ES4 the version of JavaScript that time mostly forgot (except for Adobe and ActionScript) had static types that looked rather similar to Typescript/Flow. It's not impossible that it will be revisited. Especially now with the precedent from Python of defining/standardizing no runtime behavior for it, only syntax acceptance; that seems like something browsers might be more okay with versus the runtime behaviors required/encouraged by ES4.
Post reply on HN