How CodeSwitch got its name
Published on 2015-07-09
I've written several articles over the last year about my experimental programming language, Gypsum, and its compiler. So far, I haven't said much about CodeSwitch, the virtual machine that executes Gypsum code. Today, I'll start going into more detail about CodeSwitch with a series of short articles. Before I get into the technical stuff though, I want to talk about what I want CodeSwitch to be in the future.
Code switching is a linguistic term for when a person speaks in one language, then switches to another language mid-sentence. I want programmers to be able to do that with code. There are a lot of different programming languages that are well-suited for different purposes. I don't think it's actually possible to design a language that is better than all languages for all tasks. It's better to use the right tool for the right job, and it should be easy to build multi-language projects that exercise each language's strengths.
I wasn't around at the time, but I'm sure a lot of work went into setting this up. Every developer who creates a multi-language project will go through the same pain. And this is not an isolated problem; anyone who wants to share code with back-end, front-end, and mobile is familiar with this.
Optimization is another problem CodeSwitch can solve. CodeSwitch will have a JIT compiler and optimizer in the future. Languages which are traditionally pretty slow, like Python and Ruby, could target CodeSwitch and get a big speed boost.
This is the future vision anyway. Today, CodeSwitch is the simplest possible thing that works: a package loader, a memory manager, and an unoptimized interpreter. It has a long way to go before it gets to that vision.
As always, you can find the source code to Gypsum and CodeSwitch on GitHub.