Compile Rebol code to executable

旧时模样 提交于 2020-01-16 09:11:31

问题


I downloaded Rebol/View (vesion 2.7.8) Linux x86 libc6 2.3 version from http://www.rebol.com/downloads.html and it is working all right as an interpreter on Linux (Debian Stable 9). Is it possible to compile the code to executables? I tried checking the options, and compile to executable option does not seem to be there:

$ rebol -v --help
The command line usage is:

    REBOL <options> <script> <arguments>

All fields are optional. Supported options are:

    --cgi (-c)       Check for CGI input
    --do expr        Evaluate expression
    --link url       Connect to Link
    --help (-?)      Display this usage information
    --nowindow (-w)  Do not open a window
    --noinstall (-i) Do not install (Link, View)
    --quiet (-q)     Don't print banners
    --reinstall (+i) Force an install (Link, View)
    --script file    Explicitly specify script
    --secure level   Set security: allow ask throw quit
    --trace (-t)     Enable trace mode
    --uninstall (-u) Uninstall REBOL (Link, View)
    --version tuple  Minimum version of script, when URL (View)
    --noviewtop (-v) Do not start viewtop (view desktop)

Special command line options:

    +q               Force not quiet (Link, View)
    -s               No security
    +s               Full security
    -- args          Provide args without a script

Examples:

    REBOL script.r
    REBOL -s script.r
    REBOL script.r 10:30 test@domain.dom
    REBOL --do "verbose: true" script.r
    REBOL -cswq
    REBOL --cgi --secure throw --script cgi.r "debug: true"
    REBOL --version 1.2.3 http://www.rebol.net/test.r ; view only

Can I compile Rebol code to executable code on Linux/Windows? Thanks for your help.


回答1:


Rebol/View can be packed with the interpreter using a product called Encap which was available from Rebol Technologies. I don't know if they still sell this, or even if the company still exists.

Red, a Rebol 2 clone with an enhanced GUI, can compile to binary as far as I know.

Ren-c, a Rebol3 derivative, can be compiled from C source so you can compile in any code you want. However, there is no GUI support at present though one branch in planning to add this.




回答2:


In theory there should be a commercial SDK for Rebol available that bundles the interpreter with your script to one file, no native compiler.

Red uses Rebol to compile Red and Red/System for all supported platforms (Windows, Linux, Mac, Android etc), even crosscompiling. The compiler is included in the stable builds and automated builds. How to compile see the README and also RedEd



来源:https://stackoverflow.com/questions/46210235/compile-rebol-code-to-executable

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