Commit Graph

184 Commits

Author SHA1 Message Date
Louis Gesbert
c864f658c8 Cleaner message printing
Aerates the printing of messages, removes extraneous noise, and more clearly
attaches the various information tied to a given message.
2024-05-03 12:21:34 +02:00
Louis Gesbert
9d07015864 Unify runtime error handling
- Clearly distinguish Exceptions from Errors. The only catchable exception
  available in our AST is `EmptyError`, so the corresponding nodes are made less
  generic, and a node `FatalError` is added

- Runtime errors are defined as a specific type in the OCaml runtime, with a
  carrier exception and printing functions. These are used throughout, and
  consistently by the interpreter. They always carry a position, that can be
  converted to be printed with the fancy compiler location printer, or in a
  simpler way from the backends.

- All operators that might be subject to an error take a position as argument,
  in order to print an informative message without relying on backtraces from
  the backend
2024-04-26 18:31:26 +02:00
Louis Gesbert
fe2a562730 Cheat-sheets fixes and improvements 2024-04-25 14:20:22 +02:00
Louis Gesbert
36ca23eb89 Cheat-sheet: minor adjustments 2024-04-23 16:01:23 +02:00
Louis Gesbert
aa38d1b2ca Update the syntax cheat-sheet, add a consistency tests
Should now have all latest syntax updates and additions, along with some
reformatting to make it fit.
2024-04-16 23:20:37 +02:00
Louis Gesbert
e123d7eb95 Change type syntax of collection into list of 2023-12-19 15:26:44 +01:00
Louis Gesbert
9a255522be Document and first test for externals
Also some fixes for Clerk to properly support them
2023-12-06 11:06:54 +01:00
Denis Merigoux
43a1e30c33
Update old image on main README (fixes #514) 2023-09-19 13:29:14 +02:00
Louis Gesbert
15e0339800 Update ocamlformat
Apparently this time it has no incidence on our code.
2023-09-01 16:19:58 +02:00
Louis Gesbert
147ab62fe8 Cheat-sheet: fix compilation
Use xelatex and don't require fonts-extra (which is 1GB) just for two 20-lines
files.
This also syncs the dependencies for the cheat-sheets which those of Catala
literate output, which is good.
2023-08-04 15:36:53 +02:00
Louis Gesbert
71e3ca21c0 Remove generated files from git
and add proper pointers to the online artifacts
2023-07-10 15:48:11 +02:00
Louis Gesbert
db09eb0c42
Add date rounding option in scope (#397) 2023-03-17 10:14:36 +01:00
Raphaël Monat
8fe20e7fa2 Update syntax 2023-03-16 17:20:13 +01:00
Raphaël Monat
1e0eddfa1f Update syntax 2023-03-16 17:20:13 +01:00
Raphaël Monat
ce858a74df Update syntax cheatsheet 2023-03-16 17:20:13 +01:00
Louis Gesbert
abc5a00c2f Compile LaTeX code using minted without the Python venv
This is a hack, but not a dirty one: a new command `catala pygmentize` is added,
which is just a wrapper around `pygmentize` that calls it with the proper lexers
defined.

The point is that this needs no installation, just a stock `pygmentize`
installation and the `catala` binary.
2023-03-14 17:35:22 +01:00
Louis Gesbert
deb12d2c4a Bump version to 0.8.0
Changelog:
---

A lot has been going on, with more than 530 patches and 70 PRs merged since
0.7.0 last summer. In summary:

- Quite a lot of syntax improvements and changes. Checkout the latest
  [cheat-sheet](https://catalalang.github.io/catala/syntax.pdf) for an overview

- Allow local `let ... equals ... in ...` definitions

- Better error messages and positions throughout

- Added the ability to directly call a scope and retrieve its outputs, like a
  function

- Added disambiguation, allowing to access structure fields without specifying
  the structure type each time

- Added automated resolution of operators, allowing e.g. to write just `+` in
  place of all the type-specific operators `+.`, `+$`, `+@`, `+^`, etc.

- More consistent priority for operators. It is no longer allowed to write `a
  and b or c` without parenthesis.

- Added and changed some operators (`date + duration` now allowed either way,
  `int / int` now returns a decimal, added `duration / duration`)

- Added the ability to have variables and functions defined at
  top-level (outside of any scope). See annex A of the tutorial for details.

- Added support for functions with multiple arguments

- Some big refactors in the compiler, allowing much better code sharing between
  the different passes, and making it much easier to extend. Also added the
  possibility to run the type-checker earlier, etc.

- Countless bug-fixes

- Improvements to our proof backend with Z3

- A tool to automatically synchronise with the upstream French law from
  Legifrance
2023-03-08 18:07:53 +01:00
Louis Gesbert
a3b9045745 Update the cheat-sheet
- Add the new syntax for multi-argument functions
- Add the syntax for defining top-level values
- Increased font size and improved compacity
2023-03-02 17:00:14 +01:00
Louis Gesbert
52eeae3319 Syntax cheat-sheet: permutation of columns 2023-03-02 14:32:07 +01:00
Louis Gesbert
03f31b4923 Cheat-sheet: small fixes 2023-02-13 11:44:32 +01:00
Louis Gesbert
98ebc36343 Add all missing parser error messages
... that's one less thing to do

Two notes:

- Updated the syntax errors in
  examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en ; those
  probably aren't expected though, but fixing them is outside my purpose here

- There is consensus on keeping the error messages in English; however, here,
  the error messages include hints on the syntax to use, which are only valid
  for users of the English syntax.
  * A possible solution would be to apply cppo on parser.messages, using the
    macros already defined in lexer_LANG.cppo.ml. However, we would then need to
    tweak (or duplicate!) the parser to use the messages for the correct language.
    Furthermore, updating and merging the file on parser updates would need
    special care.
  * Another, maybe easier solution would be manual processing, using a custom
    escape in the parser messages and rewriting that at runtime when printing
    the message. We would need to extract a runtime version of the macro
    definitions though.
2023-02-13 10:51:42 +01:00
Denis Merigoux
f4c92530c6
Update aides_logement and fix bugs to produce an updated working simulator (#377) 2023-01-13 12:05:32 +01:00
Denis Merigoux
5fb9031c8a
Fixing review comments 2023-01-11 10:42:21 +01:00
Louis Gesbert
41eb25e9e0 Fix code in LaTeX literate output
pfffff
2023-01-10 12:06:48 +01:00
Louis Gesbert
59f81b4002 Rework and update the cheat-sheet
and pygments syntax coloring
2022-12-19 16:05:02 +01:00
Louis Gesbert
a4dc6c4b3e Update the cheat sheet with scope calls 2022-10-25 11:53:21 +02:00
Denis Merigoux
755b1212a2
Remove division durations 2022-08-19 15:21:29 +02:00
Denis Merigoux
e8bc253445
Added collection merging to syntax cheat sheet 2022-08-10 10:57:35 +02:00
Denis Merigoux
03e598128a
Bumping version number 2022-08-08 17:26:07 +02:00
Louis Gesbert
9db038812c Include generation of json_schema artifacts
(plus other small Makefile improvements)
2022-08-03 18:55:42 +02:00
Denis Merigoux
65225d467c
Added new operator to syntax cheat sheet 2022-06-01 15:23:56 +02:00
Louis Gesbert
c5583a0c16 Add ocamlformat, obelisk and conf-npm as dev dependencies 2022-05-11 16:25:51 +02:00
Denis Merigoux
f312c6bc6a
Documentation in syntax cheat sheet 2022-03-17 12:35:03 +01:00
Denis Merigoux
cf586c6b5e
Documentation: cheat sheet and tutorial 2022-02-28 15:11:40 +01:00
Denis Merigoux
bddf077b05
Syntax cheat sheet 2022-02-09 17:33:58 +01:00
Emile Rolley
7a62147283 fix(latex): render properly the '^' and fix the french babel usage 2021-12-31 20:50:03 +01:00
Denis Merigoux
5000417279
Update syntax reference 2021-10-01 16:31:50 +02:00
Denis Merigoux
0659816782
Fix indentation 2021-07-15 14:56:51 +02:00
Denis Merigoux
d8b18c80b8
Fixed syntax cheat sheet for extremum 2021-07-15 14:55:32 +02:00
EmileRolley
b32f0bf0a4 docs(syntax): add the duration division operator + fix the catala_en syntax highlighting 2021-05-31 10:26:51 +02:00
Denis Merigoux
faedeaf3ce
Pull proof robustness modifications from ICFP21 artefact 2021-05-20 11:21:29 +02:00
Denis Merigoux
3c8d187be0
Big refactoring of the literate programming structure
Partially fixes #120
Removes the distinction between headers and articles, streamlines the surface AST
Changes affects lexers and parser
2021-05-15 01:16:08 +02:00
EmileRolley
a594220313 docs(images): add file icons 2021-04-06 11:56:02 +02:00
EmileRolley
188324a361 docs(images): add an alternative logo 2021-04-06 10:37:30 +02:00
Denis Merigoux
29a066684c Change date syntax 2021-03-21 19:48:04 +01:00
Denis Merigoux
ef85b06bc1
Update syntax cheat sheet 2021-03-19 19:33:38 +01:00
Denis Merigoux
88cbe1fc9f
Update screenshot 2021-03-16 19:11:31 +01:00
Denis Merigoux
7edc3aa768
Added duration literal 2021-03-15 14:57:11 +01:00
Denis Merigoux
f6c1417a95
Finished syntax cheat sheet 2021-03-15 11:12:24 +01:00
Denis Merigoux
3b110e04ee
Syntax sheet 2021-03-14 21:57:01 +01:00