Scratch.js

Dev tools

javascript scratchpad

SHOW HN2020

169points
66comments
#351of 3,028 in 2020
Top 12%of 2020 by points

How HN took it

CuriousMostly questions and neutral comments

6 positive, 18 neutral or asking, 1 mixed, 2 critical, out of 27 comments about the project. Thread score +0.07.

Idea: 3 for, 1 againstDesign: 2 for, 1 against

The thread, comment by comment

Each row is a top-level comment and its replies, in HN's order. Select a cell to open that comment on HN.

positive neutral or mixed critical about another commenter or something else the maker

What HN said

What people liked

  • Simple and effective; fun to use for quick JS experiments

    From 3 comments
    • I love how simple and effective this is. I'm also building a web-based literate programming environment called Starboard[1] that's probably a hundred times the amount of code…
      protoduction on HN
    • Ah, I do that too, that must be why playing with this app made me happy :-) Thanks for making it, have bookmarked it.
      robbiejs on HN
    • It's super cool how the result of any evaluated expression is also itself an evaluable expression.
      y2bd on HN
  • Inline multi-line execution via selection is useful

    From 1 comment

Objections

  • Infinite loops such as while(1) can freeze the tab with no escape

    From 2 comments
    • Do you, or the broader community, have any ideas about solving infinite loops? I'm on mobile so I can't test this at the moment, but I imagine that while(1) crashes the tab. What…
      angleofrepose on HN
    • A determined user will still be able to figure out something that blocks forever, for instance run a WASM program that has an infinite loop in it.
      protoduction on HN
  • Cursor can get stuck inside output tags (bug, since fixed)

    From 1 comment
    • Very cool. Small issue: I find that the cursor can be hard to use sometimes. For example, if I clear and then execute the single line ``` "<style>body {background-color:…
      SamBam on HN

Requests

  • Support Mac Command key instead of Ctrl for run (fixed)

    From 3 comments
    • Can you give us Mac users some love and replace ctrl w/ command ? My muscle memory is giving me a hard time xD
      OzzyB on HN
    • I suggest using CMD+Enter for Mac. This is the closest/better alternative to CTRL+Enter for PC, albeit Mac having a CTRL key.
      anonytrary on HN
    • fixed
      kahole on HN
  • Render Element or Node results as DOM instead of [object] text

    From 1 comment
    • Suggestions: ``` If the result is an Element (or perhaps Node) insert it into the document instead of for example "[object HTMLCanvasElement]" A potentially more difficult one…
      Lerc on HN
  • Soft-wrap lines and support mobile execution

    From 1 comment
    • Is it poasible to soft-wrap lines and execute functions on mobile? Its cool haha
      joshxyz on HN
  • Remove pasted formatting by default (fixed)

    From 2 comments

Questions

  • How to handle infinite loops in browser code execution

    From 2 comments
    • Do you, or the broader community, have any ideas about solving infinite loops? I'm on mobile so I can't test this at the moment, but I imagine that while(1) crashes the tab. What…
      angleofrepose on HN
    • I am aware of multiple hacky solutions, such as loop detection and adding timeouts. This fails in most non-trivial creative coding applications due to long running code. I'm…
      angleofrepose on HN
  • Why build this when JavaScript REPLs already exist

    From 1 comment
    • Not to be rude (I actually like it), but why build your own instead of using one of the many JavaScript REPLs already available?
      colejohnson66 on HN

Alternatives named

  • Starboard notebook

    From 2 comments
    • I love how simple and effective this is. I'm also building a web-based literate programming environment called Starboard[1] that's probably a hundred times the amount of code…
      protoduction on HN
    • On Starboard[0] I approached this by sandboxing the notebook code in an iframe on a different origin. This sandboxing has to be done anyway to prevent XSS. If you type…
      protoduction on HN
  • Observable notebooks

    From 1 comment
    • Hi, yes! I like your project. I chatted about similar things on your launch post here. You also address this explicitly on your product which I appreciate. What I'm getting at is…
      angleofrepose on HN
  • Stopify JS-to-JS instrumentation

    From 2 comments
    • https://www.stopify.org/
      emmanueloga_ on HN
    • To add to this comment, Stopify is a JS-to-JS compiler that instruments sync JS code to make them interruptible at set points. The paper [0] can explain it better than I ever…
      rng_civ on HN
  • Easylang online IDE

    From 1 comment
    • I have made something similar (https://easylang.online/ide/). It is a language of its own, which is compiled and interpreted by WASM. The problem with hanging in endless loops is…
      chkas on HN
  • Plain contenteditable data URL scratchpad

    From 1 comment
    • The simplest scratchpad, which works in Firefox and Chromium at least. ``` data:text/html,<html contenteditable> ```
      drran on HN

Category, keywords, summaries and labels on this page were made by AI (Thread Reader v2) and not checked by hand. Each point links to the comments it came from.

Add a badge to your READMEShown on HackerShow
[![Shown on HackerShow](https://hackershow.org/badge.svg)](https://hackershow.org/show/25138872)