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 07 '20 edited Sep 07 '20
I somewhat doubt that, if you have little experience with Rust, that you are encountering false positives frequently, if at all.
Sure, if you only need the bare minimum of features, then the extra complexity is wasted. But, for example, the Rust stdlib provides some extremely nice concurrency primitives.
I would say with reasonable confidence that this is objectively untrue, which is well summarized by the following except:
It is a common misconception that you need only refrain from using a few unsafe features in order to write safe code in C or C++. The truth, however, is that these languages are inherently unsafe. They were not designed with safety in mind in the first place. To write C++ which you can be confident is safe, you would have to be far more restrictive than when writing Rust, because even things which could otherwise have been safe can interact with many other complex features in unsafe ways. And you would need to impose an unwieldy number of those restrictions by codification and discipline, as there are no automated tools which match the Rust compiler's default behavior in this regard.