foreign function interface in KRL so that rulesets can use JavaScript modules

Open
#617 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
5/5
Estimated time
Over a week
Newbie friendliness
20/100
Issue type
Feature
Clarity
Needs clarification
Activity status
Stale
Domain
api, backend

Research direction

Start by defining how KRL rulesets would import JavaScript modules and how the engine would load modules and their dependencies. Clarify whether URL-based imports are supported and how failures from missing dependencies should be reported; the feature is done when these behaviors are specified and implemented.

Written by the indexing model from the issue text.

Description

enhancement new language feature

Phil
Today at 9:33 AM
Idea: foreign function interface in KRL so that rulesets can use JavaScript modules. Any exported function world be importable. (edited)
👍
1

3 replies

Phil
32 minutes ago
One question would be how the module (and its dependencies) would be loaded into the engine so it’s available.

Phil
31 minutes ago
This would allow mixed programs of KRL and JS and allow KRL programs to make use of existing JS modules without having to modify the engine to load them.

Phil
24 minutes ago
JS imports can be urls. So we could limit modules to only those that load dependencies from urls. But I’m not sure how we do that to arbitrary depth. I guess then it’s the developers problem. We just report that a module can’t be loaded because dependencies can’t be found.

Dominant language
TypeScript
Stars
51
Forks
10
PR merge metrics
No merged PRs in 30d

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Picolab/pico-engine

All issues in Picolab/pico-engine

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.