3 ms·
Are these things HN readers didn't know? I didn't know you can do operator overloading in Java (with Manifold). That would be interesting: https://www.youtube.
by invalidname 3y ago
Are these things HN readers didn't know?
I didn't know you can do operator overloading in Java (with Manifold). That would be interesting: https://www.youtube.com/watch?v=pwQs-308OdY https://www.youtube.com/watch?v=pwQs-308OdY
- nilptr 3y agoI would be terrified on introducing that into a project and worrying about its long-term support...
- Twisol 3y agoA team I was on decided against Manifold precisely because we wanted to keep up with Java's twice-yearly version updates, and we didn't want a bespoke compiler plugin to lock us to an older version. I think Manifold is extremely cool, and it does look like they're keeping up with the latest -- but the deep compiler magic it relies on really makes me nervous.
- zeedude 3y agoThey are good about supporting latest JDK release and all LTS releases, going back to 8. It’s Oracle’s saber rattling lately concerning plugins like Lombok and Manifold that make me more disappointed than nervous.
- invalidname 3y agoIt is interesting through ;-) Personally, I will probably introduce some of it to a project I'm working on. Here's why: * It's relatively conservative - almost of all its work is done in compile time. Once you have a binary and it went through testing then Manifold is irrelevant. * It's open source - I know it's not the same as "support" but the project has been around for a while and the author is active. * Worst case scenario I can remove it - it would suck since I will need to rewrite code. But the compiler will point me at the exact lines of code I need to fix.
- tpoacher 3y agoI was not aware of manifold; from a quick look, my understanding is that manifold is a bunch of popular language extensions, implemented mostly via preprocessor annotations, which are highly tied to specific java versions and IDEs. But while that does seem cool, I'd hesitate to call manifold-driven operator overloading as "modern java supporting op overloading". To me it has the same vibe as simulating high-level syntax in c via hacky macros.
- invalidname 3y agoThat's not how it works exactly. It's a deep integration as a compiler plugin extension. It works with LTS versions since 8 and with Java 19 (I think 20 also works but not sure). Modern Java is the title of the series that talks about many different subjects including new Java language features, etc.
- tpoacher 3y agoAs in, the java compiler formally provides extension APIs, and Manifold taps directly into those? Hm, ok, in that case, slightly less hacky. Probably more comparable to using gcc extensions then... in that, I'd still hesitate to call it "this is evidence that c supports x" ... but it's the kind of statement that could be argued both ways, and discussions would probably quickly devolve into semantics and pedantry rather than anything of practical significance.
- invalidname 3y agoYes. I suggest checking out the full project source: https://github.com/manifold-systems/manifold https://github.com/manifold-systems/manifold It's very impressive and far bigger than the operator overloading stuff. The other videos in that series cover some of the other features.