mirror of
https://github.com/kanaka/mal.git
synced 2024-10-27 14:52:16 +03:00
c9f7b5a1f8
Explictly select python 3. The `python2` and `python` packages will be removed from Ubuntu. Until each call site is fixed, install a /usr/local/bin/python symbolic link as a non-intrusive work-around (.deb packages do not interfer with /usr/local). Add an explicit maintainer for bbc-basic. Undo some cosmetic changes in order to reduce the global diff, this merge request will probably be sqashed before acceptance. Move lib{readline,edit}-dev out of the generic part. Use existing .deb packages for GHDL and vim. |
||
---|---|---|
.. | ||
tests | ||
core.php | ||
Dockerfile | ||
env.php | ||
interop.php | ||
Makefile | ||
printer.php | ||
reader.php | ||
readline.php | ||
README.md | ||
run | ||
step0_repl.php | ||
step1_read_print.php | ||
step2_eval.php | ||
step3_env.php | ||
step4_if_fn_do.php | ||
step5_tco.php | ||
step6_file.php | ||
step7_quote.php | ||
step8_macros.php | ||
step9_try.php | ||
stepA_mal.php | ||
types.php | ||
webrunner.php |
Running .mal scripts on PHP hosting
Create a symlink to mal-web.php
with the same name as your .mal
script and your script will be executed as if it was PHP.
Here's an example using local dev.
First build mal-web.php
:
cd mal/php
make mal-web.php
Now you can create a web runnable mal script:
echo '(println "Hello world!")' > myscript.mal
ln -s mal-web.php myscript.php
Start a development server with php -S 0.0.0.0:8000
and then browse to http://localhost:8000/myscript.php and you should see "Hello world!" in your browser as myscript.mal
is run.
You can do the same thing on live PHP web hosting by copying mal.php
up and creating a symlink for each .mal
file you want to be web-executable.
PHP interop
In stepA_mal.mal you can find some examples of PHP interop.
Eval PHP code:
(php* "return 7;")
7
(php* "return array(7,8,9);")
(7 8 9)
Native function call:
(php/date "Y-m-d" 0)
"1970-01-01"
Accessing PHP "superglobal" variables:
(get php/_SERVER "PHP_SELF")
"./mal"