Skip to content

Conversation

@nikola-matic
Copy link
Contributor

@nikola-matic nikola-matic commented Oct 6, 2025

Under development, don't review yet.

  • CLI
  • Standard JSON
  • Forbid --experimental with --standard-json
  • Pragmas
  • Docs?
  • Changelog

@nikola-matic nikola-matic force-pushed the introduce-experimental-flag branch 5 times, most recently from 1beb509 to ba48a91 Compare October 9, 2025 13:17
@nikola-matic nikola-matic force-pushed the introduce-experimental-flag branch 4 times, most recently from fd70f82 to 98cad7c Compare October 21, 2025 09:40
@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Nov 4, 2025
@argotorg argotorg deleted a comment from github-actions bot Nov 4, 2025
@nikola-matic nikola-matic removed the stale The issue/PR was marked as stale because it has been open for too long. label Nov 4, 2025
@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Nov 19, 2025
@nikola-matic nikola-matic removed the stale The issue/PR was marked as stale because it has been open for too long. label Nov 19, 2025
@argotorg argotorg deleted a comment from github-actions bot Nov 19, 2025
@nikola-matic nikola-matic force-pushed the introduce-experimental-flag branch 3 times, most recently from 5c5a463 to 2518378 Compare November 20, 2025 11:55
@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Dec 4, 2025
@nikola-matic nikola-matic removed the stale The issue/PR was marked as stale because it has been open for too long. label Dec 4, 2025
@argotorg argotorg deleted a comment from github-actions bot Dec 4, 2025
@nikola-matic nikola-matic force-pushed the introduce-experimental-flag branch from 2518378 to 83b670d Compare December 8, 2025 09:43
@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Dec 22, 2025
@nikola-matic nikola-matic removed the stale The issue/PR was marked as stale because it has been open for too long. label Dec 22, 2025
@argotorg argotorg deleted a comment from github-actions bot Dec 22, 2025
@github-actions
Copy link

github-actions bot commented Jan 6, 2026

This pull request is stale because it has been open for 14 days with no activity.
It will be closed in 7 days unless the stale label is removed.

@github-actions github-actions bot added the stale The issue/PR was marked as stale because it has been open for too long. label Jan 6, 2026
@clonker clonker removed the stale The issue/PR was marked as stale because it has been open for too long. label Jan 6, 2026
@nikola-matic nikola-matic force-pushed the introduce-experimental-flag branch from 83b670d to 17c3e0e Compare January 6, 2026 12:22
m_errorReporter.syntaxError(
2816_error,
_pragma.location(),
"Experimental pragmas can only be used if the experimental mode has been enabled."
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be good to add a link here to somewhere in the docs where it's detailed how to do that and/or just say that one must specify --experimental or settings.experimental in standard JSON.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Link to this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah. Generally I think we could do better with our error messages and not only say that something is wrong, but also - if possible at least - say what to do differently. We could say that --experimental or settings.experimental is required to be toggled on depending on input mode and/or link to that, yeah :)

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's best to separate the error (which is factually correct about what happened, just not necessarily why) from hints (which are just speculation and may or may no be correct). We should really have some kind of "hint" field in errors.

But for the time being, sure, would not hurt to mention --experimental. I'd avoid direct links though. Links break. IMO it's best to just include some something that is easy to search for, like the name of the feature or the flag. At the same time also to try to make it relatively self-contained so that the user has a fighting change of figuring it out on their own without having to leave the terminal.

@nikola-matic nikola-matic force-pushed the introduce-experimental-flag branch 8 times, most recently from 6c4e799 to 136bd18 Compare January 15, 2026 16:37
@nikola-matic nikola-matic marked this pull request as ready for review January 15, 2026 16:57
+-----------------------+--------------------------+------------------+-------------------------------------------------------------------+
| EOF | ``eof`` | yes | ``--eof-version`` |
+-----------------------+--------------------------+------------------+-------------------------------------------------------------------+
| Osaka EVM | ``evm-osaka`` | yes | ``--evm-version osaka`` |
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wait, fusaka fork was in December, no? So this should be removed. I also didn't implement an evm version check for >current.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, not only that, Osaka is our current version; how could I go about testing the implementation?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It wasn't yet released when I created the spec :) Now we have no experimental EVM versions, but you could add Amsterdam already if you want to have one for testing. It's supposed to be ready in half a year, so we can already start preparing.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, now that I think about it, we could change the ID here to just evm covering all non-mainnet EVMs. This way we won't have to be all that fine-grained.

@nikola-matic nikola-matic force-pushed the introduce-experimental-flag branch from 136bd18 to 8f8a1dc Compare January 16, 2026 13:38
@cameel cameel added this to the 0.8.34 milestone Jan 16, 2026
+-----------------------+--------------------------+------------------+-------------------------------------------------------------------+
| EVM Assembly import | ``evmasm-import`` | yes | ``--import-asm-json`` |
+-----------------------+--------------------------+------------------+-------------------------------------------------------------------+
| Generic Solidity | ``generic-solidity`` | yes | ``pragma experimental solidity`` |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
| Generic Solidity | ``generic-solidity`` | yes | ``pragma experimental solidity`` |
| Core Solidity | ``core-solidity`` | yes | ``pragma experimental solidity`` |

In the we went with a different name for Experimental Solidity, but the spec was written before that.

Comment on lines +736 to +738
| Yul SSA CFG exporter | ``yul-ssa-cfg-exporter`` | no | ``--yul-cfg-json`` |
+-----------------------+--------------------------+------------------+-------------------------------------------------------------------+
| SSA CFG codegen | ``ssa-cfg-codegen`` | yes | ``--ssa-cfg-codegen`` (not yet on ``develop``) |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@clonker Do we actually need two separate flags for this? Like, are we planning to have the exporter stable before the codegen? Or do we need people to be able to export the CFG without enabling the codegen? To me they seem like parts of the same bigger feature.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the docs should be written from the perspective of a release. So if it's not merged into develop, it should not be listed in the docs. It should be added as a part of the PR that introduces the flag.


bool isExperimentalArtifactRequested(Json const& _outputSelection)
{
static std::array<std::string, 3> const experimentalArtifacts{"irAst", "irOptimizedAst", "yulCFGJson"};
Copy link
Collaborator

@cameel cameel Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about ethdebug outputs?

sed -i "s|it\(('Cannot be called if PARENT_CANNOT_CONTROL is burned and is an existing subdomain',\)|it.skip\1|g" test/wrapper/NameWrapper.js

find . -name "*.sol" -type f -exec sed -i -e 's/^\(\s*\)\(assembly\)/\1\/\/\/ @solidity memory-safe-assembly\n\1\2/' '{}' \;
find . -name "*.sol" -type f -exec sed -i '/pragma experimental/d' {} \;
Copy link
Collaborator

@cameel cameel Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should be more specific in these replacements (in prb-math.py as well). If you're only looking for the ABI coder pragma, specify just that.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would consider moving these tests into syntaxTests/coreSolidity or something like that. Otherwise we'll likely end up with tests for random experimental features landing here.

Though that's probably best done after this PR is merged not to make the diff bigger.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe it does not matter if you're going to remove all of that in the near future...

@cameel
Copy link
Collaborator

cameel commented Jan 17, 2026

Note that there is an issue for this: #16123. Please include it in the description and also check if the PR covers everything.


Compiler Features:
* Commandline Interface: Introduce `--experimental` flag required for toggling the experimental mode.
* Standard JSON Interface: Introduce `settings.experimental` setting required for toggling the experimental mode.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if it wouldn't be a good idea to make a prerelease once we merge this PR.

I imagine that this kind of change could cause some disruption for those who were relying on experimental features but shouldn't have.

Copy link
Collaborator

@cameel cameel Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we also mention (as a separate entry) that some features now require the experimental mode (and list those features)?. If we do make a prerelease that will be the primary source of information about this.

Comment on lines +708 to +713
Experimental mode has been introduced as of version 0.8.34 as an additional safeguard when using experimental features.
Prior to version 0.8.34, all experimental features not requiring an explicit ``pragma experimental ...`` in source file(s)
were freely available to be used without any additional safeguards. Given that experimental features are sparsely documented,
if at all, often not adequately tested, and thus not intended for production use, we decided to add the ``--experimental``
flag to the command line interface, and the analogous ``settings.experimental`` boolean setting to the Standard JSON interface.
Going forward, usage of any experimental feature will require the experimental mode to be toggled.
Copy link
Collaborator

@cameel cameel Jan 17, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels more like something that would go into the release notes. In docs we usually just focus on describing the current state rather than the future and the past.

It's also missing some information. Here's my attempt at documenting it:

Suggested change
Experimental mode has been introduced as of version 0.8.34 as an additional safeguard when using experimental features.
Prior to version 0.8.34, all experimental features not requiring an explicit ``pragma experimental ...`` in source file(s)
were freely available to be used without any additional safeguards. Given that experimental features are sparsely documented,
if at all, often not adequately tested, and thus not intended for production use, we decided to add the ``--experimental``
flag to the command line interface, and the analogous ``settings.experimental`` boolean setting to the Standard JSON interface.
Going forward, usage of any experimental feature will require the experimental mode to be toggled.
Some language and compiler features included in stable releases are not themselves considered stable.
They are sparsely documented, if at all, often not adequately tested, and thus not yet intended for production use.
In many cases it is possible to develop a big feature incrementally, with each iteration being already stable.
Sometimes, however, it is preferable to start with a prototype and stabilize it over multiple releases, while receiving feedback from users.
To prevent accidental use, such features can be only accessed by enabling the experimental mode.
There are no backwards compatibility guarantees for experimental features.
They are subject to change in breaking ways in non-breaking releases of the compiler.
Only major changes affecting them are recorded in the changelog.
To enable the experimental mode, use the ``--experimental`` flag on the command line,
or the analogous ``settings.experimental`` boolean setting in the Standard JSON input.
Note that if the feature has any impact on the generated bytecode, this fact is recorded in the metadata:
- ``experimental`` flag in CBOR metadata is set to ``true``,
- ``settings.experimental`` in JSON metadata is set to ``true``,
- ``experimentalFeatures`` field in JSON metadata includes the IDs of all the experimental features which may have affected the bytecode.
.. note::
Prior to version 0.8.34, most of the experimental features were usable without any extra safeguards.
Some were gated behind ``pragma experimental``, but this was not done consistently.
The information about them was also only recorded in CBOR metadata and even then not always.
The main goal of the experimental mode is to systematize this and make users fully when they are relying on features which are unfinished or not production-ready.

I'd also include some links, e.g. to changelog, metadata, section on pragmas.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I don't think the PR adds the metadata info. Full extent of it could be done separately, but we need to at least record at the use of --experimental so that the bytecode can be reproduced based on from metadata.

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.

4 participants