A brief first-person overview and retrospective of the language's first year.
Implemented features, plans and priorities.
January 20, 2023
On a gloomy winter morning, I received a notice from Google about an upcoming staff reduction: I must either find another department at Google or I will be laid-off in three months. Okay, I contacted my managers, and they gave me contacts of the GoLang and Carbon groups. Also they guaranteed that I could freely use my ideas for a new language and smart pointer system, which I unsuccessfully had tried to convey to the Google management and architects for years. So this began. The project for a new programming language. A safe and effective one that performs precise memory and resource management, with no leaks, and fundamentally does not use the garbage collector, to avoid its pauses and overheads.
February - April 2023
I started integrating with LLVM, I immersed myself into the compiler code and the architecture of the new language:
- I implemented a new data model: managing-object-lifetimes
- I made a set of flow control operators that not only blur the boundaries between null, optional and boolean types but also allowed to create fault-tolerant code without using exceptions (control-structures).
- I implemented OOP having the classic classes and interfaces, but with the addition of ultra-fast interface dispatch methods and dynamic casts performed by just a number of CPU instructions (dynamic_cast-and-method-dispatch).
- I designed a system of modules that act as translation units, name isolation units, dependency control units, and versioning units.
- A hierarchy of callable entities has been created: functions, lambdas, methods, delegates, callable objects, that serve various scenarios: synchronous and asynchronous call, in- and intra-threaded, with local and global state retention.
- Also I quickly tinker a primitive integration with SDL.
May 2023
I contacted my colleagues from Google and sent them a demo - a JIT compiler running on Debian x86/64, which demonstrated the basic features of the language - a code free from memory leaks, from random GC pauses, fast and compact. Well, to say that they weren't impressed is to greatly overestimate it. One of the GoLang architects replied that until the language showed some passably working multithreading, it’s better not to even contact them.
June - August 2023
I left Google and had an excellent summer - a big family trip, daily ocean, pool, BBQ and parties with friends. I didn’t forget about the language either:
- My JIT compiler was replaced with a real compiler that built executables.
- I migrated to Windows (that's how I liked it).
- I added generics (parameterized classes and interfaces).
- I implemented multithreading, largely based on the CSP model:
- with immutable objects that are shared between threads,
- and mutable hierarchies of objects living inside each thread,
- with inter-thread communication through asynchronous message passing between objects,
- no overheads, no data races, no deadlocks, etc. The application code never stops at mutexes and atomic operations.
- An interface with C has been implemented, which lets to directly write functions and methods of Argentum objects in C.
- I made a single operator for return/break/continue, which works not only with control structures, but also with lambdas (it allows to exit from lambda to any block in which this lambda is declared) - like set_jump/long_jump but on steroids, with safe stack unwinding. This operator also doubles as an exception handling mechanism.
- I added multiline string literals and string interpolation.
- And a basic debugger. Now you can write and debug Argentum programs with VSCode and GDB.
- I created this website aglang.org, and wrote a series of articles for Reddit and Russian-language Habr.
September 2023
Google money began to run out, so I began to look for another work. But before I left Google for good, I did my best to reach out to my former colleagues. This attempt ended with a phrase said by one of the main architects of GoLang: “I have neither the time nor the desire to really delve into the idea of this language. Besides, Google doesn’t need new programming languages at all.” Honestly, I expected some better answer. So I accepted the offer from another FAANG company with a light heart.
October 2023 - January 2024
Weekends hobby:
- Foreign-function interface was extended to the multi-threaded case. Now C-code can safely send asynchronous messages to Argentum objects from any threads.
- Argentum got bindings to SDL, CURL, SQLite.
- Runtime library got arrays and hash maps.
- Argentum has been ported to Linux and launched on the Steam Deck.
- A first iteration of the animated graphical 2D scene - the basis for future GUI library.
- I unified the lambdas and conditional operators syntax, and simplified strings and interpolations.
- Argentum was ported to ARM-64 and ran on Raspberry Pi. BTW this is not cross-compilation: both the examples and the compiler itself work on ARM.
What's next
I'm working from office again, so I can't devote much time to this project. But I have big plans for Argentum'2024:
- support for Android, iOS, OsX, port to WAsm, RISC-V,
- dimensional data types so that
pixels
andkilograms
cannot be added to one another, - enumeration and enumeration-based method dispatch, this will radically simplify the GUI and scripting-automation,
- numerous language additions: mix-ins, parameterized functions and methods, async, tests, module versioning etc.,
- runtime library extensions - parsers for various data formats, integration with various C libraries, etc.
- data definition language and built-in serialization,
- numerous optimizations in the compiler (b/c nowadays there are almost none).
I think that in six months Argentum can be used carefully for the development of simple applications.
The first year turned out to be productive 🙂