zlacker

[return to "Stop Writing Dead Programs"]
1. the-sm+lH[view] [source] 2022-10-20 11:04:21
>>aidenn+(OP)
Why can't our programs be dead but our tools alive? Having a static and full world view allows your tools to do a lot more. An alive and very dynamic program allows you to run fine-grained strands of control flow, a dead and static one allows you to run coarse but large amounts of strands of control flow. Let me ask more complex queries, don't give me this hand-rolled LSP crap.

Here are some things that I've done/found out manually that I want my IDE to do for me:

1. General inter-procedural analysis queries: - Does anyone pass in null? - Is X set in each path that can be taken? - Take a theory, for example numerical ranges, what can you tell me about this function? - Is this probably a hot function? - Are any of these sum type ctrs unused?

2. Show me counter-examples of things I believe about the code, don't force me to find them myself.

3. Predictable, but non-standard (not pre-rolled by IDE), refactoring. I had to grep and do an Emacs macro that went through the list of matches, one execution at a time. Why can't the IDE record my actions, show me the AST transformation that I did, and let me apply them for some qualifying criteria across the whole codebase?

4. Let me apply semantically equivalent code refactorings within a function by picking cost-based heuristics. For example, "flatten indentation levels".

5. Do coarse-grained semantic analysis for me, "are these the same on a type-level? OK, now apply this theory, still the same? Aah, I'm about to go for lunch, just run the whole analysis".

6. Let me save any thing I've done, so that I can use it in the future

Something like that, that'd be great. I have 128GB of RAM and like 64 CPU cores and I'm using my brain on this 1M+LoC codebase while they sit idle. Lazy bums, I tell ya!

◧◩
2. infini+cU[view] [source] 2022-10-20 12:40:28
>>the-sm+lH
In Alan Kay's recent talks where he describes the implementation of Squeak, one of the last things he demonstrates is the ability to query the system for:

  Number of total objects
  Size of objects
  Number of methods
  Avg size of method
  Etc
As a sibling comment points out, by definition a live system can do everything a dead system can and more.
◧◩◪
3. the-sm+bP2[view] [source] 2022-10-20 21:34:31
>>infini+cU
All of those are dynamic properties of one running system, what if I pass in a different set of starting state to it? Will it allocate more objects then? Are any of the methods unused? Well, maybe it is now, but maybe we'll redefine a method at runtime to call the previously unused method.

> As a sibling comment points out, by definition a live system can do everything a dead system can and more.

"Can do" is not the same as "we can say about", see my response to sibling.

[go to top]