compiler-benchmark icon indicating copy to clipboard operation
compiler-benchmark copied to clipboard

generate code for each language directly instead of using current complex piecemeal approach

Open timotheecour opened this issue 3 years ago • 0 comments

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))
...

timotheecour avatar Apr 25 '21 06:04 timotheecour