User loginNavigation |
LtU ForumThe stack calculus : a fundamental (and simple !) calculus for Classical LogicAround April 1 (but doesn't seem like a joke) 2013, on arxiv: We introduce a functional calculus with simple syntax and operational semantics in which the calculi introduced so far in the Curry–Howard correspondence for Classical Logic can be faithfully encoded. Our calculus enjoys confluence without any restriction. Its type system enforces strong normalization of expressions and it is a sound and complete system for full implicational Classical Logic. We give a very simple denotational semantics which allows easy calculations of the interpretation of expressions. I haven't looked at the details yet, but the result are surprisingly simple and look deeply interesting -- if you're into that sort of thing. I was always a bit rebuted the relatively large size of classical calculi, with lots of rules on top of the lambda-calculus. This one doesn't have a lambda primitive (a bit like System L in this respect) and is surprisingly concise.
(Fun fact: intuitionistic calculi are structured by the fact that there is only one hypothesis on the right of the turnstile. They have at most one hypothesis on the left of the turnstile.)
Mutable Structures: ArraysNearly all languages with imperative elements have some kind of an array. In C The C view of arrays has certain advantages: It is memory efficient because it But the C view has some pitfalls as well. First you might fail to allocate Modern languages avoid this pitfalls by certain methods which can be executed All these solutions avoid memory corruption but they have a cost. Additional A language which allows formal verification can avoid all these pitfalls In the article we show an array structure in our programming Since an array is a mutable structure we have to address the framing problem A lot of effort is done currently in the verification community to address the In the article we demonstrate that the framing problem can be solved without We're In The MonadOkay, so it's Easter Sunday, and I feel a bit risen (in the sense of bread dough, that is — full of bubbles). What is more, I have finally made it through Learn You A Haskell, and in consequence I no longer fear The Monad. Indeed, I found myself perpetrating the following little ditty, which I hereby share with other Haskell fans who are also fans of 42nd Street: We're in the monad, We never need to muta- We're in the monad By johnwcowan at 2013-03-31 18:54 | LtU Forum | login or register to post comments | other blogs | 4197 reads
Type dispatch on continuations is isomorphic to type dispatch on calls. Why therefore is it considered "unsound?"Why is doing type dispatch on method calls different or more acceptable to (static) type theorists than doing type dispatch on continuation (return) calls? Function calls and function returns are completely isomorphic, as anyone can prove by transforming a program into continuation-passing style. What possible justification then, can there be for considering type dispatch "sound" and return dispatch "unsound"? The more I think about this the more fundamental a question it seems to become. The essence of sound static typing is that, at any point in the program, we know exactly what type everything is, yes? Without resorting to nasty labels like type tags, for the purists. We can achieve that in the presence of polymorphic function calls by choosing at what point in the program to continue based on what type/s we are returning. There is no difference between this technique and choosing what point in the program to call based on the argument types, because after all every function return is just a function call to a continuation. In both cases, we know exactly what type everything is at every point in the program simply because we do not go to points in the program where the types we have in hand would result in a type mismatch with the types expected at that point in the program. Syntactically some code may look like a ladder of type checks, but the clauses can be treated as separate continuation addresses to pass to the function whose type they are checking. Syntax comparison for function callI have the following ideas for function call syntax a) c = sum.a( 42 ).b( 42 ) b) c = sum( a:42 b:42 ) Which one would you prefer and why? Best maintainable evaluation strategy?Lets face it: Almost all code needs to be maintained, meaning it needs to be fixed and/or extended (Except TeX, but even that needs to be ported to new languages/environments ;)). In order to be maintained, code needs to be understood. So what is the evaluation strategy that you would think is best maintainable? I vote for call-by-value. Call-by-reference decided by callerI wonder if it makes any sense if the caller of a function decides weither a parameter is passed by reference or value. Often when I look at code (C++ mostly) I ask myself "Is this one changed by the function?" and I have to look up the function declaration. Does anyone know of a language implementing such abstraction? Edit: I just realized, that the caller can control how an argument is passed by either making a deep copy before passing it (call-by-value) or not (call-by-ref). Only thing is, the function needs to define this argument as ref. Also this does not work well together with manual memory management, because if you create deep copies of stuff on the fly they do not get cleaned up afterwards, because the function receiving the arg does not know it has been copied before. JSI am not up to it at the moment, but how about someone summarize the developments in the Javascript world (lljs, asm.js etc.) for those not following that world too closely? Thanks. Five "laws" of programming paradigmsNow that we are close to releasing Mozart 2 (a complete redesign of the Mozart system), I have been thinking about how best to summarize the lessons we learned about programming paradigms in CTM. Here are five "laws" that summarize these lessons:
Here a "paradigm" is defined as a formal system that defines how computations are done and that leads to a set of techniques for programming and reasoning about programs. Some commonly used paradigms are called functional programming, object-oriented programming, and logic programming. The term "best paradigm" can have different meanings depending on the ultimate goal of the programming project; it usually refers to a paradigm that maximizes some combination of good properties such as clarity, provability, maintainability, efficiency, and extensibility. I am curious to see what the LtU community thinks of these laws and their formulation. general thread model motivations?About the purpose of threads — especially green threads — I would like to hear suggestions about models, metaphors, terminology, or tactics about why this form of code organization is a good idea. A very high-level, hand-wavy perspective is what I hope to explore, to inform docs one might write for new users of code who ask simply, "But why?" If anyone wants to contribute, I'll also post short comments too, though I'm more interested in what other folks think. Note other ways of organizing code amount to the same thing, just folded differently; for example, coroutines are just green threads by another name and focus, at least in broad terms. I've been thinking about green threads all the time lately, outside work, imagining diagrams and prose to explain the point, as starting context to motivate a library architecture whose VM model revolves around green threads (and groups of them associated under one identity in simulation of a green process). Working on solutions for a long time can make one focus too hard on the answer, and not enough on the question; so I hope I can get folks to ask rhetorical questions that amount to vague problem statement(s) causing one to seek a thread oriented design. Ideas I had earlier this evening got profoundly vague as I tried to generalize. I suspected thread use causes hierarchy flattening, and simplifies by making many complex things uniform in organization. Another half-formed idea likened thread use to a kind of indirection, but a flat top-level indirection, with threads as equal peers. You see I'm trying to squint and find really coarse form and structure here. Here's one last anecdote for entertainment's sake. I'm not sure what year it was — maybe 1996? — but I had a chance to ask Ike Nassi at Apple what he thought needed to be done for Dylan to gel/progress/matriculate/etc, because he was in charge of the Dylan group and I thought he might have a view from on high. He surprised me by saying he wished Dylan had defined a thread model. My first reaction was, "What does that have to do with anything?" But now I get it. So I wonder what I didn't grasp then, which I learned since, that makes the difference. |
Browse archives
Active forum topics |
Recent comments
9 weeks 5 days ago
9 weeks 5 days ago
9 weeks 6 days ago
9 weeks 6 days ago
10 weeks 3 days ago
10 weeks 3 days ago
10 weeks 4 days ago
10 weeks 4 days ago
10 weeks 4 days ago
10 weeks 4 days ago