|
Re: Cat is all about Tuples
|
Posted: Nov 21, 2006 7:33 AM
|
|
> I > > was wondering if it'd be possible to allow flow based > > constructs as well. > > What form would flow based primitive constructs take?
Four operations come to mind. One is splitting tuples. I'm using named parameters here.
(int:A, int:B)->(A) (B)
Next is merging:
(int:A) (int:B)->(A B)
Then there is chaining:
{fA -> fB -> {fC, fD}}
Or some sort of syntax to allow chaining of functions. fA,fB,fC and fD can all execute at once if needed. It's up to the compiler to determine if it should be done. There are some basic algorithms for this. The syntax is always difficult because you can merge and split chains. So I'm sure something WAY better can be done.
Also, this entire function would take its parameters from either the stack or yet another chained function. It depends how it's used (nested of not).
Lastly, there are conditional and selective merging and splitting.
(int:S) (int:A) (int:B)->(int:C)
S is the selector and you output either A or B on C.
You can also have selective redirecting.
(int:S) (int:A)->(int:B) (int:C)
Depending on S, A will be output on either B or C. You don't need to use both output.
These are needed for queue based processing.
> > For > > example, how to you reduce a list that is still being > > built AS the reduce operation is executing? > > Use "filter_map_reduce"! :-)
I'm just saying with queues, you can build this with the available language constructs. It's nothing special. You can use it everywhere, not just in this special case.
> > > I'm not sure if you know about my project. > > What is the url?
I only have a blog (username links to it) right now. Beware if you go there. My alter ego is pretty forceful on certain topics. I'll let you know once I release something if you wish.
It's about a visual IDE that has the above constructs and much more. Basically, it's a way to link up different tools together without the restrictions that comes with an execution point (although the implementations can use it). I'm hoping many tools with come with an editor where you can configure them. This is something that I find lacking in programming languages. A simple example is a sort tool where you can pick which algorithm to use and select what data to sort on.
> > This sounds very interesting, but also very different from > where I want to go. I am interested in an operating > environment which maps very closely and efficiently to > single processor hardware.
AH! I'm sorry to hear that. > > However I do agree that queus are an important data > structure, which will be supported by Cat, but not at the > most fundamental level as you suggest. > I'm tempted to add it myself if you'd allow me to take a jab at it. All I need are the four constructs above. Even if it was single processor only, I think it would add something very useful.
> I am not convinced at this point, you can't do what you > want using a very clever library. > Normally, I'd agree with you as everything can be written in any Turing complete language. But we both know this stop languages from being built. Even so, what I'm talking about cannot be written with a library.
> > Note that I don't want to influence you either way. > I'm > > interested in knowing what your personal opinion is on > > this and if it's a direction you have thought of, > whether > > for or against. > > I'd have to see a more complete description to comment > further. > > Thanks for sharing your ideas!
Sure thing.
I usually have difficulty in explaining the virtues of queues. I think I remember you talking about black box connectivity. Well, now you could have them. And you'd finally have lego block style of building software. I think that without seeing it and using it, it'll continue to be difficult to show the real power of this. Streams are at the heart of it all. Once you start using it, I think it'll be hard to use anything else after that.
|
|