• Author: Katacc
  • Date: 2026-10-14
  • Description: "Zettp"

  • Zettp, a webserver and a templating system

    I have been working on a project called Zettp, it is actually what this whole blog have been hosted on. It is a http server, a templating system and a static site generator bundled into a zettp-all project, that acts as a web framework without JavaScript.

    Zettp on git

    Why

    Because I do not think JavaScript is the silver bullet for all web applications. JavaScript ecosystem has one glaring issue, the huge dependency chains. Lot's of vulnerabilities slip by and affect lots of websites contantly. Also I do think that it takes way too much enegy to run all the node servers in the world running completely useless JavaScript code just to make some things look a bit better, when it could have been a static site or static site with some basic templating.

    That is what I set out to fix for myself. A simple, extensible framework that operates completely with native code. I was also in need of a project for myself, so what better way to tackle some environmental issues at the same time!

    Language?

    The language the core http server, zettp is written is Zig, and the templating system uses really zig like syntax. Kani, which is the static site generator, has been written in C

    I love both languages and I could not choose one, so I decided to use them both in the project.

    A look at the syntax

    The templating syntax is really zig like, it consists of "blocks" or "nodes" that can have conditional- or looping properties. An example of this from this very blog:
    ```html

    %%
    if (blog_posts) {
    for (blog_posts) |post| {
    ${post.name} - ${post.date}
    }
    } else {

    No posts yet :(


    }

    Author: ${author}


    %%

    ```
    All template blocks starts and ends with %% symbol sequence. And inside this "block" we can write our templating logic. It accepts the zig like if-else statements and for-each loops. Ofcourse you can write normal html inside aswell.

    Shortcomings

    Ofcourse this project is not perfect. You cannot do reactivity the same way you could do with React or similar tools but those tools require the heavy garbage collected node runtime. Ofcourse you can do scripts and things can happen on page load. And you can use Zig's async to aid you in this.

    Also an upcoming feature is accepting of url parameters by default.

    First touch on writing bigger project in Zig

    This is actually my first bigger project written in zig. And till now, the experience has been really enjoyable. The project has teached me many things, and just recently I got around to figure out that I was using possibly leaking memory allocator, the arena allocator, which I changed today to general purpose allocator for more control on the memory allocations. (connections still use arena allocators for a good reason!);

    Next steps

    I will continue on improving zettp, I need to make some improvements on the static site generation side, it is not yet perfect and is missing some important features.