alex icon indicating copy to clipboard operation
alex copied to clipboard

Update words.x

Open PiotrJustyna opened this issue 5 months ago • 2 comments
trafficstars

A simple comment update to bring it up to date.

Additionally, I changed the function's return type from () to String as it's easier on the eye while executing the lexer.

If this is useful to anybody, here's a link to a sandbox repository I created for alex: https://github.com/PiotrJustyna/alex-sandbox

PiotrJustyna avatar May 27 '25 09:05 PiotrJustyna

FYI: benchmark run:

time ./words.bin +RTS -s < /usr/share/dict/words
235976
   1,749,384,800 bytes allocated in the heap
      10,807,296 bytes copied during GC
          62,848 bytes maximum residency (2 sample(s))
          35,456 bytes maximum slop
               6 MiB total memory in use (0 MiB lost due to fragmentation)

                                     Tot time (elapsed)  Avg pause  Max pause
  Gen  0       418 colls,     0 par    0.004s   0.004s     0.0000s    0.0001s
  Gen  1         2 colls,     0 par    0.000s   0.001s     0.0006s    0.0012s

  INIT    time    0.004s  (  0.004s elapsed)
  MUT     time    0.204s  (  0.203s elapsed)
  GC      time    0.004s  (  0.005s elapsed)
  EXIT    time    0.000s  (  0.012s elapsed)
  Total   time    0.212s  (  0.224s elapsed)

  %GC     time       0.0%  (0.0% elapsed)

  Alloc rate    8,577,728,309 bytes per MUT second

  Productivity  96.2% of total user, 90.7% of total elapsed

0.21s user 0.02s system 47% cpu 0.487 total

The benchmark run isn't affected noticeably by the changes in this PR.

andreasabel avatar May 28 '25 08:05 andreasabel

Comment done. Feels like we could use a more general guide on how to get started with alex, but that's maybe for another day. Thanks for reviewing again.

PiotrJustyna avatar May 28 '25 09:05 PiotrJustyna

Thanks, @PiotrJustyna for the contribution!

andreasabel avatar Aug 03 '25 16:08 andreasabel