User loginNavigation |
LtU ForumTradeoffs between Unique Types and MonadsHello everyone, I am currently trying to understand what the trade-offs are between uniqueness typing and monads. On the surface uniqueness typing seems a little easier to grasp and read (code wise), but it seems there is a lot of fascination with Monads. I was curious how one would judge whether to use one or the other in order to model side-effects in a pure functional language. Which strategy gives the most 'bang-for-the-buck' in regards to language semantics but also in regards to learning curve? Thank you everyone in advance for being so helpful. =) Regards, -M. BBC Radio 4 Programme about the History and Development of AIHi, I don't know if any of you are interested in this but, the weekly BBC Radio 4 program "In Our Time" last installment divoted the whole program to the development and history of Artifical Intelligence (AI). As you are probably aware, BBC Radio 4 offers a "listen again" service where past programs are streamed to you via Real Player so that you can enjoy missed programmes at your leisure. However, "IOT" is one of the few programs where you can actually download the programme as an MP3 as well. "IOT"'s webiste is here: http://www.bbc.co.uk/radio4/history/inourtime/inourtime.shtml. The next episode (about the Peterloo Massacre) is on Thursday morning and this new episode will replace this current edition about AI, so you may need to "digitus extractus" if you want to catch the programme and listen to it. Enjoy Is this a new programming paradigmI am implementing a new language whose fundamental blocks are two structures called "Connect" and "Signal". The "Signal" carries the data from one connect to another. A Connect takes a signal as an input and gives another signal as the output.The behaviour of the connect depends on the following things: Can i call this a new way of doing things, a paradigm? CPS without GC?I am steadily growing frustrated with the programming languages and more importantly their implementations that I use both at work and at home. I won't bore you with why. So I thought I'd have a go at creating a language and RTL that I would like to use. Personally, I happen to think OO is greatly overrated and prefer a functional/procedural approach and would probably prefer to use CPS for the implementation but would rather shy away from the complexities of garbage collection. But as far as I can tell it seems impossible to implement continuation passing style (and closures, of course) without garbage collection. Correct? (I can tell as I write this that anyone responding is just going to say 'GC has decades of research behind it and these days can be extremely efficient while remaining relatively simple. What's the problem?' so rather than explain why I don't want GC perhaps my question can be taken as a hypothetical inquiry. :)) Types and reflectionIn my day-job as a Java programmer I use a lot of tools that relies heavily on reflection, and I've come up with quite a few uses of reflection that can simplify my day job. Having also become quite fond of OCaml and it's powerful type systems I've started wondering if combining reflection with a powerful type system is possible. The two features seem quite at odds with each other, reflection completely undermines the type system, something I also see every day in my day-job. Has anyone looked at ways of combining the power of these two language features? In OCaml I'll have to resort to something like camlp4 if I want to do the stuff I use reflection for in Java. But it's seems to me that there might be a middle ground between syntactic extension and the metaprogramming allowed by reflection. Or is there some fundamental reason why this is impossible? As you probably understand I really don't have any clue what this is called, or if it exists, or if it's useful, so I'm curious about anything that might shed some light on it. Continuations from Generalized Stack Inspection
Practical: Designing a graph matching language.I've written a graph pattern-matcher (Common Lisp), and I was wondering if anyone could offer comments regarding primitives or operators to modify or add. Mostly, I tried to extend regexes to graphes (or any data structure that can contain references), and make it easier to extend the language. Maybe I should have posted this on my own webspace and pasted a link. If it is the case, simply tell me and I'll fix that. Ob-Grocery list of features: circularity-aware (for the graph that is to be matched, not the pattern against which to match - circular code is wrong ;), not biased towards any data structure, easily extensible and, of course, a dreaded sexp-based syntax. The core of the language is:
And that's it for the primitives. Lazy, one-level deep, macroexpansion (to allow recursive macros) does the rest. Other operators are defined in terms of the previously described primitives and macroexpansion.
Example usage: To match any combination of cons with only 2 atoms in it:
(rep (cons)
(alt (bind a (atom))
(bind b (atom)))
car cdr)
It traverses conses' car and cdr, matching any cons. When the current node isn't a cons, it saves the corresponding atom under the names a or b. If "a" is already bound to something that isn't equal to the current node, it tries to bind it to "b". If, again, "b" is already bound to something that isn't equal to the current node, the matching fails. Thus, it can only match up to two different non-cons atoms (I think there is some redundance here ;). Note that when it does match successfully, the bindings' alist is returned as a second return value. No point in wasting all that work!
Now, it obviously wouldn't be very hard to build a recursive function to do the same job -- in fact, this is exactly what the matcher will do. However, making the same function work in the presence of circularity would make this already repetitive job a tad more tedious. Comments, questions or suggestions (additional operators or another syntax, for example) would be appreciated. Paul Khuong EDIT: How _I_ expect to use this: I want to write a compiler that works, as much as possible, through graph rewriting. I hope the matcher can help a lot there. EDIT2: Fixed the expansion for rep Actual programs written in FP or FL?I've become enamored with Backus's FP language (and the lesser known follow-up FL) as of late. Does anyone know of *any* programs written in either of these languages that are outside the 1-3 line toy variety? I've found nothing. Even 10+ line toy programs would be fine, but a larger program would be even better. (For programs in a related style there's Iverson's J, but I'd still like to see some real FP programs.) Workshop on Synchronization and Concurrency in OO languagesThe workshop on Synchronization and Concurrency in Object-Oriented Languages has a nice, accessible collection of papers on software transactional memory and other language-based approaches to building concurrent systems. By Sriram Srinivasan at 2005-12-07 11:57 | LtU Forum | login or register to post comments | other blogs | 6043 reads
Ulf's Home-Page of Programming Language DesignA giant (and messy!) collection of PL musings, links, and citations. I enjoyed the polymorphism page the most. By Jim Apple at 2005-12-04 14:27 | LtU Forum | login or register to post comments | other blogs | 7638 reads
|
Browse archives
Active forum topics |
Recent comments
9 weeks 17 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