How can I compile perl6 file to exe

元气小坏坏 提交于 2019-12-12 09:34:34

问题


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 ?


回答1:


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).




回答2:


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...



来源:https://stackoverflow.com/questions/27178599/how-can-i-compile-perl6-file-to-exe

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!