Do all the things like ++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatarSign Up
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple APILearn More
Search - "wasm"
Variable naming at its best...
Took only 2 hours to notice the difference between leftToRight and lefttoRight11
Finally graduated only to realize that my degree did not provide hard skills, only outdated practices and student loans.2
WASM was a mistake. I just wanted to learn C++ and have fast code on the web. Everyone praised it. No one mentioned that it would double or quadruple my development time. That it would cause me to curse repeatedly at the screen until I wanted to harm myself.
The problem was never C++, which was a respectable if long-winded language. No no no. The problem was the lack of support for 'objects' or 'arrays' as parameters or return types. Anything of any complexity lives on one giant Float32Array which must surely bring a look of disgust from every programmer on this muddy rock. That is, one single array variable that you re-use for EVERYTHING.
Have a color? Throw it on the array. 10 floats in an object? Push it on the array - and split off the two bools via dependency injection (why do I have 3-4 line function parameter lists?!). Have an image with 1,000,000 floats? Drop it in the array. Want to return an array? Provide a malloc ptr into the code and write to it, then read from that location in JS after running the function, modifying the array as a side effect.
My- hahaha, my web worker has two images it's working with, calculations for all the planets, sun and moon in the solar system, and bunch of other calculations I wanted offloaded from the main thread... they all live in ONE GIANT ARRAY. LMFAO.If I want to find an element? I have to know exactly where to look or else, good luck finding it among the millions of numbers on that thing.
And of course, if you work with these, you put them in loops. Then you can have the joys of off-by-one errors that not only result in bad results in the returned array, but inexplicable errors in which code you haven't even touched suddenly has bad values. I've had entire functions suddenly explode with random errors because I accidentally overwrote the wrong section of that float array. Not like, the variable the function was using was wrong. No. WASM acted like the function didn't even exist and it didn't know why. Because, somehow, the function ALSO lived on that Float32Array.
And because you're using WASM to be fast, you're typically trying to overwrite things that do O(N) operations or more. NO ONE is going to use this return a + b. One off functions just aren't worth programming in WASM. Worst of all, debugging this is often a matter of writing print and console.log statements everywhere, to try and 'eat' the whole array at once to find out what portion got corrupted or is broke. Or comment out your code line by line to see what in forsaken 9 circles of coding hell caused your problem. It's like debugging blind in a strange and overgrown forest of code that you don't even recognize because most of it is there to satisfy the needs of WASM.
And because it takes so long to debug, it takes a massively long time to create things, and by the time you're done, the dependent package you're building for has 'moved on' and find you suddenly need to update a bunch of crap when you're not even finished. All of this, purely because of a horribly designed technology.
And do they have sympathy for you for forcing you to update all this stuff? No. They don't owe you sympathy, and god forbid they give you any. You are a developer and so it is your duty to suffer - for some kind of karma.
I wanted to love WASM, but screw that thing, it's horrible errors and most of all, the WASM heap32.7
Wohoo! Adobe kills flash in 2020 👍
"Adobe chose to end Flash because it believes coding technologies like HTML5, WebGL, and WebAssembly "
I am worried of a future in which JS has taken over everything, fortunately wasm is here to help :D5
College student here.
What are the most important skills/assets one should bring to the workplace? As a developer and a colleague.5
Was scrolling youtube last night, not expecting much, found this video about web apps. Holy mother of linus torwalds, just watch the fucking web assembly part. https://youtu.be/MiLAE6HMr10
I'm not trying to say web assembly will be a good thing or dot net is, but holy crap!
Edit: wasm is the second topic in the video2
– we expect you to know the concepts of immutability, persistence, software architecture and systems theory, methods of analyzing complexity beyond the big-O notation, safe parallel code execution with web workers, WASM, modern web standards including working drafts, progressive enhancement and graceful degradation, WCAG recommendations and web accessibility in general, UX strategies and modern graphic design trends. Nice 20k github stars you got there. By the way, what's your opinion on modern optimistic UX?
– I know this all but I somewhat disagree with some status-quo UX strategies
– unfortunately it's a no
– Do you know how to wipe your ass?
– *excited hysterical jumping with head nodding*
– You're hired26
If you've ever tried using Go plugins raise your hand.
If you've ever tried doing plugins in Go, raise your hand.
If you think that the following rant will be interesting, raise your hand.
If you raised your hand, press [Read More]:
This is a tale of pain and sorrow, the sorrow of discovering that what could be a wonderful feature is woefully incomplete, and won't be for a very long time...
Go plugins are a cool feature: dynamically load pre-compiled code, and interact with it in a useful and relatively performant way (e.g. for dynamically extending the capabilities of your program). So far it sounds great, I know right?
Now let me list off some issues (in order of me remembering them):
1. You can't unload them (due to some bs about dlopen), so you need to restart the application...
2. They bundle the stdlib like a regular Go binary, despite the fact that they're meant to be dynamic!
3. #2 wouldn't be so bad if they didn't also require identical versions of all dependencies in both binaries (meaning you'd need to vendor the dependencies, and also hope you are using the right Go version).
4. You need to use -trimpath or everything dies...
All in all, they are broken and no one is rushing to fix it (literally, the Go team said they aren't really supporting it currently...).
So what other options are there for making plugins in Go?
There's the Hashicorp method of using RPC, where you have two separate applications one the plugin, one the plugin server, and they communicate over RPC. I don't like it. Why? Because it feels like a hack, it's not really efficient and it carries a fear of a limitation that I don't like...
Then we come to a somewhat more clever approach: using Lua (or any other scripting language), it's well known, it's what everyone uses (at least in games...). But, it simply is too hard to use, all the Go Lua VMs I could find were simply too hard to set up...
Now we come to the most creative option I've seen yet: WASM. Now you ask "WASM!? But that's a web thing, how are you gonna make that work?" Indeed, my son, it is a web thing, but that doesn't mean I can't use it! Someone made a WASM VM for Go, and the pros are that you can use any WASM supporting language (i.e. any/all of them). Problem inefficient, PITA to use, and also suffers from the same issues that were preventing me from using Lua.
Enter Yaegi, a Go interpreter created by the same guys who made (and named) Traefik. Yes, you heard me right, an INTERPRETER (i.e. like python) so while it's not super performant (and possibly suffering from large inefficiency issues), it's very easy to set up, and it means that my plugins can still be written in Go (yay)! However, don't think this method doesn't have its own issues, there's still the problem of effectively abstracting different types of plugins without requiring too much boilerplate (a hard problem that I'm actively working on, commits coming soon). However, this still feels to be the best option.
As you can see, doing plugins in Go is a very hard problem. In the coming weeks (hopefully), I'm going to (attempt to at least) benchmark all the different options, as well as publish a library that should help make using Yaegi based plugins easier. All of this stuff will go (see what I did there 😉) in a nice blog post that better explains the issues and solutions. But until then I have some coding to do...
Have a good night(/day)!13
If a bug is logged don't mark it as resolved unless you commit that resolution.
Also don't mark it resolved without at least a one-liner of the fix/expected behavior.2
I've been working on an Emscripten emulation layer for a fledgling startup, and it's just a huge bitch. Seriously, Emscripten is the worst designed project I've ever seen. It embeds constants into a js file that it spits out. It turns out you can't fucking run the wasm that Emscripten emits without these magic constants from the js file.
Additionally, all the wasm imports that emscripten specifies are weirdly cased, with apparently no naming convention. They also use some weird, shitty vararg implementation when it already fucking knows exactly how many arguments are going to get passed to an import.
Also, there are a ton of broken things left over from when emscripten compiled to asm.js that they never bothered to replace with features from wasm. God knows how it even works.
I've ranted about this before, but here we go again:
I was racking my brains trying to figure out how one could possibly implement plugins easily in Go.
I had a look at using RPC, which requires far to much boilerplate to be realistic. I looked at using Lua, but there doesn't seem to be a straight forward way of using it. I was even about to go with using WASM (yes, WASM). But then I came across Yaegi ("Yet another elegant Go interpreter", you heard right: "interpreter"), Yaegi is also very easy to use.
There are a few issues (including some I haven't solved yet), including flexibility (multiple types of plugins), module support, etc. Fortunately, Traefik just released their plugin system which is based on Yaegi (same company), and I got to learn a few tricks from them.
Here's how module loading works: The developer vendors their dependencies and pushes them to a repo. The user downloads the repo as a zip and saves it to the plugins folder. I hash the zip, unzip it to a cache, and set the the GOPATH for the interpreter to be that extracted folder. I then load the module (which is defined by a config file in the folder), and save it for later. This is the relatively easy part.
The hard part is allowing for different types of plugins. It looks easy, but Go has a strict typing system, makes things complicated. I'm in the process of solving this problem, and so far it should go like this: Check that the plugin fits an arbitrary interface, and if it does, we're good the go. I will just have to apply the returned plugin to that interface. I don't like this method for a few reasons, but hopefully with generics it will become a bit more clean.1
- I have done this, this and this. I'm an amazing programmer even though i copied it from SO.
- Allright, could you explain this part since you did not write one single comment.
- (insert generic bullshit excuse)
you don't think he's the one getting the internship amd the summer job since he's the loudest? dear god, my fist, his face.3
2005, after I tried to program my computer to be quicker. By the time I realized that it was impossible, I was hooked.
So I did some testing with WebAssembly to see how it works in the most recent version and without Emscripten. I installed CMake and Visual Studio Community 2015 and compiled Binaryen, LLVM and Clang for a few hours (had to do it multiple times because I used the wrong version and forgot a compile flag), ended up with over 10 GB less free space on my laptop.
All that to compile a < 1kb C file to < 1kb WASM code.
At least it works for now and can natively run in (some) browsers.2
A big development company needed summer interns, the job required java and the likes and it was the first big interview i've had. This wasn't a problem, i thought, until i got there. worth noting is that Im still in school and and the last time i used java extensivly was a year prior to the interview. I completly blanked on the, rather basic, questions. needless to say, I didnt get it.2
I'm porting an OpenGL project to work with WebAssembly, I'm using emscripten to compile/generate the 'glue' to JS. Sofar I'm able to render my gl code properly through the glfw3 framework. I know you can use emscripten callbacks for input, however I was hoping to keep my existing glfw3 callback setup, that said the only callback that seems to be working properly is mouse position, window resize, keyboard, etc never get called. If anyone knows how to enable these I'd be super greatful!1
Hey devs, I'm doing a final year project for a company where I have to implement a solution using web assembly.
Now this can be anything at all from a new operating system to a virtual machine. Although I have something in mind I thought I'd ask the community too, do you guys have any interesting project ideas that can be implemented using web assembly?
I'm kind of excited about the development of Web assembly (wasm), and to see Blazor getting closer to a release is awesome.
Blazor Update: 'The End of the Experiment Is in Sight' -- Visual Studio Magazine
when I get the assignment of debugging my group members uncommented Java Swing application, I seriously have to untangle that mess for days
I read about wasm and being a web dev Im now scared.
So I want o learn c++. Even if not for wasm it would still be really cool to have that language in my toolbox.
Any recommendations where to start?6
Is JS effectively going to become the secondary option for web once the WASM is adapted? I know that JS isn't going to die, nothing ever really dies.