A few things come to mind when you hear the word “Rakuten” ⁠— internet shopping, digital content, cashless payment and drones to name a few. But the denizens of Rakuten Crimson House have been doing far more than just impacting the world through internet services.

Satoshi Egi of Rakuten Institute of Technology (RIT) has been making waves in both the programming and mathematics communities with the invention of a new programming language. He recently sat down with the Global Head of RIT Masaya Mori to talk about his journey and share his story with Rakuten Today.

The language of learning

Egi belongs to the Advanced Software Team of RIT’s Power Domain Group where he works on the project that bears his namesake: the programming language Egison.

Global Head of RIT Masaya Mori (left) with Satoshi Egi.
Global Head of RIT Masaya Mori (left) with Satoshi Egi.

I first heard about your talents and your programming language (Egison) from Yukihiro Matsumoto — the RIT fellow who developed the programming language Ruby. I also heard about you from the programming language researcher Dr. Ikuo Takeuchi. Matsumoto lauded you as a programming genius, while Takeuchi recommended you as an indispensable candidate for the next generation of Rakuten talent.

When you joined, we conducted a special programming test and you were the first ever applicant to achieve full marks! We were all pretty excited about you and Egison.

I’m flattered that Matsumoto said that about me!

I’d never met him before, but he had expressed interest in Egison over Twitter. I sent him a message asking for an introduction with RIT, and that’s how I ended up applying.

Egison: The future of programming?

When you first joined, you told me about how Egison could be used to efficiently evaluate mahjong or poker hands. There were no other programming languages at the time that were able to pattern match multisets like that in as few lines of code as Egison.

Could you explain a little more about what Egison is?

An excerpt of an Egison program used to evaluate poker hands.
An excerpt of an Egison program used to evaluate poker hands.

Egison is a programming language used to pattern match any data type as if it were a regular expression.

Pattern matching regular expressions is easy, but it only works for strings of text that match exactly. Egison expands that power to apply to multisets, sets, graphs, trees, mathematical and Boolean expressions — any type of data that the user defines.

An Egison program defining a pattern matching algorithm for a multiset.
An Egison program defining a pattern matching algorithm for a multiset.

When self-proclaimed language nerd Matsumoto created Ruby, he set out with the explicit goal of creating a new programming language. He says that the 1966 sci-fi novel “Babel-17” convinced him that creating a new programming language would define the framework for a new way of thinking, and that it could change the world.

What drove you to come up with Egison?

I had the idea while doing my graduate research at university. I was working on automated theorem proving, a field of computer science which deals with proving mathematical theorems automatically through algorithms.

In designing this automated theorem prover, I needed to write a program that was capable of efficiently rewriting a range of Boolean expressions. I realized that it wasn’t possible to write a program for processing multisets succinctly using any existing programming language.

For example, the expression “P∧Q∧R” is the same as “Q∧P∧R” or “R∧P∧Q,” and programs should ignore what order they’re in. But no existing programming language was able to pattern match this kind of data in a succinct way.

You’ve been working on Egison for nine years now. What has been the hardest part of your work?

The hardest thing was probably explaining Egison to other people. That was even harder than the development itself!

Applications in mathematics

Egison’s ability to efficiently handle multisets is one characteristic that makes it very applicable to the field of mathematics. It’s also receiving attention from the world of mathematics.

To demonstrate the practical applications of Egison, I built a system to process mathematical equations. The system uses pattern matching to rewrite mathematical expressions over and over.

By using Egison, users can easily define pattern matching algorithms to these expressions, making an even simpler, expandable system possible.

As I was inputting various mathematical equations into my system, I developed a new method to use tensor index notation within the programming — something commonly used in differential geometry.

It’s very interesting that this kind of notation is being used so widely among mathematicians, but not in programming. How does that happen?

Mathematics research is so far-reaching; I think some parts of computer science are still quite detached from it. I don’t think there are that many researchers out there with a strong grasp of both differential geometry and the logic of programming languages.

Masaya Mori puts his hands up for Egison.
Mori puts his hands up for Egison.

The singularity and the future of Egison

In the world of AI development, many people are concerned about “the singularity.” Egison connects the power of mathematics with the world of computer science, which could speed up or perhaps define when the singularity happens.

To take it even further, mathematical notation is merely a human invention ⁠— it has the potential to evolve even further. Egison could give rise to new mathematical expressions and notation. It’s a bold prediction, but the potential is there.

That’s a very interesting way of looking at it. Egison is a programming language that allows more intuitive expression, so in that sense it could contribute to the singularity. But I don’t think that alone is enough to bring the actual singularity much closer.

If the singularity really were to happen, I expect the software that would make it possible would need to be smart enough to write its own languages.

That said, one of my dreams for the future is to break down and analyze the research process that was required to create Egison and present the results.

Software that writes its own language… That feels very similar to automated theorem proving. What other dreams do you have?

I really want to continue researching things that I find interesting. I want to build software that would surprise present-day me.

I also want the philosophy behind Egison to become common sense around the world, not just for those who have heard it directly from me. I would love to see other people continue what I have begun.

A grand vision that shows your desire to change and contribute to society. I think Egison has the potential to do just that.

Egi and Mori are optimistic about the future of Egison and what it means for the field of programming.
Egi and Mori are optimistic about the future of Egison and what it means for the field of programming.