[DRAFT] Add a new Distribution case known as Application #218
DamianReeves
started this conversation in
Proposal
Replies: 1 comment 2 replies
-
Thank you for the detailed proposal. There's a lot of good ideas here. I'm wondering if it would make sense to separate out the core bundling aspect of the proposal from the other aspects such as entry points, metadata, SDK inclusion? That way we could start by introducing the Application type and refine the details later. I'm not sure but it seems like you forgot to include the type Distribution
= Library ...
| Application ApplicationDistribution
type alias ApplicationDistribution = ... |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
[DRAFT] Adding Application as A New Distribution Kind
Overview
Programming languages have a history of partitioning the kinds of artifacts/distributions produced by their tooling/compilers into one of two categories: libraries or applications.
Elm, .NET, Go, Rust, and C/C++ are all examples of programming languages which have this distinction.
It has become increasingly apparent that the Morphir community (its current and potential adopters) have use-cases that would benefit from the addition of a new application focused distribution.
What are some of the capabilities and properties that an Application distribution should have, and what use-cases should it enable.
Applications Have Entry points
In programming languages applications have entry points. And the same should hold for Morphir Applications. A Morphir Application distribution should capture enough context that a backend or runtime of some sort can interrogate/analyze/scan a Morphir distribution and know what are the possible entry points.
It may be possible that there are multiple entry points within one application and that that entry point is meant to enable a specific service.
Below is one possible view:
Entry Point Selection
Applications Should Support Metadata To Help With Binding To A Variety Of Backends/Runtimes
Applications Are Standalone
The
Application
distribution should represent a fully standalone unit, this should include not just user defined functions but also potentially what SDK and Native functions/types are used.Why would we want this?
Use-case A
One use-case that we have is to fully version a
Distribution
and to be able to make claims that:Application
distributions are equivalentApplication
distributions are compatible -To be more concrete, our use-case requires us to be able to safely version the types and logic we would be embedding in an application. By contract our use-case wants to ensure when replay events or messages and execute those events/messages against the "Application" that we are guaranteed the "Application" is consistent. This consistency guarantee may be relaxed to allow for compatible bug fixes.
Use-case B
An additional (and unrelated use-case) is to allow for tree-shaking of a distribution all the way down to what portion of the Morphir.SDK needs to be exposed. This can be crucial in reducing the size of the
Application
, as well as allowing for code-generators to only generate the required portion of the Morphir.SDK.Possible Approaches
Include the Package Specification for the SDK as part of the signature
Pros
Cons
Morphir.SDK.Rule
, much if not all ofMorphir.IR
, and others.Introduce
DependencyDefinition
to provide finer grained dependency informationWe could introduce a type that allows us to classify a dependency as being one of the following:
PackageName
Beta Was this translation helpful? Give feedback.
All reactions