Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Last revisionBoth sides next revision
about:core [2016/11/09 13:49] – created sbsabout:core [2016/11/09 13:50] sbs
Line 1: Line 1:
 +====== The C-like core of SaC ======
 +
 +
 The language kernel of SAC is a functional subset of C. In this context, the term "functional" refers to a rather straightforward mapping of language constructs to an applied Lambda-calculus. The meaning of programs is given by this mapping and by context-free substitutions, as defined by the applied Lambda-calculus. Still, this meaning is supposed to exactly coincide with that defined by the original host language's semantics, which is based on implicit control flow. The language kernel of SAC is a functional subset of C. In this context, the term "functional" refers to a rather straightforward mapping of language constructs to an applied Lambda-calculus. The meaning of programs is given by this mapping and by context-free substitutions, as defined by the applied Lambda-calculus. Still, this meaning is supposed to exactly coincide with that defined by the original host language's semantics, which is based on implicit control flow.
  
Line 13: Line 16:
 Type => Id Type => Id
 | int | float | double | char | bool | int | float | double | char | bool
 +
 They are sequences of top-level type and function definitions with a specific function main serving as the designated starting point for program execution. Function headers are almost identical to ANSI-C, the sole difference being that supports functions with multiple return values, similar to ID or SISAL . Hence, function definitions may start with sequences of return types, separated by commas, instead of a single return type only. The set of basic types is restricted to the four scalar data types known from C, which represent integer numbers, single and double precision floating point numbers and characters. In contrast to C,SAC explicitly distinguishes between integer and boolean values. Hence, a dedicated data type bool is added to the set of basic types. Furthermore, SAC supports function overloading , i.e., functions may share the same name as long as they differ with respect to the types of their formal parameters. The ordering of function definitions is irrelevant, i.e., functions may be applied before they are defined, thus making obsolete forward declarations of function prototypes. They are sequences of top-level type and function definitions with a specific function main serving as the designated starting point for program execution. Function headers are almost identical to ANSI-C, the sole difference being that supports functions with multiple return values, similar to ID or SISAL . Hence, function definitions may start with sequences of return types, separated by commas, instead of a single return type only. The set of basic types is restricted to the four scalar data types known from C, which represent integer numbers, single and double precision floating point numbers and characters. In contrast to C,SAC explicitly distinguishes between integer and boolean values. Hence, a dedicated data type bool is added to the set of basic types. Furthermore, SAC supports function overloading , i.e., functions may share the same name as long as they differ with respect to the types of their formal parameters. The ordering of function definitions is irrelevant, i.e., functions may be applied before they are defined, thus making obsolete forward declarations of function prototypes.