3 ms·
What would it gain? REPLs make perfect sense for scripting problems, but when you would you ever use it for systems problems?
by randomdata 3y ago
What would it gain? REPLs make perfect sense for scripting problems, but when you would you ever use it for systems problems?
- dekhn 3y agooften when I am developing systems code or RPC client code, I sit in a REPL and make repeated ad-hoc calls to various functions, building up various bits of state (I started using python long before Jupyter). I find this much more intuitive than writing code, compiling it, executing it, going back to the editor, changing the code, re-running it with something that loads a bunch of data, just so I can answer a question about the runtime behavior of the system I'm working with.
- randomdata 3y agoThere is certainly something to be said about being able to answer questions about another system by poking at it, but that is a scripting task. You would be better served by a scripting language. And, as it happens, most scripting languages come with REPLs. That is a solved problem that was solved long before Go was ever imagined. Just because you are building a particular systems program does not mean everything you do has to be a systems problem. And, really, if you don't exactly know what you're building, it is probably too soon to consider any of it a systems problem.
- Guvante 3y agoYou say systems problems like Go is for embedded work. Half the things I have seen replaced Python scripts. Seeing what your internal state is after taking X action is exactly what REPLs are good at...
- randomdata 3y ago> You say systems problems like Go is for embedded work. I'm not sure who is talking about embedded work. That didn't come from me. There is nothing in this thread about embedded. Did you accidentally press the wrong reply button? I say that Go is for systems. Do you think Go is actually designed for scripting? If so, why? > Half the things I have seen replaced Python scripts Python is often used to build systems. Python is a scripting language, yes, but that doesn't mean you can't build systems in it – just as you can build scripts in a systems language. But there are tradeoffs in crossing paths like that. Systems languages will be better for building systems, and scripting languages will be better for building scripts. Perhaps the applications you speak of are actually systems and that is why developers saw reason to convert them into using a systems language? > Seeing what your internal state is after taking X action is exactly what REPLs are good at... Quite good. But that workload is not systems in nature, so why would you ever do that in a systems language? That is a scripting workload. Naturally you would use a scripting language. And, lucky for you, most scripting languages include REPLs out of the box!