The Newspeak Programming Language

i am not really a web design type so i am going to make this short and plain. newspeak is a language i have developed to test some of my ideas about programming languages. but instead of boring you with a lot of theoretical background, i'll just give you the bullet points.

--the most unusual feature is the ability to associate a syntactical rule with every function and procedure definition so that their invocations have a much more natural appearance. i.e. "write 'some text' to the Output File" instead of "write('some text', the_output_file)"

--another interesting feature is the use of capitalization to link words together into identifiers ("the Output File" instead of "the_output_file" and the ability to refer to arguments by their type names ("the first String") instead of having to come up with a unique and arbitrary name for every argument.

--the project includes a hand-written lexical scanner and parser generator. these were necessary to accomplish some of the funky lexical and syntactic things i wanted to achieve.

--its closest existing relative is Python. but differences such as the above make it read unlike any other language.

--all of the code is written in Python. newspeak currently also compiles to python (although that is obviously not the long term plan). so you might not want to delve into this unless you are comfortable with python.

--it is not object oriented in the traditional sense. the language is weakly typed, and all user-defined data structures are dynamic. however, unlike python, newspeak does allow the user to specify the types of variables and parameters. a clarification of the distinction would take more space than i have here, but suffice it to say that while newspeak code does not strictly enforce type relationships, it includes just enough type information that stongly typed, object oriented code could be automatically generated from it. and this is in fact what i plan to do in the future.

enough talk. the best thing to do is just play around with it and see if you like. so on to the "getting started with newspeak". if you have python installed on your system, as most popular linux distributions do, this should be easy. in the directory that appears when you untar/unzip the release files, there is a script called "ns.py". this is the compiler. to try it on an example type "./ns.py Example" . Note that newspeak files begin with capital letters and have the extension ".nsp", but you don't have to put the extension when you invoke the compiler.

take a closer look at Example.nsp. It is a good way to get a feel for what newspeak is like. note that you can import other .nsp file with the "use" syntax. Also take a look at File.nsp. This demonstrates how you can inline python into the compiled code by surrounding it with the curly braces. Now compare Example.nsp to Example.py (which should have been generated). Also compare File.nsp to File.py. You should start to see some patterns that will help you understand what i am trying to do. for an even better understanding, consult the formal grammar specification and the lexical specification. i wish i could provide you with some more user-friendly docs, but its early in the project, i'm the only developer, and i'm trying to get some releases out. so good luck and enjoy.

and, of course, if you're interested in this project and want to help, just email me at jtracy717@yahoo.com or post a message in the forum here.

SourceForge Logo