16 ms·
> I don’t believe that natural language is an adequate medium for conveying instructions with the precision required for many applications. Not clear to me if
by ryanjshaw 3y ago
> I don’t believe that natural language is an adequate medium for conveying instructions with the precision required for many applications.
Not clear to me if the author actually uses LLMs to do meaningful work, or is speculating about how they might be used.
I've written about 2500 lines of F# for the first time in the past 1.5 weeks using ChatGPT-4 to guide me. It has been an constant back and forth, iterative process. My decades of development experience factored in heavily to guide the process. I would've have been at maybe a quarter the progress without ChatGPT, or given up entirely on F# as my language.
I don't think that iterative aspect will be eliminated any time soon for AI-supported complex, creative processes. It's no different from tweaking inputs to a Photoshop filter until your experienced brain decides things look right.
To that end you need to know roughly what looks "right" before you use an LLM. This will all become second nature to the average developer in the next 5-10 years.
- lysecret 3y agoAh haha I am going through the exact same experience but picked up F# about 4 months ago and ChatGpt has been an absolute godsend. There is a whole category of blockers in learning that have been eliminated.
- depletedgherkin 3y agoBit of an aside, but I wonder if the rise of LLMs will lead to new programming languages being much slower to be adopted. Like you said, you might have given up on F# without ChatGPT assistance, and the main way ChatGPT is able to help with F# is because of all of the example code it's been trained on. If developers rely more and more on LLM aid, then a new language without strong LLM support might be a dealbreaker to widespread adoption. They'll only have enough data once enough hobbyists have published a lot of open-source code using the language. On the other hand, this could also leading to slowing adoption of new frontend frameworks, which could be a plus, since a lot of people don't like how fast-moving that field can be.
- Closi 3y agoI've also wondered this - including if we might see a breed of 'higher level' languages (i.e. much higher level than Python) which can then be 'AI compiled' into highly efficient low level code. i.e. the advantages of an even-higher-level python that's almost like pseudo-code with assembly-level speed and rust-level safety, where some complexity can be abstracted out to the LLM.
- waynesonfire 3y agoI disagree. Chatgpt is helpful here because f# is a paradigm shift for this otherwise experienced programmer. The programmer probably knows juuussstt enough f# to guide the llm.
- Closi 3y agoI mean why is f# the goal, and could we write a better f# with the use of AI. As an example, why not write in f# and let an 'AI-compiler' optimise the code... The AI-compiler could then make sure all the code is type safe, add in manual memory management to avoid the pitfalls of garbage collection, add memory safety etc - all the hard bits. And then if we gave the AI-compiler those sort of responsibilities, then we can think about how this would impact language design in the longer term. None of this is with current generation LLM's, but might be where we end up.
- jprete 3y agoThis doesn’t require AI, it requires higher-level languages than we have that can express intent more directly.
- Closi 3y agoIn current generation language there is definitely a trade-off between language productivity (i.e. speed of writing) and features such as speed and memory-safety. So far we haven't been able to close this gap fully with current compilers and interpreters (i.e. python still runs slower than C). It seems like that gap could be closed through, for example, automated refactoring into a rust-like language during compilation, or directly into more-efficient byte-code/ASM that behaves identically. And surely if that is a possibility, that would affect language design (e.g. if you can abstract away some complexity around things like memory management).
- Buttons840 3y agoIt could go the other way. LLMs might make porting code from one language to another easier which would speed the adoption of newer and more niche languages. And the future of documentation and tutorials might be fine-tuning an LLM.
- throwuwu 3y agoThe crazy thing that a lot of people don’t realize is that all of that data generalizes to anything new you can throw at it. As long as there’s enough space in the prompt to provide documentation it can do it on the fly but you could also fine tune the model on the new info.
- Spivak 3y agoWhich is what Phind tries (and mostly succeeds) in doing. LLM + Search Engine is way smarter than just LLM.
- yayitswei 3y agoI heard somewhere that ChatGPT is surprisingly good for human language translations even though it's not specifically trained for it. There seems to be just enough examples of e.g. Japanese that Japanese researchers use it to translate papers. I suspect that's largely true for programming languages too. I've had great success working with it in Clojure, even though there's relatively little published code compared to more popular languages.
- bugglebeetle 3y agoChatGPT is pretty good for translations of Japanese into English. It’s English to Japanese translation tend to sound somewhat stiff/formal/machine-generated, although it’s less prone to hallucinations than DeepL for larger texts. I expect this is because it was trained on a much larger corpus of English language texts than Japanese ones, which means the problem is not intractable.
- bostonsre 3y agoWouldn't you just need to publish a Rosetta stone type translation for it to be able to digest the new language fully? e.g. here is how you do this in python and here is how you do it in this new language
- gumballindie 3y agoTo this day i am still wondering what kind of code people write that chatgpt can possibly help with. All my attempts lead to garbage and i would spend more time fixing the output of the chat bot than writing the actual code. It does help with some documentation. But even that has glitches.
- ryanjshaw 3y agoI've used it on this side project for: - A rough crash course in F#. I'll say "what's the equivalent in F# of this C# concept?". It will often explain that there is no direct concept, and give me a number of alternative approaches to use. I'll explain why I'm asking, and it'll walk through the pros/cons of each option. - Translating about 800 lines of TypeScript JSON schema structures to F#. A 1:1 translation is not possible since TypeScript has some features F# doesn't, so ChatGPT also helped me understand the different options available to me for handling that. - Translating psuedo-code/algorithms into idiomatic F# as a complete F# beginner. The algorithms involve regex + AST-based code analysis and pattern matching. This is a very iterative process, and usually I ask for one step at a time and make sure that step works before I move onto the next. - Planning design at a high-level and confirming whether I've thought through all the options carefully enough. - Adding small features or modifications to working code: I present part of the function plus relevant type definitions, and ask it for a particular change. This is especially useful when I'm tired - even though I could probably figure it out myself, it's easier to ask the bot. - Understanding F# compiler errors, which are particularly verbose and confusing when you're new to the language. I present the relevant section of code and the compiler error and 90% of the time it tells me exactly what the problem and solution is; 5% of the time we figure it out iteratively. The last 5% tends I have to stumble through myself. - Confirming whether my F# code is idiomatic and conforming to F# style. - Yes it makes mistakes. Just like humans. You need to go back and forth a bit. You need to know what you're doing and what you want to achieve; it's a tool, not magic. Note: this is the commercial product, ChatGPT-4. If you're using the free ChatGPT 3.5, you will not be anywhere near as productive.
- mk_chan 3y agoI used chatgpt4 to generate python code which generates c++ code for a hobby project of mine using a library I've never used before. The iteration speed is ridiculously good and no one in any of the IRC or discord channels I visited pointed me even in the general direction of such a simple solution. https://chat.openai.com/share/d041af60-b980-4972-ba62-3d41e09fdf24 https://chat.openai.com/share/d041af60-b980-4972-ba62-3d41e0... https://github.com/Mk-Chan/gw2combat/blob/master/generate_copy_registry_utils.py https://github.com/Mk-Chan/gw2combat/blob/master/generate_co...
- _8j50 3y agoI feel like such a jerk for not wanting to use chatgpt for all that. It's not just mild paranoia about feeding it input I prefer be kept private but I just don't enjoy having someone else do half the thinking for me I guess. I mean, I don't like intellisense either (but simple autocomplete is fine). Perhaps it is because I only code to help with my job, I don't get paid to have a lot of good quality code output.
- n4r9 3y agoDon't beat yourself up. As a mathematically-oriented software engineer I also have little to no interest in using LLMs to help with coding. It feels like the people that do are the builders, i.e. interested in quickly knocking up something that works most of the time. Which is great from a business perspective. I can't help but see my programming output as an artistic expression of my thought, and therefore find it difficult to give up the hands-on construction to others (be it LLMs or juniors).
- corethree 3y agoMathematically oriented software engineers have the most to benefit off of software assistance due to algebraic designs. As one myself LLMs don't feel like giving up control it feels like collaboration. You probably don't like collaboration.
- n4r9 3y agoCould you expand on the comment about "algebraic designs"? When I interact with an LLM it feels like I'm speaking to someone who lacks inherent conceptual understanding, but is doing their utmost best to bullshit me. This is problematic when it comes to algorithmic thinking. I sometimes need to solve problems that involve tweaking existing algorithms in somewhat novel ways. For example "k-medoid clustering but with various capacity constraints on clusters", or "contraction heirarchies but accounting for varying vehicle dimension restrictions". I love collaborating with smart colleagues to come up with ideas to solve these problems. Seeing chat-gpt fail to solve very simple traveling salesman type problems gives me little confidence that it can do novel conceptual tihnking. EDIT To test my own claims, I just tried asking Chat-GPT to make this modification to k-means clustering. It produced something that will give a result but will likely not be very optimal. When prompted to refine the solution, it failed to understand the issue and instead proposed the exact same solution just with a bit more implementation detail. User Suggest a modification to the k-means algorithm where the number of elements assigned to each cluster is limited to a pre-defined maximum value. ChatGPT To modify the traditional k-means algorithm to limit the number of elements assigned to each cluster to a pre-defined maximum value, you can create a variation of k-means called "k-means with cluster size constraints." This modification ensures that no cluster exceeds the specified maximum size while still optimizing cluster centroids based on the sum of squared distances. Here's a high-level overview of the modified algorithm: 1 Initialize centroids: Start by randomly selecting K initial centroids, where K is the desired number of clusters. 2 Assign data points to clusters: Assign each data point to the nearest centroid based on Euclidean distance, just like in the traditional k-means algorithm. 3 Update centroids: Recalculate the centroids of each cluster by taking the mean of all the data points assigned to that cluster. 4 Check cluster sizes: After updating the centroids, check the size of each cluster. If any cluster exceeds the pre-defined maximum size, proceed to reassign some data points from that cluster to other clusters. Here's how you can do this: Identify the cluster(s) that exceed the maximum size. For each over-sized cluster: Sort the data points in that cluster by their distance to the cluster centroid in ascending order. Start reassigning the farthest data points to other clusters (the ones with the smallest distances) until the cluster size constraint is satisfied. Update the centroids of the affected clusters accordingly. 5 Repeat steps 2 and 3: Continue iterating between data point assignment and centroid updating until convergence, or until a predefined number of iterations have been reached. 6 Termination: The algorithm terminates when either the cluster assignments do not change significantly between iterations or after a fixed number of iterations. Here are a few things to consider when implementing this modification: You will need to experiment with the order in which you reassign data points from over-sized clusters to minimize the impact on the overall clustering quality. You should set an appropriate stopping criterion to prevent the algorithm from running indefinitely. Be prepared to handle situations where it is impossible to meet the cluster size constraint while maintaining good cluster quality. In such cases, you may need to relax the constraint or consider alternative clustering methods. This modified k-means algorithm with cluster size constraints allows you to control cluster sizes while still finding meaningful clusters in your data. User Your proposed solution has an issue that points might be reassigned even if there are clearly no other suitable clusters. Please tweak the solution to avoid this issue. ChatGPT To address the issue of potentially reassigning points even when there are no other suitable clusters, we can modify the approach by introducing a priority queue or heap data structure to efficiently manage the reassignment process. Here's an improved version of the k-means algorithm with cluster size constraints: 1 Initialize centroids: Start by randomly selecting K initial centroids, where K is the desired number of clusters. 2 Assign data points to clusters: Assign each data point to the nearest centroid based on Euclidean distance, just like in the traditional k-means algorithm. 3 Update centroids: Recalculate the centroids of each cluster by taking the mean of all the data points assigned to that cluster. 4 Check cluster sizes: After updating the centroids, check the size of each cluster. If any cluster exceeds the pre-defined maximum size, proceed to reassign data points from that cluster to other clusters. Here's how you can do this: Identify the cluster(s) that exceed the maximum size. For each over-sized cluster: Create a priority queue (or heap) to store the data points in the cluster, ordered by their distance to the cluster centroid in ascending order. Start reassigning the farthest data points to other clusters (the ones with the smallest distances) until the cluster size constraint is satisfied. Update the centroids of the affected clusters accordingly. Continue this process until either the cluster size constraint is met or there are no more suitable clusters to reassign points to. 5 Repeat steps 2 and 3: Continue iterating between data point assignment and centroid updating until convergence, or until a predefined number of iterations have been reached. 6 Termination: The algorithm terminates when either the cluster assignments do not change significantly between iterations or after a fixed number of iterations. This modified approach ensures that points are only reassigned to clusters that are suitable and have room to accommodate additional points while maintaining the overall quality of the clustering solution. The use of a priority queue helps prioritize the reassignment of points to clusters with the least impact on their quality. Additionally, you should set an appropriate stopping criterion to prevent the algorithm from running indefinitely, and you may need to handle situations where it is impossible to meet the cluster size constraint while maintaining good cluster quality by relaxing the constraint or considering alternative clustering methods.
- waynesonfire 3y agoI had similar success when trying to solve problems with Makefiles.
- sanderjd 3y agoYeah, for me it has been docker and kubernetes. I have found it to be something of a killer app for spinning up on anything with a bunch of annoying little details, that I'm not already super familiar with. Make, docker, kubernetes, all fit this pattern. Heck, maybe I won't be so down on autotools if I run into it again now that I can attack it with LLM support. Or html / css; I haven't written any of that in the LLM era, but maybe I'd enjoy it more now.
- kristianp 3y agoThe llm effect may enable people to use languages that are harder to write, but produce a more maintainable and/or performant product. Maybe it's finally time to learn rust or ocaml!
- vishnumenon 3y agoI'm the author, and I don't disagree with this at all - I do use LLMs pretty meaningfully in my day-to-day engineering work, and I definitely agree that they hold a ton of promise in situations like the one you mentioned. To be clear, I'm very much bullish on the applications of LLMs to e.g. coding! The point I was trying to make there was just that for _certain_ tasks, the process of chatting with an LLM is, by nature, less precise and more arduous than a purpose-built UX. By analogy, we might have "describe-your-change" functionality in Photoshop, but its no replacement for all the other pixel-perfect editing functionality that it provides, and I'd struggle to imagine a world where Photoshop is ever _replaced entirely_ by a chat UX
- throjwbahrnd 3y ago[flagged]