https://github.com/beaver-lodge/charms
NIF, in Elixir, for Elixir
https://github.com/beaver-lodge/charms
compiler elixir
Last synced: 11 months ago
JSON representation
NIF, in Elixir, for Elixir
- Host: GitHub
- URL: https://github.com/beaver-lodge/charms
- Owner: beaver-lodge
- Created: 2024-05-17T11:59:37.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2025-07-26T06:08:14.000Z (11 months ago)
- Last Synced: 2025-07-26T12:09:06.248Z (11 months ago)
- Topics: compiler, elixir
- Language: Elixir
- Homepage:
- Size: 837 KB
- Stars: 32
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
[](https://livebook.dev/run?url=https%3A%2F%2Fhexdocs.pm%2Fcharms%2F0.1.1%2Fprogramming-with-charms.livemd)
# Charms
[](https://hex.pm/packages/charms) [](https://hexdocs.pm/charms)
Charms is an Elixir compiler that compiles a subset of Elixir to optimized native code using MLIR. It enables writing performance-critical Elixir code that gets compiled to efficient native binaries while maintaining Elixir's syntax and development workflow.
## Features
- [x] `defm` to define native functions, some examples
- [quick sort](/bench/enif_quick_sort.ex)
- [vector add](/bench/vec_add_int_list.ex)
- [x] Multi-threaded compilation, built upon Elixir processes and MLIR's multi-threaded capabilities
- [ ] SIMD support
- [ ] SIMT support
## Installation
If [available in Hex](https://hex.pm/docs/publish), the package can be installed
by adding `charms` to your list of dependencies in `mix.exs`:
```elixir
def deps do
[
{:charms, "~> 0.1.0"}
]
end
```
## Development
To run the benchmarks:
```sh
mix run bench/sort_benchmark.exs
mix run bench/list_add_benchmark.exs
```