vize_carton

Crates.iovize_carton
lib.rsvize_carton
version0.0.1-alpha.31
created_at2026-01-11 14:27:41.357877+00
updated_at2026-01-12 12:37:44.097626+00
descriptionCarton - The artist's toolbox for Vize compiler
homepage
repositoryhttps://github.com/ubugeeei/vize
max_upload_size
id2035876
size108,466
ubugeeei (ubugeeei)

documentation

README

vize_carton logo

vize_carton

The artist's toolbox for Vize compiler


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 vize_carton::{Allocator, Box, Vec};

let allocator = Allocator::default();

// Allocate values in the arena
let boxed = Box::new_in(42, allocator.as_bump());
let mut vec = Vec::new_in(allocator.as_bump());
vec.push(1);
vec.push(2);

Shared Utilities

DOM Tag Configuration

use vize_carton::{is_html_tag, is_svg_tag, is_void_tag};

assert!(is_html_tag("div"));
assert!(is_svg_tag("path"));
assert!(is_void_tag("br"));

String Transformations

use vize_carton::{camelize, hyphenate, capitalize};

assert_eq!(camelize("foo-bar"), "fooBar");
assert_eq!(hyphenate("fooBar"), "foo-bar");
assert_eq!(capitalize("hello"), "Hello");

Optimization Flags

use vize_carton::{PatchFlags, ShapeFlags, SlotFlags};

let flags = PatchFlags::TEXT | PatchFlags::CLASS;
assert!(flags.contains(PatchFlags::TEXT));

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

Commit count: 135

cargo fmt