marad / chi-compiler-kotlin

Experimental language to try some ideas
MIT License
10 stars 0 forks source link

set/map/vector equality #78

Open marad opened 1 year ago

marad commented 1 year ago

Turns out I've used isIdenticalOrUndefined but that's just for identical objects. To correctly handle different cases of equality I should implement the equal node like in JS implementation.

https://github.com/oracle/graaljs/blob/4ae2f77c22a37e116d6af13368793d19b2f4b4a0/graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/nodes/binary/JSEqualNode.java#L315

marad commented 1 year ago

Other example suggests otherwise https://github.com/oracle/graaljs/blob/81061dd4966bd16b42d01c1f715d3b90e313d638/graal-js/src/com.oracle.truffle.js/src/com/oracle/truffle/js/runtime/JSRuntime.java#L1558

marad commented 1 year ago

Problems may be resolved here: https://github.com/oracle/graal/issues/5090 Until this is resolved something like this is not going to work:

setOf(vectorOf(1), vectorOf(1))

Set is going to have two entries instead of one.

marad commented 1 year ago

The PR meerly fixed the simple case of vectorOf(1) == vectorOf(1) but doesn't solve the issue completely.