Discuss Scratch
- Discussion Forums
- » Things I'm Making and Creating
- » How could i start to make a programming language?
- techygamemaker
- Scratcher
61 posts
How could i start to make a programming language?
How could i start to make a programming language?
All Answers appreciated.
All Answers appreciated.
- techygamemaker
- Scratcher
61 posts
How could i start to make a programming language?
Thanks! Just to ask , would i use NotePad ++ or anything like that to make it?
- techygamemaker
- Scratcher
61 posts
How could i start to make a programming language?
Ah thanks for the help Its really helped me to know what to do now.
I guess I have to start Installing Ubuntu now, eh?
I guess I have to start Installing Ubuntu now, eh?
- gdpr533f604550b2f20900645890
- Scratcher
1000+ posts
How could i start to make a programming language?
HI! I implemented a small C-style language in Scratch, so I know a little bit about programming language implementation. I'm no expert, but I'll tell you what I know.
The process of compiling a program is:
The tokenizer, or lexer, is a program that separates the program into lexemes, the different substrings with a lexical meaning. For example, the JavaScript code
would be tokenized as
Next, the lexemes are parsed. My project uses the LR(1) parsing algorithm, a bottom-up (from parse tree leaves to root) shift-reduce parser. My project executes the program directly from the tree, but a more professional implementation would generate an intermediate representation. My project uses a stack to elegantly handle the instructions. For example, the parse tree
would be executed as
I hope my reply helps!
The process of compiling a program is:
- Tokenize the program
- Parse the resulting lexemes
- Generate an intermediate representation of the program from the parse tree
- Optimize the code
- Generate the final machine-executable program
The tokenizer, or lexer, is a program that separates the program into lexemes, the different substrings with a lexical meaning. For example, the JavaScript code
var x = 0;
var
x
=
0
;
+
/ \
5 *
/ \
2 7
PUSH 5 Stack: [5]
PUSH 2 Stack: [5, 2]
PUSH 7 Stack: [5, 2, 7]
MULTIPLY Stack: [5, 14 (AKA 7 * 2)]
ADD Stack: [19 (AKA 5 + 14)]
I hope my reply helps!
- techygamemaker
- Scratcher
61 posts
How could i start to make a programming language?
Thanks! i will be using all of your tips! Oh and the 8-bit thing confuses me lol.
- gdpr533f604550b2f20900645890
- Scratcher
1000+ posts
How could i start to make a programming language?
Why not C++? I'm using that to make a parser.It would be insanely hard to write it in Notepad ++ or something like that. Thanks! Just to ask , would i use NotePad ++ or anything like that to make it?
It would be insanely hard to write it in Windows.
Write it in GNU/LINUX, using the C programming language.
Compile using GCC.
- kanishka_maiti
- Scratcher
30 posts
How could i start to make a programming language?
HI! I implemented a small C-style language in Scratch, so I know a little bit about programming language implementation. I'm no expert, but I'll tell you what I know.
The process of compiling a program is:
- Tokenize the program
- Parse the resulting lexemes
- Generate an intermediate representation of the program from the parse tree
- Optimize the code
- Generate the final machine-executable program
The tokenizer, or lexer, is a program that separates the program into lexemes, the different substrings with a lexical meaning. For example, the JavaScript codewould be tokenized asvar x = 0;Next, the lexemes are parsed. My project uses the LR(1) parsing algorithm, a bottom-up (from parse tree leaves to root) shift-reduce parser. My project executes the program directly from the tree, but a more professional implementation would generate an intermediate representation. My project uses a stack to elegantly handle the instructions. For example, the parse treevar
x
=
0
;would be executed as+
/ \
5 *
/ \
2 7PUSH 5 Stack: [5]
PUSH 2 Stack: [5, 2]
PUSH 7 Stack: [5, 2, 7]
MULTIPLY Stack: [5, 14 (AKA 7 * 2)]
ADD Stack: [19 (AKA 5 + 14)]
I hope my reply helps!
link?
I EAT PIZZAS!
- kanishka_maiti
- Scratcher
30 posts
How could i start to make a programming language?
i made one on scratch
: https://scratch.mit.edu/projects/244381929/
: https://scratch.mit.edu/projects/244381929/
I EAT PIZZAS!
- Discussion Forums
- » Things I'm Making and Creating
- » How could i start to make a programming language?