Evaluate Shell-Style Comments using the LSP#2360
Evaluate Shell-Style Comments using the LSP#2360Hyalunar wants to merge 20 commits intodiku-dk:masterfrom
Conversation
Now I only have to make the client request them...
|
Perhaps you could move some of the logic from |
|
What happens if the user evaluates an infinite loop, or something that uses up all your memory? |
It loops infinitely many times or uses up all the memory. Feels like a halting problem to me. We could do some best-effort stuff like a memory or execution time limit. |
HLS has exactly the same problem, they don't have any guardrails and it has forced me to kill the Language Server at least a few times. Usually, implementing a time and memory limit should be hard but I think asynchronous exceptions and heap allocation limits could work like a charm here. Leavingy the questions: what is a reasonable limit? What if the user hits it but wants to continue? |
|
This is a good argument for doing the evaluation in a separate process. |
|
My work on this has stalled a little bit because I'm struggling to figure out how to properly set up the interpreter. |
|
The interpreter goes through the infrastructure in |
|
Cool! @vox9, this might also be a useful application for your work. |
|
The feature works as intended now. I would appreciate feedback on some improvements/design decisions I have in mind. TimeoutCurrently, the evaluation is limited using a memory limit on total allocations, this is documented to be portable. TraceWhen the evaluation times out, all the traces are thrown away. It's possible to retain and display them, but they might be huge (since the computation timed out), maybe it's better not to? Hitting the LimitsThere is no way to use the feature when your expression times out. I'm open for ideas on how this could be avoided.
|
Closes #2358
This is currently in this state:
I would like to reuse some code from
futhark eval, but I'm not sure how to do it, sincefuthark evalhas no underlying support module and does not export anything except formain. I could callmain, but it would write tostdout, which is inacceptable in this scenario.