[HN Gopher] C Isn't a Programming Language Anymore
       ___________________________________________________________________
        
       C Isn't a Programming Language Anymore
        
       Author : jasonpeacock
       Score  : 30 points
       Date   : 2022-03-16 21:56 UTC (1 hours ago)
        
 (HTM) web link (gankra.github.io)
 (TXT) w3m dump (gankra.github.io)
        
       | _3u10 wrote:
       | Nah it's a programming language author just don't like it.
       | 
       | You don't have to write FFI for Linux. Use your great new
       | language to write an OS, or one of the many OSes not written in
       | C.
       | 
       | Let's face the facts, your new language probably solves some
       | pretty theoretical problems and not problems people actually have
       | like, hey I need to layout these structs exactly so the hardware
       | will work. Or I can parse a packet off the wire in a reasonable
       | amount of time.
        
       | rayiner wrote:
       | My Google SoC project was writing a c++ bindings generator for
       | Common Lisp: https://lwn.net/Articles/147676/ (In my head this
       | was ten years ago, but apparently it'a nearing 17. Shit I'm
       | getting old.)
       | 
       | C isn't ideal, but it's actually not so bad and it could be worse
       | (it could be C++). Yes parsing C is non-trivial, but that's true
       | of every language. Kids these days have libclang and a dozen
       | other decent C parsers. Back in my day I had to use a hacked up
       | version of GCC.
       | 
       | Also, C doesn't have a standard ABI, but every real world
       | platform defines a C ABI. And it's pretty simple. Meanwhile
       | trying to handle all of the cases of C++ vtables took up weeks of
       | my life (and I ended up shipping without fully supporting
       | multiple inheritance, which is stupid anyway).
       | 
       | The bigger problem for writing FFIs is, in my opinion, memory
       | management.
        
       | dleslie wrote:
       | This is a strange complaint that seems to reduce to C not having
       | a week defined ABI.
       | 
       | Of course it doesn't. C implementations do. This isn't really any
       | different than most other languages, but feels different because
       | C doesn't have a blessed implementation that all other
       | implementations must interact with.
       | 
       | That's a strength. It means C is found on esoteric
       | microcontrollers as well as powerful modern desktops. That
       | wouldn't work as well as it could if the ABI were uniform on all
       | targets and implementations.
        
       ___________________________________________________________________
       (page generated 2022-03-16 23:00 UTC)