Post AaN7hJCQjn8SDeQc5Y by janriemer@floss.social
 (DIR) More posts by janriemer@floss.social
 (DIR) Post #AaN7hJCQjn8SDeQc5Y by janriemer@floss.social
       2023-10-02T18:47:45Z
       
       0 likes, 0 repeats
       
       Aaaaaannnd we have another example of #AI creating bullshit code. 💩 This time it tries to create a "simple" #Rust function that checks if a string is an acronym:https://www.youtube.com/watch?v=Fvy2nXcw3zc&t=224s (YT, because timestamp)The AI generated code absolutely does not care about #unicode at all, so it panics, when you give it a unicode character that happens to not have their char boundary at byte index 1.1/2#LLM #LLMs  #ArtificialIntelligence #SALAMI #RustLang
       
 (DIR) Post #AaN7hK8vEJvJ93nKG8 by hyde@lazybear.social
       2023-10-02T21:22:59Z
       
       0 likes, 0 repeats
       
       @janriemer should we submit that to the https://incidentdatabase.ai/😏
       
 (DIR) Post #AaN7hLXQ2j73TKGP56 by janriemer@floss.social
       2023-10-02T18:52:07Z
       
       0 likes, 0 repeats
       
       Here is a playground with the AI shitty code and a better version that doesn't panic, _created by us humans_ (I know, wild!):https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=9e5c78234031e86a4e76810cbf64fe73⚠️Warning: the more correct version doesn't handle grapheme clusters, so there is still room for improvement.Docs for chars() mention this (thank you Rust _people_ for these great docs):https://doc.rust-lang.org/std/primitive.str.html#method.charsIt's all not that simple!And the most scary thing is: as of now, noone in the YT comments seem to recognize this mistake.2/2
       
 (DIR) Post #AaN8mN4NsLJHcmdtp2 by janriemer@floss.social
       2023-10-02T21:35:06Z
       
       0 likes, 0 repeats
       
       @hyde Oh well, if such code will end up in some embedded system or medical device, we should definitely consider it. ¯\_(ツ)_/¯😏