News for hackers. Stuff that matters.
Re:Inspector – A drop-anywhere C++ REPL by Dangeranger on Monday February 12, 2018 @02:25PM (#16361233)
Injecting a REPL into a given section of code is my favorite means of debugging and interactively developing. I've gotten into the habit of building up a class interactively within Emacs and re-evaluating files after they have been changed.

It feels a bit like test driven development, but much more concrete. When I don't really know what I want to build, or what is possible, it's a fun way to spike out some functionality.

Then after you see what sort of path could exist from your interactive session you can use the code as a scaffold and re-implement the functionality by writing a test and implementing the code to satisfy it.

Re:Inspector – A drop-anywhere C++ REPL by weavie on Tuesday February 13, 2018 @05:50AM (#16366176)
How well does it work with class redefinition? Do your instances created with the old definition automatically update to become instances of the new definition, or do you need to recreate them?

Common Lisp goes to a lot of trouble to ensure old instances automatically become new instances - given the repl is a first class feature, the whole language is built around this concept. But with C++ I can't quite picture how it would work.

Re:Inspector – A drop-anywhere C++ REPL by Dangeranger on Tuesday February 13, 2018 @12:55PM (#16369153)
The variables and references need to be re-initialized. It would be absolutely amazing if instances updated themselves but I think only Lisps and Smalltalk are capable of what you are saying. Correct me if I am wrong.
Re:Inspector – A drop-anywhere C++ REPL by Mic92 on Tuesday February 13, 2018 @07:13AM (#16366518)
It is not supported. You can only define each type once.
Re:Inspector – A drop-anywhere C++ REPL by zitterbewegung on Monday February 12, 2018 @02:46PM (#16361411)
Even just knowing the variables in the Stack frame is useful also. The error pages for Django and pyramid have this. Also, at a previous job someone created a toolbar that had all of the relevant server variables in your session.
Re:Inspector – A drop-anywhere C++ REPL by majewsky on Monday February 12, 2018 @03:26PM (#16361755)
At a previous job, I built a server-side debugging tool which would record the requests that you made. For each request, you could see the HTTP request, the HTTP response, and events like SQL statements and log messages. (Sort of like Sentry.) There was also a button that re-ran the same request under a profiler.

Sadly the tool was never merged into mainline, so the feature branch has probaly rotten away by now.

Re:Inspector – A drop-anywhere C++ REPL by vog on Tuesday February 13, 2018 @03:42AM (#16365647)
Shlightly off-topic:

Maybe it's just me, but this is exactly why I'm not a fan of feature branches.

I do like to have local branches which sometimes serve as feature branches. But those are short-lived, so these either make it into mainline within a few days, or are deliberately marked as dead ends. (Or developed into a separate project, but this is very seldom and even then quickly moved into a new repository.)

Re:Inspector – A drop-anywhere C++ REPL by Ono-Sendai on Monday February 12, 2018 @09:53PM (#16364371)
A decent debugger will show all the local variables and their values.
Re:Inspector – A drop-anywhere C++ REPL by Mic92 on Tuesday February 13, 2018 @02:49AM (#16365442)
Many variables are marked as optimized in debuggers - never in Inspector. This even happen sometimes to me, when compiler optimizations are disabled.