An open API service indexing awesome lists of open source software.

https://github.com/chemicallang/chemical

High Performance Native Programming Language With Minimal Syntax
https://github.com/chemicallang/chemical

chemical compiler compilers javascript js-framework language llvm lsp-server programming-language tinycc

Last synced: about 1 month ago
JSON representation

High Performance Native Programming Language With Minimal Syntax

Awesome Lists containing this project

README

          



Chemical logo


The Chemical Programming Language

[Website](https://chemicallang.com)
| [Docs](https://chemicallang.github.io/learn-chemical)
| [Changelog](https://github.com/chemicallang/chemical/releases)
| [Speed](https://chemicallang.com/speed)
| [Contributing & compiler design](https://github.com/chemicallang/chemical/blob/main/CONTRIBUTING.md)

[![Sponsor][SponsorBadge]][SponsorUrl]
[![Patreon][PatreonBadge]][PatreonUrl]
[![Discord][DiscordBadge]][DiscordUrl]
[![X][XBadge]][XUrl]

## πŸš€ Overview

Chemical is an innovative, performant, type-safe, and user-friendly programming language with a low memory footprint. It comes with first-class tooling out of the box, all customizable by developers.

---

> [!IMPORTANT]
> Chemical is in pre-alpha state, expect breaking changes and do not use in production.

---

## βš™οΈ Installation

1. Download & Extract the latest ZIP from the [Releases](https://github.com/chemicallang/chemical/releases) page.
2. Inside the folder, run `./chemical --configure` or `./chemical.exe --configure`
3. Verify by running `chemical -v`

---

## 🌟 Features

- **Easy to Learn:** Master in under a week.
- **Great IDE Support:** LSP with syntax highlighting, completions, diagnostics, and more.
- **Compile-Time Evaluation:** Powerful `comptime` features.
- **Low Memory Footprint:** Tiny executables, no garbage collector.
- **Multiple Backends:** LLVM & C (both fully functional).
- **C Interop:** Translate between C & Chemical.
- **Flexible Build System:** Custom DSL for builds and modules.

---

## πŸ“Š Progress & Roadmap

| Component | Status |
|-------------------------------|----------------|
| Lexer, Parser, Sym Res | βœ… |
| Native Codegen (LLVM) | βœ… |
| C Translation & TCC JIT | βœ… |
| Basic Build System | βœ… |
| Basic Multi-threading | βœ… |
| Basic LSP | βœ… |
| Standard Library & Docs | πŸ”„ In Progress |
| Embedded Languages | πŸ”„ In Progress |
| Advanced LSP Support | πŸ”„ Planned |
| Memory Management & Safety | πŸ”„ Partial |
| Advanced Build System Support | πŸ”„ Planned |
| Comptime Features | πŸ”„ Planned |
| Compiler Plugins | πŸ”„ Planned |
| Mobile & Web Support | πŸ”„ Planned |

---

## πŸ“š Language Features

These features should give you an idea about features I have worked on

- C-like syntax with structs & namespaces
- Arrays, enums, unions
- Native lambdas (with capture)
- Macros & annotations
- Implicit & explicit casting
- Extension functions (like Kotlin)
- Raw pointers & memory control
- Full constructors & destructors
- Explicit copying (`.copy()` required)
- Comptime support & generics
- Overloading, variants, type aliases
- Trait & impl (Rust-like)
- Name mangling & conflict detection

---

## πŸ› οΈ Build (From Source)

### Requirements

- 8–16β€―GB RAM
- C++ toolchain (for LSP)
- LLVM (for compiler)
- CLion or other IDE

### Building Tiny CC Based Compiler Project (easy, fast)

1. Clone this repo
2. Inside the repo, run `./scripts/configure.sh` (on windows, git bash must be installed)
3. If you are not going to install llvm/clang/lld use -DBUILD_COMPILER=OFF when generating the project
- in CLion, Settings -> Build,Execution,Deployment -> Cmake -> Select CMake Profile put in Cmake Options -DBUILD_COMPILER=OFF
4. Open the repo in IDE (in CLion, you'll get automatic build configurations)

LSP also depends on Tiny CC Based Compiler Project and is built similarly

### Building LLVM Based Compiler Project (takes time)

1. Clone `chemical-bootstrap` repo in this organization (contains LLVM/CLANG)
2. Run build scripts (`./build.bat` / `./build`) (this builds LLVM)
3. Inside it, clone this repo
4. Open this repo directory in terminal
5. Run the configure script using `./scripts/configure.sh` (on windows, bash must be installed, usually comes with git)
6. Open the repo in CLion

#### LSP

1. For LSP: clone `chemical-vscode`.
2. There's a run configuration for compiling and launching extension
3. Build and Launch the LSP server before launching the extension, The extension detects running lsp executable at port automatically

*Open an issue for any build errors.*

---

# 🎯 Vision & Design Goals

## Compiler plugins and language extensions β€” Scalability

Chemical exists to let you embed complex, domain-specific syntax into the language via compiler plugins. Extensions are first-class: add new syntax and behaviors without touching the core. Tooling (syntax highlighting, editor parsing) must continue to work for extended syntax. Scalability and extensibility are part of Chemical’s DNA.

## Comprehensive features

Real projects frequently need features a language didn’t originally include. Chemical aims to provide the capabilities you actually need while avoiding β€œsyntax pollution.” Powerful, composable abstractions for library authors and power users come with sensible defaults and a gentle learning curve for beginners. The goal: lots of capability, minimal surprise.

## Memory safety β€” without the cost of simplicity

Long-term, Chemical will promote memory safety while keeping the language simple to use. Safety is a priority but not yet fully enforced β€” the initial focus is on core functionality and tooling. Once the core is stable, compiler-enforced safety checks will be added progressively; the beta compiler will enforce baseline safety guarantees.

---

## 🀝 Contributing

We welcome all contributions! See [CONTRIBUTING.md](https://github.com/chemicallang/chemical/blob/main/CONTRIBUTING.md) for guidelines.

---

## πŸ“„ License

Chemical compiler is MIT-licensed and will remain open source. Use it freelyβ€”credit is appreciated but not required.

---

[WorkflowBadge]: https://github.com/vlang/v/workflows/CI/badge.svg
[DiscordBadge]: https://img.shields.io/discord/1206227290359337062?label=Discord&logo=discord&logoColor=white
[PatreonBadge]: https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Dwakaztahir%26type%3Dpatrons&style=flat
[SponsorBadge]: https://img.shields.io/github/sponsors/wakaztahir?style=flat&logo=github&logoColor=white
[XBadge]: https://img.shields.io/badge/follow-%40qinetikorg-1DA1F2?logo=x&style=flat&logoColor=white

[WorkflowUrl]: https://github.com/chemicallang/chemical/commits/main
[DiscordUrl]: https://discord.gg/uYU4SV9avu
[PatreonUrl]: https://patreon.com/wakaztahir
[SponsorUrl]: https://github.com/sponsors/wakaztahir
[XUrl]: https://x.com/qinetikorg