Hello, World!
Try putting this code into the compiler:
def main
print "Hello, World!"
end
Run the code. You will get the output of "Hello, World!".
This code defines a main function which is where execution will begin
when the compiled shell script is run.
How to Install
- Go to the download page on this website.
- Download the installer program by clicking the globe icon.
-
Run the jar file. In linux this can be doine by making it executable
with "chmod +x install.jar" and running it with "java -jar installer.jar".
-
Use the installer to download the development enviornment.
Package Descriptions
The following packages can be downloaded with the installer.
-
Core: The Core package is the main
library which compiles code from the DashScript syntax
to Shell Scripts.
-
Development: The development package
is a graphical source code editor which allows you to
operate the compiler and create projects without using
the command line.
-
Compiler: The compiler package is a
command-line compiler which allows compilation without
a graphical enviornment.
-
Previewer: The previewer package allows
you to see the compiler's output for code in the fastest
possible way.
Manual Installation
The following code should be inputted into a Linux shell.
mkdir ~/.dashscript;cd ~/.dashscript
wget "http://dashscript.com/installer/lib.jar";mv lib.jar lib/lib.jar
wget "http://dashscript.com/installer/dev.jar"
wget "http://dashscript.com/installer/previewer.jar"
Types of Structures
- Definition: Declares a function.
- Class: Defines a class.
- Logical: Tests whether a condition is true.
- Reptition: Repeats code.
- While: Continues until a condition is no longer true.
- Loop: Loops a certain number of times.
Using a Structure
A structure is declared with a header, a body, and an end. An example is
the following:
def main()
print "Hello, World"
end
The header is the first line of the structure and must begin with a structure's
identifier, such as "def" for a Definition and "class" for a class. The last line
in the above example is "end" and it defines the structure's conclusion. All lines
in between these two are the body and are executed when the structure's conditions
are met. The syntax of a structure is as follows. Underlined text is required.
type name (arguement1, arguement2) flag1 flag2
// code goes here
end
Some structures require names or arguements. For example, a definition must have
a name to identify it. An if statement, though, does not require a name.