Skip to content

Add some PPXes#50

Draft
terencode wants to merge 3 commits intosail-pl:mainfrom
terencode:ppx
Draft

Add some PPXes#50
terencode wants to merge 3 commits intosail-pl:mainfrom
terencode:ppx

Conversation

@terencode
Copy link
Collaborator

@terencode terencode commented Jul 7, 2023

This aims at removing some boilerplate code by bringing mostly dependency-free PPX rewriters, maybe create one for our needs as well. As they are an AST to AST transformation, we can pretty-print it back to a PPX-free code to feed it to coq-of-ocaml for the long-term goal of proving the compiler using Coq.

Interesting PPXes :

  • ppx_lun
  • logs_ppx
  • ppx_curried_constr

terencode added 3 commits July 6, 2023 23:36
- Support is provided by the Z module of the zarith package
- when writing a literal number, you can add a suffix to tell the
  compiler what size it will use. no suffix means 32bits

- add int type parameterized by bit length : i32, i64, i128, i69420...
  (no restriction for now as llvm is able to deal with it)

  idealy, for literals, there should be a type inference so we don't
  need to specify a suffix when dealing with type different than i32 but
  for now you must provide it.

- check for out_of_bounds literal

- int literals can have '_' separators : 1_000_000 is now valid
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.

1 participant