Slide # 1

1

GET TUTORIALS RELATING TO JAVA S40 N AlchemyOS N OTHER OS!!! Read More

Slide # 2

2

GET TUTORIALS RELATING TO JAVA S40 N AlchemyOS N OTHER OS!!! Read More

Slide # 3

3

GET TUTORIALS RELATING TO JAVA S40 N AlchemyOS N OTHER OS!!! Read More

Slide # 4

4

GET TUTORIALS RELATING TO JAVA S40 N AlchemyOS N OTHER OS!!! Read More

Slide # 5

5

GET TUTORIALS RELATING TO JAVA S40 N AlchemyOS N OTHER OS!!! Read More

Thursday, 11 April 2013

AlchemyOS Ether programming tutorial

AlchemyOS - Ether Programming language
                
                
Introduction
                
Ether programming language is created for the AlchemyOS made by Serger Basalaev( more info at his official website http://alchemy-os.org)
I created this tutorial since a few of my friends asked me to write a tutorial about it since it was quite complicated to use AlchemyOS.
I won't be discussing other section because it's already documented in the official alchemyOS page.
                
        
Creating your first AlchemyOS program
        
Open up terminal and change your terminal directory location to the 'home' directory if you have not already
you can do this by using the CD command. To change to a specific directory available in the current directory(type LS to see the list of file and folder/directory in the current directory) you can type CD <name of folder>
for example
        
cd home
        
after that type
        
edit firstprogram.e
        
this will launch the AlchemyOS default text editor called EDIT and create the file named firstprogram.e on the current directory.
from here you will be presented an editing space.
type this in it
        
        def main(args: [String]) {
        }

        
this is the most basic program you can create on alchemyOS but we won't be creating this instead we will be creating the most popular program of all which is the Hello World program
now edit the application and at the start of it add
        
        use "io"
        
use is a command if you want to use function from a certain library. A library is a file that contains sets of predefined functions. The "io" library is mostly used for input output stuff including files and system. It contains the command PRINTLINE thats why we need to "use" it as a library. Below are the other libraries that are present to the alchemyOS
        
builtins        List of built-in types of Ether.
io.eh                Work with file system and input/output routines.
dataio.eh        Additional I/O routines for binary data streams.
textio.eh        Text I/O streams.
string.eh        String operations.
strbuf.eh        String buffers.
list.eh                Ordered collection of elements.
dict.eh                Dictionaries.
math.eh                Math functions.
rnd.eh                Pseudorandom numbers.
sys.eh                Various system functions
time.eh                Time and date.
error.eh        Error handling.
process.eh        Work with program processes.
dl.eh                Dynamic loading support.
connection.eh        Generic connection framework.
func.eh                Functional transformations.
        
so next in between the { } of the main function type in println("Hello World!")
so now your code would already look something like this
        
        use "io"
        
        def main (args: String) {
        println("Hello World!")
        }

        
Now you can compile it!. Save and quit edit , from your terminal type
        ex firstprogram.e -o app
        
ex is the name of the compiler , firstprogram.e is the name of our source code file, "-o" tells ex to compile it into an object and "app"
is the name of the program we want it to build to.

after typing that you can run it by typing in terminal
        
        ./app
        
If you did it right then you will get Hello World! printed

To be Continued...

0 comments:

Post a Comment