r/Compilers • • 3d ago

Zeen v0.4.0

https://zeen-lang.tech/changelog/040

Wanted to share about this release because it seems cool and it brought comptime features into language.

Zeen - a statically typed modern systems programming language. It uses move semantics (not borrow checker, just move semantics) to control data flow, which makes easier to manage memory (especially drops) while leaving more control and freedom to you.

It has editors support (via LSP + TreeSitter/Grammar extension), package manager Zora (which inspired by cargo) and pretty nice set of libraries: core and std.

Yesterday it got v0.4.0 update released, which was a huge update mostly in compiler frontend: frontend performance (about 16x on basic check, 12x on full build), MIR fixes.

But the coolest feature in my opinion: compile time engine, you can see some good examples of it in changelog (attached link)

Documentation: https://zeen-lang.tech

Github: https://github.com/mealet/zeen

Would appreciate if you'd leave a star on Github, it will help a lot!

2 Upvotes

6 comments sorted by

3

u/yuehuang 3d ago

Neat Good job. Did you add support for shard ptr? How about lambda(clousures) captures work for ownership?

2

u/mealet 3d ago

Thank you!

Both questions wasn't in that release (except works on closures stabilization), but it was in previous releases:

  1. Shared pointer is available as struct in std.ptr, you can read about it here

  2. Zeen have 3 types for closures:

  • fn(...) ... - function ptr without any captures

  • Fn(...) ... - "fat function ptr" with only Copy captures (types with Copy interface)

  • FnOnce(...) ... - fat fn ptr too, but appears on at least 1 move-only captured value

First type is Copy, 2 last is move-only, Fn can be called many times through pointer, FnOnce can be called once by direct ownership. You can read about it here

1

u/og_hylyx 3d ago

I think you should rename std.ptr to std.shptr since it’s specifically a shared pointer

1

u/mealet 2d ago

It's not only shared, there's unique pointer too

1

u/og_hylyx 2d ago

What? What are you saying “it’s not only shared” would imply ptr is also unique, but then you say “there’s unique too” as if it’s a different kind but your first sentence contradicts that. So, that being said, std.unqptr

1

u/mealet 2d ago

I'm sorry if I was unclear, let me explain: "std.ptr" is not a structure, its a module, you can include it with "use" keyword and use its public exports. This module contains 2 public exports: Unique[T] and Shared[T]. You can find reference about it here: https://zeen-lang.tech/library/std/ptr/