Carp Programming Language
carp-lang.github.io
2
Leaving SiteNav
External Link Disclaimer
You are about to visit carp-lang.github.io. This website is not operated by us. We are not responsible for its content or privacy practices.
About this website
Carp is a statically typed, semi-functional programming language designed for interactive use, combining the performance of C with the safety and expressiveness of modern functional languages. Created by Erik Svedang in 2016 (inspired by the Lisp family and Clojure), Carp aims to provide a smooth game development experience with a live REPL, no garbage collection, and automatic memory management through ownership tracking. Key features: static typing with a Hindley-Milner-style type system, ensuring type safety at compile time while inferring most types automatically. Ownership-based memory management: no garbage collector; instead, Carp tracks linear types (ownership) at compile time to determine when memory should be freed, providing deterministic memory management without runtime overhead. Lisp syntax: S-expression syntax with prefix notation, macros, and metaprogramming capabilities similar to Clojure and Scheme. REPL (Read-Eval-Print Loop): interactive development with live code reloading, enabling rapid iteration during game development without recompilation. C interop: seamless integration with C libraries and code, with automatic generation of C bindings. Output: compiles to C code, which is then compiled to native machine code using clang or gcc, providing C-level performance. Game development focus: built-in support for graphics (SDL2), audio, input handling, and game loop management via the active library. Immutable data by default: variables are immutable unless explicitly marked as mutable, reducing side effects. Polymorphism via interfaces (type classes). Modules and project management. Pattern matching. Dynamic binding for hot-reloadable global state. Macros for compile-time code generation. Cross-platform: Linux, macOS, Windows. Small standard library focused on game development primitives (math, vectors, geometry, color). Version 0.5.x. Open source under Apache-2.0.
Statistics
2
Views
0
Clicks
0
Like
0
Dislike