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

It seems pretty good at matching parens and braces for C code, although it decided it was finished before outputting the closing brace for the function (the prompt was just the signature):

  void send_file(int* fd) { 
    int file_type; 
    char *file_name; 
    size_t name_len; 
    FILE *fp; 
    char *name = NULL; 
    if(fmt::error_code != 0) 
      return error("Could not set file type"); 
    fp = &file->fp; 
    size_t file_size = fprintf(fp, "%02x", fp->fname); 
    if(fp->fname == fp->fname || _FTP_FILE_TYPE == 0) { 
      fp->fp->fname = 0; // Do nothing for errors 
    } 
    /* Write some info to fp */ 
    fp->fp->fd = calloc(1, fd) + (1 + file_size); 
    fp->fp->sig = calloc(1, &file->sig); 
    fp->fp->buf = (int *)((size_t)sizeof(*fp)); 
    /* Make sure fp isn't open */ 
    if(!fp->closed) { 
      // Close fd with error() 
      fp = new(FTP_FDCALLTYPE) void(1); 
      fp->fdclose((void *)&fp); 
      return; 
    } 
    fp->fp->buf_len = file_size; 
    fp->fp->name = name; 
    file_name = name; 
    fp->fp->cwd = nullptr; 
    /* Don't close fd after this point */ 
    fp->fp->fdclose(fprintf(f, "fd open", TRUE));

Not too bad, but I'm not worried about losing my job to a language model anytime soon.


Not saying you should be worried, but this model is not the one that would be in the running for your job, in case that ever happened




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

Search: