making a programming language
- by None
I was wondering which way would create a faster programming language, because I have tried both. Writing code that takes the text, splits it by whitespace or newlines or something, then processes each line and has a dictionary for variables. Or writing code that takes text and converts it to another programming language. This is an example of how a very simple version of the first way would be programmed in python:
def run(code):
text = code.split(";")
for t in text:
if t == "hello":
print "hi"
second:
def run(code):
rcode = ""
text = code.split(";")
for t in text:
if t == "hello":
rcode += "print 'hi'"