zlacker

[return to "My fast zero-allocation webserver using OxCaml"]
1. ttoino+da[view] [source] 2026-02-02 12:25:13
>>noelwe+(OP)
Does it look like functional programming anymore ?
◧◩
2. cess11+zr[view] [source] 2026-02-02 14:12:30
>>ttoino+da
Looks pretty ML:ish to me, even in a segment like this:

   let parse_int64 (local_ buf) (sp : span) : int64# =
     let mutable acc : int64# = #0L in
     let mutable i = 0 in
     let mutable valid = true in
     while valid && i < I16.to_int sp.#len do
       let c = Bytes.get buf (I16.to_int sp.#off + i) in
       match c with
       | '0' .. '9' ->
         acc <- I64.add (I64.mul acc #10L) (I64.of_int (Char.code c - 48));
         i <- i + 1
       | _ -> valid <- false
     done;
     acc
[go to top]