Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

topic: pretty-printing library #57

Open
abhin4v opened this issue Apr 15, 2024 · 2 comments
Open

topic: pretty-printing library #57

abhin4v opened this issue Apr 15, 2024 · 2 comments
Assignees
Labels
assigned Topic has been assigned in-content Is the issue in lesson content?

Comments

@abhin4v
Copy link

abhin4v commented Apr 15, 2024

The idea is to implement a pretty printing library based on Philip Wadler's "A prettier printer" paper.

The paper already contains code for an implementation, though it is a bit rudimentary. The wl-print Haskell package contains an extension of it, with some extra bells and whistle for convenience.

We can stick with the paper's implementation or something in-between that and wl-print's. We would also demonstrate the library usage by pretty printing one of these:

  • An ADT, such as the JSON value representation
  • An AST representation of s-exps (simple AST)
  • An AST representing some simple imperative language (complex AST)

This has been done before in the chapter 5 of the Real World Haskell book.

The Roc implementation may not be exactly same as the Haskell implementations because of strict-vs-lazy nature of the two languages.

@gvwilson
Copy link
Collaborator

👍 I like this one, and I think it's about the right size - @rtfeldman @Anton-4 thoughts?

@gvwilson gvwilson added discuss An issue or PR currently being discussed in-content Is the issue in lesson content? propose-addition A suggestion for an addition to content or infrastructure labels Apr 16, 2024
@rtfeldman
Copy link
Contributor

Sounds good to me! There was a blog post recently on how to take the ideas in that paper a step further, but I don't have a link handy. It gave examples in Rust, which might be easier to port to Roc because they're strictly evaluated.

@gvwilson gvwilson changed the title Topic Proposal: A Pretty Printing Library topic: pretty-printing library Apr 18, 2024
@gvwilson gvwilson added assigned Topic has been assigned and removed discuss An issue or PR currently being discussed propose-addition A suggestion for an addition to content or infrastructure labels Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
assigned Topic has been assigned in-content Is the issue in lesson content?
Projects
None yet
Development

No branches or pull requests

3 participants