|
|||||||
This is a discussion on "Combining of Languanges" in the Top Mud Sites MUD Coding forum : 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 ... |
|
You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our MUD community today! If you have any problems with the registration process or your account login, please contact us. If you are a registered member of the old TMS forums, please click here
|
![]() |
|
|
LinkBack | Thread Tools |
|
|
#1 |
|
New Member
Join Date: Jan 2006
Posts: 1
![]() |
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.
Neal |
|
|
|
|
|
#2 |
|
Legend
Join Date: Apr 2002
Name: Richard
Location: München
Home MUD: God Wars II
Posts: 1,518
![]() ![]() |
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. |
|
|
|
|
|
#3 |
|
Member
|
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(); } [/quote] 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. |
|
|
|