forked from ocaml-sf/learn-ocaml
-
Notifications
You must be signed in to change notification settings - Fork 0
Exercice external libraries #2
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
Open
hernoufM
wants to merge
33
commits into
AltGr:a7977b52
Choose a base branch
from
hernoufM:exercice-lib
base: a7977b52
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
to cmi, cma and js. Includes changes to the toploop to handle the dynamic loading.
Finally :) This should give a nice economy of bandwidth since the uncyphered compilation artifacts will compress much better.
(now that it's fixed)
instead of just "open". This restores the toplevel output on values defined in Prelude, and forbids access to the interface of Prepare (which were two small regressions with pre-compilation)
…ions (or extensible variant cases)
(now that it works!)
…ister_sampler` calls * New transformation has been added that inserts `let () = Introspection.register_sampler name fun` for each toplevel binding prefixed with `sample_*` in test.ml. * Compilation units stored in `demo-repository/exercises/exercise_name/` during the precompilation are no longer staged.
Previous patch on byte/js selection broke static servers. This restores the compatible API by using GET args to filter the answer (on a static server, no filtering will be done but that just means a little more bandwidth usage)
Functorising to add parameters so that it can be used to inject printer registerers as well, for example
Containing just the names of the ocamlfind libraries to link in
and facility to link them during the `build` step. NOTE: the helper library is going to be included in every exercise. A lighter approach could be to keep loading it separately, e.g. after loading the cma/js file from a directory holding static content on the server (and removing the `.cma` from the compilation line in `precompile_exercise.ml`). This will probably fit well once we include such a mechanism for loading custom libraries as the prelude to exercises, the main difference being that the latter will also need the `cmi` files.
Now an optional library that demonstrates the use of grader libraries.
sync'ing with printer handling and the newer ppx that has the module name
`learn-ocaml build` now requires write access to the repository since it writes compilation artefacts in-place.
…on in exercices_format documentation
81ff75a
to
a86b256
Compare
0a507b6
to
6ce797f
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Loading exercise dependencies feature. Here is a clipping from
exercise_format
:External libraries
Additionally, you could define external libraries to your exercise in meta.json that becomes available in the set of .mls and at the toplevel of exercise. To do that mention library name and imported interfaces in additional field in meta.json.
A .cmi should be mentioned without extension part. Listing explicitly cmis for a library allows you to restrict students to use only those interfaces that are mentioned, at the same time leaving the opportunity for teachers to use all possible modules when compiling exercises (i.e. in prelude, prepare, solution and test files). Order between cmis is assumed, but not for libraries. So if you want to load several libraries that could depend on some of them, make sure that you lists them in the correct order (library with no dependencies should be listed first). Libraries should be able to be compiled to JavaScript.