+ 1
New language
What do y’all think about this concept? I have no idea about making programming languages but I thought about this: x 0 "label1": x < 5: Console.Output(x) x + 1 goTo("label1") This will output all numbers from 0 to 4. Assigning variable will look like this: variable value: x 0 Checking boolean value will look like this: like python but without if: x < 5 Self assigning a variable will look like this: variable operator value: x + 1 Etc. (character limit exceeded) I think this would be efficient.
7 odpowiedzi
+ 2
BASIC has GOTO.
GOTO gets a bad rap, because people can make "spaghetti code" with it, but I think it's a great way to learn because it forces you to invent all the higher control flow patterns yourself.
Then you clearly get concepts such as when a do-while loop is better than a while loop, which prepares you for languages that have those built in.
Why not shorten goto to go or to?
If you're going to use indentation instead of brackets, like Python, maybe you can remove the colon and be even more efficient.
x 0 seems readable to me, but it could become tricky when the assignment becomes more complicated.
0
Rain good idea! Do you know how i could make this programming language?
0
Great! You just came up with the G-code for CNC machines, go on...
0
TheLazyCat ,
No. I don't know how you can make your language, but you'll need to learn an existing language to use to write the compiler or interpreter for your new language. For example, the core beginnings of Python were written using the C language.
0
TheLazyCat ,
Oh, another argument defending why I like that you include GOTO in your language is this.
At the bottom level of computer programming, in machine code, there are no higher-level organizational patterns, only single CPU instructions, and one of them is equivalent to GOTO in basic, so a programmer who learned BASIC is actually better prepared to write machine code or assembly (the next level slightly above machine code) than a programmer who starts with a high-level language with all sorts of abstract patters already built in that they can use without really understanding how they work, such as loops, functions, classes, if then else, etc.
0
Rain are there actually people who code like this: 01001011 and shit?
0
TheLazyCat ,
Probably not except for fun.
They probably use assembly language, where the equivalent of GOTO is JMP or JP (for jump) instead of 10001000 or whatever the machine code would be.
But the principle is still the same -- one instruction at a time.