Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

"It does what took him 6 months in seconds."

It generated unusuable garbage code in seconds, which is nothing like what he wrote by hand in six months.

"Size is not a very useful metric."

Size is a very useful metric. Counting tokens is more accurate estimate of "size" but lines of code is a good first approximation.

The entire purpose of high level languages is to make it possible to do more with less code. Size isn't all that matters but it's very important.

Rust code is not only more verbose than C it's also much more irregular and complex. That 20% increase in lines of code is probably more like 50% increase in code complexity, and this is without safety.

Just compare tokens in the post's example:

  // cmd-kill-session.c
  RB_FOREACH(wl, winlinks, &s->windows) {
    wl->window->flags &= ~WINDOW_ALERTFLAGS;
    wl->flags &= ~WINLINK_ALERTFLAGS;
  }

  // cmd_kill_session.rs
  for wl in rb_foreach(&raw mut 
  (*s).windows).map(NonNull::as_ptr) {
      (*(*wl).window).flags &= !WINDOW_ALERTFLAGS;
      (*wl).flags &= !WINLINK_ALERTFLAGS;
  }





C-flavored-rust is more verbose than C, sure, but that doesn't tell you much about idiomatic Rust.



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: