Esta página se muestra en inglés. Una traducción al español está en curso.
ConfigsJul 21, 2026·3 min de lectura

Janet — Lightweight Embeddable Programming Language

A functional and imperative Lisp dialect designed for embedding, scripting, system automation, and rapid prototyping with a tiny footprint.

Listo para agents

Instalación lista para agent

Este activo puede instalarse después de elegir el runtime, revisar el plan y ejecutar el comando correspondiente.

Native · 98/100Política: permitir
Superficie agent
Cualquier agent MCP/CLI
Tipo
Skill
Instalación
Single
Confianza
Confianza: Established
Entrada
Janet Overview
Comando de instalación directa
npx -y tokrepo@latest install b2d4d7b0-84e1-11f1-9bc6-00163e2b0d79 --target codex

Ejecutar después de confirmar el plan con dry-run.

Introduction

Janet is a small, portable, dynamically typed programming language inspired by Clojure, Lua, and Python. It is designed for embedding into C/C++ applications, writing build scripts, system automation, and rapid prototyping. The entire runtime compiles to a single C file with no external dependencies.

What Janet Does

  • Provides a Lisp-like language with familiar syntax for functional and imperative programming
  • Embeds into C/C++ applications as a single-file library with a clean C API
  • Includes a built-in module system, package manager (jpm), and PEG-based parser combinator
  • Offers fibers and channels for lightweight concurrency without OS threads
  • Compiles scripts to bytecode for faster loading and optional ahead-of-time compilation

Architecture Overview

Janet compiles source code into bytecode that runs on a custom register-based virtual machine written in ANSI C. The runtime includes a mark-and-sweep garbage collector, a module loader, and an event loop for asynchronous I/O. The entire core is a single C file (~15K lines) with no dependencies beyond libc, making cross-compilation and embedding straightforward.

Self-Hosting & Configuration

  • Install via Homebrew, package managers, or compile from source with make && sudo make install
  • Use jpm (Janet Project Manager) to manage dependencies and build projects
  • Embed by including janet.c and janet.h in your C project — no separate library needed
  • Configure the module search path via JANET_PATH environment variable
  • Pre-compile scripts to images with janet -c script.janet script.jimage for faster startup

Key Features

  • Tiny runtime (~300 KB binary) suitable for resource-constrained environments
  • PEG module for parsing grammars directly in Janet without external parser generators
  • First-class fibers enabling cooperative multitasking and coroutine-based workflows
  • Built-in networking, file I/O, and OS interaction for system scripting
  • Comprehensive standard library covering data structures, regex, JSON, and more

Comparison with Similar Tools

  • Lua — Similar embedding niche; Janet offers richer data structures and a more modern standard library
  • Guile/Scheme — More traditional Lisp; Janet is smaller and simpler to embed
  • Python — Larger ecosystem; Janet is 100x smaller for embedding use cases
  • Fennel — Lisp that transpiles to Lua; Janet has its own VM and does not depend on Lua

FAQ

Q: Is Janet a Lisp? A: Janet is Lisp-inspired with s-expression syntax but adds features from Clojure and Python. It uses brackets for arrays and braces for tables.

Q: How do I add packages? A: Use jpm install package-name. Packages are listed in the Janet package index.

Q: Can Janet replace Lua for game scripting? A: Yes. Janet's embedding API is similar to Lua's, and several game projects use Janet for scripting.

Q: What platforms does Janet support? A: Janet runs on Linux, macOS, Windows, BSDs, and has been ported to embedded systems and WebAssembly.

Sources

Discusión

Inicia sesión para unirte a la discusión.
Aún no hay comentarios. Sé el primero en compartir tus ideas.

Activos relacionados