A stupid concept..

Discussion in 'CommandHelper' started by Synthproc, Apr 15, 2017.

  1. Synthproc

    Synthproc Member

    MethodScript is a scripting language, so "she" basically and simply passes the script to the lexer, then to the abs. layer, etc. Just to execute it once, right? So, of any way, a functional code is always obtained at the end, but is discarded or saved in cache (when /reloadaliases called. I don't know, is? I supossed that by logic). But, it would not be efficient (or what factors would prevent) the allocation of this functional code as a class and then hook that class directly to the provider?

    SIMPLY: If instead of discarding code or caching it (use of memory), the code were allocated at an class created with Reflection and then hooked directly to the provider, but the hook were handled from CommandHelper?

    (obs.: Just a curiosity what-if question)
  2. PseudoKnight

    PseudoKnight Well-Known Member

    On load and /recompile, most scripts are compiled and cached so that they can be executed fast later. Any scripts in libraries are compiled and cached the first time they're used. This barely uses any memory compared to things like chunks.

    I don't fully understand your questions, though.
  3. Synthproc

    Synthproc Member

    Boom, and then I though "Nyah, and if I link the coded script directly to the provider?". Really, a stupid concept.

    About the "compile per use", it was how I heared how a certain scripting (literally, "scripting") "platform" works. Of course, I already expected that the band do not play this way. 2017, a thing like this is unacceptable.
  4. PseudoKnight

    PseudoKnight Well-Known Member

    Scripting is a vague term. It can be characterized by a lot of things: high level, easy-to-learn, interpreted, domain specific, control language, extension language, linear, plain text distribution.

    Here the text files are tokenized with a lexer, compiled into a functional parsetree, optimized, checked for errors, cached if they're an include or an alias (since those can be run multiple times), then executed if they're an .ms file. So some files are not cached, and of course /interpreter code is also not cached. It only caches where appropriate to do so.