thomasnield
12/18/2018, 9:28 PM(-4.0).pow(1.0/3.0)
, which returns NaN
due to lack of support for imaginary numbers. However, Java has Math.cbrt()
specifically for this purpose. Is this something Kotlin should explicitly support?altavir
12/26/2018, 5:04 PMthomasnield
12/27/2018, 12:08 AMthomasnield
12/27/2018, 12:12 AMthomasnield
12/28/2018, 12:15 AMbreandan
12/28/2018, 6:43 AMaltavir
12/28/2018, 7:06 AMI suspect you want people to be able to extend these APIs without knowing abstract algebra and category theory.No, I definitely do not want people to extend any classes if they do not want what they are doing. This is a Java approach and we want to move away from it. I want people to use existing constructs and possibly write extension functions.
thomasnield
12/29/2018, 7:04 AMaltavir
12/30/2018, 4:35 PMaltavir
01/05/2019, 11:09 AMbreandan
01/05/2019, 7:14 PMval ε = 0.03
is a valid statement, but val ∇ = 0.03
is not.breandan
01/06/2019, 4:10 AMaltavir
01/08/2019, 5:38 PMaltavir
01/09/2019, 6:57 PMbreandan
01/09/2019, 7:14 PMaltavir
01/10/2019, 3:30 PMbreandan
01/11/2019, 10:58 PMfun List<TypeA>.doSomething() = Something()
and fun List<TypeB>.doSomething() = SomethingElse()
in the same scope for multiple dispatch on a generic type. What's interesting is that this behavior is not possible to implement with a true member function inside List
(due to type erasure), but since the call site knows the type then it will work! This is very cool! https://github.com/breandan/kotlingrad#howthomasnield
01/14/2019, 2:24 AMthomasnield
01/18/2019, 6:37 PMthomasnield
01/18/2019, 6:38 PMkyonifer
01/19/2019, 9:41 PMMatrix
implementation in both of those languages just to make sure it wasn't some weird optimization done by the builtin libs that was cheating. My matrix wrapper used builtin arrays with the matrix algorithms i needed added in by me: on julia implemented using multiple dispatch, on swift using their generic specialization of protocols to eliminate virtual calls and protocol/value witness table lookups. In both cases i ended up with something that was fast, no codegen required, and generic. It was a discouraging result, because i prefer the language of kotlin much more but i have spent much more time trying to make it fast (via koma) than my weekend project in those twokyonifer
01/19/2019, 9:59 PMMatrix
, except for the fact that I want to support multiple backends at runtime. I'm not sure how useful that feature actually is to anyone though. If I said "only import one back-end at a time" I could probably rely on an inline class
around the underlying memory (e.g. around the pointer on k/native to the matrix memory) or at least a final one with whatever it needs inside. Of course, before doing so I'd have to produce some metric to show its worth the pain. It's probably drowned out by other sources of slowness for now.Percha
01/20/2019, 10:03 AMThomas Legrand
01/21/2019, 8:40 AMhudsonb
01/21/2019, 5:23 PMfun someMath(phi: Double) {
var phi = phi
// ....
}
The one place that method parameters being final seems to annoy me is when I'm writing mathematical functions.thomasnield
01/22/2019, 7:13 PMmpp-dev
branch that you can target your WIP to.thomasnield
01/22/2019, 7:20 PMbreandan
01/24/2019, 11:44 PMbreandan
01/26/2019, 6:35 PMaltavir
01/27/2019, 8:31 AM