Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Josh @ Dreamland

2326
Announcements / Re: Prophase
« on: March 06, 2010, 09:22:24 AM »
Only the next three newsposts.

2327
Announcements / Prophase
« on: March 06, 2010, 12:47:05 AM »
The C Parser is now hooked up such that it is self sufficient in collecting information.

On initialization, it asks the GCC to dump built-in #defines into a file that it can read. It parses those to gain the ability to correctly evaluate later preprocessors and the like, then it begins parsing SHELLmain.cpp, which will soon be moved (for the most part) to a separate header, since that particular source file shouldn't be responsible for all of that.

While getting it to work, I was met only with the problem of setting the working directory, which is currently temporarily resolved: I set it manually with a relative path that will have to be changed for the release compile.

However, once that was implemented, it made it through the entire project without incident. I asked it to print the contents of the enigma namespace to be sure it got it all, and was blown away.

At that, mission accomplished. I will make sure the GML parser and syntax checker are performing adequately tomorrow, which they shouldn't be, considering I am recoding a chunk of each to use the new input.

Expect material to be tested this coming week (Surprise). Don't expect anything grandiose during testing; I've not even hooked up the DLL functions yet. What you should see is vastly improved compile time and some small bugfixes that were made before the split. Serp's optimized code as well as the things that have been implemented since R3 are not part of the equation at this point.

In fact, the struggle of the next several days is going to be getting LGM to communicate better with ENIGMA, which has officially outgrown its separate-module form. I remember when syntax check rang in at 13x faster than GM's while code was being sent as a file. XD Those days are over, and now we'll be faster with dignity.

*commits code in whatever state it may be*

I haven't seen Ism today. I'll definitely need her for this part...
Ed suggests we use JNA to handle the interface as a DLL. We'll see how that works for us.

Ciao for now.

2328
Announcements / Re: Encryption
« on: March 05, 2010, 11:08:46 PM »
That's a tad more specific than what I was describing. It'd also require a lot of template instantiations.

2329
Tips, Tutorials, Examples / Re: lol streams
« on: March 05, 2010, 09:54:21 PM »
The only difference between const char* and char* is that const char* points to read-only memory. And even that's only on systems that support such (ie, not Windows). '\0' == 0, and I'd be willing to bet that if you were to compare {'n','o',0} and "no" you'd get that they were equivalent. And I do mean as-is.

"Test" == "test" compares correctly for string literals. "Test" == "test" will return false, "test" == "test" will return true. This is because they point to the same location in memory when GCC is done with them.

Also, you don't need to use const_cast to get it represented as a const char. :P
Const char* can be set to a char* without cast. Vice-versa requires cast, but is dangerous on Linux and the like.

2330
Tips, Tutorials, Examples / Re: lol streams
« on: March 05, 2010, 09:33:35 PM »
He's thinking about 'situations where you need to quote "' + "that's" + '," or other situations requiring both "' + " and '".

2331
Announcements / Re: Pride
« on: March 05, 2010, 07:24:18 PM »
I use a goto roughly four times in the C parser. My labels are usually descriptive and located nearby. Usually.

2332
Announcements / Re: Encryption
« on: March 05, 2010, 03:26:50 PM »
The only way that could have anything to do with typing is if I made a class that did the checks on operator=, which wasn't what I was suggesting.

2333
Announcements / Re: Pride
« on: March 05, 2010, 10:34:32 AM »
It's by no means a hack. GML does support switch(); it will let you switch either a real or string. Switching an array switches its first value.
Just because a code uses goto doesn't mean it's a hack. Goto was excommunicated from use in high level code due to it making said code difficult to read when misused. Case labels are just that: labels. The compiler writes the hash map instead of me doing it. The same will apply to ENIGMA.

2334
Announcements / Re: Encryption
« on: March 04, 2010, 07:20:40 PM »
I could have worded that better. - fix'd

I meant that it could do such things as find locations where given variables are modified. The conditions of the set could then be relayed to the server-side module. That could of course be spoofed, but it'd be a step.

I think a more comprehensive idea would be to have submit the locations of certain key objects along with any changes; the server would allow a small tolerance accounted for by lag. No one likes missing a shot because the server and client disagree on a location.

So, a function could be defined for call when a certain variable is set or action is performed requesting a double check on locations and allowing the server to double check the math.

Frankly, I'm not sure how convenient such an idea would be, hence my not promoting it or "making any promises."

2335
Tips, Tutorials, Examples / Re: lol streams
« on: March 04, 2010, 06:44:39 PM »
String already defines those...
And then some...

2336
Announcements / Re: Pride
« on: March 04, 2010, 06:23:53 PM »
Retro and other concerned individuals:

In the case that strings are involved, it'd be a hijacked switch. What I was hinting at is basically this (assume that the hash of "hello" and "herro" is 143):

Code: [Select]
case 143:
  if (enigma::sval == "hello") { ... }
  if (enigma::sval == "herro") { ... }

Note, however, a couple things:
1) Ideally, the hash function would be played with a little bit to try to achieve the fewest collisions possible
2) An actual hijacked switched statement would look more like this:
 
Code: [Select]
switch hash()
    case hash: if (...) goto ...
    case hash: if (...) goto ...
    break;
3) The most ideal option, but perhaps a more difficult one, is to do the hash map myself, storing pointers to goto labels in my own array (this is legal in C)
This would look like this:
goto enigma::hashmap_switch_1[sval];
Where operator[] computes the hash, starts raiding pre-defined buckets for the correct label, then returns it for jump. This is how switch() actually works, and how I hope to do it.

2337
Announcements / Re: Encryption
« on: March 04, 2010, 06:07:50 PM »
Hmmmm... ENIGMA would be great for server side code if the graphics system could be disabled as easily as I intend...
Code to implement the framework for a set of simple checks could be integrated into the parser or something, but I'm not making any promises until I have a plan for such. Doesn't help that I hate coding online things.

2338
Announcements / Re: Pride
« on: March 03, 2010, 06:20:22 PM »
*shrug*

Oh, and Fede: Many people use primitives for circle-related effects. Think ripples or rings. Especially awesome with surfaces.

2339
Announcements / Re: Pride
« on: March 03, 2010, 01:49:58 PM »
I do love my parentheses (and messing with you). Really, they're mostly for thoughts that might confuse the rest of the sentence; I separated them because they are confusing or because they are pieces of info that those who read them should probably know.

Grundoko:

Since if I even hint it's toward the end of the month, you'll guess what day it is, I may as well tell you I want it out on April Fool's day. I might release some things for testing around the 15th or 20th.

2340
Announcements / Re: Pride
« on: March 02, 2010, 11:36:56 PM »
Yeah, using namespace std works. I asked it to print the using scope... it took five seconds or so...
Asking it to print everything it had just parsed took 36 seconds. Heh...