22 ms·
Show HN: A fast, dependency-free traceroute implementation in pure C
- 9029 11mo agoIs this vibe coded or is it just the readme that's AI-generated?
- raphman 11mo agoThe commit messages (with dozens of semi- and unrelated changes in each commit) suggest so. https://github.com/davidesantangelo/fastrace/commit/79d9274451e26df929a8961a524d56a443e60d06 https://github.com/davidesantangelo/fastrace/commit/79d92744... (For me, this does not necessarily say anything about code quality. However, if a whole project is AI-generated, the author has no enforceable copyright IMHO, and thus, the 2-clause BSD license is void.)
- Sesse__ 11mo agoI wish ChatGPT could have told the author about the existence of mtr before starting this :-)
- checker659 11mo agoI was skeptical at first, but this does stink of auto-generated code. I want to believe it is not.
- ohyoutravel 11mo agoI take issue with the Author section. You’re the only one listed. Shouldn’t you give ChatGPT credit, or even further afield, all the developers who wrote the code and answers that ChatGPT trained on to produce this, as far as I can tell, meaningless tool?
- alt187 11mo agoChatGPT isn't an author, so it shouldn't be listed. Instead, every single piece of human creation that's been sloshed and slurried to produce this drab drivel should be put as authors. That would be fair.
- ohyoutravel 11mo agoThis only seems fair.
- akritid 11mo agoIf FSF trained a net on all the code that has Copyright assigned to FSF, could it be used to ethically vibe code free software retaining the same Copyright and license? Perhaps even pointing to a file on fsf.org with all the author's names?
- pavlov 11mo agoIt used to be that if someone released a tool that's 700 lines of C, they probably had an actual need and a problem they solved by writing that code because debugging even that amount of C tends to be non-trivial. Today all bets are off. Does the tool do anything anybody needed? Does it work? Who knows. It might just be 700 lines of convincing-looking C churned out by a model.
- checker659 11mo agoIt could be a vehicle to learn about traceroute / ICMP.
- anonymous908213 11mo agoFor whom? What is the creator going to learn from pasting code they've never read? What are readers going to learn from reading code the "author" themselves didn't read, let alone write? If you want to learn about something, reading an LLM-generated repo seems to be about the worst possible way to do it. That's not even to say LLMs are useless for learning; you could ask directly about concepts without having it write all the code for you, but this is the lowest effort application of the tool and is more of a vehicle for anti-learning than anything.
- checker659 11mo agoI meant that IFF the author wrote it themself. IFF.
- pjmlp 11mo agoWell I was surprised that it actually makes use of "-Wall -Wextra" as good practice. However both PVS-Studio and clang-tidy have a few complaints about the code, since it is a single file, it is rather easy to try out on Compiler Explorer. https://godbolt.org/z/n4M1vGccq https://godbolt.org/z/n4M1vGccq As for your remark, most folks seem to have not followed that C authors also created lint in 1979, Dennis Ritchie proposed fat pointers to WG14, Plan9 was going to use Alef, which failed but its ideas were re-used for Limbo on Inferno, and they were also involved with Go. Finally Rust's borrow checker ideas steam from AT&T research with Cyclone, as way to create a safe C. As such the real question is why still use C in new projects, when even the language authors have moved beyond it, or at least reduce their use of it on userspace applications.
- raphman 11mo agoHonest question: why would this code clamp the reported round-trip time? By default, min = 0.05 ms and max = 800 ms [1]. if (rtt < config.min_rtt) rtt = config.min_rtt; else if (rtt > config.max_rtt) rtt = config.max_rtt; Wouldn't this hide bugs in the code or network anomalies? Replies from localhost seem to typically arrive in less than 50 µs. Comments in an earlier version [2] make no sense to me: /* Use standard timersub for more accurate results */ if (rtt < 0) rtt = 0; /* Cap at reasonable maximum to handle outliers */ if (rtt > 1000) rtt = 1000; [1] https://github.com/davidesantangelo/fastrace/blob/5b843a197b559d7a01e22bc32325a11870d91d9f/fastrace.c#L365 https://github.com/davidesantangelo/fastrace/blob/5b843a197b... [2] https://github.com/davidesantangelo/fastrace/commit/79d9274451e26df929a8961a524d56a443e60d06#diff-73819fe3d1f9cf0870908f31828a0c3c2d7ef4d1794cf297aa50404fc9fe70c5R404 https://github.com/davidesantangelo/fastrace/commit/79d92744...
- deleted 11mo ago[deleted]
- roygbiv2 11mo agoBecause it's AI generated.
- 9029 11mo agoIt has now been changed to if (rtt < 0.0) { fprintf(stderr, "Warning: Negative RTT detected (%.3f ms) - clock issue?\n", rtt); rtt = 0.0; } https://github.com/davidesantangelo/fastrace/blob/e8b19407a4bac4f78857c70e44efb38d6d8a8123/fastrace.c#L359-L363 https://github.com/davidesantangelo/fastrace/blob/e8b19407a4...
- anonymous908213 11mo agoAnd the update message has a reference to "50µs localhost responses", indicating the comment calling the code out was directly fed into a prompt: "Fixed Removed artificial RTT clamping that was hiding legitimate network measurements Previously clamped RTT between 0.05ms and 800ms Now reports actual values including sub-50µs localhost responses and >800ms satellite/long-distance links Added sanity check for negative RTT to detect clock issues without corrupting data This fix restores full diagnostic capability for detecting network anomalies like bufferbloat and measuring true round-trip times across all network types." It shouldn't be legal to vibe this hard, honestly. If convicted in court, you should face punishment of, say, XXX hours doing something actually useful to society with your own two hands.
- codetraceback 11mo agoEven if it's simple or AI-made, projects like this still help people learn and explore, every start matters.
- anonymousiam 11mo agoI just built and ran it. Unlike traceroute and mtr, this utility must be run as root. fastrace 1.1.1.1 fastrace 0.2.1 Tracing route to 1.1.1.1 (1.1.1.1) Maximum hops: 30, Probes per hop: 3, Protocol: UDP TTL │ IP Address (RTT ms) Hostname ────┼─────────────────────────────────────────── Error creating ICMP socket. Are you running as root?: Operation not permitted