Functional Programming in OutSystems.

By Schalk Dormehl on 4 Jan

So first the benefits; 


1. Radically less logic.

2. Radically less errors per function.

3. Radically clearer logic in terms of human comprehension.

4. LINQ like functionality in the OutSystems drag and drop fashion!

5. Potential future avenues of performance increases such as the MapReduce pattern and lazy evaluation.


I know there is going to be massive resistance to this this suggestion, but here we go anyway.

As far as I can tell, we need 3 things to introduce lambdas into OutSystems.

1. Basic inferred typing. Imagine there is an output variable, that if you assigned something to it in the action / function that the systems looks at the assignments and constructs the type correctly. Anywhere you use the function will now have the function's output as this inferred type.

2. The ability to pass functions around as parameters. This will essentially be the analog to delegates in C#.

3. Then finally the ability to have a lambda definition element. It would be similar in the loop element, in that it has an entry, an internal segment and an exit connector. In addition it would have the same inferred result type and the assignments inside of its scope would adjust that result type.

Between these 3 elements we will be able to rebuild the entirety of LINQ for instance inside of OutSystems. I'm presumptuous now, but it should also be fairly simple for OutSystems to implement the above 3 without having to rework the entire compilation structure, their underlying languages already support this kind of thing. Again, probably and incredibly presumptuous statement.

4. (Optional) Pure functions that cannot change any permanent state of the system.

I know functional programming changed my whole way of thinking. It makes coding about the problem and not the structures. The only tech that was more of a productive leap was OutSystems.

We could then further implement things such as lazy evaluation, expression compilation, reactive extensions, etc, etc, etc.

I hope someone plays around with this, it would be an awesome feature

This idea has no comments yet. Be the first to comment!