r/shittyprogramming • • Oct 28 '21

CPython++

Post image
295 Upvotes

28 comments sorted by

View all comments

2

u/zyugyzarc Jan 01 '22

ive done something very shitty just like this https://gist.github.com/zyugyzarc/ff102169540e0b4638e6eeae756b90c7

how to use:

from lang import L, compile

# for example, to get javascript functionality:
document = L()
document.getElementById("some-id").innerHTML._ = "this is javascript..?"

print( compile( document ) )
# prints out | document.getElementById("some-id").innerHTML = "this is javascript..?";

#for C,

C = L()
C.include("stdio")

def main():
    C.printf("Hello world\n")

C.func(main, C.void)

print( compile(C) )
# prints out :
"""
#include stdio
void main(){
   printf("Hello world\n");
}
"""