Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
D

dynamix

> 编程语言
Open source

:fish_cake: A new take on polymorphism

695 stars0 likes1 views
WebsiteGitHub

About

:fish_cake: A new take on polymorphism

IMPORTANT v2 is here. It is a big change. The last v1 release was v1.4.0

DynaMix (Dynamic Mixins) is an alternative take on object oriented programming and dynamic polymorphism. It lets users compose and modify polymorphic objects at run time. The main target language is C++, but C is also supported.

The library is a means to create a project's architecture rather than achieve its purpose. It helps with extensibility, readability, scalability and interoperability. It focuses on maximal performance and minimal memory overhead.

DynaMix is applicable for the software architecture of systems with complex objects including, but not limited to:

  • Games (especially role-playing ones or strategies)
  • CAD systems
  • Enterprise systems

The library uses the type dynamix::object as a placeholder, whose instances can be extended with existing classes (mixins), thus providing a particular instance with the mixin features of all those types. Likely the most important types of mixin features are messages: functional objects which in C++-OOP terms can be thought of as methods. Mixin features are overridable and use late binding and singular dispatch. Unicasts and multicasts are possible.

Here is a small example of what code may look like using the library:

…

Here are some of the key features of the library:

  • Compose objects from mixins at run time
  • Physically separate interface and implementation
  • Non-intrusive – mixins don't need to have a common parent or any special code inside
  • Mutate "live" objects by changing their composition at run time
  • Use std::polymorphic_allocator to allow fine-tuning allocations and achieving cache locality in critical parts of the code
  • Create shared libraries and plugins which can enrich or modify objects, without modifying (or even rebuilding) the executable.
  • Add "hotswap" to a project while developing
  • Have complete runtime reflection by symbols or strings
  • Messages:
    • Fast polymorphic calls – comparable to std::function
    • Have multicast messages, which are handled by many mixins within an object
    • Thread safe message calls – as thread safe as the underlying methods.

Created with DynaMix

The following projects are known to use DynaMix as a key piece of their software architecture:

  • A3I by ViewRay (Released 2022) - A medical system for cancer treatment. Uses v2
  • huse - a polymorphic serialization library. Uses v2
  • Heroes of the Dark by Gameloft (Released 2021) - An RPG for Android, iOS, and Windows. Uses v1
  • War Planet Online: Global Conquest by Gameloft (Released 2017) - An MMORTS for mobile devices and PCs. Uses v1
  • Blitz Brigade: Rival Tactics by Gameloft (Released 2017) - A multiplayer RTS for Android, iOS, and Windows. Uses v1
  • Swords & Crossbones: An Epic Pirate Story by Epic Devs LLC (Released 2014) - A strategy/exploration game for Android, iOS, and PC. Uses v1
  • Earthrise by Masthead Studios (Released 2011) - An MMORPG (no longer supported). Uses an early proprietary prototype version of the library with a similar interface and a different implementation.

Documentation

The documentation is part of the repo in the doc/ directory.

Contributing

Contributions in the form of issues and pull requests are welcome.

License

This software is distributed under the MIT Software License.

See accompanying file LICENSE or copy here.

Copyright © 2013-2026 Borislav Stanimirov, Zahary Karadjov

Logo

.

The DynaMix logo is licensed under a Creative Commons Attribution 4.0 International License. Copyright © 2018 area55git

V1

DynaMix v2 is a complete rewrite and though it has the same idea as v1, it is incompatible with it, and has a different interface, and different implementation for most features, and different terminology for some.

The last release of DynaMix v1 was v1.4.0. The documentation is available here

A list of the most notable differences between v1 and v2 can be found here.

Boost.Mixin

DynaMix was initially developed as Boost.Mixin but is now a separate library that doesn't depend on the Boost libraries Collection.

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

C++cpplibrarymixinsoop

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言