Languages Features Creators Calendar CSV Resources Blog About Pricing Add Language
GitHub icon

Zephir

Zephir - Programming language

< >

Zephir is a programming language created in 2013 by Andres Gutierrez.

#200on PLDB 10Years Old 4.7kUsers
0Books 0Papers 91Repos

Zephir is a compiled high level language aimed to the creation of C-extensions for PHP.


Example from Linguist:
/** * CBLOCK tests * asfas */ %{ // top statement before namespace, add to after headers #define MAX_FACTOR 40 }% namespace Test; %{ // top statement before class, add to after headers // test include .h #include "kernel/require.h" }% %{ // c implement fibonacci static long fibonacci(long n) { if (n < 2) return n; else return fibonacci(n - 2) + fibonacci(n - 1); } }% class Cblock { public function testCblock1() { int a = 0; %{ a = MAX_FACTOR; }% return a; } public function testCblock2() { long a = 0; %{ a = fibonacci(MAX_FACTOR); }% return a; } }

Language features

Feature Supported Token Example
Integers ✓
// [0-9]+
Floats ✓
// [0-9][0-9]*\.[0-9]+([eE][0-9]+)?[fd]?
Hexadecimals ✓
// 0x[0-9a-fA-F]+
MultiLine Comments ✓ /* */
/* A comment
*/
Comments ✓
// A comment
Line Comments ✓ //
// A comment
Semantic Indentation X
nemerle.html · zephir.html · vala.html

View source

- Build the next great programming language · Search · v2023 · Day 208 · Docs · Acknowledgements · Traffic · Traffic Today · Mirrors · GitHub · feedback@pldb.com