createImport = (name, params, returns, js = null, c = null) => {
  const lazy = () => {
    if (typeof params === 'function') params = params();
    if (typeof returns === 'function') returns = returns();
    if (typeof params === 'number') params = new Array(params).fill(valtypeBinary);
    if (typeof returns === 'number') returns = new Array(returns).fill(valtypeBinary);
  };

  if (name in importedFuncs) {
    // overwrite existing import
    const existing = importedFuncs[name];
    lazy();

    existing.params = params;
    existing.returns = returns;
    existing.js = js;
    existing.c = c;
    return;
  }

  const call = importedFuncs.length;
  const ident = String.fromCharCode(97 + importedFuncs.length);
  let obj;
  const get = () => {
    if (obj) return obj;
    lazy();

    obj = new Number(call);
    obj.name = name;
    obj.import = ident;
    obj.params = params;
    obj.returns = returns;
    obj.js = js;
    obj.c = c;
    return obj;
  };

  Object.defineProperty(importedFuncs, name, {
    get,
    configurable: true,
    enumerable: true
  });
  Object.defineProperty(importedFuncs, call, {
    get,
    configurable: true
  });
  importedFuncs.length = call + 1;
}
Create an import function for the Porffor world to use.

@param {string} name - Name of the import
@param {number} params - Number of parameters
@param {number} results - Number of results
@param {function} js - Native (your world) function to call as import implementation
@param {string} c - C source code to compile as import implementation