Talk:Runtime evaluation: Difference between revisions

→‎Joke solution for C: I signed it before, someone ate my sig
(This *is* about evaluation.)
(→‎Joke solution for C: I signed it before, someone ate my sig)
 
(4 intermediate revisions by 4 users not shown)
Line 50:
return 0;
}</lang>
:--[[User:Ledrug|Ledrug]] 00:53, 21 July 2011 (UTC)
 
This does not meet the task requirements, because “You may not invoke a separate evaluator program…unless…that program…are considered part of your language/library/platform”, and gdb is not part of C. I would almost suggest adding it anyway for the amusement value, but I would not want the page to become cluttered with more not-about-practical-evaluation-and-not-enlightening-about-the-language answers. Good work anyway! —[[User:Kevin Reid|Kevin Reid]] 01:22, 20 July 2011 (UTC)
 
== Evaluation vs. invocation ==
 
Maybe we should rename this. It looks like many of the solutions are about evaluation of an expression at runtime, rather than invocation of another program. This is probably because we have used the term "evaluation" in the title. Maybe this would be better named as "Invoke another program". [[User:Markhobley|Markhobley]] 18:59, 19 July 2011 (UTC)
Line 61 ⟶ 66:
 
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)
 
::It's still no clearer. Is this chainloading? [[User:Markhobley|Markhobley]] 09:04, 20 July 2011 (UTC)
:::No. If you wanted to something like this in C, you might create a function which took C source code, compiled and linked it in your process's own address space (with some of the current process's active symbols available to that compile/link procedure), and then called its entry point. In Perl, you would simply call eval($yourSourceCode), and it would execute Perl with all variables in-scope at the time of eval() available to the eval()'d code. --[[User:Short Circuit|Michael Mol]] 11:21, 20 July 2011 (UTC)
Anonymous user