Hacker News new | past | comments | ask | show | jobs | submit | bugfix-66's comments login

I seriously doubt this appeals to the modern Hacker News crowd, but it might appeal to a couple of you:

Published in October 2022, The Art of Computer Programming: Volume 4B is dazzling. It's like a guide to expressing (in non-obvious ways) all kinds of problems as some variation on Exact Cover (or Boolean Satisfiability) and using wicked tight little general-purpose backtracking solvers to solve them.

If you want a peek, watch Knuth's 2018 lecture on Dancing Links Exact Cover:

https://youtu.be/_cR9zDlvP88


Did you mean Volume 4 Fascile 5 ? 4b is Combinatorial Algorithms.



The training set is full of code for these problems.

Put your query into Google and see how many thousands of answers appear.

Your tests are in the training set.


True but the horrifying truth is 95% of our actual problems at work are also in the training set...


My biggest problems are obscure bugs that I would hardly understand even if the AI would just give me the workaround.


This idea is why I wanted to see the code created by GPT at each step during this conversation for this post...


Look at how many times that program appears when you paste your question into Google.

The language model was trained on it.


You're correct on the training - but how many things in engineering are re-hashing the same crud over and over?

I can even see it helping with core innovations. No - it won't write a realtime, infrastructure intense system (eg: Kafka) - but it could write all the non-innovative code around it, for example.


As someone who doesn't program/code at all, I don't care how it arrives at the result. It's just amazing to me that if I need a simple script or program, I can have an AI write usable code that I can use.


Yes, this will just further the unhealthy management attitude that programmers are fungible and "why can't you make X do Y, even my phone can do that".


Named after the two companies that promoted it.


It was trained on numerous Leetcode solutions (question/answer), which you can find on GitHub. People are proud of their Leetcode efforts: they post their solutions, as if it is an achievement.

Now tell me, how many of the BUGFIX-66 problems can it solve?

https://BUGFIX-66.com

Copilot can solve a few of the simple ones at the beginning (simple matrix multiplication, simple radix sort, etc., that appear often in the training data, and some of the harder ones whose solution appears on GitHub, e.g., the uncorrected prediction/correction compressor/decompressor whose solutions were front-page on Hacker News).

But as you go down the list, into material outside the training set, the language model won't be able to solve it.

Try it. Paste the tile, the introductory text, and the unfixed code, and see whether the omnipotent AI can solve these (quite straightforward) problems. For how many does it need the hint?


Let me check in a year


Radix sort is also very simple, e.g., https://bugfix-66.com/834f0677c85b23c0bf1047d3654ab7c27ff054...

And djb's vectorized sorting networks are pretty great: https://sorting.cr.yp.to/


Now do it for an algorithm+explanation the training set doesn't contain a million copies of, please.

For example, substitute "The Burrows-Wheeler Inverse Transform" for "bubble sort".


Look at Section 8 and Section 9 here:

http://tug.ctan.org/info/tex-nutshell/tex-nutshell.pdf

How is ChatGPT's answer wrong? The regex is matching square brackets instead of the correct OPTIONAL curly braces. Unseparated arguments aren't handled. The regex for the id is also wrong. The leading slash is correct, but other than that, the whole fucking thing is wrong!

And of course it can't handle macro calls within the macro arguments (nesting).

It's just an absolute clusterfuck, from top to bottom. The chatbot gave its user a useless piece of garbage, and Hacker News doesn't know enough to throw it away. Instead, we parade it around like some great success!

Fooled by a language model.


Did you mean to reply to someone else perhaps?

The comment you replied to was a one line joke about being bad at regex. I didn't directly or implicitly make any claim about the quality of the output of the chatbot. It's unclear to me how my comment could be reasonably interpreted as "parading it around".

On a tangent:

> Fooled by a language model

I suspect a reasonable person would understand this to be insulting on some level, so I assume you must have seen some other meaning/value in including it such that the "insultingness" is outweighed by the point you're making. I'm not seeing that point though, could you clarify?


Based on this and the other post where it delivered lies about Typescript generics, ChatGPT will—with total confidence—tell you things that look correct but are horrendously wrong for anyone who understands the subject matter. Just like the "science news" section of any mainstream media.


Thankfully all the other sections of mainstream media are much more accurate!


Mainstream needs journalists that can code. headduck


As an aside, this is why I hate regex. The expressions are too convoluted for a human to readily parse and understand. Unless there's a good reason, I prefer to stick to imperative parsing code (and have developed personal tooling to help with that).

Part of elegant development is abstracting at the right places to make your code communicate what it's doing to the next person working on it (which could include future you).


Too convoluted for a human to readily parse and understand? The same could be said for pretty much any code. As with anything else, the more practice you have reading and writing regexes, the easier they become.

If you ask me, the real boogeyman is lack of programmers' comments that explain what the regex is doing. In other words, the fault lies not with the tools, but PEBKAC.


I can’t see any mention of square brackets in section 9 (macros). Also, my end goal was to specifically target the contents of the first parameter, which I know which will wrapped in curly braces.

Regardless, even if my prompt didn’t meet the LaTeX spec exactly, the regex I got back (after just 2 natural-language revisions) saved me a lot of time and hassle, and helped me get the job done in the way I needed it to.

There’s little point judging it to be a “total clusterfuck” without knowing what I’m even trying to achieve in the first place :)


A different kind of programming puzzle: https://BUGFIX-66.com

The idea is that you read and understand a small piece of code (full of useful techniques) and make a small change to demonstrate understanding.

Games that require you to write the code are limited to rehashing the same old tired algorithms... reverse a string and other sequence techniques, edit distance and dp variants, optimization by binary search and evaluation, etc., the standard leetcode stuff. Basically, useless wankery you will never use. The competitive programming standards.

If you don't have to write it, just understand it, the game can cover some very interesting new algorithmic terrain. It becomes part book, part game. Like Hacker's Delight: The Game.


I like this idea! Sounds more relaxing like I could passively work on it while on the train, and also see code examples that I wouldn’t normally be exposed to in my day job.

Seems like it might help me get better at code reviews too. Granted, I don’t like doing code reviews (mostly cus it’s usually pretty uninteresting code). But I do like puzzles! I’ll check it out :)


Similarly, you can turn off bounds-checking in Go like this:

  go build -gcflags=-B
and see if it helps. Generally the assembly looks better, but it doesn't really run faster on a modern chip.

Do your own test, and keep the results in mind next time somebody on Hacker News dismisses Go because of the "overwhelming cost of bounds checking".


> next time somebody on Hacker News dismisses Go because of the "overwhelming cost of bounds checking".

That’s certainly one criticism I don’t remember ever seeing.


There's a few examples like this https://news.ycombinator.com/item?id=32256038 if you search comments for "go bounds checking"


It appears that the flag keeps being undocumented, though.

https://pkg.go.dev/cmd/compile


Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: