Skip to content

Latest commit

 

History

108 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cara

A calmer, kinder web for the people who read and write it.

Cara is a small web browser built from scratch. It does not open normal websites, and it never will. Instead it shows its own kind of page, written in a simple format called Glyph. By skipping the thirty years of complexity behind today's web (HTML, CSS, JavaScript), Cara stays small enough for one person to understand completely.

Three small pieces, each doing one job:

  • Glyph is how you write a page. Four simple rules, no legacy quirks: you say what is on the page and how it should look.
  • Luau is a small, safe scripting language that makes pages interactive, like responding to a click.
  • Zig is the language Cara itself is written in, top to bottom.

There is no sprawling document model, no JavaScript engine, no tracking, and no app store. This is a browser, not the browser, and you could read the whole codebase in a weekend.

How it works

Cara runs as two separate programs that talk to each other:

  • The host handles everything that touches your computer: the window, the screen, the mouse and keyboard, the network, and saved files.
  • The renderer handles the page itself: it reads the Glyph file, works out where everything goes, and decides what to draw. Each site gets its own renderer, sealed off from the rest of your machine.

The renderer never draws to the screen directly. It writes down what each frame should look like (a plain list: a box here, some text there), and the host draws it. They share that list through a piece of memory both can read, and send short messages over a private channel. Splitting them apart and sealing the renderer in is the whole point: if a page goes wrong, or turns hostile, it cannot reach the rest of your computer.

What works today

On macOS, Cara already turns a Glyph page into a real, clickable window:

  • It reads a page you write (boxes, colors, text), lays it out, and draws it. None of it is hardcoded.
  • Text is drawn with a real font, properly sized and placed.
  • Boxes can be nested and stacked in different colors.
  • Clicks work. Cara figures out exactly which element you clicked, and finds the code meant to handle it (so clicking the text on a button counts as clicking the button).

What is not done yet

  • Pages cannot run scripts yet. A click finds the code that should handle it, but the Luau engine that would actually run that code is not connected. That is the next step.
  • No images, no network, no saved data.
  • The safety sandbox is designed but not switched on.

Build and run

Cara runs on macOS (Apple Silicon) today; Linux is planned, Windows is not. You need two things on your machine:

  • Zig, via anyzig. It reads the exact version from build.zig.zon and runs the matching Zig for you, so there is no version to pick.
  • Xcode Command Line Tools (xcode-select --install), for the macOS frameworks Cara links (Metal, QuartzCore, Cocoa, IOKit).

Then clone and build. Every dependency is fetched automatically on the first build, pinned in build.zig.zon: glfw (windowing) and Luau (scripting), both built from source, the wgpu-native GPU library, and FreeType. The font is bundled in the repo. There are no submodules and nothing else to download.

git clone https://codeberg.org/rootkill/cara.git
cd cara
zig build run     # build host + renderer, then run (the host spawns the renderer)
zig build         # build only
zig build test    # run the unit tests

Zig Mark

About

A browser that refuses to render the "current" web. This repository is mirror of https://codeberg.org/rootkill/cara

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages