4 ms·
I’m interested in how people using different languages manage this style of “developing in the debugger” and then (eventually) checking in finished code. Two s
by skybrian 5y ago
I’m interested in how people using different languages manage this style of “developing in the debugger” and then (eventually) checking in finished code.
Two systems I’m familiar with:
* In Flutter, you write code in the normal way, in an editor or IDE. If you want to change code while the program is running, you edit code in the normal way and hit a key to reload it. This works when stopped at a breakpoint. But the changes you can make using hot reloading seem somewhat limited; you couldn’t do a major refactoring.
* In an Observable notebook, you edit a cell and then any other cells that depend on it automatically run, like a spreadsheet. You don’t normally use a debugger, though the browser’s debugger does work. In some cases when you’re using advanced features, you might need to reload the page, but usually you don’t.
How do people work using Common Lisp? In other languages? In particular, do you write code in one place (using the repl) and copy-paste it to another place?
- tgbugs 5y agoThe workflow for slime/sly and swank/slynk described at the end of the article is standard if you are in the Emacs world. Sometimes I work in an Org file, sometimes in a lisp file directly. In both cases I will C-x C-e (eval-last-sexp) or run blocks, or the whole file (depending on Org vs lisp file). It is copy and paste on steroids (same for slime-eval-defun were you can be working deep inside some large function and update the whole without changing your view). There are some examples of developing in the debugger in [0] around 55 minutes (linked). This video also has great examples of other crazy interactive development workflows and is worth watching in its entirety if you are interested in this kind of thing. 0. https://youtu.be/bl8jQ2wRh6k?t=3299 https://youtu.be/bl8jQ2wRh6k?t=3299
- skybrian 5y agoHmm. The article doesn't really describe what it's like but I skimmed the SLIME manual. So you basically point at the code you want to run, and this isn't necessarily how you would run it in production. It looks like SLIME mode requires you to install an interpreter hook in the startup code for the process that you want to debug, so you can run commands that way? This seems like it would make the most sense for event-driven code. Evaluating a script is another kind of event. Many systems have a way to execute commands. I'd guess this style of development encourages people to structure their systems as essentially command interpreters, even if the commands normally come from a UI. The interesting bit will be deciding how the data structures that persist between commands are implemented. For example in server-side web apps, the shared state is often a database, so state is external to the process being debugged. The architecture limits what you can do directly, but you can try out SQL queries.