I am attempting to write a hash, which is written very slowly, into a data file, but am unsure about how Perl6 does this in comparison to Perl5. This is a similar question Storing intermediate data in a file in Perl 6 but I don't see how I can use anything written there, specifically messagepack.

This is built in to Perl5, it's super easy, I don't need to install any modules (I love it!), but how can I do this in Perl6? I don't see it in the manual. They appear to be talking about something else with STOREhttps://docs.perl6.org/routine/STORE

So I just did a quick test. Made a hash with 1000 key/values pairs. Used Perl5 storable and the output file is 15476 bytes. Then I made the same file and output it as a pretty printed json file. 14344 bytes. So a JSON file is cross langauge compatible, future proof and smaller than a Storable file.
– ScimonJan 31 at 21:11

2

You can just use many Perl 5 modules as is in Perl 6. You can, for example, just write use Storable:from<Perl5>; and then use it using Perl 6 syntax. You may have to do something to turn this ability on such as letting Perl 6 know where your Perl 5 modules are installed and perhaps installing whatever extra Perl 5 modules you want. To find out where things are at on your system, just try typing the use line as I've written it above and seeing what the compiler says. For more info see github.com/niner/Inline-Perl5/blob/master/README.md If you get stuck, post another SO question.
– raiphFeb 1 at 0:19

while I appreciate your work, I was hoping for a system approach, like use Storable in Perl5, which I could type as quickly as I could in the question. It looks like it doesn't exist in Perl6 :( I wonder how I can contribute to Perl6
– conJan 31 at 19:50

I seriously think you should move away from Storable and over to JSON. If you're using Rakudo Star as your install it includes a number of different JSON modules as part of it's core install so you don't need to add anything extra.

JSON is compatible with a number of different languages (not just Perl) and is a defined standard (unlike Storable which is backward incompatible). And JSON file sizes are of a similar size (if not smaller).

About the only plus point of Storable over JSON is handling code references. But if you're just storing data I wouldn't advise using Storable.