// Group where all routes are added
table_t *table = inittable();
// Create customizable HTTP routes
createroute("GET", // HTTP method
"/home", // Resource route
&Homepage, // Function pointer
table); // Route group
// Fires the server engine forever
initservice(&parserequest, table, &executeroute, NULL);
Ptahka is brutally fast. Built from scratch using just plain C language and specially written functions on top of the most performant Windows NT4 networking API, you can truly expect the ultimate performance available on any machine.
High modularity in core aspects of a project often means easier tweaks, higher adaptability and consequently, more performance.
One of the two parts that composes Ptahka is Gobio, powering all low-level networking stuff, input and output strategy (further information here), multi-threading and the general socket behavior. Gobio benchmarks shows 3.87x more speed than NodeJS which relies on the same pillars when running on Windows, ouch!
The second part is Tinfin which contains useful specialized functions, for handling protocols of a higher level more intuitively.
The design patterns were inspired by very popular frameworks like Flask, Falcon (both written in Python) and NodeJS. Like those, Ptahka achitecture allows developers to rapidly prototype and build server solutions, from microservices to full-featured API's.
It was born modular since the whole framework is just two other smaller projects tied up with some magic dust. Gobio brings high-performance socket support and Tinfin specialized protocol handling. Feel free to modify both or even replace them.
Scalability is achieved thru the Makefile script available within the project. It is enough to automatically compiles any other source files (*.c) that small or medium projects could ever need, and may be even useful for big projects as well.
Written in pure and plain C99, Ptahka API can be easily extended by any other language that extend C language, like C++, D, Go, Rust, Python, Lua, NodeJS and so on, making the project reliable enough to become a solution anywhere.
The stability of the Winsock 2 API (which was first implemented for Windows 95) makes it perfect to be used on any Windows NT4 compatible (legacy ones included) project.
> git clone https://github.com/phtdacosta/ptahka.git
> cd ptahka
> make -B all
> main
The documentation is going to be written gradually, but enough information regarding the basic usage of the framework is already available in the main
file included.
Ptahka was created with community in mind. Giving developers a reliable option to create native and extremely performant server applications (also focused in productivity, simplicity and modularity) let us shape better our future solutions using stable and time-tested tools. Faster web applications means efficient energy use on data warehouses which leads to less overall energy consumption. Performance is sustainability. Think about that. (I will write something about this in the future!)
Feel free to do whatever you want with the code. Ptahka is open source and MIT licensed.
The whole project is maintained for just one person, so just-in-time support is almost impossible. But critical bugs and significant issues are going to be patched as soon as possible.
- Detailed documentation with advanced usage examples
- Make Ptahka less bug prone as possible without making it slower
- Further micro-optimizations and even broader machine support