repl.it
@thomasballinger2/

compile_calc_to_python-1

Python

For a programming languages course at https://bradfieldcs.com/ we created a language that compiles to Python Bytecode!

fork
loading
Files
  • main.py
  • calc.py
  • compile.py
  • completer.py
  • debug.py
  • debugrepl.py
  • demo.py
  • importhack.py
  • interp.py
  • linter.py
  • mutablecode.py
  • parse.py
  • recur.calc
  • recurspeedtest.calc
  • requirements.txt
  • scope_analysis.py
  • simple.calc
  • simple.pyc
  • simplest.calc
  • testing.py
  • tests.py
  • tokens.py
  • typeinfer.py
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import calc
import dis
import pudb

codeobj = calc.calc_source_to_python_code_object("""
a = 1;
b = 2;
print(b);
""")
dis.dis(codeobj)

import simple

pudb.set_trace()
a = 10
simple.foo()
b = 20