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
base: trunk
from

Conversation

Projects
None yet
4 participants
@Drup
Contributor

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

This comment has been minimized.

Show comment
Hide comment
@bluddy

bluddy 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.

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

This comment has been minimized.

Show comment
Hide comment
@dbuenzli

dbuenzli Aug 10, 2016

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).

Contributor

dbuenzli commented Aug 10, 2016

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

This comment has been minimized.

Show comment
Hide comment
@Drup

Drup Aug 10, 2016

Contributor

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

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@bobzhang

bobzhang Aug 10, 2016

Member

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

Member

bobzhang commented Aug 10, 2016

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

@dbuenzli

This comment has been minimized.

Show comment
Hide comment
@dbuenzli

dbuenzli Aug 10, 2016

Contributor

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.

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

This comment has been minimized.

Show comment
Hide comment
@Drup

Drup Aug 10, 2016

Contributor

@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.

Contributor

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

This comment has been minimized.

Show comment
Hide comment
@dbuenzli

dbuenzli Aug 10, 2016

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).

Contributor

dbuenzli commented Aug 10, 2016

@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

This comment has been minimized.

Show comment
Hide comment
@Drup

Drup Jan 23, 2017

Contributor

An improved version was merged. Closing.

Contributor

Drup commented Jan 23, 2017

An improved version was merged. Closing.

@Drup Drup closed this Jan 23, 2017

@Drup Drup deleted the Drup:hackind_md branch Jan 23, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment