Getting Lambdas into OutSystems

Getting Lambdas into OutSystems

  

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.

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. 

Hi Schalk,

Thank you for your suggestions but the appropriate place for them is here:

http://www.outsystems.com/ideas/

How to keep the TrueChange in order?

I understand why you want it, but imho, Outsystems USP is also the reducing the amount of runtime-errors.


J. wrote:

How to keep the TrueChange in order?

I understand why you want it, but imho, Outsystems USP is also the reducing the amount of runtime-errors.


Hi J,

The TrueChange wouldn't be affected. It would allow any changes to the special result variable within the function. Outside of the function it would identify it and not allow access to elements that it doesn't possess.

Passing a function into an action as a parameter would throw TrueChange errors if the types were incompatible. This can be done similar to how C# generics are approached.

I'm not suggesting dynamic typing, I'm suggesting inferred, static typing.


I was into functional programming a decade ago. Anything like this in OS would have my interest.

Talking about functional programming...

Did OutSystems ever considered generating the application in a functional language. I am thinking about how Erlang based Elixir / Phoenix and OutSystems would be an awesome combination.

I stumbled on this post searching the forums. If anyone is interested I can give a more detailed explanation.

Hi Simon,

OutSystems produces code that can be run on a web server or mobile device. How would generating it in a functional language help this?

In my opinion the Erlang (based) ecosystem provides an superior environment for future process/service oriented applications with event/message based communication.

https://en.wikipedia.org/wiki/Erlang_(programming_language)

The Erlang view of the world, as Joe Armstrong, co-inventor of Erlang summarized in his PhD thesis:

  • Everything is a process.
  • Processes are strongly isolated.
  • Process creation and destruction is a lightweight operation.
  • Message passing is the only way for processes to interact.
  • Processes have unique names.
  • If you know the name of a process you can send it a message.
  • Processes share no resources.
  • Error handling is non-local.
  • Processes do what they are supposed to do or fail.

That's all nice on a theoretical level, but there are no Erlang webservers I'm aware of.

There is the Phoenix Framework and the Elixir language both based on the Erlang VM.

To Killian's point, generating it as a different language does not really help the developer, because you never touch or see the generated code anyways. It could produce machine code or Assembly or whatever, and it would work just as well from the perspective of the developer. Producing an output that is not Java or .NET just means that the people running the servers need to support a less-well known server system.


What are the benefits that you perceive from generating a different language output?


J.Ja

Agreed, from a developers perspective nothing changes. It is the generated environment that will be more processor and memory efficient, fault tolerant, distributed and better suited for process/service oriented deployment.

I know this is probably never going to happen for OutSystems but there is a low code competitor who is looking into this technology or has even implemented it (not sure). So I guess it is not completely of the scale.

Simon de Kraa wrote:

Agreed, from a developers perspective nothing changes. It is the generated environment that will be more processor and memory efficient, fault tolerant, distributed and better suited for process/service oriented deployment.

I know this is probably never going to happen for OutSystems but there is a low code competitor who is looking into this technology or has even implemented it (not sure). So I guess it is not completely of the scale.


I think those are fair points. As it is, though, selling into on-prem installations is difficult, and I think that asking on-prem IT to manage a Web Server that isn't JBoss or IIS is just going to be tough. As it is, my experience with them has been that they don't like having to learn about the OutSystems services.

J.Ja