View mode: basic / threaded / horizontal-split · Log in · Help
March 04, 2012
Re: DustMite updated
On Sun, Mar 04, 2012 at 06:04:36PM +0100, Andrej Mitrovic wrote:
> On 3/4/12, Vladimir Panteleev <vladimir@thecybershadow.net> wrote:
> > I pushed out another large update today.
> 
> I can't believe I'm saying this, but I can't wait for my next ICE to
> try it out. :p

Just play around with AA's a bit and you'll run into lots of them. ;-)
Especially unusual AA's, like unusual key types.


T

-- 
One reason that few people are aware there are programs running the internet is that they never crash in any significant way: the free software underlying the internet is reliable to the point of invisibility. -- Glyn Moody, from the article "Giving it all away"
March 04, 2012
Re: DustMite updated
On 3/4/12, H. S. Teoh <hsteoh@quickfur.ath.cx> wrote:
> Just play around with AA's a bit and you'll run into lots of them. ;-)
> Especially unusual AA's, like unusual key types.

Oh don't worry, I'm all too familiar with ICEs. :) They do mostly show
up when doing metaprogramming and not that often in regular code.
March 04, 2012
Re: DustMite updated
On 02/22/2012 09:25 PM, Vladimir Panteleev wrote:
> I played with some algorithms today and got about a 7x improvement in
> reduction time for my test case. The data is now arranged into a binary
> tree, and the progress indicator was changed to reflect that. Let me
> know if I broke anything in the process.
>
> No new features have been added. Still thinking about how to handle lists.
>
> ---
>
> DustMite is a tool which minimizes D source code.
> https://github.com/CyberShadow/DustMite

I ran into an ICE today and decided to try DustMite.  I couldn't compile 
it though:

chad@Hugin ~/dprojects/dustmite $ dmd dustmite.d dsplit.d
dustmite.d(873): expression expected, not '>'
dustmite.d(873): found 'regex' when expecting ')' following template 
argument list
dustmite.d(873): semicolon expected following auto declaration, not ')'
dustmite.d(873): found ')' instead of statement

DMD32 D Compiler v2.057
on Gentoo Linux

If it's because my compiler is a version behind, then don't worry about 
it too much.  I haven't updated because issue 5278 
(http://d.puremagic.com/issues/show_bug.cgi?id=5278) makes it a pain for 
me to upgrade the dmd.
March 04, 2012
Re: DustMite updated
On 03/04/2012 12:04 PM, Andrej Mitrovic wrote:
> On 3/4/12, Vladimir Panteleev<vladimir@thecybershadow.net>  wrote:
>> I pushed out another large update today.
>
> I can't believe I'm saying this, but I can't wait for my next ICE to
> try it out. :p

Here's one for DMD 2.057.  Knock yourself out ;)

(As I mentioned in my other post, I can't build DustMite right now, or 
I'd do it myself.  But if you want one...)

----------------------------------------------
chad@Hugin ~/dprojects/database $ dmd ice.d
entity.(fld)
Internal error: e2ir.c 683
----------------------------------------------

import std.stdio;

scope class Query(string queryText)
{
	static class Entity
	{
		private static size_t bufSize = 0;
		private static size_t[string] offsets;
		private static size_t registerField(T)(string varName)
		{
			auto offset = bufSize;
			offsets[varName] = offset;
			bufSize += T.sizeof;
			return offset;
		}
		
		private void[] buf;
		
		class fld(T,string varName)
		{
			T opCall()
			{
				auto i1 = offsets[varName];
				return cast(T)buf[i1 .. i1 + T.sizeof];
			}
			
			static this()
			{
				registerField!T(varName);
			}
		}
		
		this()
		{
			buf = new void[bufSize];
			writefln("offsets = %s\n", offsets);
		}
		
		~this()
		{
			delete buf;
		}
	}
	
	Entity e;
	
	this()
	{
		e = new Entity();
	}
}

void main()
{
	scope query = new Query!(
		"SELECT ONLY_NEEDED_COLUMNS"
		"FROM contacts c"
		"WHERE c.country = 'US'"
		"AND   c.sales > 10000;")();
	
	auto entity = query.e;
	//foreach(entity; query)
	//{
		auto email_addy = entity.fld!(char[],"email")();
		auto full_name = entity.fld!(char[],"name")();
		//Email.spam(email_addy, full_name, "We have this great new offer for 
you!");
	//}
}
March 04, 2012
Re: DustMite updated
> If it's because my compiler is a version behind, then don't worry about  
> it too much.

Yep it uses the new => syntax.
March 04, 2012
Re: DustMite updated
> Here's one for DMD 2.057.  Knock yourself out ;)
>
> (As I mentioned in my other post, I can't build DustMite right now, or  
> I'd do it myself.  But if you want one...)
>
> ----------------------------------------------
> chad@Hugin ~/dprojects/database $ dmd ice.d
> entity.(fld)
> Internal error: e2ir.c 683
> ----------------------------------------------

Done in 280 tests and 20 secs and 934 ms;

http://d.puremagic.com/issues/show_bug.cgi?id=7645
March 04, 2012
Re: DustMite updated
> I can't believe I'm saying this, but I can't wait for my next ICE to
> try it out. :p

Me too :D
March 04, 2012
Re: DustMite updated
On 3/4/12, Chad J <chadjoan@__spam.is.bad__gmail.com> wrote:
> Here's one for DMD 2.057.  Knock yourself out ;)

It's reproducible in 2.058 too. Reduced test-case:
http://paste.pocoo.org/show/560891/

That ran really really fast compared to older versions of dustmite.
Great work Vlad. :)
March 04, 2012
Re: DustMite updated
On 3/4/12, Trass3r <un@known.com> wrote:
>> I can't believe I'm saying this, but I can't wait for my next ICE to
>> try it out. :p
>
> Me too :D
>

Son of a gun, you beat me to it! lol
March 04, 2012
Re: DustMite updated
On 04.03.2012 23:17, Andrej Mitrovic wrote:
> On 3/4/12, Chad J<chadjoan@__spam.is.bad__gmail.com>  wrote:
>> Here's one for DMD 2.057.  Knock yourself out ;)
>
> It's reproducible in 2.058 too. Reduced test-case:
> http://paste.pocoo.org/show/560891/
>
> That ran really really fast compared to older versions of dustmite.
> Great work Vlad. :)

OT: that should have been Vova ;)

-- 
Dmitry Olshansky
1 2 3
Top | Discussion index | About this forum | D home