Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I compile perl6 file to exe

Tags:

raku

moarvm

I am playing with perl6 version which built on MoarVM on windows. I created some perl6 file and want to compile it to exe. I tried the following:

perl6 --target=MAST r.pl>r

Now I want to compile the r to executable

I found this link which talk about how to that using Parrot but I am using MoarVM target: http://perlgeek.de/blog-en/perl-6/my-first-executable.writeback

my question how can i compile MoarvVM targeted file to windows executable ?

like image 474
smith Avatar asked Nov 27 '14 21:11

smith


2 Answers

Unfortunately, the answer is to target JVM and one of the many nice tools for turning a JAR into an executable. MoarVM doesn't have that tooling at this point (and given the lack of current overlap between perl6 hackers and Windows users, probably won't for some time).

like image 136
Daniel Lathrop Avatar answered Sep 29 '22 13:09

Daniel Lathrop


One of the things that attracted me to the language, was that it was supposed to be compilable, I thought "sure, it would build exe files for me", unfortunately, it does not (last I checked).

compile:

perl6 --target=mbc --output=test.moarvm  -e 'say 42'

run:

perl6 -e 'CompUnit::Loader.load-precompilation-file("test.moarvm".IO)'

However, you can compile the program t the intermediate moarvm machine, do KEEP IN MIND this is not porable, so you have to recompile on each target.

I think this code was legated to me by somebody that really knew perl6 on the irc channel, I don't understand how it works, though.

I advise if you need a compiled language, to wait for real support from the compiler guys or simply to use something like rust or golang (that is what I ended up using, I'm happy).

I know rust doesn't have all the "bells and whistles" that Perl6 has, but it gets the job done...

like image 28
Felipe Valdes Avatar answered Sep 29 '22 13:09

Felipe Valdes