5 ms·
I don't get the wasm craze in the rust crowd. There is no popular language that cannot be compiled to wasm. It just feels sad to spend time there.
by fxfan 8y ago
I don't get the wasm craze in the rust crowd. There is no popular language that cannot be compiled to wasm. It just feels sad to spend time there.
- lukeqsee 8y agoI think the point is Rust is a very good language in its own right. The fact it compiles to WASM is a great feather in the cap. They are able to deliver a demo in the browser for something that would normally require downloading and compiling. I think that’s pretty cool to show for a project people wouldn’t normally be able to try out with such low barrier of entry.
- mjw1007 8y agoIf this ended up making it possible to run Python in the web browser, that might be interesting to a fair number of people. (There are advantages to running the same language on the server and client, and there's plenty of server-side web application Python code out there.)
- soperj 8y ago>There are advantages to running the same language on the server and client I see this said quite often. What are they?
- nsstring96 8y agoSaving in developer salaries is the only tangible one. You could argue there is less context switching for developers between languages, but I’ve never actually heard that from someone who builds the apps.
- Zelmor 8y agoTo make sure the same bootcamp hacks can work on your backend and frontend, neither of which they fully understand.
- mjw1007 8y agoIf you have a traditional server-rendered web application and you want to add a little bit of scripting on the client side, it can be nice to be able to share pieces of domain-specific code (for example, you might want the client and server to have the same notion of what a well-formed stock code looks like). In more sophisticated systems, people sometimes like the client to "optimistically" do the same processing as it expects the server to do, so it can update its display more quickly. Or if you have a mostly client-side application which builds up some fancy widget tree, sometimes people like to have the server do the same rendering as the client would so that it's there on initial page load, or so that search engines can see it.
- zoul 8y agoYou often have the same data types on the server and the client for data exchange. When both sides use the same language, you only write these types once and it’s impossible for the client and server implementations to differ.
- coldtea 8y agoNot having to learn 2 languages and duplicate efforts for starters...
- aaaaaaaaaaab 8y ago>learning TWO languages Oh! The horror!
- tylerl 8y agoYou mean like repl.it or skulpt or ... actually there's a few different option with different features, but doing python in the browser has been a thing for many years.
- half-kh-hacker 8y agoRunning Python, client-side in the browser.
- StavrosK 8y agoThere are already various options, many using Emscripten.
- bbernard 8y agoThere's already a client-side implementation of Python in JavaScript. See: https://brython.info/ https://brython.info/ But it might not give you the sort of compatibility between the client and server code that you're looking for.
- geofft 8y agoI think it's less "the Rust crowd is excited about wasm" and more as "there is a crowd which is excited about doing certain things with languages and software, and Rust and wasm are both exciting means for those ends." Perhaps a good approximation is, they're both tools for using high-level programming techniques with high performance for domains that were previously constrained in terms of what languages you could use.
- nicoburns 8y agoRust is particularly suited to WASM due to the lack of GC and runtime (which tend to be quite large, and have to be downloaded in a web context). And due to it being able to achieve very high performance (which is the whole point of WASM). The only other languages that really compete here are C and C++, and they don't have the great, easily installable library ecosystem that Rust has, and they aren't very accessible to JavaScript developers). Personally I'm more excited about other uses of Rust, but I can see why people are excited about Rust and WASM.
- mhh__ 8y agoYou're talking about web technologies, and needing to download a runtime is the problem? C++ isn't accessible but rust is? Only because they can't be bothered to learn: It complicated but its really not that hard. Plug: D can happily compile to wasm
- nicoburns 8y agoWell yes, the need to download a new runtime for every app you run is a problem if thst runtime is several megabytes. C++ isn't accessible to web developers compared to Rust. It's not just that I can't be bothered to learn, it's that I'm scared of all the security vunerabilities and memory corruption bugs I will write while I'm learning. And wjy put in that effort when I can learn Rust more easily, and get the ongoing benefits of my code being safe and reliable. True, D also competes here. I should probably have put D on the list. Although my understanding is that a large part of the D ecosystem still relies on GC.
- mhh__ 8y agoMost runtimes are fairly small, and most issues could be done away with by either the browser storing common runtimes (Search for x, then checking hashes etc.) or by compiling statically against the parts you actually use. This is still not conclusive, as the runtimes will probably have to be significantly modified (at the ABI/System level, so around the edges) given that they will have to get memory from the browser etc. This leaves much room for WASM specific optimisation, especially given that the actual (let's say) garbage collector implementation is probably quite small compared to the code used to interface to it. Writing C++ defensively (i.e. Do what the guidelines tell you, Preach Andrei and Bjarne etc), and using sanitizers cleans up a huge amount of C++ code.
- xkapastel 8y agoMost of the popular languages are not making a serious effort to compile to WebAssembly, though. It's totally reasonable for Rust to focus on.