-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
base: trunk
Are you sure you want to change the base?
Conversation
"day3_part2.carbon", | ||
] + utils, | ||
) | ||
[ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[ | |
# Produce a binary "dayX_partY" for each matching `.carbon` file. | |
[ |
With the
name = "day%d_part%d" % (day, part), | ||
srcs = [ | ||
"day%d_common.carbon" % day, | ||
"day%d_part%d.carbon" % (day, part), |
There was a problem hiding this comment.
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)
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 { |
There was a problem hiding this comment.
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?)
There was a problem hiding this 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?
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". |
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. |
A collection of additional Carbon examples demonstrating current language capabilities and some limitations of the current state of the toolchain.