Hacker News new | ask | show | jobs
by pcthrowaway 5 hours ago
> 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