enso-org / enso

Hybrid visual and textual functional programming.
https://enso.org
Apache License 2.0
7.34k stars 323 forks source link

Don't unnecessarily report bindings as unused variables (in IDE & REPL) #9883

Closed radeusgd closed 2 months ago

radeusgd commented 4 months ago

The repro is trivial - just declare a named binding in the REPL:

> abc = 123
[WARN] [2024-05-08T00:52:20+02:00] [enso.org.enso.compiler.Compiler] Internal_Repl_Module___:1:1: warning: Unused variable abc.
    1 | from Standard.Base import all
      | ^~~
>>> Nothing

Expected behaviour

  1. The warning should not be reported - it is expected in the REPL that the variable is not yet used.
  2. Even if it is shown - the location of the error is wrong.
JaroslavTulach commented 4 months ago

I've heard similar complain by @jdunkerley for the IDE case. Warnings of unused operatorXYZ are reported and they quite useless as it is a common development practice to have unused values in the IDE.

Can we disable unused bindings pass when STRICT_ERRORS are false? That would fix the IDE case. Is REPL running with strict or non-strict errors? If the latter, the change would fix also the repl mode.

hubertp commented 2 months ago

That would fix the IDE case. Is REPL running with strict or non-strict errors? If the latter, the change would fix also the repl mode.

The former it seems. https://github.com/enso-org/enso/blob/develop/engine/runner/src/main/java/org/enso/runner/Main.java#L629

GitHub
enso/engine/runner/src/main/java/org/enso/runner/Main.java at develop · enso-org/enso
Hybrid visual and textual functional programming. Contribute to enso-org/enso development by creating an account on GitHub.
enso-bot[bot] commented 2 months ago

Hubert Plociniczak reports a new STANDUP for yesterday (2024-07-29):

Progress: PR fixing #9883 is up for review. Working on Tableau integration problems. Turned out to be related to wrong context classloaders when loaded in Enso polyglot. Added sbt logic that deals with Tableau's jar packaging. It should be finished by 2024-07-30.

Next Day: Next day I will be working on the #9883 task. Address review, pick up next item.

enso-bot[bot] commented 2 months ago

Hubert Plociniczak reports a new STANDUP for the provided date (2024-07-30):

Progress: Addressed PR comments. Profiling current startup. Noticed a lot of objects being created during IR passes. Experimenting with reducing that to lower memory and GC pressure. It should be finished by 2024-07-30.

Next Day: Next day I will be working on the #10525 task. Finish the experiment. Move into visualization work.