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

Use c++17 for non-c files #64

Closed
wants to merge 1 commit into from
Closed

Conversation

aksh-at
Copy link

@aksh-at aksh-at commented Apr 4, 2021

https://github.com/tree-sitter/tree-sitter-haskell uses c++17 language features, so needs to be built with that flag.

Test output:

...........
----------------------------------------------------------------------
Ran 11 tests in 0.012s

OK

@lunixbochs
Copy link
Collaborator

Blocking this on tree-sitter/tree-sitter-haskell#38 for Windows support in CI

@ahelwer
Copy link

ahelwer commented Aug 25, 2021

Don't C++17 features mean commands like tree-sitter test and tree-sitter parse won't work on macOS? ref tree-sitter/tree-sitter#1246

@lunixbochs
Copy link
Collaborator

Probably. I think I mentioned in the Haskell thread, tree sitter probably needs a better standardized approach to building C++ parsers.

@maxbrunsfeld
Copy link
Contributor

This is no longer needed for tree-sitter-haskell, as that external scanner has been rewritten in plain C.

@lunixbochs
Copy link
Collaborator

ah perfect. let me get the test-haskell branch up to date with that then close this PR, this issue is where I got stuck previously

@lunixbochs lunixbochs self-assigned this Jan 19, 2022
@lunixbochs
Copy link
Collaborator

Haskell looks to be failing on Windows Python 3.5 runner even with the new C parser: https://github.com/tree-sitter/py-tree-sitter/runs/5104795690?check_suite_focus=true

@narpfel
Copy link
Contributor

narpfel commented Feb 8, 2022

The Haskell scanner uses restrict, which MSVC only supports in C11 or C17 mode (and not the weird C89+extensions that is the default), but py-tree-sitter compiles .c files without flags on Windows.

@dneto0
Copy link

dneto0 commented Feb 2, 2023

I would like to see this change land.

On macOS, when trying to compile 'scanner.cc', the /usr/bin/cc compiler is invoked.
That is:

$ cc --version
Apple clang version 13.1.6 (clang-1316.0.21.2.5)
Target: x86_64-apple-darwin22.3.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

And this compiler defaults to not supporting C++ at all.

My particular example scanner.cc uses C++17 features, so this patch would be ideal.

@dneto0
Copy link

dneto0 commented Feb 2, 2023

Alternately, it would be sufficient to be able to pass compiler flags down through the interface.

@amaanq
Copy link
Member

amaanq commented Aug 25, 2023

Haskell's scanner is now back in C, and no we do not want to encourage using modern standards/features in a scanner, it is just not needed.

@amaanq amaanq closed this Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants