Building a programming language, now possible?

So I have been messing around with the new blocks and started wondering if it would be possible to build a programming language(very basic one) in GKC. Would be a cool project, plus it will teach many things and allow us to build fully fledged calculators. So who would like to help me out?

Explanation on building the programming language:

In a programming language you first need to create the lexer/tokenizer. This phase is overall quite simple but can be complicated when dealing with very low-level language grammar like C++. It should be very easy for a basic calculator, but maybe not…
A lexer/tokenizer is supposed to loop through all the source code and then check what the current character in the source code is. We always like to check for whitespace so we can skip through it by incrementing the position in the source code. At the end of the lexer/tokenizer we return a “list” of tokens that are the building blocks for our programming language. A calculator should only have these tokens:
DIGIT(for numbers), PLUS(for +), MINUS(for -), MUL(for *), DIV(for /), LPAREN(for “(” ), RPAREN(for “)” ), and maybe even EXPO(for ^).

After we finish the lexer/tokenizer we need to build the parser. The parser takes as input all of the tokens and loops through them. The parser normally returns an AST(abstract syntax tree), but for the sake of simplicity it will simply loop through the tokens and return the expected result.

Time for an example!
First the lexer will take in the input as:
5+5*(30/3)
Then it will return:
[{type: "DIGIT", value: "5"}, {type: "PLUS"}, {type: "DIGIT", value: "5"}, {type: "MUL"}, {type: "LPAREN"}, {type: "DIGIT", value: "30"}, {type: "DIV"}, {type: "DIGIT", value: "3"}, {type: "RPAREN", value: "3"}]
Then this code is parsed and returns:
55
Easy right? Well not really…but maybe it will be! So can someone help me out please? @Blackhole927 and @getrithekd and @Shdwy

9 Likes

I know the language of scratch.mit.edu

4 Likes

@Blackhole927 has made brain**** in GKC before.

1 Like

I thinks it’s scratch.mit.edu

Can you help then?

Which is why I mentioned him.

This is actually really cool! The only coding I know how to do is Scratch though :frowning:

Would love to see some other people make it work!

1 Like

I mean, for the calculator, you could use get location of blocks plus recursion which would probably be sufficient.

Scratch.mit.edu speaks
download
not

Also what exactly do you mean by programming language? If it’s like an actual programming language, we’ll need a chat system and a lot of other things

in programming you have

  1. block coding (gimkit uses)
  2. python
    3.C++
  3. a lot more

GKC uses scratch like coding so you can help!

1 Like

Yes, I thought of that. Just need some people to test it out.

I think this should be moved to devices because it’s less help and more of a brainstorming/research/development project.

I have no idea why I replied to that post

2 Likes

I’ve never actually tried coding on Gimkit, maybe I could start!

I don’t think you understand my overall request here. I simply need people to create a calculator that is fully fledged using some loops, logic gates, and that’s it!

I mean an actual one, but for right now I was thinking to just build a basic arithmetic calculator.

True, I will do so right now then.

Yes, and you can also check out some guides for help!

True but you spoke… b-but you spoke…