Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft: Add nqp::getnextcuid #821

Closed
wants to merge 1 commit into from
Closed

Draft: Add nqp::getnextcuid #821

wants to merge 1 commit into from

Conversation

ab5tract
Copy link
Contributor

This is a mechanism for HLLs to rationally supply CUIDs at runtime without fear of collision.

I'm presenting it here for discussion as to its utility before I bother with JVM support and a better commit message.

This is a mechanism for HLLs to rationally supply CUIDs at
runtime without fear of collision.
@niner
Copy link
Contributor

niner commented Apr 29, 2024

What's the advantage over use QAST; QAST::Block.next-cuid? And what's the use-case?

@ab5tract
Copy link
Contributor Author

AFAIK we don't expose QAST to userland like we do with nqp, but I could be wrong here.

./rakudo-m -MQAST -e1
===SORRY!=== Error while compiling -e
Could not find QAST in:
    ...
at -e:1

I don't have any particular use cases in mind (anymore). I opened the PR because the work is already done and I figured that it would be at least worth discussing.

Maybe this will enable something that myself and others haven't thought of yet?

@lizmat
Copy link
Contributor

lizmat commented Apr 29, 2024

Wouldn't a use case be Inline::Perl5 an API to create CUIDs for its own usage, that are guaranteed not to interfere with Rakudo itself?

@niner
Copy link
Contributor

niner commented Apr 29, 2024

QAST is an NQP module, so the correction version is:

> rakudo -e 'use QAST:from<NQP>; say QAST::Block.next-cuid'
7

Inline::Perl5 doesn't need cuids. It needs to be able to export INIT phasers to its user. Cuids are just an implementation detail necessary for using the $*W.add_phaser implementation detail. It will need neither once we have a real solution in place.

@ab5tract
Copy link
Contributor Author

QAST is an NQP module, so the correction version is:


> rakudo -e 'use QAST:from<NQP>; say QAST::Block.next-cuid'

7

So obvious now that you've pointed it out. That clearly shows this PR is not necessary.

@ab5tract ab5tract closed this Apr 29, 2024
@ab5tract ab5tract deleted the getnextcuid branch April 29, 2024 12:37
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.

None yet

3 participants