What will the target architecture look like ? #6
Replies: 6 comments 11 replies
-
Here is how the runtime architecture will look like: Only representing 3 target languages for clarity. |
Beta Was this translation helpful? Give feedback.
-
Here is how the tool architecture will look like: Only representing 1 target add-on for clarity. A critical feature is the direct contract between the tool WASM and the target language WASM. This ensures that the add-on can run in any environment (browser, LSP, CI/CD...) |
Beta Was this translation helpful? Give feedback.
-
What's in the tool ? What's in the wrapper ? Although the WebAssembly committee is actively working on WASI (a spec for calling the host from within the WASM) it will likely take years for it to become broadly available. In the meantime (and maybe forever) we want ANTLR WASM components to only deal with text (and text streams). As an example, the runtime will not accept a file as an input, but rather a character stream as an input, which fetches the characters through a callback to the wrapper. Similarly, the runtime will log warnings and errors through a stream, and will output a serialized ParseTree. The wrapper will know how to deserialize the ParseTree into 'something' that can be traversed by the ParseTreeWalker (how much data will be available locally vs fetched via calls to the WASM parser is a technical detail). Similarly, the tool wrapper will take care of reading options, loading target add-ons, etc... It could provide everything required for lexer/parser generation in the form of a "provider", that the core tool would invoke to get options, main, imported and included grammars, etc... |
Beta Was this translation helpful? Give feedback.
-
I'm leaving maven and LSP aside for now, until the above is discussed and reaches consensus. |
Beta Was this translation helpful? Give feedback.
-
The topic contains high-level/external architecture description (API, wrappers), but it doesn't cover low-level/internal architecture like processing stages (ParseTree -> ATN (also its lowerings) -> target-language (codegen)), general algorithms (ALL, is it possible to simplify or even remove DFA in runtime?). I'm going to create a new topic or extend the existing one after a while. |
Beta Was this translation helpful? Give feedback.
-
Ha :). Ok mate. Go for it!
…On Thu, Feb 15, 2024 at 15:16 ericvergnaud ***@***.***> wrote:
Let's see how it goes, I hope to prove you wrong soon enough 🤣
—
Reply to this email directly, view it on GitHub
<#6 (reply in thread)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAJ7TMCFCS762OLDZIPGAG3YTZ3KFAVCNFSM6AAAAABAWYEF7GVHI2DSMVQWIX3LMV43SRDJONRXK43TNFXW4Q3PNVWWK3TUHM4DIOBVGYYTI>
.
You are receiving this because you commented.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
browser first:
unified wasm runtime:
other evolutions:
Beta Was this translation helpful? Give feedback.
All reactions