Hello,
Does C has a eval function?! It would be cool if it has because it gives the possibility to use an extra eprom for writing extra code for executing the code in the atmega.
Greetings
Christian
Hello,
Does C has a eval function?! It would be cool if it has because it gives the possibility to use an extra eprom for writing extra code for executing the code in the atmega.
Greetings
Christian
C doesn't have eval().
You can only have an eval function in an interpreted language, the language used here is a compiled one.
Not sure if that is true. I used to program in the dBase III language (DOS age) and used the Clipper compiler to create an executable. Eval was possible there.
I wrote the equivalent of "eval" for compiled fortran, a long time ago.
You can fit an interpreter in an arduino, have it eval code out of eeprom or flash or strings, and still have room for sketches as well, I think...
But it's not in there by default, and it wouldn't be an "easy" project!
Thanks for the info!!!
Greetings,
Christian
Not sure if that is true. I used to program in the dBase III language (DOS age) and used the Clipper compiler to create an executable. Eval was possible there.
The "executable" in that case was a small interpreter, and a bytecode-compressed copy of the source code of your dBase language. Even though you had a .EXE file, it was an interpreted language.
The same model exists for MATLAB and many other domain-specific languages that offer a "compiler" option.
It's a basic truth of computer science: if you can evaluate a string in the human-readable source language, you must be able to parse the language, interpret the parsed instructions, and execute the instructions using native machine code at some level. Even if the "compiler" is really doing all that for the rest of your program, the executable would require all of those steps to perform an eval() on a string variable. You can't escape it.