jank-lang / jank

A Clojure dialect hosted on LLVM with native C++ interop

Home Page:https://jank-lang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unboxed primitive fn signatures

jeaye opened this issue · comments

Clojure supports unboxed signatures for fns with up to 4 params. jank can do the same thing, but it comes in two steps:

  1. We support type hints on fns and generate the appropriate primitive version
  2. When we already have the type/box info for each param, we can generate code to invoke accordingly

Right now, jank tracks boxing info, but not type info. This may be required, if we support unboxed things which aren't numbers. I'm not yet sure if we will.

Alex Miller covers an example of this here: https://youtu.be/s_xjnXB994w?t=2529