Giter Club home page Giter Club logo

Comments (6)

rossberg avatar rossberg commented on August 12, 2024

That's working as intended, and is hard-coded in the syntax, see the grammar. The only way to access a module externally is by invoking an export, so you shouldn't be able to (or need to) observe anything else in a test.

from spec.

kg avatar kg commented on August 12, 2024

That's working as intended, and is hard-coded in the syntax

| AssertEq of string * Ast.expr list * Ast.expr list?

from spec.

rossberg avatar rossberg commented on August 12, 2024

Right, that's the (script) AST. The parsing rule is:

  | LPAR ASSERTEQ LPAR INVOKE TEXT expr_list RPAR expr_list RPAR
    { AssertEq ($5, $6 (c0 ()), $8 (c0 ())) @@ at() }

Those expressions are evaluated in an empty dummy context, so you (intentionally) don't have access to any state. IOW, constant expressions only -- this is intended as a declarative assertion about the behaviour of exported functions.

from spec.

kg avatar kg commented on August 12, 2024

OK, I see. So for the purposes of the ml-proto, we're acting as if each module has its own isolated heap (not the unified heap we will have post-dynamic-linking) and it's not exposed externally (unlike what will happen in embedded environments). And to do heap assertions you shove an assertion routine into the module? Awkward but reasonable, I guess. I don't like having to shove test code inside the module being tested :(

from spec.

rossberg avatar rossberg commented on August 12, 2024

Yes. @titzer was particularly adamant about not having a richer assertion
language, see the discussion on PR #14.

On 29 August 2015 at 04:05, Katelyn Gadd [email protected] wrote:

OK, I see. So for the purposes of the ml-proto, we're acting as if each
module has its own isolated heap (not the unified heap we will have
post-dynamic-linking) and it's not exposed externally (unlike what will
happen in embedded environments). And to do heap assertions you shove an
assertion routine into the module? Awkward but reasonable, I guess. I don't
like having to shove test code inside the module being tested :(


Reply to this email directly or view it on GitHub
#34 (comment).

from spec.

lukewagner avatar lukewagner commented on August 12, 2024

@kg Even with dynamic linking, there will not be a single "unified heap" but, rather, explicit linking of new code into existing module instances. In ml-proto, the static-code/loaded-instance distinction is reflected by the Ast.modul / Eval.module_instance types. When we add dynamic linking, the logical extension would be to change Eval.module_instance to contain a list of Ast.modul. (To prepare for dynamic linking and to avoid confusion like in #306, I've been thinking we should rename Eval.module_instance to something that doesn't imply 1:1. Probably should update design repo first, though.)

from spec.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.