Saving/loading module-code as text?


#1

Isn't it possible to save the code of a module to the SD-card and load it on command, using a "char" array?
Would be a way of keeping code-size and multiple oscillator instances to a minimum..
Of course there are some requirements, like having the same local-data and parameter-calling.. but it might be very interesting for simple code-modules (eg. logic and maths)


#2

simple answer - no

compilation/storing on sdcard/loading/executing could work.
the issue is linking the code to other existing code, it would need to utilise dynamic linking. this is theoretically possible, but is hard to implement generically.
also a significant issue is performance, currently code is compiled inline by the optimiser, so as not to include the overhead of function calls... this of course is not possible if you dynamically load code.
(so doing low level objects like logic/maths as you suggest, would be the worst, it would work better with high level functional blocks)

these issues are the same as for 'live coding' which we discussed quite a while back

when I raised this, I did recognise this is very much 'against the spirit' of Axoloti, which builds its performance on static compilation/optimisation... but is an interesting area, though probably not a likely direction Axoloti would go, or excel at.

that said, if you have some knowledge of development tools, you could try to 'hack' this , perhaps in some cases it could work.