简体   繁体   中英

Are there any low-level languages that can be used in place of scripts?

I am a "high-level" scripting guy. All my code is Class-based PHP or JavaScript. However, I want to know if there is any form of useful interpreter projects for "low-level" compiled languages like C or C++ (strange sounding huh?).

This all came about when I stumbled upon http://g-wan.com/ and was fascinated by the fact that you could setup C code to run as server scripts. However, that project is all but useless because it is run by one guy and is closed source.

So, is there anything out there for "low-level" languages that would enable them to be easier to run by compiling them at runtime. OR is this just a bad accident waiting to happen which explains why that was the only project I could find about this?

Being able to dump PHP/Ruby/Python for C scripts would really speed up our sites.

Im not sure I understand what you want to achieve, but tcc (tiny c compiler) allows you to run C programs as scripts.

http://linux.die.net/man/1/tcc

TCC can be invoked from scripts, just as shell scripts. You just need to add "#!/usr/local/bin/tcc -run" at the start of your C source:

#!/usr/local/bin/tcc -run
#include <stdio.h>

int main()
{
    printf("Hello World\n");
    return 0;
}

I recently stumbled upon something called BinaryPHP in which you code normally in php and then convert the script into C++ to be compiled on your favorite tool. That should be a nice learning curve for someone already in touch with php.

There are products like Beanshell for Java. They aren't intended to replace scripting languages but instead to allow an easy unit testing and debug capability to an existing language. In my opinion you should use a language for what it was designed for.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM