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

1831
Announcements / Progress
« on: July 08, 2010, 12:01:23 PM »
I'm so happy with a couple changes I've made and am making.

First off, I'm proud to announce that standard templates are now completely available to ENIGMA users.
Code: (C) [Select]
map a; // is the same as...
map<> a; // is the same as...
map <variant> a; // is the same as...
map <variant,variant> a;

That's right: ENIGMA now correctly defaults all non-defaulted template parameters (as in, template parameters that are not already optional according to the C++ library) to variant. That means that once Ism and I are finished coordinating our new "Definitions" resource (previously "WhiteSpace"... we're still working on a catchy name) you will be able to #include <map>, use it, and use codes like this:

Code: (EDL) [Select]
map a;
a[100] = "one hundred";
a[15625682900000000.0] = "lol, big float";
a[3.141592653589793238] = "pie";
a["pi"] = 3.14;

That's right: with the implementation of var4, comparison operators are correctly implemented for all types and mirrored const. This makes them capable of complete interaction with the standard template library. GM's ds_* functions are officially toilet food in comparison.

Furthermore, map isn't exactly necessary for large numbers. Var4 also implements Lua's algorithm for fast, sparse arrays. This introduces a number of nice properties:

Code: (EDL) [Select]
var a = 0;
for (int i=0; i<100; i++) a[i] = i;
a[1000000000] = "one billion";

How can this be efficient? It's simple. a[0..127] operates in O(1), because that's how much space was allocated for the array. a[128] operates in either O(1) or O(n), depending on how your system resources are doing. a[256..INT_MAX] operates in O(log(N)), as it relies on a map for the lookup. (This will hopefully be replaced with a sparse hash map at some point).

Currently the system is functional, but not finished. Var4's lua_table<> needs to ensure that elements can hop data structure when the array part is resized. Templates need field tested, which will happen after my latest renovation: the dot operator.

Because C++ introduces structures and classes which I do not want to alienate, I have to take special care to ensure that the left-hand side of the dot is not an instance of a structure. This requires a type resolver, which I hope to complete inside 400 lines. We'll see. Basically, it will return the type of the expression that precedes the dot. I intend for the following to happen:

If it's an instance of a class, check for a member by name of the variable to the right hand side of the dot. If the member exists, ignore the dot. Possibly, if the class was actually a pointer, not a direct reference, replace the dot with ->. C++ should have done this from square one; I see no use for pointer.member. If no member was found, or if the type was scalar, replace the dot with an integer-based accessor function and record that the global was indeed accessed that way so optimizations can be done later. Also try to warn if it was a class without a member and without operator int() or some other scalar that can be cast easily. Perhaps it should be up to ENIGMA to find an appropriate cast path, such as int(var()).

Anyway, just something to think about.
Back to work, ciao for now.

1832
Announcements / Re: Bugtracker trial
« on: July 08, 2010, 11:33:45 AM »
General: I believe a2h has or was going to add categories, certainly. Perhaps some will want to have a separate category for suggestions. It'd probably be good if he let the intermediate user (as in, whatever we are to Simple Machines: not the creator, not the end-end-user) change the labels of each severity. That's just if he wants to put it out there for the public, as I know is his intention.

1: Vote for bugs. I assume you mean "This affects me, too!", in which case, yeah. Good idea.
3: There is an Assigned to: field.
6: That's kind of silly; why not just paste any concerned URLs into the body of the bug report?

I like the idea of and have no further comment on suggestions 2, 4, 5, and 7.

But personally, I'm happy with it right now. So he can take his sweet time on that extra glittery stuff. As long as I can mark a bug "solved," which I've not yet been given a chance to test.

1833
Announcements / Re: Bugtracker trial
« on: July 08, 2010, 08:44:02 AM »
Suggestions are given very low priority. I like the recommended tags idea. Maybe in a large cluster or something like a lot of sites do, with more frequent tags in larger typeset. The template thing only really applies to bugs. A trend seems to be the ability of people in general to propose a solution. Canonical and several others I've observed lately seem to have an answer proposal box at the bottom of each bug report (at least those given attention).

a2h, I'm amazed at how well this all works together. Great job!

1834
Off-Topic / Re: Sandy Duncan and clan
« on: July 08, 2010, 12:50:08 AM »
Sigh. What a2h said.
This is the real image of that... that.


Admit it. My recreation was oddly hotter.

Though I must wonder, then. Who is that in the incorrect picture?

1835
Announcements / Re: Bugtracker trial
« on: July 07, 2010, 01:45:05 PM »
Not anymore...? How odd.

1836
Announcements / Re: Bugtracker trial
« on: July 06, 2010, 11:30:08 PM »
I am so happy with you right now. I was just remarking to my brother. Thanks for this, this is insane.

1837
Announcements / Re: Bugtracker trial
« on: July 06, 2010, 01:50:00 AM »
I know you can't tell, but I'm smiling right now. Nice work. Now maybe I can get more notice than "Oh, it's too bad ENIGMA segfaults on load..." a month later.

1838
Announcements / Re: Happy Independence Day
« on: July 06, 2010, 01:49:10 AM »
Retep: Who's this "we" we're going to get to focus? If you mean Americans, don't count on it. They'll remain, as a majority, in oblivia until it becomes absolutely necessary for them to think for themselves. Ism would make that sooner than later, but I insist that nutrition facts on water and directions on poptart and cereal boxes are a good sign that no thought will be put into life by any of them for a long time.

Gary: Noted: has calendar date at disposal. Can resolve meaning thereof if invoked.

1839
Announcements / Re: Happy Independence Day
« on: July 05, 2010, 09:27:19 AM »
I've asked some British people if they were still sore about it. But yeah, Americans aren't, as a collective, shining jewels of intellect...

1840
Announcements / Happy Independence Day
« on: July 04, 2010, 06:54:20 PM »
Since a2h is Australian (and asleep anyway, I guess), Ism is actually a Russian spy, and none of the other administrators know what the hell day it is, happy fourth to all you Americans.

I'm going to go set something on fire and blow some other things up in good American spirit. ...The old spirit. Well. I mean.

Explanations later.

Peace.

1841
Announcements / Re: Install script - Ubuntu
« on: July 04, 2010, 05:24:43 PM »
Build directory.

Nice change, Ism.

1842
Off-Topic / Re: Help coding something...
« on: July 04, 2010, 03:39:45 PM »
Yes, you can. It won't work because you can't assume that all types passed to a generic mixed() will have even operator+. If you could presume all available operators for both types, you'd be fine.

1843
Announcements / Re: COmputers SUck
« on: July 03, 2010, 09:34:30 PM »
I never liked SDL. Then I found out it had proprietary segments, and now I hate its guts as well as those of all involved with it, in any way. SDL can go fuck itself.

...Still, thanks for the suggestion. :P

1844
Announcements / Re: COmputers SUck
« on: July 02, 2010, 06:51:03 PM »
This is retarded. >=\

Somebody else do the goddamn timing function. Clearly THIS, of all things, is just above my ability. <_<"
I assumed it was my vsync screwing it up. I'll look into fixing that...

I've not implemented the Windows counter yet, though.

1845
Off-Topic / Re: Help coding something...
« on: July 02, 2010, 06:45:59 PM »
Not while treating it as a plain variable. Allowing operator behavior of -two- types is the difficult part; if it was one or the other, you could use the template magic to make it work, and it would only error if an operator was called that was unsupported. But since, in the case of string and double, only some 8 operators are shared in common, that's problematic.

You could look at boost::variant better than I did. From what I can tell, they scraped something together with accessors. If I were you, I'd recommend overloading operator+(void) and operator-(void) to fetch either type explicitly (Has to be as good as or better than what boost did, but I didn't read very far in).