Earlier quoted context omitted.
Languages like this don't make sense anymore. You can just pick a mature, feature-rich language you like (Rust, Kotlin, Python, probably many more) and transpile to JS.
That approach only makes any sense if you have broadly compatible semantics; otherwise execution will pay a heavy penalty (CPU usage, memory usage, bundle size). And let me tell you, your “Rust, Kotlin, Python, probably many more” don’t transpile to JS well. If you genuinely mean transpiling as distinct from compiling , I think you could even reasonably say that it’s simply not possible for many languages due to fund…
Civet: A Superset of TypeScript
131–140 of 237 posts
Re: Civet: A Superset of TypeScript
#132Re: Civet: A Superset of TypeScript
#133Re: Civet: A Superset of TypeScript
#134The one feature that I liked was pattern matching, but I wouldn't use such a different syntax just for that.
What I would like the most from a TypeScript superset is additional runtime features, like being able to validate if an object matches a certain type, and a more comprehensive standard library. The first one got alleviated a lot by Zod becoming a thing, and LLMs integrated into your editor being able to generate the equivalent validation code. The second one seems like it will never become part of the language itself, and it's up to runtimes to provide batteries-included APIs if they want to. Deno and Bun are definitely more inclined that way.
The devs seem pretty happy with it though, so I hope they continue hacking and building the language that they would like to use. :)
Re: Civet: A Superset of TypeScript
#135Its not about how concise or short your code looks, its how about much time the new intern coming tomorrow needs to understand those 1000 line files. I find the syntax very hard to remember and confusing
Some people don't code for the interns but to have fun. But I agree this isn't a very enterprise programming language, à la Java or Golang.
> Some people don't code for the interns but to have fun.
I don't think the person you were replying to necessarily disagrees with you there. But their post was phrased in such a way that seemed like business was the only focus that mattered, yeah.
Re: Civet: A Superset of TypeScript
#136Re: Civet: A Superset of TypeScript
#137Re: Civet: A Superset of TypeScript
#138it was about a decade ago and i liked ruby for the implicit nature and minimal looking code— without the curly braces and shorthand notation whenever possible
return true unless false
that line is roughly why i favor curly braces and javascript’s control flow
lines like return true unless false are so easy to write in the moment, but so much to reason about it post.
in all, i’m in favor of systems that bring future code to today’s code, like polyfilling tc39, but probably won’t bet against core javascript semantics again, like other coffee-script adjacent comments, which was the dominant flavor of js for rubyists at the peak.
Re: Civet: A Superset of TypeScript
#139Dedent and object globs are useful imo and should be added to javascript. Maybe for-of with index too.
Also, I see no flow control in array literals, how do they plan to appeal to jsx/h users?
Re: Civet: A Superset of TypeScript
#140 switch x
0
console.log("zero")
/^\s+$/
console.log("whitespace")
[{type: "text", content}, ...rest]
console.log("leading text", content)
Yes, looks very cool, but nobody should ever write code like this, especially not in strictly typed code. And it is extremely rare you need to do similar pattern matching. For the object case, you would want to define interfaces and type guards in TypeScript anyway. This feels like poor man's pattern matching compared to Python and Rust. items = for item of items
if item.length
item.toUpperCase()
else
""
If JavaScript has always required statements to end in semicolon, I'm 100% for this. But it's not. So "standalone expression" as return value will only cause chaos.