Zig heading toward a self-hosting compiler
Zig heading toward a self-hosting compiler
Posted Oct 7, 2020 17:46 UTC (Wed) by snopp (guest, #138977)In reply to: Zig heading toward a self-hosting compiler by khim
Parent article: Zig heading toward a self-hosting compiler
Do you mind elaborate a bit more about the point above? Or a link to where I can read more about it.
      Posted Oct 7, 2020 18:17 UTC (Wed)
                               by chris.sykes (subscriber, #54374)
                              [Link] (1 responses)
       
https://ziglang.org/#Manual-memory-management 
https://ziglang.org/documentation/master/#Memory 
The second link is is worth reading in its entirety if you're interested in an overview of the language features. 
     
    
      Posted Oct 8, 2020 13:43 UTC (Thu)
                               by kleptog (subscriber, #1183)
                              [Link] 
       
> The API documentation for functions and data structures should take great care to explain the ownership and lifetime semantics of pointers. Ownership determines whose responsibility it is to free the memory referenced by the pointer, and lifetime determines the point at which the memory becomes inaccessible (lest Undefined Behavior occur).  
Since we now have Rust as demonstration that all the ownership checks can be done at compile time (thus no runtime cost) this feels like a missed opportunity. 
     
    Zig heading toward a self-hosting compiler
      
Zig heading toward a self-hosting compiler
      
 
           