User loginNavigation |
LtU ForumApproaches 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 | 5361 reads
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 | 4311 reads
Resolved 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 ? FringeDC Meeting: Introduction to Prolog by Conrad Barski, July 25th 2009 at 1PMEver wanted to learn a little Prolog? Want to learn what it's good for? Join us at the next FringeDC Meeting. Afterwards, we'll stop at a nearby restaurant for some food and to discuss programming. The meeting will be held at the Clark&Parsia offices in downtown DC near the Convention Center(clarkparsia.com/contact) FringeDC is a group in Washington DC interested in fringe programming languages (Lisp, Haskell, Erlang, Prolog, etc.) Anyone is welcome to join our meetings! www.lisperati.com/fringedc.html By drcode at 2009-07-20 16:08 | LtU Forum | login or register to post comments | other blogs | 4408 reads
SimplicityI'm on a campaign, I'm joining a revolution, and it's guiding maxim is this... "Simplicity is the Price of Reliability, a price which I'm now fully prepared to pay." The full quote comes from The Emperor's Old Clothes C.A.R. Hoare 1980 ACM Turing Award Lecture "The price of reliability is the pursuit of the utmost simplicity. It is the price the very rich find most hard to pay." While more features go into a language, in particular threading, I cannot write reliable programs, since the language compiler / interpretor itself becomes ever more complex. So I'm on a hunt for the some other language to be my prime tool.... and Threading is at the top of my list of "features not to have". I've learnt my limitations... unlikely most programmers, I know I'm not smart enough to code reliably in C / C++ like languages. (I didn't say I'm less smart than most programmers, merely that unlike most programmers I know I'm not smart enough.) The code implementing Rubies interpretor is, ahh, um, threaded through with support for threading... Common Lisp has the simplicity of Syntax but is a horrendous sprawl of semantics. Scheme is near the top of my list, but I suspect a touch more expressiveness in semantics may make large programs simpler. Scala appeals... but building it ontop of JVM strikes me as a very very bad start. I'm begging for suggestions. Lambda Cube and programming languagesI've been reading about the Lambda cube type scheme of Henk Barendregt and found it interesting if a little obscure. Does anyone know of any languages that implement the "full cube" (the 8th corner of the cube). I'm familiar with Haskell but I don't think it has dependent types (axis 2 IIRC). Munkres' TopologyNot really the PL-applicable sort of topology, but I think it will be interest to a fair few folks here: there's a PDF scan of James Munkres (2000) Topology available. Postscript: Not anymore. I guess it was not a legitimate distribution of the text. Postscript #2: Or maybe it does still, for some... Human language and machine languageI am reading The language instinct from Steven Pinker. Some of the examples he has are very familiar to compiler construction. Shift/Reduce conflictis a conflict in LALR grammars (most programming languages) where in the parser has to decide between shifting a new token for a rule or reducing the rule. Quoting Stephen C. Johnson from the YACC paper As an example of the power of disambiguating rules, consider a fragment from a programming language involving an ``if-then-else'' construction:That is during a shift/reduce conflict, LALR parsers chose shift over reduce, implying that clauses are always associated with the innermost clause. On the human side of the equation, Steven Pinker talks about Chomsky's classic illustration of turning a declarative sentence into a question
A unicorn is in the garden
-> Is a unicorn in the garden?This is done by taking the auxiliary "is" and moving it. However, this is not a simple move as illustrated in the below case
A unicorn that is eating a flower is in the garden
-> Is a unicorn that is eating a flower in the garden?Chomsky argues that our mental algorithm does not pick words by their linear positions, but does so by grouping it into phrases, implying that during a conflict the mind chooses entire units together. Does this mean that the designers of LALR were goaded by their mintal algorithm to chose shift instead of reduce? Or does this mean that language is an algorithm (albeit more powerful than any parser) that is wired into our brain - and evolution chose shift over reduce because that is the easier one to implement? Also at here By kusimari at 2009-07-18 03:39 | LtU Forum | login or register to post comments | other blogs | 5766 reads
Soccer-Fun: Teaching Functional Programming
By Isaac Gouy at 2009-07-08 15:24 | LtU Forum | login or register to post comments | other blogs | 12369 reads
Trade-offs with abstractionPeter A. H. Petersen has written two weblog posts on abstraction and security: The points he makes echo a theme dear to my heart: abstractions offer the programmer compositionality of construction when creating their programs and systems, but that notion of compositionality does not match all of the properties one needs to ensure that a system is secure. Cf. slogan #2, from my story The irreducible physicality of security properties: Postscript — Before someone mentions it, Joel Spolsky wrote something quite relevant: The Law of Leaky Abstractions |
Browse archives
Active forum topics |
Recent comments
9 weeks 18 hours ago
9 weeks 1 day ago
9 weeks 1 day ago
9 weeks 2 days ago
9 weeks 5 days ago
9 weeks 5 days ago
9 weeks 6 days ago
9 weeks 6 days ago
9 weeks 6 days ago
9 weeks 6 days ago