Proposal: code refactor towards cleaner architecture #62
Replies: 2 comments 1 reply
-
|
Hey. Thanks for this message. I agree on the idea to make things as simple as possible in order to be able to change the design quickly and evaluate the impact of design changes. I am looking forward to your refactor. If it can help me better understand Rust it will be a nice side effect (this is also something new for me). Regarding your questions:
To summarize: the internal language looks like some assembly language, but we use the fact that we are not actually at instruction-set level in order to help doing complex things easily. For example, the stack for return addresses is separated from the stack for storing other values (the one with push/pop). If you want to talk about that a bit more in details, I would be happy to call you in the next days. |
Beta Was this translation helpful? Give feedback.
-
I think it is a good idea to have the possibility to directly use values from the top of the stack as "variables" and to directly put results of operations on top of the stack, it would make shorter programs and thus more efficient execution. I would be in favour of taking values one by one, though. In particular because, if for an addition the order of the arguments is not fundamental, for a subtraction it is (and so, one could easily have difficult to find bugs when popping several values from the stack directly in an arithmetic operation) Here is a document I wrote to try to explain the model of execution of Bubocore and the instructions we have. This is a work in progress but it may give you a better idea of what we want to achieve: In am not in Paris, and I will not be there in the next few weeks. I think the best solution would be to have a call. Are you available in the next days? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi team. Quick intro: I'm in an art collective with @Bubobubobubobubo but I'm more on the technical side, working as a software architect and using Rust. He's invited me to have a look at the code. I'll talk in English as new contributors may not speak French.
So I had a glimpse to the repo, and in accordance with @Bubobubobubobubo I've started a branch to make some structural changes. The goal is to keep the functional code, and the compiled binary should be roughly the same. So changes will mainly deal with putting the code in the right structs and setting their relationships. I'm particularly interested in making the live-coding part testable, so that the tool behavior is deterministic. And tests shall not involve actual delays :)
However I have to say that the code felt more like optimized C++, which is normal from audio software engineers, but kind of annoy me. I believe the code complexity hinders its maintenance and evolution, and this is particularly sad at the beginning of a project, where design is not yet final, so agility is mandatory to make it grow. Onboarding new contributors is a plus, and they have to quickly understand the code. Besides, one goal of this project is for @Bubobubobubobubo to learn Rust, but I don't feel the code is in a proper state to do so. There are lots of Arcs and string clones, which may be the quickest adaptation from his Python background. But this obviously counteracts any micro-optimizations, e.g. the step's struct of arrays. In addition, OSes are not real-time and the scheduler could be off by a few milliseconds, so I believe making the code harder to work on in order to gain some microseconds is not worth it. In particular for the struct of arrays, they are mostly accessed together, so I think there's no gain. I think the data fit in a few pages at most anyway.
In short, I'm not against optimizations, but I prefer to have a clean design, make some benchmarks, then optimize, and see if the benchmark improvements, if any, are worth it. And that's what I'm proposing. I may be able to present my work in a few days/weeks. It shall not be a take-it-all-or-leave-it-all, it shall be open to discussion. I'm fine if you decide to only take a part of it, or even none at all.
Last night I started the refactor, and had a few questions:
Beta Was this translation helpful? Give feedback.
All reactions