Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can we backport patches from program sources to literate sources? #47

Open
gunnihinn opened this issue Jun 4, 2020 · 0 comments
Open

Comments

@gunnihinn
Copy link
Contributor

gunnihinn commented Jun 4, 2020

Suppose we have a program written in Literate, and some collaborators on that program who, for whatever reason, only want to work on the generated program source files. This could happen when working on a literate project in a large company, or when trying to port an existing project into Literate while it still receives patches.

We have ways of pointing compiler errors in the generated sources back to the literate sources. Is it feasible to similarly backport the output of diff on a generated source back to the literate sources?

For example, suppose we have a literate source L from which we generate a program source file S. We modify S and obtain S'. Running diff(S, S') gives us patches P_1, ..., P_n that we can apply to S with patch to obtain S'. Is it possible to "lift" the patches P_j to the literate source L to get patches P'_1, ..., P'_n that give us a literate source L' that generates S'?

In wonky math speak, generating the sources is a function f : L -> S and we have a function patch : S -> S'. Can we always lift it automatically to L -> L' such that the diagram

L --> L'
|     |
v     v
S --> S'

commutes?

If so, contributors or coworkers can remain ignorant of Literate and we can easily benefit from their contributions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant