An extract on #skill
SKILL was originally based on a flavor of Lisp called Franz Lisp created at UC Berkeley by the students of Professor Richard J. Fateman. SKILL is not an acronym; it is a name. For trademark reasons Cadence prefers it be capitalized.
Franz Lisp and all other flavors of LISP were eventually superseded by an ANSI standard for Lisp called "Common Lisp." Historically, SKILL was known as IL. SKILL was a library of IL functions. The name was originally an initialism for Silicon Compiler Interface Language (SCIL), pronounced "SKIL", which then morphed into "SKILL", a plain English word that was easier for everyone to remember.
"IL" was just Interface Language. Whilst SKILL was used initially to describe the API rather than the language, the snappier name stuck. The name "IL" remains a common file extension used for SKILL code ".il" designating that the code contained in the file has lisp-2 semantics. Another possible file extension is ".ils" designating that the content has lisp-1 semantics.
SKILL programmers have a choice of expression syntaxes. Traditional Lisp syntax such as
can be mixed with C-like syntax such as
White space between the function name and the opening parenthesis, as in
is also allowed but has a different meaning. For example,
(list car (mylist))
has the traditional lisp meaning of a call to the list function with two operands car and (mylist), the first of which is a variable reference, and the second a call to the mylist function. Usually this is not what the beginner programmer intended. Thus, SKILL novices usually incorrectly think of car (mylist) as a syntax error.
Certain arithmetic operations can be also called using an infix notation. Thus each of the following is recognized and in fact are represented the same internally
Functions may be called using several different indirect second order functions.
This infix notation was introduced to make it easier for programmers familiar with C and other procedural languages to understand and write SKILL code.
SKILL indeed internally represents the language as traditional Lisp S-expression, the surface syntax loosens this restriction compared to other lisps. More elaborate examples look quite different from their Lisp equivalents. For example, the factorial function in SKILL may be represented several different ways which are all compiled to the identical internal representation.
The SKILL language supports both dynamic (sometimes referred to as special) and lexical variables. However, a single function is limited to interpret its variables homogeneously. There are several ways of syntactically indicating whether a function be interpreted lexically or dynamically. One of which are to use (inSkill ..) and (inScheme ...) forms indicating dynamic and lexical scoping respectively.
(inSkill (lambda (A B) (A B)))
In the inSkill example A and B are dynamic variables in the parameter list of the lambda (the lambda list), and (A B) within the body of the function is interpreted as a call to the globally defined function A passing the value of the local dynamic variable B.
(inScheme (lambda (A B) (A B)))
In the inScheme example A and B are lexical variables in both the lambda list, and also (A B) within the body of the function which is interpreted as a call to the function A which has been passed and a parameter the value of the local lexical variable B.
inSkill and inScheme forms may be mixed within a single function with some degree of flexibility.
(inScheme (lambda (A B) (A (inSkill B) B)))
In this example a lexical 2-ary function is created which calls A, a function passed as its first argument, passing two parameters: the value of the dynamic variable B and also the value of the local lexical variable B.
SKILL supports several kinds of functions. In addition to the functions and special forms built into the language, users can create functions in their own applications of several varieties.
Anonymous functions including lexical closures.
Lambda functions which evaluate their arguments using normal left-to-right evaluation rules.
Nlambda functions which do not evaluate their arguments, but pass their operands unevaluated at run time.
Macros which are evaluated by expanding at load/compile time. The expressions a macro returns (evaluates to) become input for the compiler, and is thus evaluated at run time.
SKILL supports CLOS-like generic functions which are allowed to have an optional default implementation.
SKILL supports CLOS-like methods which specialize on all their required arguments. (Older versions of SKILL only support specialization of the first argument.)
Local functions of two sorts are supported with flet and labels. If local functions are defined with flet such as inner1 and inner2 below, neither one can see the other's definition.
If local functions are defined with labels such as inner1 and inner2 below, all of them see the other's definition. Local function are only supported in lexical mode.