Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add language: Tact, and extension to JSON #6689

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

novusnota
Copy link

@novusnota novusnota commented Jan 26, 2024

Adding a Tact programming language for .tact file extension and an extension to JSON under .tact. More about the former: https://tact-lang.org/

Description

Tact is a new programming language for TON blockchain smart contracts that is easy to use and has a familiar syntax, strong type system, gas control and zero-overhead type composition, which enables developers to write complex smart contract systems with verified execution costs.

Checklist:

  • I am adding a new language. — Tact

  • I am adding a new extension to a language. — JSON, but written under .tact format

    • The new extension is used in hundreds of repositories on GitHub.com
    • I have included a real-world usage sample for all extensions added in this PR:
    • I have included a change to the heuristics to distinguish my language from others using the same extension.

Additional info

In the search query I've excluded forks and some smaller JSON-like file format used by the specific haptics company, which happens to have the same file extension (not listed in languages.yml). However, I've done a bit of research and the JSON-like .tact format is just regular JSON, so I've added a heuristic to differentiate them and an extension of JSON with a sample JSON .tact file.

Currently, the former query gives approximately 1.9k rightful .tact files across a fair distribution of repositories, although still falling short of the 2k mark. Please, add the Pending Popularity label :)

On other note — in addition to the TextMate grammar submitted with this PR, the language as of now also has a complete and well-tested Tree-sitter grammar. Could you please help integrate it to GitHub once or when this PR gets merged?

@novusnota novusnota requested a review from a team as a code owner January 26, 2024 17:21
@lildude
Copy link
Member

lildude commented Jan 27, 2024

🤔 your search result suggests there are more non-Tact files than there are Tact files which means they're all going to be misidentified once this PR merged. In such cases we recommend both languages be identified and added in the same PR.

On other note — in addition to the TextMate grammar submitted with this PR, the language as of now also has a complete and well-tested Tree-sitter grammar. Could you please help integrate it to GitHub once or when this PR gets merged?

This is out of my control and is entirely up to the team that controls the highlighting engine. Given the low usage, this is unlikely to happen any time soon.

@novusnota
Copy link
Author

Got it, thanks for the clarification. I did some research on that non-Tact language and turns out it's just JSON. So I've added it as a new extension for JSON and also provided a heuristic to differentiate them, relevant test and samples. Hope it's done correct :)

@novusnota novusnota marked this pull request as draft June 25, 2024 16:58
@novusnota
Copy link
Author

novusnota commented Sep 27, 2024

With updated query path:*.tact NOT nothack NOT is:fork NOT user:tact-lang NOT /^\s*\{\"/, which uses the same regex to differentiate between Tact language and JSON stored under .tact, we're now at 2k+ files spread across GitHub, excluding forks and tact-lang org!

Also, I've changed the grammar source from tact-lang/tact-vscode to tact-lang/tact-sublime, since we keep the upstream one with all the related tests there.

cc @lildude

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants