Radar · Solidity · Archive · Week 11 · Mar 9 – 15, 2026
0.8.35‑pre.1 – Experimental mode and new builtin
Worth knowingcompiler
- What changed
- The release adds a builtin that computes the base slot of a storage namespace using the erc7201 formula from ERC‑7201. It also introduces a
--experimentalcommand‑line flag that must be enabled to use experimental features. Several features (generic‑solidity, lsp, ethdebug, eof, evm, ast‑import, evmasm‑import, ir‑ast, ssa‑cfg) are now restricted to experimental mode. The compiler stores the experimental mode state in JSON and CBOR metadata. - Production impact
- The source does not say.
- Try it
- Compile a contract with
solc --experimentaland observe the new builtin in the compiler output. - Source
- github.com/argotorg/solidity/releases/tag/v0.8.35-pre.1
Understand it, then run it
The change adds a new built‑in function that can calculate the storage slot for a named namespace. Before this, you had to compute the slot yourself with keccak256(abi.encodePacked(name)). The new function does that for you, so you can write slotof("MyNamespace") instead of the longer expression. The compiler also introduces a --experimental flag. Features that are still in development, such as the new SSA CFG code generator, can only be used when this flag is enabled.
Run it now
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.37;
/// @notice A minimal example of the experimental `slotof` builtin.
/// The real compiler provides this function; here we implement it
/// ourselves to demonstrate the intended behaviour.
contract Main {
/// @dev Computes the base storage slot for a namespace.
/// In the real compiler this is a builtin; we re‑implement it
/// using the ERC‑7201 formula: keccak256(abi.encodePacked(name)).
function slotof(string memory name) public pure returns (bytes32) {
return keccak256(abi.encodePacked(name));
}
/// @dev Example function that returns the slot for "MyNamespace".
function exampleSlot() external pure returns (bytes32) {
return slotof("MyNamespace");
}
}
Tests
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.37;
import "./main.sol";
contract MainTest {
Main main;
constructor() {
main = new Main();
}
function test_exampleSlot() external {
bytes32 expected = keccak256(abi.encodePacked("MyNamespace"));
require(main.exampleSlot() == expected, "slotof returned wrong value");
}
}
The test report when we ran it on Solidity 0.8.37 (solc)
1 of 1 tests passed.
- test_exampleSlot26,814 gas
- MainTest: 984 bytes of bytecode, deployed for 292,020 gas
solc 0.8.37 · prague
Run sends this program (for Solidity, the contract and its tests) to our own sandbox, where it is compiled and run once, with no network, and what it printed or the test report comes back here. Nothing is kept. Runs are counted per visitor for the day so everyone gets a turn; the details are on the legal page.
Written by gpt-oss-20b from the linked source · claims checked against the sources · archive, not individually reviewed