Urgent.News

What's breaking now, across thousands of outlets.

Tech

JSLab is out: write code, watch it run as you type

JSLab is available today for Apple Silicon Macs running macOS 14 or later. It's a native JavaScript and TypeScript scratchpad. Open a tab, type, and every result, log and error lands in the output panel, tagged with the line that produced it. No project, no terminal, no build step. A first tab const orders = [ { region : "EU" , total : 120 } , { region : "US" , total : 80 } , { region : "APAC" ,…

JSLab, a JavaScript and TypeScript scratchpad for Apple Silicon Macs, debuted today. This tool eliminates the need for projects, terminals, or build steps. Simply open a tab, type your code, and watch the output appear right next to each line.

For instance, a simple code snippet such as:

```

const orders = [ { region : "EU", total : 120 }, { region : "US", total : 80 }, { region : "APAC", total : 210 } ];

const revenue = orders.reduce((s, o) => s + o.total, 0);

//? "Revenue: ${revenue}"

```

will display "Revenue: 410" next to the line where the result was calculated.

Modify the code and the output updates instantly without having to press any key. Auto Run feature automatically re-runs your code as you stop typing.

To view the output, just click on a row in the panel and the editor jumps to that line. You can also use magic comments for logging values; for example `//?` logs a value, `//? $.length` logs part of the array length.

JSLab supports three runtimes: Bun by default, Browser, or Browser & Node APIs. Each tab runs one of these runtimes.

You can install npm packages complete with types and autocomplete. The tool also lets you ask AI to read your code and generate an inline diff for review. If you accept the changes, they are saved.

Ollama runs locally, but you can also use OpenAI, Anthropic, or Google Gemini APIs if you have your own API key stored in macOS Keychain. Your data remains on your Mac, with no telemetry or crash-reporting services.

Each feature of JSLab has its own dedicated post in the Scratchpad JS series. The official documentation is available at js-lab.app/docs. Try JSLab for free for 14 days without needing an account at js-lab.app. If you encounter any issues or notice any inaccuracies, please report them in the comments.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at dev.to →

More in Tech

Cross-validation, and the split that hides a model's failure

Cross-validation is how most models get their score. Six points worked through by hand show how k-fold works, and how the same model scores 0.80 or −0.67 depending only on how the data was split.

  • Cross-validation assesses model performance by splitting data into folds.
  • Hidden flaw: model scores higher when tested on data it saw during training.
  • Group-based cross-validation prevents overfitting to specific data groups.

Linear Light Upscaling Is Correct, and It Cost Me 18 Shadow Levels

Every resampling article opens with the same demo: downscale a black-and-white checkerboard in sRGB, get a muddy grey that should have been mid-grey, then do it in linear light and get the right…

  • Resampling in linear light preserves high-frequency detail better than sRGB.
  • Linear resampling results in worse PSNR compared to sRGB, wasting bits in shadows.
  • Quantizing linear intermediate to 8-bit causes banding in dark shadows, reducing quality.

More from Sunday 15 November →