On Tuesday, 4 August 2015 at 04:10:33 UTC, tcak wrote:
max_hex_length = 2
max_dec_length = 3
max_bin_length = 8
I think that there is no need to add such properties. They
clearly belong into the application domain. min and max values
are different because they depend on the internal represent
On Tuesday, 4 August 2015 at 04:10:33 UTC, tcak wrote:
There is a use case for me that I am given a string, and before
even trying to convert it to integer, I want to check whether
it is valid. One of the checks necessary for this is the length
of string.
So, if I have received "156" and it s
On Tuesday, 4 August 2015 at 06:17:15 UTC, rumbu wrote:
enum max_hex_length = T.sizeof * 2;
enum max_bin_length = T.sizeof * 8;
enum max_dec_length = cast(T)log10(T.sizeof) + 1;
Errata:
enum max_dec_length = cast(T)log10(T.max) + 1;
On 08/03/2015 02:25 PM, Andrei Alexandrescu wrote:
I had to set up dmd and friends on a fresh Ubuntu box, so I thought I'd
document the step-by-step process:
http://wiki.dlang.org/Starting_as_a_Contributor
Along the way I also hit a small snag and fixed it at
https://github.com/D-Programming-L
On Sunday, 2 August 2015 at 15:46:40 UTC, dereck009 wrote:
On Sunday, 2 August 2015 at 15:33:42 UTC, David Nadlinger wrote:
Somebody just mentioned Vladimir's great work in a discussion
on the Hacker News front page:
https://news.ycombinator.com/item?id=9990763
— David
Can we read about ho
There is a use case for me that I am given a string, and before
even trying to convert it to integer, I want to check whether it
is valid. One of the checks necessary for this is the length of
string.
So, if I have received "156" and it should be converted to ubyte,
I would check whether it i
On Tuesday, 4 August 2015 at 03:04:14 UTC, Dicebot wrote:
indeed. I remember Iain complaining about presence of HLT (and
saying he won't do that for gdc) for exactly this reason.
Yes. I think a lot of this confusion could have been avoided by
using "halt()" instead of "assert(0)" and "unreacha
On Tuesday, 4 August 2015 at 02:37:00 UTC, Ola Fosheim Grøstad
wrote:
On Monday, 3 August 2015 at 15:18:12 UTC, Dicebot wrote:
On Monday, 3 August 2015 at 14:34:52 UTC, Steven Schveighoffer
wrote:
Why do we do this?
Because all asserts must be completely removed in -release
Yet assert(0) eff
On Monday, 3 August 2015 at 15:18:12 UTC, Dicebot wrote:
On Monday, 3 August 2015 at 14:34:52 UTC, Steven Schveighoffer
wrote:
Why do we do this?
Because all asserts must be completely removed in -release
Yet assert(0) effectively mean "unreachable code" (it is
actually defined that way in s
On 8/3/2015 5:25 PM, Ali Çehreli wrote:
On 08/03/2015 04:57 PM, Steven Schveighoffer wrote:
> At the very least, assert(0, "message") should be a compiler error, the
> message is unused information.
Agreed.
No.
1. If you want the message, do not use -release.
2. Do not use asserts to issue
On 8/3/2015 4:57 PM, Steven Schveighoffer wrote:
OK, this brings up another debate. The thing that triggered all this is an issue
with core.time, see issue https://issues.dlang.org/show_bug.cgi?id=14863
Essentially, we wrote code to get all the clock information at startup on a
posix system that
On Monday, 3 August 2015 at 23:57:36 UTC, Steven Schveighoffer
wrote:
OK, this brings up another debate. The thing that triggered all
this is an issue with core.time, see issue
https://issues.dlang.org/show_bug.cgi?id=14863
[...]
Why not just " stderr.writeln(errMsg); assert(0);"?
On 08/03/2015 04:57 PM, Steven Schveighoffer wrote:
> At the very least, assert(0, "message") should be a compiler error, the
> message is unused information.
Agreed.
How about dumping the message to stderr as a best effort if the message
is a literal? Hm... On the other hand, undefined behavi
On 8/3/15 6:54 PM, Walter Bright wrote:
On 8/3/2015 8:50 AM, Steven Schveighoffer wrote:
1. They aren't removed, they are replaced with a nearly useless segfault.
Not useless at all:
1. The program does not continue running after it has failed. (Please,
let's not restart that debate.
You ca
On 8/3/2015 8:50 AM, Steven Schveighoffer wrote:
1. They aren't removed, they are replaced with a nearly useless segfault.
Not useless at all:
1. The program does not continue running after it has failed. (Please, let's not
restart that debate.
2. Running it under a debugger, the location of
On 04-Aug-2015 01:30, Steven Schveighoffer wrote:
On 8/3/15 5:25 PM, Andrei Alexandrescu wrote:
I had to set up dmd and friends on a fresh Ubuntu box, so I thought I'd
document the step-by-step process:
http://wiki.dlang.org/Starting_as_a_Contributor
You should make sure there's no overlap wi
On 8/3/15 5:25 PM, Andrei Alexandrescu wrote:
I had to set up dmd and friends on a fresh Ubuntu box, so I thought I'd
document the step-by-step process:
http://wiki.dlang.org/Starting_as_a_Contributor
You should make sure there's no overlap with this:
http://wiki.dlang.org/Get_involved
I thi
On Monday, 3 August 2015 at 06:16:57 UTC, yawniek wrote:
On Sunday, 2 August 2015 at 16:25:18 UTC, Yura wrote:
While it is easy to code in Python there are two things I do
not like:
1) Python is slow for nested loops (much slower comparing to C)
2) Python is not compiled. However, I want to w
I had to set up dmd and friends on a fresh Ubuntu box, so I thought I'd
document the step-by-step process:
http://wiki.dlang.org/Starting_as_a_Contributor
Along the way I also hit a small snag and fixed it at
https://github.com/D-Programming-Language/dlang.org/pull/1049
Further improvements a
On Tuesday, 28 July 2015 at 14:07:19 UTC, Atila Neves wrote:
Start of the two week process, folks.
Code: https://github.com/s-ludwig/std_data_json
Docs: http://s-ludwig.github.io/std_data_json/
Atila
Looked in the doc (
http://s-ludwig.github.io/std_data_json/stdx/data/json/value/JSONValue.h
On Tuesday, 23 June 2015 at 14:58:35 UTC, Manu wrote:
https://github.com/D-Programming-Language/phobos/pull/2845
I'm getting quite happy with it.
I think it's a good and fairly minimal but useful starting
point.
It'd be great to get some reviews from here.
Whats the status on this? This rea
On Monday, 3 August 2015 at 14:25:21 UTC, FreeSlave wrote:
On Sunday, 2 August 2015 at 16:25:18 UTC, Yura wrote:
Dear D coders/developers,
I am just thinking on one project in computational chemistry,
and it is sort of difficult for me to pick up the right
language this project to be written.
On Monday, 3 August 2015 at 12:46:51 UTC, Elvis Zhou wrote:
On Thursday, 30 July 2015 at 19:38:12 UTC, Joakim wrote:
On Monday, 25 May 2015 at 20:08:48 UTC, Joakim wrote:
[...]
Some good news, I've made progress on the port to Android/ARM,
using ldc's 2.067 branch. Currently, all 46 modules
On Monday, 3 August 2015 at 17:33:30 UTC, aki wrote:
On Monday, 3 August 2015 at 16:47:58 UTC, John Colvin wrote:
changing two lines:
final class SubFoo : Foo {
int test(F)(F obj, int repeat) {
I tried it. DMD is no change, while GDC gets acceptable score.
D(DMD 2.067.1): 2.445
D(GDC 4.9.2/2.0
Im using visual studio code with vibed and dub, it's working very
well. Visual studio code support jade files.
Would be happy to see official support for D.
atm I have my own basic custom "D support". You can
copy/paste/edit c# support and edit the files to add D keywords,
it's very easy.
Y
On 03-Aug-2015 20:05, Steven Schveighoffer wrote:
On 8/3/15 12:59 PM, Dmitry Olshansky wrote:
On 03-Aug-2015 19:54, Steven Schveighoffer wrote:
ALSO, make SURE you are compiling in release mode, so you aren't calling
a virtual invariant function before/after every call.
This one is critical
On Monday, 3 August 2015 at 16:47:58 UTC, John Colvin wrote:
changing two lines:
final class SubFoo : Foo {
int test(F)(F obj, int repeat) {
I tried it. DMD is no change, while GDC gets acceptable score.
D(DMD 2.067.1): 2.445
D(GDC 4.9.2/2.066): 0.928
Now I got a hint how to improve the code b
On 8/3/15 12:59 PM, Dmitry Olshansky wrote:
On 03-Aug-2015 19:54, Steven Schveighoffer wrote:
ALSO, make SURE you are compiling in release mode, so you aren't calling
a virtual invariant function before/after every call.
This one is critical. Actually why do we have an extra call for trivial
On Monday, 3 August 2015 at 16:50:42 UTC, John Colvin wrote:
Making SubFoo a final class and test take SubFoo gives a >10x
speedup for me.
Right, gdc and ldc will the the aggressive inlining and local
data optimizations automatically once it is able to devirtualize
the calls (at least when yo
On Monday, 3 August 2015 at 16:53:30 UTC, Adam D. Ruppe wrote:
On Monday, 3 August 2015 at 16:47:58 UTC, John Colvin wrote:
gets me down to 0.182s with ldc on OS X
Yeah, I tried dmd with the final and didn't get a difference
but gdc with final (and -frelease, very important for max speed
her
On 03-Aug-2015 19:54, Steven Schveighoffer wrote:
On 8/3/15 12:50 PM, John Colvin wrote:
On Monday, 3 August 2015 at 16:47:14 UTC, Adam D. Ruppe wrote:
You can try a few potential optimizations in the D version yourself
and see if it makes a difference.
Devirtualization has a very small impact
On Monday, 3 August 2015 at 16:47:58 UTC, John Colvin wrote:
gets me down to 0.182s with ldc on OS X
Yeah, I tried dmd with the final and didn't get a difference but
gdc with final (and -frelease, very important for max speed here
since without it the method calls are surrounded by various
a
On 8/3/15 12:50 PM, John Colvin wrote:
On Monday, 3 August 2015 at 16:47:14 UTC, Adam D. Ruppe wrote:
You can try a few potential optimizations in the D version yourself
and see if it makes a difference.
Devirtualization has a very small impact. Test this by making `test`
take `SubFoo` and maki
On Monday, 3 August 2015 at 16:47:14 UTC, Adam D. Ruppe wrote:
You can try a few potential optimizations in the D version
yourself and see if it makes a difference.
Devirtualization has a very small impact. Test this by making
`test` take `SubFoo` and making `bar` final, or making `bar` a
sta
You can try a few potential optimizations in the D version
yourself and see if it makes a difference.
Devirtualization has a very small impact. Test this by making
`test` take `SubFoo` and making `bar` final, or making `bar` a
stand-alone function.
That's not it.
Inlining alone doesn't make
On Monday, 3 August 2015 at 16:41:42 UTC, Steven Schveighoffer
wrote:
On 8/3/15 12:31 PM, Dmitry Olshansky wrote:
On 03-Aug-2015 19:27, aki wrote:
When I was trying to port some Java program to D,
I noticed Java is faster than D.
I made a simple bench mark test as follows.
Then, I was shocked w
On Monday, 3 August 2015 at 16:27:39 UTC, aki wrote:
When I was trying to port some Java program to D,
I noticed Java is faster than D.
I made a simple bench mark test as follows.
Then, I was shocked with the result.
test results on Win8 64bit (smaller is better)
Java(1.8.0,64bit,server): 0.677
On 8/3/15 12:31 PM, Dmitry Olshansky wrote:
On 03-Aug-2015 19:27, aki wrote:
When I was trying to port some Java program to D,
I noticed Java is faster than D.
I made a simple bench mark test as follows.
Then, I was shocked with the result.
test results on Win8 64bit (smaller is better)
Java(1.
On 3 August 2015 at 18:27, aki via Digitalmars-d <
digitalmars-d@puremagic.com> wrote:
> When I was trying to port some Java program to D,
> I noticed Java is faster than D.
> I made a simple bench mark test as follows.
> Then, I was shocked with the result.
>
> test results on Win8 64bit (smaller
On 03-Aug-2015 19:27, aki wrote:
When I was trying to port some Java program to D,
I noticed Java is faster than D.
I made a simple bench mark test as follows.
Then, I was shocked with the result.
test results on Win8 64bit (smaller is better)
Java(1.8.0,64bit,server): 0.677
C++(MS vs2013): 2.14
Java being fastest at running Java-style code is not too surprising. My
guess is that Java is "hotspot" inlining the calls to `bar`, getting rid
of the dynamic dispatch overhead. I think that for real systems D will
generally beat out Java across the board, but not if the D version is a
strai
On Monday, 3 August 2015 at 16:27:39 UTC, aki wrote:
When I was trying to port some Java program to D,
I noticed Java is faster than D.
I made a simple bench mark test as follows.
Then, I was shocked with the result.
[...]
What compilation flags?
When I was trying to port some Java program to D,
I noticed Java is faster than D.
I made a simple bench mark test as follows.
Then, I was shocked with the result.
test results on Win8 64bit (smaller is better)
Java(1.8.0,64bit,server): 0.677
C++(MS vs2013): 2.141
C#(MS vs2013): 2.220
D(DMD 2.067
On Monday, 3 August 2015 at 14:43:00 UTC, Tofu Ninja wrote:
How well does that work?
Well, if it exists in the first place, I suppose, it has some
sizable users?
On 8/3/15 11:59 AM, Dicebot wrote:
General advice - simply don't ever use -release unless you are _very_
sure about program correctness (to the point of 100% test coverage and
previous successful debug runs)
So in other words, only release code that has no bugs. Got it ;)
-Steve
On 8/3/15 11:57 AM, Dicebot wrote:
On Monday, 3 August 2015 at 15:50:56 UTC, Steven Schveighoffer wrote:
On 8/3/15 11:18 AM, Dicebot wrote:
On Monday, 3 August 2015 at 14:34:52 UTC, Steven Schveighoffer wrote:
Why do we do this?
Because all asserts must be completely removed in -release
1.
General advice - simply don't ever use -release unless you are
_very_ sure about program correctness (to the point of 100% test
coverage and previous successful debug runs)
On Monday, 3 August 2015 at 15:50:56 UTC, Steven Schveighoffer
wrote:
On 8/3/15 11:18 AM, Dicebot wrote:
On Monday, 3 August 2015 at 14:34:52 UTC, Steven Schveighoffer
wrote:
Why do we do this?
Because all asserts must be completely removed in -release
1. They aren't removed, they are repla
On 03/08/15 02:24, bitwise wrote:
Just stumbled upon this:
https://code.visualstudio.com/
I see support for Rust and Go, but no D.
If you download it, there is a little smiley/frowny in the bottom right
corner for feedback/feature requests.
If I recall correctly it supports TextMate bundles.
On 8/3/15 11:18 AM, Dicebot wrote:
On Monday, 3 August 2015 at 14:34:52 UTC, Steven Schveighoffer wrote:
Why do we do this?
Because all asserts must be completely removed in -release
1. They aren't removed, they are replaced with a nearly useless segfault.
2. If we are going to put something
On Monday, 3 August 2015 at 14:34:52 UTC, Steven Schveighoffer
wrote:
Why do we do this?
Because all asserts must be completely removed in -release
Yet assert(0) effectively mean "unreachable code" (it is actually
defined that way in spec) and thus it is possible to ensure extra
"free" bit o
On Monday, 3 August 2015 at 10:37:43 UTC, Kagamin wrote:
On Saturday, 1 August 2015 at 04:25:07 UTC, Jonathan M Davis
wrote:
You know, it would be _really_ cool if there were an OS out
there that was fully compliant with both the POSIX standard
and ecosystem and the Win32 API such that you coul
On Monday, 3 August 2015 at 14:30:43 UTC, Andrea Fontana wrote:
On Monday, 3 August 2015 at 13:54:51 UTC, HaraldZealot wrote:
You have to write the same amount of code.
It's just one line for each type... Something like:
[...]
Many thanks, it seems like good workaround for my personal use
ca
On Monday, 3 August 2015 at 13:54:51 UTC, HaraldZealot wrote:
On Monday, 3 August 2015 at 13:13:55 UTC, Andrea Fontana wrote:
Why don't you use templates? Something like:
enum ValueType
{
Init,
Min,
Max
}
auto exampleValues(T)()
{
T[ValueType] retVal;
If you compile and run the following code, what happens?
void main()
{
assert(0, "error message");
}
answer: it depends. On OSX, if you compile this like so:
dmd testassert.d
./testassert
You get this message + stack trace:
core.exception.AssertError@testassert.d(3): error message
Not bad
On Sunday, 2 August 2015 at 16:25:18 UTC, Yura wrote:
Dear D coders/developers,
I am just thinking on one project in computational chemistry,
and it is sort of difficult for me to pick up the right
language this project to be written. The project is going to
deal with the generation of the mo
On Monday, 3 August 2015 at 13:13:55 UTC, Andrea Fontana wrote:
Why don't you use templates? Something like:
enum ValueType
{
Init,
Min,
Max
}
auto exampleValues(T)()
{
T[ValueType] retVal;
retVal[ValueType.Init] = T.init;
static if (__traits(compiles,
On Monday, 3 August 2015 at 12:13:15 UTC, HaraldZealot wrote:
I found myself in situation that were good that all types
support `.examplevalues` property in unittest version. This
property will return array of predefined values for specified
type (we can even have some convention like `examplev
On Thursday, 30 July 2015 at 19:38:12 UTC, Joakim wrote:
On Monday, 25 May 2015 at 20:08:48 UTC, Joakim wrote:
[...]
Some good news, I've made progress on the port to Android/ARM,
using ldc's 2.067 branch. Currently, all 46 modules in
druntime and 85 of 88 modules in phobos pass their tests
I found myself in situation that were good that all types support
`.examplevalues` property in unittest version. This property will
return array of predefined values for specified type (we can even
have some convention like `examplevalues[0]` is `init`,
`examplevalues[1]` is `min` (for numerica
On Saturday, 1 August 2015 at 04:25:07 UTC, Jonathan M Davis
wrote:
You know, it would be _really_ cool if there were an OS out
there that was fully compliant with both the POSIX standard and
ecosystem and the Win32 API such that you could run KDE, gnome,
bash, zsh, etc. on it just like on Linu
On 8/2/2015 8:33 AM, David Nadlinger wrote:
Somebody just mentioned Vladimir's great work in a discussion on the Hacker News
front page: https://news.ycombinator.com/item?id=9990763
— David
The title is: Why and how is Hacker News so fast?
On Sunday, 2 August 2015 at 21:17:10 UTC, Jonathan M Davis wrote:
Where distinguishing between + and ~ would likely make a big
difference though is dynamic languages that aren't strict with
types and allow nonsense like "5" + 2.
Using '~' instead of '+' to concatenate strings is just a syntax
On Monday, 3 August 2015 at 06:52:41 UTC, Timon Gehr wrote:
On 08/02/2015 09:02 PM, Max Samukha wrote:
On Sunday, 26 July 2015 at 23:29:18 UTC, Walter Bright wrote:
For example, the '+' operator. Rust traits sez "gee, there's
a +
operator, it's good to go. Ship it!" Meanwhile, you thought
the
On 03-Aug-2015 10:56, Sönke Ludwig wrote:
Am 02.08.2015 um 19:14 schrieb Dmitry Olshansky:
Actually JSON is defined as subset of EMCASCript-262 spec hence it may
not ciontain anything other 64-bit5 IEEE-754 numbers period.
See:
http://www.ecma-international.org/ecma-262/6.0/index.html#sec-terms
Am 02.08.2015 um 19:14 schrieb Dmitry Olshansky:
Actually JSON is defined as subset of EMCASCript-262 spec hence it may
not ciontain anything other 64-bit5 IEEE-754 numbers period.
See:
http://www.ecma-international.org/ecma-262/6.0/index.html#sec-terms-and-definitions-number-value
http://www.e
On 3/08/2015 6:53 p.m., Sebastiaan Koppe wrote:
On Monday, 3 August 2015 at 03:28:26 UTC, Rikki Cattermole wrote:
On 3/08/2015 1:35 p.m., Sebastiaan Koppe wrote:
On Sunday, 2 August 2015 at 14:03:50 UTC, Rikki Cattermole wrote:
Some of things that goes on in the modding world is truely amazing
On Friday, 31 July 2015 at 09:37:10 UTC, Jonathan M Davis wrote:
On Friday, 31 July 2015 at 04:47:20 UTC, Enamex wrote:
Right now docs say that `delete` is getting deprecated but
using it on DMD .067.1 gives no warnings.
There are no warnings because it hasn't actually been
deprecated yet.
[
68 matches
Mail list logo