Optimizing an IDE for an Evolving Language Ecosystem
This paper outlines a strategy for building a high-performance IDE for the evolving Move smart contract language by leveraging the Language Server Protocol and the existing core compiler, while detailing the necessary infrastructure optimizations and lessons learned to support the ecosystem's growth.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are building a brand-new city from scratch. You have the blueprints for the buildings (the programming language) and the construction crew (the compiler). But before anyone can actually live there or build anything useful, they need a super-smart assistant to help them navigate the streets, find specific addresses, and fix mistakes as they build. In the world of coding, this assistant is called an IDE (Integrated Development Environment).
The paper by the team at Mysten Labs describes how they built this "super-smart assistant" for a new city called Move (a language for smart contracts). Here is the story of how they did it, using simple analogies.
The Big Dilemma: Build a New Engine or Use the Existing One?
When you need a car engine to power your new assistant, you have two choices:
- Build a brand-new engine from scratch just for the assistant. This is like hiring a special mechanic to build a custom engine that only does one thing: helping the driver. It might be perfect for the job, but it takes a long time and a lot of money.
- Use the engine you already have. The city builders already had a massive, powerful engine (the compiler) designed to turn blueprints into finished buildings.
The team chose Option 2. They decided to hook their assistant up to the existing city engine.
- The Risk: The engine was built to finish buildings, not to help people while they are still drawing the blueprints. It might be too slow or too heavy.
- The Reward: Since the engine already existed, they could get the assistant running almost immediately, rather than waiting years to build a new one.
The Problem: The Engine Was Too Slow
At first, the assistant worked, but it was sluggish. Imagine asking a librarian to find a book. If the librarian has to walk to the back of the library, check every single shelf, and read every book cover-to-cover just to find one page, you will wait a long time.
As the city of Move grew, the library got bigger. Every time a developer made a tiny change to their code, the assistant had to re-read the entire library (the code and all its dependencies) from scratch. This took over a second, which felt like an eternity to a developer.
The Fixes: How They Speeded Things Up
The team realized they had to optimize the engine without rebuilding it. They applied three main "tweaks":
1. The "Pre-Read" Library (Pre-compiling Dependencies)
The Problem: The assistant kept re-reading the standard library books (like dictionaries or math guides) every single time a developer changed their own story.
The Fix: They realized, "Hey, nobody changes the dictionary!" So, they created a pre-read shelf. They read the standard library books once, wrote down the important notes, and put them on a special shelf. Now, when the assistant needs to check a word, it just grabs the notes from the shelf instead of walking to the back of the library.
- Result: This cut the wait time from nearly a second down to a fraction of a millisecond.
2. The "Spot-Check" Strategy (Incremental Compilation)
The Problem: Even with the pre-read shelf, if a developer changed a 100-page story, the assistant still tried to re-read the entire story, even the parts that hadn't changed.
The Fix: They taught the assistant to be lazy (in a good way). If a developer only changed page 50, the assistant only re-read page 50. For the other 99 pages, it just said, "I already know this part, it hasn't changed."
- Result: This made the assistant feel instant, even in huge codebases.
3. The "Shared Backpack" (Memory Optimization)
The Problem: The assistant was carrying a huge backpack. It was so heavy that if a developer opened three different projects, the assistant's backpack became too heavy to carry, causing the computer to slow down or crash. It was carrying every detail of every book, even the details the assistant didn't need to see right now.
The Fix: They reorganized the backpack. They threw out the heavy, unnecessary details and only kept the essential notes. Furthermore, they realized that if three developers were working on projects that used the same dictionary, they didn't need three separate dictionaries. They shared one dictionary among all three projects.
- Result: The backpack became much lighter, allowing the assistant to handle multiple projects at once without breaking a sweat.
The Lessons Learned
The paper concludes with a few "rules of thumb" for anyone trying to build a similar assistant for a new language:
- Don't build everything at once: You don't need the perfect engine on day one. Start with what you have and tweak it as the city grows.
- Expect to cache things: Always plan to save your work (like the pre-read shelf) so you don't have to do it twice.
- Watch your weight: Be careful how much "stuff" (memory) you carry. Just because you can carry a heavy backpack doesn't mean you should.
- Be resilient: If a developer makes a typo, the assistant shouldn't quit and give up. It should say, "I see a mistake, but I'll keep helping you with the rest of the sentence."
The Bottom Line
The team successfully turned a slow, heavy construction engine into a fast, nimble assistant by being smart about how they used the existing machinery. They didn't build a new engine; they just made the old one run much more efficiently. This allowed developers to build their smart contract cities quickly and without frustration.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.