4 ms·
I think the marketing page is not doing a great job. Grain is a language compiled to WebAssembly. So comparing it with either Javascript or Elm is pointless
by thangngoc89 8y ago
I think the marketing page is not doing a great job. Grain is a language compiled to WebAssembly. So comparing it with either Javascript or Elm is pointless
- tlrobinson 8y ago> So comparing it with either Javascript or Elm is pointless Why? They all target browsers. What else would you compare it to?
- thangngoc89 8y agoLike comparing to Rust compilation to WebAssembly for example?
- ForHackernews 8y agoDoes Rust have any DOM integration?
- ekidd 8y agoYes. For a while, you've been able to embed JavaScript wrappers using stdweb (https://github.com/koute/stdweb https://github.com/koute/stdweb). There are pre-built libraries covering much of the DOM. But you may need to submit PRs if you get heavily into <video> or something else with non-standard APIs. The shiny new toy is wasm-bindgen (https://github.com/rustwasm/wasm-bindgen https://github.com/rustwasm/wasm-bindgen), which will soon allow the use of WebIDL (https://heycam.github.io/webidl/ https://heycam.github.io/webidl/) to wrap the entire browser API, if I understand correctly. In practice, it all seems to work pretty well. But for public-facing sites, you need to watch the number of dependencies you include and keep the *.wasm size down.
- masklinn 8y agoThere are vdom/components-based libraries based on that as well e.g. Yew seems popular.
- vijaybritto 8y agoThey've even got the ability to query dom using a light weight lib on the js side. I think this is a more full fledged framework and they should really talk about it. The marketing page is not upto other frameworks imo.
- masklinn 8y ago> Grain is a language compiled to WebAssembly. So comparing it with either Javascript or Elm is pointless This ability is a tool and nothing precludes a wasm target for Elm (in fact Evan specifically expressed interest in it: https://github.com/WebAssembly/gc/pull/1#discussion_r111501121 https://github.com/WebAssembly/gc/pull/1#discussion_r1115011...). Either way, comparing Grain to JS or Elm is anything but pointless, at the end of the day it's competing with them.
- bad_user 8y agoIf we're speaking of competition and JavaScript, then a much stronger competitor would be PureScript. http://www.purescript.org/ http://www.purescript.org/ PureScript is a Haskell dialect that was built specifically to run on top of JavaScript engines. Specifically, compared with Haskell, it is strictly evaluated (whereas Haskell is non-strict / lazy, well almost). However it eliminates some of Haskell's baggage, but retains Haskell's functional purity. It's all around an awesome programming language for FP that targets JavaScript engines, far surpassing any other attempt.