A little comparison between R and Kap

· open-source · Source ↗

TLDR

  • Blog post reimplements pandas-vs-R examples in Kap (an APL dialect), showing Kap is terser but lacks R’s automatic CSV type inference and column-header parsing.

Key Takeaways

  • io:readCsv in Kap returns all values as strings; R’s read_csv auto-parses numerics and headers, requiring explicit extra steps in Kap.
  • Kap’s fork syntax and labels function handle header extraction cleanly, and ⍎¨⍢(0 1↓) converts non-string columns to numbers.
  • Grouping uses the key operator ; outlier removal uses bitmap filtering with and stat:median, both composable inline.
  • Author notes Kap solutions are shorter overall but R’s ergonomic defaults reduce boilerplate for common data-loading tasks.
  • A readCsv variant with auto type inference is flagged as a worthwhile addition to Kap.

Hacker News Comment Review

  • No substantive HN discussion yet.

Original | Discuss on HN