tree-sitter-python icon indicating copy to clipboard operation
tree-sitter-python copied to clipboard

Swift Package Manager & C Bindings including Makefile

Open lukepistrol opened this issue 3 years ago • 1 comments
trafficstars

Swift Package Manager

Swift's package manager can build C/C++ sources and use headers to expose functions to Swift. The standard tree-sitter parser project layout just requires a little extra configuration to make it happy.

Grammars with SPM support to this date:

  • https://github.com/tree-sitter/tree-sitter-javascript
  • https://github.com/tree-sitter/tree-sitter-php
  • https://github.com/tree-sitter/tree-sitter-c
  • https://github.com/tree-sitter/tree-sitter-java
  • https://github.com/tree-sitter/tree-sitter-rust

C Bindings & Makefile

This change adds a Makefile and bindings to more easily build static/dynamic libraries for use in C-based languages. The implementation is intended to be as generic as possible, to make for easier adoption and diffing.

This comes from discussion in the main tree-sitter repo https://github.com/tree-sitter/tree-sitter/issues/1488.

lukepistrol avatar May 30 '22 12:05 lukepistrol

@maxbrunsfeld Sorry to be a bother, but how's this one looking?

mattmassicotte avatar Sep 06 '22 10:09 mattmassicotte

Is there anything that's holding this up?

lukepistrol avatar Oct 29 '22 14:10 lukepistrol

@tausbn Is this something that you all are looking at doing? I would love to help get this merged or answer any questions as adding SPM supports allows the swift community to also use it.

bombardier200 avatar Jun 28 '23 13:06 bombardier200

hey @aryx can you look at this one for python?

bombardier200 avatar Jun 29 '23 13:06 bombardier200

imo the swift bindings are fine but the Makefile is a bit unnecessary

amaanq avatar Jun 29 '23 13:06 amaanq

I have no objections to removing the Makefile. It does make it much easier to use the parser from C, but most C clients have long-since come up with their own non-standardized solutions. Should anyone ever take up this task again, it could be done in a separate PR.

mattmassicotte avatar Jun 29 '23 14:06 mattmassicotte

@amaanq Luke should have fixed everything that you requested, could you review this and make sure everything looks good to you?

bombardier200 avatar Jul 10 '23 17:07 bombardier200

@amaanq Luke should have fixed everything that you requested, could you review this and make sure everything looks good to you?

One more thing, just the changes to the gitignore aren't needed now

amaanq avatar Jul 10 '23 21:07 amaanq