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

[flagged]


Looking at the code it's just loops with simple floating point math. There's absolutely nothing in the code that would benefit from C++ features.


Not yet.


Raising the question of why it isn't in FORTRAN.


Better in which way?


Automatic resource management thanks to RAII. To me this is the most important thing.


But in this particular application, if you look e.g. through the training code, there's very little going on in terms of resource management. A handful of mallocs and some file handling.

That doesn't mean that you can have bugs even in a small number of instances, but if automatic resource management is your main argument, perhaps llm.c isn't the most prominent case that could benefit from it.


RAII sucks the way C++ does it. Magical background BS with massive unintended complexity consequences requiring obtuse intricate crap like the copy-and-swap idiom, a mudball of pointer and reference types, etc. They should have added a defer/scope-exit statement and been done with it.


Next level troll?


Rewrite in (safe) Rust, I am sure many will enjoy to compare how it runs.


Candle already exists[1], and it runs pretty well. Can use both CUDA and Metal backends (or just plain-old CPU).

[1] https://github.com/huggingface/candle


The programming language colonialists can't help themselves.




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

Search: