@@ -278,7 +278,7 @@ def main():
278278
279279 parser .add_argument ('--languages' , '--langs' , type = str ,
280280 default = ',' .join (SUPPORTED_LANGUAGES ),
281- help = 'Languages (optionally combined with compilers) to benchmark separated by comma. For instance --languages=C:tcc,D:dmd.' )
281+ help = 'Languages (optionally combined with compilers) to benchmark separated by comma. For instance --languages=C:tcc,D:dmd,D:gdc,D:ldmd2 .' )
282282
283283 parser .add_argument ('--operations' , '--ops' , type = str ,
284284 default = ',' .join (SUPPORTED_OPERATIONS ),
@@ -304,19 +304,23 @@ def main():
304304
305305 args .languages = list (map (lambda x : 'OCaml' if x .lower () == 'ocaml' else x .capitalize (),
306306 args .languages .split (',' ))) # into a list
307- filtered_languages = []
308- args .language_exe = {}
309- for language in args .languages :
310- split = language .split (':' )
307+ args .language_exes = {}
308+ for language_exes_spec in args .languages :
309+ split = language_exes_spec .split (':' )
311310 if len (split ) == 2 :
312311 language = split [0 ]
313312 exes = split [1 ]
314- args .language_exe [language ] = tuple (exes .split ())
315- if language in SUPPORTED_LANGUAGES :
316- filtered_languages .append (language )
317313 else :
314+ language = split [0 ]
315+ exes = Null
316+ if language not in SUPPORTED_LANGUAGES :
318317 print ('Warning: Ignoring unsupported language ' + language )
319- args .languages = filtered_languages
318+ continue
319+ if language in args .language_exes :
320+ args .language_exes [language ] += tuple (exes .split (',' ))
321+ else :
322+ args .language_exes [language ] = tuple (exes .split (',' ))
323+ print ("args.language_exes:" , args .language_exes )
320324
321325 args .operations = list (map (lambda x : x .capitalize (), args .operations .split (',' ))) # into a list of capitalized names
322326 filtered_operations = []
@@ -333,82 +337,82 @@ def main():
333337 print (markdown_header ('Benchmark:' , 1 ))
334338
335339 for op in args .operations :
336- if 'Vox' in args .languages :
340+ if 'Vox' in args .language_exes :
337341 for templated in (False , True ):
338342 benchmark_Vox (results = results , code_paths = code_paths , args = args , op = op , templated = templated )
339343 benchmark_Vox (results = results , code_paths = code_paths , args = args , op = op , templated = templated )
340- if 'D' in args .languages :
344+ if 'D' in args .language_exes :
341345 for templated in (False , True ):
342346 benchmark_D (results = results , code_paths = code_paths , args = args , op = op , templated = templated , use_dips = True )
343- if 'C' in args .languages :
347+ if 'C' in args .language_exes :
344348 for templated in (False ,):
345349 benchmark_C_using_tcc (results = results , lang = 'C' , code_paths = code_paths , args = args , op = op , templated = templated )
346350 benchmark_C_using_cproc (results = results , lang = 'C' , code_paths = code_paths , args = args , op = op , templated = templated )
347351 benchmark_C_and_Cxx_using_gcc (results = results , lang = 'C' , code_paths = code_paths , args = args , op = op , templated = templated )
348352 benchmark_C_and_Cxx_using_clang (results = results , lang = 'C' , code_paths = code_paths , args = args , op = op , templated = templated )
349- if 'C++' in args .languages :
353+ if 'C++' in args .language_exes :
350354 for templated in (False , True ):
351355 benchmark_C_and_Cxx_using_gcc (results = results , lang = 'C++' , code_paths = code_paths , args = args , op = op , templated = templated )
352356 benchmark_C_and_Cxx_using_clang (results = results , lang = 'C++' , code_paths = code_paths , args = args , op = op , templated = templated )
353357
354- if 'Ada' in args .languages :
358+ if 'Ada' in args .language_exes :
355359 # if 'Check' in args.operations:
356360 # benchmark_Ada_using_gcc(results=results,lang='Ada', code_paths=code_paths, args=args, op='Check', templated=False)
357361 if 'Build' in args .operations :
358362 benchmark_Ada_using_gcc (results = results , lang = 'Ada' , code_paths = code_paths , args = args , op = 'Build' , templated = False )
359363
360- if 'Go' in args .languages :
364+ if 'Go' in args .language_exes :
361365 if 'Check' in args .operations :
362366 benchmark_Go (results = results , code_paths = code_paths , args = args , op = 'Check' , templated = False )
363367 if 'Build' in args .operations :
364368 benchmark_Go (results = results , code_paths = code_paths , args = args , op = 'Build' , templated = False )
365369
366- if 'Swift' in args .languages :
370+ if 'Swift' in args .language_exes :
367371 if 'Check' in args .operations :
368372 benchmark_Swift (results = results , code_paths = code_paths , args = args , op = 'Check' , templated = False )
369373 if 'Build' in args .operations :
370374 benchmark_Swift (results = results , code_paths = code_paths , args = args , op = 'Build' , templated = False )
371375
372- if 'V' in args .languages :
376+ if 'V' in args .language_exes :
373377 if 'Build' in args .operations :
374378 benchmark_V (results = results , code_paths = code_paths , args = args , op = 'Build' , templated = False )
375379 benchmark_V (results = results , code_paths = code_paths , args = args , op = 'Build' , templated = True )
376380
377- if 'C3' in args .languages :
381+ if 'C3' in args .language_exes :
378382 for op in args .operations :
379383 benchmark_C3 (results = results , code_paths = code_paths , args = args , op = op , templated = False )
380384
381- if 'Zig' in args .languages :
385+ if 'Zig' in args .language_exes :
382386 if 'Check' in args .operations :
383387 benchmark_Zig (results = results , code_paths = code_paths , args = args , op = 'Check' , templated = False )
384388 benchmark_Zig (results = results , code_paths = code_paths , args = args , op = 'Check' , templated = True )
385389 if 'Build' in args .operations :
386390 benchmark_Zig (results = results , code_paths = code_paths , args = args , op = 'Build' , templated = False )
387391 benchmark_Zig (results = results , code_paths = code_paths , args = args , op = 'Build' , templated = True )
388392
389- if 'Rust' in args .languages :
393+ if 'Rust' in args .language_exes :
390394 if 'Check' in args .operations :
391395 benchmark_Rust (results = results , code_paths = code_paths , args = args , op = 'Check' , templated = False )
392396 benchmark_Rust (results = results , code_paths = code_paths , args = args , op = 'Check' , templated = True )
393397 if 'Build' in args .operations :
394398 benchmark_Rust (results = results , code_paths = code_paths , args = args , op = 'Build' , templated = False )
395399 benchmark_Rust (results = results , code_paths = code_paths , args = args , op = 'Build' , templated = True )
396400
397- if 'Nim' in args .languages :
401+ if 'Nim' in args .language_exes :
398402 if 'Check' in args .operations :
399403 benchmark_Nim (results = results , code_paths = code_paths , args = args , op = 'Check' , templated = False )
400404 if 'Build' in args .operations :
401405 benchmark_Nim (results = results , code_paths = code_paths , args = args , op = 'Build' , templated = False )
402406
403- if 'C#' in args .languages :
407+ if 'C#' in args .language_exes :
404408 if 'Build' in args .operations :
405409 benchmark_Mono (results = results , code_paths = code_paths , args = args , op = 'Build' , templated = False )
406410
407- if 'Java' in args .languages :
411+ if 'Java' in args .language_exes :
408412 if 'Build' in args .operations :
409413 benchmark_Java (results = results , code_paths = code_paths , args = args , op = 'Build' , templated = False )
410414
411- if 'Pareas' in args .languages :
415+ if 'Pareas' in args .language_exes :
412416 if 'Check' in args .operations :
413417 benchmark_Pareas (results = results , code_paths = code_paths , args = args , op = 'Check' , templated = False )
414418 if 'Build' in args .operations :
@@ -422,12 +426,12 @@ def main():
422426 args .function_count = 100
423427 args .function_depth = 100
424428
425- if 'OCaml' in args .languages :
429+ if 'OCaml' in args .language_exes :
426430 if 'Build' in args .operations :
427431 benchmark_OCaml (results = results , code_paths = code_paths , args = args , op = 'Build' , templated = False , bytecode = False )
428432 benchmark_OCaml (results = results , code_paths = code_paths , args = args , op = 'Build' , templated = False , bytecode = True )
429433
430- if 'Julia' in args .languages :
434+ if 'Julia' in args .language_exes :
431435 if 'Build' in args .operations :
432436 benchmark_Julia (results = results , code_paths = code_paths , args = args , op = 'Build' , templated = False )
433437 benchmark_Julia (results = results , code_paths = code_paths , args = args , op = 'Build' , templated = True )
@@ -442,7 +446,7 @@ def main():
442446
443447def match_lang (args , lang , exe_name ):
444448 try :
445- if exe_name not in args .language_exe [lang ]:
449+ if exe_name not in args .language_exes [lang ]:
446450 return None
447451 except KeyError :
448452 pass
@@ -617,7 +621,7 @@ def benchmark_D(results, code_paths, args, op, templated, use_dips):
617621 else :
618622 return None
619623
620- # DMD
624+ # dmd
621625 exe = match_lang (args , lang , 'dmd' )
622626 if exe :
623627 version = get_version (sp .run ([exe , '--version' ], stdout = sp .PIPE ))
@@ -633,7 +637,7 @@ def benchmark_D(results, code_paths, args, op, templated, use_dips):
633637 templated = templated ,
634638 results = results )
635639
636- # LDC
640+ # ldmd2
637641 exe = match_lang (args , lang , 'ldmd2' )
638642 if exe :
639643 version = sp .run ([exe , '--version' ], stdout = sp .PIPE ).stdout .decode ('utf-8' ).split ()[6 ][1 :- 2 ]
@@ -649,7 +653,7 @@ def benchmark_D(results, code_paths, args, op, templated, use_dips):
649653 templated = templated ,
650654 results = results )
651655
652- # GDC
656+ # gdc
653657 exe = match_lang (args , lang , 'gdc' )
654658 if exe :
655659 exe_flags = ['-fsyntax-only' ] if op == 'Check' else []
0 commit comments