User loginNavigation |
archivesResolved Debates in Syntax Design ?In the spirit of the What Are The Resolved Debates in General Purpose Language Design? topic, I would be interested in hearing your opinion on the specific Syntax Design problem. In designing a new syntax for a programming language, what are the decisions that are objectively good (or bad) ? Most syntaxic questions are rather subjective (for example, 'CamelCase' or 'with_underscores' identifiers ?), but I think that some can be answered definitely with a convincing argumentation. Here is one example : recursive scoping should always be optional and explicit. Recursive scoping is when a defined identifier scope is active at the definition site as well as at the usage site. In Haskell, term definitions have recursive scoping by default, while OCaml doesn't (there is a Example of debates that are probably not resolved (yet ?) :
Do you know of ressources discussing such syntaxic issues in a general way applicable to numerous/all (textual) programming languages ? Question on top-level (and other) environmentsIn Lisps, where definitions, expressions, and syntax transformers can be mixed freely in a block of code, the semantics of environments become a bit complicated, I think. R6RS's expansion process is the best and most clearly described semantics for such blocks that I know. In effect, a block of code is transformed into a This seems sensible, but I wonder if anyone has pointers, information, or rationale for R6RS's and other possible approaches to the semantics of such environments? Thanks By Manuel J. Simoni at 2009-07-22 13:47 | LtU Forum | login or register to post comments | other blogs | 1224 reads
Approaches to dependent types(DT)Approaches to dependent types(DT) Introduction Slogans Ascending Levels of abstraction Dependent types in Haskell Here is a Haskell example of the use of DT from (Raubal and Kuhn 2004). class Named object name | object -> name where instance (Eq name, Named object name) => Eq object where The intended semantics are: I am not sure about the last semantic it might be interpreted as "the named object depends on..". ============================================================ My attempt at dependent types in CafeOBJ Note CafeOBJ modules are parameterized by other modules (not type variables as in Haskell classes) mod! NAMEDOBJECT(object :: TRIV, name :: TRIV) { We can now open the module with any appropriate types In the system generated module replaced sorts can be clearly seen. Some points for comparison: I can see my first attempt does not quite match the semantics of Haskell version. Best regards, Goguen, J. (1991). Types as Theories. Topology and Category in Computer Goguen, J. and R. Burstall (1992). "Institutions: abstract model theory for specification and programming." Journal of the ACM 39(1): 95-146. See http://en.wikipedia.org/wiki/Institution_(computer_science) Hallgren, T. (2001). Fun with Functional Dependencies. In the Hinze, R., J. Jeuring, et al. (2006). Comparing Approaches to Generic Raubal, M. and W. Kuhn (2004). "Ontology-Based Task Simulation." Spatial Thompson, S. (1991). Type Theory and Functional Programming, Addison-Wesley. By Patrick Browne at 2009-07-23 00:08 | LtU Forum | login or register to post comments | other blogs | 1811 reads
|
Browse archivesActive forum topics |