Comments (5)
Hi! Trying out syncat
for the first time, and getting it to build and run on nix / NixOS. (That was actually quite easy!) I've only used it a little so far but it seems awesome!
More suggestions for the package management:
For Nix users
Allow using a build-time env var to dictate where tree-sitter parsers should be loaded from, so Nix users can install the treesitter parsers with Nix. The Nix module/flake for syncat
could build a default set of parsers, and let you override the list by passing in the parsers' nix packages. 🤔
For non-Nix users
- Change the default path for tree-sitter parser installs to
$XDG_STATE_HOME/syncat
(see XDG_STATE_HOME) -$XDG_CONFIG_HOME
isn't the best place for installing compiled binaries - Use
git clone --depth 1
to avoid gigabytes of git history from the various parsers' repositories (tree-sitter-ocaml
's.git
folder is 2.6G) - Don't clone
tree-sitter-ocaml
recursively, if possible--it has 19 submodules, and they all get cloned intoexamples/
so (I presume) they aren't required
Thanks for making this project!
from syncat.
Allow using a build-time env var to dictate where tree-sitter parsers should be loaded from
This sounds like a great idea, unrelated to Nix at all. Even a runtime env var would likely work just fine? As the parsers are dynamically linked/loaded anyway, they can be located at runtime from anywhere. Though I know nothing about how Nix works, maybe that's not going to work for you guys, you'd have to tell me on that one!
Considering some possible approaches:
- Env var to specify the folder in which to find languages
- Env var specifying an override for the languages.toml config file, which can then point to parser folders directly (by absolute or relative path)
- Allow specifying override env variables/command line flags to override any setting of a languages.toml entry on the fly (e.g. for one off/testing a parser use cases)
Thanks for the suggestions :)
from syncat.
Have implemented some of your suggestions in 3.7.0:
- There is a new command line argument
-c/--config
which allows specifying the directory in which to find configuration files. Would be possible to make this into an environment variable later on, but that can wait, since this behaviour is easily adaptable using aliases or something yourself - I removed
--recursive
from the default clone args, and nowclone_args
andpull_args
are options that can be specified in the languages.toml file. I tried to see if--depth 1
would work for the default, but it seems when you shallow clone a repository, then pulling becomes hard/impossible in the naive case, so I could not make this the default... you're welcome to specifyclone_args = ["--depth", "1"]
on ocaml yourself in the config now though, but it'll then be up to you to manually update the repository (or justsyncat remove ocaml; syncat install ocaml
) to update it, since the pull command won't work. - (Admittedly didn't really test this part but) in theory should be possible to set the
library
field of the language inlanguages.toml
to an absolute path, if you prefer your languages installed intoXDG_STATE_HOME
instead ofXDG_CONFIG_HOME
. A bit manual of a task now, to change that for your own config file, but I may change the default for this in future (I'll check up on that link you linked!)
from syncat.
Oh, that's awesome, thank you!! 🚀 I wasn't considering the update (git pull) case for the packages, so a full clone does make sense. For Nix use, Nix would manage installing (and thus "upgrading") the tree-sitter parsers. It looks like Syncat's install command builds an object file in each parser directory (for interop with Syncat, I presume), so that will need to be part of the Nix build. I think I'll be able to build a decent Nix flake for Syncat... 🤔
from syncat.
Yes I think if the tree sitter binaries are compiled the way syncat needs them, it will work... if nix is already generating that file (just with a different name/location) it does seem reasonable to allow overriding the name of the file in the languages.toml file as well so that it can be located from anywhere, if that helps at all.
from syncat.
Related Issues (10)
- Unsure how it compares to Bat HOT 2
- Provide pre-compiled binaries HOT 1
- Option to generate a tree-sitter grammar when installing
- Benchmarks?
- miss LICENSE
- Provide default setting HOT 5
- Attempt to generate some stylesheets from nvim treesitter files HOT 6
- Spellcheck
- syncat unsupported architecture error on m1 mac HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from syncat.