17
typosaurus
264d

Wrote a language using C in a few days that can execute this:

If you have the base correct, it gets boring.

I spend a lot of time in research to write smth like this

Comments
  • 6
    I am disappointed in the picture of your screen... I thought we were better than this?
  • 5
    @Demolishun it gives a retro look
  • 4
    I love the semicolon free syntax!
  • 4
    It even supports Dutch function names.
  • 1
    It's slower than python but I know why
  • 2
    @retoor wow you wrote a language? I’m new to coding and would be interested in learning it. Is there documentation or some sort of tutorial that could help me get started?
  • 1
    It has a GC? Or everything is stack allocated for now?

    ...... or there perhaps is no memory management?
  • 3
    @fumey learn to program first if you don't know how.

    https://cs50.harvard.edu/x

    This guy does a complete series on compilers and shows how to make one that compiles and runs code on .Net:

    https://youtube.com/watch/...

    I started watching this and kind of lost interest part way through. Here is a compiler book you can download:

    https://iitd-plos.github.io/col729/...
  • 3
    @fumey craftinginterpreters.com / https://buildyourownlisp.com

    The second one learns you basics as well.

    I miss a stdlib in my language. Without access to files / sockets you can't do anything useful with it
  • 0
    @AlgoRythm is garbage collected, wasn't hard
  • 1
    Lexer/Tokenizer = Syntax error check and gets tokens
    Parser = creates AST Tree
    Basicly done.

    The algo of parsing a formula with correct predence is funny IMHO.

    this.var + 2 * (this.var2 + 4) for example.

    I have a C# Implementation for a full compiler with VM and such in my open source MMORPG, which fully works and IIRC I have a youtube video that explains it, but not sure about that anymore.

    https://github.com/KDSBest/...
  • 1
    What are the constructor semantics? I see you instantiate the class, is there a way to define a constructor?
  • 2
    @KDSBest if (lowerToken[i] != '_' && lowerToken[i] != 'a' && lowerToken[i] != 'b' && lowerToken[i] != 'c' &&
    lowerToken[i] != 'd' && lowerToken[i] != 'e' && lowerToken[i] != 'f' && lowerToken[i] != 'g' &&
    lowerToken[i] != 'h' && lowerToken[i] != 'i' && lowerToken[i] != 'j' && lowerToken[i] != 'k' &&
    lowerToken[i] != 'l' && lowerToken[i] != 'm' && lowerToken[i] != 'n' && lowerToken[i] != 'o' &&
    lowerToken[i] != 'p' && lowerToken[i] != 'q' && lowerToken[i] != 'r' && lowerToken[i] != 's' &&
    lowerToken[i] != 't' && lowerToken[i] != 'u' && lowerToken[i] != 'v' && lowerToken[i] != 'w' &&
    lowerToken[i] != 'x' && lowerToken[i] != 'y' && lowerToken[i] != 'z' && !

    Hahaha, I can't stop laughing
  • 1
    @Ranchonyx no constructor yet
  • 2
    @KDSBest rest of code is cool stuff. I should publish my source since it's different than any others you find online. Mine is a parser and interpreter at once. No ast
  • 1
    @retoor I haven't started laughing yet, I'm still staring at it and it's starting to stare back at me.
  • 1
    @retoor yeah happens to the best xD.

    >= 'a' && <= 'z'
Add Comment