An interactive way of blogging about JavaScript
blog.klipse.tech
blog.klipse.tech
1. Example that spins up an express server in the example you can actually hit: http://blog.tonicdev.com/2016/03/09/snapshots.html
2. A blog post I wrote about hacking JSX with many runnable examples: http://tolmasky.com/2016/03/24/generalizing-jsx/
3. Node's fs docs with the examples converted to embed: http://capicue.com/fs.html
For other people: Is there anything like Tonic Dev (notebook kind of thing) that runs locally? I want to love Tonic but without offline support, that will never happen...
I'd say it's more lightweight by default (it's not mandatory to use an editor like CodeMirror) and more flexible because of the plugin system (there are plugins for using Ace or CodeMirror as editors, or for compiling ES6, CoffeeScript, Less, Stylus, Markdown).
It also has a Console plugin, like the one in devtools, that makes it work like klipse. https://twitter.com/ghindas/status/697790917302996993
There are a bunch of demos on the site: https://ghinda.net/jotted/#demos
One inconvenience. I entered "while (1) {}" and the page locked up and needed to be reloaded. An infinite loop could easily happen unintentionally, and it's not user-friendly to hang, especially when the goal is an Alan Kay style educational/interactive system. It would be nice to have a "stop" button so the user could continue editing, rather than losing the page. Unfortunately I don't see any way to do this within existing browsers.
The problem is that the page is just having the browser execute the javascript directly. Javascript in the browser doesn't have ways to directly debug itself or enforce resource limits. It would be nice if there was a javascript interpreter (yes, in javascript) that could enforce step and resource limits and have debugging support that pages could interactively embed.
And Ruby: http://blog.klipse.tech/ruby/2016/06/20/blog-ruby.html
There is no reason why Wikipedia couldn't do that.
I wrote a MediaWiki plugin to do pretty much this for JavaScript. I use it for helping teach kids JavaScript. http://fingswotidun.com/code/index.php/Main_Page
The difficulty arises when you want to extend the abilities of the wiki to do things like this within the revision/revertible mechanism that Wikipedia supports.
Now that articles are not just text and images, they need a standard on what they can support. What version of Logo will they use? Do they have an emulator, or a transpiled JS VM? Who created that? Will that support mobile devices? How do you enter text on those? What are the licenses involved? OK, Logo is a given, but what else will they support? JavaScript? Processing? C++? What version of the compiler? Do they host it themselves or use a public service? It gets blurry. What about the article about an old computer, will they also embed an emulator? Those exist. And a game if it's public domain? It's a computer, after all, right? Where do you draw the line?
I agree with the sentiment, but there are big logistical and political problems related to that. Just look at how weird their audio/video support is already because they wanted to make sure they're using free players, free codecs, free assets.
I realize I'm only listing problems, but it's important to think of those. From my perspective, I think it's a lot more about WikiPedia picking their battles and focusing in textual information (with tidbits of other media) rather than "never thinking about that".
Actually letting people play with the technology is an awesome thing, but I wonder if WikiPedia is the place for that.
Good thing sites like https://archive.org/details/softwarelibrary_msdos_games exist.
All in all it would help, but only with trivial snippets approaching hello-world complexity or self-contained examples better suited for tutorials rather than encyclopaedias.
This looks like another vector for XSS... when controlling your own content, no big deal. But if Wikipedia becomes an opening for people to run arbitrary JS code in the browser... even if only for a brief time until another editor corrects it. Well, I can see why Wikipedia might not want that.
<Javascript>
[1,2,3].map((n) => (n+1))
</Javascript>
But the of course requires you to implement the page using react, which isn't what everyone is doing. <JavaScript src={`[1, 2, 3].map(n => n + 1)`} />I also have something similar going on with my blog. It focuses on game development, so I actually embed an iframe with a canvas to let the users play around with the code as they learn.
I really think that interactive interfaces like this for blogs and tutorials will be more common place in the future.
[1]https://blog.codinghorror.com/our-programs-are-fun-to-use/
What I did was run code in a worker with events and drawing commands passed through messages.
http://fingswotidun.com/code/index.php/Naughty_Bits
There's probably still a few more things to do to make it properly secure, but at least you can't just kill the page with while(true);
This works in the same vein and lets you play around with the code you are learning. I am definitely using this the next time I blog about code or algorithms
Mediawiki plugins or Greasemonkey scripts pave the way for what takes years of "project work" to integrate.