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

Solutions for advent of code, day 4 - 13. #4750

Open
wants to merge 10 commits into
base: trunk
Choose a base branch
from

Conversation

zygoloid
Copy link
Contributor

@zygoloid zygoloid commented Jan 2, 2025

A collection of additional Carbon examples demonstrating current language capabilities and some limitations of the current state of the toolchain.

@github-actions github-actions bot requested a review from jonmeow January 2, 2025 20:08
@github-actions github-actions bot added the documentation An issue or proposed change to our documentation label Jan 2, 2025
"day3_part2.carbon",
] + utils,
)
[
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
[
# Produce a binary "dayX_partY" for each matching `.carbon` file.
[

With the

Comment on lines +14 to +17
name = "day%d_part%d" % (day, part),
srcs = [
"day%d_common.carbon" % day,
"day%d_part%d.carbon" % (day, part),
Copy link
Contributor

Choose a reason for hiding this comment

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

Had you considered using .format instead? I note this because I think we're predominantly using it in .bzl files (somehow I think this may be the first case in a BUILD)

Suggested change
name = "day%d_part%d" % (day, part),
srcs = [
"day%d_common.carbon" % day,
"day%d_part%d.carbon" % (day, part),
name = "day{0}_part{1}".format(day, part),
srcs = [
"day{0}_common.carbon".format(day),
"day{0}_part{1}.carbon".format(day, part),

import Core library "io";
import library "io_utils";

class Terrain {
Copy link
Contributor

@jonmeow jonmeow Jan 6, 2025

Choose a reason for hiding this comment

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

Is it worth having any documentation in these files? A lot of these get fairly complex, including when you get into hex representations of characters. Where do you see the balance of maintenance and discarding if the code needs updated? (maybe it's more on the latter side, due to a lack of tests?)

Copy link
Contributor

@jonmeow jonmeow left a comment

Choose a reason for hiding this comment

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

Approving, but maybe it's worth a note about what the expectation is (in the README) for the code maintenance is, given the lack of documentation and tests? It says it's mainly for seeing the current state of the toolchain, but what happens if an example stops working? Who fixes that and how do they verify their fix, or do we not fix it and delete instead?

@jonmeow
Copy link
Contributor

jonmeow commented Jan 6, 2025

To be sure it's clear, the lack of comments and tests means I can't really offer much review beyond the BUILD beyond "looks like Carbon code".

@danakj
Copy link
Contributor

danakj commented Jan 6, 2025

Approving, but maybe it's worth a note about what the expectation is (in the README) for the code maintenance is, given the lack of documentation and tests? It says it's mainly for seeing the current state of the toolchain, but what happens if an example stops working? Who fixes that and how do they verify their fix, or do we not fix it and delete instead?

I was also wondering about this, as we make changes going forward. Maybe it'd be good to clearly timestamp these somehow like "they work with version of the toolchain" so that we can explicitly not have to maintain them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation An issue or proposed change to our documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants