Introduction

I am interested in Compiler implementation using AI Techniques and Supernova (Simple scripting language for Microsoft-Windows which released formally as Freeware) as a result of my research on this topic.

Supernova is a small size programming language (less than 15MByte) and you can use it for quick and simple tasks. It is also useful for children as a start towards learning the art of programming.

Supernova as a language tends to be more near to our human language where we do Programming With Fiction Description (PWFD) using subset of Pure human language.

The human language is VERY big and contains many words so we use a subset of it to **Reduce the Complexity** of the problem and to **Get Acceptable Performance** as much as we can.

Unlike other programming languages which is based on statements, Supernova is based on paragraphs which contain many statements packed together using ignored words like (the, and,...etc.).

For example, the two commands:

I want window

Window title is hello

May be connected together to form another big statement:

I want window and the window title is hello.

And a collection of big statements form a paragraph and a collection of paragraphs form a program.

Unlike other programming languages, most of Supernova programming language statements have a rule describe its structure and help users to use and remember the statement in the future.

For example:

The rule: PVC used to control the structure of the Statement I Want Window

Rule: PVC = Pronoun Verb Class

Statement = I Want Window follow PVC Rule

Where:- [I] = Pronoun , [Want] = Verb and [Window] = Class

Using the Code

I have 5 samples to show.

The sample files take the extension .Nova.

To run these files, you need the Supernova Interpreter Nova.exe except the delivery sample.

It's attached as source code + executable file ready to RUN!! (i.e. using Supernova, you can distribute your applications as executable files. This feature added starting from version 1.1 which released in 2010.03.30).

I want window and window title = Hello!!.
Window back color = {5,155,255}.
Window width = 330. window height = 250.
Window name = win1.
I want button and button caption = Be my friend , click to say yes !!.
The button top = 20. button width = 300.
The button name = btn1.
I want button the button top = 80.
Button caption = . and the button name = btn2.
I want button the button top = 130.
Button caption = . and the button name = btn3.
btn1 mouseclick. instructions are
Btn2. button selected and button caption = Really !! ? .
End of instructions
btn2 mouseclick. instructions are
Do while (True).
Btn3. button selected and button caption = Hurrah.
[x]. = the seconds. and do while "the seconds - [x] < (0.5)"
Do windows events
End while
Btn3. button selected and button caption = .
[x]. = the seconds. and do while "the seconds - [x] < (0.5)"
Do windows events
End while
End while
End of instructions
btn3 mouseclick. instructions are
You close window
End of instructions
€

TheClock.nova Sample

Application title = The Time.
I want window and window title = The Time.
window back color = {5,155,255}.
window width = 330. window height = 250.
window name = win1.
I want label
The label font size = 40. and label width = 300.
label height = 100.
I want button and button caption = Close.
the button name is btn1.
button top = 150. and button left = 150.
do while (True).
label caption from ( ) the time.
[x]. = the seconds. and do while the seconds - [x] < (1).
do windows events
end while
end while
btn1 mouseclick. instructions are
You close application
end of instructions

Delivery2.nova

The application title is "Delivery2"
Set window auto show off
Set window resize off
[myarray]. = (3).
[myarray]\(1). = (Tea).
[myarray]\(2). = (Cafe).
[myarray]\(3). = (Sandwich).
I want window and the window title is "Delivery"
Window width = 730. and window height = 530.
I want label
The label width is 700. and label height is 120.
The label font size is 20.
The label back color = white.
The label caption is
"
What do you want ?
"
I want label and label top is 140.
label caption is Title :.
label font name is "arial"
label font size is "14"
I want textbox
textbox left is 80.
textbox top is 140.
textbox width is 500.
textbox font name is arial.
textbox font size is 14.
textbox name is text1.
I want listbox and listbox top is 180.
Listbox width is 700. and listbox height is 250.
The listbox font name is arial.
The listbox font size is 14.
[x]. = (1). and do while [x] <= [myarray].
The listbox must add from [myarray]\[x].
[x]. = [x] + (1).
end while
I want button and the button top is 450.
The button left is 240. and button caption = "Ok"
The button name is btn1.
The button back color is white.
I want button and the button top is 450.
The button left is 360. and button caption = "Close"
The button name is btnclose.
The button fore color is white.
The button back color is red.
btnclose mouseclick. instructions are you close application ok
listbox value is 1.
You centre window and You show window
btn1 mouseclick. instructions are
The listbox value to [x].
do if not [x] == (0).
"(
Delivery Application
-------------------------------------------------------------------
Date :) thedate (
Time :) thetime (
Month :) themonth (
Day :) theday (
Item :---------------> ) [myarray]\[x] (
-------------------------------------------------------------------)"
memory to file "(delivery.txt)"
execute file "delivery.txt"
end if
end of instructions
text1 change. instructions are
textbox value to [mystr].
[mystr]. = lower [mystr].
[x]. = (1).
do while [x] <= [myarray].
[myitem]. = lower [myarray]\[x].
[check]. = [mystr] at [myitem].
do if not [check] == (0).
listbox value from [x].
end if
[x]. = [x] + (1).
end while
end of instructions

COM.nova

I want window and the window title is COM Test.
I want button and button caption is Open Word Application. button width = 150.
button name = btn1.
I want button and button caption is Hide Word.
button name = btn2. and button left = 200.
I want button and button caption is Show Word.
button name = btn3. and button left = 350.
procedure btn1 mouse click.
[myobj]. COM Object to create of type "(Word.Application)"
[myobj]. COM Object to use
"(Documents:Add)" COM method to call with parameters nothing.
(visible). COM Property to set (1).
endprocedure
procedure btn2 mouse click.
[myobj]. COM Object to use and (visible). COM Property to set (0).
endprocedure
procedure btn3 mouse click.
[myobj]. COM Object to use and (visible). COM Property to set (1).
endprocedure

Points of Interest

Multi-Language source code support including English & Arabic as a start

Not Case/Space/Tab/Line Sensitive

History

I am the creator of Supernova (simple scripting language for Microsoft-Windows) and I am interested in Compiler implementation using AI-Techniques and Supernova is a result of my researches in this topic and I released it as freeware in 2010.03.19 so children from different countries can use it as a simple start towards programming.