Re: AA rehash threshold

2014-11-20 Thread Jerry Quinn via Digitalmars-d
Steven Schveighoffer writes: > On 11/20/14 5:30 PM, Jerry Quinn wrote: >> This works nicely for small types, but has gotchas. For example, if >> you've got an AA of ints, what value indicates that this is a value >> folded into the bucket entry vs actually being a poin

Re: AA rehash threshold

2014-11-20 Thread Jerry Quinn via Digitalmars-d
Steven Schveighoffer writes: > On 11/18/14 9:46 PM, deadalnix wrote: >> >> After all, unless your hash table is very small, the first hit is >> most likely a cache miss, meaning ~300 cycles. at this point the >> cache line is in L1, with a 3 cycle access time. So accessing >> several element in t

Re: std.benchmark is in reviewable state

2011-09-26 Thread Jerry Quinn
Walter Bright Wrote: > We already have std.perf: > > http://www.d-programming-language.org/phobos/std_perf.html > > A review should compare the two. std.perf doesn't show up in the nav bar to the left. I didn't know it existed until your post :-) Jerry

Re: Why do we have transitive const, again?

2011-09-23 Thread Jerry Quinn
Adam D. Ruppe Wrote: > IMO immutable has taken a step *backward* a few releases ago, > and that's about all I've thought about it. > > immutable string a = "lol"; > > auto b = replace(a, "lol", "rofl"); // used to work, now doesn't. This works for me in 2.055. Jerry

Re: Support for feeding data to engine threads?

2011-09-12 Thread Jerry Quinn
dsimcha Wrote: > == Quote from Jerry Quinn (jlqu...@optonline.net)'s article > > dsimcha Wrote: > > > == Quote from Jerry Quinn (jlqu...@optonline.net)'s article > > > > I'm looking at porting an app that maintains a work queue to be > > > &g

Re: Support for feeding data to engine threads?

2011-09-12 Thread Jerry Quinn
dsimcha Wrote: > == Quote from Jerry Quinn (jlqu...@optonline.net)'s article > > Timon Gehr Wrote: > > > On 09/12/2011 07:23 PM, Jerry Quinn wrote: > > > > I'm looking at porting an app that maintains a work queue to be > > > > processed by &g

Re: Support for feeding data to engine threads?

2011-09-12 Thread Jerry Quinn
dsimcha Wrote: > == Quote from Jerry Quinn (jlqu...@optonline.net)'s article > > I'm looking at porting an app that maintains a work queue to be processed > > by one > of N engines and written out in order. At first glance, std.parallelism > already > provid

Re: Support for feeding data to engine threads?

2011-09-12 Thread Jerry Quinn
Timon Gehr Wrote: > On 09/12/2011 08:01 PM, Jerry Quinn wrote: > > Timon Gehr Wrote: > > > >> On 09/12/2011 07:23 PM, Jerry Quinn wrote: > >>> I'm looking at porting an app that maintains a work queue to be processed > >>> by one of

Re: Support for feeding data to engine threads?

2011-09-12 Thread Jerry Quinn
Timon Gehr Wrote: > On 09/12/2011 07:23 PM, Jerry Quinn wrote: > > I'm looking at porting an app that maintains a work queue to be processed > > by one of N engines and written out in order. At first glance, > > std.parallelism already provides the queue, but t

Support for feeding data to engine threads?

2011-09-12 Thread Jerry Quinn
I'm looking at porting an app that maintains a work queue to be processed by one of N engines and written out in order. At first glance, std.parallelism already provides the queue, but the Task concept appears to assume that there's no startup cost per thread. Am I missing something or do I ne

Google +1 button for dpl.org?

2011-07-13 Thread Jerry Quinn
Hi folks, This seemed like the right place to toss this out... What do folks think of adding a google +1 button to d-programming-language.org? I just created a google+ account and discovered it. Jerry

Re: Question about D, garbage collection and fork()

2011-03-10 Thread Jerry Quinn
Steven Schveighoffer Wrote: > Do you know what causes the OS to regard that memory as read-only? Since > fork() is a C system call, and D gets its heap memory the same as any > other unix process (brk()), I can't see why it wouldn't work. As long as > you do the same thing you do in C, I

Question about D, garbage collection and fork()

2011-03-09 Thread Jerry Quinn
Where I work, we find it very useful to start a process, load data, then fork() to parallelize. Our data is large, such that we'd run out of memory trying to run a complete copy on each core. Once the process is loaded, we don't need that much writable memory, so fork is appealing to share th

Re: Proposal for std.path replacement

2011-03-03 Thread Jerry Quinn
Lars T. Kyllingstad Wrote: > As mentioned in the "std.path.getName(): Screwy by design?" thread, I > started working on a rewrite of std.path a long time ago, but I got > sidetracked by other things. The recent discussion got me working on it > again, and it turned out there wasn't that much l

Re: xxxInPlace or xxxCopy?

2011-01-19 Thread Jerry Quinn
Andrei Alexandrescu Wrote: > On 1/19/11 6:53 PM, Jonathan M Davis wrote: > > On Wednesday, January 19, 2011 15:33:16 Andrei Alexandrescu wrote: > >> I'm consolidating some routines from std.string into std.array. They are > >> specialized for operating on arrays, and include the likes of insert, >

Re: eliminate junk from std.string?

2011-01-11 Thread Jerry Quinn
Jerry Quinn Wrote: > > > Same comment for icmp(). Also, in the Unicode standard, case folding can > > > depend on the specific language. > > > > That uses toUniLower. Not sure how that works. > > And doesn't mention details about the Unicode standard

Re: eliminate junk from std.string?

2011-01-11 Thread Jerry Quinn
Andrei Alexandrescu Wrote: > On 1/11/11 1:45 PM, Jerry Quinn wrote: > > Unclear if iswhite() refers to ASCII whitespace or Unicode. If Unicode, > > which version of the standard? > > Not sure. > > enum dchar LS = '\u2028';

Re: eliminate junk from std.string?

2011-01-11 Thread Jerry Quinn
Jerry Quinn Wrote: > One set of functions I'd like to see are startsWith() and endsWith(). I find > them frequently useful in Java and an irritating lack in the C++ standard > library. Just adding that these functions are useful because they're more efficient than doing

Re: eliminate junk from std.string?

2011-01-11 Thread Jerry Quinn
Andrei Alexandrescu Wrote: > On 1/9/11 4:51 PM, Andrei Alexandrescu wrote: > > There's a lot of junk in std.string that should be gone. I'm trying to > > motivate myself to port some functions to different string widths and... > > it's not worth it. > > > > What functions do you think we should re

Re: [review] new string type

2010-12-03 Thread Jerry Quinn
Steven Schveighoffer Wrote: > On Fri, 03 Dec 2010 14:40:30 -0500, Jerry Quinn > wrote: > > > I tend to do a lot of transforming strings, but I need to track offsets > > back to the original text to maintain alignment between the results and > > the input. For

Re: [review] new string type

2010-12-03 Thread Jerry Quinn
Steven Schveighoffer Wrote: > On Fri, 03 Dec 2010 11:15:36 -0500, spir wrote: > > > On Thu, 02 Dec 2010 16:24:03 -0500 > > "Steven Schveighoffer" wrote: > > > >> Yes, it does seem odd, but then again, how often do you need the > >> individual characters of a string? I wrote php code for about

Re: FloatLiteral 1f

2010-07-28 Thread Jerry Quinn
> On 27/07/2010 21:46, Philip Trettner wrote: > > Hello. > > > > When I came across the lexical definition of a FloatLiteral I wondered > > how '1f' gets recognized. > > > > The definition says: > > FloatLiteral: > > Float > > Float Suffix > > Integer ImaginarySuffix > > Integer Flo

Re: container stuff

2010-05-25 Thread Jerry Quinn
Andrei Alexandrescu Wrote: > On 05/25/2010 06:04 PM, Steven Schveighoffer wrote: > > On Tue, 25 May 2010 18:27:32 -0400, Andrei Alexandrescu > > wrote: > > > >> I've uploaded a work in progress on the container design here: > >> > >> http://erdani.com/d/phobos/std_container.html > >> > >> It's de

Re: Is this a bug with goto?

2010-04-17 Thread Jerry Quinn
Andrei Alexandrescu Wrote: > (Hi Jerry! Glad to see you're ramping up participation lately.) Yes, > that's a bug. There are many other bugs related to jumps, including in > switch statements. http://d.puremagic.com/issues/show_bug.cgi?id=4101 cheers, Jerry

Is this a bug with goto?

2010-04-17 Thread Jerry Quinn
In the spec it says that it's illegal to skip an initialization using goto. Unless I'm mistaken, the code below does that for b, s, and c. However, it compiles without complaint. So, should the compiler be complaining, or is the text about goto really saying that behavior is undefined. Obvio

Re: Does D allow paradoxical code?

2010-03-27 Thread Jerry Quinn
Daniel Keep Wrote: > > This generally raises the question of what should be the order of > > evaluation for constructs like mixins, conditional compilation, and CTFE. > > Each has the potential to modify the other. > > > > What should be the rule to break the ambiguity? Or do we leave it >

Does D allow paradoxical code?

2010-03-25 Thread Jerry Quinn
What should happen when the following code is compiled? mixin(vs); version(v1) { const string vs = "version = v2;"; pragma(msg, "yes"); } else { const string vs = "version = v1;"; pragma(msg, "no"); } Currently, there's an error saying that vs must be a string. However, as far as I ca

Re: Container hierarchy vs. container types

2010-03-04 Thread Jerry Quinn
Andrei Alexandrescu Wrote: > I decided to let no assumption unchallenged and got back to the > question: do we really need a container _hierarchy_? How much joy and > usefulness do people derive from dynamically changing an array with a > list under the same interface? Or a rb-tree vs. a binary

Re: An example of Clang error messages

2010-03-04 Thread Jerry Quinn
Walter Bright Wrote: > grauzone wrote: > > How many man years would you assume writing a full D compiler takes? > > (Frontend starting from scratch, using an existing backend.) > > But there's little reason to implement a D compiler from scratch. For > open source uses, you can just go ahead an

Re: Making all strings UTF ranges has some risk of WTF

2010-02-04 Thread Jerry Quinn
Don Wrote: > We seem to be approaching the point where char[], wchar[] and dchar[] > are all arrays of dchar, but with different levels of compression. > It makes me wonder if the char, wchar types actually make any sense. > If char[] is actually a UTF string, then char[] ~ char should be > permi

Re: Tidy auto [Was: Re: @disable]

2010-01-18 Thread Jerry Quinn
bearophile Wrote: > myself). If this is true then a syntax like: > auto immutable x = y * 2; > > can be seen as too much long and boring to write all the time, so the > "immutable" keyword may need to be changed again :-) For example into "val" > (also as "retard" has said), so it becomes short

Re: one suggestion for improving the performance of gc and memroy management

2009-12-22 Thread Jerry Quinn
Michel Fortin Wrote: > My opinion is that immutable and shared immutable should be two > different type modifiers. Contrary to other shared values, shared > immutable values can be cast to non-shared immutable (and non-shared > const) since they do not require memory barriers, but the reverse

Re: yank '>>>'?

2009-12-07 Thread Jerry Quinn
Simen kjaeraas Wrote: > On Mon, 07 Dec 2009 02:11:16 +0100, Jerry Quinn > wrote: > > Well, I could see the value of poviding a rotate operator. > > > > Since >>> is tainted, what about >>@ and <<@ for integral rotation? > > I was thinking

Re: yank '>>>'?

2009-12-06 Thread Jerry Quinn
Walter Bright Wrote: > dsimcha wrote: > > == Quote from KennyTM~ (kenn...@gmail.com)'s article > >> No, it will _silently_ break code that uses >>> as unsigned right shift. > > > > Well, we could get around this by making >>> an error for a few releases, > > and then > > only after everyone's re

Re: Array, AA Implementations

2009-10-19 Thread Jerry Quinn
dsimcha Wrote: > If anyone can think of any more, please let me know. Also, just thought of > this > now: I wonder if it would make sense to use some polymorphism tricks (AA > operations are slow enough that an extra pointer dereference or virtual > function > call isn't going to make or break

Follow-on question about delegates

2009-06-09 Thread Jerry Quinn
OK, having thought a bit more about delegates, I now have another question. The ABI shows a delegate as consisting of a context ptr and a function ptr. The context ptr can be a class reference, ptr to struct, ptr to closure or ptr to stack frame. If you're passing one of these delegates into a

Re: question about foreach, opApply, and delegates

2009-06-08 Thread Jerry Quinn
downs Wrote: > Jerry Quinn wrote: > > Hi, all. I find myself a little confused about how foreach, opApply, and > > delegates interact according to the docs. > > > > Foreach on an aggregate will use the opApply call (assuming ranges aren't > > being used)

question about foreach, opApply, and delegates

2009-06-08 Thread Jerry Quinn
Hi, all. I find myself a little confused about how foreach, opApply, and delegates interact according to the docs. Foreach on an aggregate will use the opApply call (assuming ranges aren't being used). So if we use a simple example below, what exactly is the delegate that is passed to opApply

Re: const?? When and why? This is ugly!

2009-03-07 Thread jerry quinn
Walter Bright Wrote: > When we first got into what to do with strings and > const/immutable/mutable, I was definitely in the camp that strings > should be mutable char[], or at worst const(char)[]. The thing is, > Andrei pointed out to me, languages that are considered very good at > dealing w

Re: const?? When and why? This is ugly!

2009-03-06 Thread jerry quinn
Andrei Alexandrescu Wrote: > Steven Schveighoffer wrote: > > I think what Burton is saying is by annointing immutable(char)[] as the > > type "string," you are essentially sending a message to developers that > > all strings should be immutable, and all *string parameters* should be > > declare

Re: problem with declaration grammar?

2009-02-20 Thread Jerry Quinn
Ellery Newcomer Wrote: > jerry quinn wrote: > > Ellery Newcomer Wrote: > >>> Maybe I'm missing something. The grammar shown in > >>> http://www.digitalmars.com/d/2.0/declaration.html has the following rules: > >>> > >>> BasicType2

Re: problem with declaration grammar?

2009-02-19 Thread jerry quinn
Ellery Newcomer Wrote: > > Maybe I'm missing something. The grammar shown in > > http://www.digitalmars.com/d/2.0/declaration.html has the following rules: > > > > BasicType2: > > * > > [ ] > > [ Expression ] > > [ Expression .. Expression ] > > [ Type ] >

Re: problem with declaration grammar?

2009-02-19 Thread jerry quinn
Sergey Gromov Wrote: > Thu, 19 Feb 2009 01:30:36 -0500, jerry quinn wrote: > > > Christopher Wright Wrote: > > > >> jerry quinn wrote: > >>> Hi there, > >>> > >>> I'm not sure if I'm missing something, but I'm having

Re: problem with declaration grammar?

2009-02-18 Thread jerry quinn
Christopher Wright Wrote: > jerry quinn wrote: > > Hi there, > > > > I'm not sure if I'm missing something, but I'm having trouble seeing that a > > simple declaration will parse correctly with the D grammar. > > > > If we take a declarati

problem with declaration grammar?

2009-02-18 Thread jerry quinn
Hi there, I'm not sure if I'm missing something, but I'm having trouble seeing that a simple declaration will parse correctly with the D grammar. If we take a declaration statment like: int x = 3; we have (my best guess): DeclarationStatement -> Declaration Declaration -> Decl Decl -> BasicTy

Re: ref?

2009-02-15 Thread Jerry Quinn
Nick Sabalausky Wrote: > "Jerry Quinn" wrote in message > news:gn9i7n$2uj...@digitalmars.com... > > > > Use a class when you have things that make sense to share, and use structs > > for when it makes more sense to have distinct copies. > > > >

Re: ref?

2009-02-15 Thread Jerry Quinn
dsimcha Wrote: > == Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article > > Walter and I have been discussing what the regime of statically-sized > > arrays should be. In short, the behavior that's most consistent with > > everything else is to treat them as values. > > This a

Re: random cover of a range

2009-02-14 Thread Jerry Quinn
Andrei Alexandrescu Wrote: > Bill Baxter wrote: > > On Sat, Feb 14, 2009 at 1:03 PM, Andrei Alexandrescu > > mailto:seewebsiteforem...@erdani.org>> > > wrote: > > > > bearophile wrote: > > > > Andrei Alexandrescu: > > > > Say at some point there are k available (not ta

Re: Optimizing Immutable and Purity

2008-12-22 Thread Jerry Quinn
Walter Bright Wrote: > I've been working on improving the optimizer to take advantage of > immutability and purity. > > http://www.reddit.com/r/reddit.com/comments/7l5x4/optimizing_immutable_and_purity/ > > http://dobbscodetalk.com/index.php?option=com_myblog&show=Optimizing-Immutable-and-Purit