| ▲ | Yahivin 5 hours ago | ||||||||||||||||
As the creator of this language I'm always looking for feedback, even/especially from HN :) | |||||||||||||||||
| ▲ | pcthrowaway 3 hours ago | parent | next [-] | ||||||||||||||||
I was prepared to appreciate this as a curiosity and move on. Instead I'm nearly sold on it, to the point I might see myself using it. Some questions first, which would inform whether I could practically use this: - Does it have LSP integration? - Can a linter/formatter catch typescript/javascript which isn't valid Civet (needs minor changes to conform to the additional restrictions). Perhaps even an auto-formatter? - I see semicolons are optional but not used in examples.. are there ASI pitfalls as with Javascript? - Is this built from a fork of the Typescript compiler? Or is it compiling Civet -> Typescript -> Javascript (with the ts compiler involved in the second step)? - Whitespace appears significant in Civet... are the rules of whitespace significance documented in one place anywhere? - How does it play with existing ecosystem. I'm immediately wondering about runtime schema validation libs like Zod And for me, the most compelling feature is the potential with switch. Any plans to support switch nesting and algebraic data types a la rust? This would be a killer feature IMO. I guess in the example, there is no type for `x` shown in the demonstration; Is `x` here presumed un-typed? If `x` was typed, would the switch present a compiler error if trying to match a subset of `x` disallowed by its typedef? edit: Another question: what's the rationale behind disallowing whitespace between unary operands? IMO whitespace is useful for readability here. | |||||||||||||||||
| |||||||||||||||||
| ▲ | tyre 2 hours ago | parent | prev | next [-] | ||||||||||||||||
Whitespace-sensitivity has not been adopted by another new mainstream programming language, and I’d ask you to consider why that is. It is not simply a matter of personal preference. Pipes are a great addition. Matching as well, except for the whitespace issue. Some of these things seem more for code golfing; particularly `&` and the way method m-chaining can work without an explicit reference to the object. When introducing syntactical sugar or metaprogramming, I’d ask myself, “it’s 2am and I’ve been paged. The issue lives across 10 20-line methods/functions in this language. How quickly and confidently can I identify it?” Anything too clever is fun when you’re writing on a lovely spring morning and hell when you’re reading under pressure during an incident. I’d optimize for the latter. | |||||||||||||||||
| |||||||||||||||||
| ▲ | biasedstuff an hour ago | parent | prev [-] | ||||||||||||||||
Ycombinator is owned by genuinely evil people, but apart from that: Pattern matching: I dislike the pattern matching syntax a lot, but I respect that it would probably take way too many hours and take way too much research and such, to improve the syntax to something better. For one thing, it is something of a symbol soup. One's mileage may vary, and maybe others are fine with it, and maybe it is fine overall. It builds on syntax from existing works and proposals that has a lot of issues, so many of the issues are inherited from other languages and proposals. Compatibility with JavaScript is an additional challenge for any language in this space. Overall: I suspect that Hacker News users here are sweet-talking you, just in case that is not clear, you probably are aware of it. Also, I suspect that the language does not have any chance. Though I could be mistaken. Neat effort regardless. | |||||||||||||||||