Sand
From AJS.COM
Sand is a programming language that I've been toying with for some time now. Sand may not be its final name (it would be nice to come up with something that's not a normal English word so that search engines can find references to it easily), but for now it will do. The name is a nod to Sand's relationship to the Perl 6
language. That is, Sand aims to be a subset of Perl 6... a kernel around which the constructs of the larger language could be explored by implementor, programmer and hobbiest alike.
Contents |
Design
Sand's design documentation is under development. It will eventually exist in three parts:
Implementation
Unlike all previous forms of Perl, the first target implementation of Sand is a compiler that generates object code. A gcc front-end might be ideal for this task, but that selection has not yet been made.
Goals
Sand's goals are many. Perl 6 development has stagnated somewhat in the sense that there are only a tiny core of dedicated developers working on it, and it is this author's opinion that part of that is the sheer scope of the project. Perl 6 is monumental, attempting to bring multiple programming paradigms and imperatives together into a single language while allowing the maximum interoperability with all existing languages.
In contrast, sand will simply attempt to implement basic Perl 5-like features plus a handful of Perl 6 features. It is a transitional language. However, Sand also seeks to fill a niche that will last beyond its use as a transition, and even remain relevant once Perl 6 is in use.
Specifically, Sand will provide:
From Perl 5
- Dynamic, untyped scalars
- Lists and hashes as complex data
- Inline documentation via POD
- Namespaces and modules
- Well integrated text and IO handling
- Abstractly, Sand aims for the simplicity of Perl 5 (even Perl 4 in places) where possible, in order to speed implementation
From Perl 6
- Perl 6 rules
in a slightly reduced form.
- Limited integration between arbitrary grammars and the rest of the language.
- Generators in place of many routine list operations
- Name and positional parameter passing
- Class definitions with auto-generated accessors
- Macros that can manipulate text and/or ASTs (but probably a limited subset of Perl 6 macros)
- Optional duck-typing-like model
Sand specific features
- Many features of Perl 5 have been simplified in order to ease implementation:
- Variables are prefixed only with
$ - Complex data structures are delimited only by
[...] - Only a subset of Unicode is allowed within programs, though most codeblocks are supported
- more simplifications will be detailed as the spec takes hold...
- Variables are prefixed only with
- Wherever possible, allowances are made for compilation to object code
Perl 6 features that Sand will not provide
- Hyperoperators (maybe)
- Inline parsing of arbitrary languages (though some flexibility to parse arbitrary grammars exists)
- Support for a backwards-compatible Perl 5 mode
- A full meta-object protocol (something simpler will be provided)
- Support for typing container contents (e.g. "Hash of Array of Scalar")
- Support for non-string hash keys
- Continuations and other asynchronous execution features (future version, perhaps)
- Auto-threading
- Currying (though possibly this will be provided by library routines)
- Garbage collection (Sand will use reference counting by default, but may provide hooks for a later gc mechanism)
Categories: Sand | Perl | Aaron Sherman
