ECL, at least in its purest form, is a declarative, data-centric language. Programs, in the strictest sense, do not exist. Rather an ECL application will specify a number of core datasets (or data values) and then the operations which are to be performed on those values.
Hello world ECL is to have succinct solutions to problems and sensible defaults. The "Hello World" program is characteristically short: 'Hello World' Perhaps a more flavorful example would take a list of strings, sort them into order, and then return that as a result instead. // First declare a dataset with one column containing a list of strings // Datasets can also be binary, CSV, XML or externally defined structures D := DATASET([{'ECL'},{'Declarative'},{'Data'},{'Centric'},{'Programming'},{'Language'}],{STRING Value;}); SD := SORT(D,Value); output(SD) The statements containing a := are defined in ECL as attribute definitions. They do not denote an action; rather a definition of a term. Thus, logically, an ECL program can be read: "bottom to top" OUTPUT(SD) What is an SD? SD := SORT(D,Value); SD is a D that has been sorted by ‘Value’ What is a D? D := DATASET([{'ECL'},{'Declarative'},{'Data'},{'Centric'},{'Programming'},{'Language'}],{STRING Value;}); D is a dataset with one column labeled ‘Value’ and containing the following list of data.
ECL primitives ECL primitives that act upon datasets include SORT, ROLLUP, DEDUP, ITERATE, PROJECT, JOIN, NORMALIZE, DENORMALIZE, PARSE, CHOSEN, ENTH, TOPN, DISTRIBUTE
ECL encapsulation Whilst ECL is terse and LexisNexis claims that 1 line of ECL is roughly equivalent to 120 lines of C++, it still has significant support for large scale programming including data encapsulation and code re-use. The constructs available include MODULE, FUNCTION, FUNCTIONMACRO, INTERFACE, MACRO, EXPORT, SHARED
Support for Parallelism in ECL In the
HPCC implementation, by default, most ECL constructs will execute in parallel across the hardware being used. Many of the primitives also have a LOCAL option to specify that the operation is to occur locally on each node.
Comparison to Map-Reduce The Hadoop Map-Reduce paradigm consists of three phases which correlate to ECL primitives as follows. == References ==