causerie |
Introductioncauserie v1.0: A simple, elegant and powerful programming language. IntroductionCauserie is a programming language, derived from Smalltalk, that is designed to be simple, elegant, and powerful. You may ask why the world needs another programming language, and I would answer that, based on my own explorations of the available languages, I have yet to find one that delivers on all three of the above ideas. Smalltalk comes close but, unfortunately, it has so far been rendered as an interpreted language only, and I want to write binary executables. Besides these reasons, it's also a challenge: can I write a computer language? And can I write one that delivers on the ideas of simplicity, elegance, and power? We'll find out! The initial implementation of causerie is written using Free Pascal and Lazarus. Free Pascal was chosen for a couple of reasons: first, I tried writing the classes required in pure C with the help of GLib/GObject but, even though I find GLib and GObject to be admirable for their depth of documentation and fairly clean code, actually using it still proves to be somewhat cumbersome, even with the help of the C preprocessor. Second, I didn't want to write it in C++. Yes, I'm biased against C++; there is no denying that it's a widely-used (if not popular) language, but its adherents seem loath to document anything and its behavior of templates, multiple inheritance, and allowing operators to be overloaded at will, together with its adherents' abhorrence of documentation, makes sifting through someone else's C++ code a lot like trying to decipher some deranged wizard's arcane scrawl. That way lies screaming madness. I know -- I've had to do it. I imagine many of you have, too. Free Pascal allows the code to be well-structured, if still a bit cumbersome. I set out to write the code with profuse documentation and, although this tends to slow progress a little, it ensures that I can go back and figure out what the expletive I was thinking when I wrote a particular routine. It should prove helpful to you, too, if you're interested in things like parser internals -- at least, I hope so. If you find an error or omission, or if something is not quite explained to your satisfaction, even after consulting the documentation here, the causerie wiki, or the various articles on my site, please drop me a line. All serious inquiries will be answered in due time. Now, a few words on what you can expect to find in the Source. A word on the Source CodeClass inheritanceNearly everything derives from I suppose that brings us to naming conventions. Naming conventionsClasses are named in a way that makes sense in context. Do I want to create
an object? I use Classes and variables that represent class instances are always capitalized. Custom types are also capitalized. Functions that return classes or class instances are capitalized. Everything else begins with a lower-case letter and uses camelCase, if necessary. Every method is virtualEvery method is virtual. This makes the code flexible. The trade-off in calling time is fairly negligible and certainly worth the added flexibility. Causerie's methods are likewise all virtual. Properties, and the lack thereofNo, I don't use properties at all. You may notice that properties are also
absent from causerie's language definition, even though it compiles for use with
Once upon a time, I used properties liberally to prevent other programmers from modifying values and so forth -- but I found, through practice, that defining a property and then a couple of protected methods to access and alter such a value not only cluttered up the class declaration, but was less efficient, from a coding time standpoint, than simply defining the accessor and mutator methods up-front -- especially where indexed properties (the ones that pretend to be arrays) are concerned. The standard I've followed for dealing with properties is as follows: given a
protected value named Much simpler than having a Odds and endsAnd now, some odds and ends:
That's all there is to say for now. Have a look through the documentation, check out the wiki and the source, and let me know what you think! Generated by PasDoc 0.13.0 on 2015-01-10 17:13:18 |