Is it possible to access System.Numerics[.Vector] classes and methods through the Manifold 9 .NET API?

I am having no luck. Some version of both System.Numerics.dll and System.Numerics.Vector.dll is present on the system, but I don't know if they are visible generally, nor if from Manifold.Context.

Does Manifold 9 target a .NET Framework version prior to the addition of Numerics?

Anyway I don't think System.Numeric.Vector<T> (which is what's really valuable) is available from the Framework, only from Core.

The short answer might be, don't use System.Numerics at least for now. Instead, use Manifold native vector types, that is what they are there for. To enjoy SIMD benefits from a .NET script, write an SQL Command or Expression, which will use native Manifold C++ code and therefore Intel MKL, which uses full-width SIMD whenever possible. (I really don't know.)

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.

A quick update on this--mainly to save anyone interested from wasting time on it.

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. ...

The short answer to this issue is to add System.Numerics.Vectors.dll to the GAC. System.Numerics.dll is already there (various versions).

System.Numerics.Vectors.dll only contains the new System.Numerics.Vector<T> and its methods, and relies on a reference to System.Numerics.dll for the rest of the functions in their shared namespace.

For some reason the C# compiler seems to need them to be in the same place--and it seems that the place must be the GAC. When that requirement is met, then Manifold C# scripts can use the new version of Numerics.

I don't know why IronPython does not mind if the two assemblies are in different places.

By the way JetBrains dotPeek was invaluable for a beginner sorting this out. What a great tool (and free).

We are using .NET 4, that's the least advanced / default / base version of .NET guaranteed to be everywhere (well, .NET 2 is even less advanced, but we had .NET 4 a long time ago, it comes by default with all modern versions of Windows so it's safe to rely on it being installed), and that's pre-Roslyn.

We are considering adding $... directives to the script to request a later / side version. However we don't want to be relying on anything above the base version of .NET for our own features, including features in the object model. You can see how messy the picture is currently with eleventy different subdivisions of .NET interacting with each other, it is really frustrating (this also has been going on for years and things are not really improving).

Sum total, you can safely use Vector2 and other things from System.Numerics without any extra hoops right now (they come with system updates, IIRC):

I don't find a lot documentation about howto use vector matrix in manifold but after test ...all is very clear and very easy to combine SQL function / transform template ! But don't find doc howto write transform template but the new way to call sql script variable i think ll be helpfull ..i guess / feel !!

Intel /AMD in every new cpu add more and more register ( storage index) operand ( function) instruction on SIMD architecture ( see flynn taxonomy) to compute here many value at once ( parallel) in different domain ( mainly audio video instruction ). Following intel( not AMD) history we have in intel platform MME , SSE and now AVX ( for vector) .

A old article here help us understand better the context and this post ( that deal with performance / speed) and understand the valuable information post here !! thank's a lot tjhb for this post ( and many others i like to study/ understand ) !!

microsoft OS ll change a lot when understand that microsoft want dev tool that target both android and apple OS ( winphone is dead) . I am very happy to see more and more microsoft application for android or Apple OS . For example a Microsoft app let us change android desktop layout to have microsoft look and feel . In the same time google add new tools in microsoft OS to avoid to use ( buy) microsoft RDP or teamviewer by using chrome browser !! apple fight against some application like google map but Apple have to be more ll be more open to not death ( airplay 2 is available in TV 2019 and wireless audio device !! ..)

here infography about the future of microsoft .. even not really show cpu instruction but let us undertand some words like ryuJIT , nuget and that "core" word has differents meanings ...

there is really a lot to know about SIMD and System.Numerics[.Vector] and what i write is really a little part of the subject ( old point of view of a developper herehere performance test here another library toon )