by macca321 · 12y ago · 0 comments
Abstracting away web development and http has been tried again and again, and always ends up being more hassle than plain ol' HTML+JS+HTTP.
Then you've limited yourself to interop with the js libraries they've provided leaky wrappers over, or you can write your own leaky wrapper if you want to use coolnewthing.js you saw on github.
And to cap it all, this framework requires commercial licensing for closed source projects!
The other benefit is that I can use all the same type definitions, so I don't need to write some generator or wrapper around my XHR functions - it just works.
It's quite easy to just drop out into pure JS if you feel the need. And defining wrappers is actually very very simple. For example:
[<Direct "foo($a, $b)">]
let foo (a: string) (b: int) = ()
Doesn't Google use a Java-based system to do essentially the same thing (GWT)?But you're right that if you are already happy with JS then there's a lot less reason to pick it up.
https://www.youtube.com/watch?v=qpCSbj36O44&feature=youtu.be
For example, using similar techniques that html5index.org uses, all browser native APIs are automatically covered by fetching the latest WebIDL definitions from Chromium or Firefox's repository or via standards docs, and used to generate the interfaces.
Or, using IDE FileWatchers, we use the Closure Compiler to read in Javascript libraries and/or externs, infer types, and write out interfaces. Likewise, we'll be able to read in typescript library interfaces and generate Java interfaces.
Combining the new JsInterop system, Java8, and SuperDevMode's <1 second compiles, the new system eliminates wrappers, reduces Java boilerplate overhead (lambdas, method references), and provides fast refresh times.