R-SCRIPT You can think of R-Script as Java-Lite; it nearly follows the same object-oriented methodology as Java and C++, but is design for the smaller programs that are typically written in a shell language such as Bourne/Korn and even Perl. I began developing this language and its interpreter back in July 2001 to see if I could do it. I completed a "concept" version of the language early 2002, so I'm left with the question of "now what?" The concept version is functional with all the syntax defined in the manual, but it has not been fully tested nor has it been used in the field -- perhaps in the future I might integrate this project into another (my stock program perhaps?). If you have questions or comments about this language, or you found some bugs in the Runner, you can email me at reymano@yahoo.com. |
|||||||
Programmer's Manual |
Interpreter |
||||||
Basics To get a full description of the language, please read the programmer's manual. I think the best way to demonstrate this language to jump right in with a few samples. Let's start with the customary "Hello World" program: Sample 1-1: Hello World
/* This is Hello World */ It's as simple as that. For you C++ and Java programmers, the basic syntax is the same: statements are terminated with a semi-colon, curly braces are used for denoting scope, and comments can be specified in block (/*,*/) or single-line (//) notation. In addition, every ReyScript program must define a main function in the workspace (also known as the global class). The write statement (along with its twin read) serves as the key I/O mechanism in the language. Let's add some more stuff to this program: Sample 1-2: Hello World Part 2
number a; In this example, we see the use two of the language's primitive classes: number and string. The variable "a" is defined as a number, but what is not clearly seen is that the constants "Hello World" and "\n" are resolved into string objects during execution. Here's how the output to the program above.
Hello World 1 Our last sample in this section will show how classes can be used in conjunction with the read/write statements. This is just the tip of the iceberg. Read the programmer's manual for more stuff. Sample 1-3: Hello You
class user Here's how the output might look:
What is your name? Dave |
|||||||