A TW5-compatabile sidecar code-snippet runner for Windows

Hello all you wonderful Tiddlers.

I really like the Literate Programming experience of Jupyter Notebook, and was exploring ways to add similar functionality to TiddlyWiki; the ability to execute code block snippets and put the results immediately back into the document. Unlike Jupyter though, I didn’t want to limit myself to just Python; I wanted a lot support for various languages I wanted to learn and toy with. Docker Containers is the obvious solution to this; however; the design principals of the whole container ecosystem and TiddlyWiki are somewhat at odds; and I realized a TW-native solution wasn’t feasible.

What I ended up with is a sidecar windows tray application that runs code snippets directly from your clipboard in a sandboxed container and then returns the stdout back to the clipboard so you can paste it into your document. I called this tool “Ephemeral”

Simply declare your desired language with a shebang in the first line of your codeblock, (or with triplebacktick decleration as well) and then use the copy-code button in TiddlyWiki, use the Ephemeral execute hotkey (CTRL + ALT + X); it will execute the code and put the text result back into the clipboard.

ephmeral

I demonstrated the ‘edit mode’ functionality in the gif above, but the 2ndary shebang method works better for ‘view mode’ since by default the triple-backtick syntax code declarations are not carried over via the copy-code button.

I have future plans to develop this tool further but I’m really happy with how it works at the moment; there is minimal dependency setup though; namely WSL2 and podman. There is more details on the github for interested parties.

Obviously this isn’t exclusively a TW5 tool, it’s more ‘bring-your-own-notebook’ sidecar coderunner, but I thought if there were any other Computer Sciencey kinda TW nerds out there like me, they might appreciate a tool like this.

If you are interested please check it out and let me know your thoughts.

-Xyvir

I think we may be TiddlyWikians not tiddlers :nerd_face:

Thanks for sharing @Xyvir, this is very interesting.

As long as the source code and the result can be persisted in storage, particularly within Tiddlers it seems to me perhaps what else do you need to use a range of languages to design a solution and “get the job done” with whatever language you can find the code for or write in.

  • Combine this with good online resources, carful questions to an LLM and vibe coding what more would you want?

Actually, what would be good is allowing the source code reference tiddlers, and data structures within TiddlyWiki to allow sophisticated solutions, then generate output that can be moved into “tiddlers, and data structures”.

I am disappointed Advanced Basic is not amongst the languages

Did you see this An all-in-one-file and portable BASIC language programming IDE + .BAS programs?

1 Like

Hey, thanks for the mention. Related links for the project:

I have a very dark, wild, and wonky sense o’ha-ha, and I do love self-deprecating humour, so I sometimes think of myself as a Tiddlicker …

EDIT: Oh, I always think of myself as a member of the “Tiddlerhood”.

1 Like