semantic
semantic copied to clipboard
F# support
Any interest in supporting F#?
We have our own compiler APIs that enable all kinds of stuff based on structure and semantics; and it's part of the compiler proper, not some janky thing that breaks because the compiler changed stuff. You can see this in the Fable REPL, which supports a wide range of tooling features in the editor: https://fable.io/repl/
Based on looking at how you do things, you wouldn't be able to use this directly, which would imply a lot of work. F# syntax and semantic aren't trivial 😅. But if there was a way to extend this to allow the existing tooling support (which can run in a browser!), then we might be able to prioritize stuff on the F# side of things to make it easier.
Hi there! F# is a lovely language; we’re glad to hear that people want to use it with Semantic.
Though integrating with external tooling would be a fast way to get up and running, APIs to do so are not in our roadmap; for reasons of simplicity, compatibility, and speed, we’re locked in to the tree-sitter ecosystem. The first step would be to write a tree-sitter parser for F#; PR #131 contains a (draft) list of the subsequent steps. Though we don’t plan to tackle F# support ourselves for the time being, I really appreciate the report—it’s our intention for Semantic to work with ML-style languages like Haskell and F#, rather than just ALGOL descendants.
I think it makes sense to list here also the OCaml, due to the sheer similarity of these languages. So probably a big chunk of the code can be shared between those.
Now the OCaml support is being worked on, for those who will start to implement F# support, take a look at those:
- https://github.com/baronfel/tree-sitter-fsharp
- https://github.com/tree-sitter/tree-sitter-ocaml
- https://github.com/tree-sitter/haskell-tree-sitter/tree/master/tree-sitter-ocaml
- https://github.com/github/semantic/pull/623
Any updates on the F# support?