Skip to content

Recent update#10

Merged
ChingLongTin merged 11 commits into
ChingLongTin:final🐤from
NeilKleistGao:fix🦠
Jun 5, 2026

Hidden character warning

The head ref may contain hidden characters: "fix\ud83e\udda0"
Merged

Recent update#10
ChingLongTin merged 11 commits into
ChingLongTin:final🐤from
NeilKleistGao:fix🦠

Conversation

@NeilKleistGao

@NeilKleistGao NeilKleistGao commented May 28, 2026

Copy link
Copy Markdown
Collaborator
  • Add test cases for reg exp
  • Improve 3d transform
  • Remove shape set flattening
  • Fix unexpected inlining
  • Generate functions at the top level
  • Fix subclass check and dyn merging

@ChingLongTin ChingLongTin marked this pull request as ready for review June 3, 2026 10:47
Comment thread hkmc2/shared/src/test/mlscript-compile/staging/out/StagedClass.mls Outdated

@ChingLongTin ChingLongTin left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a regression that should be addressed: https://github.com/ChingLongTin/mlscript/pull/10/changes#r3350061642
The remaining are some minor suggestions.

Comment thread hkmc2/shared/src/test/mlscript/ShapeSetTest.mls Outdated
Comment thread hkmc2/shared/src/test/mlscript-compile/ShapeSet.mls Outdated
import "./Block.mls"
import "./Option.mls"
import "./CachedHash.mls"
import "./ShapeSet.mjs"

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We might want to put Shape and ShapeSet in a single module in a later commit instead of having both files importing each other.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. We should do it.

Comment thread hkmc2/shared/src/test/mlscript-compile/SimpleRegExp.mls
Comment thread hkmc2/shared/src/test/mlscript-compile/Shape.mls Outdated
Comment thread hkmc2/shared/src/test/mlscript-compile/SimpleRegExp.mls Outdated
Comment thread hkmc2/shared/src/test/mlscript-compile/staging/StagedRegExp.mls
Comment thread hkmc2/shared/src/test/mlscript/block-staging/SimpleRegExpTest.mls Outdated
Comment thread hkmc2/shared/src/test/mlscript/block-staging/ShapeProp.mls Outdated
let fullBlk = foldl((acc, e) => concat(acc, e.0))(End(), ...evaledArgs)
let newArgs = evaledArgs.map(e => Arg(if e.1 is Path then e.1 else throw Error("expected path")))
[fullBlk, Call(f, newArgs), mkDyn()] // non staged function and some params unknown
argShapes.every(staticSet) then // non staged function and params known

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to make the sorUnknownCall fallback inside sorStaticModuleCall unreachable.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that branch should be redundant. But there is a case that failed. It is probably due to missing metadata. I added a fixme in the latest commit, and maybe you can help figure it out.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, we seem to need it. Having all static parameters doesn't mean the result is also static, as we may not always be able to reconstruct the shape of the value. This is the reason this test failed:

class C
module Opaque with
  fun f() = new C
staged module M with
  fun f() = Opaque.f()
M."f_gen"()

because we can't currently reconstruct the class symbol for C.

@ChingLongTin ChingLongTin merged commit 15b8e2c into ChingLongTin:final🐤 Jun 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants