||: Candle 0.10
||: Nov 12, 2011
1. The Candle Language
(Common ApplicatioN Development LanguagE)
is designed to be a
new general-purpose scripting language capable of developing
desktop and Internet applications.
Besides the common features found in many scripting languages, like
cross-platform, interpreted execution, auto garbage collection, dynamic
typed, built-in list and map support, Candle also supports some unique
features that are not common in today's general-purpose programming
Currently, the default character encoding (also the only supported
encoding) of Candle is UTF8.
- Built-in hierarchical data
processing: hierarchical data
(whether from XML, HTML, XHTML,
JSON, CSV, RDB or MIME Message) can be
as easily constructed, selected (like XPath), queried (like XQuery),
transformed (like XSLT) and serialized as
any primitive data in Candle.
- Set-oriented expressions:
the expressions in Candle can handle not only a single item, but
also a sequence of items - making the language more expressive and
- Unified pattern language:
Candle unifies several pattern related DSLs (including RegEx, BNF,
RELAX NG, XQuery Sequence Type) into one consistent pattern language
that can apply to sequence of items, nodes and string characters.
- Unification of functional
and procedural programming:
Some multi-paradigm programming languages, like Python, already have a
mixture of features from both worlds. But by introducing a mechanism, I
Candle unifies two worlds in a more orderly manner. In Candle, routines
are divided into functions and methods. Functions are routines without
side-effects and methods are routines with side-effects. The rule of separation-of-side-effects
is that methods can call functions, but not
vice versa. In this way, pure functional islands are
well-preserved in the vast sea of procedural program.
There are two types of documents in Candle - Candle Markup and Candle
In the opening signature, '
- Candle Markup is for storing
static markup data. It starts with
It is normally stored
with file extension '
The letters '
stands for Candle
Candle Markup is a strict
subset of Candle script in syntax. And you can use '
as the MIME type for Candle Markup.
- Candle Script is for storing
code. Its opening signature is
It is normally stored with two file extensions '
The letters '
stands for Candle
The former for general scripts
and the latter for procedural
program. And you can use '
MIME type for Candle Script.
version of the Candle language. As the language
evolves, more version numbers would be expected to appear in the
opening signature. Only whitespace characters are allowed to precede
the opening signature.
As Candle is closely based on some XML technologies, including XPath,
XSLT and XQuery, it will be easier for you to understand
already have knowledge of these languages.
Two blog articles may also help you understand the design rationales
behind Candle: Blog
- Why I Invented Candle (I) and
- Why I Invented Candle (II).
2. The Candle App Platform
The Candle App Platform is the runtime environment to support the
execution of Candle scripts on various operations systems. It is being
developed in C/C++. Currently, Candle runs on Windows (2000 and
above) and Linux (only tested with Ubuntu, but as Candle has very few
dependencies, it should be easy to port to other
Linux and UNIX distros).
Below is the architecture diagram of Candle App Platform:
Candle Runtime is very lightweight.
With current beta
release, the entire zipped binary package is only 2.1M
on Windows and 1.2M on Linux.
So besides running as standalone application, it can also be used as
embedded scripting language in large applications.
The entire Candle Runtime implementation is open-sourced
SourceForge, so there's nothing
that hinders you from porting it,
customizing it and patching it. Workspace files for Microsoft Visual
C++ (Express) and CodeLite are provided.
3. Candle Reference Documents
Here's a quick overview of the list of more detailed reference
documents in Candle:
If you encountered any problem with the program or the documentation,
can always email me at firstname.lastname@example.org
- Candle Markup
Reference: specifies the
syntax and semantics for Candle markup document;
- Candle Data
the type hierarchy and data model in
Candle, which is essential to understanding the semantics of Candle
- Candle Query
the scripting features in Candle;
- Candle Pattern
is dedicated to the pattern language in Candle, which can be used to
specify patterns on sequence of items, nodes and strings.
- Candle Routine
the built-in routines in Candle;
- Candle Style
documents the style markup elements and attributes in Candle. This
module is still being developed.
- Candle Runtime
documents the steps to install Candle, and run it in 3 slightly
different ways, as a command line program, a desktop GUI program and a
web application server.