I mainly want to jot down an idea I currently find interesting. :wink:
I was porting a PowerShell script with my dad into TypeScript/Deno for fun and got annoyed with TypeScript (so many try catches and weird APIs). So I had the itch to rewrite the script in Roc, but that is not there yet for me, but I thought about Elm (with elm-pages's scripts you can actually do that).
And there I'd have the problem that elm-pages let's me read files but not write them. But no problem, I can just aggregate all the file creations and movements, pass them through a port to a NodeJS function that just executes them. So the NodeJS code would be pretty simple and just create some files with the given path and content and move other files, while the Elm code would make sure that that is all in order.
I could even output that description of what files to create and move for debugging without running it. And this is what I'm currently intruiged by and wanted to jot down.
It could be pretty interesting to have a CLI platform where all side effects are run in batches that are first shown to the user so they can approve all the changes to be made. Something like:
Move newFile.csv to processed/oldFile
Create output.svg with content <svg>...
Do you want to apply these changes? y/n
Oh yeah, that would be an amazing tool when writing shell scripts, a --safe mode that doesn't make any changes.
I guess some shell commands have --dry-run parameters you could use, but it's easy to forget adding it to some line. I like the idea of a platform that only exposes functions that are guaranteed to implement a safe mode correctly.
But while writing this, I realized that this would be annoying if you'd need to approve every single change. So it would need to encourage batching up as many changes as reasonable to be approved together.
So this would not be backwards-friendly and you'd probably need to develop scripts with this idiom in mind for them to be comfortable.
Richard did a talk about a feature like this before but I can't find it right now...
@Anton Is it https://youtu.be/7SidSvJcPd0?feature=shared by chance?
I haven't rewatched it, but I understood it as a permission system where thr platform has control over what effects are allowed and could prompt for them (as Deno already does).
So the idea above is really similar. But batching the actual changes together into a preview that you approve is an interesting twist on the permission idea. At the very least it could help with debugging.
Yeah, that's the one :)
But batching the actual changes together into a preview that you approve is an interesting twist on the permission idea. At the very least it could help with debugging.
Agreed!
I talked about deno in https://youtu.be/cpQwtwVKAfU?si=-tBxlq85EaouB_-R a bit after the 3 minute mark
Last updated: Jun 16 2026 at 16:19 UTC