|
|
|
|
|
by badsectoracula
1071 days ago
|
|
It it technically possible in that C macros are supposedly Turing complete, but i mean i want something like being able to add a value to a variable, iterate through values (proper list would be neat but i'd be ok with a string of space separate values), etc. |
|
It isn't Turing complete, because it will always terminate, but you can make the execution time (number of execution steps) arbitrary large exponential in respect to the number of source lines.
There are a few libraries that implement that.
https://github.com/rofl0r/chaos-pp: Quite high level implementation, that supports arbitrary precision decimal base arithmetic.
https://github.com/camel-cdr/boline: Mine implements 8/16/32/64 bit arithmetic, and low level control flow.
You can very often get away with using unary numbers and/or constant expressions to work around the limitations without needing a library.
Got any problem in mind? I've got some time on my hands to problem solve.