There is about to be a language explosion.
In many ways I have No Fucking Idea what I'm talking about...but something weird says that in five years time I'll have made the right moves by just attempting to talk about this today. I may be repeating myself, but each time I do, I get more ideas.
Any two important questions that need answering.
What can make this possible?
I've hinted on this before.
- JVM
- IDE Support
- Library Support
Scala, for instance, has compile time access to Java classes (which, if you reference the last point, has IDE access as well). Someone had to write a Scala compiler to allow this to happen. Those points in and of themselves are not too interesting. But they do lead into something much greater.
Once Scala compiles down to JBC, then its accessible to Java code. Someone writing Java in their favorite IDE can drop in a Scala jar file, which is really just a Java jar file, and have full access to it. I'm very curious as to how this works. What does the JBC look like? How can you link to the source code? Do they line up? How can they?
Anyway, we still arent at the truly interesting part. Any new languages compiling to JBC, you guessed it, Boom! Instantly accessible to all other new languages also compiling to JBC. Ok maybe not instantly, you still have to write the compiler. That is the interesting point. New languages, designed for different purposes, designed to make different aspects of development easier, all with accessibility to each other. All tied into the IDE. Oh man.
So let me summarize all that.
- Choose a syntax that fits your problem.
- Write a compiler that understands Java.
- Compile to Java Byte Code
- Write a compiler plugin for the IDE, or write your compiler to fit some special IDE compiler spec.
- Plug in.
Maybe I'm nuts and thats so far out of wack, or so far off in the future, but I can see this happening in 5 years.
Is there a way to capitalize on this?
As I see it, there is a whole bunch of work that needs to be done, but it will get done.
- IDE's need a way to understand new languages. This could be through a compiler plugin, or Abstract Syntax Tree plugin or who knows, just something else.
- People still have to write compilers.
Writing compilers is hard work. No doubt about it. There needs to be generic compiler libraries that a compiler writer can use to to easily create compilers that do all this stuff. I'm not just talking LEX and YACC. I'm talking easy API's to do the following:
- Give access to all Java code.
- Provide the hooks to the IDE
- Compile to Java Byte Code
No comments:
Post a Comment