-
Notifications
You must be signed in to change notification settings - Fork 54
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
DO NOT MERGE: Compiling Eliom with the new compiler #459
base: master
Are you sure you want to change the base?
Conversation
Eliom_runtime -> Eliom_serial (shared) Eliom_syntax -> Eliom_runtime (server) Eliom_client_core.Syntax_helper -> Eliom_runtime (client) Eliom_syntax.client_value -> Eliom_runtime.fragment (server)
Note: the new compiler is 4.03.0 only for now. Will port to 4.04 when I have time. |
Let me know if I can help somehow. |
Can you clarify? You do need separate |
No. eliom cmi contains more information (encoded in ppx attributes) that specificy sides of the various declarations. The presence of |
It would be great to get rid of these suffixes. Client (resp. server) codes must be in a |
I disagree. With the new compiler, we should be able to get to the point where you can put your files in any directory you want, regardless of the fact that they are client, server or eliom. The separation in client and server directories is an artifact of the old compilation scheme and is pretty opposite to the point of eliom (which is to group things by what they do, not where they are executed). If that's how you want to do things, you should be able to, but it should not be imposed. And in particular, for eliom, I would really rather have it organized in: |
@Drup I suppose |
@dannywillems They do. The first one is implemented in |
Any news about this effort, anything one can do to help? |
@FlorentBecker The first step would be to port my patches to the last version of the OCaml compiler. Then there are a few things to tweak/fix. Unfortunately, I don't work on Eliom anymore and the rest of the ocsigen crew doesn't have time to spare at the moment. If you are motivated, Please go on. I will gladly answer questions. |
It's hard to see how much effort it's worth putting in it without knowing what the ocsigen team is up to. |
Happy new year everyone, I come bearing eliom gifts! 🎅
This is my WIP branch for attempting to compile eliom (the framework) with eliom (the compiler, aka eliomlang).
This needs:
New features:
Proper typechecking of injections and fragments. No dirty tricks.
Typechecking is mindful of sides, and will give good errors when using identifiers on the wrong side and various other kind of errors.
The default side in eliom modules is, like OCaml modules, "sideless": Code written here can be used everywhere (but cannot use special eliom features and can not use any code that has a side).
To enter a side, like currently, use
%client/server
Types can be given a sideness annotations. Here is a very contrived example:
The typechecker will ensure that annotations are correct (and will force you to annotate your datatypes).
The module language is now aware of sides, and most things you can think of should work.
In particular, sections can be used inside flat modules (not functors):
(See the testsuite for a set of contrived examples)
Only one compiler invocation needed per module.
For now, only bytecode compilation works (no blocker, just haven't taken the time to patch the opt frontend yet).
Current situation
Currently, the main problem is the build system. ocamlbuild is very extensible ... except in the various ways that would help us, so the predefined rules don't work well. I might attempt to use solvuu (cc @agarwal) (but I'm getting a bit burned out on build systems right now).
Here is how building eliom libraries with the new compiler should work:
foo.eliomi
produces one cmi:foo.cmi
foo.eliom
produces two cmo:foo.client.cmo
andfoo.server.cmo
-mode client|server
is available for compiling regular OCaml files, and marks the produced cmi as being client/server.client.cmi
and.server.cmi
files (or marked files) and consider them as client/server for the purpose of typechecking.*.client|server.*
files (this is extremely badly handled by ocamlbuild).bar.eliom
depends on the moduleFoo
and there exists both afoo.client.cmi
andfoo.server.cmi
, the eliom files should depends on both (this cause issues with ocamlbuild dependency discovering).If anyone want to try this, bug reports related to the new compiler should be made here.