User loginNavigation |
LtU ForumI'm from china and I'm working on a new programming language "Zero"First appologize for my poor English.:)So,I just write more codes. I'v found a new way of reusing codes: Question:
How to write a function return all these propX's value?
these three functions are very similar,can we write one function to deal with it? In my new programming language "Zero",it is OK!
So strange!Can it work?How to use it?Can the compiler of the language deal with it? Zero language has an IDE named "Amoeba".Through the syntax of the function analysis, Amoeba knows: so,when we write the function in IDE:
There is a blank we should fill.Amoeba's Code assist will give the message: It means there is only one selection we can fill.Why? Because m1 is integer type,and each side of ":=" has the same type,"Amoeba" knows it. if the code is like this:
Amoeba's Code assist will give the message: Why?because Amoeba don't know m1's type.So there are 3 selections. Now m1 has a "float" type! Let's explain the new way of reusing codes,the rule is: If we found similar codes,write it directly,if something is seeking article on representing cyclic graphs using purely functional data structuresSome time ago I have seen an article reference on LtU that discussed representing cyclic graphs using purely functional data structures. The graph structure was something like flow graph or state machine. The article discussed switch from implementation based on mutable variables to purely functional version, and the thesis of article was that the authors lived more happily with purely functional version afterwards. I was unable to locate article using search (too many unrelated results), if somewhat remember the article or at least its title, please give me a reference. help with type theoryGreetings LTU. I am very new to type theory, taking an independent study in it at my university as my interests seem to point in this direction. However, as an independent study at a university where no one has a real specialization in the subject, there are some basics that I am struggling with. Are there any good forums that would be recommended for someone of my level where I could post questions that I just can't figure out and get some guidance? Thank you in advance. Introducing AmbiI love RPN calculators and have been experimenting with how it may be possible to extend the RPN stack style into a structured programming language. Ambi is the result. Here is Ambi for the factorial function and an invocation:
5 ! .; (The 'import' operator pops the top stack item from the calling context and pushed it onto the expression's stack. 'export' is the converse pushing the top of the expression's stack back out into the calling context's stack.) Notice that the program is written using Polish (prefix) notation without any brackets and individual expressions are written in Reverse Polish (postfix) notation. Actually, Ambi doesn't care whether the programmer writes the program (and individual expressions) in prefix or postfix notation. Here is the exact same program written in postfix.
Ambi is an open source language and has been implemented in browser-based Javascript and an interpreter and documentation lives at http://www.davidpratten.com/ambi There are lots of example programs there that can be loaded into the interpreter just by clicking on them. Ambi owes a debt to Forth, RPL and to CAT. CAT (and earlier) JOY elected to make the composition operator implicit, whereas in Ambi it is made explicit in the 'seq' operator. Your observations, suggestions, and/or critique are welcome. David Graduate Programs in Programming Language Design/Research/Implementation?I have a passion for Programming Language Design; designing compilers, languages and dreaming up functional code; I just finished undergraduate studies from Purdue University (BS: Computer Engineering) and would like to pursue the above for further studies...which schools and deptt. that humble readers of LtU may know of, would you recommend? It doesn't have to be in US necessarily but that helps...just a bit more on myself; so far, I've not done anything ingenious; just followed standard compiler texts and replicated their code to understand what's going on...in this way, I've implemented compilers for very simple subsets of Java and C. There's obviously so much to do! PS: planning to start with graduate studies in Fall '10 (currently working as .NET developer with an IT Consultancy). Any help/advice greatly appreciated! LtU rocks! (and "yes", I DO know what a y-combinator is! (yay!)). (PS: I see there is a "Course">""Graduate Programs in Program Design" Link in this blog but I am seeking a more forthcoming response; of course I will scour through all the listings in detail but where is the action happening RIGHT NOW? Which schools? Under which professors? THANKS! Shubham Harnal. Specifying semantics and type rulesThere are relatively few language specifications out there which incorporate a formal statement of semantics and typing rules. Of those that do, the one that I'm most familiar with (ML) uses a fairly hard to read notation. We're at the point where we want to incorporate such a statement into the BitC specification, and I'ld appreciate pointers, inputs, and suggestions on how we might express these things with the greatest clarity and precision. It seems to me, naively, that we need to specify how the full language syntax maps (syntactically) to a canonicalized core syntax, and then specify the semantics and typing rules for that core. At the moment, I'm attracted to the notation used by Pierce's book (and of course by others). I'm willing to sacrifice textual compactness for clarity. On the other hand, the idea of formalizing directly in Coq has its appeal. Are there examples of specifications out there that we should look at as potential exemplars? If so, why are they exemplars? What makes them good. Conversely, are there examples out there of approaches to avoid, and why? Aside: this isn't the right forum for an extended discussion of formalizing BitC in particular, but if you would like to participate in that process, please do come join the appropriate mailing list. Parsing with error recovery?Are there parser DSLs which allow you to 'nicely' specify error handling? It seems natural with, say, parser combinators, though something that is otherwise more akin to LL(1) would be more interesting. The context is that some of the most common languages are generally thought of as LL(1), CFGs, etc., yet, in reality, their informal specifications allow some forms of erroneous input and actually define how to handle them. This means they're not really erroneous, but pockets of complication that should be somewhat uniformly handled in an isolated manner. Tony Hoare / Historically Bad Ideas: "Null References: The Billion Dollar Mistake"(seen via http://catless.ncl.ac.uk/Risks/25.51.html#subj9.1, i didn't find it searching on ltu yet) at qcon, london:
Nested functions - how many nesting levels are really needed?I'm implementing a language that supports nested functions with closure semantics, i.e.
def func(x:int) returns (int):int
{
return def nested(y:int) returns int
{ x*y; }
}
Now, to simplify the closure implementation, I only allow one nesting level. Is this overly restrictive? What does other languages do? I haven't come across a real-life use-case for multiple nesting levels. Any opinions / counter examples would be greatly appreciated. Thanks. Efficient Interpretation by Transforming Data Types and Patterns to Functions
|
Browse archives
Active forum topics |
Recent comments
8 weeks 2 days ago
8 weeks 2 days ago
8 weeks 3 days ago
8 weeks 3 days ago
9 weeks 7 hours ago
9 weeks 8 hours ago
9 weeks 1 day ago
9 weeks 1 day ago
9 weeks 1 day ago
9 weeks 1 day ago