• altavir

    altavir

    3 years ago
    Here is an interesting proposal about primitive specialization: https://discuss.kotlinlang.org/t/primitive-type-specialization/11022
    altavir
    k
    5 replies
    Copy to Clipboard
  • breandan

    breandan

    3 years ago
    What characters valid Kotlin identifiers? Some unicode characters are allowed without backtick-escaping. For example
    val ε = 0.03
    is a valid statement, but
    val ∇ = 0.03
    is not.
    breandan
    gildor
    3 replies
    Copy to Clipboard
  • breandan

    breandan

    3 years ago
    @altavir Have you considered using sealed classes / algebraic data types (ADTs) for expressions? The original use case exactly fits building abstract syntax trees of symbolic elements, for example: https://kotlinlang.org/docs/reference/sealed-classes.html https://antonioleiva.com/sealed-classes-kotlin/ See also the original paper on GADTs: https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/gadtoop.pdf
    breandan
    2 replies
    Copy to Clipboard
  • altavir

    altavir

    3 years ago
    Also class structure seems a little bit overengeneered. It is completely opaque to the user so it is not the problem, but still I am not completely happy with it.
    altavir
    thomasnield
    10 replies
    Copy to Clipboard
  • altavir

    altavir

    3 years ago
    From user point of view everything will be simplified down to factory methods. What I really fear is too complicated type structure for developers. For example, ojalgo is super complicated, I am not sure anyone but the author can understand what happens inside.
    altavir
    thomasnield
    3 replies
    Copy to Clipboard
  • breandan

    breandan

    3 years ago
    breandan
    altavir
    3 replies
    Copy to Clipboard
  • altavir

    altavir

    3 years ago
    Do someone know a good way for matrix inversion benchmarking? The problem is that obviously inversion will have different complexity for different matrices, and I can't use random ones because not every matrix could be inverted. To generate them as LUD?
    altavir
    breandan
    +2
    13 replies
    Copy to Clipboard
  • breandan

    breandan

    3 years ago
    @altavir I'm stealing your idea of context oriented programming for Kotlin𝛁. It's nice because you can declare extensions on parametric types, for example declaring
    fun 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#how
    breandan
    altavir
    7 replies
    Copy to Clipboard
  • thomasnield

    thomasnield

    3 years ago
    @altavir what's your barrier in keeping it going?
    thomasnield
    altavir
    4 replies
    Copy to Clipboard
  • thomasnield

    thomasnield

    3 years ago
    @altavir what are the big disadvantages of JNI anyway? Besides debugging inconvenience and weird overheads outside the JVM? 🤔 the more I watch you toil at this and deal with boxing the more I wonder if we truly are making this BLAS thing difficult.
    thomasnield
    1 replies
    Copy to Clipboard