Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Candid Files #17

Open
skilesare opened this issue Aug 27, 2020 · 3 comments
Open

Candid Files #17

skilesare opened this issue Aug 27, 2020 · 3 comments

Comments

@skilesare
Copy link

I'm interested in trying to get this running inside of a DFINITY wasm canister. I think if I get a wasm file and a candid file I can get to a point to poke it with a stick, but I'm not sure if this project produces the candid file. If I have to custom build it, any idea what the function signatures would be to call line entries dynamically? https://sdk.dfinity.org/docs/developers-guide/work-with-languages.html

@mbbill
Copy link
Owner

mbbill commented Aug 27, 2020

that's an interesting idea! Currently it doesn't build a candid file, but it should be relatively easy since you can get JSC.js working with only one or two APIs. You can check out the demo html for the API signature.

@skilesare
Copy link
Author

Looks like these are the culprits here. Any advice on how to suss out what the return types are on these "la" and "va"(etc) functions? Looks like there is a good bit of memory management going on here that is handled in the jsc.js file. That shouldn't be too much of an issue as I think I can script the interaction with the dfinity cannister once I have a valid definition file.:

var asm = Module["asm"](asmGlobalArg, asmLibraryArg, buffer);

Module["asm"] = asm;

var ___emscripten_environ_constructor = Module["___emscripten_environ_constructor"] = function() {
return Module["asm"]["ea"].apply(null, arguments)
};
var ___errno_location = Module["___errno_location"] = function() {
return Module["asm"]["fa"].apply(null, arguments)
};
var __get_daylight = Module["__get_daylight"] = function() {
return Module["asm"]["ga"].apply(null, arguments)
};
var __get_timezone = Module["__get_timezone"] = function() {
return Module["asm"]["ha"].apply(null, arguments)
};
var __get_tzname = Module["__get_tzname"] = function() {
return Module["asm"]["ia"].apply(null, arguments)
};
var _free = Module["_free"] = function() {
return Module["asm"]["ja"].apply(null, arguments)
};
var _jsRound = Module["_jsRound"] = function() {
return Module["asm"]["ka"].apply(null, arguments)
};
var _jsc_eval = Module["_jsc_eval"] = function() {
return Module["asm"]["la"].apply(null, arguments)
};
var _malloc = Module["_malloc"] = function() {
return Module["asm"]["ma"].apply(null, arguments)
};
var _memalign = Module["_memalign"] = function() {
return Module["asm"]["na"].apply(null, arguments)
};
var _memset = Module["_memset"] = function() {
return Module["asm"]["oa"].apply(null, arguments)
};
var _setThrew = Module["_setThrew"] = function() {
return Module["asm"]["pa"].apply(null, arguments)
};
var stackAlloc = Module["stackAlloc"] = function() {
return Module["asm"]["va"].apply(null, arguments)
};
var stackRestore = Module["stackRestore"] = function() {
return Module["asm"]["wa"].apply(null, arguments)
};
var stackSave = Module["stackSave"] = function() {
return Module["asm"]["xa"].apply(null, arguments)
};
var dynCall_i = Module["dynCall_i"] = function() {
return Module["asm"]["qa"].apply(null, arguments)
};
var dynCall_ii = Module["dynCall_ii"] = function() {
return Module["asm"]["ra"].apply(null, arguments)
};
var dynCall_v = Module["dynCall_v"] = function() {
return Module["asm"]["sa"].apply(null, arguments)
};
var dynCall_vi = Module["dynCall_vi"] = function() {
return Module["asm"]["ta"].apply(null, arguments)
};
var dynCall_vii = Module["dynCall_vii"] = function() {
return Module["asm"]["ua"].apply(null, arguments)
};

@mbbill
Copy link
Owner

mbbill commented Aug 28, 2020

For testing purpose I think you may safely delete some of the functions like __get_timezone without breaking jsc.js.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants