This is an umbrella issue to cover the steps needed for Yul, the internal IR of Solidity. Yul aims to be fairly expressive, support basic types (bool, numbers) and be a source to generate both EVM and eWASM bytecode.
A superset of Yul, currently named Yul++ or Solidity--, can include "user defined types", which here means internal types of Solidity, like contracts, address, etc. This superset is also exposed to the user as "inline assembly".
Planned is to have transformations / optimisations on Yul as a middle layer.
Three targets / backends are proposed for Yul: EVM, "EVM 1.5" and eWASM.
In the compiler the following components are affected:
libsolidity/inlineasm is extended to support parsing Yul (and Yul++). It also exposes an AST structure which is returned by the parser and is supported as an input by the printer. Since this code is also able to parse current inline assembly, there should be a flag to switch between the two formats. Perhaps we could rename it libsolidity/yul. (flag has been added)libsolidity/frontend is to be created, which receives the Solidity AST and produces a Yul ASTlibsolidity/backend/evm is to be created, which receives the Yul AST and produces EVM bytecode - has been implementedlibsolidity/backend/evm15 is to be created, which receives the Yul AST and produces EVM1.5 bytecode - has been implementedlibsolidity/backend/ewasm is to be created, which receives the Yul AST and produces eWASM bytecodeAnother possible layout of code as discussed is:
libjulia - AST, parser, printer (the current libsolidity/inlineasm)libjulia/backend/evm (doesn't uses libevmasm, but the peephole optimiser is copied from there)libjulia/backend/evm15libjulia/backend/ewasmlibsolidity/codegen/evm (the current libsolidity/codegen, uses libevmasm)libsolidity/codegen/julia - the new Julia AST generatorThe first milestone here is the ABI coder
The API in StandardCompiler could be:
contractData["julia"] = m_compilerStack.julia(contractName);
contractData["ewasm"]["wast"] = solidity::julia::wast(m_compilerStack.julia(contractName));
Possible input for JSON I/O:
{
"language": "JULIA",
"settings": {
},
"sources": [
"function assert(x:bool)\n{\n switch x\n case false:bool:\n {\n abort()\n }\n}"
]
}
And output:
{
errors: [],
julia: "...", // transformed Julia based on the settings (i.e. fold in all "standard functions", run optimisation passes, etc)
"evm": ..., // see JSON I/O
"ewasm": ... // see JSON I/O
}
@chriseth @pirapira if we could define an AST class for Julia, I could start writing an eWASM backend.
Julia parser:
=: variable)bool as a type (it is a token)forswitchiftrue and false as literals for boolcontinuebreaktypes of assignment/callSome other naming/acronym ideas:
Yul - Yet another Universal Language
Jul - Joyfully Universal Language
Julie - Joyfully/Yet another Universal Language without Instructions for Ethereum
Yalll - Yet another Low Level Language
I'd go for Y'all (Yet Another Low-level Language) aka. Texan Assembly
As I live in Atlanta, Georgia, and do say "y'all," I very much approve of
this.
On Thu, Apr 27, 2017, 11:32 Alex Beregszaszi notifications@github.com
wrote:
I'd go for Y'all (Yet Another Low-level Language) aka. Texan Assembly
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
https://github.com/ethereum/solidity/issues/2131#issuecomment-297800668,
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAlhYEfs_x9ZVo8NvthPp10bSeZBHMCAks5r0N8ngaJpZM4NBctk
.
New name suggestion:
JULIA - Joyfully Universal Language which is not Instructional Assembly
I still have a grudge against the name Julia being used by another more known language :)
When I saw the title of @axic 's talk today at DevCon3 on "Julia – IR for Ethereum Contracts" my immediate thought was that the talk involved the scientific computing language Julia. This was also the impression of a Gnosis employee. Julia the scientific computing language has been around since 2009 or 2012, depending on which date one uses; I anticipate the use of the scientific language Julia to grow with upcoming releases. If the name of the IR language in this thread stays "Julia", naming collisions such as that which I experienced can be expected to increase.
I suggest the name for the IR language be changed to something different than Julia.
Yeah, totally voting for "not Julia" to avoid confusion with the scientific computation language Julia.
Yeah, totally voting for "not Julia" to avoid confusion with the scientific computation language Julia.
Yes please :)
Julia is generally a great language not limited to scientific computing and there is a good chance we and / or others will use it for implementing smart contracts on Ethereum at some point so the chance of confusion is high I think.
Some more proposals:
Decision was to use yul. Finally :)
Yay! :tada:
Updated description a little.
Ticked some more boxes. The only thing missing is type checking. Do we really need to keep this open for that, @axic?
Most helpful comment
Yeah, totally voting for "not Julia" to avoid confusion with the scientific computation language Julia.