compiler-benchmark
compiler-benchmark copied to clipboard
generate code for each language directly instead of using current complex piecemeal approach
benchmark
python code would IMO be a lot more readable, concise, maintainable and extensible to other languages and benchmarks if it instead generated each language searately instead of the current complex logic, eg
def generate_main_test_function_variable(lang, typ, f, templated):
if lang in ('c', 'c3', 'c++', 'd', 'vox'):
f.write(Tm(' ${T} ${T}_sum = 0;\n').substitute(T=typ))
elif lang in ['ada']:
f.write(Tm(' ${T}_sum : ${T} := 0;\n').substitute(T=typ))
elif lang in ['c#']:
f.write(Tm(' ${T} ${T}_sum = 0;\n').substitute(T=typ))
...