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

I didn't see any mention of the recursive-usage problem. How do they plan on handling co-dependant files?

For example, class A's code makes use of class B. Class B's code makes use of class A.

a.h looks like:

  class B;
  class A {
  public: void foo (B *);
  }
a.cc looks like:

  #include "a.h"
  #include "b.h"
  void A::foo (B *) { b->narf (); }
and b.h and b.cc use A in the same way.


I don't see what the issue is. In some sense, the proposal is to essentially do away with inserted code and instead do what Java is doing with its import statements: a public API. There's no recursion issue in Java.

I think you may be mixing this up with C's #include, which does have recursion issues, hence the need for its absurd #ifdef guards. But Apple did away with that years ago with #import, which is basically #include with built-in guards.


I'm wondering how it accomplishes this as a practical matter. Does it compile a file twice? Once to create the interface info, and a second time to compile the implementation? Can they even parse enough of a C++ file to generate the interface in all cases?

That they chose not to mention the issue makes me nervous that they think they can just ignore the problem. Many previous languages have ignored the problem and said "don't do that." I hope this proposal does not go in that direction.




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

Search: