Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

The forced execution of souce code

Name: Anonymous 2009-11-19 5:27

How's called the ability of a language to interpret new code at runtime (the keyword/function that does this is typically called eval)?

For example Perl, Python, JavaScript and most shell languages have this. C and C++ haven't it.

Does Haskell have it? What about C#?

Note that shit like manually invoking the compiler doesn't count.

Name: Anonymous 2009-11-20 11:34

It's not just about executing "new" code, it's obvious you can do that in almost any language (however IMO it's an important distinction whether the language supports it natively or whether you have to manually supply an entire compiler implementation to do it).

What's interesting is
char buffa[9999];
i = 5;
gets(buffa);
eval(buffa);
printf("%d\n", i);

and then supporting an input like i += 1;

Obviously you're very fucked in C with normal compiled code, as the code itself has no notion of variable names, just to name the least of the problems.

So yeah, maybe you could call one type "dynamic" and the other "static", but I'm not sure this distinction and nomenclature are 100% right.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List