[{"data":1,"prerenderedAt":406},["ShallowReactive",2],{"project-25138872":3},{"id":4,"name":5,"line":6,"line_source":7,"title":8,"url":9,"domain":10,"maker":11,"posted_at":12,"year":13,"points":14,"comments":15,"rank_in_year":16,"shown_in_year":17,"top":18,"tier":19,"category":20,"subcategory":21,"format":22,"keywords":23,"reception":27,"sentiment":28,"stance_mix":29,"scored_comments":34,"aspects":35,"strip":41,"post_text":43,"what":44,"said":58,"maker_in_thread":194,"shape":206,"grid":210,"attempts":364,"same_week":369,"maker_shows":33,"maker_hidden":398,"reader_version":399,"card":400},"25138872","Scratch.js","Interactive JavaScript Scratchpad","title","Show HN: Scratch.js – Interactive JavaScript Scratchpad","https:\u002F\u002Fhole.dev\u002Fscratch\u002F","hole.dev","kahole",1605717592,2020,169,66,351,3028,12,"notable","dev_tools","javascript scratchpad","web_app",[21,24,25,26],"browser repl","literate programming","notebook","curious",0.068,{"positive":30,"neutral":31,"mixed":32,"critical":33},6,18,1,2,27,{"execution":36,"design":38,"idea":39},{"positive":37,"critical":37},0,{"positive":33,"critical":32},{"positive":40,"critical":32},3,[40,40,40,37,37,37,37,40,37,37,40,37,37,37,37,37,37,37,40,37,40,40,37,42,40,40,42,42,40,37,40,40,40,42,40,42,40,40,32,40],5,null,{"problem":45,"audience":43,"pricing":43,"motivation":52,"time_to_build":43,"stack":56,"openness":57,"stage":57,"team_size":57},{"value":46,"source":47,"evidence":48},"Running quick JavaScript snippets like string manipulation, maths and sorting without the web console","maker",[49],{"id":50,"by":11,"text":51},"25140147","I find myself opening and using the web console to do simple tasks like string manipulation, maths, sorting often. I wanted a dedicated and persistent way to do this. And also…",{"value":53,"source":47,"evidence":54},"Wanted a persistent, dedicated way to run simple JS and keep notes and URLs, inspired by Emacs scratch buffer",[55],{"id":50,"by":11,"text":51},[],"unknown",{"praise":59,"objections":83,"requests":101,"questions":140,"alternatives":155},[60,76],{"value":61,"source":62,"evidence":63},"Simple and effective; fun to use for quick JS experiments","commenter",[64,68,72],{"id":65,"by":66,"text":67},"25140361","protoduction","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…",{"id":69,"by":70,"text":71},"25140288","robbiejs","Ah, I do that too, that must be why playing with this app made me happy :-) Thanks for making it, have bookmarked it.",{"id":73,"by":74,"text":75},"25142315","y2bd","It's super cool how the result of any evaluated expression is also itself an evaluable expression.",{"value":77,"source":62,"evidence":78},"Inline multi-line execution via selection is useful",[79],{"id":80,"by":81,"text":82},"25140742","jawnknee","Very cool. Love this - great work!",[84,94],{"value":85,"source":62,"evidence":86},"Infinite loops such as while(1) can freeze the tab with no escape",[87,91],{"id":88,"by":89,"text":90},"25140526","angleofrepose","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…",{"id":92,"by":66,"text":93},"25140782","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.",{"value":95,"source":62,"evidence":96},"Cursor can get stuck inside output tags (bug, since fixed)",[97],{"id":98,"by":99,"text":100},"25142544","SamBam","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 ``` \"\u003Cstyle>body {background-color:…",[102,116,123,130],{"value":103,"source":62,"evidence":104},"Support Mac Command key instead of Ctrl for run (fixed)",[105,109,113],{"id":106,"by":107,"text":108},"25139848","OzzyB","Can you give us Mac users some love and replace ctrl w\u002F command ? My muscle memory is giving me a hard time xD",{"id":110,"by":111,"text":112},"25145875","anonytrary","I suggest using CMD+Enter for Mac. This is the closest\u002Fbetter alternative to CTRL+Enter for PC, albeit Mac having a CTRL key.",{"id":114,"by":11,"text":115},"25147707","fixed",{"value":117,"source":62,"evidence":118},"Render Element or Node results as DOM instead of [object] text",[119],{"id":120,"by":121,"text":122},"25144041","Lerc","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…",{"value":124,"source":62,"evidence":125},"Soft-wrap lines and support mobile execution",[126],{"id":127,"by":128,"text":129},"25143675","joshxyz","Is it poasible to soft-wrap lines and execute functions on mobile? Its cool haha",{"value":131,"source":62,"evidence":132},"Remove pasted formatting by default (fixed)",[133,137],{"id":134,"by":135,"text":136},"25139737","PieUser","When you paste something it keeps the formatting, intended?",{"id":138,"by":11,"text":139},"25147714","Fixed, formatting is now removed",[141,148],{"value":142,"source":62,"evidence":143},"How to handle infinite loops in browser code execution",[144,145],{"id":88,"by":89,"text":90},{"id":146,"by":89,"text":147},"25140574","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…",{"value":149,"source":62,"evidence":150},"Why build this when JavaScript REPLs already exist",[151],{"id":152,"by":153,"text":154},"25141055","colejohnson66","Not to be rude (I actually like it), but why build your own instead of using one of the many JavaScript REPLs already available?",[156,163,169,180,187],{"value":157,"source":62,"evidence":158},"Starboard notebook",[159,160],{"id":65,"by":66,"text":67},{"id":161,"by":66,"text":162},"25140669","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…",{"value":164,"source":62,"evidence":165},"Observable notebooks",[166],{"id":167,"by":89,"text":168},"25140929","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…",{"value":170,"source":62,"evidence":171},"Stopify JS-to-JS instrumentation",[172,176],{"id":173,"by":174,"text":175},"25141238","emmanueloga_","https:\u002F\u002Fwww.stopify.org\u002F",{"id":177,"by":178,"text":179},"25141412","rng_civ","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…",{"value":181,"source":62,"evidence":182},"Easylang online IDE",[183],{"id":184,"by":185,"text":186},"25140803","chkas","I have made something similar (https:\u002F\u002Feasylang.online\u002Fide\u002F). It is a language of its own, which is compiled and interpreted by WASM. The problem with hanging in endless loops is…",{"value":188,"source":62,"evidence":189},"Plain contenteditable data URL scratchpad",[190],{"id":191,"by":192,"text":193},"25141750","drran","The simplest scratchpad, which works in Firefox and Chromium at least. ``` data:text\u002Fhtml,\u003Chtml contenteditable> ```",{"comments":195,"answered":30,"key":196},11,[197,200,203],{"id":198,"text":199},"25144244","Great suggestions!",{"id":201,"text":202},"25142638","(Now fixed) Thanks for letting me know, there is indeed a small issue with the clear() function. I considered supporting only plain-text, but I found the editable visible style…",{"id":204,"text":205},"25142764","This should now be fixed!",{"commenters":207,"max_depth":30,"maker_replies":195,"first_comment_mins":208,"lifespan_hours":209},36,51,78,[211,213,215,216,217,221,223,225,227,229,231,233,234,237,239,241,243,246,249,251,252,253,255,257,259,262,265,268,271,273,275,277,278,279,281,283,286,288,291,294,298,301,304,305,306,307,311,312,316,318,321,325,327,331,332,333,336,338,340,341,343,346,349,351,356,361],[120,37,40,212,121,37],"project\u002Fneutral\u002Fexecution",[198,37,37,214,11,32],"commenter\u002Fneutral\u002Fnone",[88,32,40,212,89,37],[146,32,40,212,89,37],[218,32,37,219,220,37],"25140654","commenter\u002Fneutral\u002Fexecution","jraph",[222,32,37,219,89,37],"25140839",[224,32,37,219,220,37],"25141503",[226,32,37,219,89,37],"25141961",[161,32,37,228,66,37],"other\u002Fneutral\u002Fexecution",[230,32,37,219,220,37],"25140700",[232,32,37,219,66,37],"25140761",[167,32,37,219,89,37],[235,32,40,212,236,37],"25140731","mattigames",[92,32,37,238,66,37],"commenter\u002Fcritical\u002Fexecution",[184,32,37,240,185,37],"other\u002Fneutral\u002Fnone",[242,32,37,240,89,37],"25141529",[244,32,40,212,245,37],"25141193","1-more",[247,32,37,219,248,37],"25141906","flafla2",[250,32,37,214,245,37],"25142166",[173,32,37,240,174,37],[177,32,37,228,178,37],[254,32,37,214,89,37],"25143214",[256,32,37,214,178,37],"25143969",[258,32,37,240,89,37],"25141479",[260,32,37,228,261,37],"25141791","shortercode",[263,32,37,228,264,37],"25141913","artifact_44",[266,32,37,214,267,37],"25142772","gitgud",[269,32,37,214,270,37],"25143027","teraflop",[272,32,37,219,267,37],"25143825",[274,32,37,214,89,37],"25143149",[98,33,40,276,99,37],"project\u002Fmixed\u002Fexecution",[201,33,37,212,11,32],[204,33,37,212,11,32],[106,40,40,280,107,37],"project\u002Fneutral\u002Fdesign",[282,40,37,280,11,32],"25139989",[284,40,40,280,285,37],"25140239","kamikaz1k",[287,40,37,280,11,32],"25147705",[289,40,40,280,290,37],"25141876","bikeshaving",[73,292,42,293,74,37],4,"project\u002Fpositive\u002Fidea",[295,292,40,296,297,37],"25145468","project\u002Fneutral\u002Fnone","r3trohack3r",[299,42,37,240,300,37],"25140589","arthurcolle",[302,30,40,303,70,37],"25139594","project\u002Fneutral\u002Fidea",[50,30,37,303,11,32],[69,30,42,293,70,37],[65,30,42,293,66,37],[308,30,37,309,310,37],"25146214","other\u002Fneutral\u002Fdesign","mNovak",[152,30,40,303,153,37],[313,30,37,314,315,37],"25141919","other\u002Fneutral\u002Fidea","latchkey",[317,30,37,293,11,32],"25142515",[319,320,40,280,310,37],"25146208",7,[322,323,37,314,324,37],"25145570",8,"alan_russell",[127,326,40,280,128,37],9,[328,329,40,280,330,37],"25142317",10,"pwdisswordfish0",[110,195,40,280,111,37],[114,195,37,280,11,32],[334,195,42,335,111,37],"25173301","project\u002Fpositive\u002Fdesign",[337,18,40,280,81,37],"25140608",[339,18,37,280,11,32],"25140655",[80,18,42,335,81,37],[134,342,40,280,135,37],13,[344,342,37,345,11,32],"25139917","maker\u002Fneutral\u002Fidea",[347,342,40,212,348,37],"25140492","purplecats",[138,342,37,350,11,32],"maker\u002Fneutral\u002Fexecution",[352,353,32,354,355,37],"25140617",14,"project\u002Fcritical\u002Fdesign","Naskid",[357,358,42,359,360,37],"25140248",15,"project\u002Fpositive\u002Fnone","tomcat27",[191,362,32,363,192,37],16,"project\u002Fcritical\u002Fidea",[365,368],{"id":366,"t":367,"points":33,"comments":37},"24908796",1603814983,{"id":4,"t":12,"points":14,"comments":15},[370,375,379,384,389,393],{"id":371,"name":372,"points":373,"category":374},"25088683","Stargate (Dwitter 20584)",377,"creative",{"id":376,"name":377,"points":378,"category":20},"25110879","gh-pages-url-shortener",355,{"id":380,"name":381,"points":382,"category":383},"25099847","LibreASR",233,"ai",{"id":385,"name":386,"points":387,"category":388},"25139833","Podcast API",223,"data",{"id":390,"name":391,"points":392,"category":374},"25071643","dosylogo",174,{"id":394,"name":395,"points":396,"category":397},"25127468","Twelve70",158,"consumer_social",false,"v2",{"id":401,"name":5,"line":6,"ai":398,"cat":20,"year":13,"points":14,"comments":15,"rec":27,"s":402,"top":18,"kw":403,"maker":11,"domain":10,"tier":19,"attempts":33,"strip":404,"url":9,"mix":405,"praise":61,"objection":85,"sub":21},25138872,0.07,[21,24,25,26],"3330000300300000003033053355303335353313",[30,31,32,33],1794036598549]