seanbaxter / circle

The compiler is available for download. Get it!
http://www.circle-lang.org/
2.42k stars 74 forks source link

Circle can't parse Eigen #163

Closed TobiSchluter closed 9 months ago

TobiSchluter commented 1 year ago

#include <Eigen/Dense> to receive a barrage of errors (tested with build 186, as adding --version on the command line tells me)

https://godbolt.org/z/cfene9j71

correaa commented 1 year ago

Did it work for previous versions of circle? (or, you can use an alternative library that works with circle, https://godbolt.org/z/qd9P71a7W)

TobiSchluter commented 1 year ago

Previous versions available on godbolt didn't have sse intrinsics, though I thought I'd tried it before with similar results, maybe with older versions of Eigen

  1. originally, I wanted to use circle to help me hack Eigen, so another library is not gonna help me
  2. Eigen is a well-established library, it doesn't build my trust in Circle if it cannot handle it
  3. the example you showed doesn't make me interested. A matrix library where I'd have to implement the trace operator myself?
correaa commented 1 year ago
  1. Sure, no problem.
  2. Yes, in my experience, libraries need modifications to make them work with Circle, the same as when you introduce any new supported compiler. Some of them seem to originate from defects in the Circle parser, but I found most of the modifications to be very positive for the base code. This is because a) it makes the library more robust as some constructs are interpreted differently than in the GCC and Clang parsers. (i.e., other opinions on murky aspects of the standard grammar). A few times, Circle helped me detect plain bugs in my library and tests that GCC and Clang didn't catch, such as i) life extensions of temporaries and ii) accessing private data of other classes in template expressions.
  3. Not to divert the conversation further about the trace function (which was just an example), we can continue here if you want https://gitlab.com/correaa/boost-multi/-/issues/139.
TobiSchluter commented 9 months ago

Works now, but usage still fails e.g. #201