From Test-Scratch-Wiki
A programming language is a type of project which evaluates a program written in a custom programming language. Complexity of programming languages vary a lot. Some are integrated into operating system projects.
Often, a user is required to write the program in a text editor like TextEdit or NotePad, then save it as a *.txt
file. It is then imported into a list in Scratch. This simplifies editing, as the Scratch List Editor is not very simple to use. Some languages allow programmers to "distribute" code on a forum topic by letting end-users install code by copying and pasting, or in a studio by downloading and importing projects. This allows for virtual devices which users can install multiple applications on.
Common Implementations
There are many common implementations in programming languages as they are easy to set up in Scratch. These include:
Jump/Label
for flow control
Jump/Label
is common in many low-level languages like BASIC, Batch, etc. It is based on "labeling" lines, then "jumping" the compiler to those lines based on commands. For example:
Label loop Print "Hi!" Jump loop
Here, the compiler will first label line 1 as "loop", then print "Hi!", then go back to "loop", where it will continue again (i.e. print "Hi!"). Thus, it is an infinite loop. Complex flows can be achieved with conditional jumping, where a jump happens only if a condition is fulfilled.
Arguments in methods
There is a wide range of techniques to support arguments in methods, but the most efficient is to include each argument on a new line ("line-by-line programming"). This minimizes parsing as it is easy to extract an item of a list rather than a part of a string.
Named Variables
The more advanced languages provide names variables. Names variables operate on two lists. One list contains the name of the variable and the other, the value. The program can retrieve a variable by searching a list until the position of the variable is found in the names list, then getting the value from the values list.
Kinds of Interactions
Interactions are the methods by which a program interacts with the user/programmer. There are usually two types of interactions: Terminal/Console, and IDE/Driver.
Terminal Interaction: CUI environment
Usually, a programming language will be run by a makeshift console consisting of a list display and an ask textbox. Commands like -h
and -r
are used to get help and run, respectively. Here, the programming language often provides a print
function which adds an item to the list, thus "printing" it. An example is QuickSilver.
IDE and Driver Interaction: GUI environment
Another way to run some programs is the IDE and Driver Interaction method. You can create, edit, test, and debug programs in an IDE which is designed to help you write better code. Then you can save your program and others can install it on their own personal VM (driver software) by importing a project which contains the code. Often the VM acts like a simple OS allowing multiple "Apps" to be added and run all from a single database. IDE and Driver programming languages often do not require a console or terminal to be run, they use vector graphics for their output via the Pen. An example of this is Skip.