rescript-compiler icon indicating copy to clipboard operation
rescript-compiler copied to clipboard

Move the syntax inside the compiler repo

Open bobzhang opened this issue 4 years ago • 9 comments

The current syntax repo depends on a fix version of ocaml compiler API parsetree/4.06, so you can not really develop that repo without pinning to 4.06 compiler API.

Given that the compiler has more aggressive changes to the parsetree/typedtree/outcometree, for example, recently we also made changes to outcometree to print obj style record, it is more and more difficult to sync up when split in two repos.

And there are cycles here:

  • rescript-compiler depends on the parsing
  • parsing depends on rescript-compiler API

To merge the two repo into a single repo, the main challenge is have a common build system and make sure the tests are moved properly.

@IwanKaramazow Are you okay with the current ninja based build system or should we move it to dune?

bobzhang avatar Aug 29 '21 07:08 bobzhang

@bobzhang you can use whichever build system you prefer. I will provide an overview of the tests. Cristiano's reanalyze, is also an important part of this. (Makes sure the parser doesn't infinite loop). It would also be handy if the syntax dev cli would also be available in this repo (for quick iteration on the syntax part of the compiler)

IwanKaramazow avatar Aug 30 '21 15:08 IwanKaramazow

With the evolution of the compiler APIs, the editor tooling repo should also become a part of the compiler?

IwanKaramazow avatar Aug 30 '21 17:08 IwanKaramazow

@IwanKaramazow Ideally yes. But there are no cycles in the IDE part, I am thinking we can also publish the compiler API as an opam package so that they can develop on top of that. cc @cristianoc

bobzhang avatar Aug 31 '21 03:08 bobzhang

the compiler-libs is currently vendored in editor analysis project. there's no opam in there (we don't use any dependency). moving editor analysis project to this repo might be good idea since it also uses syntax repo (currently just for printing types with outcometree) and it's being updated occasionally.

about build system IMHO using dune would improve general dx and contributing experience. makefile ocamlopt/ninja was not a big deal for me to hack around these projects but using dune would definitely improve the experience since it's now the defacto build system in the community and matches the ecosystem / toolings like ocaml-lsp etc. having said that at the on of the day the build system that matches the project goal should be used but that ws my personal thought on dune.

amiralies avatar Sep 01 '21 12:09 amiralies

@amiralies I am open to move to dune especially for the bsb develop workflow. The current build system serve me very well, if someone wants to add an overlay of dune, I am happy to merge it and check if it works

bobzhang avatar Sep 02 '21 08:09 bobzhang

@IwanKaramazow It seems the CI only runs make roundtrip-test?

It would also be handy if the syntax dev cli would also be available in this repo (for quick iteration on the syntax part of the compiler)

Should be easy

bobzhang avatar Sep 14 '21 10:09 bobzhang

@bobzhang make roundtrip-test is indeed only run on CI. I usually run make test during local development because it's a lot faster during iteration.

IwanKaramazow avatar Sep 15 '21 04:09 IwanKaramazow

I'm trying to build 9.1.4 and it's missing a commit in the syntax submodule:

https://github.com/rescript-lang/rescript-compiler/tree/9.1.4

It's pointing to https://github.com/rescript-lang/syntax/tree/bc57a1c328c8c5ac76362482dcc4ac07a0eea37e

MasseGuillaume avatar Oct 13 '21 23:10 MasseGuillaume

what's the current state of this? should we still commit changes to the syntax repo for now, until this is figured out?

ryyppy avatar Jan 21 '22 16:01 ryyppy

This has been done in the meantime.

cknitt avatar May 02 '23 16:05 cknitt