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:
“The sayings of a community, its proverbs, are its characteristic comment upon life; they imply its history, suggest its attitude toward the world and its way of accepting life. Such an idiom makes the finest language any writer can have; and he can never get it with a notebook. He himself must be able to think and feel in that speechit is a gift from heart to heart.”
—Willa Cather (18731947)
“UG [universal grammar] may be regarded as a characterization of the genetically determined language faculty. One may think of this faculty as a language acquisition device, an innate component of the human mind that yields a particular language through interaction with present experience, a device that converts experience into a system of knowledge attained: knowledge of one or another language.”
—Noam Chomsky (b. 1928)
“Whether we regard the Womens Liberation movement as a serious threat, a passing convulsion, or a fashionable idiocy, it is a movement that mounts an attack on practically everything that women value today and introduces the language and sentiments of political confrontation into the area of personal relationships.”
—Arianna Stassinopoulos (b. 1950)