PDA

View Full Version : Core - would like to write C# plug-ins



ToolmakerSteve
10-28-2009, 08:44 AM
While I can program in C++, I hate it. And I have no interest in Python. When Core comes out, will there be a way to write plug-ins in C# (or any other .NET language)? If not, please consider it. I realize that is not a cross-platform solution, but there is much power in .NET platform, and that is what I use.

Lightwolf
10-28-2009, 09:19 AM
I suspect CORE to use SWIG... and then you should be able to create your own wrappers (or NT should be):
http://www.swig.org/Doc1.3/CSharp.html

On the other hand, CORE will be running on three, not just two platforms as well.

Cheers,
Mike

Matt
10-28-2009, 09:32 AM
Why do people not like C++? I've heard this a few times now.

ToolmakerSteve
10-28-2009, 10:55 AM
My background: Started using C in 1978 on Berkeley Unix, started using C++ when it became available. But in the meantime, I had used Smalltalk and Mesa [an early OO language on Xerox Dandelion workstations, with a clean design], so I knew what OO could be like.

While C++ was a major step forward in creating complex software compared to C, compared to more modern OO alternatives [Java, any .NET language] it is deeply fragile. Professional quality C++ code creation requires the programmer to hold a lot of subtleties in their mind. Basically, C++ is today's "assembly language": if performance of the running code is the goal, use it. If performance of the programming team, not to mention long-term evolution of the code is the goal, consider other alternatives.

Then there are dynamic languages and scripting languages, which have different roles - though have been evolving into full-fledged software engineering alternatives, as can be seen in IronPython or IronRuby. So maybe someday I will use those. [No, I don't work for Microsoft or otherwise have any pro-Microsoft axe to grind - I just use the best available technology for my purposes, which currently is .NET].

ToolmakerSteve
10-28-2009, 10:55 AM
Lightwolf - thanks for heads-up re SWIG. Will keep that in mind :)

OnlineRender
10-28-2009, 11:03 AM
Could be worse you could have suffered 2 years worth of pointless pascal "argh" C# is ok we use that for some stuff (XNA)

ToolmakerSteve
10-28-2009, 11:16 AM
Looking at the SWIG link - sure if one can PInvoke from inside a plug-in, then anything is possible .. so I hope that is the case. (Barring possible performance issues accessing non-managed data from a managed language... But for now any solution would do. )

COBRASoft
10-28-2009, 11:41 AM
Let me know if you have a C# or VB.Net wrapper working please. I'm interested in this too. I develop in VB.Net everyday, whole day :)

Perhaps it would be interesting to combine CORE and .Net with a good SQL Server Database one day... Dreaming loud here...

jay3d
10-28-2009, 11:50 AM
While those "modern" high-level languages could be the way of the future (I doubt it), applications written in such a language like Java, C# (what a lousy name), Python (that's an exception to a certain limit) tend to be slower, consumes unnecessarily more memory, unnecessarily huge, requires the use of a virtual machine (which significantly add to the memory overhead) and are crippled by patents from their respective vendors (see Mono and it's struggle)

I think the languages that worth to be the future are C++, Objective C and Python (this latter can be faster than C# in some routines)

and ... really ... what .NET stands for??

ToolmakerSteve
10-28-2009, 12:57 PM
Everyone is entitled to their own opinion :D

jay3d
10-28-2009, 01:05 PM
Well if an application as simple as "Hello, world!" can take 25 megs of ram, then there's really a serious problem with the language design :stumped:

ercaxus
10-28-2009, 02:38 PM
Haskell !!

(runs away)

Titus
10-28-2009, 03:17 PM
Why do people not like C++? I've heard this a few times now.

It's just a matter of personal and subjective preferences, like with many other things (mac vs pc, windows vs unix, etc.).

I'm very technology agnostic in my professional life, I'm always open to any language, OS, computer platform that fit my needs. I can program in a dozen of computer languages (just like any other experienced programmer), and I don't program in C# for the only rason that my head seems to be saturated.

DiscreetFX
10-28-2009, 03:18 PM
@jay3d

The C# version of "Hello World" takes into account code for future Quantum Computers and Diamond Semiconductors. Thus the code has to be a little bloated for that, it's a feature!

:thumbsup:

Lightwolf
10-28-2009, 04:47 PM
While those "modern" high-level languages could be the way of the future (I doubt it), applications written in such a language like Java, C# (what a lousy name), Python (that's an exception to a certain limit) tend to be slower, consumes unnecessarily more memory, unnecessarily huge, requires the use of a virtual machine (which significantly add to the memory overhead) and are crippled by patents from their respective vendors (see Mono and it's struggle)
Well, yes and no. On the other hand, they can be faster running certain kinds of code, and don't need to be slower. To the contrary, since there is always the option of the runtime creating optimized native code - and that means optimized to the current architecture as well as the system configuration.

Which is a lot more fun than multiple bit-ness and CPU extensions builds.

Not that we're there yet, but the potential is. After all, even many CPUs "interpret" machine code and don't run it natively.

Cheers,
Mike

OnlineRender
10-28-2009, 05:00 PM
I spoke to someone about this today , he use's python for a game engine " don't ask which one " and he said the exact same thing ..

"there's a port / wrapper that goes from C++ - Python ,and if you use python he said to try writting a iphone app using it ,he also said
Shed Skin Python-to-C++ Compiler is good aswell (blog) google it and goodluck "

end quote (",)

PEACE

francesY
12-25-2012, 02:03 AM
I like this post!

Silkrooster
12-25-2012, 10:51 PM
For now this thread is kind of moot since Core is to our knowledge dead. Even though I personally believe that it is being sneaked into the old code a little at a time until it is done without any bickering coming from the public. Afterall we now do have python and bullet. But that's just my opinion, it could all be a coincidence. If you believe in that.

BigHache
12-26-2012, 06:00 AM
We sort of have Python. Still waiting on it to have a complete implementation where it has access to all classes available in LightWave and XPanels. Align vertical and align horizontal can only take you so far when designing a UI. Hoping to see some of that move forward in 11.5.

Kryslin
12-26-2012, 09:24 AM
I'd love to see .NET bindings for lightwave, since I'm fairly good with C# and VB.NET. However, I realize that these items may be very low on the TO-DO list of the Dev-Team.

Cryonic
12-26-2012, 09:57 AM
Those probably won't exist as they aren't well supported for cross-platform applications. The SDK does provide for C/C++ bindings, IIRC.

Lightwolf
12-27-2012, 05:40 AM
Those probably won't exist as they aren't well supported for cross-platform applications. The SDK does provide for C/C++ bindings, IIRC.
C... but there's C++ wrappers, such as our lwpp (which is far from complete, any help is appreciated): https://github.com/dbw/lwpp

Cheers,
Mike

Silkrooster
12-27-2012, 11:53 PM
I have been doing a bit of reading and it doesn't look like it would be too hard to create a wrapper for C#. I think the only catch is C++ must use /clr. It may also be necessary to compile for 64 bit as well, but like I said a bit of light reading, so for me this is all guess work for now. But it may make it easier to use lightwave assets in a XNA based game or generate XAML for creating 3D UI's for example. So there are some interesting possibilities. Granted I don't know enough about C++ yet for a comparison.

Kryslin
12-28-2012, 12:12 PM
I'd have to review my C#/VB.NET materials, but I think the C++ wrapper could be used as-is in a managed C++ environment. Yes, that would require the CLR, but the JIT compiler could generate native machine code at run time...

COBRASoft
12-28-2012, 05:07 PM
Kryslin, or you use ngen after installing on the destination computer. Also, the JIT compiler has to do it's stuff once (per launch), afterwards, it keeps a lot of stuff in 'cache' while executing. I use .Net daily and I am really impressed with what I can achieve in short terms.

Silkrooster
12-29-2012, 01:37 AM
I been reading again and now I think for C# it really depends on whether you are using windows forms or wpf. Windows forms is based on win32 and wpf supposedly is not. I also read that using windows forms, you can use unmanaged C code using interop if that's makes sense. I thought it was weird that forms had a way to access com and I think activeX but it appears it is not as easy in wpf.
Anyway it really is way over my head, but none the less I find it interesting.

COBRASoft
12-29-2012, 04:52 AM
I still program WinForms. WPF is going nowhere since Microsoft decided to go for HTML5 + CSS + JS instead. The 'metro' part of Windows 8 is in fact HTML5 and not WPF or SilverLight. SilverLight is used on Windows Phone though. The 'power' behind WPF is XAML, a structured language for UI (GFX, Anims, inputfields, ...). See it as a mixture of Flash, html, xml, css, ... but then in .C# or VB.Net. 'Old' developers struggle a bit with WPF, new developers catch it up faster since they don't know the old way.

So, go HTML5 for the interface :D.

sami
12-29-2012, 11:11 AM
Don't forget Unity rocks with C#, it's fast performing and easy to kick out complex stuff with. I've done multithreaded stuff with it too. You can always call external libraries from it, and MonoDevelop on the Mac works fine too so no problems with platform issues... Bottom line is, despite the C++ purists saying high level languages are crap, they kick *** with productivity. Do I really wanna spend that much time dealing with simple tasks like string handling or json/xml parsers? Sure there are external libraries, but C++ code gets nasty quickly and takes longer to produce better stuff....


With processor speeds these days, you'd be hard pressed for a lot of tasks to say C# is slow.

Also, productivity = less $$ to develop, and in this age of "minimum viable product" that should not be discounted if the app performs fast enough. Anything else is for publicly funded university researchers to debate. ;-)

Cryonic
12-29-2012, 11:10 PM
Don't forget Unity rocks with C#, it's fast performing and easy to kick out complex stuff with. I've done multithreaded stuff with it too. You can always call external libraries from it, and MonoDevelop on the Mac works fine too so no problems with platform issues... Bottom line is, despite the C++ purists saying high level languages are crap, they kick *** with productivity. Do I really wanna spend that much time dealing with simple tasks like string handling or json/xml parsers? Sure there are external libraries, but C++ code gets nasty quickly and takes longer to produce better stuff....


With processor speeds these days, you'd be hard pressed for a lot of tasks to say C# is slow.

Also, productivity = less $$ to develop, and in this age of "minimum viable product" that should not be discounted if the app performs fast enough. Anything else is for publicly funded university researchers to debate. ;-)

For interface stuff (where human reaction time is involved), you're right that high level code isn't that big of a speed issue. But when it comes to 3D or other data heavy type of systems (like microarray biostatistics) the lazy code could have a big impact. Like orders of magnitude difference in the use of memory, disk, CPU, etc...

sami
12-30-2012, 12:34 AM
For interface stuff (where human reaction time is involved), you're right that high level code isn't that big of a speed issue. But when it comes to 3D or other data heavy type of systems (like microarray biostatistics) the lazy code could have a big impact. Like orders of magnitude difference in the use of memory, disk, CPU, etc...

I fully agree, but unless you are rewriting a renderer or something where everything requires that, then why not just abstract out that function and use the low level language to make the number cruncher etc library and pass that data back to C# or some other high level language - to allow it to display the GUI and/or work with the data?

Again, productivity is king - at least for people who care about the cost of development. If you're doing microarray biostatistics as you say, then you are most likely in a clinical or university/corporate research setting and have the funds to go slow and wrestle with the tedium of some tasks in low level development. If you aren't heavily number crunching but still need to handle big data - maybe have a look at tools like hadoop (http://hadoop.apache.org/). But we are talking about using languages like C# for addons to off-the-shelf software like Lightwave.

And of high-level languages, Java is great and all, but I prefer C# mainly because of the IDEs - plus some libraries are often simpler/cleaner. With Java I don't want to spend my time messing with annoying frameworks like Stripes or whatever which lock you in with development and there are a myriad of choices for which one to use. Plus I pretty much hate Eclipse (MyEclipse, Aptana, all of them) with the white hot passion of 1000 suns. But then again, I digress... :ohmy:

Silkrooster
12-30-2012, 01:25 AM
Wouldn't it make sense to prototype in a higher level language and then go back and fine tune with a lower level language?

COBRASoft
12-30-2012, 05:09 AM
Sami: couldn't agree more! Visual Studio ROCKS! Add CodeRush to it and it becomes gold.

sami
12-30-2012, 06:10 AM
Sami: couldn't agree more! Visual Studio ROCKS! Add CodeRush to it and it becomes gold.

Btw Monodevelop with C# on the Mac is excellent as well and though not as full featured, is still a lightweight very usable IDE.

Cool -had a peek at CodeRush. Wtf is up with their subscribe model? The product looks interesting, but I no longer have any use for companies who require subscriptions. I won't ever do the Adobe Cloud junk nor rent my software. I want a capital one-off expense that I can justify and just buy. I don't want another utility bill and more admin work every month. My business can justify purchasing software outright if we make money from it, I am so tired of this software as a service trend, nickel & diming me to death and mostly just being irritating. When software companies go down this road I just run screaming and take my cash elsewhere. I'll use MSPaint before I go to the "creative cloud" if Adobe ever stop selling their products as well... (Btw - this means you too NewTek - please never go to a subscription-only-model or you've lost me). ;-)

Burchigb
12-30-2012, 07:06 AM
My experience with coding is that you keep it one language, mixing just makes it easier to crash it.
Using a code that can work well on all three platforms is difficult.

CodeRush cost too much and there is no direct benefit to the coding of the platform you are working on.

Lightwolf
12-30-2012, 12:12 PM
CodeRush cost too much and there is no direct benefit to the coding of the platform you are working on.
Very much like an IDE... ;)

Cheers,
Mike

HarverdGrad
12-30-2012, 03:08 PM
Coderush is okay, but it can be really annoying when using the intellitype (guesses what you want to type)- and you have to literally type a partial string.. hit space.. backspace and then finish your line of code. Jetbrains ReSharper looks similar and for much less. If I was an Indie developer- I'd check out ReSharper.

I gave up using DevExpress Studio due to all the bloated page size, and Jumping through hoops to have multiple AJAX Panels trigger off each other. Much lighter alternatives. But to each is own :thumbsup:
Regards~

jwiede
12-30-2012, 03:19 PM
CodeRush cost too much and there is no direct benefit to the coding of the platform you are working on.
Won't address cost, as productivity-vs-cost is a personal decision, but if you're not getting a huge productivity boost using tools like CodeRush, you're not using them correctly. Used properly, such tools save a LOT of time by automatically generating all the "boilerplate" structural code in C#/C++/C, regardless of platform/app the code itself targets.

Also look at Atomineer's Atomineer Pro utils for accelerating "autodoc" generation within VisualStudio for C#/C++/C/etc. It has a very impressive ability to extract doc text given just minimal info in the routines' code themselves. Definitely worth a try if you are required to produce "autodoc"-type doc headers in your code.

jwiede
12-30-2012, 03:23 PM
Coderush is okay, but it can be really annoying when using the intellitype (guesses what you want to type)- and you have to literally type a partial string.. hit space.. backspace and then finish your line of code. Jetbrains ReSharper looks similar and for much less. If I was an Indie developer- I'd check out ReSharper.
ReSharper is only for C#, while both CodeRush and VisualAssistX support C#/C++/C language coding. If you don't like CodeRush's model, take a look at VisualAssistX (www.wholetomato.com) as an alternative. I prefer CodeRush of the three, but they each have different strengths and weaknesses, so depending on your precise needs, it's worth checking all three out IMO.

COBRASoft
12-30-2012, 04:51 PM
I develop WinForms in VB.Net and have customized my CodeRush to my needs. It works super for what I want it to do, it doesn't work where I don't want it work (disabled those features or changed them).
I have my own framework for ERP apps and with the help of coderush (and complete DevExpress suite) I can create a new working form in minutes from scratch, with datalayer generated, UI customization and all (without using XAF).

I've been beta tester for 'all' of the component suppliers out there (DevExpress, XCeed, ComponentOne, Janus Systems, Infragistics, ...). DevExpress is by far the most complete one. For ASP (MVC)... they still have a lot of work, and DX knows it.

P.S.: You don't need to take a subscription for CodeRush. And if I remember well, there's even an express edition that's free :).