ZEN CCommunity Edition
Ergonomia Moderna.
Zero Overhead.
C Puro.
Linguagem com 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 ouvindo em :8080";
let listener = TcpListener::bind("127.0.0.1", 8080).unwrap();
loop {
// Aceitar novas conexões
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);
}
}
}
PROJETADO PARA:
JOGOS
•
SOFTWARE DE ALTO DESEMPENHO
•
SISTEMAS EMBARCADOS
•
DESENVOLVIMENTO DE KERNEL
Compilar
CLONAR
git clone https://github.com/zenc-lang-ce/zenc.git
CONSTRUIR
make
INSTALAR
sudo make install
GCC/Clang!
Controle Máximo.
Transparência do C.
alguem_realmente_le_isso.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 {
// Construtor. Todos os recursos vêm ativados!
fn new() -> Self {
return Features{
transparent_compilation: true,
native_c_abi: true,
resource_management: true,
monomorphization: true,
pattern_matching: true,
async_await: true,
};
}
// Descreva a linguagem em uma linha
fn describe(self) {
println "Ergonomia Moderna. Zero Overhead. C Puro.";
}
}
fn main() {
let zc = Features::new();
zc.describe();
}
transparent_compilation
C11 limpo.
native_c_abi
Zero FFI.
resource_management
Sem GC.
monomorphization
Generics sem overhead.
async_await
E/S assíncrona.
pattern_matching
Pattern matching.
zero_cost_generics
Sem despacho virtual.
Poliglota
Adapta-se.
CUDA
--cudaGPU.
@global
fn add(a: float*, b: float*) {
let i = thread_id();
a[i] += b[i];
}
C++
--cppC++.
raw {
std::vector<int> get_vec() {
return {1, 2, 3};
}
}
Objective-C
--objcmacOS.
raw {
id pool = [[NSPool alloc] init];
[pool drain];
}
Vídeos
Assista tutoriais.
O Caminho
Roteiro.
0x00
Atual
Core
- Transpilação
- Interop C++
- RAII
- Generics
- LSP
0x10
Em breve
Ecossistema
- Package Manager
- Wasm
- LSP
- std expandida
0x20
Horizonte
Semântica
- async/await
- comptime
- Plugins
- Compilador
0x30
Destino
1.0
- Especificação
- API Freeze
- ABI
- Kernel