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

Release preparations for 2.0 #299

Merged
merged 4 commits into from
Sep 16, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,5 @@ cabal-dev
cabal.sandbox.config
.*.swp
.*.swo
/.vscode/
/.vscode/
tests/*.hs
36 changes: 25 additions & 11 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,35 @@

## 2.0

The main focus of this release was modularizing Happy.
There are two main breaking changes in this release:

* Generated parsers now activate the language extension `-XNoStrictData` without
which every use of a happy parser would lead to an immediate crash (#273).
This causes us to drop support for GHC < 8.0.
1. Removal non-array, non-GHC modes, so flags `-ag` are the default now and
sgraf812 marked this conversation as resolved.
Show resolved Hide resolved
become no-ops.
2. Generated parsers now activate the language extension `-XNoStrictData` without
which every use of a happy parser would lead to an immediate crash (#273).
This causes us to drop support for GHC < 8.0.

* Break up into libraries:
Furthermore, the project structure was modularized and a library `happy-lib`
containing the implmentation of the `happy` executable was extracted.

- `happy-backend-glr`
- `happy-backend-lalr`
- `happy-frontend`
- `happy-grammar`
- `happy-tabular`
Quite similar to the situation with GHC vs. the GHC API, we expect that `happy`
will continue to be a stable CLI tool with solid (if occasionally out of date)
documentation, while the design, documentation and implementation of `happy-lib`
is still in flux and use is only recommended to expert users.

* Revert the new bootstrapping system of 1.21.0 to mitigate build issues.
Other, more minor changes:

* Revert the new bootstrapping system of 1.21.0 to mitigate build issues (#255, #274).

* Encode action table offsets in 32 bit instead of 16 bit (#93, #199, #266).
This increases the size of generated parsers a bit (about 250KB for GHC's
parser), but also manages to generate parsers for grammars that were
previously running into the size limit (#199).

* The documentation has been converted to ReStructuredText,
hosted at https://haskell-happy.readthedocs.io/en/latest/ (#226)

* A few internal refactorings to the structure of generated code.

## 1.21.0

Expand Down
20 changes: 11 additions & 9 deletions doc/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,11 @@ feel free to submit them!
Repo Layout
-----------

- ``src``: The source code for the Happy executable itself
- ``app``: The source code for the Happy executable itself

- ``packages/*``: The various packages that make up Happy behind the scenes, and are available for reuse for other purposes.
- ``lib/*``: The various internal libraries that make up the ``happy-lib``
package. This library is used to implement the ``happy`` executable behind the
scenes, and is available for reuse for other purposes.

- ``doc``: The documentation

Expand All @@ -34,20 +36,20 @@ Happy is mostly a normal Cabal-packaged Haskell executable::

$ cabal build

The only wrinkle is that developing Happy's own parser (i.e. the frontend
The only wrinkle is that changing Happy's own parser (i.e. the frontend
component that parses ``.y`` files) requires an existing Happy executable on
the PATH.
the PATH to run ``lib/frontend/boostrap.sh``.

Do *not* modify these files by hand::

packages/frontend/src/Happy/Frontend/Parser.hs
packages/frontend/src/Happy/Frontend/AttrGrammar/Parser.hs
lib/frontend/src/Happy/Frontend/Parser.hs
lib/frontend/src/Happy/Frontend/AttrGrammar/Parser.hs

Instead, edit these files::

packages/frontend/boot-src/Parser.ly
packages/frontend/boot-src/AttrGrammarParser.ly
lib/frontend/boot-src/Parser.ly
lib/frontend/boot-src/AttrGrammarParser.ly

and regenerate the ``.hs``-files with::

$ packages/frontend/bootstrap.sh
$ lib/frontend/bootstrap.sh