To me, the syntax of a language has to be at least three things:
The first point, that the language is beautiful, I expect to accomplish with little or no effort as I have the Occam and Python languages to be inspired by.
The second point, that the language is convenient to use, I expect to accomplish through the Python inheritance.
The third point, that the language is safe to use, also involves the semantics of the language. For instance, the original K&R C is unsafe both syntactically and semantically, modern variants of C are mostly unsafe semantically even though the syntax leaves a lot to be desired in my mind. One of the ways I intend to make Braceless a syntactically safe language is by applying these rules rigorously:
enumwhenever he or she defines an enumeration.
x ? y : z), will be spelled out plainly like this:
if x then y else zand nesting of them will be prohibited.
Other than that, I can already now reveal that the syntax of Braceless is very straightforward. It is sort of like C# syntax changed into a Python-style syntax.
The code below is just a rough sample; it does not compile with the current version of the Braceless0 compiler, but it does show where I am headed:
Please notice that the code sort of assumes that overloading is in place even though I've deferred support for it until a later time.
module String: class String: # NOTE: Value declarations (member variables) are always protected and field declarations (accessors) are always public. # Buffer attribute, no public access. value buffer is pointer to character # Length attribute, full public read-write access. value length is cardinal field Length is io length: set: if $value > .length: throw new StringError(this, "Cannot extend the length field") let .length = $value # Extent property, read-only access. value extent is cardinal field Extent is out extent # Factor property, full read-write access. value factor is cardinal field Factor is io factor: set: if $value == 0 or $value % 8 <> 0: throw new StringError(this, "The growth factor must be a multiple of eight") let .factor := $value create(): let .buffer := none let .length := 0 let .extent := 0 let .factor := 32 delete(): release .buffer operator :=(that is String): # Resize the recipient string, if too small. if that.length > this.extent: this.Extend(that.length) # Copy the source string to the recipient string. let this.buffer[:that.length] := that.buffer[:that.length] # Assign the length and we're done. let this.length = that.length