| ▲ | fc417fc802 3 hours ago | |
I've also found myself thinking a lot about isomorphic languages, particularly the edge cases I run into when I start attempting to run through potential mappings for various aspects of syntax or language features in my mind. > with all of the language-specific concepts stripped away I've arrived at a somewhat different conclusion. I think we'll arrive at a maximally cumbersome, maximally verbose interchange format that isn't intended to be parsed by a human. One capable of expressing literally every feature of every language that it officially supports. Otherwise translation will necessarily be lossy and round trips with perfect fidelity impossible. Even then certain paradigms that are common today simply don't seem possible to translate between arbitrary language pairs. I think the client language would also need to be tailored to support the paradigm. Consider how you would go about abstracting (for example) longjump in C and how fundamentally incompatible that is with (for example) Java in its present form. Or how you would deal with differences in ordering requirements as well as any implicit synchronization points between languages. I figure that C++ will be a viable candidate for the interchange format if we wait another 10 years or so. Just need to add a borrow checker, first class continuations, full blown AST macros, and a runtime "eval" facility. It's slightly tongue in cheek but it's wild to think that actually it could almost work (including the bit about not being intended to be parsed by a human). | ||