Skip to content

Add a command line option to print the Pancake news file - #1470

Open
IlmariReissumies wants to merge 13 commits into
masterfrom
pan_news
Open

Add a command line option to print the Pancake news file#1470
IlmariReissumies wants to merge 13 commits into
masterfrom
pan_news

Conversation

@IlmariReissumies

Copy link
Copy Markdown
Member

The flag is --pancake_news. Close #1469

@IlmariReissumies IlmariReissumies added user experience Time needed to perform tasks not related to compiler development Pancake labels Aug 24, 2026
@mktnk3

mktnk3 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

I suppose this assumes that NEWS.md is already updated for the feature being added. I wonder if there is a way to ensure this is done. For example, requiring a non-empty (markdown?) string describing the changes that gets concatenated to the content of NEWS.md for both command line printing and updating the file... won't work probably :D Not sure how to go about it, but maybe it's worth stating that "NEWS.md should be updated" somewhere...

@IlmariReissumies

Copy link
Copy Markdown
Member Author

Yes that's a good point, this works so long as we're disciplined about updating NEWS.md when merging Pancake PRs with user-facing changes. But it doesn't do anything to enforce this discipline.

I think that's difficult to enforce entirely automatically, because there's no good check for figuring out which changes are user-facing. But there are things that would probably help. Maybe a github hook that checks if PRs make any changes in the pancake/ directory and encourages NEWS.md updates or makes you tick a box that it's not needed?

Even so I guess this at least gives people a lower bound on the features they have :)

@KurtWu10

Copy link
Copy Markdown
Contributor

Is there a simple way to make it more machine-readable?

The motivation for the issue is to improve the compatibility of Pancake programs, i.e. to enable programmers to write a single Pancake program that selects language features based on availability, similar to feature test macros in C. In the existing form, I guess I would write another wrapper to retrieve the latest date in the news, and then use the date to query a pre-defined list of dates to know the supported features.

@mktnk3

mktnk3 commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Even so I guess this at least gives people a lower bound on the features they have :)

I can't quite decide whether that is a plus or a potential cause for confusion, but either way, that only won't be good enough to close the issue. I guess we can keep looking into more complete solutions.

@KurtWu10 would you like to add something on the motivation to the issue #1469 ?

@IlmariReissumies

Copy link
Copy Markdown
Member Author

Is there a simple way to make it more machine-readable?

Don't see why not. For example, the NEWS.md could assign a tag to each new feature, say varshifts for variable-length shifts. You could then ask the binary whether certain tags are present with (say) cake --pancake_news varshifts, which would print true or false accordingly. Would that work for you?

@KurtWu10

Copy link
Copy Markdown
Contributor

Yes, that would work.

@IlmariReissumies

Copy link
Copy Markdown
Member Author

Okay, that's added now! Please check if it looks good to you :)

I added annotations for enabling and disabling features to NEWS.md, see here: https://github.com/CakeML/cakeml/blob/pan_news/pancake/NEWS.md

newsScript now parses these tags does some basic well-formedness checks on them. The compiler can query them with e.g. cake --pancake_feature=varshifts, which will print true if the most recent varshift entry in NEWS.md says "Feature enabled".

@KurtWu10

KurtWu10 commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Thanks for the work, it looks helpful. I noticed that some important features are not in the NEWS.md file, e.g. function inlining of PR 1323.

@IlmariReissumies

Copy link
Copy Markdown
Member Author

Good catch! I added one retroactively.

@IlmariReissumies IlmariReissumies added the test failing regression test failed on the latest commit of this pull request label Aug 26, 2026
@IlmariReissumies IlmariReissumies removed the test failing regression test failed on the latest commit of this pull request label Aug 26, 2026
After discussion with @myreen and the Pancake meeting, printing the
entirety of `NEWS.md` has the unfortunate side effect of storing a
~15kb (and growing) string in memory, that needs to be copied over
every time the GC runs.

Therefore, this commit keeps only the `--pancake_feature=T` query
and drops the option to print `NEWS.md.` The usage notes instead
explain where the news can be found.
@IlmariReissumies

Copy link
Copy Markdown
Member Author

In the most recent commit I dropped the --pancake_news option, since @myreen pointed out that it's inadvisable to have huge one-time-use strings in memory. Now the PR only includes the option to query feature tags with --pancake_feature=<feature tag>. This seems closer to the spirit of #1469 and @KurtWu10's ideas anyway :)

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

Labels

Pancake user experience Time needed to perform tasks not related to compiler development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Link binary with (recently added) features - Pancake

3 participants