ChatGPT stuff
tl;dr: it seems likely ChatGPT took advice meant for Python or MATLAB, and substituted Julia’s name in their place because it considers them “close enough”.
1 isn’t wrong, but makes no mention of type stability, which is at least as important as its (more generic, applicable many languages) suggestion.
2 is also generic advice that’s good to have, but isn’t #JuliaLang specific (but I consider this one a #ChatGPT success)
3 rates as kinda okayish advice. One could argue that for a beginner, the base functions offer a solid place to start, if we assume they’re gonna write badly optimized code (but then teaching them how not to do that - as the prompt asked - is a better way to solve that). But since this is Julia, it’s not uncommon that simple custom code you write beats the obvious ways using built-ins. So I’d consider this potentially misleading.
4 is likely the smoking gun here - the repeated mentions of vectorization and asking to use techniques to “vectorize your code” seems to suggest that this whole thing was taken from guides written for Python or MATLAB, which are at this point more numerous than those for Julia, and then the Language Model substituted Julia in the language name’s place because it considers them similar. (A previous answer said “there are a number of programming languages that are commonly used for numerical and scientific computing, including Python, Julia, MATLAB, R, and others” - so it knows they’re in the same category.)
ChatGPT stuff
I asked #ChatGPT “What is the secret to make Julia code fast?” (just to see if it picks up anything from Jakob Nissen’s excellent guide https://viralinstruction.com/posts/optimise/ or the many other #julialang optimization guides online).
The answer turned out to be good example of the model’s ability to be subtly misleading while not being entirely wrong.
(Thread, with ChatGPT’s reply as the next post.)
I just completed Day 12 of #AdventOfCode in #JuliaLang.
Hard day with little time for AoC, but I managed to squeeze it in - and the problem was interesting enough to be rewarding, to make it feel worth it. Got to explore Julia’s typing and multiple dispatch a little bit along the way.
I just completed “Adapter Array” - Day 10 - Advent of Code 2020 #AdventOfCode https://adventofcode.com/2020/day/10 in #JuliaLang .
uniq -c
in shell). The StatsBase
downloadable package is needed for that.sort
in Vim before?! I always thought I’d need to use the shell’s sort command since that’s the Unix-y way, but :sort n
works like a charm.I just completed “Handheld Halting” - Day 8 - Advent of Code 2020 #AdventOfCode https://adventofcode.com/2020/day/8 in #JuliaLang.
Spent way too long on Part 2 thinking there must be an interesting non-bruteforce way to solve it. reddit also seems to be concluding there’s no neater way of solving it, just straight up try everything, which is disappointing.
I just completed “Handy Haversacks” - Day 7 - Advent of Code 2020 #AdventOfCode https://adventofcode.com/2020/day/7 in #JuliaLang.
I wanted to do something interesting using Julia’s multiple dispatch, making each outer bag a function and the inner bags the parameters, but it would have needed too much macro munchkinry and ended up in the “too clever for its own good” type code. I’m not trying to be Mel the Real Programmer after all.
I just completed “Custom Customs” - Day 6 - Advent of Code 2020 #AdventOfCode https://adventofcode.com/2020/day/6 in #JuliaLang.
Every day, while implementing Part 2, I end up with a more elegant neater way of doing Part 1. Never occurs to me while doing Part 1 itself - probably because I come up with an idea while reading the question and rush to implement it, not stopping to think of other ways of doing it .
toy prog challenge solution
Did the subset sum challenge today, in #JuliaLang. Code here. I used to get stuck with dynamic programming problems, finding them hard to reason about, so it was pleasant to find that with this one the logic flowed nice and easy. Typing in the test cases and getting the test setup going took up more time than actually solving the problem itself!
I just completed “Toboggan Trajectory” - Day 3 - Advent of Code 2020 #AdventOfCode https://adventofcode.com/2020/day/3 using #JuliaLang
Lessons (re-)learnt:
I just completed “Password Philosophy” - Day 2 - Advent of Code 2020 #AdventOfCode https://adventofcode.com/2020/day/2 using #JuliaLang.
Day 2 was kind of a letdown. The problems felt particularly pointless, and there was no thinking or creative problem solving required; just look up some functions in your language’s manual and then it’s just nitty gritty work.
Let’s hope Day 3 has something fresh and interesting!
Teacher, trainer, developer.
Interested in books, tech, pets, being less wrong, and having my mind blown every now and then.
I'm also @Sundar where I'll be posting Julia tips, resources, etc.
#programming #education #training #learning #julialang #julia
#science
#webfiction
#meditation
#fedi22