Hacker News new | ask | show | jobs
by A_Venom_Roll 614 days ago
Would you be willing to give an example of this?
4 comments

Not exactly the same… But recently I wanted to pick a library in Python or Julia for simulating differential equations using a GPU. So I asked ChatGPT which libraries exist for this (JAX, CuPy, etc.), asked it to generate code to solve e.g. the 2D heat equation on a 1000x1000 grid for 100 time steps using each of those frameworks. Then I stepped in and verified that each code appeared to do the same thing, and proceeded to benchmark their performance on my hardware. Afterwards I had an informed choice of which framework to use for my project, even though ChatGPT gave me the benchmark code instead of the answer.
Similarly I find Bing copilot very handy for exploring problem spaces and their solution spaces. Then i dig/ask deeper and deeper until i understand the solution. It is a quick way to brainstorm without diverting too much, and hence converging, since that tech knows a lot details about a lot of things.
You should actually ask for 3 examples so you can select one.
Here's one: I asked Claude this:

"Options for JavaScript to turn a JPEG into a vector SVG"

Result: https://gist.github.com/simonw/d2e724c357786371d7cc4b5b5bb87...

I ended up building this: https://tools.simonwillison.net/svg-render

More details here: https://simonwillison.net/2024/Oct/6/svg-to-jpg-png/

> I ended up building this:

I'm confused about how you ended up building the opposite of your initial prompt? The initial prompt seemed like puzzle worth solving.

Here's one: if you want it to rewrite something or show you a better way to say something you've already written, just ask for different options. I usually find that mixing what I wanted to write with parts of its suggestions gives me a great result.