[HN Gopher] A high-throughput parser for the Zig programming lan...
       ___________________________________________________________________
        
       A high-throughput parser for the Zig programming language
        
       Author : jedisct1
       Score  : 37 points
       Date   : 2025-04-16 14:11 UTC (2 hours ago)
        
 (HTM) web link (github.com)
 (TXT) w3m dump (github.com)
        
       | neerajsi wrote:
       | Very interesting project!
       | 
       | I wonder if there's a way to make this set of techniques less
       | brittle and more applicable to any language. I guess you're
       | looking at a new backend or some enhancements to one of the
       | parser generator tools.
        
         | adev_ wrote:
         | I have applied a subset of these techniques in a tokenizer in
         | C++ to parse a language syntactically similar to Swift: no
         | inline assembly, no intrinsics, no SWAR but reduce branching,
         | cache optimization and SIMD parsing + explicit vectorization.
         | 
         | I get:
         | 
         | - ~4 MLOC/sec/core on a laptop
         | 
         | - ~ 8-9MLOC/sec/core on a modern AMD sever grade CPU with
         | AVX512.
         | 
         | So yes, it is definitively possible.
        
       ___________________________________________________________________
       (page generated 2025-04-16 17:00 UTC)