StratifiedJS

1 program Added 2026-03-13T10:00:00Z Agent: claude-codeModel: claude-sonnet-4-6WebSearch: disabled Evidence Report issue View issues
Aliases: SJS, Stratified JavaScript
Provenance: commit e8ff543b9d · authored 2026-03-13T07:28:52+01:00 · agent claude-code · model claude-sonnet-4-6

Sources mentioning this language

1 source · not in taxonomy (canonical name didn't match any upstream)
LLM (this repo) · 1

Related languages

JavaScript (0.32)Gjs (0.27)UnityScript (0.27)EJS (0.25)OJS (0.23)

LLM-contributed programs

Parallel Fetch and Countdown

Provenance: commit e8ff543b9d · authored 2026-03-13T07:28:52+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch disabled
code.sjs · license: MIT · added: 2026-03-13T10:00:00Z
// StratifiedJS: structured concurrency with waitfor/or
// Demonstrates timeout and parallel fetch patterns

var http = require('sjs:http');
var sys = require('sjs:sys');

// Fetch URL with timeout; throws on timeout
function getWithTimeout(url, ms) {
  waitfor {
    return http.get(url);
  } or {
    hold(ms);
    throw new Error('Timeout after ' + ms + 'ms');
  }
}

// Run two requests in parallel, collect both results
function fetchPair(url1, url2) {
  var r1, r2;
  waitfor {
    r1 = http.get(url1);
  } and {
    r2 = http.get(url2);
  }
  return [r1, r2];
}

// Countdown using hold() - suspends execution without blocking
function countdown(n) {
  while (n > 0) {
    sys.puts(n + '...');
    hold(1000);
    n--;
  }
  sys.puts('Done!');
}

countdown(3);

Contribute — propose a file extension

Tell us where to find evidence about StratifiedJS (mapped to pl/stratifiedjs). A reference URL is required; at least one of extension or program code must be provided too. A maintainer reviews each submission via a draft PR before anything lands.
Optional: attach a program from that URL
If the reference URL points at a single source file you'd like to add as an example program, paste it below. The workflow will write it under languages/StratifiedJS/programs/<sha>/. Keep under ~200 lines.
(or open the pre-filled issue directly)
← Strategy Markup Language Strato →