This topic is a guide to programming programming languages. I have made QuickSilver. Another example is Skip by ScratchReallyROCKS. I will use the QuickSilver platform for this guide. So, I recommend downloading it and learning it.
Instead of telling you exactly how to make one, I'm going to give you ideas for how to solve problems like variables, repeats, etc. So, let's get started!
Chapter 1: How it all works
The biggest problem for most programming language programmers is how to get started. The easiest way is to think of a program as a list. You also need a variable called 'Line'. The basic coding then becomes:
Set Line to 1
Repeat until Line = Length of List
Change Line by 1
If item Line of List = {command}
{action}
If item Line of List = {other command}
{other action}
etc.There are a few extra things (like arguments, flow control, and terminators) but we'll worry about those later.
Chapter 2: Arguments
An argument is basically an input. The (5)+(10) block takes two arguments, 5 and 10 in this case.
The best way to deal with arguments is to have each argument in a new line:
{command}
{argument 1}
{argument 2}Now, arguments can be represented by the simple coding
(Item ((Line)+(1)) of (List))
Make sure you put in a [change (Line) by {number of arguments}] at the end.
Here's an example of how this could be used:
Set Line to 1
Repeat until Line = Length of List
Change Line by 1
If item Line of List = 'PRINT'
Say (item(Line+1) of (List))
Change Line by 1Chapter 3: Variables
The best way to battle variables is with a list called 'variables'. Each item stands for a variable. So, you can add, edit, and use variables. But you can't name them. To name them, you need the list 'variable names'. 'Variable names' contains all the variables' names (like variables contains the values). Now, the code is
set n to 1
repeat until item n of var. names = {variable name here}
change n by 1
item (n) of (variables) is the value of the desired variableChapter 4: Flow control
In Scratch, flow control is the orange control blocks. Here, the best way to use flow control is with LBL and GOTO/JMP-like commands. Here's how it works:
LABEL loop Say Hi! JMP loop
Here, LABEL labels that line as 'loop', and JMP tells the script to jump to that line. So, the program will say Hi!, then jump back to 'llop', and say Hi! again and so on. To code this, you can use a similar structure as the variables: a list called LABELS, and one called LABEL NAMES. The only differences are that you put the line number instead of the variable and you add a
set Line to {input line # here}at the end.
Chapter 5: Compilation [saving programs]
coming soon
Last edited by Hardmath123 (2011-04-18 12:17:03)
Offline
Nice. I have made a programming language, although it doesn't really work as one. Post some more! This is great!
Offline
Do we create a list, also?
Offline
Cool! I'll probably use this code. Maybe this should be stickied.
Offline
scratcher7_13 wrote:
Cool! I'll probably use this code. Maybe this should be stickied.
![]()
Thanks!
Offline
Seems like a really good guide! However, some of the things that my new programming language 'Cobra' is going to have a saving and opening system! I know how to make one, but you might like to show others
Offline
ssss wrote:
Seems like a really good guide! However, some of the things that my new programming language 'Cobra' is going to have a saving and opening system! I know how to make one, but you might like to show others
![]()
I'll add it. Later, though—I need to do flow control.
PS: Thanks for advertising Xenon!
Offline
Hardmath123 wrote:
ssss wrote:
Seems like a really good guide! However, some of the things that my new programming language 'Cobra' is going to have a saving and opening system! I know how to make one, but you might like to show others
![]()
I'll add it. Later, though—I need to do flow control.
PS: Thanks for advertising Xenon!
Your welcome
Although your time is almost up -_- I am making a software company -_-
You could ask for another week or 2 though
Offline
Great guide. A good way to do flow control is to use a stack, but that is really advanced.
Offline
Thanks!
Offline
There is one fatal flaw: unless you don't want the first line to be read, you have to change 'set line to 1' to 'set line to 0'
Go here to learn more or to help develop Apputunaria. Check my signature later to see if X Programming has a forum yet. Learning AIOffline
TheSuccessor wrote:
Great guide. A good way to do flow control is to use a stack, but that is really advanced.
What is a stack? Is that when you take data and compile it to one big line using symbols to seperate the items?
Last edited by XComputers (2012-06-08 17:03:26)
Go here to learn more or to help develop Apputunaria. Check my signature later to see if X Programming has a forum yet. Learning AIOffline
XComputers wrote:
There is one fatal flaw: unless you don't want the first line to be read, you have to change 'set line to 1' to 'set line to 0'
I use the first line for a comment.
Offline
XComputers wrote:
TheSuccessor wrote:
Great guide. A good way to do flow control is to use a stack, but that is really advanced.
What is a stack? Is that when you take data and compile it to one big line using symbols to seperate the items?
Offline
I think I'll try this tomorrow. Well, not this exactly, but use it as a base😡👉
Offline
I'm making a scheme interpreter in scratch.
Offline
I might try this! I tried to make Scratch in Scratch. I made 2 blocks, then it sorta, stopped. I might come back to it later.

Offline
joefarebrother wrote:
I'm making a scheme interpreter in scratch.
Hey, that's what I was doing recently... now I'm curious to see what you make.
Offline
Hardmath123 wrote:
joefarebrother wrote:
I'm making a scheme interpreter in scratch.
Hey, that's what I was doing recently... now I'm curious to see what you make.
![]()
Did you ever finish it? I didn't know, so it wasn't copying.
Offline
joefarebrother wrote:
Hardmath123 wrote:
joefarebrother wrote:
I'm making a scheme interpreter in scratch.
Hey, that's what I was doing recently... now I'm curious to see what you make.
![]()
Did you ever finish it? I didn't know, so it wasn't copying.
I wasn't accusing you—I've only mentioned it to bharvey on the BYOB discussion thread. I just finished a JS implementation (which is AWESOME
) and now I'm porting it to Scratch with some changes.
Offline
just give me credit on part 5
faster normally than yours on turbo xD
Offline