Sierra is a new high-level programming language that is user-friendly and compiles into C code on the web using cloud computing. By January 2011 we can compile the generated C code on the web using cloud computing also. Sierra has readable code designed to make sense to humans. Sierra has automatic memory management. Sierra is designed to be used both by professional software engineers and students since it's fast and easy to use. The objective is to increase productivity and reduce bugs and make reusing code much easier and writing code more efficiently. The most striking difference is that Sierra has an underlying knowledgebase of implied meanings. Note: We will soon be adding OOP and functional features and operator overloading. 1. Disclaimer 2. Introduction 3. Syntax 4. Sierra Core Data Types 1. Atomic Variables 1. Numbers 2. Strings 2. Arrays 3. Records 5. Sierra Operators 1. Mathematical Operators 2. Comparison and Equality Operators 6. Sierra Global Block Commands 1.Includes 2.Macros 3.Functions 7.Function and Main Block Commands 1.Embedded C code 2. Flow Control Structures 1. If-Else 2. Switch 3. Miniswitch 4. Loops 5. When 3. File Operations 4. swap 5. search 8. Appendix 1. C Translation Scheme 2. Operator Precedence Table 3. Upcoming Features 1. Under Immediate Development 2. Future Development Disclaimer This is the first-draft manual for the prototype Sierra RDC ("Readable C",) programming language. This document is not intended to be definitive, and the basic elements of the Sierra RDC programming language may change in further drafts of this manual. This manual is not intended to be an introduction to computer programming concepts, and presumes some familiarity with basic concepts. It is recommended for readers who have prior experience in at least one other programming language. All text in this document is written in Verdana typeface, Sample Sierra RDC code will be written in Courier New font. Introduction Sierra is a cloud-oriented, high-level, imperative programming language designed for translation and compilation by a distributed supercomputer. For unsubscribed users, Sierra programs can also be translated into C99 by the cloud, and can then be compiled to a binary by the local machine using any C99-compliant compiler. Sierra is intended to fulfill the following goals: *make programming easy for beginners *dramatically speed up C99 development without sacrificing granularity of control or execution speed *automatic memory management *eventually be the basis for the Sierra Language Stack, a larger initiative to realize intentional and literate programming concepts augmented by cloud computing Syntax One line of Sierra is equivalent to approximately 2-8 lines of C99, but with a simplified readable syntax that draws inspiration from a variety of sources including: Javascript, Groovy, Cobol, Pascal, Lisp, Lingo, Turing, Ada, Ruby, Python, and SQL. By using Sierra a C progrmamer will be at least 10X more productive than developing in C99 and reduce bugs by 50%. Sierra keywords are case-insensitive. Thus the following Sierra statements are all equivalent: write "hello world" WRITE "hello world" wRiTe "hello world" Sierra variables on the other hand are case-sensitive. The following statements are not equivalent: variable1 = variable2 + variable3 variable1 = VARIABLE2 + variable3 variable1 = Variable2 + Variable3 Sierra programs consist of blocks, containing zero or more statements. At the highest level a Sierra program consists of two blocks, the global block and the main block. The main block is opened by a begin main tag and ends with an end main tag. The global block consists of everything outside of the main block, either above begin main or below end main. As in C/C++, the double-slashes ("//")can be used to indicate a single-line comment anywhere in a Sierra program. Likewise, multi-line comment blocks can be indicated beginning with the character pair "/*" and ending with "*/". // this is a comment function foo() write "this is function foo" end function // this is the end of the function definition /* This is a comment spanning lines. */ //The main function is at the top of a file begin main foo() CALL_MY_FUNCTION end main function fooToo() write "this is function fooToo" end function macro CALL_MY_FUNCTION fooToo() /* Note: functions in Sierra don't need to be redeclared with extern as in C when they are used in a different file from which they are created and there is no need to create a prototype of a function. */ You can pass records and arrays to functions as arguments. //recursive function function espressoMachine() when (coffee not done) //keep making coffee call self end function Sierra Core Data Types Atomic Variables in Sierra The basic components of any programming language are variables and literals. Sierra variables are untyped and do not have to be declared before use. Variable names can contain any alphanumeric character including the "_" (underscore) symbol, but the first character cannot be a number. Variables can have the ' |