FPath and FScript
FScript is a Domain-Specific Language (DSL) to program
dynamic reconfigurations of Fractal architectures. FScript includes the
FPath notation to navigate inside Fractal architectures,
which can be used by itself as a query language for Fractal.
The FPath notation is inspired by the XPath language for XML navigation
and query. If you have some notions of XPath, learning FPath should be
easy. FPath makes it trivial to navigate inside even large and complex
Fractal architecture with simple and readable queries, where the raw
Fractal APIs would requires pages of code.
FScript itself can be thought of as a scripting language dedicated to
Fractal components architectural reconfigurations. It builds upon FPath
but adds the possibility to define reconfiguration scripts to modify the
architecture of a Fractal application. Like FPath, FScript is much more
concise the direct API usage. In addition, the FScript interpreter can
provide transactional support for architectural reconfigurations by
seamlessly integrating with an extended version of Julia (this work is
done by Marc Léger at France Télécom).
2008-02-28: FScript 2.0 Released
FScript version 2.0 is an almost complete rewrite from version 1.0,
with many new features and changes.
Languages changes in FPath
- FPath now (finally!) supports XPath-style shortcuts for common
- The node-set manipulation functions
difference() now have
direct syntactic support as infix operators
- The way FPath sees collection interfaces has changed in an
incompatible way: collection interfaces are now explicitly represented
as nodes even when they have no actual instance.
Languages changes in FScript
- Because of the new shortcuts now supported in FScript, the comments
syntax has been changed:
/*, which were
use to start C/C++ style comments before, are now valid FPath syntax.
The new comments start with
-- (double-dash) and go to the
end of the line.
Implementation and API changes
- FScript 2.0 is now implemented as a set of Fractal components. The
new architecture is much more modular and extensible.
- The client-side APIs have changed. The concepts are mostly the same,
but the details differ. See the Java APIs tutorial for the details.
- Most of the implementation is now completely independent on the
details of Fractal, and only deal with general concepts of nodes, node
properties (e.g. a node's
name) and axes to connect nodes.
This means both languages can be retargeted to toher component models
- FScript 2.0 does not implement transactional semantics by itself
anymore. Instead, it can connect to an extended version of Julia which
provides a much more complete and robust support for reliable ACID
reconfigurations. This work is done by Marc Léger at France Télécom, and
is independent of FScript, but is not publicly available for now.
- The new architecture was designed to support various levels of
static and dynamic analysis of FScript programs, to ensure the
reliability and efficiency of the reconfigurations. As of version 2.0,
only the overall structure of the different phases is in place, and not
much actual analysis is implemented. These analyses are currently in
active research, and the plan is to integrate them in future 2.x
releases with minimal changes to the overall architecture.
Console application changes
- The console now supports automatic completion on axes names and
global variables using the
- Better result formatting.
- Several special commands have been renamed, and most have been
New special commands:
:help provides integrated help on special commands.
:help cmd (e.g.
:get_interpreter varName can be used to obtain a
reference (in variable
varName) to the underlying FScript
interpreter used by the console (a Fractal component). Note that
directly reconfiguring this component from the console is very
hazardous and can easily deadlock the console.
:set_interpreter $varName can be used to change the
FScript interpreter used by the console.
- A new module named
fscript-jade has been added. It
provides a slightly extended version of FScript to support features
specific to the Jade
platform (now part of Jasmine)
Missing or deprecated features
Features from version 1.0 which have not yet been re-implemented in
used to support a variable number of arguments to specify
instantiation context parameters. The FScript 2.0 runtime does not
currently support varargs, so
adl-new() can only be used
in its single argument form (and ADL definition name) at the moment.
new_component() action has not yet been ported to
- Some of the convenience methods provided by the
FScriptInterpreter API (for example
evaluateFrom()) currently do not have any equivalent in
the new APIs.
2008-01-25: FPath and FScript in the TCS Zoo
FPath and FScript have been added to the TCS Zoo, as use cases for the AMMA (ATLAS Model Management
The use cases include syntax definitions for both languages (using TCS), and the corresponding
meta-model (in KM3). AMMA
technologies can, among other things, generate parsers and Eclipse plugins
with structured editors for the languages with these high-level definitions
(see the screenshots on the TCS Zoo page).
This work was done by Frédéric
FScript is available in the
fscript module of the Fractal
project's Subversion repository:
svn co svn://forge.objectweb.org/svnroot/fractal/trunk/fscript
To get a specific release, for example 2.0:
svn co svn://forge.objectweb.org/svnroot/fractal/tags/fscript-2.0
Like most Fractal modules, FScript is managed using Maven. The Maven coordinates are the
<!-- The main FScript module -->
<!-- The console application (optional) -->
<!-- Jade-specific extensions (optional) -->
Currently, the documentation is only available as part of the
Maven-built site, and is not deployed on
http://fractal.objectweb.org/. Until more convenient
packaging is deployed, the best way to obtain FScript 2.0 documentation is
Checkout the main
% svn co svn://forge.objectweb.org/svnroot/fractal/tags/fscript-2.0
% svn co svn://forge.objectweb.org/svnroot/fractal/trunk/fscript
to get the latest development version.
Build and install the FScript website:
% cd fscript
% mvn site
Browse the result at
will find several tutorials for FPath, FScript and the Java APIs in the
Questions, comments, ideas, etc. related to Fractal can be posted on
the Fractal mailing
list (preferably prefixing your email subject with
Both FPath and FScript are Free Software released under the
General Public License version 2.0. See the source files for the