Skip to content

Drop optional context parameters - #95

Merged
liufengyun merged 15 commits into
mainfrom
remove-opt-param
Aug 25, 2026
Merged

Drop optional context parameters#95
liufengyun merged 15 commits into
mainfrom
remove-opt-param

Conversation

@liufengyun

@liufengyun liufengyun commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

Drop optional context parameters

Note: This is a breaking change, a JIP is deserved to justify.

Summary

Il semble que la perfection soit atteinte non quand il n'y a plus rien à ajouter, mais quand il n'y a plus rien à retrancher.

Perfection, it seems, is attained not when there is nothing more to add, but when there is nothing more to take away.

— Antoine de Saint-Exupéry, Terre des Hommes (1939)

This proposal drops optional context parameters — the form in which a declaration carries a default:

param pageWidth: Int = 80   // dropped

Such a default is supplied automatically wherever no binding is in scope. After this change a declaration states only a requirement, and a caller provides the value:

param pageWidth: Int
with pageWidth = 80 in render(document)

Nothing else about context parameters changes: with, receives, allow, shadowing, and capture keep their current meaning.

param states a requirement, receives tracks it, allow bounds it, and with provides it.

See more in the JIP.

Checklist

  • Added / updated tests under tests/pos/ or tests/warn/
  • Docs updated if the change affects user-visible behavior
  • All commits are signed off (why?)
How to sign off commits

Use git commit -s to add the Signed-off-by line automatically:

To add a sign-off to the last commit retroactively:

git commit --amend -s --no-edit

To add sign-off to the last 3 commits:

git rebase --signoff HEAD~3

Security impact

No

Compatibility impact

This is a breaking change.

  • Source compatibility: existing code continue to compile
  • SAST compatibility
    • forward compatibility: new libraries can be used by old compiler
    • backward comopatibility: old libraries can be used by new compiler
  • Standard Library compatibility:
    • forward compatibility: new code can work with old stdlib
    • backward compatibility: old code work with the new stdlib
  • Runtime Library compatibility:
    • forward compatibility: new code can work with old runtime
    • backward compatibility: old code work with the new runtime
  • Build tool
    • Build spec compatibility: old projects continue to build
    • Joy package compatibility: old .joy can be consumed by new build tool

@liufengyun
liufengyun requested a review from everdance August 23, 2026 22:03
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
Signed-off-by: Fengyun Liu <fengyun.liu.cs@gmail.com>
@liufengyun
liufengyun merged commit b9f5b62 into main Aug 25, 2026
3 checks passed
@liufengyun
liufengyun deleted the remove-opt-param branch August 25, 2026 15:26
@liufengyun liufengyun mentioned this pull request Aug 25, 2026
16 tasks
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.

2 participants