Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Search - "emscripten"
-
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. -
My beard has grown during the time i've been waiting for Emscripten SDK to get installed
In Syria, my connection speed is 512kbps and Google repositories is blocked, so i had to run OpenVPN using a VPNBook account located in Poland to get everything working, and i guess you all know how connection speed is screwed when you use a VPN, i hardly got 300kbps
The bright side is having to do ZERO configurations on Linux before installation4 -
I like rants that are thought provoking and push a message forward regardless of whether they may sting a little, so for my first post on here I'd like to hit at home with many of you.
Html5 "Native" Applications are not needed. Let's cover mobile first of all, the misconception that apps are written in either javascript or Native android/ Native ios environment. Or even some third party paid tools like xamarin is quite strange to me. OpenGL ES is on both IOS and Android there is no difference. It's quite easy to write once run everywhere but with native performance and not having to jump through js when it's not needed. Personally I never want to see html or css if I'm working on a mobile app or desktop. Which brings me to desktop, I can't begin to describe how unthought out an electron app is. Memory usage, storage space for embedding chromium, web views gained at the expense of literally everything else, cross platform desktop development has been around for decades, openGL is everywhere enough said. Finally what about targeting browser if your writing a native app for mobile and desktop let's say in c++ and it's not in javascript how can it turn back into javascript, well luckily c++ has emscripten which does that simply put, or you could be using a cross complier language like haxe which is what I use. It benefits with type safety, while exporting both c++ and javascript code. Conclusion in reality I see the appeal to the js ecosystem it's large filled with big companies trying to make js cross development stronger every day. However development in my mind should be a series of choices, choices that are invisible don't help anyone, regardless of the popularity of the choice, or the skill required.8 -
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 -
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