Re: Adding Markdown to Ddoc

2017-12-09 Thread Walter Bright via Digitalmars-d
On 12/9/2017 9:17 PM, meppl wrote: since commonmark exists, is specified and is compatibale to many markdown-languages,  I claim there is a markdown standard: http://spec.commonmark.org/ It certainly wants to be the standard, but until most everyone decides to follow it, it is not. There is n

Re: Invoking writeln() from a lot of threads running concurrently --> crash

2017-12-09 Thread IM via Digitalmars-d
On Saturday, 9 December 2017 at 10:36:08 UTC, Messenger wrote: On Saturday, 9 December 2017 at 09:38:05 UTC, IM wrote: For purposes of debugging, I'm using writeln() to print stuff out from tasks running concurrently on many threads. At some point it crashes with the following stack trace: Th

Re: Invoking writeln() from a lot of threads running concurrently --> crash

2017-12-09 Thread IM via Digitalmars-d
On Sunday, 10 December 2017 at 01:12:37 UTC, Walter Bright wrote: On 12/9/2017 5:56 AM, Seb wrote: IIRC the implementation of LockingTextWriter isn't thread-safe. There's no bugzilla issue on this. So I added one: https://issues.dlang.org/show_bug.cgi?id=18052 Please, folks, I can't emphas

Re: Adding Markdown to Ddoc

2017-12-09 Thread meppl via Digitalmars-d
On Sunday, 10 December 2017 at 01:19:13 UTC, Walter Bright wrote: On 12/9/2017 12:23 PM, Jacob Carlborg wrote: On 2017-12-09 02:49, Walter Bright wrote: This is way overstating the case. Ddoc already supports some markdown, and some markdown in different ways. Yes, but I haven't yet seen any

Re: foreach bug, or shoddy docs, or something, or both.

2017-12-09 Thread Jonathan M Davis via Digitalmars-d
On Sunday, December 10, 2017 02:02:31 Dave Jones via Digitalmars-d wrote: > Foreach ignores modification to the loop variable... > > import std.stdio; > > void main() { > int[10] foo = 10; > > foreach (i; 0..10) // writes '10' ten times > { > writeln(foo[i]); > if (

foreach bug, or shoddy docs, or something, or both.

2017-12-09 Thread Dave Jones via Digitalmars-d
Foreach ignores modification to the loop variable... import std.stdio; void main() { int[10] foo = 10; foreach (i; 0..10) // writes '10' ten times { writeln(foo[i]); if (i == 3) i+=2; } } From the docs... "ForeachType declares a variable with either an explicit

Re: Adding Markdown to Ddoc

2017-12-09 Thread Walter Bright via Digitalmars-d
On 12/9/2017 1:05 PM, David Gileadi wrote: On 12/8/17 6:49 PM, Walter Bright wrote: On 12/8/2017 7:30 AM, Jacob Carlborg wrote: Otherwise it will be confusing and very hard to remember which features are supported with Markdown syntax and which are not. This is way overstating the case. Ddoc

Re: Adding Markdown to Ddoc

2017-12-09 Thread Walter Bright via Digitalmars-d
On 12/9/2017 12:23 PM, Jacob Carlborg wrote: On 2017-12-09 02:49, Walter Bright wrote: This is way overstating the case. Ddoc already supports some markdown, and some markdown in different ways. Yes, but I haven't yet seen any official documentation saying that Ddoc supports Markdown syntax.

Re: Invoking writeln() from a lot of threads running concurrently --> crash

2017-12-09 Thread Walter Bright via Digitalmars-d
On 12/9/2017 5:56 AM, Seb wrote: IIRC the implementation of LockingTextWriter isn't thread-safe. There's no bugzilla issue on this. So I added one: https://issues.dlang.org/show_bug.cgi?id=18052 Please, folks, I can't emphasize this enough. When you find a bug, POST IT ON BUGZILLA! Otherwi

Re: Adding Markdown to Ddoc

2017-12-09 Thread David Gileadi via Digitalmars-d
On 12/9/17 2:25 PM, Adam D. Ruppe wrote: On Saturday, 9 December 2017 at 21:05:04 UTC, David Gileadi wrote: For instance, as I've been working on adding Markdown features I was surprised to discover that DDoc's current support for backtick-delimited code only works within a single line. Most i

Re: Adding Markdown to Ddoc

2017-12-09 Thread Adam D. Ruppe via Digitalmars-d
On Saturday, 9 December 2017 at 21:05:04 UTC, David Gileadi wrote: For instance, as I've been working on adding Markdown features I was surprised to discover that DDoc's current support for backtick-delimited code only works within a single line. Most implementations I've seen allow it to span

Re: Adding Markdown to Ddoc

2017-12-09 Thread David Gileadi via Digitalmars-d
On 12/8/17 6:49 PM, Walter Bright wrote: On 12/8/2017 7:30 AM, Jacob Carlborg wrote: Otherwise it will be confusing and very hard to remember which features are supported with Markdown syntax and which are not. This is way overstating the case. Ddoc already supports some markdown, and some ma

Re: Adding Markdown to Ddoc

2017-12-09 Thread Jacob Carlborg via Digitalmars-d
On 2017-12-09 02:49, Walter Bright wrote: This is way overstating the case. Ddoc already supports some markdown, and some markdown in different ways. Yes, but I haven't yet seen any official documentation saying that Ddoc supports Markdown syntax. -- /Jacob Carlborg

Re: Post about comparing C, C++ and D performance with a real world project

2017-12-09 Thread Steven Schveighoffer via Digitalmars-d
On 12/9/17 12:11 PM, unleashy wrote: On Saturday, 9 December 2017 at 14:00:16 UTC, Steven Schveighoffer wrote: Yes, it would be nice to have a "If you do this in C, here's how you do it in D" guide. It could be part of the tour, for sure. Just tag it intermediate. What about this? https://dla

Re: Post about comparing C, C++ and D performance with a real world project

2017-12-09 Thread unleashy via Digitalmars-d
On Saturday, 9 December 2017 at 14:00:16 UTC, Steven Schveighoffer wrote: Yes, it would be nice to have a "If you do this in C, here's how you do it in D" guide. It could be part of the tour, for sure. Just tag it intermediate. What about this? https://dlang.org/ctod.html

Re: Post about comparing C, C++ and D performance with a real world project

2017-12-09 Thread Steven Schveighoffer via Digitalmars-d
On 12/9/17 5:55 AM, Kagamin wrote: On Thursday, 7 December 2017 at 21:38:57 UTC, Daniel Kozak wrote: Yes using FILE* directly could be the way.  But using file.rawRead is still possible. But it is better to use static array with length one. This can reflect absence of middle level resources li

Re: Invoking writeln() from a lot of threads running concurrently --> crash

2017-12-09 Thread Seb via Digitalmars-d
On Saturday, 9 December 2017 at 09:38:05 UTC, IM wrote: Note that I didn't add any synchronizations around the writeln() calls, should I? I assume the implementation *should* synchronize access to std_out, no? Bug in phobos? Yes, try using synchronized access. IIRC the implementation of Loc

Re: Post about comparing C, C++ and D performance with a real world project

2017-12-09 Thread helxi via Digitalmars-d
On Friday, 8 December 2017 at 15:40:08 UTC, Steven Schveighoffer wrote: On 12/7/17 8:11 PM, Mengu wrote: On Thursday, 7 December 2017 at 22:39:44 UTC, Daniel Kozak wrote: The other slowdown is caused by concatenation. Because std::string += is more simillar to std.array.(Ref)Appender wait, i

Re: Inconsistent floating point conversion to bool

2017-12-09 Thread Iain Buclaw via Digitalmars-d
On 9 December 2017 at 12:51, rumbu via Digitalmars-d wrote: > > float f = float.min_normal; > bool fcast1 = cast(bool)f; > bool fcast2 = cast(bool)float.min_normal; > > if (fcast1) > writeln("variable casting to bool is true"); > else > writeln("variable casting

Inconsistent floating point conversion to bool

2017-12-09 Thread rumbu via Digitalmars-d
float f = float.min_normal; bool fcast1 = cast(bool)f; bool fcast2 = cast(bool)float.min_normal; if (fcast1) writeln("variable casting to bool is true"); else writeln("variable casting to bool is false"); if (fcast2) writeln("constant casting to b

Re: Post about comparing C, C++ and D performance with a real world project

2017-12-09 Thread Kagamin via Digitalmars-d
On Thursday, 7 December 2017 at 21:38:57 UTC, Daniel Kozak wrote: Yes using FILE* directly could be the way. But using file.rawRead is still possible. But it is better to use static array with length one. This can reflect absence of middle level resources like basic optimization techniques f

Re: Invoking writeln() from a lot of threads running concurrently --> crash

2017-12-09 Thread Messenger via Digitalmars-d
On Saturday, 9 December 2017 at 09:38:05 UTC, IM wrote: For purposes of debugging, I'm using writeln() to print stuff out from tasks running concurrently on many threads. At some point it crashes with the following stack trace: Thread 4 received signal SIGUSR1, User defined signal 1. [...] B

Invoking writeln() from a lot of threads running concurrently --> crash

2017-12-09 Thread IM via Digitalmars-d
For purposes of debugging, I'm using writeln() to print stuff out from tasks running concurrently on many threads. At some point it crashes with the following stack trace: Thread 4 received signal SIGUSR1, User defined signal 1. [Switching to Thread 0x75ec2700 (LWP 19267)] __lll_lock_wait_p