Re: "Try it now"

2011-04-15 Thread Jérôme M. Berger
Roman Ivanov wrote: > == Quote from Jacob Carlborg (d...@me.com)'s article >> On 2011-04-14 18:48, Andrei Alexandrescu wrote: >>> On 4/14/11 9:03 AM, Steven Schveighoffer wrote: Sometimes, I worry that my unit tests or asserts aren't running. Every once in a while, I have to change one to

Re: Floating Point + Threads?

2011-04-15 Thread Robert Jacques
On Fri, 15 Apr 2011 23:22:04 -0400, dsimcha wrote: I'm trying to debug an extremely strange bug whose symptoms appear in a std.parallelism example, though I'm not at all sure the root cause is in std.parallelism. The bug report is at https://github.com/dsimcha/std.parallelism/issues/1#iss

Re: "Try it now"

2011-04-15 Thread Jonathan M Davis
> == Quote from Jacob Carlborg (d...@me.com)'s article > > > On 2011-04-14 18:48, Andrei Alexandrescu wrote: > > > On 4/14/11 9:03 AM, Steven Schveighoffer wrote: > > >> Sometimes, I worry that my unit tests or asserts aren't running. Every > > >> once in a while, I have to change one to fail to m

Re: GSoC 2011 update: we have 3 slots

2011-04-15 Thread Andrei Alexandrescu
On 4/15/11 9:05 AM, Ishan Thilina wrote: Are you still going to interview every applicant or only the applicants from the project that you think have high priority and success rate? Thank you...! Due to the few slots we received, we got we must be very conservative. We'll interview the applic

Re: GC for pure functions -- implementation ideas

2011-04-15 Thread Don
dsimcha wrote: On 4/15/2011 5:01 PM, Sean Kelly wrote: On Apr 15, 2011, at 1:12 PM, Don wrote: Create a pure heap for each thread. This is a heap which can only be used by pure functions. I present some simplistic code, with the simplest possible implementation: just a big block of memory with

Re: GC for pure functions -- implementation ideas

2011-04-15 Thread Don
Tomek Sowiński wrote: Don napisał: LEAKY FUNCTIONS Define a 'leaky' pure function as a pure function which can return heap-allocated memory to the caller, ie, where the return value or a parameter passed by reference has at least one pointer or reference type. This can be determined simply by

Re: Floating Point + Threads?

2011-04-15 Thread Andrei Alexandrescu
On 4/15/11 10:22 PM, dsimcha wrote: I'm trying to debug an extremely strange bug whose symptoms appear in a std.parallelism example, though I'm not at all sure the root cause is in std.parallelism. The bug report is at https://github.com/dsimcha/std.parallelism/issues/1#issuecomment-1011717 . D

Floating Point + Threads?

2011-04-15 Thread dsimcha
I'm trying to debug an extremely strange bug whose symptoms appear in a std.parallelism example, though I'm not at all sure the root cause is in std.parallelism. The bug report is at https://github.com/dsimcha/std.parallelism/issues/1#issuecomment-1011717 . Basically, the example in question

Re: Temporarily disable all purity for debug prints

2011-04-15 Thread Walter Bright
On 4/15/2011 7:06 PM, bearophile wrote: There is something I don't understand. If your last change allows code like this, isn't it breaking the safety of pure functions in debug mode? Do you think this loss of safety is not important? Yes, it allows one to break the purity of the function. The

Re: Temporarily disable all purity for debug prints

2011-04-15 Thread bearophile
Walter: > On the contrary, I think it is the right solution. After all, the reason > people > want to put impure code in a pure function is for debugging. By putting it > under > the debug conditional, any logging or printing code can be there without > needing > the compiler to be aware of wha

Re: GC for pure functions -- implementation ideas

2011-04-15 Thread dsimcha
On 4/15/2011 5:01 PM, Sean Kelly wrote: On Apr 15, 2011, at 1:12 PM, Don wrote: Create a pure heap for each thread. This is a heap which can only be used by pure functions. I present some simplistic code, with the simplest possible implementation: just a big block of memory with a thread local

Re: Temporarily disable all purity for debug prints

2011-04-15 Thread Walter Bright
On 4/15/2011 3:00 PM, bearophile wrote: I presume this front end change is not following my suggestion (of adding a switch to disable purity), but adds a dirty hack that allows impure debug code inside pure functions. If this is true, then let's now find the bad side effects of this change. On

Re: GC for pure functions -- implementation ideas

2011-04-15 Thread bearophile
Tomek Sowiñski: > I'm far from being a GC expert but I think Java having identified such cases > with escape analysis just puts locally allocated objects on the stack. Escape analysis will be useful for D compilers too (I think LDC-LLVM is not doing this much yet), but if the amount of non-esca

Stroustrup on C++0x + JSF++ coding standard

2011-04-15 Thread bearophile
Recent slides by Stroustrup on C++0x: http://www.arcos.inf.uc3m.es/~jdaniel/sem-cpp-11/Madrid-bs.pdf The Reddit thread: http://www.reddit.com/r/programming/comments/gqwei/ The graph at page 20 (about list Vs vector) seems a bit too much good to be true. There is no link to the benchmarking code.

Re: GC for pure functions -- implementation ideas

2011-04-15 Thread Tomek Sowiński
Don napisał: > LEAKY FUNCTIONS > > Define a 'leaky' pure function as a pure function which can return > heap-allocated memory to the caller, ie, where the return value or a > parameter passed by reference has at least one pointer or reference > type. This can be determined simply by inspecting th

Re: Temporarily disable all purity for debug prints

2011-04-15 Thread bearophile
> > Related news: > > https://github.com/D-Programming-Language/dmd/commit/ed8068f5036f88fff1603d98ebe96bb6659bceed I have forgotten to add something: thank you Walter. Sorry for criticizing before actually trying out the change. Bye, bearophile

Re: Temporarily disable all purity for debug prints

2011-04-15 Thread bearophile
David Nadlinger: > Related news: > https://github.com/D-Programming-Language/dmd/commit/ed8068f5036f88fff1603d98ebe96bb6659bceed It's a bit disconcerting to see how important things I'm asking and arguing for for three years or more gets ignored, while this that I have barely noted gets worked

Re: GC for pure functions -- implementation ideas

2011-04-15 Thread Don
Sean Kelly wrote: On Apr 15, 2011, at 1:12 PM, Don wrote: Create a pure heap for each thread. This is a heap which can only be used by pure functions. I present some simplistic code, with the simplest possible implementation: just a big block of memory with a thread local 'stack pointer' which

Re: Temporarily disable all purity for debug prints

2011-04-15 Thread David Nadlinger
On 4/11/11 11:27 PM, bearophile wrote: From what I am seeing, in a D2 program if I have many (tens or more) pure functions that call to each other, and I want to add (or activate) a printf/writeln inside one (or few) of those functions to debug it, I may need to temporarily comment out the "p

Re: GC for pure functions -- implementation ideas

2011-04-15 Thread bearophile
Don: > But it seems to me that a dedicated GC for pure functions has enormous > unexplored potential, and might be relatively easy to implement. - In D we have not even started to exploit the full potential of purity and pure functions. - In D reducing the work of the normal GC is a very good t

Re: Backporting Tango runtime enhancements to druntime

2011-04-15 Thread mta`chrono
We could also rewrite tango.core.Thread so that it extends core.thread. But keep the old interface/API. Some of the tango special feature might be wrapped in this case. In my mind it's more important that tango.core.Atomic gets deprecated, because it doesn't work well on my maschine. I have ou

Re: GC for pure functions -- implementation ideas

2011-04-15 Thread Sean Kelly
On Apr 15, 2011, at 1:12 PM, Don wrote: > > Create a pure heap for each thread. This is a heap which can only be > used by pure functions. I present some simplistic code, with the > simplest possible implementation: just a big block of memory with a thread > local 'stack pointer' which points to

Re: "Try it now"

2011-04-15 Thread Roman Ivanov
== Quote from Jacob Carlborg (d...@me.com)'s article > On 2011-04-14 18:48, Andrei Alexandrescu wrote: > > On 4/14/11 9:03 AM, Steven Schveighoffer wrote: > >> Sometimes, I worry that my unit tests or asserts aren't running. Every > >> once in a while, I have to change one to fail to make sure that

Re: GC for pure functions -- implementation ideas

2011-04-15 Thread Walter Bright
On 4/15/2011 1:12 PM, Don wrote: In reality, things are going to be a bit more complicated than this. But it seems to me that conceptually, something like this could still stay fairly simple and be very, very fast. With no changes required to the language, and not even any changes required to exi

GC for pure functions -- implementation ideas

2011-04-15 Thread Don
I noticed a lively discussion in Bugzilla about the GC, with speculation about the impact of a precise GC on speed. But it seems to me that a dedicated GC for pure functions has enormous unexplored potential, and might be relatively easy to implement. LEAKY FUNCTIONS Define a 'leaky' pure func

Re: Ceylon language

2011-04-15 Thread Dmitry Olshansky
On 15.04.2011 22:24, KennyTM~ wrote: On Apr 16, 11 00:29, Andrej Mitrovic wrote: I've also tried to create a some sort of 'bind' function which could let you bind arguments to specific parameters of a function. If I had it working it would really help (me) out in coding for e.g. the Windows API

Re: Ceylon language

2011-04-15 Thread KennyTM~
On Apr 16, 11 00:29, Andrej Mitrovic wrote: I've also tried to create a some sort of 'bind' function which could let you bind arguments to specific parameters of a function. If I had it working it would really help (me) out in coding for e.g. the Windows API. For example you might have a WinAPI

Re: Ceylon language

2011-04-15 Thread Andrej Mitrovic
Oh and the reason I used a struct and opCall inside the template is because this somehow allowed me to use foreach for some things. I dunno, CTFE overall seems like a buggy thing where I have to guess whether something will work or not. It's very stress-inducing.

Re: LLVM Coding Standards

2011-04-15 Thread spir
On 04/15/2011 01:10 PM, Spacen Jasset wrote: As other posters have pointed out, it seems to me, at least, that having a way to express your model/idea or view of a problem directly is the most useful thing a language can give you. This is my definition of a good language :-) Denis -- _

Re: Ceylon language

2011-04-15 Thread Andrej Mitrovic
Here's a hardcoded example: http://codepad.org/klr8S1hi I've tried numerous ways of automatically creating the appropriate call to fun in the bind template, but I've been unsuccessful. Maybe using some form of string mixin would work.. My biggest issue is that I can't modify variables at compile

Re: Ceylon language

2011-04-15 Thread bearophile
Andrej Mitrovic: > alias bind!CreateWindow(void, void, width, height, null, null, null, > void) myWindow; How do you give a void argument to a function, in D2? This doesn't work, despite having templated void arguments seems potentially useful: void foo(T)(T x) {} void bar() {} void main() {

Re: question to Walter - about the GUI library

2011-04-15 Thread Walter Bright
On 4/15/2011 7:20 AM, Jacob Carlborg wrote: Just for the record, it's in development and now supports D2. That's most excellent!

Re: Ceylon language

2011-04-15 Thread Andrej Mitrovic
I've recently made an attempt to make a curry alternative which can take any number of parameters (currently the curry implementation only works with 1 parameter). I've put my implementation in bugzilla, it is extremely simple (and maybe buggy :p) http://d.puremagic.com/issues/show_bug.cgi?id=5829.

Re: [OT] Partial-reparsing thory?

2011-04-15 Thread Rainer Schuetze
Nick Sabalausky wrote: "spir" wrote in message news:mailman.3527.1302824019.4748.digitalmar...@puremagic.com... On 04/15/2011 12:51 AM, Nick Sabalausky wrote: Is anyone aware of any (formal or informal) theory/information/research/articles/etc. that's already been done on the idea of reparsin

Re: question to Walter - about the GUI library

2011-04-15 Thread Jacob Carlborg
On 2011-04-14 20:59, Walter Bright wrote: On 4/14/2011 7:31 AM, Jesse Phillips wrote: Walter has dropped the idea of endorsing a GUI/any library. There was once a statement that DWT was the official library for D, development promptly stopped afterwards. Not trying to claim there was causation h

Re: "Try it now"

2011-04-15 Thread Jacob Carlborg
On 2011-04-14 18:48, Andrei Alexandrescu wrote: On 4/14/11 9:03 AM, Steven Schveighoffer wrote: Sometimes, I worry that my unit tests or asserts aren't running. Every once in a while, I have to change one to fail to make sure that code is compiling (this is especially true when I'm doing version

Re: question to Walter - about the GUI library

2011-04-15 Thread Jacob Carlborg
On 2011-04-15 15:13, David Wang wrote: == Forward by Jesse Phillips (jessekphillip...@gmail.com) == Posted at 2011/04/14 10:31 to digitalmars.D David Wang Wrote: Dear Walter Bright, I would like to know that what GUI library you wou

Re: Ceylon language

2011-04-15 Thread Pelle
On 04/15/2011 03:23 AM, Nick Sabalausky wrote: I'm not certain either, but I *think* partial application is just like currying except there's some sort of arbitrary limitaion on what combination(s) of paramaters you can choose to specify or not specify. And that limitation is based purely on what

Re: GSoC 2011 update: we have 3 slots

2011-04-15 Thread Ishan Thilina
>> Digital Mars has received 3 slots for GSoC 2011. That means we need >> to choose three student projects to go with. >> >> We have enjoyed many strong applications and we have a great lineup >> of mentors, but Google is reluctant to allocate a lot of slots to >> first-time participants because hi

Re: question to Walter - about the GUI library

2011-04-15 Thread Daniel Gibson
Am 15.04.2011 15:13, schrieb David Wang: > > == Forward by Jesse Phillips (jessekphillip...@gmail.com) > == Posted at 2011/04/14 10:31 to digitalmars.D > > David Wang Wrote: > >> Dear Walter Bright, >> >> I would like to know that what

Re: RFC: Units of measurement for D (Phobos?)

2011-04-15 Thread David Nadlinger
On 4/15/11 2:24 PM, Simen Kjaeraas wrote: This looks very good. I'd suggest calling them std.units and std.units.si, if possible. Thanks for your comments. Unfortunately, having a package of the same name as a module is not possible in D – any other ideas? What about std.measure(ment).*? D

Re: RFC: Units of measurement for D (Phobos?)

2011-04-15 Thread David Nadlinger
On 4/15/11 3:06 PM, Simen Kjaeraas wrote: Oh, and it would appear I have found a bug: enum foo = metre / 2; std\units.d(165): Error: cannot raise int to a negative integer power. Did you m ean (cast(real)rhs)^^-1 ? Oh, thanks, I just pushed a fix (which uses (rhs ^^ 0) / rhs to work around th

Re: question to Walter - about the GUI library

2011-04-15 Thread David Wang
== Forward by Jesse Phillips (jessekphillip...@gmail.com) == Posted at 2011/04/14 10:31 to digitalmars.D David Wang Wrote: > Dear Walter Bright, > > I would like to know that what GUI library you would like to use for D > Language ? >

Re: RFC: Units of measurement for D (Phobos?)

2011-04-15 Thread Simen Kjaeraas
Oh, and it would appear I have found a bug: enum foo = metre / 2; std\units.d(165): Error: cannot raise int to a negative integer power. Did you m ean (cast(real)rhs)^^-1 ?

Re: RFC: Units of measurement for D (Phobos?)

2011-04-15 Thread Simen Kjaeraas
This looks very good. I'd suggest calling them std.units and std.units.si, if possible. It seems to support all the features I wanted when I started writing such a module, though I never finished mine. The documentation is very nice if, as you said, somewhat duplicated. Could perhaps use a bette

Re: "Try it now"

2011-04-15 Thread Jacob Carlborg
On 2011-04-14 16:03, Steven Schveighoffer wrote: On Wed, 13 Apr 2011 21:04:25 -0400, Adam D. Ruppe wrote: On the other hand, having output there might be more interesting to look at than "yay the asserts all passed!". I think this is a good point. Someone playing with a language might type i

Re: LLVM Coding Standards

2011-04-15 Thread Spacen Jasset
On 12/04/2011 11:21, Mafi wrote: Am 12.04.2011 00:31, schrieb Spacen Jasset: std::getline(is, line); while (line.size() != 0) { ...some things... std::getline(is, line); } What's wrong with while( std::getline(is, line), (line.size() != 0) ) { //... some things } I mean, that's what the comma

Re: single-line string?

2011-04-15 Thread Kagamin
spir Wrote: > I press '"' '""' is written out (a feature I hate anyway for code edition). I > would like to know how & how well other editors deal with all of that > (especially but not only emacs and vim). Visual studio rehighlights instantly and has a timeout of 2 sec for refold. > Compare w

Re: [OT] Partial-reparsing thory?

2011-04-15 Thread spir
On 04/15/2011 02:40 AM, Nick Sabalausky wrote: "spir" wrote in message news:mailman.3527.1302824019.4748.digitalmar...@puremagic.com... On 04/15/2011 12:51 AM, Nick Sabalausky wrote: Is anyone aware of any (formal or informal) theory/information/research/articles/etc. that's already been done