[M3devel] switching to C backend?

dirk muysers dmuysers at hotmail.com
Sat Jul 18 10:42:14 CEST 2015


May I remind you Norman Ramsey’s opinion on the subject:



Code generation is my business :-)

Comments on a few options:

  a.. CLR: 

    a.. Pro: industrial support 
    b.. Con: you have to buy into their type system pretty much completely; depending on what you want to do with types, this may not matter 
    c.. Con: Only Windows platform is really prime-time quality
  b.. LLVM:

    a.. Pro: enthusiastic user community with charismatic leader 
    b.. Pro: many interesting performance improvements 
    c.. Con: somewhat complex interface 
    d.. Con: history of holes in the engineering; as LLVM matures expect the holes in the engineering to be plugged by adding to the complexity of the interface
  c.. C--

    a.. Pro: target is an actual written language, not an API; you can easily inspect, debug, and edit your C-- code 
    b.. Pro: design is reasonably mature and reasonably clean 
    c.. Pro: supports accurate garbage collection 
    d.. Pro: most users report it is very easy to use 
    e.. Con: very small development team 
    f.. Con: as of early 2009, supports only three hardware platforms (x86, PPC, ARM) 
    g.. Con: does not ship with a garbage collector 
    h.. Con: future of project is uncertain
  d.. C as target language

    a.. Pro: looks easy 
    b.. Con: nearly impossible to get decent performance 
    c.. Con: will drive you nuts in the long run; ask the long line of people who have tried to compile Haskell, ML, Modula-3, Scheme and more using this technique. At some point every one of these people gave up and built their own native code generator.
Summary: anything except C is a reasonable choice. For the best combination of flexibility, quality, and expected longevity, I'd probably recommend LLVM. But your example code is very close to C--, so that may be an advantage.

Full disclosure: I am affiliated with the C-- project.


From: Jay K 
Sent: Saturday, July 18, 2015 10:27 AM
To: m3devel 
Subject: [M3devel] switching to C backend?

Any objection if I start switching targets to the C backend? 

In particular, Darwin does not support m3gdb, so debuggability is not a factor.

Thanks,
- Jay







--------------------------------------------------------------------------------
_______________________________________________
M3devel mailing list
M3devel at elegosoft.com
https://mail.elegosoft.com/cgi-bin/mailman/listinfo/m3devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://m3lists.elegosoft.com/pipermail/m3devel/attachments/20150718/0900c2cf/attachment-0002.html>


More information about the M3devel mailing list