Current Behavior
There are no automatic optimizations present in Robyn at the moment.
Desired Behavior
Below is the example of a disassembled code in Python.
High Level Implementation
5 0 LOAD_CONST 1 ('Hello world')
2 RETURN_VALUE
None
9 0 LOAD_CONST 1 ('Hello world')
2 RETURN_VALUE
None
16 0 LOAD_CONST 1 ('Hello world ')
2 LOAD_CONST 2 (1)
4 FORMAT_VALUE 0
6 BUILD_STRING 2
8 RETURN_VALUE
None
22 0 LOAD_CONST 1 ('Hello world ')
2 LOAD_GLOBAL 0 (str)
4 LOAD_GLOBAL 1 (a)
6 CALL_FUNCTION 1
8 BINARY_ADD
10 RETURN_VALUE
None
12 0 LOAD_CONST 1 ('Hello world')
2 LOAD_CONST 2 ('bruhh')
4 BINARY_ADD
6 RETURN_VALUE
None
import dis
def myfn():
return "Hello world"
def myfn1():
return f"Hello world"
def myfn4():
return f"Hello world" + "bruhh"
def myfn2():
return f"Hello world {1}"
a = 1
def myfn3():
global a
return "Hello world " + str(a)
print(dis.dis(myfn))
print(dis.dis(myfn1))
print(dis.dis(myfn2))
print(dis.dis(myfn3))
print(dis.dis(myfn4))
Screenshots / Mockups
Alternatives
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too