Talk:Runtime evaluation: Difference between revisions

This *is* about evaluation.
(→‎Joke solution for C: explaining the joke...)
(This *is* about evaluation.)
Line 59:
The task description states "Demonstrate your language's ability for programs to execute other programs in the language provided". That is "invocation" of another program, not "evaluation" of an expression. Looking through the solutions given, it looks like some solutions are about expressions and not about execution of another program, although I am not familiar with every language, so maybe I am misinterpreting the code given. [[User:Markhobley|Markhobley]] 19:53, 19 July 2011 (UTC)
: The "program" in the task description simply means "a piece of source code in your language". It could be a file, or a string containing source code, or something along that line. The C joke solution wasn't showing how to run another executable; in this case that executable (gdb) happens to be the debugger. <code>EVAL()</code> calls gdb; it's constructed in such a way that the following happens: program forks; one copy busy waits, the other copy execs debugger; debugger comes online, sets a breakpoint right after the EVAL() call, interrupts the busy program and tells it to return; program returns to EVAL() and steps right into the breakpoint so debugger has control again; now debugger is looking at the correct context, evaluate the saved text, resumes the program and quits. From the program's point of view, the net effect is a piece of text got eval'd. It's a joke because that was a lot of hoops to jump through, highly inefficient and quite unreliable. --[[User:Ledrug|Ledrug]] 20:29, 19 July 2011 (UTC)
 
As the original author of the task, I declare: This task is about evaluation, not about starting processes. The task text does not mention "source code" or strings because it is OK to use ASTs as Lisp and E do. I've reworded the header to avoid talking about "programs". —[[User:Kevin Reid|Kevin Reid]] 01:17, 20 July 2011 (UTC)