by a_c · 5y ago · 0 comments
Common lisp's REPL come closest to mind. Erlang's hot swapping is the dopplerganger in deployment world. Bret Victor's inventing by principle is a good analogue to UI programming imo. Imagine editing CSS in browser's inspector, and have the change reflected back to source code. No more switching between editor(IDE) and runtime(browser). I heard smalltalk provide similar development experience, but I had no experience on it yet
There are browser addons that auto-reload a page making your changes visible every few seconds. You can tweak them to reload every 5 seconds or even every minute, depending on how fast you're building the site.
e.g.
- Smalltalk, https://squeak.org/
- Haskell, https://ihp.digitallyinduced.com/ for database schema
- In python, I use a vim plugin, where you can run highlighter code by pressing Ctrl+R. I forgot the plugin name
- If you use erlang, there is no need for the kubernetes
- Tiddlywiki, where the result of your editing changes the source code directly
In general I think a good development environment is close to either quine or isomorphism (code is data, data is code)For generated CSS I had Emacs configured to generate the CSS on change and automatically update the "cache buster" token (just to be safe). Clojure(Script) with figwheel takes care of updating the webapp (in dev) on every change in the CSS dir. Really no issue there: everything is instant.
And then there's this crate https://docs.rs/live-reload/0.2.0/live_reload/ which works on the same principles as the article above, and is based on C code (i.e. the same approach works for C). On the documentation there's links to "Interactive Programming in C" http://nullprogram.com/blog/2014/12/23/ and "Loading Game Code Dynamically" https://www.youtube.com/watch?v=WMSBRk5WG58 (this video by Casey Muratori is btw where I first heard about this technique)
There's a bunch of other libraries that work the same way, and some example code that can do this. I can find https://github.com/irh/rust-hot-reloading and https://github.com/porglezomp-misc/live-reloading-rs and https://github.com/xixixao/hot-reload-rs and https://github.com/emoon/dynamic_reload
And there's https://github.com/draivin/rust-hotswap which has a nice API but uses a deprecated rustc internal API and doesn't build anymore.
Anyway there was a library that did this in a more elegant way and I just can't find it (perhaps it was rust-hotswap?).
https://github.com/ziglang/zig/issues/68
That issue has some links to people doing it in C/C++.
Perhaps you’re functionally fixed on the idea an editor has to be interacted with like a word processor?
It’s all electron state. The boundaries are just UI design.
There are drag and drop web app building tools that let you fine tune the code in an inspector window, and transpile to whatever.
Perhaps what you need is to simply change how you work.
Most contemporary business app building could be visual; I mean look at what experiences Unreal enables with their blueprints. If that coding model can result in AAA games, I don’t see why it can’t replace a whole lot of website building effort.
This stuff is possible. It’s just you have to work for the aristocrats or else.
i cant believe i never thought to just save the source after editing the page the way i wanted in the window