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

YOCaml 2 #53

Merged
merged 182 commits into from
Oct 4, 2024
Merged

YOCaml 2 #53

merged 182 commits into from
Oct 4, 2024

Conversation

xhtmlboi
Copy link
Owner

@xhtmlboi xhtmlboi commented Oct 4, 2024

At least...

xhtmlboi and others added 30 commits October 4, 2024 04:20
The code of the Virtual FileSystem mainly come from
https://github.com/xvw/mini_yocaml (with some simple changes)

Co-authored-by: hakimba <[email protected]>
Co-authored-by: xvw <[email protected]>
In the previous version of YOCaml, abstraction on paths was a problem.
However, rather than abstracting paths by interpreting effects (which
requires the effect manager to be functorised, which is ... very
cumbersome), this commit proposes a standard representation of a file
path. The abstraction comes at the level of consumption, transforming an
expression of type `Path.t` into something understandable by a Runtime.
The implementation of paths is, for the moment, relatively naive for
crystallising its API.

Co-authored-by: xvw <[email protected]>
CSexp (Canonical S-Expression) is chosen to decipher the
textual (serializable) format of YOCaml's cache. Integration of
serialization, from CSexp to strings.

Co-authored-by: xvw <[email protected]>
Add companion modules to the `Test_lib` library to centralize
Testables (from Alcotest) and Generators (Qcheck).

Co-authored-by: xvw <[email protected]>
Addition of a naive way of deserializing canonical S-Expressions.
Deserialization is optimistically tested using PBT via QCheck2.

Co-authored-by: xvw <[email protected]>
Introduction of arrow combiners and profonctors for composing tasks by
tracking dependencies.

Co-authored-by: xvw <[email protected]>
Co-authored-by: grrm <[email protected]>
- Specialize the type `('a, 'b) t` to `'a ct = (unit, 'a) t'`
- Addition of Arrow Apply in order to implement monads with particular
  attention to the handling of dynamic dependencies (hence the omission
  in this patch).
  This also requires `ap` to be used as the main Applicative operation
  (instead of apply, reserved by the arrow).

The way in which the Functor/Applicative and Selective combinators have
been implemented relies essentially on the definitions of the arrow
operators to use an _equational_ description, so as not to have to worry
about tracking dependencies, leaving this to the arrows and therefore
being less _error prone_.

Co-authored-by: xhtmlboi <[email protected]>
Rather than duplicating effects as in the first version of YOCaml, this
implementation uses a flag to distinguish whether an effect is
propagated with the target or the source as the reference storage.

Co-authored-by: xvw <[email protected]>
A pipeline is a specialised `Task' that explicitly exploits YOCaml's
effects to interact with the file system. It is these specific tasks
that are used to build a DSL describing a build pipeline.

Co-authored-by: xvw <[email protected]>
Adds a dummy interpreter for interpreting effect programs, making it
easy to build unit tests.

Co-authored-by: xvw <[email protected]>
Implements the first effect interaction with a set of dependencies to
describe whether, on the basis of a set, a target should be built.

Co-authored-by: xvw <[email protected]>
Rather than forcing the user to manage trace mutability, the plumbing is
hidden within the effect interpreter using the `match_with` primitive.
So that they can be used to represent the cache.

Co-authored-by: xvw <[email protected]>
A first naive implementation of caching that simply associates
targets (paths) with hashed contents and dynamic dependency sets. For
the moment, the cache is based on a path-indexed map.

Co-authored-by: xvw <[email protected]>
gr-im and others added 28 commits October 4, 2024 04:25
I found myself needing to build a style sheet (as a composition of
several different sheets).
When you're writing an article, a metadata error can lead to a server
shutdown, which can be very annoying. So I suggest throwing an exception
which, in the event of a build, will return an error, but in the event
of a live-server, will be caught by the exception handler. The
modification has no impact on the unix server or the EIO server.
…e path from the incoming http request at a higher level (yocaml_unix & yocaml_eio)
If we assume that we're handling a well-formed Git repository, there's no need
to check whether an element is actually a directory or not. We could do a real
check (and see that the element is a tree) but it would be a little slower.

The problem with the current code is that an existing folder is then considered
to be a file: and YOcaml fails.
@xhtmlboi xhtmlboi merged commit 90facf8 into main Oct 4, 2024
4 checks passed
@xhtmlboi xhtmlboi deleted the yocaml2-mirror branch October 4, 2024 03:03
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

Successfully merging this pull request may close these issues.

6 participants