Thought about a langage that would be for Typescript what Crystal is for ruby

Sorry for the really off topic issue. Just wanted to know your thoughts about some language (perhaps Typelang???) that would be for TypeScript what crystal is for ruby

In my wish list I would put

  • a subset of Typescript (the good parts you might say, like no “any” type, and definitely not trying to support all JavaScript dynamic features)
  • not aiming at strict compatibility, but highly inspired on TS (like Crystal on ruby)
  • with a couple needed features (real immutable structures, type safety at runtime, sound type system, etc.)
  • great plus: ability to compile to readable (and hopefully very similar) Typescript code

In general the idea would be to have a language that make TypeScript developer feel at home, while being more performant and safe (in the spirit of “if it compiles it works!”)

just wanted to know if you think a project like this is feasible at all, and if it’s worth the effort

ps: once again, sorry for being so off-topic, I’ve just been working quite a lot with TypeScript lately

ps: a couple interesting projects, similar to this idea

Hey, thanks for sharing your thoughts.

If you define a language that’s just a subset of another language with an additional superset of features, your users would need to learn many new concepts when migrating to your new language (in this case borrow-checking, type-safety, concurrency, similar but not same syntax etc.) and that brings up the question why not just use a language that offers the same kind of features (albeit with a less familiar syntax)?

Basically, I don’t think ‘familiar syntax’ is a big enough reason for devs to move to a new language when they can’t reuse their code anyways. Having said that, I love the clean syntax and the general beauty of Crystal. Which is kind of a feature in itself :slight_smile:


C, C++, Java, JavaScript, TypeScript and PHP is all languages that share quite a bit of syntax, but I’ve never seen anyone using that as an argument for going from PHP to Java.

And, if you’ll excuse my bluntness, why on earth would you want another one? The syntax is only a minor part of the language, the rest is in the philosophy of it. An if statement looks the same in the above-mentioned languages (and Crystal/Rubys aren’t far off), it’s in how the language handles truthyness where the difference is really felt.

Besides, isn’t TypeScript already kinda the Crystal to JavaScripts Ruby (apart from the compiled part)?