Looking at the docs, it seems Luna uses some from of multiple dispatch. The only language I know of, that also uses MD is Julia, but there are three notable differences:
- It does not have currying.
- The type system is weak (you can get run time errors).
- It uses Just In Time compiler (to prevent massive bloat of specialized functions).
There is also no difference between functions and methods. I am unsure whether the difference in Luna is just syntactic…
So I would like to know how Luna deals with each of these problems:
- How do you dispatch on curried functions (eg
A.f :: Int -> Int,
B.f :: Int-> Int -> Int, what is type of
foo x = x.f 2)
- How do you represent data under the hood? Is it a dictionary with data and pointers to its methods?
- Have you thought about specializing functions at runtime to decrease bloat and compilation time?
- Is there any significant difference between functions and methods in Luna? Is method just an infix function?