Anybody here made their own programming language?

  • 89 Replies
  • 5460 Views
*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #60 on: June 24, 2020, 06:20:08 AM »
GitHub?
What about it? Well, yes, my code is available on GitHub. I could format my repository a lot better now, I started doing that back before I understood much about Git and GitHub (I commited a few large binary files). Maybe that would give me a few more forks, but, most likely, it won't.
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #61 on: July 04, 2020, 05:00:07 AM »
I've tried to make my program for sorting decimal numbers faster for nearly-sorted or nearly-reverse-sorted arrays by implementing the algorithm recursively, checking the sortedness of the array each iteration. I've implemented it in ArithmeticExpressionCompiler.
This time, I didn't make an executable program using FlatAssembler, but a static library that can be compiled using GNU Assembler and linked with, for instance, a C++ program that will test it. So, I can get more precise measurements of its performance. Now it works better than last time for nearly-sorted arrays (it's as fast as C++ "sort" directive), but it's around 50 times slower than C++ "sort" is if the array is randomly shuffled, and around 2 times slower than my last program was. Oddly, I thought I implemented QuickSort(running when the sortedness is near 0) much more efficiently now.

Implementing it as a static linking library rather than as an executable also makes it easier to see what's going on inside:

There also appears to be some surge in the number of QuickSorts executed when the sortedness is around 0.9 (when MergeSort will almost certainly do a better job), I can't figure out exactly why (yet alone that there is an easy fix).
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

Bullwinkle

  • The Elder Ones
  • 19790
  • Standard Idiot
Re: Anybody here made their own programming language?
« Reply #62 on: July 04, 2020, 09:31:05 PM »
This sounds dorky and incredibly fun.   
I know that feeling of satisfaction.   :)

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #63 on: July 07, 2020, 03:33:41 AM »
Quote from: Bullwinkle
This sounds dorky and incredibly fun.   
I know that feeling of satisfaction.   
Well, it does give you that feeling of satisfaction. Especially when you fix some mysterious bugs, such as (the one I just fixed) when your sorting routine crashes on apparently random inputs, such as this one:

And why would it be dorky? My professors seem to value what I am doing.
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #64 on: August 03, 2020, 01:27:41 PM »
I've begun developing an AEC-to-WebAssembly compiler, allowing AEC programs to run in a browser (only in super-modern ones, though). After having written more than 3'000 lines of code (I've rewritten the tokenizer and the parser into C++, people say it's a much better language than JavaScript is), I've successfully compiled the following program:
Code: [Select]
/*
 * After I've written 3'000 lines of code of my AEC-to-WebAssembly compiler,
 * I should finally be able to compile some simple AEC programs so that they
 * can run in a browser.
 */

Function add(Integer32 first,
        Integer32 second)
    Which Returns Integer32 Does
        Return first+second;
EndFunction

Function subtract(Integer32 first,
        Integer32 second)
    Which Returns Integer32 Does
        Return first-second;
EndFunction

Function multiply(Integer32 first,
        Integer32 second)
    Which Returns Integer32 Does
        Return first*second;
EndFunction

Function integerDivision(Integer32 first,
        Integer32 second)
    Which Returns Integer32 Does
        Return first/second;
EndFunction

Function decimalDivision(Integer32 first,
        Integer32 second)
    Which Returns Decimal32 Does
        Return Decimal32(first)/second; //"Decimal32(" here is the casting
                                        //operator, equivalent to the
                                        //C casting operator "(float)"
EndFunction

Function emptyFunction() Which Returns Nothing Does
    Nothing; //The compiler should no longer crash when compiling the
             //no-operation statement ("Nothing").
EndFunction

Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #65 on: August 04, 2020, 11:15:02 AM »
I've managed to compile some simple algorithms written in AEC to run in a browser:
Code: [Select]
/*
 * Can you think of a better way to test whether while-loops and
 * if-statements work than implementing Euclid's algorithm and Fibonacci
 * sequence?
 */

Function gcd(Integer32 a, Integer32 b) Which Returns Integer32 Does
    //So, this will be the Euclid's algorithm. But, first, let's deal with
    //the edge cases.
    If a<0 Then
        a:=a*-1; //Write in such a way that it will expose as many potential
                 //bugs in the compiler as you can.
    EndIf
    If b<0 Then
        b:=b/-1;
    EndIf
    If a=0 or b=0 Then
        Return 0;
    EndIf
    //And now goes the 2'300 years-old algorithm:
    While not(b=0) Loop
        If a>b Then
            a:=mod(a,b);
        Else
            If a=0 Then
                Return b;
            EndIf
            b:=mod(b,a);
        EndIf
    EndWhile
    Return a;
EndFunction

Decimal64 memoisation[100]:={0,1},i; //When local variables haven't yet
                                     //been implemented, I need to use
                                     //global variables. Also, I'll be
                                     //using floating-point numbers,
                                     //because a lack of precision is way
                                     //better than overflow in this case,
                                     //I think.

Function fib(Integer32 n) Which Returns Decimal64 Does
    If n<0 or n>99 Then
        Return -1; //As some sort of sign of error.
    EndIf
    If memoisation[n] Then //If it's already been calculated,
        Return memoisation[n]; //simply return it.
    EndIf
    i:=1; //Find where the memoisation ends...
    While memoisation[i] and i<n Loop
        i:=i+1;
    EndWhile
    //Now calculate using what's already been calculated...
    While i<n or i=n Loop
        If i=0 Then
            memoisation[i]:=0;
        ElseIf i=1 Then //Not needed, but it should compile correctly.
            memoisation[i]:=1;
        Else
            memoisation[i]:=memoisation[i-1]+memoisation[i-2];
        EndIf
        i:=i+1;
    EndWhile
    Return memoisation[n];
EndFunction

Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #66 on: August 05, 2020, 01:25:28 PM »
I've managed to get some recursive algorithms written in AEC to compile to WebAssembly:
Code: [Select]
/*
 * I'll implement some recursive algorithms, to see whether the recursion
 * works as expected.
 */

Function sumFirst(Integer32 n) Which Returns Integer32 Does
    //First, let's test whether local variables are implemented correctly.
    If n<0 or n>199 Then
        Return -1; //A sign of error.
    EndIf
    Integer32 localArray[200]:={0,1,3},i:=3;
    If localArray[n] or n=0 Then
        Return localArray[n];
    EndIf
    While i<n or i=n Loop
        localArray[i]:=localArray[i-1]+i;
        i:=i+1;
    EndWhile
    Return localArray[n];
EndFunction

Decimal64 memoisationOfFibonacci[200]:={0,1};

Function fib(Integer32 n) Which Returns Decimal64 Does
    //Let's now test whether the recursion works.
    If n<0 or n>199 Then
        Return -1; //As a sign of error.
    ElseIf not(memoisationOfFibonacci[n]=0) Then
    /*
     * Simply putting "If memoisationOfFibonacci[n]=0 Then" causes the
     * JavaScript Virtual Machine to abort the program with error message
     * that a certain float is out of range of i32 and can't be converted
     * to it.
     */
        Return memoisationOfFibonacci[n];
    ElseIf n=0 Then
        Return 0;
    Else
        memoisationOfFibonacci[n]:=fib(n-1)+fib(n-2);
        Return memoisationOfFibonacci[n];
    EndIf
EndFunction

Function fact(Integer32 n) Which Returns Decimal64 Does
    If n<0 Then
        Return -1;
    EndIf
    Decimal64 fact; //Just to make sure no form of declaring local variables
                    //is left untested.
    fact:=1;
    Integer32 i;
    i:=1;
    While i<n or i=n Loop
        fact:=fact*i;
        i:=i+1;
    EndWhile
    Return fact;
EndFunction

Function empty_function() Which Returns Nothing Does
    Nothing; //Let's put this simple edge-case test into every test suite.
EndFunction

Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #67 on: August 08, 2020, 01:48:10 PM »
I've managed to compile the permutations algorithm written in AEC to WebAssembly:
Code: [Select]
/*
 * This will be a test to see whether calling JavaScript functions from AEC
 * works as expected. It will also attempt to expose as many potential compiler
 * bugs as possible by implementing the permutations algorithm.
 */

//So, those are JavaScript functions which I am planning to call from AEC:
Function printInt(Integer32 int) Which Returns Nothing Is External;
Function printString(CharacterPointer ptr) Which Returns Nothing Is External;
Function clearScreen() Which Returns Nothing Is External;

//JavaScript equivalent of C "strlen" is the "length" property of a string
// and there is, as far as I know, no way to call it from outside of JS.
//Nevertheless, I think I can easily write it myself.
Function strlen(CharacterPointer ptr) Which Returns Integer32 Does
    Return ValueAt(ptr) = 0 ?
                                0
                            :
                                1 + strlen(ptr + 1);
EndFunction

Integer32 originalNumberOfDigits[10];
Integer32 NDEBUG := 1;
Integer32 numberOfPermutations;

Function recursiveProcedure(CharacterPointer currentAttempt)
    Which Returns Nothing Does
    Integer32 lengthOfTheCurrentAttempt := strlen(currentAttempt);
    If not(NDEBUG) Then
        printString(
            "DEBUG: \"recursiveProcedure\" has been invoked with the argument: \""
            );
        printString(currentAttempt);
        printString("\". \"strlen\" says it has length of ");
        printInt(lengthOfTheCurrentAttempt);
        printString(".\n");
    EndIf
    Integer32 currentNumberOfDigits[10] :=
        {0, 0, 0, 0, 0,
         0, 0, 0, 0, 0};
    Integer32 i := 0;
    While i<lengthOfTheCurrentAttempt Loop
        currentNumberOfDigits[ValueAt(currentAttempt + i) - '0'] :=
            currentNumberOfDigits[ValueAt(currentAttempt + i) - '0'] + 1;
        i := i + 1;
    EndWhile
    If not(NDEBUG) Then
        i := 0;
        While i < 10 Loop
            printString("DEBUG: The current number has ");
            printInt(currentNumberOfDigits[i]);
            printString(" digits '");
            printInt(i);
            printString("'.\n");
            i := i + 1;
        EndWhile
    EndIf
    i := 0;
    While i < 10 Loop
        If currentNumberOfDigits[i] > originalNumberOfDigits[i] Then
            If not(NDEBUG) Then
                printString("DEBUG: There are too many digits '");
                printInt(i);
                printString("', ending \"recursiveProcedure\".\n");
            EndIf
            Return;
        EndIf
        i := i + 1;
    EndWhile
    Integer32 haveWeFoundAPermutation := 1;
    i := 0;
    While i < 10 Loop
        If currentNumberOfDigits[i] < originalNumberOfDigits[i] Then
            haveWeFoundAPermutation := 0;
        EndIf
        i := i + 1;
    EndWhile
    If haveWeFoundAPermutation Then
        printString("Permutation #");
        numberOfPermutations:=numberOfPermutations+1;
        printInt(numberOfPermutations);
        printString(": ");
        printString(currentAttempt);
        printString("\n");
        Return;
    EndIf
    Character digitWeAreAdding := '0';
    While digitWeAreAdding < '9' + 1 Loop //The less-than-or-equal operator
                                          //">=" hasn't yet been implemented.
        Character newAttempt[12];
        i := 0;
        While i < 12 Loop
            If i < lengthOfTheCurrentAttempt Then
                newAttempt[i] := ValueAt(currentAttempt + i);
            Else
                newAttempt[i] := 0;
            EndIf
            i := i + 1;
        EndWhile
        newAttempt[lengthOfTheCurrentAttempt] := digitWeAreAdding;
        If currentNumberOfDigits[digitWeAreAdding - '0'] <
            originalNumberOfDigits[digitWeAreAdding - '0'] Then //To speed
                                                                //things up
                                                                //a bit.
            recursiveProcedure(AddressOf(newAttempt[0]));
        EndIf
        digitWeAreAdding := digitWeAreAdding + 1;
    EndWhile
EndFunction

Function printPermutationsOfDigits(Integer32 original)
    Which Returns Nothing Does
    clearScreen();
    If original < 0 Then
        original := -original;
    EndIf
    printString("Printing all the permutations of digits of the number: ");
    printInt(original); //Unfortunately, the JavaScript standard library
                        //doesn't have "printf".
    printString("\n");
    Integer32 i := 0;
    While i < 10 Loop
        originalNumberOfDigits[i] :=     0;
        i                         := i + 1;
    EndWhile
    If original = 0 Then
        originalNumberOfDigits[0] := 1;
    EndIf
    While original > 0 Loop
        originalNumberOfDigits[mod(original, 10)] :=
            originalNumberOfDigits[mod(original, 10)] + 1;
        original := original / 10;
    EndWhile
    If not(NDEBUG) Then
        i := 0;
        While i < 10 Loop
            printString("DEBUG: The original number has ");
            printInt(originalNumberOfDigits[i]);
            printString(" digits '");
            printInt(i);
            printString("'.\n");
            i := i + 1;
        EndWhile
    EndIf
    numberOfPermutations := 0;
    recursiveProcedure("");
    printString("The end!");
EndFunction

Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #68 on: August 09, 2020, 11:14:32 AM »
Just managed to compile the Analog Clock in AEC, previously runnable only on Linux and DOS (DJGPP), to be runnable in a browser. The code is rather long, and I had to implement parts of the math library (WebAssembly doesn't have the "sin" function built-in).
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

?

Jamie

  • 1723
  • Retired
Re: Anybody here made their own programming language?
« Reply #69 on: August 19, 2020, 12:22:17 PM »
I tried briefly to make my own programming language in basic on my C64. It came with a desktop-style CLI I was also programming on it.

It was fun. I programmed all kinds of programs it would load if you for example typed "Calculator" or "School math program"

This was like 10 years ago, fun times.
What's C64? Never heard of it, to be honest. Can you share some example programs?

What's C64?

Way to make me feel old, dude.
"Conspiracy theorists actually believe in the conspiracy because that is more comforting." - Alan Moore

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #70 on: August 19, 2020, 12:30:59 PM »
I've implemented a Dragon Curve in AEC:
Code: [Select]
/*
 * This will be my attempt to build a graphical application with AEC.
 */

//Let's import some JavaScript functions...
Function drawLine(Integer32 x1,
                  Integer32 y1,
                  Integer32 x2,
                  Integer32 y2,
                  CharacterPointer color,
                  Integer32 lineWidth) Which Returns Nothing Is External;
Function applyTurtleTransformation(Integer32 translateX,
                                   Integer32 translateY,
                                   Integer32 rotateDegrees)
    Which Returns Nothing Is External; //We won't use the turtle for actual
                                       //drawing, but we will move it and
                                       //rotate it.

Integer32 directionX[4]    := { 0, 1, 0, -1},
          directionY[4]    := {-1, 0, 1,  0},
          currentX         := 15,
          currentY         := 250,
          currentDirection := 0,
          lineLength       := 5,
          lineWidth        := 2,
          currentStep      := 0;

Character path[16384], reversedPath[16384];

//Again, we need to implement string manipulation functions. Like I've said,
//even though this program will be running on JavaScript Virtual Machine, it
//can't call the methods of the JavaScript "String" class.
Function strlen(CharacterPointer str) Which Returns Integer32 Does
    //We can't implement this recursively, like we did in earlier AEC
    //programs, because we will be dealing with large strings which will
    //cause stack overflow.
    Integer32 length := 0;
    While ValueAt(str + length) Loop
        length := length + 1;
    EndWhile
    Return length;
EndFunction

Function strcpy(CharacterPointer dest,
                CharacterPointer src) Which Returns Nothing Does
    While ValueAt(src) Loop
        ValueAt(dest) := ValueAt(src);
        dest          :=     dest + 1;
        src           :=      src + 1;
    EndWhile
    ValueAt(dest) := 0;
EndFunction

Function reverseString(CharacterPointer string) Which Returns Nothing Does
    CharacterPointer pointerToLastCharacter := string + strlen(string) - 1;
    While pointerToLastCharacter - string > 1 Loop
        Character tmp                   := ValueAt(string);
        ValueAt(string)                 := ValueAt(pointerToLastCharacter);
        ValueAt(pointerToLastCharacter) := tmp;
        string                          := string + 1;
        pointerToLastCharacter          := pointerToLastCharacter - 1;
    EndWhile
EndFunction

Function strcat(CharacterPointer dest,
                CharacterPointer src) Which Returns Nothing Does
    strcpy(dest + strlen(dest), src);
EndFunction

//This is the function that's supposed to be called by JavaScript as soon
//as it is ready.
Function init() Which Returns Nothing Does
    CharacterPointer path         := AddressOf(path[0]);
    CharacterPointer reversedPath := AddressOf(reversedPath[0]);
    strcpy(path,"R");
    Integer32 counter := 0;
    While strlen(path) < 8192 Loop
        strcpy(reversedPath, path);
        If mod(counter, 4) = 0 Then
            reverseString(reversedPath);
        EndIf
        strcat(path, reversedPath);
        strcat(path, not(mod(counter,4))?"L":"LLL");
        counter := counter + 1;
    EndWhile
EndFunction

//This function is supposed to be periodically called by JavaScript:
Function step() Which Returns Nothing Does
    If currentStep < 8192 and currentX > 0 and currentX < 500
       and currentY > 0 and currentY < 500 Then
        Integer32 nextX := currentX + directionX[currentDirection] * lineLength,
                  nextY := currentY + directionY[currentDirection] * lineLength;
        drawLine(currentX, currentY, nextX, nextY,
                 currentStep=0?
                    "lightYellow"
                 :path[currentStep]='R'?
                    "red"
                 :path[currentStep]='L'?
                    "lightGreen"
                 :  "lightBlue",
                 lineWidth);
        currentX    := nextX;
        currentY    := nextY;
        If path[currentStep]='R' Then
            currentDirection := mod(currentDirection + 1, 4);
        ElseIf not(currentDirection=0) and path[currentStep]='L' Then
            currentDirection := currentDirection - 1;
        ElseIf path[currentStep]='L' Then
            currentDirection := 3;
        EndIf
        currentStep := currentStep + 1;
        applyTurtleTransformation(currentX, currentY, currentDirection*90);
    EndIf
EndFunction

To accomplish that, I needed to fix a few bugs in the compiler.
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #71 on: August 19, 2020, 12:32:56 PM »
I tried briefly to make my own programming language in basic on my C64. It came with a desktop-style CLI I was also programming on it.

It was fun. I programmed all kinds of programs it would load if you for example typed "Calculator" or "School math program"

This was like 10 years ago, fun times.
What's C64? Never heard of it, to be honest. Can you share some example programs?

What's C64?

Way to make me feel old, dude.
Well, it's way more important to know what WebAssembly is than to know what C64 was, right?
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

?

Jamie

  • 1723
  • Retired
Re: Anybody here made their own programming language?
« Reply #72 on: August 19, 2020, 01:07:34 PM »
Beats me. I ain't the guy to talk to about programming. It's all gibberish to me.
"Conspiracy theorists actually believe in the conspiracy because that is more comforting." - Alan Moore

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #73 on: August 20, 2020, 12:26:18 PM »
Beats me. I ain't the guy to talk to about programming. It's all gibberish to me.
Well, it's not gibberish if you can see it working.
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

markjo

  • Content Nazi
  • The Elder Ones
  • 41795
Re: Anybody here made their own programming language?
« Reply #74 on: August 20, 2020, 01:23:20 PM »
I tried briefly to make my own programming language in basic on my C64. It came with a desktop-style CLI I was also programming on it.

It was fun. I programmed all kinds of programs it would load if you for example typed "Calculator" or "School math program"

This was like 10 years ago, fun times.
What's C64? Never heard of it, to be honest. Can you share some example programs?

What's C64?

Way to make me feel old, dude.
C64 is Vic 20's big brother.
Science is what happens when preconception meets verification.
Quote from: Robosteve
Besides, perhaps FET is a conspiracy too.
Quote from: bullhorn
It is just the way it is, you understanding it doesn't concern me.

Re: Anybody here made their own programming language?
« Reply #75 on: August 20, 2020, 11:58:59 PM »
I tried briefly to make my own programming language in basic on my C64. It came with a desktop-style CLI I was also programming on it.

It was fun. I programmed all kinds of programs it would load if you for example typed "Calculator" or "School math program"

This was like 10 years ago, fun times.
What's C64? Never heard of it, to be honest. Can you share some example programs?

What's C64?

Way to make me feel old, dude.
C64 is Vic 20's big brother.
I was more of a Sinclair person myself. 
Gotta love the screech of the cassette tape loading.:)
“Once, every village had an idiot. It took the internet to bring them all together.”

Re: Anybody here made their own programming language?
« Reply #76 on: August 21, 2020, 11:11:27 AM »
I had an Amstrad.  Dodgy built in tape deck that you had to slam with the palm of your hand once you heard the motor struggling.

It was actually a nice machine  (aside from the tape deck) - 64k of memory was sweeet.

Ah, the glory days of British computing...
Quote from: mikeman7918
a single photon can pass through two sluts

Quote from: Chicken Fried Clucker
if Donald Trump stuck his penis in me after trying on clothes I would have that date and time burned in my head.

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #77 on: August 22, 2020, 10:01:17 AM »
Today, I've opened a Reddit thread about my programming language. The responses seem very positive.
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #78 on: August 29, 2020, 04:58:01 AM »
I've implemented my hybrid sorting algorithm in the new version of AEC, to see how it compares with JavaScript "Array.sort". It's significantly slower:

Studying algorithms is not a very thankful job.
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #79 on: August 30, 2020, 01:22:53 AM »
I've written some specification for my programming language. A programming language isn't really a programming language without a specification.
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #80 on: October 05, 2020, 01:32:34 AM »
I've recently implemented some basic support for data structures into my programming language.
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #81 on: October 17, 2020, 06:00:32 AM »
I've made another video about my programming language:
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #82 on: November 11, 2020, 12:11:48 AM »
I tried briefly to make my own programming language in basic on my C64. It came with a desktop-style CLI I was also programming on it.

It was fun. I programmed all kinds of programs it would load if you for example typed "Calculator" or "School math program"

This was like 10 years ago, fun times.
What's C64? Never heard of it, to be honest. Can you share some example programs?

What's C64?

Way to make me feel old, dude.
Is C64 something similar to what PicoBlaze is now? I've made a PicoBlaze Simulator in JavaScript as a part of a university project.
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #83 on: February 17, 2021, 06:26:52 AM »
I have implemented my solution to the N-Queens Problem, one of the classical problems in computer science, in my programming language: https://flatassembler.github.io/nQueensPuzzle.html
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

Stash

  • 7618
Re: Anybody here made their own programming language?
« Reply #84 on: February 17, 2021, 11:18:28 PM »
I have implemented my solution to the N-Queens Problem, one of the classical problems in computer science, in my programming language: https://flatassembler.github.io/nQueensPuzzle.html

Cool. Check out this person's version:

https://giovanni-orlando.com/n-queens/

It solved for 30 Q's and can seemingly go higher. It took 20 seconds, must be doing some serious computations. 

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #85 on: February 18, 2021, 12:49:52 PM »
I have implemented my solution to the N-Queens Problem, one of the classical problems in computer science, in my programming language: https://flatassembler.github.io/nQueensPuzzle.html

Cool. Check out this person's version:

https://giovanni-orlando.com/n-queens/

It solved for 30 Q's and can seemingly go higher. It took 20 seconds, must be doing some serious computations.
Does it try to calculate all possible solutions, like mine does? Or does it find a random one? To me it seems as though it finds a random one, and spends most of the time drawing it.
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

boydster

  • Assistant to the Regional Manager
  • Planar Moderator
  • 16035
  • FREEDOIS IS ᗡIИIRG!
Re: Anybody here made their own programming language?
« Reply #86 on: February 18, 2021, 01:13:45 PM »
I have implemented my solution to the N-Queens Problem, one of the classical problems in computer science, in my programming language: https://flatassembler.github.io/nQueensPuzzle.html

Cool. Check out this person's version:

https://giovanni-orlando.com/n-queens/

It solved for 30 Q's and can seemingly go higher. It took 20 seconds, must be doing some serious computations.
Does it try to calculate all possible solutions, like mine does? Or does it find a random one? To me it seems as though it finds a random one, and spends most of the time drawing it.
If you choose a number less than or equal to 8, and then check the "Solve for N" box, it calculates all the solutions.

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #87 on: February 19, 2021, 06:11:42 AM »
I have implemented my solution to the N-Queens Problem, one of the classical problems in computer science, in my programming language: https://flatassembler.github.io/nQueensPuzzle.html

Cool. Check out this person's version:

https://giovanni-orlando.com/n-queens/

It solved for 30 Q's and can seemingly go higher. It took 20 seconds, must be doing some serious computations.
Does it try to calculate all possible solutions, like mine does? Or does it find a random one? To me it seems as though it finds a random one, and spends most of the time drawing it.
If you choose a number less than or equal to 8, and then check the "Solve for N" box, it calculates all the solutions.
Oh, I have somehow missed that.
Anyway, I have added the ability draw ASCII-art chessboards to my program. If you click the checkbox labeled Print chess-boards using ASCII art, you will receive this kind of output:
Code: [Select]
Solving the n-queens puzzle for 6:
A2 B4 C6 D1 E3 F5
  +-+-+-+-+-+-+
 6| |*|Q|*| |*|
  +-+-+-+-+-+-+
 5|*| |*| |*|Q|
  +-+-+-+-+-+-+
 4| |Q| |*| |*|
  +-+-+-+-+-+-+
 3|*| |*| |Q| |
  +-+-+-+-+-+-+
 2|Q|*| |*| |*|
  +-+-+-+-+-+-+
 1|*| |*|Q|*| |
  +-+-+-+-+-+-+
   A B C D E F
A3 B6 C2 D5 E1 F4
  +-+-+-+-+-+-+
 6| |Q| |*| |*|
  +-+-+-+-+-+-+
 5|*| |*|Q|*| |
  +-+-+-+-+-+-+
 4| |*| |*| |Q|
  +-+-+-+-+-+-+
 3|Q| |*| |*| |
  +-+-+-+-+-+-+
 2| |*|Q|*| |*|
  +-+-+-+-+-+-+
 1|*| |*| |Q| |
  +-+-+-+-+-+-+
   A B C D E F
A4 B1 C5 D2 E6 F3
  +-+-+-+-+-+-+
 6| |*| |*|Q|*|
  +-+-+-+-+-+-+
 5|*| |Q| |*| |
  +-+-+-+-+-+-+
 4|Q|*| |*| |*|
  +-+-+-+-+-+-+
 3|*| |*| |*|Q|
  +-+-+-+-+-+-+
 2| |*| |Q| |*|
  +-+-+-+-+-+-+
 1|*|Q|*| |*| |
  +-+-+-+-+-+-+
   A B C D E F
A5 B3 C1 D6 E4 F2
  +-+-+-+-+-+-+
 6| |*| |Q| |*|
  +-+-+-+-+-+-+
 5|Q| |*| |*| |
  +-+-+-+-+-+-+
 4| |*| |*|Q|*|
  +-+-+-+-+-+-+
 3|*|Q|*| |*| |
  +-+-+-+-+-+-+
 2| |*| |*| |Q|
  +-+-+-+-+-+-+
 1|*| |Q| |*| |
  +-+-+-+-+-+-+
   A B C D E F
Found 4 solutions!
I am not sure why drawing such ASCII-art slows it down significantly. Maybe you can figure out. The source code is available here: https://flatassembler.github.io/nQueensPuzzle.aec.html
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0

*

boydster

  • Assistant to the Regional Manager
  • Planar Moderator
  • 16035
  • FREEDOIS IS ᗡIИIRG!
Re: Anybody here made their own programming language?
« Reply #88 on: March 18, 2021, 08:20:41 AM »
I think you should program a chatbot, FlatAssembler. It could be educational research!

*

FlatAssembler

  • 479
  • Not a FE-er
Re: Anybody here made their own programming language?
« Reply #89 on: July 29, 2021, 06:25:05 AM »
I have tried to add a feature to my AEC-to-WebAssembly compiler that it suggests corrections for misspelled function or variable names, using the Longest Common Subsequence algorithm. However, now that compiler crashes if compiled with CLANG on Windows or Visual Studio on Windows, and it is set to compile the Analog Clock example. It runs into Stack Overflow then, if I am interpreting the error messages from the debugger correctly, when compiling the line 358 ( https://github.com/FlatAssembler/AECforWebAssembly/blob/9653c623bdd713f164482fee1ff7cdd5d0972d80/analogClock/analogClock.aec#L358 ). The error does not occur on Emscripten, on any version of GCC that I have tried or if optimization is enabled in CLANG (using -O3, it only occurs in CLANG on Windows under default optimization). Can somebody help me figure out what is going on?
I have opened a GitHub issue about it, on which you can see what the Visual Studio Debugger outputs when that Stack Overflow occurs: https://github.com/FlatAssembler/AECforWebAssembly/issues/5
By the way, which algorithm would you be using for suggesting corrections for misspelled variable, function and structure names? I was first using LCS ( https://github.com/FlatAssembler/AECforWebAssembly/blob/9653c623bdd713f164482fee1ff7cdd5d0972d80/TreeNode.cpp#L99 ), but I am quite sure it is not the most appropriate (sometimes suggesting a very long variable name which has that misstyped variable name as substring, rather than the much-shorter variable name the programmer more likely intended), so I switched to Levenstein distance ( https://github.com/FlatAssembler/AECforWebAssembly/blob/31d2ccf802603d61b3b723046649f30500ef96c0/TreeNode.cpp#L117 ). However, Levenstein distance will still consider variable names "PRECISION" and "precision" to have no similarity, but, as far as the programmer is concerned, they probably do. So, again, which algorithm would you suggest?
Fan of Stephen Wolfram.
This is my parody of the conspiracy theorists:
https://www.theflatearthsociety.org/forum/index.php?topic=71184.0