Compilier success should be more affirming

warning: this might be my dumbest post yet

if the compiler doesnt like what I did I get this

>>>> Start compiling
rescript: [1/3] src/Demo.ast
FAILED: src/Demo.ast

  Syntax error!
  /Users/kevin/Dev/ReScript/rescript-scratch/src/Demo.res:1:20-2:0

  1 │ Console.log("hello"
  2 │

  Did you forget a `)` here?

FAILED: cannot make progress due to previous errors.
>>>> Finish compiling (exit: 1)

Then when I fix it I see this (including the stuff from above)

>>>> Start compiling
rescript: [1/3] src/Demo.ast
FAILED: src/Demo.ast

  Syntax error!
  /Users/kevin/Dev/ReScript/rescript-scratch/src/Demo.res:1:20-2:0

  1 │ Console.log("hello"
  2 │

  Did you forget a `)` here?

FAILED: cannot make progress due to previous errors.
>>>> Finish compiling (exit: 1)
>>>> Start compiling
rescript: [3/3] src/Demo.cmj
>>>> Finish compiling 55 mseconds

And I just look at it and think, did it work this time? Did I forget to save? Does it just assume the previous error is not fixed and just not do anything? Oh right, I know it worked because there is no “FAILED” and the “compiling” line has seconds instead of “exit: 1”

Normally I wouldnt care, but since this is a transpilier, I have to keep checking it for success or error otherwise I might be looking at the output of my code from the last successful compile.

Could success be make more obvious, like a green “SUCCESS”? A timestamp might be nice too (in local time)

3 Likes

I actually love this. A green success is always nice to see.

1 Like

You can use rewatch today, if you want both a fast and monorepo-aware watcher and green emoji checkmarks when compilation succeeds.

EDIT: But I agree the compiler output could be similarly appealing in 2024.

3 Likes