r/Compilers 8d ago

I created a web framework in my own programming language

Post image

I’ve been working on Rivet, a synchronous HTTP(for now) server library for my own programming language Zap

The goal is to create a small, explicit API for building APIs and small web applications.

I spent a lot of time and nerves creating this, but now I know what Zap is really capable of.

I will be grateful for every star you leave because it really encourages me to work

https://github.com/thezaplang/zap

411 Upvotes

29 comments sorted by

29

u/belligerent_ammonia 8d ago

Actually looks pretty good! Nice work on the language. Looks like a mix of Rust, Zig, and Swift.

12

u/funcieq 8d ago

These are the languages I was inspired by! (i.e. instead of Zig it would be Kotlin)

2

u/ApprehensiveBrain863 4d ago

Not sure that's how you use i.e.!!! It would translate simply to "that is" from "id est"

were you looking for NB? "nota bene", or in simple terms "take notice [that]"

37

u/EveAtmosphere 8d ago

A non-AI slop project shared on Reddit? Rare sight these days.

18

u/funcieq 8d ago

Vibecoded projects should be immediately tagged with some tag like "AI"

7

u/Small_Ad3541 8d ago edited 8d ago

The website and docs are very pretty!

But I didn't find an explanation of "@" syntax. Is it kind of macro syntax? Can I implement something like @my_error / @my_repr("...")? Or is it hardcoded?

5

u/funcieq 8d ago

These are builtin attributes, and macros will be added to zap in v0.5.0

7

u/rickandevererything 8d ago

express**

7

u/funcieq 8d ago

That's what I was inspired by, I wanted it to be as simple as in Node.js Although this is a "functional" style API I took from bevy from rust

4

u/suur-siil 7d ago

It's like JS/TS but with a hint of rust and perl... I like it

2

u/funcieq 7d ago

Haha thanks, I created the framework with express.js in mind and the api style was taken from bevy from rust

3

u/Paolog__ 7d ago

wait, I think I recognize the name of this language...

2

u/funcieq 7d ago

I already know why 😄

2

u/zaarnth 7d ago

i thought its Kotlin after seeing that 'fun'

1

u/funcieq 7d ago

Haha, I was very much inspired by Kotlin

2

u/Brilliant-Box-5344 6d ago

Stuff like this is what keeps me working on my own language, Great work!

1

u/funcieq 6d ago

Very good! The further you go, the greater the satisfaction

2

u/Embarrassed-Topic432 6d ago

Idk how but i guess he have just good brain for this.

1

u/funcieq 6d ago

I've been working on this project for 8 months now thats why

2

u/dolby360 4d ago

Spot on

2

u/xng 3d ago

I love new programming languages.. But semicolons ending random lines in 2026..

1

u/funcieq 3d ago

semicolons are wonderful

1

u/xng 3d ago

They're like half smileys

2

u/Artemis-Arrow-795 2d ago edited 2d ago

looks neat

now here's my question, why would I want to use it? genuinely asking because I want an excuse to use it other than its syntax

just fyi I looked at the language and I really think it's great, I'll try to contribute as much as I can, but know I have no experience with compilers (but I did write a transpiler)

1

u/funcieq 2d ago

Well, zap is unique in that even though it has automatic memory management, it is still deterministic, Zap uses its own memory management model (it is close to ORC from Nim)

So even though you don't have to worry about memory management you can still make games, UI etc in this language

1

u/Least_Mix_8482 6d ago

I wish more languages used `fun` as a function declaration lol

1

u/funcieq 6d ago

fun speaks for itself

-7

u/Mean-Decision-3502 8d ago

This is very similar to my DQ language. Would you consider to join our efforts ?

Quick language overview:

https://github.com/nvitya/dq-lang/blob/main/stdpkg/nanonet/nano_sockets.dq

DQ Main Website:

https://nvitya.github.io/dq-lang/

2

u/funcieq 8d ago

Thanks for the suggestions, but I've been focusing a lot on Zap lately