4 ms·
Can dart be evaluated within the browser? I’ve been looking for a language which can be executed within the browser (without needing a connection to any server)
by paperwork 8y ago
Can dart be evaluated within the browser? I’ve been looking for a language which can be executed within the browser (without needing a connection to any server).
I would like to write some blog posts explaining technical concepts and provide executable, interactive code. As far as. I can tell, currently JavaScript is the only language for the job. All languages which transpile to js seem to require (out of browser) command line tools
- markdog12 8y agodart2js tool can be used in the browser, I believe this uses it: https://dartpad.dartlang.org/ https://dartpad.dartlang.org/ It also has dart dev compiler which compiles much faster to more modern JavaScript: https://webdev.dartlang.org/tools/dartdevc https://webdev.dartlang.org/tools/dartdevc
- thangngoc89 8y agoOCaml/ReasonML could be evaluated in browser without a connection to a server. I built this little project to demonstrate the ability: https://sketch.sh https://sketch.sh
- opencl 8y agodart2js is written in Dart so you can use it to compile itself and then run in browser.
- nickik 8y agoI think probably one of the most advanced languages in that respect is ClojureScript. ClojureScript is fully self hosting and you can 'eval' in the browser. I don't really use ClojureScript, but it was a milestone that took a couple of years of leg work to get going. ClojureScript is also in wide production use, I have not seen another compile to JS language that works as well.
- rkangel 8y agoDart was originally designed as a JS 'replacement', designed to supplant it. The talked about browsers executing it directly, but as a transition step compile-to-JS has always been a first class citizen for Dart. Now of course no language is going to replace JS, it's going to be compile to WASM or JS, and Dart is now focused on things like Flutter where it is used in a 'Ahead of Time' compiled form.
- WorldMaker 8y agoYou can use the Typescript transpiler directly in a browser.