tag:blogger.com,1999:blog-4348519741358344123.post1296946069056689640..comments2023-04-16T06:46:23.339-04:00Comments on functional orbitz: C++11 is unsafeUnknownnoreply@blogger.comBlogger3125tag:blogger.com,1999:blog-4348519741358344123.post-85841395336292847812012-08-14T10:46:15.260-04:002012-08-14T10:46:15.260-04:00Cool post. Why no Facebook like button? Reach more...Cool post. Why no Facebook like button? Reach more people...Assafhttps://www.blogger.com/profile/07807112192107539607noreply@blogger.comtag:blogger.com,1999:blog-4348519741358344123.post-40806372716524761422012-08-04T10:19:19.964-04:002012-08-04T10:19:19.964-04:00I believe John D Cook did a blog post that put for...I believe John D Cook did a blog post that put forth the idea of separating C++ into two languages: Top C++ and Bottom C++. Top C++ would, for example, not have pointer arithmetic. Although it's unclear what op[] for a vector would be then. If Top is safe should we only be able to use std::vector::at? Or is safety just in terms of raw memory allocations? I don't know.<br /><br />I'm not sure "modern" means "advanced". As I say, I also don't know what Sutter means by "modern" either, so I just gave a list of languages that have been getting some attention lately.<br /><br />Thanks for the insight.orbitzhttps://www.blogger.com/profile/15829306324556605767noreply@blogger.comtag:blogger.com,1999:blog-4348519741358344123.post-79864453957212019542012-08-04T08:49:20.179-04:002012-08-04T08:49:20.179-04:00One problem is that there's no way to distingu...One problem is that there's no way to distinguish easily automatically safe code from unsafe code. If you start with safe code, you can easily make it unsafe, and sometimes non obviously unsafe.<br /><br />(I also find that you have a strange notion of "modern", which looks more like "recent" than "advanced"; eg. Common Lisp would be one of the oldest language amongst your list (standardized in 1994, only Ada was standardized earlier, in 1983), but it would still be one of the more advanced and safest of the list).<br /><br />In Modula-3 and some other languages designed to do system programming as well as application programming, most of the language is safe: you can only use safe operators. But you can also write modules declaring them UNSAFE, were you can use unsafe operators (such as pointer arithmetic). Your unsafe modules must only export safe operations (you need to prove yourself or with the help of program provers that your exported operations are safe).pjbhttps://www.blogger.com/profile/09065388232282458321noreply@blogger.com