Friday, November 18, 2011

Type programming

http://fexpr.blogspot.com/2011/11/where-do-types-come-from.html


Just started reading the above post when an idea formed.

I am wondering if there is a programming model completely based on types and the rules for assembling them, converting between them, manipulating them etc.  (Kind of functional programming but with types) This may be already feasible in c++ generics but I have not played with that in a while and my memory is full of other sludge.

Anyway, the idea goes something like this.

Establish a set of type descriptions and the rules for assembling one type instance from other type instances ( one or more small bits can be assembled into this big thing..) these rules then act as the error conditions and assertions for the process of aggregating the fragments together into the higher level item.  Sort of like SQL filtering the records into a record set. This allows you to reason about the record set, even before the set exists... it has known verifiable properties.

Anyway,  by describing the whole shebang in terms of type rules, transforms and types, would it be possible to create a system that computed a result without actually having dynamically described operations?

I think this is currently feasible, the more I think about it in both generic programming and some sort of data declaration language, kind of lispish... just not sure what the idea is particularly useful for. 

My idea is more about a kind of functional composition model which acts on types with a hard rule set... ok the more I think about it the more the idea is kind of merging into lisp.... need a brain reboot to get it all straightened out.

Friday afternoon is not the best time for profound thought....


Later.

Got the thread again.... Ok, the seed of the idea was that by defining the composition rules, we can have "Emergent" types.  Types that are able to self assemble rather than be pre-determined by the programmer.  Sounds like insanity?  Probably... been reading Machine Learning papers, writing databases and eating too much sugar.... had this great idea ( laugh later) about building a machine learning system, that could self assemble, self evaluate and then prune out non-useful components to optimize the solution as well as the process. Got a whiteboard full of ideas that I need to write down at the moment... wonder if it will make sense on Monday?  Should I wait... probably partially delusional anyway... but that's the fun part isn't it.


No comments:

Post a Comment