Version 6 (modified by cotto, 12 years ago)

add deficient lvalue model

Hudson: Is this gonna be a standup fight, sir, or another bughunt?
Gorman: All we know is that there's still no contact with the colony, and that a xenomorph may be involved.
Frost: Excuse me sir, a-a what?
Gorman: A xenomorph.
Hicks: It's a bughunt.

-- Aliens, 1986

These subsystems need rethinking and revision and refactoring, because:

  • hashes
    • the Hash PMC is too entertwined with the guts of src/hash.c which knows too much about the internals of Hash PMCs
    • it's not clear if the hash/bucket algorithm is sufficiently collision free
    • OrderedHash is a mess of semantics and implementation
    • some Parrot systems need C-like hashes while user-visible parts of Parrot need PMC-ish hashes

(Perhaps now is a good time to re-examine the thought of using an external hash library rather than re-inventing our own. --coke)

  • freeze/thaw
    • The code in src/pmc_freeze.c pokes deep into the guts of the STRING structure, without using any kind of API, hindering any kind of refactoring or cleanup of STRING internals.
    • It also relies on implementation details of the io subsystem, such that altering seemingly unrelated io functions can cause segfaults or misbehavior of the freeze/thaw code. This is often related to the string poking.
    • The code and comments in this subsystem give the impression of being a exploratory prototype or following an incomplete specification. For example, the main data structure in the freeze/thaw process (IMAGE_IO) claims to be a "stand-in for some kind of serializer PMC which will eventually be written".
    • There are hints in the documentation that the current implementation dates as far back as 2003, with comments that some parts of it "might go away sometime".
  • CLI argument parsing
    • The current code is closely tied to imcc and will inhibit the eventual migration to pirc.
    • It's not possible to add new options at runtime.
    • It's not possible for subsystems to register new options.
    • Subsystems do not have access to arguments passed directly to the parrot binary.
  • lvalue model (WhyDoesNQPGenerateInefficientCode)
    • PIR does not have clear and consistent assignment/binding semantics.
    • This forces nqp to be rather pessimal in the assumptions it makes about the contents of lexical variables.
    • It's also a source (actual, not potential) of confusion for HLL developers.
    • Note: Research into this problem should include a look at how other VMs (e.g. JVM, CLI, PyPy, CPython, Perl 5, MRI, etc) deal with this. PyPy may be of special interest because that project aims for a similar niche to Parrot.