Anyone here made their own programming language?
-
- Master of the Forum
- Posts: 1452
- Joined: Tue Oct 27, 2015 3:46 pm
- Diet: Vegan
Re: Anyone here made their own programming language?
Yesterday evening, I published another YouTube video about my programming language: https://youtu.be/YFZ-45ea5mo
-
- Master of the Forum
- Posts: 1452
- Joined: Tue Oct 27, 2015 3:46 pm
- Diet: Vegan
Re: Anyone here made their own programming language?
Apparently, not everybody thinks I can be trusted about programming just because I made a programming language: https://discord.com/channels/1720184990 ... 7450117121
stuxxnet wrote:you've also written a log function that runs in an infinite loop if the input is close to 1Teo Samarzija wrote: Come on now, I have written a programming language that compiles to WebAssembly, I know that stuff.
you're trying to compare sort functions written in an interpreted language to those provided by that language in its native VM
you're overfitting measurement data to come up with a completely insane formula for the comparisons of quicksort
you're using rand in c++ code
you implement custom math functions using highschool maths that just doesn't work if you want to be numerically efficient or just even get a sane result for the whole range of possible inputs.
I'm sorry, but I really don't have much confidence in your judgement calls...
-
- Master of the Forum
- Posts: 1452
- Joined: Tue Oct 27, 2015 3:46 pm
- Diet: Vegan
Re: Anyone here made their own programming language?
I have written my solution to the N-Queens Puzzle in my programming language: https://flatassembler.github.io/nQueensPuzzle.html
-
- Master of the Forum
- Posts: 1452
- Joined: Tue Oct 27, 2015 3:46 pm
- Diet: Vegan
Re: Anyone here made their own programming language?
I made executable files for the AECforWebAssembly v1.5.6, because it seems to parse code 10 times faster than AECforWebAssembly v1.5, just because of some trivial (and mysterious as to how they could drastically speed up the parsing) fixes: https://sourceforge.net/projects/aecfor ... es/v1.5.6/
I have managed to tweak it to work in CLANG, but it still does not work in Visual Studio C++. Namely, my compiler runs into Stack Overflow error when set to compile complicated example programs if it itself is compiled using some C++ compilers.
I have managed to tweak it to work in CLANG, but it still does not work in Visual Studio C++. Namely, my compiler runs into Stack Overflow error when set to compile complicated example programs if it itself is compiled using some C++ compilers.
-
- Master of the Forum
- Posts: 1452
- Joined: Tue Oct 27, 2015 3:46 pm
- Diet: Vegan
Re: Anyone here made their own programming language?
I have added a few more features to the compiler for my programming language, including lvalue conditional operator and multi-line strings, both of them from C++.
-
- Master of the Forum
- Posts: 1452
- Joined: Tue Oct 27, 2015 3:46 pm
- Diet: Vegan
Re: Anyone here made their own programming language?
I have just written a program that converts Arabic numbers to Roman numbers in my programming language.
-
- Master of the Forum
- Posts: 1452
- Joined: Tue Oct 27, 2015 3:46 pm
- Diet: Vegan
Re: Anyone here made their own programming language?
So, thanks to the help from people on the VOGONS forum, I have managed to make my AEC-to-x86 compiler target i486. Now you can, for example, use it in DosBox.
-
- Master of the Forum
- Posts: 1452
- Joined: Tue Oct 27, 2015 3:46 pm
- Diet: Vegan
Re: Anyone here made their own programming language?
Here is my first AEC 16-bit DOS program:
Code: Select all
;This is my attempt to port "rose.aec" to 16-bit DOS, using FlatAssembler.
;My previous DOS example, "anlalogClockForDOS.aec" is 32-bit and is assembled
;using GNU Assembler.
;Notice that we CANNOT use arrays here, as ArithmeticExpressionCompiler uses
;"ebx" to index arrays, which works in 32-bit and 64-bit mode, but doesn't work
;in the 16-bit mode.
AsmStart
format binary as "COM"
org 100h
use16
AsmEnd
y:=0
While y<24
x:=0
While x<79
distance:=sqrt(pow(abs((x-40)/2),2)+pow(abs(y-12),2))
angle:=atan2(y-12,(x-40)/2)
r:=cos(angle*3)*12
If (distance < (r + 0.5) ) | ( (y = 12) & (x > 40-1) & (x < 40 + (13 * 2) ) )
AsmStart
mov dl,'*'
mov ah,2
int 0x21
AsmEnd
Else
AsmStart
mov dl,' '
mov ah,2
int 0x21
AsmEnd
EndIf
x:=x+1
EndWhile
AsmStart
mov dl,0xa ;The newline character
mov ah,2
int 0x21
AsmEnd
y:=y+1
EndWhile
AsmStart
int 0x20
result dd ?
x dd ?
y dd ?
distance dd ?
angle dd ?
r dd ?
AsmEnd
-
- Master of the Forum
- Posts: 1452
- Joined: Tue Oct 27, 2015 3:46 pm
- Diet: Vegan
Re: Anyone here made their own programming language?
Recently, I got the Starstruck achievement on GitHub, as my AEC-to-WebAssembly compiler got its 16th star: https://github.com/FlatAssembler?achiev ... hievements
-
- Master of the Forum
- Posts: 1452
- Joined: Tue Oct 27, 2015 3:46 pm
- Diet: Vegan
Re: Anyone here made their own programming language?
I've tried to write a as-portable-as-possible script for downloading the source code and building the Analog Clock in AEC.
For AEC-to-x86:
For AEC-to-WebAssembly:
Is there anybody knowledgeable about various operating systems here to know how to make the scripts better? @TelepathyConspiracy, you mentioned you considered making your own operating system, so perhaps you are knowledgeable about those things?
For AEC-to-x86:
Code: Select all
mkdir ArithmeticExpressionCompiler
cd ArithmeticExpressionCompiler
if [ $(command -v wget > /dev/null 2>&1 ; echo $?) -eq 0 ] # Check if "wget" exists, see those StackOverflow answers for more details:
# https://stackoverflow.com/a/75103891/8902065
# https://stackoverflow.com/a/75103209/8902065
then
wget https://flatassembler.github.io/Duktape.zip
else
curl -o Duktape.zip https://flatassembler.github.io/Duktape.zip
fi
unzip Duktape.zip
if [ $(command -v gcc > /dev/null 2>&1 ; echo $?) -eq 0 ]
then
gcc -o aec aec.c duktape.c -lm # The linker that comes with recent versions of Debian Linux insists that "-lm" is put AFTER the source files, or else it outputs some confusing error message.
else
clang -o aec aec.c duktape.c -lm
fi
./aec analogClock.aec
if [ $(command -v gcc > /dev/null 2>&1 ; echo $?) -eq 0 ]
then
gcc -o analogClock analogClock.s -m32
else
clang -o analogClock analogClock.s -m32
fi
./analogClock
Code: Select all
if [ $(command -v git > /dev/null 2>&1 ; echo $?) -eq 0 ]
then
git clone https://github.com/FlatAssembler/AECforWebAssembly.git
cd AECforWebAssembly
elif [ $(command -v wget > /dev/null 2>&1 ; echo $?) -eq 0 ]
then
mkdir AECforWebAssembly
cd AECforWebAssembly
wget https://github.com/FlatAssembler/AECforWebAssembly/archive/refs/heads/master.zip
unzip master.zip
cd AECforWebAssembly-master
else
mkdir AECforWebAssembly
cd AECforWebAssembly
curl -o AECforWebAssembly.zip -L https://github.com/FlatAssembler/AECforWebAssembly/archive/refs/heads/master.zip # Without the "-L", "curl" will store HTTP Response headers of redirects to the ZIP file instead of the actual ZIP file.
unzip AECforWebAssembly.zip
cd AECforWebAssembly-master
fi
if [ $(command -v g++ > /dev/null 2>&1 ; echo $?) -eq 0 ]
then
g++ -std=c++11 -o aec AECforWebAssembly.cpp # "-std=c++11" should not be necessary for newer versions of "g++". Let me know if it is, as that probably means I disobeyed some new C++ standard (say, C++23).
else
clang++ -o aec AECforWebAssembly.cpp
fi
cd analogClock
../aec analogClock.aec
npx -p wabt wat2wasm analogClock.wat
node analogClock