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

Replace $?UNICODE-VERSION by Unicode.version #5191

Closed
wants to merge 1 commit into from

Conversation

lizmat
Copy link
Contributor

@lizmat lizmat commented Feb 6, 2023

  • creates a Unicode class to keep info about Unicode versions
  • add a Unicode.version class method with former $?UNICODE-VERSION value
  • add a Unicode.NFG class method indicating support for NFG
  • adapt tests accordingly

- creates a Unicode class to keep info about Unicode versions
- add a Unicode.version class method with former $?UNICODE-VERSION value
- add a Unicode.NFG class method indicating support for NFG
- adapt tests accordingly
@lizmat lizmat changed the title Replace $?UNICODE-VERSION by Unicode.version Replace $?UNICODE-VERSION by Unicode.version Feb 6, 2023
@vrurg
Copy link
Member

vrurg commented Feb 7, 2023

This one I would still backport to 6.c. Not all code could easily be converted to the new version, which is anyway is still in PREVIEW state. And yet the feature is way too useful for many, I think. If not crucial sometimes.

@lizmat
Copy link
Contributor Author

lizmat commented Feb 7, 2023

Disagree. If we would backport it, then you wouldn't know which release starts supporting it. And we have too much of that already.

Also, if it was that crucial sometimes, why wasn't this done earlier?

@vrurg
Copy link
Member

vrurg commented Feb 7, 2023

Disagree. If we would backport it, then you wouldn't know which release starts supporting it. And we have too much of that already.

For some features/fixes I have compiler version check in my code. It is inevitable sometimes:

    die "Rakudo of at least v2019.11 required to run this version of " ~ ::?PACKAGE.^name
        unless $*RAKU.compiler.version >= v2019.11;

Also, if it was that crucial sometimes, why wasn't this done earlier?

  1. "If not" means "I don't know exactly, but it's possible" :)
  2. Not everybody qualified enough to implement it
  3. Not everybody is ready to ask for a feature and might just skip implementing something or get around the deficiency in their own way

Anyway, I would insist on having this one at 6.c level. It had to be there from the beginning.

@lizmat
Copy link
Contributor Author

lizmat commented Feb 8, 2023

Ok, I tried moving the Unicode class into core.c

% git diff  
diff --git a/tools/templates/6.c/core_sources b/tools/templates/6.c/core_sources
index 89667242b..cabc590e4 100644
--- a/tools/templates/6.c/core_sources
+++ b/tools/templates/6.c/core_sources
@@ -250,6 +250,7 @@ src/core.c/REPL.pm6
 src/core.c/WrappedJSObject.pm6)@
 src/core.c/Rakudo/Metaops.pm6
 src/core.c/Rakudo/Internals/PostcircumfixAdverbs.pm6
+src/core.c/Unicode.pm6
 src/core.c/unicodey.pm6
 src/core.c/RakuAST/Deparse.pm6
 src/core.c/core_epilogue.pm6
diff --git a/tools/templates/6.e/core_sources b/tools/templates/6.e/core_sources
index bdd2ca548..56771c3da 100644
--- a/tools/templates/6.e/core_sources
+++ b/tools/templates/6.e/core_sources
@@ -11,4 +11,3 @@ src/core.e/array_multislice.pm6
 src/core.e/hash_multislice.pm6
 src/core.e/Formatter.pm6
 src/core.e/Rakudo/Iterator.pm6
-src/core.e/Unicode.pm6

and moving the file from src/core.e/Unicode.pm6 to src/core.c/Unicode.pm6, but got:

The following step can take a long time, please be patient.
Stage start      :   0.000
Unhandled exception: getlexrel requires a concrete object with REPR MVMContext, got Null (VMNull)
   at src/vm/moar/dispatchers.nqp:3313  (/Users/liz/Github/rakudo/blib/Perl6/BOOTSTRAP/v6c.moarvm:find-core-symbol)
 from src/vm/moar/dispatchers.nqp:3335  (/Users/liz/Github/rakudo/blib/Perl6/BOOTSTRAP/v6c.moarvm:)
 from SETTING::src/core.c/Exception.pm6:952  (<ephemeral file>:message)
 from src/Perl6/World.nqp:2620  (/Users/liz/Github/rakudo/blib/Perl6/World.moarvm:)

I've now spent an hour trying to figure what is tickling this and am now giving up.

@vrurg
Copy link
Member

vrurg commented Feb 8, 2023

I tried it locally, but inserted it after unicodey.pm6 and it works. Perhaps you got a problem with uniprop which is implemented in the file.

@lizmat
Copy link
Contributor Author

lizmat commented Feb 8, 2023

Implemented as db7ca2dd03

@lizmat lizmat closed this Feb 8, 2023
@lizmat lizmat deleted the lizmat-Unicode-version branch February 8, 2023 14:53
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

2 participants