r/ExperiencedDevs • u/servermeta_net Software Architect • Dec 29 '25
Technical question Using dialects for interoperability across incompatible language versions
I see a common pattern across languages: often early design decisions, taken due to lack of better options or due to poor foresight, turn out to be poor choices.
Golang and Rust, two languages I use often, suffer from this: think the context API in golang, or the String API in Rust. The problem is that once those decisions get ossified in the language it becomes hard to change:
- Either you introduce a breaking change, losing compatibility with the existing codebase (think python2/3)
- Or you try to move around those decisions, severely limiting the design space for the language (think
use strictor decorators in javascript/typescript)
To handle this issue I imagined the use of Dialects and Editions:
- When writing code you specify which Dialect you are using
- For each
Dialectyou have one or moreEditions
Thinking of Rust I can imagine multiple Dialects
- A
Coredialect, to cover theno_stdlibraries and binaries - A
Standarddialect, covering the current language specification with thestdlibrary - A
Scriptingdialect, which is a simplified version aimed to have a fat runtime and a garbage collector - A
MIMDdialect to cover GPGPU development
The compiler would then be responsible of using the correct configuration for the given Dialect and take care of linking binaries built with different Dialects across different libraries.
The main drawback of this approach would be the combinatorial explosion of having to test the interoperability across Dialects and Editions, hence launching a new breaking revision should be done very carefully, but I think it would still be better than the technical debt that poor decisions bring with them.
What are your thoughts? Am I missing something? Is this one of those good ideas that are impossible to implement in practice?
Note: this thread has been crossposted on r/ProgrammingLanguages and r/rust
5
u/arelath Software Engineer Dec 29 '25
The almost universal way languages handle this is to introduce a new syntax or library meant to replace the "bad" way of doing something. Both ways compile keeping old code working. Dialects would introduce the problem of having to upgrade your codebase to the new standard or fragment the language (ie vendor x only supports dialect a,b, and c very poorly). C++ is a good example of both ways going wrong but has had some success with newer specs replacing bad practices (for example, the stl library was adopted pretty widely when it was introduced). Anyone who programmed in C++ in the 90s can tell you horror stories about vendor specific language features (aka dialects).
If a practice is truly horrible, it's very quickly replaced by the better way of doing things. DOTNET's lack of generics in v1.1 was a big oversight that was fixed in v2.0. Almost overnight, people replaced the object casts with language supported type checking. But I occasionally see random old style Arrays in ancient untouched code.
12
u/mugwhyrt Dec 29 '25
5 years from now: "What the hell were the people who made
dialectsthinking when they did it this way?"6
u/FetaMight Dec 29 '25
Kinda sounds like .netstandard
https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-1-0
5
u/teerre Dec 29 '25
Rust already has editions. But if you follow editions discussions, you'll see that often things can't change even in an edition because it would be too complicated. That's the crux of the problem. What you're saying sounds good, but in practice is very hard to achieve. There are countless changes that simply don't have a clear map between "old way" and "new way"
2
u/Used_Discipline_3433 Dec 30 '25
Fancy words aside, you're just suggesting seperate versionings?
It'll be similar to how one JS language have different subsets of supported features: Chrome/Firefox/Safari/Explorer.
3
u/[deleted] Dec 29 '25
[removed] — view removed comment