WSL(ID:1447/wsl001)

Waterloo Systems Language 


Waterloo Systems Language. A C-like systems programming language.


References:
  • Boswell, F.D. "Waterloo Systems Language: Tutorial and Language Reference", WAcom Publications Ltd, Waterloo, Canada. 1982 view details
  • Gigudre, Eric "Exotic Language Of The Month Club WSL: The best of C, Pascal, and more" Computer Language 5(2) February 1988 view details Extract: iNTRO
    Among procedure-oriented languages, C and Pascal are two of the most popular, each for different reasons. Pascal is the language of choice for educational purposes; its simple syntax, strict data typing, and emphasis on structured programming make it perfect for introductory programming courses. C, on the other hand, is a more flexible language, giving the programmer a degree of control approaching that of assembly language while maintaining high-level control structures and some portability.
    In some ways, C and Pascal are at opposite ends of the spectrum, each with its own often-zealous advocates. Waterloo Systems Language (WSL, usually pronounced "whistle") is a language that occupies the middle ground. It is a hybrid of C and Pascal, combining strong points from each to form a language with a sum total greater than its parts. But WSL is more than a simple hybrid. It's probably best to say that WSL evolved from C and Pascal.
    WSL was the brainchild of F.D. Bos-well of the Computer Systems Group (CSG), a research group at the University of Waterloo, Ont., Canada. Originally designed in 1979 as the implementation language for the Waterloo Pascal compiler on the IBM System 370, WSL was created out of a need for a systems-oriented language that is both hardware-and system-independent and very simple. C was rejected because at the time it was primarily UNIX oriented and its file I/O system byte oriented, whereas the System 370 under VM/CMS was record oriented. Thus WSL was designed based on C, Pascal, and other procedure-oriented languages.
    WSL is a simple language, easily described with LALR (look ahead left right) grammar. WSL grammar generates a parser with approximately 380 states, close to the number of states in a C parser. However, a one-pass WSL compiler is usually smaller than its C counterpart because the semantics of the language are generally less complex.
    Many programmers consider WSL superior to C as a systems-oriented language. The language's ending keywords, efficient control structures, well-developed pointer operations, simple expressions, and well-rounded library make for readable and useful programs.
    WSL has been used for most large-scale development projects at CSG. Internal versions of WSL compilers have been written for various machine architectures, including the IBM 370, DEC PDP-11, IBM Series/1, and DEC VAX, as well as microprocessors such as the 8086, 68000, and 6502. The language is also taught to computer science majors at the University of Waterloo, but little has been done to popularize WSL and it is rarely found outside the university.
    In general, WSL program organization is similar to that of the C language. Source code may be spread out across
    several files (modules) that are compiled separately and linked together with a standard library of routines to create an executable program. A C-style preprocessor allows for the inclusion of header files. The development environment is also reminiscent of C; common C-oriented utilities are used effectively with WSL source. At CSG, internally developed make and grep utilities (part of the Waterloo C Tools package) developed for the Waterloo C compiler are often used as programming aids for WSL development.
    Internal program structure within a WSL module has a Pascal flavor. A module has two optional components: definitions and procedures. If present, the definitions section must come first; it defines types, constants, and objects used throughout the module. The actual routines making up the module are found in the procedures section. WSL has no explicit differentiation between functions and procedures as in Pascal. A WSL procedure may return a value if so declared. Figure 1 shows the organization of a module.
    The definitions section of a WSL module is usually critical since nothing is predefined. Each definitions section is made up of one or more definition blocks, much like Pascal. A definition block starts with one of the keywords type, struct, const, import, export, or domestic and continues until the next definition block or procedures section is encountered.
    Since nothing is predefined, a WSL module usually defines a set of types for use within the program. Commonly used scalar types are defined in the header file standard.inc. Type declarations follow the Pascal style: type descriptors following type names. Pointer and array modifiers are to the immediate right of the type name and read in a straight left-to-right fashion, avoiding confusion of different placements and precedences of C-type modifiers. Extract: eNVOI
    While unknown outside of the University of Waterloo, WSL has found a dedicated core of users within CSG. As a consequence, the language has been steadily evolving over the years as more and more programmers use it. Future directions for WSL include intermodule type checking and stricter data typing, as influenced by the popularity of languages like Ada and Modula-2.