Remix.run Logo
▲ Yahivin 3 hours ago

- Yes there's decent LSP integration - There are some in the community working on linters/formatters but it's an ongoing - We've removed all the ASI pitfalls in the code emit stage - Whitespace is significant, we try to keep it consistent and intuitive but there are probably some subtleties and edge cases. The interactive docs on https://civet.dev are fairly exhaustive. - Compiles directly into cjs/esm via esbuild and other build plugins so has 100% integration with existing JS/TS ecosystem

There might be some existing issues about extending switch with more advanced pattern matching / data types. Currently the compiler itself is not very type aware to allow it to run each file independently. A fully type aware compiler opens up lots of opportunities with switch/overloading/etc. but can have challenges depending on what we need to know at compile time.

Rationale for disallowing whitespace between unary operands is to keep `a + -b` and friends more consistent. We may be able to add it in if you have some compelling examples.

Thanks for the feedback and hope you can give it a shot!

If you use LLMs they are surprisingly good at writing Civet considering the paucity of Civet data in the training corpus.

▲pcthrowaway 11 minutes ago | parent [-]

> Compiles directly into cjs/esm via esbuild and other build plugins so has 100% integration with existing JS/TS ecosystem

I'm assuming you must be compiling to TS in order for type issues to be flagged in an IDE by the TS language server? Or are you saying types in Civet are just hints that don't cause errors if violated? Docs say civet can compile to typescript, so I'd expect typescript checks to work.

> A fully type aware compiler opens up lots of opportunities with switch/overloading/etc. but can have challenges depending on what we need to know at compile time.

If the compiler's not type aware, couldn't it still leverage the fact that the typescript language server is? So perhaps Civet could compile an algebraic data type-hinted switch to Typescript code that follows a pattern approximating the DX of Rust's match (there are a few examples of this), and then you wouldn't have to change anything to civet's own type-awareness.

But you'd probably understand how difficult of a project this is better than I would. I'm just excited at the possibilities since Rust enums/matches are my favourite feature of the language in terms of ergonomics.

> Rationale for disallowing whitespace between unary operands is to keep `a + -b` and friends more consistent. We may be able to add it in if you have some compelling examples.

I don't actually have strong feelings about this; I was just curious