Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> C is a heavyweight intermediary language which brings with it a /lot/ of baggage. There's no valid direct technical reason other than financial resource constraints to justify compiling to C (... or JS, for that matter) instead of a more suitable and expressive IR/bytecode.

1. In theory. But what is that "more suitable and expressive IR/bytecode"? I would argue such a bytecode should be portable, but LLVM IR is not that.

2. There are lots of reasons to target C. C can be compiled by many compilers, while LLVM IR can only be compiled by LLVM to things LLVM can compile to. For example, game consoles, various new embedded platforms, etc. - they all have C compilers, but LLVM might not support them (and possibly cannot support them).



All of your arguments about going through C would go away if you had enough money to build your own ideal toolchain, including the development of your own IR for your language.


In theory. But it would be my own ideal toolchain. Someone else might make different tradeoffs in its design.


I'm not sure I understand. The claim is that the only reason to target C is to save money.


It's not difficult to restrict LLVM IR to a portable subset, though ;-)


> 2. There are lots of reasons to target C. C can be compiled by many compilers, while LLVM IR can only be compiled by LLVM to things LLVM can compile to. For example, game consoles, various new embedded platforms, etc. - they all have C compilers, but LLVM might not support them (and possibly cannot support them).

Is the point to produce something optimal for users, or produce something optimal for developers? Most successful game and application platforms trend towards the former, whereas your work on web technologies trends towards the latter.


Vendor lock-in isn't good for users either.


No, it is not. But what does it have to do with anything discussed here? I can't see IR being something which locks users or developers to a particular vendor.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: