Background: As part of the Gonum dev team, I have an interest in using Go for scientific computing. This stems from long experience with unsafe computing environments often used in, particularly, bioinformatics (perl, python and R being standouts in the field, with packages that often use dubious design and implementation practices that allow silent failures giving plausible but incorrect results rather than following than following the rule of repair. In Gonum packages we (perhaps non- idiomatically in the context of the broader Go ecosystem) insist on failing noisily when we can rather than allowing silent progression to an incorrect result; we use panics instead of errors a fair bit because they cannot be implicitly ignored.
Question: One of the areas where we do this is in the mat package for matrix arithmetic and linear algebra. We use panics in lieue of a compile-time type check for appropriate input matrix shape (e.g. the check needed to ensure [mxw] <- [mxn] x [nxw] is a valid operation). I don't see any way to encode this kind of information into a contract as it stands in the current contracts draft. I'm not entirely sure that any kind of reasonably simple contract system *would* allow this. If we assume that there is some type parameterised function that operates on say [n][m]T to perform a matrix mult, can anyone see a way of encoding the required constraint? thanks Dan -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.