Well, publicly airing my ignorance and exasperation seems to have helped. I made progress today and learned a lot (which I should have known before). My original question was framed wrongly: Is it possible to access System.Numerics[.Vector] classes and methods through the Manifold 9 .NET API from Manifold 9 .NET scripts?
The answer is: yes and no. The updated System.Numerics class, provided by System.Numerics.Vectors.dll, is not part of the .NET Framework, but it is not limited to .NET Core, since it can be fetched into a Visual Studio project using NuGet, and if necessary copied from the NuGet cache and reused. This gives access to the generic vectors and their new methods, and to useful SIMD execution via the Roslyn IL compiler and the RjuJIT native compiler... Provided that those compilers are in fact being used? Manifold C# scripts cannot use the new version of Numerics, perhaps because Manifold uses C# 5.0, or because it is using a pre-Roslyn compiler, or for a related reason. If a Manifold C# script includes a reference to the new System.Numerics.Vectors.dll, the compiler seems to become confused, and can't find anything in the System.Numerics namespace. However, it can use the old version (referencing System.Numerics.dll, without generics) just fine. On the other hand, Manifold IronPython scripts can use the new version. Perhaps because IronPython uses the Dynamic runtime, which in turn uses an up-to-date compiler toolchain? I don't know. The current version of C# supplied with Visual Studio 2017 can also use the new version. So far I have only tested using the C# REPL, with no problems at all. So an external application using the Manifold 9 API will also be able to use the new Numerics if it wants to. I'll post a simple project tomorrow. No speed comparisons yet, let alone anything useful, just getting the wiring to work (and not).
|