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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Hacking file #751

Closed
wants to merge 5 commits into from
Closed

Add Hacking file #751

wants to merge 5 commits into from

Conversation

Drup
Copy link
Contributor

@Drup Drup commented Aug 10, 2016

A rendered version is available here.

This adds the beginning of a Hacking file. The goal is to contain the various information needed to start working on the compiler, which means: 1) give the essential commands/tools needed 2) point to the files/give an overview of the organization/provide "meta" consideration (for example, the note on circular dependencies in the type checker).

Most of 1) is done with this PR. However, most of 2) is not done (I simply added notes on the typechecker part). This is on purpose, and I expect people who know the various other parts of the compiler (ie. not me 馃槥) to fill the gaps (if only to simply say "look at this file first").

What I think is missing, besides the obvious blanks:

  • A description of the various phases of the compiler (parsetree -> typedtree -> lambda -> ..). Maybe a pretty diagram.
  • A description of the error handling in the compiler (this is why I made a note on Location, but it would deserve a longer description)
  • "Bootstraping for dummies beginners"
  • Various sections on tools, runtime, maybe pattern matching (since it's distributed in various areas of the compiler).

If this is accepted, I think this should be merged directly. The missing bits can be filled later on.

@bluddy
Copy link
Contributor

bluddy commented Aug 10, 2016

I love this. Would it make sense to have a corresponding hacking file in every important directory ie. parsing, typing, bytecomp, asmcomp, byterun, asmrun?

These files could give the overall view of their particular directory in far more detail.

@dbuenzli
Copy link
Contributor

Regarding the configure stuff @lpw25 gave me this tip which you may want to add. It can be in certain cases a bit more convenient than going through opam-compiler-conf.

Configure with --prefix $(pwd)/_install this allows you to make install (in _install) and run the built binaries without them trying to use the runtime system of a current OCaml install that may be in the environment which may or may not error in various funky ways (and that I once confused as a bootstrapping error in trunk).

@Drup
Copy link
Contributor Author

Drup commented Aug 10, 2016

@dbuenzli I don't understand. Isn't that equivalent to using compiler-conf (and eval $(opam config env --switch ...) in the appropriate terminal) ?

@bobzhang
Copy link
Member

bobzhang commented Aug 10, 2016

is _install handled magically? how is it different from ./configure -prefixpwd

@dbuenzli
Copy link
Contributor

dbuenzli commented Aug 10, 2016

Isn't that equivalent to using compiler-conf (and eval $(opam config env --switch ...) in the appropriate terminal) ?

I don't know, I never used compiler-conf. It's just an easy way to directly hack and tests things in a repo checkout without messing up your context.

is _install handled magically?

I don't think so, could be $(pwd)/zorglub if you wish so.

@Drup
Copy link
Contributor Author

Drup commented Aug 10, 2016

@dbuenzli that looks pretty much equivalent to compiler-conf, but without the advantage of having an opam switch.

@bluddy Yes, this is a possibility. I put the section about typing/ inline here, because it looked simpler, but I don't really have an opinion.

@dbuenzli
Copy link
Contributor

@dbuenzli that looks pretty much equivalent to compiler-conf, but without the advantage of having an opam switch.

Maybe, I never used compiler-conf. However it is infrastructure wise very lightweight (and you don't have to start peeking in others build dirs when things go wrong).

@Drup
Copy link
Contributor Author

Drup commented Jan 23, 2017

An improved version was merged. Closing.

@Drup Drup closed this Jan 23, 2017
@Drup Drup deleted the hackind_md branch January 23, 2017 18:47
EmileTrotignon pushed a commit to EmileTrotignon/ocaml that referenced this pull request Jan 12, 2024
Replaced all YouTube links by watch.ocaml.org links

Co-authored-by: Cuihtlauac ALVARADO <cuihtmlauac@tarides.com>
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.

None yet

4 participants