Pradeep's Stream

Compiling nim programs with C, CPP and ObjC backends

Nim supports multiple compiler backends like C, C++, ObjC and JavaScript.

I did not try compiling the program with JS because many OS facing APIs are not available to the JS backend.

  • C* -- nim c -d:release tohray -- 2117992
  • CPP -- nim cpp -d:release tohray -- 2443528
  • ObjC -- nim objc -d:release tohray -- NA

NA: ObjC compile failed with:

/Users/pradeep/.choosenim/toolchains/nim-2.0.8/lib/pure/math.nim(281, 11) template/generic instantiation of `isNaN` from here
/Users/pradeep/.choosenim/toolchains/nim-2.0.8/lib/pure/math.nim(204, 20) Error: undeclared identifier: 'c_isnan'
candidates (edit distance, scope distance); see '--spellSuggest':
 (1, 3): 'isNaN'

The CPP generated executable is slightly larger. I do not know if it's faster for the same compilation settings.

Calendar , Export