On Thursday, 11 November 2021 at 14:52:45 UTC, Stanislav Blinov
wrote:
On Thursday, 11 November 2021 at 09:11:37 UTC, Salih Dincer
wrote:
Unless explicitly set, default type is int. 110 is
greater than int.max.
11
```d
enum w = 100_000;
size_t b = w * w;
// size_t b = 10
On Thursday, 11 November 2021 at 19:34:42 UTC, Stanislav Blinov
wrote:
Original C code from the first post can only fail on I/O, which
is arguably out of your control. And the meat of it amounts to
10 conditional stores. Your implementations, in both C and D,
are a very, very far distance awa
On Friday, 12 November 2021 at 01:05:15 UTC, Stanislav Blinov
wrote:
On Thursday, 11 November 2021 at 22:10:04 UTC, forkit wrote:
It's called 'staged learning'.
Staged learning is the only way for humans to learn, due to
the limitations of the human cognitive system. Specifically,
the way sh
On Friday, 12 November 2021 at 01:05:15 UTC, Stanislav Blinov
wrote:
On Thursday, 11 November 2021 at 22:10:04 UTC, forkit wrote:
It's called 'staged learning'.
Staged learning is the only way for humans to learn, due to
the limitations of the human cognitive system. Specifically,
the way sh
On Thursday, 11 November 2021 at 22:10:04 UTC, forkit wrote:
It's called 'staged learning'.
Staged learning is the only way for humans to learn, due to the
limitations of the human cognitive system. Specifically, the
way short-term memory and long-term memory facilitate learning.
Those who
On Thursday, 11 November 2021 at 23:41:48 UTC, kdevel wrote:
On Thursday, 11 November 2021 at 22:30:12 UTC, forkit wrote:
[...]
for(int i = 0; i < sizeof(numbers) / sizeof(int); ++i) //
is so much safer - in C style
I made it even safer:
for (int i = 0; i < sizeof numbers / sizeof *nu
On Thursday, 11 November 2021 at 21:56:19 UTC, Ali Çehreli wrote:
On 11/11/21 11:34 AM, Stanislav Blinov wrote:
> Pessimization, though, is laughably easy, and
> should be avoided at all costs.
I am not passionate about this topic at all and I am here
mostly because I have fun in this forum. S
On Thursday, 11 November 2021 at 13:22:15 UTC, Basile B. wrote:
As for now, I know no compiler that can do that.
GCC can do it. Somewhat notoriously, LTO can lead to bugs from
underspecified asm constraints following cross-TU inlining.
On Thursday, 11 November 2021 at 22:35:21 UTC, forkit wrote:
On Thursday, 11 November 2021 at 21:40:33 UTC, Ali Çehreli
wrote:
On 11/11/21 1:37 PM, forkit wrote:
dmd test.d -cov
...but no .lst file anywhere to be found. Huh! I don't get it.
Please run the program! :)
Ali
oh! that kinda m
On Thursday, 11 November 2021 at 22:30:12 UTC, forkit wrote:
[...]
for(int i = 0; i < sizeof(numbers) / sizeof(int); ++i) //
is so much safer - in C style
I made it even safer:
for (int i = 0; i < sizeof numbers / sizeof *numbers; ++i)
Maybe the type of numbers is changed in the futur
On Thursday, 11 November 2021 at 21:40:33 UTC, Ali Çehreli wrote:
On 11/11/21 1:37 PM, forkit wrote:
dmd test.d -cov
...but no .lst file anywhere to be found. Huh! I don't get it.
Please run the program! :)
Ali
oh! that kinda makes sense, now that I think of it ;-)
On Tuesday, 2 November 2021 at 23:45:39 UTC, pascal111 wrote:
Next code originally was a classic C code I've written, it's
pure vertical thinking, now, I converted it successfully to D
code, but I think I made no much changes to make it has more
horizontal thinking style that it seems D program
On Thursday, 11 November 2021 at 21:13:03 UTC, Stanislav Blinov
wrote:
On Thursday, 11 November 2021 at 00:11:07 UTC, H. S. Teoh wrote:
It depends on what you're doing. In the OP's example, yeah
worrying about allocations is totally blowing things out of
proportions.
But that's the thing. Ho
On 11/11/21 11:34 AM, Stanislav Blinov wrote:
> Pessimization, though, is laughably easy, and
> should be avoided at all costs.
I am not passionate about this topic at all and I am here mostly because
I have fun in this forum. So, I am fine in general.
However, I don't agree that pessimizatio
On 11/11/21 1:37 PM, forkit wrote:
dmd test.d -cov
...but no .lst file anywhere to be found. Huh! I don't get it.
Please run the program! :)
Ali
// --
module test;
import std.stdio;
void main()
{
writeln("Hello World!");
}
// ---
dmd test.d -cov
..but no .lst file anywhere to be found. Huh! I don't get it.
On Thursday, 11 November 2021 at 00:11:07 UTC, H. S. Teoh wrote:
It depends on what you're doing. In the OP's example, yeah
worrying about allocations is totally blowing things out of
proportions.
But that's the thing. How would one ever learn to know where that
dividing line is if all the l
On Wednesday, 10 November 2021 at 23:15:09 UTC, forkit wrote:
On Wednesday, 10 November 2021 at 22:17:48 UTC, russhy wrote:
On Wednesday, 10 November 2021 at 06:47:32 UTC, forkit wrote:
btw. My pc has 24GB of main memory, and my CPU 8MB L3 cache.
So I really don't give a damn about allocations
On Thursday, 11 November 2021 at 17:29:33 UTC, rempas wrote:
On Thursday, 11 November 2021 at 13:22:15 UTC, Basile B. wrote:
Yes, this is still the case. A particularity of DMD inliner is
that it does its job in the front-end, so inlining asm is
totally impossible. Then, even if inlining was
On Thursday, 11 November 2021 at 13:22:15 UTC, Basile B. wrote:
Yes, this is still the case. A particularity of DMD inliner is
that it does its job in the front-end, so inlining asm is
totally impossible. Then, even if inlining was done in the
backend inlining of asm would not be guaranteed b
On Thursday, 11 November 2021 at 12:05:14 UTC, Adam D Ruppe wrote:
You really shouldn't expect dmd to inline *anything*.
Or to optimize anything for that matter. That isn't its
strength.
Oh yeah! I just thought to ask anyway! Thanks a lot for your time!
On Thu, Nov 11, 2021 at 01:09:26AM +, forkit via Digitalmars-d-learn wrote:
> On Thursday, 11 November 2021 at 00:11:07 UTC, H. S. Teoh wrote:
> > On Wed, Nov 10, 2021 at 11:39:40PM +, forkit via Digitalmars-d-learn
> > wrote: [...]
> > > I still remember compiling code on my 286x86 ... tal
On Thursday, 11 November 2021 at 09:11:37 UTC, Salih Dincer wrote:
Unless explicitly set, default type is int. 110 is
greater than int.max.
11
```d
enum w = 100_000;
size_t b = w * w;
// size_t b = 10 * 10; // ???
assert(b == 10_000_000_000); // Assert Failure
```
Th
On Thursday, 11 November 2021 at 08:58:43 UTC, rempas wrote:
I've seen from
[this](https://forum.dlang.org/post/op.vrzngqeavxi10f@biotronic-laptop) reply in a thread from 2011 that DMD will not inline functions that contain inline assembly. Is this still the case?
Yes, this is still the case. A
On Thursday, 11 November 2021 at 05:37:05 UTC, Salih Dincer wrote:
is this a issue, do you need to case?
```d
enum tLimit = 10_000; // (1) true result
enum wLimit = 100_000; // (2) wrong result
void main()
{
size_t subTest1 = tLimit;
assert(subTest1 == tLimit);/* no error */
siz
On Thursday, 11 November 2021 at 05:37:05 UTC, Salih Dincer wrote:
is this a issue, do you need to case?
```d
enum tLimit = 10_000; // (1) true result
enum wLimit = 100_000; // (2) wrong result
That's an `int` literal. Try
enum wLimit = 100_000L;
the L suffix makes a `long` literal.
On Thursday, 11 November 2021 at 12:05:19 UTC, Tejas wrote:
On Thursday, 11 November 2021 at 09:11:37 UTC, Salih Dincer
wrote:
On Thursday, 11 November 2021 at 06:34:16 UTC, Stanislav
Blinov wrote:
On Thursday, 11 November 2021 at 05:37:05 UTC, Salih Dincer
wrote:
is this a issue, do you need
On Thursday, 11 November 2021 at 09:11:37 UTC, Salih Dincer wrote:
On Thursday, 11 November 2021 at 06:34:16 UTC, Stanislav Blinov
wrote:
On Thursday, 11 November 2021 at 05:37:05 UTC, Salih Dincer
wrote:
is this a issue, do you need to case?
```d
enum tLimit = 10_000; // (1) true result
enum
On Thursday, 11 November 2021 at 08:58:43 UTC, rempas wrote:
I've seen from
[this](https://forum.dlang.org/post/op.vrzngqeavxi10f@biotronic-laptop) reply in a thread from 2011 that DMD will not inline functions that contain inline assembly. Is this still the case?
You really shouldn't expect dm
On Thursday, 11 November 2021 at 06:34:16 UTC, Stanislav Blinov
wrote:
On Thursday, 11 November 2021 at 05:37:05 UTC, Salih Dincer
wrote:
is this a issue, do you need to case?
```d
enum tLimit = 10_000; // (1) true result
enum wLimit = 100_000; // (2) wrong result
```
https://dlang.org/spec/
I've seen from
[this](https://forum.dlang.org/post/op.vrzngqeavxi10f@biotronic-laptop) reply in a thread from 2011 that DMD will not inline functions that contain inline assembly. Is this still the case?
31 matches
Mail list logo