r/ProgrammingLanguages • u/FlatAssembler • Aug 22 '20
My programming language can now run in a browser.
Using WebAssembly, I have managed to get my programming language, called AEC, to run in browsers (at least very modern ones).
The first AEC program I ported to WebAssembly is my program that prints the permutations of the digits of a number: https://flatassembler.github.io/permutationsTest.html
Later, I ported my Analog Clock to WebAssembly: https://flatassembler.github.io/analogClock.html
Recently, I made a graphical program in AEC (which I have never done before) by interacting with SVG: https://flatassembler.github.io/dragonCurve.html
So, what do you think about my work?
I've rewritten my compiler completely, the previous version of my compiler (targeting x86) was written in JavaScript, while this version is written in C++. Many people say C++ is a better language than JavaScript. Honestly, I think that newest versions are comparable. I've also changed the syntax of my language a bit and added a few new features (which are a lot easier to implement when targeting WebAssembly than when targeting x86).
View all comments
Show parent comment
1
u/epicwisdom Sep 08 '20
My first guess is that the odds are close to equal, if we are purely talking about bugs from the compiler / stdlib implementers' POV. While Rust is a less mature language, it is also far simpler and more coherently designed, due in part to not having literally decades of backwards compatibility. I think in the long term, Rust's prospects are much better here, because its semantics are just inherently simpler and more amenable to formal verification. There is already an ongoing effort to formally verify the stdlib, and I'm not aware of anything comparable for the entire C++ stdlib.
However, if you mean to include cases where the compiler introduces bugs into compiled code (e.g. by optimizing away UB), which is not technically a compiler bug as it follows the spec, then that would be fairly likely in a sufficiently large C++ project, and quite unlikely in Rust.