Topic 05 Professional experience · Parsing · Types · WebAssembly
Expression interpreters and cross-language integration
I helped maintain and extend an existing C++ library, adding functions, operators and types as part of a team. I individually developed its WebAssembly version to bring expression evaluation to the browser. My work combined core evolution and the cross-language bridge, with distinct scopes of authorship.
Context
Interpreter libraries turn text into a structure that can be validated and evaluated. Using that capability in another environment adds an integration boundary.
My contribution combines team-based work on an existing codebase and individual implementation of browser integration. This is professional experience, rather than a personal product.
Problem
Before an expression is evaluated, its elements must be recognized, precedence respected and operations checked against the types involved.
Across languages, value conversion, error representation and available operations need explicit contracts.
My contribution
I helped maintain and extend the existing C++ library, adding functions, operators and types as part of a team; I did not create the original core.
I individually developed the WebAssembly version and JavaScript integration to make evaluation available in the browser.
My experience also includes contributing to a Ruby/C++ integration with shared authorship.
Technical criteria
In the browser integration I developed, I reused the C++ core through WebAssembly rather than rewriting the interpreter in JavaScript. That approach brings existing behavior to another environment without creating a second implementation of interpretation.
My technical reasoning separates expression meaning from value transport across languages: the bridge needs understandable types, inputs, outputs and errors. A small example such as 2 + 3 * 4 explains precedence without exposing a professional grammar.
Alternatives and trade-offs
General criteria and technical analysis written for this portfolio.
- Reusing a core can reduce divergence, but does not remove differences in numeric representation, memory or failure handling across environments.
- Syntax and type validation are separate responsibilities. Text can be structurally valid while describing a meaningless operation.
Application and examples
The visuals on this page were written for the portfolio. They use common mathematics and predefined results without executing a professional library.
Tokenization
Recognize numbers, operators and parentheses as separate elements of the text.
Structure
Organize elements according to precedence and grouping before evaluation.
Validation
Check operands and types. Text in a numeric multiplication produces an error in the example.
Integration
Define how values and errors cross the boundary between native code and the application using it.
Visualization
Stage 1 of 5: Expression
Valid formula
01 · Expression
quantity * price * (1 - discount)02 · Tokens
quantityvariable*operatorpricevariable*operator(parenthesis1number-operatordiscountvariable)parenthesis
03 · Structure
Multiplication of (quantity × price) by (1 − discount). The parentheses make the subtraction happen before the final multiplication.
04 · Validation
- Variables defined: quantity, price, discount
- The * operator receives two numbers
- The - operator receives two numbers
05 · Result
108
3 × 40 × (1 − 0.1) = 108
Example values: quantity = 3 · price = 40 · discount = 0.1
Formula with an error
01 · Expression
quantity * price * (1 - "10%")02 · Tokens
quantityvariable*operatorpricevariable*operator(parenthesis1number-operator"10%"text)parenthesis
03 · Structure
Multiplication of (quantity × price) by (1 − "10%"). The structure is syntactically valid: the problem only shows up in semantic analysis.
04 · Validation
- Variables defined: quantity, price
- The * operator receives two numbers
- The - operator receives a number and a text value
05 · Result
The "-" operator received a number and a text value. The formula is rejected before any calculation.
Example values: quantity = 3 · price = 40
Text description
Valid formula
- Expression:
quantity * price * (1 - discount). The formula text, as someone would write it in a business rule. - Tokens: quantity (variable), * (operator), price (variable), * (operator), ( (parenthesis), 1 (number), - (operator), discount (variable), ) (parenthesis).
- Structure: Multiplication of (quantity × price) by (1 − discount). The parentheses make the subtraction happen before the final multiplication.
- Validation: Variables defined: quantity, price, discount (ok); The * operator receives two numbers (ok); The - operator receives two numbers (ok).
- Result: 3 × 40 × (1 − 0.1) = 108
Formula with an error
- Expression:
quantity * price * (1 - "10%"). The formula text, as someone would write it in a business rule. - Tokens: quantity (variable), * (operator), price (variable), * (operator), ( (parenthesis), 1 (number), - (operator), "10%" (text), ) (parenthesis).
- Structure: Multiplication of (quantity × price) by (1 − "10%"). The structure is syntactically valid: the problem only shows up in semantic analysis.
- Validation: Variables defined: quantity, price (ok); The * operator receives two numbers (ok); The - operator receives a number and a text value (fails).
- Result: The "-" operator received a number and a text value. The formula is rejected before any calculation. Not evaluated. The error is reported before execution.
What this experience demonstrates
I developed a WebAssembly version that makes expression evaluation available in the browser, alongside team-based contributions to the C++ core. Individual authorship covers the browser version, not the entire library or every integration.
The demonstration on this page explains concepts with fictional data; it does not represent the grammar, catalogue or execution of the professional work.