1. What's new in the Quark Platform and the CAL Language
version 1.7.1-0 (November 15, 2007)
-
new document: The Development History of Quark.
-
implementation of the new computer language shootout benchmark ThreadRing.
-
enhancements to the ICE manual with examples of using :find and single and
multi-threaded debugging.
-
memory-use improvement in the CAL runtime
-
experimental code generation optimization to reduce memory usage in certain
cases by nulling out the last reference to a method argument or local variable.
Can be enabled by setting the system property
org.openquark.cal.machine.lecc.source_code_space_optimization. There is a
similar experimental transformation at the bytecode level in Open Quark 1.7.0.
The advantage of the code-generation level optimization is that it is more
explicit, and it works both in the lecc source generation mode as well as in
the lecc bytecode generation mode.
-
bug fixes
-
fixed problems with the Open Quark build scripts in 1.7.0 and made them work
with Eclipse 3.3.0.
-
bug fix for foreign types located in a Java package with a 1 segment name. (more
details)
-
compilation error instead of a runtime error for foreign types in an unnamed
(i.e. default) package
-
fixed problems with the deployment metadata for gems. They needed resaving to
the new format.
version 1.7.0-0 (October 26, 2007)
-
new Record Creation special Gem in the Gem Cutter.
-
ability to create record instance functions without adding new compiler
primitives. This is useful for making records an instance of a type-class such
as Eq {r}, Ord {r} or Show {r}. (more
details)
-
Standalone CAL libraries- Standalone JARs have minimal start-up times, and can
be used when accessing the CAL compiler in the running application is not
needed. The standalone JAR builder that previously created standalone CAL
applications can now also create standalone CAL libraries. (more
details)
-
sample standalone library exposing the DirectedGraph module
-
smaller-footprint deployment options. The JAR previously containing the
CAL compiler and its runtime support has been split into 2 separate JARs.
The new CAL runtime JAR is 584KB in size while the previous combined JAR
was 4338KB.
-
improved refactoring and symbol identification support in the CAL Eclipse
Plug-in, as well as the CAL services layer:
-
renaming local variables, type variables and data constructor field
names
-
F3/go to declaration (the keyboard/context menu equivalent to hyperlinks) now
works with these new types of symbols
-
CALDoc tooltips for all identifiers (including local variables, field names,
type variables)
-
new or enhanced CAL modules:
-
Enhanced XML parser to be fully XML 1.0 conformant. Also added an Encoding
library.
-
Enhanced the Parallel module to allow an Executor to be specified to control
thread usage.
-
Allow CAL values to be registered as cleanable using a CAL function
(System.registerCleanableFunction).
-
New function File.readFileLines to read-in the lines of a file lazily.
-
New modules RegEx for regular expressions, FormatRecord for formatting record
values, and BoundedParallel for parallel computations using a bounded number of
threads.
-
tracing, statistics gathering, and interactive debugging are thread-safe and
work in concurrent mode, as well as in standalone libraries.
-
memory-use improvements in the CAL runtime:
-
elimination of need of the execution context to hold onto the rootnode. i.e. no
caching of RTValues in the rootnode any-more. See CAL Runtime Internals
for details.
-
experimental bytecode optimization to reduce memory usage in certain cases by
nulling out the last reference to a method argument or local variable. Can be
enabled by setting the system property
org.openquark.cal.machine.lecc.bytecode_space_optimization.
-
SourceModelVisualizer- a utility for inspecting the structure of
source models and identified symbols and their relationship with the actual
source text.
-
new document: Interactive CAL Environment (ICE) Manual
-
describes the text-based interactive environment for evaluating CAL
expressions, obtaining information about CAL entities, refactoring, debugging,
etc.
-
new document Developing Eclipse Plug-ins that make use of CAL Workspaces
-
updates to How to Build Open Quark to explain building
of various collaterals (such as generating PDFs, DocBook, ANTLR grammars etc)
-
various collaterals now included in the distribution instead of as separate
downloads
-
The paper: The Gem Cutter - A Graphical Tool for Creating Functions in the
Strongly-typed Lazy Functional Language CAL
(gemcutter-techpaper.pdf)
-
HTML pages: Open Quark Overview and the code samples for the CalIntro and Sql
modules
-
the tutorial videos (Gem Intro Parts 1 & 2, ICE and CAL Intro, Tool
Walkthrough, Eclipse Plug-in) are now released under a BSD licenses (but are
separate downloads due to size).
-
bug fixes and smaller enhancements
-
Added section of Java meets Quark explaining deployment options. (more
details)
-
Added a target to the build.xml Ant script for building CAL's ANTLR grammar. (more
details)
-
Context class loaders can now load CAL resources. (more
details)
version 1.6.1-0 (September 21, 2007)
-
new document Getting Started with Open Quark
provides an introduction to Open Quark for new users and an overview
of the other documents and resources available for learning more.
-
new CAL modules for concurrency:
-
Parallel
for various parallel evaluation functions such as par, parallelTuple2 and
parallelMap.
-
BlockingQueue
for a CAL implementation of a blocking queue.
-
Chameneos, Message and Message_2 provide implementations of the multi-threaded
benchmarks in the
Computer Language Benchmarks Game. Updated the CAL and the
Computer Language Benchmarks Game doc to discuss this new approach to
direct concurrency support in CAL.
-
Open Quark build process now included
-
build scripts for building the various Open Quark distributions (Quark Platform
binaries and sources, CAL Eclipse Plug-in binaries and sources) from
unzipped source distributions are now included.
-
new document How_To_Build_OpenQuark.txt.
-
new CAL Eclipse Plug-in features:
-
new Quick Outline view
-
new quick view displays the outline of the current module in-place in the
editor area
-
invoke using Ctrl-O or select Navigate -> Quick Outline
-
CAL Console enhancements to make the Console more similar to ICE:
-
unqualified symbols in entered code expressions are now automatically qualified
if unambiguous
-
added new commands
-
:t
– display the type of a CAL expression
-
:rs
– reset cached CAFs
-
:spc and :pc – display and execute from command
history
-
Rename refactoring can now rename entire modules
-
Goto next and previous elements (Ctrl-Shift-Up/Down arrow)
-
new commands to move the cursor to the next/previous top level element
definition
-
Parser module generalized to accept String as a sequence of character tokens.
Updated XmlParser to use this which resulted in large memory
savings and some speed improvement. CDATA handling improved too.
-
Set which module is the startup module for ICE.
-
ICE will default to the first module in the loaded workspace definition.
-
updated the document Java meets Quark with a new section discussing
deployment approaches such as the required JARs for deploying Quark (more
details).
-
Bug fixes and various smaller enhancements:
-
derived instance declarations which are invalid due to type reasons now give
line/column position information in the error messages. (more
details).
version 1.6.0-0 (August 29, 2007)
-
new CAL modules (more
details)
-
SqlType
for describing the types of values in a SQL database
-
BusinessCalendar, GregorianBusinessCalendar and FiscalBusinessCalendar
for working with database date/time fields with respect to periods such as
Year, Quarter, Month, etc.
-
DataDictionary and SqlDataDictionary
to expose a simplified view of a database that can be queried more simply than
by constructing SQL (either directly, or using the CAL Sql module types).
-
DictionaryQuery
supports queries on data dictionaries. Complex concepts like database tables
and joins are not needed in these queries.
-
DirectedGraph provides a directed graph data type, and
various functions on it.
-
Drawing
exposes Java2D functionality in CAL.
-
XmlParser
is an XML parser implemented using the functionality of the CAL Parser
module.
-
CollectionUtilities contains various utility functions for working
with collections.
-
IO source generator (more
details)
-
a utility that assists in marshaling CAL values to/from Java by creating Java
types corresponding to CAL types, and defining reasonable Inputable/Outputable
instances for the corresponding CAL types.
-
there is a document (Input/Output Source Generation Tool) on how to
use this feature.
-
Connections in the Gem Cutter can now be automatically split to form
a collector/emitter pair.
-
New documentation on the implementation of CAL
-
CAL Runtime Internals
explains how the CAL runtime is implemented, and some of the optimizations
used.
-
CAL Global Optimizer
has information about an optimization pass of the CAL compiler for doing global
optimizations such as inlining and fusion.
-
CAL Benchmarking
is an account of various optimizations, and their effects on performance,
covering a period of approximately four years.
-
Generating DocBook Documentation explains our process for generating
documentation in multiple formats (JavaHelp, PDF, HTML, Eclipse Help) from a
single DocBook source.
-
CAL now requires Java 5. The implementation and Java API have been updated to
use Java 5 features such as generics (more
details).
-
New features in the CAL Eclipse Plug-in:
-
New console page in the Console view can be used to evaluate CAL expressions
with respect to the CAL modules in the Eclipse workspace.
-
New item in the Project menu to clear all build state specific to CAL.
-
Supports JARs for packaged sets of CAL modules as Eclipse referenced
libraries.
-
If the hyperlink modifier is held down and the source element under the mouse
can be opened then the element displays as a hyperlink.
-
The CAL source pretty printer now handles comments (both CALDoc and regular
comments).
-
CAL foreign function syntax supports creating Java class literals.
-
e.g. foreign unsafe import jvm "class java.lang.String" stringClass :: JClass;
-
The CAL_Benchmarks project now includes more CAL benchmarks (those we have been
using over the last number of years internally). These are discussed in the CAL
Benchmarking
document.
-
New Prelude functions toCalValue and unsafeFromCalValue for working with the
CalValue type.
-
bug fixes and various smaller enhancements
-
CAL Language Discussion Group reported bug fixes and
suggested enhancements in Open Quark 1.6:
version 1.5.1-0 (July 19, 2007)
-
lazy loading of foreign entities from compiled CAL modules
-
allows for more flexible deployment of CAL generated JARs (more
details)
-
concurrent evaluation of CAL functions on a single execution context
-
this allows concurrent programs to be written entirely in CAL, instead of
having the concurrency instrumented via Java
-
must be enabled by using the VM argument
org.openquark.cal.machine.lecc.concurrent_runtime
-
currently an experimental feature, mainly for those wanting to experiment with
writing concurrency libraries in CAL
-
for example, see the thread on
Parallel CAL
-
startup time improvements for standalone JARs
-
scope icons (public/protected/private) used in the Gem Cutter and CAL Eclipse
plug-in
-
Gem Cutter now warns the user when the next action would result in losing an
unsaved design e.g. new table top, changing the current module, switching
workspaces, etc.
-
enhancement to search in the CAL Eclipse Plug-in, the Gem Cutter and ICE to
find all occurrences where a data constructor is used to construct a value
(i.e. excludes locations where unpacking a value)
-
CAL source pretty printer now preserves parentheses and is now hooked-up in the
CAL Eclipse plug-in
-
CAL Eclipse Plug-in has a new quick fix to insert the fully qualified name of
an unimported symbol (as an alternative to the quick fix for importing the
symbol) and a new quick fix for cases where you import a module and do not
qualify it properly
-
improvements to the CAL implementations of the
Computer Language Benchmark Games
benchmarks, and documentation updates with new timings for the Open Quark 1.5.1
release
-
bug fixes and various smaller enhancements
-
CAL Language Discussion Group reported bugs fixed in Open Quark 1.5.1:
version 1.5.0-0 (June 15, 2007)
-
standalone Utility JARs
-
given a CAL function of type [String] -> (), Open Quark can generate a JAR
with a static main method entry point that can be used to run the function with
supplied command-line arguments.
-
the start-up time to run the function from a cold-start will be much smaller
than running the function via ICE or the Gem Cutter since a CAL workspace is
not loaded.
-
the standalone utility JAR only includes the CAL functions needed to run it,
and thus is small in size.
-
meta-programming using CAL's Java APIs requires loading a CAL workspace, and so
is not supported in a stand-alone utility JAR.
-
improved formatting of CAL source code by tools
-
handles large expressions nicely
-
CAL code generated by the Gem Cutter will be formatted nicely
-
pretty print a CAL module using ICE and the new :pp command
-
organization and appearance of the ICE help has been improved
-
new features in the CAL Eclipse Plug-in
-
inclusion of help in the CAL Eclipse Plug-in
-
the CAL User's Guide, Using CAL with Eclipse, CAL for Haskell Programmers and
Effective CAL are all now available in Eclipse help
-
New Module dialog that can be used for creating new CAL modules
-
New Quark Binaries wizard. Creates .classpath and .project files automatically.
Verifies the Java compiler settings as well.
-
shift-hover now shows the source code for the symbol in the CAL editor.
-
templates for commonly used CAL syntactic structures.
-
insert type declarations action for functions. Works over functions in selected
range or whole file if no range is selected.
-
improvements to existing CAL Eclipse Plug-in features
-
tooltips on local function names. Tooltips on module names in import and module
statements.
-
auto-complete
-
having auto-complete turn on when '.' is pressed.
-
property page for auto-complete behavior.
-
auto-import symbols for auto-completion.
-
open declaration
-
open declaration now works for foreign functions.
-
implement control-click for open declaration action
-
workspace and outline view
-
add rename to the workspace and outline views.
-
overlays show the scope of the CAL entities on the icon.
-
CAL compiler error messages
-
nicer error message for when the VM is an older version and the CAL compiler
cannot handle projects set to a later version.
-
highlights all the text that caused the compilation error instead of just the
first character.
-
some new library functions, bug fixes, documentation improvements
-
new document "Using CAL Archives (Car files)"
-
new collaterals since the last Open Quark release (not part of the Open Quark
but available as separate downloads):
-
Technical Reports:
-
Presentations (PDFs of slides):
version 1.4.0-0 (April 11, 2007)
-
the CAL Eclipse Plug-in is now open-sourced under the Eclipse Public License.
-
the CAL Eclipse Plug-in is a separate download, with its own release notes.
-
some components of the plug-in are licensed under the BSD license of Open Quark
(see the plug-in zip for details).
-
new features in the CAL Eclipse Plug-in:
-
CAL Workspace view provides a categorized tree of all CAL entities in the
workspace
-
CAL Outline view shows the CAL entities in a particular module
-
CAL metadata editing support
-
auto-complete in the CAL editor
-
rename refactoring
-
organize imports refactoring
-
CAL Perspective
-
CAL branding plug-in
-
CAL Eclipse Plug-in documentation:
-
new "Using CAL with Eclipse" document
-
new video "CAL Eclipse Plug-in Features"
-
lazy pattern matching: new CAL syntax to lazily unpack data constructors and
records within a let expression.
-
improved readability of generated Java sources for understanding the Java code
actually generated from CAL sources:
-
Java expression pretty printer, shorter un-desugared CAL identifier names,
improved generated Java source file organization.
-
CAL and the Computer Language Shootout Benchmarks
-
various bug fixes, library enhancements and documentation updates
version 1.3.0-0 (January 24, 2007)
-
Quark Platform is now open-sourced under the BSD license!
-
hierarchical module names e.g. the Prelude module is now called
Cal.Core.Prelude (but can still be referred to as Prelude in most contexts).
This feature allows for modules to be organized according to ownership, as well
as functionality, in a similar way to Java packages. See the CAL User's Guide
for details.
-
new Record Field Selection Gem in the Gem Cutter to easily select fields from a
record (without using Code Gems).
-
improved syntax for CAL foreign functions corresponding to Java non-static
methods, non-static fields and constructors avoids redundant re-specification
of Java type names.
-
foreign functions can be created corresponding to Java null values, Java null
checks, and Java primitive array operations (creation, subscript, update and
length).
-
foreign types corresponding to Java array types no longer need to use JVM
syntax for array names but can use Java source syntax.
-
new Cal.Core.Record module
-
added the ability to output(input) a CAL record (or tuple) to(from) a Java map
from field-names to values.
-
strictRecord function for sequencing the fields of a record
-
Java sources repackaged to the org.openquark namespace (from
com.businessobjects)
-
various improvements to CAL's Java apis. For example, InputPolicy,
OutputPolicy, BasicCALServices and EntryPoints are easier to use.
-
various smaller changes to CAL modules (documented in the CALDoc)
-
various bug fixes
version 1.2.0-140 (Nov 30, 2006)
-
the Business Activity Monitor sample, which is an
extended example of an application program written partially in Java and
partially in CAL, is now fully included. It is executable, includes sources,
and a document describing how to use the application ("Business Activity
Monitor Overview") as well as details about its implementation.
-
Cal.Tutorials.DataProcessing is a new tutorial CAL
module showing how to connect to a relational database (in this case the Apache
Derby database), perform SQL operations, express the results as CAL records,
and perform various reporting and summarizing operations with those records.
-
significantly expanded "Java meets Quark" document
provides more details on ways in which Quark/CAL and Java can interact.
-
can declare foreign functions whose implementations
are Java cast operators or Java instanceof operators. See the CAL User's Guide
documentation on foreign functions for details.
-
enhancements to the Prelude.Num type class to better
support conversions between CAL's various standard numeric types
-
CAL Lists can be converted to and from Java
Iterators in a lazy fashion. See List.toIterator, List.toIteratorWith,
List.fromIterator and List.fromIteratorWith. It simplifies writing Java client
code that lazily explores a CAL list. Added examples of this pattern to the
EventLoop.java sample.
-
support for CAL foreign functions making callbacks
into CAL to trigger further CAL evaluations. See the Prelude.CalFunction type
and the functions Prelude.makeCalFunction and Prelude.evaluatedCalFunction.
There are examples of how to use this in Prelude_Tests. For example, one can
implement sortByExternal (sorting a CAL list using java.util.Collections.sort
which makes call backs to the CAL comparison function a -> a -> Ordering)
using this mechanism without modifying the compiler.
-
various enhancements to CAL's Java apis
-
various bug fixes.
version 1.2.0-135 (Oct 27, 2006)
-
includes Quark's Java apis so that Java applications can be written
incorporating CAL.
-
includes generated Javadoc for Quark's public Java apis
-
document on using Quark's Java apis ("Java meets Quark")
-
samples (i.e. including Java sources) on using Quark's Java apis.
-
the Business Objects GemCutter manual has been extensively expanded to document
more features, as well as incorporate revision suggestions
-
new sample CAL module
Cal.Tutorials.CalIntro
(a quick tutorial for CAL, showing lots of code and not assuming knowledege of
functional programming)
-
new sample CAL module Cal.Tutorials.QuickCheck and other improvements to the
QuickCheck testing modules in CAL
-
the CAL Eclipse Plug-in is now available simultaneously with the release of
Quark 1.2.0_135. It has its own release notes and install zip (or update site).
-
the CellularAutomata and Sudoku sample CAL modules posted on the forums are now
included in the distribution
-
various bug fixes
version 1.2.0-133 (Oct 12, 2006)
2. Contact information + license:
The Quark Platform download is available at:http://labs.businessobjects.com/cal
Check here for updates and announcements as well.
The Quark Platform is available under the BSD license. See the license.txt file
in the root Quark folder of the zip for the precise license.
The CAL Eclipse Plug-in is available under the Eclipse Public License. It is a
separate download from Quark Platform.
There is a Google Group on the
CAL Language and Quark Platform. This is the primary place for
discussions, announcements, and questions about CAL and Quark.
In addition, please feel free to send comments or questions to Luke Evans (luke.evans@businessobjects.com)
or Bo Ilic (bo.ilic@businessobjects.com
).
3. System requirements:
You need to have Java 5 or greater installed to run Quark. Quark has been tested
by us mainly on Windows XP, Linux and Mac OS X, but as a pure Java application
may work on other platforms supporting Java 5 or greater.
The generated HTML based CALDoc has been tested and works with the following
browsers (current versions unless specified): IE6, IE7, Firefox, Safari,
Konqueror.
These release notes are an HTML file, the other documents are PDFs which can be
read using Adobe Reader (http://www.adobe.com/).
4. Basic installation:
Unzip the open_quark_platform.zip to the directory of your choice. Note that
installing on top of a previous version of Open Quark is not
supported- the installation directory must be empty.
In the Quark subfolder there are 4 batch files, which can be used by Windows
users to quickly start-up ICE or the Gem Cutter (just double click on the files
to launch the application). There are also 4 similarly named .sh files that can
be used by Linux or Mac OS users to the same end. There are also 4 .command
files for Mac OS users. These are similar to the .sh files but can start the
corresponding application on a Mac simply by double clicking.
-
ICE.bat - launches ICE with production CAL modules
-
ICE_Test.bat - launches ICE with production as well as test CAL modules
-
GemCutter.bat - launches the Gem Cutter with production CAL modules
-
GemCutter_Test.bat - launches the Gem Cutter with production as well as test
CAL modules.
Note that Java must be accessible from this folder. Alternatively, you can
hand-edit the file javacp.bat to specify the precise location of your Java.
It is possible to deploy Quark in a variety of ways, including entirely using
JAR files, but we have shipped this deployment using .cal files that you can
modify and experiment with. A JAR based deployment can be generated using the
tools we have supplied with this distribution.
5. What is included in this distribution:
This distribution of the Quark Platform includes the following:
-
ICE- the Interactive CAL Environment. This is an interactive console shell for
evaluating CAL expressions, and performing a variety of other operations (such
as changing modules, refactoring, search, viewing CALDoc etc). The :h command
displays the list of available commands.
-
GemCutter - a graphical environment for creating, running and testing CAL
functions, along with a variety of other UI based tools for accessing various
services in the CAL platform, such as refactoring, search, CALDoc generation
etc.
-
Both production as well as test CAL modules are included. These are stored in
files with the .cal extension.
-
The Java API of Quark is included in this distribution as well as the generated
Javadoc HTML for this api.
-
The CAL Eclipse Plug-in- a plug-in for CAL in Eclipse that provides an editor
for CAL files supporting syntax highlighting, indenting, and other features. It
is not included in the basic Quark_Platform zip but is available as a separate
download from the Labs site and has its own release note.
-
quarkc- the Standalone JAR Tool. This tool produces an independent Java JAR
with a main method (corresponding to a designated CAL function), and can be
thought of as a compiler for CAL for producing Java JARs that are deployable
independently of the Quark framework.
-
quarklaunch- a launcher for JARs created using quarkc. Effectively this runs
the main entry point in a JAR created by quarkc, after first setting the
classpath appropriately.
The following documents are included:
-
Quark Platform Release Notes - this file!
-
Getting Started with Open Quark - provides an introduction to Open
Quark for new users and an overview of the other documents and resources
available for learning more.
-
CAL User's Guide- this is a combination tutorial and reference manual on the
CAL language.
-
CAL for Haskell Programmers- this is a short introduction to CAL for people
familiar with Haskell.
-
Effective CAL- a document describing tips for someone past the beginner stage
with CAL.
-
Interactive CAL Environment (ICE) Manual- describes the text-based interactive
environment for evaluating CAL expressions, obtaining information about CAL
entities, refactoring, debugging, etc.
-
Business Objects GemCutter manual- an introduction to some of the functionality
available in the Gem Cutter
-
The Gem Cutter - A Graphical Tool for Creating Functions in the Strongly-typed
Lazy Functional Language CAL (gemcutter-techpaper.pdf)- a more technical paper
on the Gem Cutter for people familiar with functional programming.
-
Java meets Quark- how to use CAL's Java apis to write Java programs that make
use of CAL's functionality.
-
Business Activity Monitor Overview- an intro and technical overview of a larger
real-world sample involving both Java code and CAL code.
-
The Java Foreign Import Tool (JFit)- describes a tool for automatically
generating CAL foreign function and type declarations for Java classes. This
functionality is also exposed as a dialog in the Gem Cutter.
-
Using CAL Archives (Car files)- describes how to create and deploy precompiled
CAL workspaces as JAR files which fully support Quark based metaprogramming
using CAL's Java APIs.
-
Using CAL with Eclipse- describes how to install the CAL Eclipse Plug-in, and
how to use it to develop, run, and test new CAL modules.
-
Developing Eclipse Plug-ins that make use of CAL Workspaces
-
The Development History of Quark
The following documents on the implementation of CAL/Quark are included:
-
CAL Runtime Internals-
explains how the CAL runtime is implemented, and some of the optimizations
used.
-
CAL Global Optimizer-
information about an optimization pass of the CAL compiler for doing global
optimizations such as inlining and fusion.
-
CAL Benchmarking-
an account of various optimizations, and their effects on performance, covering
a period of approximately four years.
-
Generating DocBook Documentation- explains our process for generating
documentation in multiple formats (JavaHelp, PDF, HTML, Eclipse Help) from a
single DocBook source.
In addition, CALDoc HTML generated help is included for the production CAL
modules. You can also generate this help yourself from the distribution (and
vary the options for generation, such as to include test modules as well), but
it is included pre-generated as a convenience.
There are also 5 videos available on the Labs site. These are a good place to
get an end-to-end introduction to what is included in Quark. The videos are:
-
Introduction to Gems and the Gem Cutter (Part 1)
-
Introduction to Gems and the Gem Cutter (Part 2)
-
CAL and the Interactive CAL Environment (ICE) Shell
-
Walkthrough of some Developer Tool Features
-
CAL Eclipse Plug-in Features
CAL modules are defined in files with the .cal extension (such as Prelude.cal).
They are text files. Both the production and release modules are located in the
Quark\bin\cal\debug\CAL subfolder of the install directory. Reading through the
code in some of these modules is a good way to familiarize yourself with CAL
after learning some of the basics through the documents or videos mentioned
above. Note that the production modules should demonstrate reasonable CAL
coding practices, but the test modules contain some examples of extreme and
unreasonable code, that are intended as unit tests, and not examples of well
written CAL code! The distributed CALDoc help only includes the production
modules, so you can see which these are, and determine which are of interest to
look at.
In addition, there are some sample modules that contain tutorials:
-
Cal.Tutorials.CalIntro
- a basic tutorial on CAL, not assuming knowledge of functional programming
-
Cal.Tutorials.CALDoc - writing CAL code with CALDoc
-
Cal.Tutorials.Fibonnaci - various approaches to writing efficient CAL code
-
Cal.Tutorials.LocalizedStrings - localizing CAL modules
-
Cal.Tutorials.QuickCheck - a tutorial on using the QuickCheck module for unit
testing CAL code
-
Cal.Tutorials.DataProcessing - a tutorial on using CAL to access the Apache
Derby database, perform SQL operations, express the results as CAL records, and
perform various reporting and summarizing operations with those records.
Also of note is the CAL modules GemModelDemo and GemModelDemo_Designs. The
former shows the CAL text of 4 functions written and the later is automatically
generated from designs created in the Gem Cutter. These designs are included in
the distribution and can be opened and viewed in the GemCutter by switching to
the GemModelDemo_Designs module, locating the desired Gem in the Gem Browser
(there are 4 in that module from which to chose), right clicking and selecting
"Open Gem Design".
CAL workspace files are defined in modules with a .cws extension. A CAL
workspace is a text file that essentially specifies the collection of modules
that should be loaded upon start-up. The production workspaces are in the
subfolder "Quark\bin\cal\release\Workspace Declarations" of the install
directory, and the test workspaces are in the subfolder
"Quark\bin\cal\debug\Workspace Declarations".
There are also samples of using CAL's Java apis in the samples subfolder of the
distribution. The samples are:
-
GemModelDemo.java -shows the use of our compositional api for creating Gems, as
in the GemCutter
-
SourceModelDemo.java -shows a more language-based apu for creating CAL
functions and other entities programmatically
-
EventLoop.java -shows how CAL lazy computations can be suspended and resumed
under a Java client's control
6. Accessing relational data in the Gem Cutter:
See the Cal.Tutorials.DataProcessing CAL module as well as the Gem Cutter manual
for this information (and more).