Re: Phix 0.8.2 uploaded

new topic     » goto parent     » topic index » view thread      » older message » newer message
petelomax said...

<snip>
https://rosettacode.org/wiki/Respond_to_an_unknown_method_call#Phix
<snip>
they're ever likely to be called thousands of times a second, for the very same reasons that myfunc(x,y) will beat call_func(routine_id("myfunc"),{x,y}) hands down.

Woaaahhh... this addresses something i asked for in OE many many years ago, didn't get, and now use a preprocessor to make up for the absence of! Or what Donald Rumsfeld once said (paraphrasing) "we don't know what it is we don't know". People made fun of him, as if he had spouted nonsense (to be fair, he was long-winded), but he had finally told a logical truth.

The preprocessor can also make up for the lack of a come_from() (which is unrelated to the goto()).

But while it was originally only to control the access to an app's shared variables, it can now also know if it has a variable or function. Since it has access to it's var list, a subprogram (or the main control program) can save it's list, write out a different version of itself, abort() and restart, reload the vars, and resume with the function which was asked for. And know it.

But yes, speed is an issue. It's a big hit with the abort/run, but may be faster in the long run than a pure interpreter. I had hopes OE would eventually have a code block that could un/load OE source code and run it, as an interpreter, rather transparently to the programmer and outside world, like Greg's mention of re/loadable .il code. I suspect this was the promise of .dll code blocks, but oh well.

Equally wonderful hack, Pete!

Kat

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu