如何将 perl6 文件编译为 exe [英] How can I compile perl6 file to exe
问题描述
我正在玩基于 Windows 上的 MoarVM 的 perl6 版本.我创建了一些 perl6 文件并想将其编译为 exe.我尝试了以下方法:
perl6 --target=MAST r.pl>r
现在我想将 r 编译为可执行文件
我发现这个链接谈论如何使用 Parrot 但我使用的是 MoarVM 目标:http://perlgeek.de/blog-en/perl-6/my-first-executable.writeback
我的问题是如何将 MoarvVM 目标文件编译为 Windows 可执行文件?
这门语言吸引我的一件事是它应该是可编译的,我想当然,它会为我构建 exe 文件",不幸的是,它没有(最后我检查过).
编译:
perl6 --target=mbc --output=test.moarvm -e 'say 42'
运行:
perl6 -e 'CompUnit::Loader.load-precompilation-file("test.moarvm".IO)'
但是,您可以在中间的 moarvm 机器上编译程序,请记住这不是可移植的,因此您必须在每个目标上重新编译.>
我认为这段代码是由在 irc 频道上真正了解 perl6 的人委托给我的,但我不明白它是如何工作的.
我建议您是否需要编译语言,等待编译器人员的真正支持,或者只是使用诸如 rust 或 golang 之类的东西(这是我最终使用的,我很高兴).
我知道 Rust 没有 Perl6 所具有的所有花里胡哨",但它完成了工作......
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 ?
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...
这篇关于如何将 perl6 文件编译为 exe的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!