https://github.com/polyvariant/treesitter4s
WORK IN PROGRESS
https://github.com/polyvariant/treesitter4s
Last synced: about 1 month ago
JSON representation
WORK IN PROGRESS
- Host: GitHub
- URL: https://github.com/polyvariant/treesitter4s
- Owner: polyvariant
- License: other
- Created: 2022-08-22T19:08:38.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-12-24T20:39:31.000Z (about 1 year ago)
- Last Synced: 2025-04-11T12:42:10.275Z (11 months ago)
- Language: Scala
- Homepage:
- Size: 8.28 MB
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# treesitter4s
Tree-sitter wrapper for Scala (JVM). Uses JNA to wrap the native library.
## Usage
# Work in progress note
This project is still in the oven and under active development.
Don't assume anything will work or that anything will stay as it is right now.
Feel free to try it if that's okay with you ;)
```scala
libraryDependencies ++= Seq(
// Pure Scala interface - cross-compiled for JVM & JS platforms
"org.polyvariant.treesitter4s" %% "core" % version,
// Bindings for the JVM artifact. Brings in JNA and the native library.
// You probably want to use this one.
"org.polyvariant.treesitter4s" %% "bindings" % version,
// Language support for a specific language.
// There's active work to split these out to separate artifacts.
// "org.polyvariant.treesitter4s" %% "language-scala" % version,
// "org.polyvariant.treesitter4s" %% "language-python" % version,
)
```
## Goals
- **immutable**, read-only, Scala-friendly API
- complete, 1-1 native/Java interface via [JNA](https://github.com/java-native-access/jna)
- binary convenience: no dealing with native libraries if you're on a supported system
- extensible language support
## Supported systems
Support can vary, but the following platforms are considered supported:
- macOS x86_64
- macOS aarch64
- Linux x86_64
- Linux aarch64
CI runs on x86_64 macOS/Linux machines. Development is currently done on an aarch64 Mac.
linux-aarch64 binaries are included thanks to the magic of [Nix](https://nixos.org/) and [Nixbuild](https://nixbuild.net/), but the library isn't being tested on that platform because GitHub doesn't offer runners for it yet ([there's hope](https://github.blog/news-insights/product-news/arm64-on-github-actions-powering-faster-more-efficient-build-systems/)).