Top Mud Sites Forum Return to
Go Back   Top Mud Sites Forum > Mud Development and Administration > MUD Coding
Click here to Register

Thread Tools
Old 01-03-2006, 08:01 PM   #1
New Member
Join Date: Jan 2006
Posts: 1
NealSilfer is on a distinguished road
Hello, I have little knowledge of the different programming languages out there. However I plan to change this by attending my local college. I was curious to know about combining different languages together to form a MUD. Are there certain rules or something that I should know about? I am more specifically interested in the combining of Java and C++ to form a MUD. Please no preaching of why I should use Java or C++ because that is not even a definite in the development of my MUD. I have done enough research to believe that for the type of MUD I would like to design learning Java and C++ is the way I need to go. Thank you for you consideration.

NealSilfer is offline   Reply With Quote
Old 01-04-2006, 08:07 AM   #2
KaVir's Avatar
Join Date: Apr 2002
Name: Richard
Home MUD: God Wars II
Posts: 2,052
KaVir will become famous soon enoughKaVir will become famous soon enough
What research, out of interest?  I find it very difficult to see what advantage you might get from combining C++ and Java.  I could understand it if you wanted a C++ server and a Java client, and I can see the advantages of embedding a language like Python or Perl into a hardcoded engine.  But unless you've already got large amounts of both C++ and Java code that you want to avoid rewriting, or are creating the mud as a learning experience (eg to practice your COM skills) I can't see any reason why you'd want to build a codebase using both languages...

I'm not 'preaching', I'm just honestly curious.  It seems like a thoroughly bizarre design decision, and I'd be really interested to see what sort of research inspired it.
KaVir is offline   Reply With Quote
Old 01-13-2006, 04:09 AM   #3
Join Date: Apr 2002
Location: Hampshire, UK
Posts: 117
Kastagaar is on a distinguished road
Send a message via Yahoo to Kastagaar
I agree with KaVir: how bizarre, how bizarre.

The first thing that you should recognise is that Java and C++, despite their apparent syntactic similarities, are completely different languages in almost every respect.  How you do things is just plain different.

That said, Java does have an interface to external code via the JNI - Java Native Interface.

Essentially, you can design a Java class, and mark methods as "native".

[code] public class Foo
   public native void stuff();

After compiling this class, you can extract a C++ header from it using the "javah" tool.  Then, you can use that header as a basis to implement those methods marked native in C++.  You then compile it into a DLL (presuming some compiler capable of this), and that code will run when that native method is called.
Kastagaar is offline   Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

All times are GMT -4. The time now is 12:43 AM.

Powered by vBulletin® Version 3.6.7
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Style based on a design by Essilor
Copyright Top Mud 2014