User loginNavigation |
LtU Forumif Records - Labels = Tuples then Rows - Labels = what?I have been reading up on row/record polymorphism (thanks to Andreas and Daniel for the pointers), but so far I haven't seen anything which apply the concept of a row variable to tuples. If I understand my theory correctly, record types without labels are in fact tuples (or product types if you prefer). So if you have a row without labels, what would that be? An "unlabeled row"? Viewed from another angle, I want to describe tuples with row variables. The nitty gritty of the whole thing is that I am working on devising an acceptable way to describe stack configurations using type theory. A stack with an integer on top, and anything else on the bottom can be described as: T = int * A where A is the "unlabelled row variable". Perhaps these are examples of "stack types" or I could call them "column types" to distinguish them from rows? Any ideas or suggestions would be much appreciated! The replay bugI am trying to understand continuations (yes, one more!). I found the Javascript example proposed here quite helpful in understanding the basic idea. Let me describe it that way:
Another explanation is that a continuation is like the Replay function of an arcade game that I used to play. The game would replay everything I did during the last game. Then I could stop at one point, and take the game over from that point. Of course continuations are used for a single function, not for a whole program like the punched card description. The entry point is the function call, and the data is the arguments of the function. Invoking the continuation is like replaying in fast forward the past execution of the function till the continuation point (the Now in a bottle) then injecting some new arguments to be used in the rest of the function to be executed. For the program to stay coherent, the new arguments should not be used before the continuation point. It is also interesting to note that when the function terminates, the result is available to the program that invoked the continuation-- it is not returned to the original invoker of the function. There remain some questions:
how convert state macine to petri net?how convert state macine to petri net? Abstractly typed languagesThis is an admittedly rather vague idea that has occurred to me a few times - I'm wondering if anyone has had the same idea, or been able to formalize it in an interesting way. I'm wondering if it would be possible to have a purely functional language, like Haskell, in which 'everything is an abstract data type'. There are no concrete data types in the language itself, everything is dealt with in an abstract / categorical / 'up to isomorphism' kind of way. Data types would be chosen just to reflect what the data logically is, without concern for the physical representation or the performance characteristics of the algorithms involved. So a list of pairs, a hash-table and a function would all be of type Map. (or (Map a) => a, to borrow Haskell's typeclass notation) The compiler, then, could chose which concrete implementation to use, say for a list or a map, based on any kind of compile-time or runtime optimizations it feels like. It can also apply lots of highly abstract categorically-based rewrite rules before it even gets to that stage. Is this idea fatally flawed (I fear it might be, but I can't quite figure out how), or has anyone done anything similar? Haskell -> Javascript converter, kind of(I looked but didn't see any other references to this on LtU) There is now a Haskell -> Javascript converter using the York Haskell Compiler's (YHC's) "core" format. From the YHC Core page:
F3 - Functional GUI Development for JavaChris Oliver has been blogging about F3, a soon-to-be-open-sourced functional programming framework for Java. It's statically typed, comes with an Eclipse plugin, and does some pretty cool dataflow/dependency management. It reminds me of SuperGlue, from McDirmid and Hsieh. Type DifferenceI've got two tuples Ta = (a0, a1, ..., aM) Tb = (a0, a1, ..., aN) With the subtyping relationship Ta <: Tb I am interested in referring to the type difference, and I was thinking of notating it as: Ta \ Tb = (aM, aM+1, ..., aN) Is there a standardized notation or language for referring to such a concept? Anyone know Prolog here?ok so im trying to creat a ai program. I have read Prolog is great for this. Im scared maybe Prolog is limited, I need to talk to someone that knows Prolog and ask him/her a few questions about Prologs limitations. What do you guys think I should use, Prolog or C++? Thanks Functional programming and software engineeringWhen I encountered discussions about OO vs FP on LtU the first time my immediate response was that FP likely doesn't lack anything technology-wise but something essentially different: a discourse about modeling and design that is devoid of implementation or PL feature considerations but mostly strategic. A strategic approach is for instance object oriented analysis and design: start with a decomposition of a system into objects. Identify their responsibilities and relationships ( modularization / class diagrams ), their behaviour and interactions ( methods ) and their properties ( member variables ). The choice of a projects programming language is than influenced by its attitude to embrace the design/modeling strategy and not by other considerations that are secondary to this process: whether it favours recursion over iteration or enables the compiler to safely exploit cute little identities among combinators granted by referential transparency. There has been a funny polemics by Steve Yegge some time ago about Java as the kingdom of nouns that caricatures the obsession of subordinating verbs ( functions ) under nouns ( objects ). The only immediate inversion of this subordination I'm aware of is that of category theory but I didn't notice yet a push of "general abstract nonsense" into a handy toolset that guides the programmer from customer requirements to program code. At the moment FP is advocated in terms of compensations or vagueries. It improves your quality as a programmer even when you write code in Java or C++ and it is "mind expanding" ( whatever this means ) or it is praised as the future of programming because once again it simplifies the life of compiler authors to deal with parallelism. It's always hard to distiguish hope from defiancy. What do you think, are there approaches to transcend the current state by envisioning a new "big picture" or am I'm just wrong in my analysis and so deeply brainwashed by my education that I overlooked the obvious and eternal truth? In the latter case I would be grateful about a "mind expansion". Random "if it bends it is funny, if it breaks it isn't funny" line of thoughtI was wondering how something like duck typing might work in C# or Java (there are other strict languages which do support duck typing, O'Caml for instance). Seems like you would have to have lots of interfaces and then list them when implementing them. Basically every public method would have an interface describing it, and then each class would laboriously list all those interfaces. Actually it all falls apart because I don't think one can say a method takes a set of interfaces for a single parameter. You would have to automatically generate the combinatorical set of interface mixins, and use those in the method signitures. (Just musing over the range of things one could - not particularly want to - do with the way Java/C# are already defined.) |
Browse archives
Active forum topics |
Recent comments
8 weeks 3 days ago
8 weeks 3 days ago
8 weeks 4 days ago
8 weeks 4 days ago
9 weeks 1 day ago
9 weeks 1 day ago
9 weeks 2 days ago
9 weeks 2 days ago
9 weeks 2 days ago
9 weeks 2 days ago