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:
“Theres a cool web of language winds us in,
Retreat from too much joy or too much fear.”
—Robert Graves (18951985)
“Public speaking is done in the public tongue, the national or tribal language; and the language of our tribe is the mens language. Of course women learn it. Were not dumb. If you can tell Margaret Thatcher from Ronald Reagan, or Indira Gandhi from General Somoza, by anything they say, tell me how. This is a mans world, so it talks a mans language.”
—Ursula K. Le Guin (b. 1929)
“Our language has wisely sensed these two sides of mans being alone. It has created the word loneliness to express the pain of being alone. And it has created the word solitude to express the glory of being alone. Although, in daily life, we do not always distinguish these words, we should do so consistently and thus deepen our understanding of our human predicament.”
—Paul Tillich (18861965)