ZEN CCommunity Edition

Ergonomia Moderna.
Zero Overhead.
Puro C.

Linguaggio con pattern matching.

$ git clone https://github.com/zenc-lang-ce/zenc.git
echo_server.zc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
import "std/net/tcp.zc"

fn main() {
    "Echo Server in ascolto su :8080";
    let listener = TcpListener::bind("127.0.0.1", 8080).unwrap();

    loop {
        // Accetta nuove connessioni
        let stream = listener.accept().unwrap();
        let buf: char[1024];
        
        while true {
            let n = stream.read(&buf[0], 1024).unwrap();
            if n == 0 { break; }
            stream.write(&buf[0], n);
        }
    }
}
PROGETTATO PER: GIOCHI • SOFTWARE AD ALTE PRESTAZIONI • SISTEMI EMBEDDED • SVILUPPO KERNEL

Compila

CLONA
git clone https://github.com/zenc-lang-ce/zenc.git
COMPILA
make
INSTALLA
sudo make install

Funziona con GCC!

Zero Attrito.

Trasparenza del C.

qualcuno_legge_davvero_questo.zc
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
struct Features {
    transparent_compilation: bool;
    native_c_abi:            bool;
    resource_management:     bool;
    monomorphization:        bool;
    pattern_matching:        bool;
    async_await:             bool;
}

impl Features {
    // Costruttore. Tutte le funzioni sono abilitate!
    fn new() -> Self {
        return Features{
            transparent_compilation: true,
            native_c_abi:            true,
            resource_management:     true,
            monomorphization:        true,
            pattern_matching:        true,
            async_await:             true,
        };
    }

    // Descrivi il linguaggio in una riga
    fn describe(self) {
        println "Ergonomia Moderna. Zero Overhead. Puro C.";
    }
}

fn main() {
    let zc = Features::new();
    zc.describe();
}
transparent_compilation

GNU C11.

native_c_abi

Zero FFI.

resource_management

No GC.

monomorphization

Generics zero overhead.

async_await

I/O asincrono.

pattern_matching

Pattern matching.

zero_cost_generics

No dispatch virtuale.

Poliglotta

Si adatta al tuo ecosistema.

CUDA

--cuda

GPU.

@global
fn add(a: float*, b: float*) {
    let i = thread_id();
    a[i] += b[i];
}

C++

--cpp

C++.

raw {
    std::vector<int> get_vec() {
        return {1, 2, 3};
    }
}

Objective-C

--objc

macOS.

raw {
    id pool = [[NSPool alloc] init];
    [pool drain];
}

Video

Guarda i tutorial.

Il Percorso

Roadmap.

0x00
Attuale

Core

  • Transpilazione C
  • Interop C++
  • RAII
  • Generics
  • LSP
0x10
Prossimamente

Ecosistema

  • Package Manager
  • Wasm
  • LSP Avanzato
  • std espansa
0x20
All'orizzonte

Semantica

  • async/await
  • comptime
  • Plugin
  • Compilatore
0x30
Destinazione

1.0

  • Specifiche
  • API Freeze
  • ABI
  • Kernel