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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Developer doc: describe debug process #1134

Open
WardBrian opened this issue Feb 24, 2022 · 4 comments
Open

Developer doc: describe debug process #1134

WardBrian opened this issue Feb 24, 2022 · 4 comments
Labels
documentation documentation for end-users and/or other devs

Comments

@WardBrian
Copy link
Member

It would be useful to add a write up to the stanc3 developer documentation on the use of print_s, s-expressions, and other debugging utilities we use while working on the compiler.

I don't really use ocamldebug personally, but if anyone has experience with it and stanc3 that would also be helpful

@WardBrian WardBrian added the documentation documentation for end-users and/or other devs label Feb 24, 2022
@WardBrian
Copy link
Member Author

Useful links:

  • Core_kernel.Debug
  • Ocamldebug
  • Print_s (this isn't really explained, but print_s [%sexp (e : typed_expression)] will print the s-expression form of e, or any type with the sexp derivation. It's a shorthand for print_endline (Sexp.to_string (Ast.sexp_of_typed_expression e))

@yizhang-yiz
Copy link

It'd also help if we add some Menhir options such as --explain that I often use to locate conflicts.

@WardBrian
Copy link
Member Author

We actually have —explain enabled by default, but the results end up in a rather unhelpful place (./_build/default/src/frontend)

There’s definitely a lot more stuff we can document on the getting started page about dune and Menhir. Those are both really common in the OCaml ecosystem though

@yizhang-yiz
Copy link

but the results end up in a rather unhelpful place (./_build/default/src/frontend)

TIL. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation documentation for end-users and/or other devs
Projects
None yet
Development

No branches or pull requests

2 participants