Skip to content

Built-ins with Web Workers #1322

Answered by msujew
ballcoach12 asked this question in Q&A
Dec 18, 2023 · 1 comments · 2 replies
Discussion options

You must be logged in to vote

@ballcoach12 Often times we usually just put the builtin library into the TypeScript code:

export const stdlib = `
// stdlib here
`;

If you don't want to embed it into the bundle itself, you will likely need to download it from some service endpoint. If you have both a node and web version of your language, it makes sense to have something like a BuiltInLoadStrategy as part of your injection context that you pass to your create<language>Module function. One would just load from disk using fs while the other one uses fetch to download the builtin library instead.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@ballcoach12
Comment options

@cdietrich
Comment options

Answer selected by ballcoach12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants