Zard the world

Unlike any previous programming language, Zard has no coupling, just like the real world. The author will start from the coupling, elicit information, and then explain the world with space and law, using information and the world to complete the decoupling of objects.

coupling

The first time I encountered the word coupling was in a mechanics class. I skipped class and asked my roommate to tell me that coupling means interaction. In programming, coupling has a similar meaning. High cohesion, low coupling, that is to say, low correlation between classes or different modules, easy to modify.

Is there coupling

I don’t think coupling exists, at least not in reality. In physics, there is a saying that the nature of forces is particles. Matter transmits information by releasing particles and captures particles to obtain information.

Information sub

A photon is a piece of information, and different matter reacts to it in different ways, some discharges, some attracts, some repels. Just like, different people have different reactions to the smell of durian. I think all particles have the ability to transmit information and can be called informons.

The world

There are rules in the world, and everything works according to them, so rules should be attached to the world.

class World {
    rules
}
Copy the code

At the same time, the world also exists in space, and matter exists in space. Space can be one, two, three, and so on.

class World {
    rules
    space
}
Copy the code

As an added benefit, objects don’t have to own methods, just need to hold information.

The rules need only be written in the corresponding rules. For example, like repulsion is not written down in the north or South Pole (which itself is hard to write), but in the laws of electromagnetism.

Information needs to circulate and is realized by the movement of information sub-in space. Of course, we can also control the operation of the program through different spatial and object position relations.

On closer inspection, this looks a lot like the ECS pattern. I think ECS works because game development is closer to the world of creation.

Zard language update plan

At this stage Zard is still theoretical. Implementation of Zard is underway.

Get ready to implement Zard with Rust, and joke that Rust is hard to learn.

  1. Implement the creation of the World, the addition of rules, unidirectional_channel creation and connection.

The above can be used instead of procedural programming, that is, procedural programming is a subset of world programming.

Finally, I hope I can stick to it and finish Zard’s creation.