Skip to content

Conversation

jaredponn
Copy link
Contributor

@jaredponn jaredponn commented Sep 16, 2024

This PR:

  • Refactored all logging (logError and logInfo functions (from lambda-buffers-frontend and lambda-buffers-codegen) to reuse the logging functions in lambda-buffers-compiler since lambda-buffers-compiler is an existing dependency of both lambda-buffers-frontend and lambda-buffers-codegen
  • Change error / info messages to be dumped to stderr instead of stdout (this is more aligned with other compilers' behaviors)
  • Shuffled error messages to more closely follow what gcc outputs e.g.
    $ lbf-prelude-to-haskell DoesNotExist.lbf
    DoesNotExist.lbf: error: the provided module file DoesNotExist.lbf doesn't exist
    
    $ cat TEST.lbf
    module TEST
    
    import Prelude (Eq, Json, Maybe, Either, List, Integer)
    
    derive Eq What
    $ lbf-prelude-to-haskell TEST.lbf
    TEST.lbf:5.11-5.15: error: [module TEST] type What not found in the module's scope Either Integer List Maybe Prelude.Either Prelude.Integer Prelude.List Prelude.Maybe
    
    $ cat TEST.lbf
    module TEST
    
    import Prelude (Eq, Json, Maybe, Either, List, Integer)
    
    prod What = (Integer
    derive Eq What
    
    $ lbf-prelude-to-haskell TEST.lbf
    TEST.lbf:6.7: error:
    unexpected keyword
    expecting s-expression
    

and shuffled error messages s.t. it more closely follows the output of
gcc
@jaredponn jaredponn force-pushed the jared/refactor-logging branch from 615f107 to 6a51974 Compare September 16, 2024 00:47
Copy link
Contributor

@bladyjoker bladyjoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great!

I left a comment about extras/lambda-buffers-utils to keep the compilation level separation. Let me know if that works

@jaredponn jaredponn force-pushed the jared/refactor-logging branch 3 times, most recently from 61a960b to 0acd00c Compare September 24, 2024 07:00
Copy link
Contributor

@bladyjoker bladyjoker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank youuuu!!!

…`dev-lambda-buffers-(utils|frontend|codegen|compiler)`
Copy link
Collaborator

@szg251 szg251 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought I reviewed this earlier...

@jaredponn jaredponn force-pushed the jared/refactor-logging branch from a76b0dc to 4c89749 Compare October 4, 2024 23:13
@jaredponn jaredponn requested a review from szg251 October 4, 2024 23:14
@jaredponn
Copy link
Contributor Author

jaredponn commented Oct 5, 2024

I'll merge this since it seems we've addressed all PR feedback :P

@jaredponn jaredponn added this pull request to the merge queue Oct 5, 2024
Merged via the queue into main with commit a9d2eca Oct 5, 2024
2 checks passed
@jaredponn jaredponn deleted the jared/refactor-logging branch October 5, 2024 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants