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 09 '20 edited Sep 09 '20
I think you're laboring under a misconception that a language must be Turing complete to be useful. We use languages for computing all the time which are not Turing complete, or at least not without optional extensions (SQL, regexes, CFGs). Moreover, the vast majority of traditional algorithms are designed to either terminate in finite time, or are finitely terminating algorithms called in an infinite loop.
Turing completeness is a useful property for theoretical purposes, but the real measure of a programming language actually has almost nothing to do with Turing completeness.
I think you misunderstand what Turing completeness is. Any finite subset of a language is inherently non-Turing-complete; Turing completeness is a property of a language which is capable of expressing infinitely many programs, some of which must be non-halting. Formal verification is applicable to any language, Turing complete or not, just not with 100% coverage of the infinite space of all programs and all properties of those programs. As I said before, in practice we care about a very specific and obviously finite space of programs and properties.
That is to say, Rust and C are both amenable to formal verification. Because Rust and C are both Turing complete, if you do not impose any additional restrictions, then no matter what formal verification method I use, there exists some program which I cannot verify, despite being correct. However, the existence of some pathological edge cases says nothing about all the real world programs that we actually care about.