Lately, I've been pondering the strengths and weaknesses of static and dynamic languages. In particular, the reaction of the online programming community to Elben Shira's post The End of Dynamic Languages made me realize that many (most?) programmers out there seem to prefer static languages. This seems to be largely because static languages usually come with better IDE and tool support, as well as static guarantees which programmers value highly (and rightly so).
I'm slowly working on a design for a programming language of my own, and I had a "wait a minute, let's take a step back" kind of moment. Why? Because the language I was working on was going to be extremely dynamic. It was going to be JIT compiled, dynamically typed, with an extremely powerful macro system based on the ability to hijack and modify the parser while a program is being parsed. I was also considering using a self-modifying Intermediate Representation (IR) as part of the design of the JIT compiler.
Elben's post made me take a step back because it made me realize that the design of my ultra-dynamic language would make it near-impossible to have much tool support. If you can hijack the parsing of a program while it's being parsed, and alter the parser using custom code you wrote, then good luck running any kind of static analysis. It's just not going to work.
I saw that I was a being myopic. I use a bare-bones text editor, no tools, and I've only used a debugger a handful of times in the last few years. That's the way I program, but it's not the way most people program. I can get away with this because the projects I've worked on have all been under 100K lines of code. Designing a language which makes any kind of static analysis, refactoring-assistance or autocompletion near-impossible is a sure way to guarantee the language won't gain adoption outside of hobbyist circles.
Then, there's the issue of JIT compilation. I very much like JIT compilers because that's where my expertise lies, I've written my own JIT as part of my PhD thesis. Still, I have to keep an open mind and ask myself what's best for my language. JIT compilers are fundamentally more powerful in terms of optimization capabilities than AOT (Ahead-Of-Time or static) compilers, because they can adapt the way they optimize code based on the behavior of running programs. They're great for dynamic languages.
Unfortunately, it seems that the world, at the moment at least, is stepping away from JIT compilation. In order to support mobile platforms or compile to WebAssembly, it seems to me that JIT compilation is impractical. Why? Because it requires generating machine code on the fly. At the moment, it's unrealistic to just plop a custom binary with self-modifying machine code on the Apple or Android app stores.
I'm thinking I might just design my language so that it compiles to plain old C. This would make it possible to leverage the C compilers that already exist for every platform out there. Rest assured though, this language will be dynamically typed ;)