Genetic System Architecture

An introduction

Ilya Mikhaltsou
6 min readJul 26, 2018

Designing software is a pain. Designing software is something that can go horribly wrong, and eventually always does go horribly wrong, as changes and new requirements pile up. It is considered quite normal for a piece of software, after some long time of development, to be a huge pile of broken, disconnected, and discontinuous design. There are many, many approaches that promise you that this is the only architecture that you will ever need, and that it will provide you the best ever cleanness of code.

What if I tell you that you can write code without doing design?

The answer lies in a misunderstood and misused technology of old, from the times people wanted improvements desperately, but didn’t yet know improvements to what.

5th generation languages

Some of you may know, that what most of the time we use to develop software is, in fact, a third generation language. Some of you also use 4th gen langs, which are mostly domain-specific languages. And then there’s 5th gen.

Interestingly, all that “progress” happened in 1970–1990, which is, a long time ago, in software world.

A 5th generation language is such a language where a computer was supposed to derive an algorithm that solves the given problem by itself. That approach… failed. Computers turned out to be not very good at creating algorithms, and programmers turned out to be much better at it and very much willing to do it themselves (no wonder). And more importantly, to get computer to actually derive a good algorithm, programmers had to write it inside out, and (obviously) were very much not willing to do so.

But there was some good stuff as well. First, when used properly, such languages accelerated development several orders of magnitude (i.e. expert systems). Second, they could grow without being subjected to bad initial design problems. Development was faster, because they are a flat design, where a developer didn’t need to think ahead. And they didn’t need good initial design, because that flat design was based on logic reasoning.

Software written in 5th gen language looks like a flat set of rules (i.e. conditions), paired with the action to be performed. Things sound fairly good, till you see some “perfect” examples of how both of those are defined.

Exhibit A, “String reversal ruleset” (that is, it makes “abcde123” into “321edcba”, through some clever use of ‘$’ and ‘*’) [1]:

Exhibit B, “I have no idea what that does and how” [2]:

Exhibit C, “It is something about primes in Perl” [3]:

Ok, enough, I think you got the idea.

For those interested, [1] and [2] are from here, and [3] is from here.

Another look

Yet, it doesn’t need to be so bad. In the end of the day, does anyone actually use Perl?..

And it doesn’t need to be so limited. You don’t use JavaScript only to create rolling text, right?

And it doesn’t need to be so formal. Would prefer Swift over Haskell any day, and still get all I want from Functional programming.

Quite much, those are the only problems with 5th generation.

When I incepted Genetic system architecture, I was trying to envision a flat software design. By flat design I mean such hypothetical design, where new components, changes, additions and whatever else can be done without nesting, in one flat shared space, and with almost no modifications to existing code.

That, I figured, had to be accomplished by some automated partial superseding.

Next, it had to be split into problem domains, but in such a way, that the problems can be nested, without requiring nested solutions. The problems became data structures, domains turned to directories. And solutions, combined with the previous requirement, turned out to be 5th generation languages of old (or at least their core concepts).

Eventually, what I now call ‘MicroGene’ came out — a most basic flavor of genetic system architecture, that could be implemented on any language of choice.

The first prototype is done in Swift, doesn’t look very cool and takes too much boilerplate.

The second prototype is in Python (the core system is in C++), and looks much better for sure.

The result does look like software, not some musings of a crazy academic with infinite access to new operators that tries to sell accountants and managers on the idea of a developer-less world.

The product

In some ways, it is still a logic reasoning system, a production system, an expert system, or whatever other terms Wikipedia has for such systems.

Main difference is in the application:

  • The input problem is now an abstract state represented by some data
  • The output result is also such state
  • And the process of solving is now not of making an algorithm, but of combining software components in a meaningful way to move from input to output through solving other problems.

The system is defined as follows:

  1. There is an abstract storage space, with directories and named items.
  2. Named items are infinite lists, that contain some values, in the order they came.
  3. A Gene is a rule, that takes inputs from some paths in storage space (defined through path matching patterns), has some conditions to fire, and on firing does some operations, possibly resulting in producing new values.
  4. A value that was taken by a Gene is consumed. That is, it ceases its existence, providing uniqueness of computation operation. Consequently, no value can be accessed concurrently.
  5. There are two predefined values: ‘Startup’ and ‘Shutdown’. The first one marks the initial state of the program, and the second tells the program to discontinue execution.

Important aspect to keep in mind, is that the system is not formal. If you simply write your full normal program in the Startup Gene, then you get a usual software system. If you write everything as Genes, you get what was before called 5th generation language. What you should do, is be somewhere in-between.

The problem of developing good software design is both easy and hard. The components you use (the bits of code logic) are the same no matter what design you employ. It is only their organization that is different. The problem of organizing them (designing software) is quite tedious, and the solutions to it keep becoming ineffective in a couple if years of project’s lifetime, but they follow very simple rules. That makes software design a perfect target for being dynamically resolved by the computer itself — development without design, a problem solved by Genetic system architecture.

I’m currently working on a project that uses the Python version of MicroGene (microgene-py) to allow fast delivery cycles and easiness of changes.

As I progress, I will keep writing more specifics and benefits of using Genetic system architecture, some more interesting background, some considerations, patterns, future ideas, deeper dives into technologies used by 5th generation languages and how they tie into Genetic system architecture, and other related topics.

I will open-source microgene-py, if there’s some interest in it and as soon as I find it good enough for being released.

Thank you for reading.

Also see my other article, that talks about how it is time now for a paradigm shift in programming (and I hope Genetic system architecture is exactly this):

This story is mirrored at my blog: https://blog.morphe.by/genetic-system-architecture/

--

--

Ilya Mikhaltsou

Never will know what I’m doing But will be doing it nonetheless. Oh, and you can find my info on https://morphe.by