User loginNavigation |
LtU ForumQuestion concerning parameterization over literalsWe're currently looking at something in BitC, and I'm wondering if there may be a simpler way. I'm concerned that we may have gotten stuck in a "we know how to do types now, so everything is a typing problem" sort of rut. Background In BitC, we have both vectors and arrays. The size of an array is part of its type, but we presently have no way to abstract over that size. This means that we cannot currently build a type class for something like After some head scratching, we concluded that there is no fundamental problem with extending typeclass-style constraints and instantiation to incorporate instantiation over literals. The underlying observation is that every literal can be considered to be a member of some singleton type, and you can then abstract over that type in the usual way. So far so good. But as we dug into it a bit, we somehow moved from "abstraction over literals" to "abstraction over literal-associated singleton types". For example, our old specification of the array type constructor was:
where e must be a literal of type word. The new specification seems to have become:
where "T.len" is required to be a singleton literal type. In this case, that would be a constrained type of the form
read: (forall ((Literal 'len Word))
(fn Stream (by-ref (mutable (array byte 'len))) 'len -> Word)
meaning that read accepts a stream, an array by reference, and a length guaranteed to match the array length, and returns the number of characters read. All well and good, but from a usability perspective we still want to be able to write something simple like: (array char 2) For the moment, there are only a very few syntactic contexts where this would make sense, and Swaroop has proposed that we accept (interchangebly) either a singleton literal type or a value of singleton literal type and "lift" the value to its type in these syntactic contexts. And I think all of that will work. The Question While all of this ought to work, it feels like we are going around Robin Hood's barn here. Are there other languages that have dealt with this, and if so, what should we look at to understand better what has previously been done? Liquid Metal project, Lime language: Java for FPGA co-processors[corrected link, apologies] Liquid Metal, Lime:
A tutorial on implemeting type inference?Hello, Oz/K: A kernel language for component-based open programming
Oz/K: A kernel language for component-based open programming Reflection, Attributes and ParameterizationI wrote up a small blurb about C# attributes used prominently for reflection, and how I think they can be replaced with interfaces without losing any of the declarative benefits, or requiring special compiler handling for metadata. I argue that parameterizing objects with interfaces is ultimately safer than using attributes, given the static typing benefits. By naasking at 2008-11-04 16:12 | LtU Forum | login or register to post comments | other blogs | 6478 reads
New Programming Language IdeaHi all, I'm new to this forum, but it seemed like there are a lotta smart people here, so I wanted to throw an idea out there and see what the 1337 hax0rz think about it. (btw, I'm also not a programming languages guy, so please correct me if I'm wrong) The Problem:
int main(void) This is usually a clear way of writing a program, any programmer that looks at the code can deduce the algorithm, namely, create the cards, shuffle them, then deal them. However, this C++ code is actually programming a very specific process and not necessarily the algorithm that it seems to imply. In actuality, you know very little about this code. All we can deduce from this code is that an object was created, and two of its member functions were called in succession. It could be the code that sets up and detonates a bomb, or the code to break eggs and fry them sunny-side up. It depends completely on how myCards.h is defined, and the algorithmic information is buried within the complex relationships. It is no wonder that understanding someone else's code can be as time-consuming as rewriting the code from scratch. Code without comments is tantamount to writing unusable code. The Idea So looking back on the algorithm -- 1.Get the cards, 2. Shuffle them, 3. Deal the cards. What is different between this and the C++ code before is that here, we don't care how to do it, just get it done. It doesn't matter if I riffled the cards, or pulled some out the middle and put them on top, just as long as they get randomized -- which is what I meant by shuffling them. The algorithmic way of writing this code would be -- 1.get to the state where i have the cards 2. get to the state where the cards are shuffled 3. get to the state where the cards are dealt. The difference is that this is goal-based -- get there, I don't care how you do it, rather than process-based -- do these specific things. The Language Correctness can be proven since each function is supposed to go from its initial state to goal state, if it doesn't, the the function is incorrect and the run-time can isolate more bugs. Conclusion K, so there's more to it if people are interested... but right now, it's still in the planning stages, and could use some help from some experts. A simple proof-of-concept version was written in python. I'm trying to work out a version 2 that will compile to parrrot vm. Any ideas/comments/people that are interested? Total functional language self interpreter?In Turner's paper "Total Functional Programming", as seen on LtU here, on page 16 it says that in a total functional language it's impossible to write an interpreter for that language. I've seen this statement in other papers too. None of them I've seen have shown or made reference to a proof. Some mumble about the halting problem. Can anyone provide a link to a paper with a proof of this, or sketch a proof themselves? It seems to me that if one were to have a language that required the programmer to give correct termination proofs of all functions, then if one could prove the termination of an interpreter for that language, one could write the interpreter in that language. That must mean that one couldn't prove the termination of an interpreter for a total functional language. I'm curious to know why. Implementations of untyped lazy lambda calculusI am trying to create a very efficient implentation of John Tromp's binary lambda calculus so that it can be used as a toy language at golf.shinh.org. It is the pure untyped lambda calculus with only 3 types of operations, lambda abstraction, variable (argument) lookup, and apply. I figure the easiest way to do this is just to convert it into some other language. I only have basic knowledge of some functional languages, I would not mind learning more, but only if it is actually possible to convert the untyped lambda calculus into it. Haskell is lazy but since it is not dynamically typed it runs into problems with "cannot construct the infinite type" Ocaml might be able to get around this problem with the -rectypes but lazyness must be done manually with lazy and Lazy.force. Even if it could work, Ocaml's lazy functions might not be very efficient at all. Another option is to convert into the spineless tagless gmachine notation that Haskell uses. Alot of the Haskell optimizations are done before this step. Can any of these problems be overcome without too much cost? Or any other good languages out there that could? Any advice is appreciated, but you do not need to explain the whole thing in detail, a pointer to the right direction will be of enough help. Call for Submissions, for the International Lisp Conference 2009CALL FOR SUBMISSIONS INTERNATIONAL LISP CONFERENCE 2009 Lisp: The Next 50 Years http://www.international-lisp-conference.org Massachusetts Institute of Technology Sponsored by the Association of Lisp Users General Information: The Association of Lisp Users is pleased to announce the 2009 We encourage submissions in diverse areas, including but not limited Explaining a known idea in a new way may make as strong a contribution There is no formal separation of categories and no need to explicitly Alongside our usual four-day program of tutorials, prominent invited The official language of the conference is English. Further details Technical Program: Original submissions in all areas related to the conference themes are Papers: Technical papers of up to 15 pages that describe original Demonstrations: Abstracts of up to 4 pages for demonstrations of Tutorials: Abstracts of up to 4 pages for in-depth presentations about Panel discussions: Abstracts of up to 4 pages for discussions about Lightning talks: Abstracts of up to one page for talks to last Important Dates: Please send contributions before the submission deadline to the Deadline for submissions: December 9, 2009 Organizing Committee: Conference Chair: Daniel Weinreb (ITA Software) Technical Program Committee: to be announced soon By Daniel Weinreb at 2008-10-29 10:48 | LtU Forum | login or register to post comments | other blogs | 6325 reads
Web application shootout?Does anyone know of a project roughly similar to the Programming Language Shootout, but for comparing web application frameworks? I'm especially interested in seeing small-to-medium-sized web applications implemented with different tools, with a focus on seeing how each tool enables component reuse. As I announced in a recent post, I'm working on a DSL for web application programming, and I'm looking for ways to quantify the advantages it provides over the competition. So far, I've been unable to find even a single comparison of the proper kind on the web. |
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 5 min ago
9 weeks 18 min ago
9 weeks 1 day ago
9 weeks 1 day ago
9 weeks 1 day ago
9 weeks 1 day ago