4 ms·
I feel like in the longer term we'll eventually get, via WASM or otherwise, another language that we're allowed to use in the browser, which can be properly typ
by pjc50 3y ago
I feel like in the longer term we'll eventually get, via WASM or otherwise, another language that we're allowed to use in the browser, which can be properly type-safe from the beginning.
- couchand 3y agoThat time is now. I've been shipping Rust code to browsers for years...
- berkes 3y agoRust is still the only language with decent tooling and an ecosystem to compile to WASM. Many other languages haven't passed the PoC stage. Several are ready, and doable (C#, Go?) but hardly as easy and common as with rust. At least that was the state when I looked six months ago. It's a fast moving area. So, yes, that time is now. But the only practical option is rust. Which may be enough, idk.
- pjc50 3y agoC# Blazor certainly exists and works, although it feels really clunky. Only suitable for a true application, not for integrating with web pages. It's almost the inheritor of the Java "applet" and the HotJava browser.
- randomdata 3y ago> Many other languages haven't passed the PoC stage. Wouldn't it be more accurate to say that WASM hasn't passed the PoC stage? There are quite a few languages that have great WASM support, to the extent WASM allows, but have to bring all kids of workarounds to deal with the shortcomings of WASM as it sits. An especially challenging problem as it relates to browser use with those workarounds is that they bloat the artifact size. Few are willing to subject users to multi-megabyte downloads. Work is being done on WASM to address those shortcomings, but hands are pretty much tied until that arrives. Until then, the "lower level" and heavily constrained languages will be left to stand alone.
- marcosdumay 3y agoYeah, but Rust is not great for UI code full of global values.
- papa0101 3y agoThat was google's original plan with Dart.
- zogrodea 3y agoI believe Dart was originally gradually typed, and then abandoned the gradual typing for strict-typing-by-default? That doesn't quite sound properly type-safe to me although still safer than how Javascript is by default. My only reference is a memory of this talk by Richard Feldman but I might be wrong or misremembering. https://www.youtube.com/watch?v=Tml94je2edk https://www.youtube.com/watch?v=Tml94je2edk
- igouy 3y agoReleased 22 February 2018 Dart 2.0 implemented a new sound type system Dart's type system, like the type systems in Java and C#, is sound. https://dart.dev/language/type-system https://dart.dev/language/type-system
- zogrodea 3y agoThanks for the link. I'm aware Dart currently has static typing similar to Java and C#, and has had it for some time, My question was different though and I was asking (quoting comments further up the chain) whether "google's original plan with Dart" really was to allow for a programming language "which can be properly type-safe from the beginning". It seems that claim about the original intent is false. I checked Wikipedia [0] which states "Dart 2.0 was released in August 2018 with language changes including a type system" and the reference they link seems to corroborate that, before 2.0, Dart didn't have a sound type system. Thanks for prompting me to dig deeper (I probably wouldn't have done it without seeing your comment). [0] Quote found under the history section. https://en.m.wikipedia.org/wiki/Dart_(programming_language) https://en.m.wikipedia.org/wiki/Dart_(programming_language)
- igouy 3y agoThanks, I was probably responding to “That doesn't quite sound properly type-safe to me” in isolation.
- wk_end 3y agoConsider using Reason and/or Rescript. Ocaml with a nice syntax and clean JS interop.