Giter Site home page Giter Site logo

Comments (3)

gergoerdi avatar gergoerdi commented on August 23, 2024

I added some trace messages, and the failure seems to come from the call to Js.ASync.getFromQueue in the ASync implementation of Dom for getInput:

export
getFromQueue : JSIOFifoQueue a -> ASync a
getFromQueue (MkJSIOFifoQueue q) =
  MkASync $ \proc =>
    believe_me <$>
      jscall
        "$JSLIB$async.getFromQueue(%0, %1)"
        (Ptr -> JsFn (Ptr -> JS_IO ()) -> JS_IO Ptr)
        q
        (MkJsFn (\x => proc $ believe_me x) )

from idrisjs.

gergoerdi avatar gergoerdi commented on August 23, 2024

The above is compiled into the following:

var _idris_Js_46_ASync_46__123_getFromQueue_95_1_125_ = function(oldbase){
  var myoldbase = new i$POINTER();
  i$valstack_top += 1;
  i$valstack[i$valstack_base + 3] = new i$CON(65764,[i$valstack[i$valstack_base + 1]],_idris__123_APPLY_95_0_125_$65764,null);
  i$ret = $JSLIB$async.getFromQueue(i$valstack[i$valstack_base], i$ffiWrap(i$valstack[i$valstack_base + 3],oldbase,myoldbase));
  i$valstack_top = i$valstack_base;
  i$valstack_base = oldbase.addr;
}

It is this i$ffiWrap callback which tries to call the missing function:

var i$ffiWrap = function(fid,oldbase,myoldbase) {
  return function() {
    var oldstack = i$callstack;
    i$callstack = [];

    var res = fid;

    for(var i = 0; i < (arguments.length ? arguments.length : 1); ++i) {
      while (res instanceof i$CON) {
        i$valstack_top += 1;
        i$valstack[i$valstack_top] = res;
        i$valstack[i$valstack_top + 1] = arguments[i];
        i$SLIDE(2);
        i$valstack_top = i$valstack_base + 2;
        i$CALL(_idris__123_APPLY0_125_,[oldbase])
        while (i$callstack.length) {
          var func = i$callstack.pop();
          var args = i$callstack.pop();
          func.apply(this,args);
        }
        res = i$ret;
      }
    }

    i$callstack = oldstack;

    return i$ret;
  }
}

from idrisjs.

gergoerdi avatar gergoerdi commented on August 23, 2024

NVM recompiling with Idris 1.1.1, it works as expected.

from idrisjs.

Related Issues (6)

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.