Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Dec 16, 2025

JS Lingo Script Parity Implementation

Phase 1: Analysis & Setup

  • Understand Python lingo.py implementation
  • Understand current JS markup.js implementation
  • Identify missing types and functions
  • Set up test infrastructure (package.json, playwright config)

Phase 2: Type System Updates

  • Update return value formatting to match Python (wrap primitives in {value, type} dicts)
  • Add support for list types with element_type
  • Fix type checking for all operations

Phase 3: Missing Functions Implementation

  • Add comparison operators (eq, ne, lt, le, gt, ge)
  • Add int function with string/base support
  • Add float and round functions
  • Add str and join functions
  • Add math functions (floordiv, mod, min, max, abs)
  • Add sequence functions (len, range, slice, any, all, sum, sorted)
  • Add sequence ops (map, filter, dropwhile, takewhile, reversed, accumulate, reduce)
  • Fix datetime handling and current.weekday
  • Fix random.randint

Phase 4: Testing

  • Create browser2/js/tests directory
  • Set up playwright test infrastructure
  • Create browser2.spec.js with tests for each test_data file
  • Add tests for hello_world_test_data.json
  • Add tests for basic_math_test_data.json
  • Add tests for all_param_types_test_data.json
  • Add tests for branch_example_test_data.json
  • Add tests for switch_example_test_data.json

Phase 5: Validation

  • Run all tests and fix failures
  • Verify parity with Python implementation
  • Document any known gaps
Original prompt

This section details on the original issue you should resolve

<issue_title>JS Lingo script parity with Python</issue_title>
<issue_description>The lingo script spec is a scripting language embedded in json/yaml and executed by interpreters in javascript and python.

The current implementation is on the dev branch, the documentation for it is in the readme and other files in ./docs. There are examples in src/mspec/data/lingo/pages and src/mspec/data/lingo/scripts for the page-beta-1 and script-beta-1 variations of the spec. The python interpreter is in src/mspec/lingo.py. The python interpreter is tested against the test scripts in tests/test_markup.py. These tests iterate over the *_test_data.json specs in src/mspec/data/lingo/scripts to confirm that given sets of input params return the expected result.

There's been a lot of changes to the scripting language in the python interpreter and we'd like to update the JS interpreter to match. The new spec is outlined in the ./docs/LINGO_* documents. Please update the JS interpreter to have parity in types and functions. The current JS interpreter is in browser2/js/src. It can be tested by running the dev server with ./server.py and then running the playwright tests in this folder.

requirements

  • add support for all types that are defined in the spec
  • add support for all functions defined in the spec
  • add tests for each test file in src/mspec/data/lingo/scripts in browser2/js/tests/browser2.spec.js, they should test that default params return expected result. This is a big ticket so it's fine if not all tests are passing in first PR
  • make a branch off of dev and submit a PR back to the dev branch.</issue_description>

Comments on the Issue (you are @copilot in this section)


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

Copilot AI requested a review from b-rad-c December 16, 2025 06:39
@b-rad-c b-rad-c closed this Dec 16, 2025
@b-rad-c b-rad-c deleted the copilot/update-js-lingo-script branch December 21, 2025 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

JS Lingo script parity with Python

2 participants