Language
XL is defined at four different levels:
- XL0 defines how an input text is transformed into a parse tree.
- XL1 defines a base language with features comparable to C++
- XL2 defines the standard library, which includes common data types and operators.
- XLR defines a dynamic runtime for XL based on XL0
XL has no primitive types nor keywords. All useful operators and data types, like integers or addition, are defined in the standard library (XL2). XL1 is portable between different execution environments. There is no such guarantee for XL2: if a particular CPU does not implement floating-point multiplication, the corresponding operator definition may be missing from the standard library, and using a floating-point multiply may result in a compile-time error.
The Hello World program in XL looks like the following:
use XL.TEXT_IO WriteLn "Hello World"An alternative form in a style more suitable for large-scale programs would be:
import IO = XL.TEXT_IO IO.WriteLn "Hello World"A recursive implementation of factorial in XLR looks like the following:
0! -> 1 N! -> N * (N-1)!Read more about this topic: XL (programming Language)
Famous quotes containing the word language:
“For all symbols are fluxional; all language is vehicular and transitive, and is good, as ferries and horses are, for conveyance, not as farms and houses are, for homestead.”
—Ralph Waldo Emerson (18031882)
“From a hasty glance through the various tests I figure it out that I would be classified in Group B, indicating Low Average Ability, reserved usually for those just learning to speak the English Language and preparing for a career of holding a spike while another man hits it.”
—Robert Benchley (18891945)
“The language I have learnt these forty years,
My native English, now I must forgo,
And now my tongues use is to me no more
Than an unstringèd viol or a harp.”
—William Shakespeare (15641616)