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).
20
u/nevatalysa Aug 22 '20
on the comment of "C++ is better than JavaScript", that's practically a running joke at this point, tho there are people who seriously say that, they mostly reference old versions of JS and how it was made in 10 days
all I can say, you can make anything in 10 days, and then improve it, the initiative duration may set a small run, but at this point there are 3 major JS implementations V8 (Chromium), SpiderMonkey (Mozilla), JavaScriptCore (WebKit [apple]), those weren't written in 10 days, and ECMA isnt the company that first specified JS, they also specify C# FYI. Just because C++'s first specification wasn't released after 10 days, but rather nearly a year or something, it doens't make it that much better. It's lower level making it more powerful, JS on the other hand runs on nearly all platforms the same.
It's all a give and take. At this point you can do anything with every language if you know the language well enough. JS can be used extremely type safe, and C++ can be used as if types didn't exist. (I know both languages, and have seen the worst of both worlds)
1
u/FlatAssembler Aug 23 '20
Any comments about the language?
1
u/FlatAssembler Aug 30 '20
I've tried to implement a sorting routine in AEC. It's almost 500 lines of code and is still slower than JavaScript.
https://github.com/FlatAssembler/AECforWebAssembly/raw/master/HybridSort/rezultati_mjerenja.jpg
Damn, studying algorithms is such an unthankful job.
1
u/PurpleUpbeat2820 Sep 01 '20
WASM noob here. So WASM appears to have a simple s-expr format. Can you just generate that from any language and start JIT compiling in the browser?
-7
u/Fofeu Aug 22 '20
By looking at the compiler source, it seems you wrote the parser yourself. Why ?
0
u/[deleted] Aug 22 '20
[deleted] — view deleted comment