Autowrap for .NET is Now Available

JJS at jjs.com JJS at jjs.com
Sat Dec 15 00:43:42 UTC 2018


>> Do you have plans to incorportae this as a VisualD project 
>> .csproj project since it's already intended to be microsoft 
>> oriented? (It would seem like a good fit to me.) That way you 
>> could even take away the mixin code and the "running the main 
>> method" code.
>> 
>
> I do not since I wouldn't know where to start, but it's 
> possible.
>


This is an interesting ideal Visual D already provides a D 
injection in to C++ projects.

Using DLangInNet(I'm renamed your project for you ;) one should 
be able to add D code in to a C#, F#, C++, VB, or any .net 
compatible project.

You should talk to Rainer about this. It shouldn't be all that 
difficult to do since C#'s PInvoke does all the real work. I 
assume DLangInNet just generates a C# equivalent that forwards 
all the calls to the D code using Pinvoke when necessary?

So the idea is that one can add .d files to .Net projects, when 
built:

1. The D files are compiled.
2. DInNet runs on the D code and generates the C# output(could be 
modified for many other lannguages such as python, F#, Haskell, 
etc). Basically an autobinding generator from D to whatever, 
might be a good project to develop.
3. .Net handles the rest.

The point of having it this way in Visual Studio is that one can 
on a single project that has many different languages involved 
and can setup a rather seamless connection. This allows one to 
tailor the program design to the language of choice. E.g., D for 
performance, C++ for barebones, C# for gui, F# for structure, etc.

This could be used for Unity, say, for using D in algorithms. 
Such a feature would attract far more users and give D a boost in 
it's userbase and more will get done.

What we need is an idea that just works and one can use any 
appropriate source language at any time and they all bind without 
hicup's in most cases.

One can easily update all the compilers at a click and unwind if 
any compiler fails to build a project, etc. So much more could be 
done. But a start would be getting some of these different 
zones(e.g., languages, 3D engines, compilers, etc) to all work 
seamlessly in an integrated fashion.

E.g., something along the lines of:

1. Pick your language's
2. Pick your rendering engine
3. Pick your standard library
4. Pick your extensions


And so one can mix and match all things and everything just 
connects together. E.g., your python file will "intellisense" 
with your D file. Write a function in Haskell and it is callable 
in VB which can be called by your python file.

of course, this would suggest that there is just one underlying 
language and many "versions"(mappings) on top... which is 
basically IR with .NET.

I'm just thinking grander and not having to write a new 
compiler... just using bindings and wrapper generators to 
generate the code. Since most languages use object files and 
pretty much follow the same basic principles, it probably could 
be done for most things needed by most people.

One would just have to come up with the proper design so that 
people could build on it and connect languages in to the 
ecosystem easily.

This is the direction in which IDE's are headed but I don't think 
they realize it yet.

It seems it wouldn't be all that much work either. Essentially 
one just maintains a list of "exportable" symbols for each 
language source, project, module, etc and all other language 
sources can see them.

E.g., write a public global function or variable in D, say, and 
it is automatically exported which can then be seen in any other 
language source. Proper interaction will be chosen and everything 
will just work.

This would be like being able to speak 10 languages nearly 
simultaneously! With such an IDE it could even deal with 
Marshalling and seg faulting issues such as apply warnings when a 
variable should be free'd when it is interopted with and the IDE 
knows it should(e.g., D and C++ issues) or whatever. (People 
would be able to write such rules so that errors could be 
minimized)






More information about the Digitalmars-d-announce mailing list