manifold-systems / manifold

Manifold is a Java compiler plugin, its features include Metaprogramming, Properties, Extension Methods, Operator Overloading, Templates, a Preprocessor, and more.
http://manifold.systems/
Apache License 2.0
2.42k stars 125 forks source link

[Request] Arithmetic (Shift, Or, Etc) Operators #537

Closed terminalsin closed 10 months ago

terminalsin commented 11 months ago

Is your feature request related to a problem? Please describe. Hi! I use Manifold a lot for writing an IR application, and I've found myself using it specifically when writing expressions, ie:

Without manifold

new ArithmeticExpr(new ConstantExpr(1), new ConstantExpr(2), ArithmeticOperator.PLUS)

With manifold

cnst(1) + cnst(2)

Simplifying my IR mechanics a lot. However, I'm extremely saddened to see the lack of implementation of these operators:

Describe the solution you'd like If I understand correctly, it'd be quite easy to implement them by adding the tags via https://github.com/manifold-systems/manifold/blob/master/manifold-core-parent/manifold/src/main/java/manifold/internal/javac/ManAttr.java#L66

All would be needed is the exact same coverage as typical booleans and integers!

Describe alternatives you've considered No alternatives considered, this is internal only.

Additional context n/a

terminalsin commented 11 months ago

Perhaps merge https://github.com/manifold-systems/manifold/pull/458

rsmckinney commented 11 months ago

This feature is high on the list. I'll get to it soon.

terminalsin commented 11 months ago

This feature is high on the list. I'll get to it soon.

God bless. Not to press but any eta? Could perhaps compiling a comprehensive PR accelerate this to production? Willing to make any sacrifice to help you move this forward 🫶

rsmckinney commented 11 months ago

I'm just finishing up an IJ plugin issue, putting that to bed now. This one is next. I like the determination! But I'll bang this out; should be on the shelf within a week. Let me know if your need for this is more pressing. Cheers.

terminalsin commented 11 months ago

I'm just finishing up an IJ plugin issue, putting that to bed now. This one is next. I like the determination! But I'll bang this out; should be on the shelf within a week. Let me know if your need for this is more pressing. Cheers.

Absolute legend! Make sure to keep time for family and new years. Love the dedication to this awesome project, keep it up. You've transformed our workflow lives.

rsmckinney commented 10 months ago

Feature available with release 2024.1.1