Pages: « 1 2
  Print  
Author Topic: Questions on EDL and ENIGMA  (Read 4255 times)
Offline (Male) Josh @ Dreamland
Reply #15 Posted on: July 11, 2011, 12:00:47 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2960

View Profile Email
The reason G++ is incapable of performing optimizations on var is because it does not recognize it as a plain datatype. The same optimizations cannot be made for variant as for double, because it doesn't understand to treat the class as a plain datatype. Implementing it in LLVM would fix that. Otherwise I'd have to do it myself.

As far as having C++ features without being tied to C++, I don't actually have a retort to that, even if you're trying to pass that off as a benefit.

I also like how you just pretend that C++ is this horribly unstable language while LLVM is the pinnacle of perfection. It reminds me of 4chan threads.

Let me ask; what would the engine be written in when we switched to LLVM? You're apparently implying it's not that bad, old C++.
« Last Edit: July 11, 2011, 12:08:54 PM by Josh @ Dreamland » Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) Rusky
Reply #16 Posted on: July 11, 2011, 12:12:23 PM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
Structs and the ability to call C libraries are not really specific to C++, nor did I mean them that way. If I were the one designing EDL, I would probably leave out most of C++, which is what I'm trying to pass off as a benefit- games, not the engine and library code, are what would be protected from segfaults. It would be impossible for an EDL program to cause a segfault, short of a bug in the compiler.
Logged
Offline (Male) Josh @ Dreamland
Reply #17 Posted on: July 11, 2011, 12:24:15 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2960

View Profile Email
I don't much fancy the concept of making anything impossible in the language. I also don't fancy bounds checking. So if there's going to be any anti-segfault measure on this, it's going to be one that pulls a glibc and catches signals to inform the user of what blew up where, instead of preventing the explosion.

So, then, the engine and game codes would be separate. I suppose you want them dynamically linked, with the engine as the DLL. Or, knowing you, you want every piece of the engine as the DLL, and then some sort of go-between to be generated that lays out the functions, yes?

I have dedicated the last five minutes to thinking of the implications of using LLVM for the game and C++ for the engine. We'd miss out on structures for communicating between the C++ functions and the LLVM ones. There'd be a major segregation between the two. Getting arbitrary C functions defined to LLVM would be difficult and likely inconsistent.
« Last Edit: July 11, 2011, 12:42:13 PM by Josh @ Dreamland » Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Male) Rusky
Reply #18 Posted on: July 11, 2011, 03:05:05 PM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
I'm having trouble comprehending why you have a problem with making segfaults impossible. Unless you're conflating the crappy Java way with solving the problem in general, there's really no reason you would ever want to allow segfaults. A segfault always indicates a bug somewhere- it's never, ever useful in a finished product.

It's also unnecessary to introduce any kind of segregation between EDL and C++ just to use LLVM. Since LLVM gives you more control than C++, you would still be able to use static linking, C-style structures and arbitrary C functions with complete consistency.

As an example, see the LLVM tutorial, specifically chapters 3 and 4. Without any extra attention, the JIT knows how to pull in externally-declared functions from currently loaded modules (i.e. the standard libraries and public functions from the executable). Their toy language just has to declare a function as extern and then call it. You could just as easily do this with static linking.
« Last Edit: July 11, 2011, 03:07:43 PM by Rusky » Logged
Offline (Male) Josh @ Dreamland
Reply #19 Posted on: July 11, 2011, 03:50:31 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2960

View Profile Email
Using a PE header that I would normally not hesitate to strip? ...

Anyway, if that's the case, it seems you don't even need any cooperation on my part to get the engine hooked up to your fork. Even our definitions resource would work well with it.

Although I'm not seeing how LLVM would discern the contents of a C structure without being told.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) luiscubal
Reply #20 Posted on: July 11, 2011, 05:10:36 PM
Member
Joined: Jun 2009
Posts: 452

View Profile Email
@Josh C also wouldn't discern the contents of a C structure without being told.
The solution? Telling it what the contents of the structure is.
It's just that the way of telling what the structure is is different between C and LLVM. In C you use a struct statement in some random header file, and in LLVM you use some random different method.

But yes, if ENIGMA's engine is sufficiently decoupled from the EDL language then it should be possible to create a LLVM backend/frontend/whatever to ENIGMA.
The only question is whether it is worth the effort.
Logged
Offline (Male) Rusky
Reply #21 Posted on: July 11, 2011, 05:22:01 PM

Resident Troll
Joined: Feb 2008
Posts: 955
MSN Messenger - rpjohnst@gmail.com
View Profile WWW Email
Like I said, use static linking. Then you can strip all the PE headers you like. Also, in exactly the same way, you just describe the struct to LLVM. You could even use one of Clang's libraries to pull C declarations directly into LLVM's format.

The reason I don't just fork Enigma is because you've got it so tightly coupled to your "parser" which is incapable of actually understanding what it reads. This is pretty much exactly the situation I was envisioning when I tried to explain/show/write a better parser.
« Last Edit: July 11, 2011, 05:38:14 PM by Rusky » Logged
Offline (Male) Josh @ Dreamland
Reply #22 Posted on: July 11, 2011, 08:42:47 PM

Prince of all Goldfish
Developer
Location: Pittsburgh, PA, USA
Joined: Feb 2008
Posts: 2960

View Profile Email
I'll remove the parser for you after I finish pasting the audio system back on right-side-up.
Logged
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble
"I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
Offline (Unknown gender) Slam drago
Reply #23 Posted on: July 19, 2011, 04:16:56 PM
Member
Joined: Jul 2011
Posts: 8

View Profile
I have one more question.
How could I help ENIGMA devolopment? I know a bit of C++.

And you guys seem really off topic.
Logged
Offline (Unknown gender) TheExDeus
Reply #24 Posted on: July 19, 2011, 04:22:40 PM

Developer
Joined: Apr 2008
Posts: 1872

View Profile
Check to-do in wiki or more importantly, check the unimplemented functions list. Then see if you can implement any of them. http://www.alasdairmorrison.com/enigmaexamples/MissingFunctions.php
You can also check out IRC : http://enigma-dev.org/docs/Wiki/IRC

And last but not least, you can try to document functions in wiki, but that needs to be standardized first, so maybe later.
Logged
Offline (Male) polygone
Reply #25 Posted on: July 19, 2011, 04:48:24 PM

Contributor
Location: England
Joined: Mar 2009
Posts: 803

View Profile
Slam drago check the wiki for more info. Also advisory to go venture onto the irc.
« Last Edit: July 20, 2011, 09:55:10 PM by IsmAvatar » Logged
I honestly don't know wtf I'm talking about but hopefully I can muddle my way through.
Post made July 20, 2011, 01:15:22 PM was deleted at the author's request.
Pages: « 1 2
  Print