GoSuda

Modern Languages in the Age of AI

By Rabbit Princess
views ...

Modern Languages

A modern language refers to a language that provides higher productivity, stability, security, and maintainability compared to older languages. These languages actively incorporate the latest techniques and concepts, offering developers more efficient and secure development tools. Representative modern languages include Java, Rust, Python, and TypeScript, which possess the following characteristics.

1. Object-Oriented Design (OOP)

Most modern languages are designed based on object-oriented concepts. Object-orientation supports principles such as encapsulation, inheritance, and polymorphism, making program structures clear and flexible by dividing complex systems into smaller, manageable objects. This is particularly effective in controlling development costs and efforts during large-scale software development and in reducing potential issues during maintenance.

2. Syntactic Sugar and Expressions

Modern languages provide various syntactic sugars and expression-based grammars to enhance code readability and development productivity. Features such as ternary operators, lambda expressions, and pattern matching reduce boilerplate code, make code more predictable, and improve developer productivity.

3. Module System

Modern languages enable programs to be managed by separating them into multiple units through a module system. This facilitates code reusability and dependency management, making maintenance easier even as project scope expands. Representative examples include Java's Maven/Gradle, Rust's Cargo, and TypeScript's npm/yarn.

4. Intermediate Language and Virtual Machine

Modern languages adopt intermediate languages and virtual machines for platform independence, performance optimization, and security. Representative examples include JVM, LLVM, WASM, and GraalVM.

Development in the AI Era and Limitations of Modern Languages

Modern languages originated under the premise that humans would write most of the code. Naturally, the purpose of modern languages is to reduce repetitive tasks, enhance productivity, and effectively implement large software through structures that enable developers to collaborate. However, in the AI era, this premise is increasingly eroding. AI-based tools such as Copilot and Cody are automating a significant portion of code writing, and the volume of code a single developer can produce is dramatically increasing. Consequently, characteristics of modern languages that were once perceived as advantages are gradually transforming into anachronistic drawbacks.

Object-Oriented Design

AI can rapidly and accurately analyze structures where all information is explicitly stated within a single function or module. Conversely, as the context increases, the inferential scope expands, leading to a decrease in AI's productivity and accuracy. Code structured with OOP distributes logic across multiple objects rather than managing it in one place, which ultimately demands more context from the AI. Consider the following code:

 1public class AnimalHandler {
 2    public void handle(Animal animal) {
 3        animal.speak();
 4    }
 5}
 6
 7public class Main {
 8    public static void main(String[] args) {
 9        AnimalHandler handler = new AnimalHandler();
10
11        Animal a1 = new Dog();
12        Animal a2 = new Cat();
13        Animal a3 = new Horse();
14
15        handler.handle(a1);
16        handler.handle(a2);
17        handler.handle(a3);
18    }
19}

In the code above, for the AI to understand what the speak() method actually does, it must repeatedly perform inferences such as:

  1. What concrete class instance is animal?
  2. Where is the overridden speak() method defined in that class?
  3. Where are the definitions of the Dog and Cat classes, and what are their internal operations?
  4. Is there a possibility that the Dog and Cat classes might be overridden by other classes?

This information is not consolidated in a single file or function but can only be understood by traversing the relationships and inheritance structures between class files. Furthermore, elements determined at runtime, such as reflection or dynamic loading, are like black boxes for AI, making analysis virtually impossible.

Syntactic Sugar and Expressions

AI prefers explicit operations over implicit ones and favors combining simple structures to produce a single correct answer rather than using complex structures. In contrast, syntactic sugar allows for diverse expressions, yet their internal operations are often identical or similar. AI must learn the meaning of each of these diverse expressions individually, and it can become difficult to prioritize which syntax to recommend in specific situations.

Intermediate Language and Virtual Machine

AI primarily learns from source code. However, in intermediate language (bytecode), the meaning of variable names and other elements is removed during compilation, and the virtual machine must reinterpret it at execution time. This makes it extremely difficult for AI to understand or transform. For example, while AI can convert TypeScript to Go, converting V8 engine bytecode to JVM bytecode or machine code is virtually impossible.

The True Modern Language of the AI Era

From the above, we can ascertain that the characteristics of modern languages are, in fact, anachronistic elements not well-suited for the AI era. So, which language could be the most appropriate modern language for the AI era? The answer can be found by examining elements that older modern languages rejected. A modern language for the AI era should:

  1. Possess explicit syntax and a natural flow.
  2. Adopt a flat and simple structure, moving away from excessive OOP.
  3. Construct various functionalities using a limited set of basic keywords, rather than relying on unnecessary syntactic sugar or implicit patterns.
  4. Have a simple and predictable build system, not a complex one.

Golang is the language that best fits these criteria. The Go language was designed to implement most practical functionalities using a minimal set of core keywords and simple syntax combinations, rigorously excluding unnecessary abstraction and implicit operations. This structure is advantageous not only for developers but also for AI in interpreting and generating code.

The characteristics of Go, such as its predictable and flat structure, explicit flow, and consistent syntax, make it more suitable for development environments where AI actively participates, unlike traditional modern languages designed with human developers in mind. Go's conservative design philosophy, once considered anachronistic, is now proving to be the most forward-thinking choice in the AI era.