Starknet / Cairo >>>>> EVM / Solidity Type system: Cairo has strong types, generics, algrebraic data types, traits. Solidity has no generics and weaker pattern matching. Ownership / borrow checker at compile time: Cairo has it, single owner move semantics and borrow rules that catch use after move. Solidity memory safety relies on developer discipline. Arithmetic safety: Cairo use checked maths by default. Solidity now has checked arithmetic but can be opt out. Cairo comes with an intermediate representation (Sierra) that cannot express undefined behaviour or a failing assert, every function is proven to terminate at compile time. Upgrade patterns: In Cairo it's done with native syscall to replace class hash while retaining storage, enforced by proof, no proxy storage collision risks. In Solidity, proxies are hand rolled, storage slot collisions and delegatecall mistakes represent a risk. Cairo deliberately omits certain features present in Solidity, such as modifiers, class inheritance. Cairo favors composability over inheritance, which helps writing cleaner, more modular code, making it easier to reason about and audit for security flaws. Cairo design eliminates whole bug classes before code compiles, whereas Solidity depends on conventions like Checks Effects Interactions and external linters.
Fede’s intern 🥊
Fede’s intern 🥊9.7. klo 23.01
Solidity is the worst programming language I have ever used in my life. I don't care who in Ethereum tells me the opposite but it's obvious to anyone that has worked with good compilers and other programming languages.
14,8K