Draft implementation of SystemKind.#4274
Conversation
balacij
left a comment
There was a problem hiding this comment.
There are only two use sites for kind at the moment -- the same two as it were before this PR.
For the case studies, kind is used in exactly one spot: titles. Testing by changing SSP's kind to nw progName:
diff --strip-trailing-cr -r -X ../.gitignore --exclude=*.prof --exclude=.drasil stable/ssp/SRS/HTML/SSP_SRS.html build/ssp/SRS/HTML/SSP_SRS.html
6c6
< Software Requirements Specification for Slope Stability analysis Program
---
> Slope Stability analysis Program for Slope Stability analysis Program
27c27
... (snip)
< \title{Software Requirements Specification for Slope Stability analysis Program}
---
> \title{Slope Stability analysis Program for Slope Stability analysis Program}
diff --strip-trailing-cr -r -X ../.gitignore --exclude=*.prof --exclude=.drasil stable/ssp/SRS/mdBook/book.toml build/ssp/SRS/mdBook/book.toml
5c5
< title = "Software Requirements Specification for Slope Stability analysis Program"
---
> title = "Slope Stability analysis Program for Slope Stability analysis Program"
... (snip)
For the notebook, the same kind of use: titles. Testing by changing Projectile's "Notebook" lesson plan to nw projectileMotion:
diff --strip-trailing-cr -r -X ../.gitignore --exclude=*.prof --exclude=.drasil stable/projectile/Lesson/Projectile_Lesson.ipynb build/projectile/Lesson/Projectile_Lesson.ipynb
8c8
< "# Notebook for Projectile Motion Lesson\n",
---
> "# Projectile Motion Lesson for Projectile Motion Lesson\n",
For the website, neither of these use sites are used. The title appearing in your web browsers are declared using the first field of Document (as in mkDoc).
| data SystemKind = | ||
| SRS | ||
| | Notebook | ||
| | Website |
There was a problem hiding this comment.
3 kinds; 1 for each of our types of categories of Systems created.
The ICO-related bits will go into the SRS constructor, and the SRS constructor will need to take on at least a bit more information: problem information (the ICO problem information) and solution (the theories, data definitions, constants, etc.).
I'm not sure what the other two will contain, but the goal will be to at least not have to instantiate a bunch of unused unused components of a System in the "notebook":
And the website:
Drasil/code/drasil-website/lib/Drasil/Website/Body.hs
Lines 72 to 92 in 141899a
There was a problem hiding this comment.
I'm following the discussion in #3260 to create SystemKind, but an alternative implementation might avoid the sum type:
data System sk where
SI :: Concept sk => ...
_kind :: sk,
...
} -> System skHow do we decide which is the better implementation? I'm not immediately sure, but #4271 (comment) is relevant ++ do we want SystemKind to be an open sum type? If so, this is the better implementation -- and we can also do some work to ensure that data placed in the hole have some sort of kindOf field set to "system kind."
There was a problem hiding this comment.
Having System be a data-structure that carries a payload is probably a good idea. It should likely be structured in such a way that the first piece of data is common to all kinds (as a bundle of data).
| -- | Project Example motivation. | ||
| type Motivation = [Sentence] | ||
|
|
||
| data SystemKind = |
There was a problem hiding this comment.
I'm thinking you should replace SRS by 2 things: RunnableSoftware and Specification.
There was a problem hiding this comment.
Split in b78bd29 -- Still a very simple implementation, I imagine we'll take multiple passes at moving things around. Also, I'm not using RunnableSoftware at all yet. Should it be used for the examples that currently support software generation? Or were you thinking that System could also replace CodeSpec?
There was a problem hiding this comment.
My memory is that CodeSpec serves a different purpose. Yes, RunnableSoftware should be used for those examples.
| data SystemKind = | ||
| SRS | ||
| | Notebook | ||
| | Website |
There was a problem hiding this comment.
Having System be a data-structure that carries a payload is probably a good idea. It should likely be structured in such a way that the first piece of data is common to all kinds (as a bundle of data).
| HasUID j, Constrained j) => | ||
| { _sys :: a | ||
| , _kind :: b | ||
| , _kind :: SystemKind |
There was a problem hiding this comment.
This does feel like an improvement! It adds more information into _kind.
balacij
left a comment
There was a problem hiding this comment.
Quite a few subsequent PRs are needed! But that's good.
| - drasil-lang | ||
| - drasil-metadata | ||
| - drasil-printers | ||
| - drasil-system |
There was a problem hiding this comment.
I'm somewhat surprised that I need to add this to the other case studies. Things from drasil-system are being re-exported somewhere they shouldn't be.
Contributes to #3260
EDIT:
This PR is now ready for review.
ORIGINAL PR DESCRIPTION:
Creating this PR as a draft because:
System-related changes across all case studies -- only SSP.