Actually I have the same question, but I think the answer is Yes! In Solidity you can use an assembly segment
assembly {
// LLL OR OPCODES HERE
}
Where you can write code as you do in LLL, same syntax and pretty cheap GAS cost, at least 30% in my experience.
pragma solidity ^0.4.24;
/*
Autor: Javier Guajardo J.
Website: https://ethereumchile.cl
Twitter: @EthereumChile
*/
contract Assembly {
function returnSum1(uint a, uint b) public pure returns (uint sum) {
// We ADD a and b in a new variable called doSum
assembly {
let doSum := add(a, b)
sum := doSum
}
}
function returnSum2(uint a, uint b) public pure returns (uint sum) {
// OR you can ADD a and b directly
assembly {
sum := add(a, b)
}
}
function returnSum3(uint a, uint b) public pure returns (uint) {
// OR you can ADD a and b into 0x40 memory address
assembly {
let sum := mload(0x40) // loading 0x40 address memory
mstore(sum, add(a, b)) // We store the add(a, b) in 0x40 address memory
return(sum, 32) // We return result.
}
}
}
Result in Remix IDE
Screencapture.png Assembly in Solidity by Javier Guajardo