News for hackers. Stuff that matters.
Re:Show HN: Scratch.js – Interactive JavaScript Scratchpad by kahole on Wednesday November 18, 2020 @01:10PM (#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 just a place to keep notes, urls and stuff. So I made this "literate programming" notepad.

I'm also former Emacs user, and I like the lisp scratch buffer there, which is similar.

Re:Show HN: Scratch.js – Interactive JavaScript Scratchpad by protoduction on Wednesday November 18, 2020 @01:23PM (#25140361)
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 (but then it has additional features such as top-level await, plugin, and Python support).

Consider supporting lit-html[2] literals instead of strings for HTML output, it works really well in notebook environments.

One more thing you can consider: a esm tagged literal that uses import(<data url of the code>), you can then use ES Module imports to dynamically load code. Here's a blog post about that approach [3]

[1]: https://starboard.gg [2]: https://lit-html.polymer-project.org/ [3]: https://2ality.com/2019/10/eval-via-import.html

Re:Show HN: Scratch.js – Interactive JavaScript Scratchpad by mNovak on Wednesday November 18, 2020 @11:25PM (#25146214)
Starboard looks very cool as well. Is there anyway to push all the outputs into a separate 'document'? That'd be super cool for e.g. Latex too.

My issue with these notebooks is they always get very cluttered with inline outputs after a couple 100 lines.

Re:Show HN: Scratch.js – Interactive JavaScript Scratchpad by latchkey on Wednesday November 18, 2020 @03:20PM (#25141919)
I've been using this extension for a while...

https://chrome.google.com/webstore/detail/markdown-new-tab/d...

Would be neat to see this integrated in somehow.

Re:Show HN: Scratch.js – Interactive JavaScript Scratchpad by kahole on Wednesday November 18, 2020 @04:13PM (#25142515)
That would be awesome!
Re:Show HN: Scratch.js – Interactive JavaScript Scratchpad by robbiejs on Wednesday November 18, 2020 @01:19PM (#25140288)
Ah, I do that too, that must be why playing with this app made me happy :-) Thanks for making it, have bookmarked it.
Re:Show HN: Scratch.js – Interactive JavaScript Scratchpad by colejohnson66 on Wednesday November 18, 2020 @02:13PM (#25141055)
Not to be rude (I actually like it), but why build your own instead of using one of the many JavaScript REPLs already available?