chr15m / frock

Clojure-flavoured PHP

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Frock is Clojure-flavoured PHP.

"If you want to produce free-as-in-whatever code that runs on virtually every server in the world with zero friction or configuration hassles, PHP is damn near your only option. If that doesn't scare you, then check your pulse, because you might be dead." Jeff Atwood, 2012

Get

curl https://chr15m.github.io/frock/frock.php > frock.php
chmod 700 frock.php

Use

$ echo '(println "hello world!")' > hello.clj
$ ./frock.php hello.clj > hello.php
$ php hello.php
hello world!

Then php -S 0.0.0.0:8000 & browse to http://localhost:8000/hello.php.

Examples & tutorial

See the examples folder and the tutorial folder.

Security

Please see this note about security.

About

  • In case it's not obvious, this is a hack and probably shouldn't be used in production.
  • This is only superficially Clojure. Most things won't work.
  • PRs most welcome.

Most of the code here comes from the Make-a-LISP project. The project and the PHP port were both built by Kanaka.

The only original thing this repository brings is a system for building mal-php code into a distributable artifact.

Why?

https://chr15m.github.io/frock-clojure-flavoured-php.html

Frock might be interesting to you if:

  • You want to build a single artifact that almost anybody can upload to commodity hosting.
  • You need some minimal server side code to support your front-end web application.
  • You find PHP's syntax onerous but enjoy wrangling LISP braces.

Caveats & limitations

Too many to list here. 😂

About

Clojure-flavoured PHP


Languages

Language:PHP 87.1%Language:Clojure 9.8%Language:Makefile 3.1%