I like to think of it as "application-as-functional-specification". A functional specification for a stateful system is a function from a list of all inputs to an output, i.e. `fun spec(inputs: List(Input)): Output`. This kind of specification doesn't need to specify `State` at all, as we can simply refer to previous inputs. E.g. imagine a counter system with the inputs `Increment`, `Reset`, and `Get`. The functional…
Application-as-a-Function Thinking
11–20 of 80 posts
Re: Application-as-a-Function Thinking
#12Earlier quoted context omitted.
Elm was inspired by Flux/Redux, not the other way around.
Sorry no, the redux docs specifically mention Elm as an inspiration and previous art https://redux.js.org/understanding/history-and-design/prior-... Flux was before, but it’s not about application as a function
Re: Application-as-a-Function Thinking
#13I like to think of it as "application-as-functional-specification". A functional specification for a stateful system is a function from a list of all inputs to an output, i.e. `fun spec(inputs: List(Input)): Output`. This kind of specification doesn't need to specify `State` at all, as we can simply refer to previous inputs. E.g. imagine a counter system with the inputs `Increment`, `Reset`, and `Get`. The functional…
That idea sounds great. I think this kind of things really work well only in a dedicated DSL
Hence much easier if the language itself precludes breaking out of the pattern.
Re: Application-as-a-Function Thinking
#14I couple of years ago I was lucky to use http4k, a server as a function web library for Kotlin. It was such a wonderful change compared to every other technologies available in both Java and Kotlin. It's simple. Testing becomes so much easier too, as one can instantiate a the whole web routing aspect, without having to bind it to a port and having to send real http requests. If strongly suggest people to take a look…
Re: Application-as-a-Function Thinking
#15> “Application as a Function” Forgive me if I’m oversimplifying, but isn’t this just “stateless servers” and “router-service separation” at its core? Maybe this isn’t targeted for the API crowd, but anybody who has spent even a few months learning modern client-server programming understands this, and web dev is pretty common these days…
Or the Unix vision of composable programs that do one thing and do it well. History repeats itself.
Re: Application-as-a-Function Thinking
#16This is basically introducing Elm (a.k.a the inspiration for Redux) to Android. At least for me this model doesn’t work. Application is all about transitions of state, yes, but in context . That’s why React’s model of managing multiple state points in different levels of the application tree makes so much more sense to me
Elm was inspired by Flux/Redux, not the other way around.
Elm semantics were originally loosely based on functional reactive programming in the sense of Conal Elliot, as per the thesis of its author.
Redux on the other hand is just imperative programming folks rediscovering that a state transition can be described as a pure function S -> S, with all the benefits that come along with it. This is as old as lambda calculus itself. Words like reducer are just red herrings.
Re: Application-as-a-Function Thinking
#17I couple of years ago I was lucky to use http4k, a server as a function web library for Kotlin. It was such a wonderful change compared to every other technologies available in both Java and Kotlin. It's simple. Testing becomes so much easier too, as one can instantiate a the whole web routing aspect, without having to bind it to a port and having to send real http requests. If strongly suggest people to take a look…
Re: Application-as-a-Function Thinking
#18I like to think of it as "application-as-functional-specification". A functional specification for a stateful system is a function from a list of all inputs to an output, i.e. `fun spec(inputs: List(Input)): Output`. This kind of specification doesn't need to specify `State` at all, as we can simply refer to previous inputs. E.g. imagine a counter system with the inputs `Increment`, `Reset`, and `Get`. The functional…
> This kind of specification doesn't need to specify `State` at all, as we can simply refer to previous inputs. E.g. imagine a counter system with the inputs `Increment`, `Reset`, and `Get`. The functional spec for `Get` is "find the latest reset and then count the number of `Increment`s since then".
I could be misunderstanding you, but this does not sound functional to me as `spec` seems to have access to previous inputs to `spec` invocations. What am I missing here?
> I think this is neat, because if you are developing the functional spec with a domain expert that doesn't know programming you don't wanna bother them with, for them, unnecessary bookkeeping details.
This sounds very similar to DDD (like as described as the DDD book at the end of the blog post).
> I learnt this from the Cleanroom software engineering people
At IBM direct, or are there any particular resources you can point to which you found useful?
Many thanks for the contribution.
Re: Application-as-a-Function Thinking
#19I couple of years ago I was lucky to use http4k, a server as a function web library for Kotlin. It was such a wonderful change compared to every other technologies available in both Java and Kotlin. It's simple. Testing becomes so much easier too, as one can instantiate a the whole web routing aspect, without having to bind it to a port and having to send real http requests. If strongly suggest people to take a look…
Re: Application-as-a-Function Thinking
#20All of this being on-chain basically gives 'event logging' out of the box so all functions (i.e. contracts) on a chain can be monitored by any developer involved.
(Building this part myself: https://thestackreport.xyz/dashboards/tezos)