Skip to content

Write PHP extensions without unending misery of C, macros and PHP build system.

Notifications You must be signed in to change notification settings

kaja47/phpmod.d

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

phpmod.d

Write PHP extensions without unending misery of C, macros and PHP build system.

Imagine a world where you can expose a native function to PHP by writing couple lines of D code just like this:

import phpmod;

mixin mod!(bitops);

long popcount(long x) {
  import core.bitop : popcnt;
  return popcnt(x);
}

Then compiling that tiny file by simple invocation of your favourite compiler:

gdc-14 -shared -fPIC -O2 -fpreview=all phpmod.d bitops.d -o bitops.so

And finally loading it:

php -d extension=./bitops.so

All that without ever touching everlasting horrors of C, wrestling with abysmal build system or being exposed to rancid guts of PHP virtual machine?

That world is possible. phpmod.d is the tool that do just that.

You write your code in a neat, expressive a performant native language and let all the garbage needed to interface with the PHP runtime be auto-generated during compilation.

About

Write PHP extensions without unending misery of C, macros and PHP build system.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published