8 Aug 2008 tampe   » (Apprentice)

Not so fast, ... actually freeze

When reason about programming I find it an interesting task to just search for abstractions. I think it is rewarding. So thinking about looping I just by myself discovered the CPS style of doing continuations. I must confess that I've never bothered to understand these stuff more than reading it, saying aha to a simplistic descriptions and skimming the computer science definitions and not really get it. But playing with it my own way I now see the whole beauty of it. And you know as a byproduct I'm not scared of that Mars Monad anymore ;-).

Observation 1 CPS is the unix of looping actually I think that unix mayby should be redesigned with this stuff in mind

Observation 2 CPS makes difficult things simple

Observation 3 CPS may lead to a functional programming way of doing loops e.g. CPS(imperative loop) = functional

Observation 4 One liners in some appropriate loop DSL could do stuff that would scare young programmers to death if they approached it too close with standard functional constructs (Ask them to make an abstraction that permutes with any permutation a n-way table in optimal ordo and do it in a functional way with only lists)

Observation 5 It could be fast as well, well you could make compilers that compiles these CPS that gives you at least as performant as usual loop frameworks and get good performance if you stay close to them logically.

Observation 6 knowing the CPS by hart means that you could augment CPS, actually you could abstract this augmentation process to give your users something more direct intuitive and easy to work with heck you could abstract the optimizer in this way as well.

And hrm, you don't now what CPS are?, don't worry thats what you typically get when you want to implement the yield generator construct in python not having the yield generator construct in python.

These observations will drive and base the development of code inspections and transformation tools in my clambda project

Not knowing but seeking is the way to enlightenment ... have fun

Latest blog entries     Older blog entries

New Advogato Features

FOAF updates: Trust rankings are now exported, making the data available to other users and websites. An external FOAF URI has been added, allowing users to link to an additional FOAF file.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!