Goro is an implementation of PHP, written in pure Go (as much as possible, right now pcre doesn’t exist in pure go and require usage of libpcre). The project is at its very very early stages, and only parts of few extensions have been implemented and most of the core is missing.

But why a Go implementation of PHP ? Because “PHP is a nice language but is having trouble keeping up with modern languages.” indicates the project page in github. Obviously because PHP is becoming adult, 23yrs old already compared to Go, who’s still a 9 years old gradeschooler. 

Things this implementation is trying to achieve include :

  • Usage of goroutines, go channels, etc from within PHP
  • Better caching of compiled code by allowing sharing of compiled or live objects (classes, objects, etc) between running PHP scripts
  • Use Go’s memory management within PHP
  • Ability to run functions or code sandboxed (including filesystem) to limit security risks
  • Easily call the PHP engine from Go to execute pieces of PHP code (user provided or legacy)

The most interesting part in all of this, is not the crazy idea of rewriting PHP, or the big list of todo, but the author of this project Mark Karpelès (MagicalTux), bonjour ! Seems like Mark have moved from Bitcoin to PHP, especially that after the popular story of Mt. Gox, he pled not guilty to embezzlement and data manipulation charges.

There are already other implementations of PHP, and there is even a PHP bindings for the Go programming language named Go-PHP. A parser for PHP have been already written in Go four years ago by Stephen Searles however the project did not get any update since a year.

A lot of work is still needed, and writing extensions is very simple if you are familiar with Golang.

More information about Goro at https://github.com/MagicalTux/goro

つづく

LEAVE A REPLY

Please enter your comment!
Please enter your name here