Name Origin
Carton (/kɑːˈtɒn/) is an artist's portfolio case or art supply box - a container that holds all the essential tools and materials an artist needs for their work. Just as a carton organizes brushes, paints, and canvases for an artist, vize_carton organizes the fundamental utilities and data structures needed for the Vize compiler.
In the art world, a carton typically contains:
- Brushes & Tools - The instruments for creating
- Paints & Pigments - The raw materials
- Canvas preparation supplies - The foundation
Similarly, vize_carton provides:
- Arena Allocator - Efficient memory management for AST construction
- Shared Data Structures - Common types used across the compiler
- Utility Functions - Helper functions for string manipulation, tag validation, etc.
Features
Arena Allocation
High-performance arena-based memory allocation optimized for compiler workloads:
use ;
let allocator = default;
// Allocate values in the arena
let boxed = Boxnew_in;
let mut vec = Vecnew_in;
vec.push;
vec.push;
Shared Utilities
DOM Tag Configuration
use ;
assert!;
assert!;
assert!;
String Transformations
use ;
assert_eq!;
assert_eq!;
assert_eq!;
Optimization Flags
use ;
let flags = TEXT | CLASS;
assert!;
Part of the Vize Art Collection
vize_carton is part of the Vize compiler's art-themed crate collection:
| Crate | Art Term | Role |
|---|---|---|
| vize_carton | Carton (Portfolio Case) | Shared utilities & allocator |
| vize_relief | Relief (Sculpted Surface) | AST structures |
| vize_atelier_core | Armature (Sculpture Framework) | Parser & tokenizer |
| vize_atelier | Atelier (Artist's Studio) | Compilers |
| vize_vitrine | Vitrine (Display Case) | Bindings |
License
MIT License