TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Learning Rust with ChatGPT, Copilot and Advent of Code

83 点作者 sean_lynch超过 2 年前

8 条评论

sorobahn超过 2 年前
This is so cool! I looked at the transcript for day 5 [1] and realized how I learned the same thing regarding Rust strings not being indexable with integers due to them being a series of grapheme clusters. I didn&#x27;t use ChatGPT and had to dig through the crate documentation [2] and look at stackoverflow [3], but Simon was able to get an equally great explanation by simply asking &quot;Why is this so hard?&quot; which I could relate to very much coming from C++ land. Now, the ability to trust these explanations is another issue, but I think it&#x27;s interesting to imagine a future where software documentation is context aware to an individual&#x27;s situation. The Rust docs are amazing and you can see they bring up indexing in the &quot;UTF-8&quot; section, but it requires me reading a section of the doc which I may not have realized was the reason for my frustration with a compiler error regarding indexing. Even if ChatGPT is not &quot;intelligent&quot; (whatever that means), its ability to take a context and almost act like an expert who&#x27;s read every page of documentation that can point to you into a productive direction is very helpful.<p>[1]: <a href="https:&#x2F;&#x2F;github.com&#x2F;simonw&#x2F;advent-of-code-2022-in-rust&#x2F;issues&#x2F;6" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;simonw&#x2F;advent-of-code-2022-in-rust&#x2F;issues...</a> [2]: <a href="https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;string&#x2F;struct.String.html#utf-8" rel="nofollow">https:&#x2F;&#x2F;doc.rust-lang.org&#x2F;std&#x2F;string&#x2F;struct.String.html#utf-...</a> [3]: <a href="https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;24542502" rel="nofollow">https:&#x2F;&#x2F;stackoverflow.com&#x2F;a&#x2F;24542502</a>
评论 #33873538 未加载
评论 #33873982 未加载
评论 #33874020 未加载
评论 #33911076 未加载
bsaul超过 2 年前
The way it explains code, the error, and then gives the solution to this particular error, i really don’t understand how someone could pretend we’re not witnessing at least a first hint of true intelligence.
评论 #33873501 未加载
评论 #33873226 未加载
评论 #33873172 未加载
评论 #33872996 未加载
评论 #33872980 未加载
评论 #33873093 未加载
评论 #33873649 未加载
worldsayshi超过 2 年前
In a way of seeing it, ChatGPT can be a great teacher because it can both provide subject knowledge and force you to be very critical about content you consume.
评论 #33873003 未加载
sean_lynch超过 2 年前
Have been thinking about exactly this workflow and of course Simon is way out ahead. I recommend taking a look at Simon&#x27;s daily notes logs too, really fascinating back and forths.
评论 #33872842 未加载
jpe90超过 2 年前
I’ve been using copilot for advent of code as well, as well as in regular day to day coding. I have less luck with comment-based coding than the author, but in my usage it’s been handy for normal autocomplete.<p>There’s been a number of instances where I would write a comment describing a simple operation and it would struggle or generate a lot of noise, but if I just start writing an implementation it would give me a good suggestion pretty quickly. I guess the extra context helped.<p>I was disappointed that it wasn’t more useful as a discovery tool- when I’m not knowledgeable about a language or framework, it can be hard to judge whether its suggestions are subtly wrong. After a while, I started getting a sense for when suggestions are likely to be valuable, which is generally when I have a concrete idea of what I want and what it should look like. When i’m doing more exploratory development I often just ignore the completion. Using ChatGPT instead for learning new stuff is a great idea and i’ll definitely be trying that.<p>Something I wasn&#x27;t expecting about copilot is that it actually has been giving me pretty good completions for emacs lisp. I think it’s going to be a very valuable tool in the long run and I recommend giving it a second thought if you’ve dismissed its utility.
ofrzeta超过 2 年前
This is amazing. Nice to see how Simon uses various tools to achieve his goals in his daily writeups. It might not be &quot;intelligence&quot; but it&#x27;s still a very subtle search engine for programmers with a human language interface.<p>I always found it a bit tedious to have to type out everything when you know you want a loop over and array or something. Now you can just tell ChatGPT what you want and let it do the typing. Disregarding the mistakes it makes while appearing confident about its answers :-)<p>Now programmers can finally be directors where ChatGPT is the film team or the cinematographer. Sometimes it&#x27;s overconfident and you need to correct it to conform to your imagination. Also as a programmer&#x2F;director you still need a lot of knowledge to ask the right questions, judge the answers and so on (as demonstrated in Simon&#x27;s writeups).
rychco超过 2 年前
I just tried something similar to generate a bunch of boilerplate for parsing some deeply nested &amp; complex JSON using Rust&#x2F;Serde. It gave me a handful of errors, but it was ~90% correct. Which, to be fair, is still shockingly good.<p>I was already very optimistic about Copilot by itself being able to basically eliminate the need to check StackOverflow&#x2F;Docs for basic questions. Combined with ChatGPT I can essentially offload all boilerplate I would ever need to write (provided I&#x27;m still able to identify &amp; correct the few errors it spits out from time to time).
Cloudef超过 2 年前
ChatGPT finally told me the solution for question: &quot;How do you force borrow checker in rust to allow reusing mutable reference when self is borrowed by a function call, but not returned back, using unsafe is okay&quot;
评论 #33873875 未加载