My 2022 Crystal Wishlist

The only thing in my wishlist is to think about Crystal 2.0 as a new language that retains the original spirit of the language but changes enough things to be able to implement modular compilation. I have to sit down and think about what this means, and my wish is for other core team members to also try to think about that.

To achieve modular compilation, all of these would need to happen:

  • Instead of require merely loading files, change it, or introduce an import keyword to specify what you want to import. If you don’t import something, it’s not globally available (unlike the current behavior)
  • Mandatory types in method arguments and return types
  • Disallow reopening types, but allow something similar by having extension methods (similar to C#)
  • Type restrictions in generic type arguments
  • Macros can no longer introspect the entire program. They can still introspect types

At least, the idea is that a file can be looked at and type-checked by looking at itself and its dependencies, but without having to always have a main program.

That said, I’m not sure if all of the above is entirely possible without making the language lose its essence.

13 Likes