Re: memcpy() comparison: C, Rust, and D

2017-01-30 Thread Jaded Observer via Digitalmars-d
On Tuesday, 31 January 2017 at 02:01:05 UTC, Walter Bright wrote: On 1/30/2017 5:53 PM, Mike wrote: One in particular prevents me from using D, period! - https://issues.dlang.org/show_bug.cgi?id=14758 The -betterC switch is the approach we intend to take to deal with that issue. You aren't

Re: Optimization problem: bulk Boolean operations on vectors

2016-12-27 Thread Observer via Digitalmars-d
On Friday, 23 December 2016 at 16:15:44 UTC, Andrei Alexandrescu wrote: An interesting problem to look at: https://github.com/dlang/dmd/pull/6352 With respect to bulk operations on vectors, of course I recognize the desire to use high-level code which is portable across platforms. But I

Re: Improvement in pure functions specification

2016-12-23 Thread Observer via Digitalmars-d
On Friday, 23 December 2016 at 11:11:09 UTC, Jonathan M Davis wrote: Conceptually, it makes no sense to be doing any of that sort of thing in a strongly pure function, because at that point, we're really talking functional purity. I understand your points. I had been thinking about purity

Re: Improvement in pure functions specification

2016-12-22 Thread Observer via Digitalmars-d
On Thursday, 22 December 2016 at 18:49:02 UTC, Stefan Koch wrote: On Thursday, 22 December 2016 at 18:04:51 UTC, Observer wrote: (1) Serve as a convenient breakpoint handle in the debugger, perhaps as a kind of centralized this_cannot_ever_happen() function. (2)

Re: Improvement in pure functions specification

2016-12-22 Thread Observer via Digitalmars-d
On Wednesday, 21 December 2016 at 01:05:50 UTC, Jonathan M Davis wrote: On Tuesday, December 20, 2016 19:58:38 Andrei Alexandrescu via Digitalmars-d wrote: On 12/20/16 7:40 PM, Timon Gehr wrote: > On 20.12.2016 23:49, Andrei Alexandrescu wrote: >> https://github.com/dlang/dlang.org/pull/1528 --

Re: UB in D

2016-07-09 Thread Observer via Digitalmars-d
On Sunday, 10 July 2016 at 02:29:15 UTC, Andrei Alexandrescu wrote: You're overthinking this. Undefined is undefined. We're done here. Andrei, you're underthinking this. You're treating it like an elegant academic exercise in an ivory tower, without consideration for the practical realities

Re: UB in D

2016-07-09 Thread Observer via Digitalmars-d
On Saturday, 9 July 2016 at 23:44:07 UTC, H. S. Teoh wrote: On a more technical note, I think eliding the bounds check on the grounds that shifting by negative x is UB is based on a fallacy. Eliding a bounds check should only be done when the compiler has the assurance that the bounds check is

Re: Vision for the D language - stabilizing complexity?

2016-07-09 Thread Observer via Digitalmars-d
On Saturday, 9 July 2016 at 11:49:49 UTC, burjui wrote: I'm sorry, but these examples are horrible, except maybe "constant if", because none give a clue about compile-time and they are not even synonyms. ... You didn't even think about it, just picked the words from a book. It's a process.

Re: Vision for the D language - stabilizing complexity?

2016-07-09 Thread Observer via Digitalmars-d
On Friday, 8 July 2016 at 20:57:39 UTC, Walter Bright wrote: On 7/7/2016 7:25 PM, Andrew Godfrey wrote: "static" is a terribly non-descriptive name That's why it's the go-to keyword for any functionality we can't think of a good name for, or if the name would be too long such as

Re: integral to floating point conversion

2016-07-03 Thread Observer via Digitalmars-d
On Sunday, 3 July 2016 at 13:41:27 UTC, Ola Fosheim Grøstad wrote: On Sunday, 3 July 2016 at 11:49:15 UTC, Andrei Alexandrescu wrote: Well to be more precise here's what I'm looking for. When you compare an integral with a floating point number, the integral is first converted to floating

Re: core.checkedint

2016-06-25 Thread Observer via Digitalmars-d
On Saturday, 25 June 2016 at 01:49:22 UTC, Andrei Alexandrescu wrote: On 06/24/2016 09:42 PM, Andrei Alexandrescu wrote: long x = -1; auto y = array.length + x; I would be hard pressed to acknowledge that as an overflow that needs to be dynamically signaled. And the beauty of two's complement

Re: Garbage Collector

2016-06-18 Thread Observer via Digitalmars-d
On Wednesday, 15 June 2016 at 20:43:55 UTC, deadalnix wrote: Simple exercise. You have 100 000 servers. Your application suddenly become 1% slower. How angry is your CFO when he discovers how many new machines he needs to buy ? Probably not too angry at all. This is still just a 1% budget

Re: pure D JPEG decoder, with progressive JPEG support, public domain

2016-06-18 Thread Observer via Digitalmars-d-announce
On Friday, 17 June 2016 at 14:20:14 UTC, ketmar wrote: ah, i also put `.ptr` to array access to skip bounds checking -- i love to build my code with bounds checking on, and i don't feel that i need it in this decoder -- it should be fairly well-tested. This statement stands out as a problem.

Re: size_t vs uintptr_t

2016-06-18 Thread Observer via Digitalmars-d
On Friday, 17 June 2016 at 15:50:41 UTC, Guillaume Boucher wrote: I was referring to this diff in the pull linked request: -private size_t _alignUp(size_t alignment)(size_t n) +private uintptr_t _alignUp(uintptr_t alignment)(uintptr_t n) size_t is the correct type. There is no reason to

Re: I'd love to see DScript one day ...

2016-06-11 Thread Observer via Digitalmars-d
On Saturday, 11 June 2016 at 09:23:55 UTC, Chris wrote: However, with `DScript` I meant a new scripting language that can draw on the power of D, not necessarily a re-implementation of JS. Adam[1] and ketmar[2] have already worked on D based scripting languages. I wonder, if there is interest

Re: Andrei's list of barriers to D adoption

2016-06-11 Thread Observer via Digitalmars-d
On Tuesday, 7 June 2016 at 23:05:49 UTC, Walter Bright wrote: On 6/7/2016 2:28 PM, Steven Schveighoffer wrote: I can attest that figuring out why something isn't inferred @safe isn't always easy, and the "slap a @safe: tag at the top" isn't always going to help. Having a -safe compiler

Re: Andrei's list of barriers to D adoption

2016-06-11 Thread Observer via Digitalmars-d
On Tuesday, 7 June 2016 at 20:41:21 UTC, Jonathan M Davis wrote: In principle, I think that you're very right that @safe needs to be implemented as a whitelist. Security in general does not work as a blacklist, and I think that @safe has the same problem. The problem is code breakage. Even

Re: Andrei's list of barriers to D adoption

2016-06-06 Thread Observer via Digitalmars-d
On Monday, 6 June 2016 at 21:35:20 UTC, DLearner wrote: IBM PL/I had a _FIXED DECIMAL_ datatype, many many years ago. Could it be used as a model? Not by me. I just checked, and I still have my IBM Fortran IV manuals, but my PL/I (F) Reference Manual seems to have evaporated. On the other

Re: Andrei's list of barriers to D adoption

2016-06-06 Thread Observer via Digitalmars-d
On Monday, 6 June 2016 at 20:56:04 UTC, Observer wrote: On Monday, 6 June 2016 at 20:35:26 UTC, Walter Bright wrote: What I've done, though I know that I won't convince any users of BigDecimal, is use longs and have them represent pennies instead of dollars. Then they're all exact to two

Re: Andrei's list of barriers to D adoption

2016-06-06 Thread Observer via Digitalmars-d
On Monday, 6 June 2016 at 20:35:26 UTC, Walter Bright wrote: What I've done, though I know that I won't convince any users of BigDecimal, is use longs and have them represent pennies instead of dollars. Then they're all exact to two places. I loaned out my copy of TDPL, so I don't have it

Re: Andrei's list of barriers to D adoption

2016-06-06 Thread Observer via Digitalmars-d
On Monday, 6 June 2016 at 19:55:53 UTC, DLearner wrote: If we allow _int foo;_ to declare an integer variable foo, then suggest we have _dec bar(a,b);_ to declare a decimal variable bar with a units in total length, b units of decimal places. D language then defines how (for example) assignment

Re: Andrei's list of barriers to D adoption

2016-06-06 Thread Observer via Digitalmars-d
On Monday, 6 June 2016 at 18:55:22 UTC, Ola Fosheim Grøstad wrote: On Monday, 6 June 2016 at 18:36:37 UTC, Observer wrote: It's more complicated than that. Part of what you need is to be able to declare a variable as (say) having two significant fractional digits, and have the rounding rules

Re: Andrei's list of barriers to D adoption

2016-06-06 Thread Observer via Digitalmars-d
On Monday, 6 June 2016 at 13:10:32 UTC, jmh530 wrote: On Monday, 6 June 2016 at 05:49:53 UTC, Ethan Watson wrote: Echoing the need for decimal support. I won't use it myself, but I know it's critical for finance. You can always round something to two digits if you need to. It's more

Re: Andrei's list of barriers to D adoption

2016-06-06 Thread Observer via Digitalmars-d
On Monday, 6 June 2016 at 15:06:49 UTC, Carl Vogel wrote: I believe a big issue for D, and for any not-mainstream language, is being straight about what works and what doesn't. D is not alone in this, but I often feel I'm sold on features that I later find out are not fully implemented or have

Re: Andrei's list of barriers to D adoption

2016-06-06 Thread Observer via Digitalmars-d
On Monday, 6 June 2016 at 10:35:40 UTC, Jacob Carlborg wrote: On 06/06/16 04:20, Walter Bright wrote: * Tooling is immature and of poorer quality compared to the competition. What is the competition in this case? I write a lot of Perl code, and I swear by perltidy to keep things clean and

Re: Andrei's list of barriers to D adoption

2016-06-06 Thread Observer via Digitalmars-d
On Monday, 6 June 2016 at 08:04:07 UTC, Observer wrote: That said, GNU C++ does provide some support: https://gcc.gnu.org/onlinedocs/gcc/Decimal-Float.html Apparently, I meant GNU C.

Re: Andrei's list of barriers to D adoption

2016-06-06 Thread Observer via Digitalmars-d
On Monday, 6 June 2016 at 07:01:33 UTC, Walter Bright wrote: On 6/5/2016 11:38 PM, rikki cattermole wrote: On 06/06/2016 6:29 PM, Andrei Alexandrescu wrote: On 6/6/16 6:17 AM, Andre Pany wrote: to be usable for companies which want to create economic software, in my opinion D lacks

Re: The Case For Autodecode

2016-06-04 Thread Observer via Digitalmars-d
On Friday, 3 June 2016 at 11:24:40 UTC, ag0aep6g wrote: Finally, this is not the only argument in favor of *keeping* autodecoding, of course. Not wanting to break user code is the big one there, I guess. I'm not familiar with the details of autodecoding, but one thing strikes me about this

Re: Idea: swap with multiple arguments

2016-05-25 Thread Observer via Digitalmars-d
On Wednesday, 25 May 2016 at 17:08:02 UTC, Martin Tschierschke wrote: A newbee question about language design: When I looked first time at Ruby I liked the simple a,b = b,a syntax, so swap. Would it be theoretically possible to allow this? And if not, where does it breaks the general language

Re: Idea: swap with multiple arguments

2016-05-24 Thread Observer via Digitalmars-d
On Tuesday, 24 May 2016 at 08:56:31 UTC, Jonathan M Davis wrote: On Tuesday, May 24, 2016 02:40:24 Observer via Digitalmars-d wrote: If you don't see value in it, you've neglected to learn PostScript. I wasn't aware that postscript was a programming language. All I know about it is that it's

Re: Idea: swap with multiple arguments

2016-05-23 Thread Observer via Digitalmars-d
On Monday, 23 May 2016 at 21:38:54 UTC, Jonathan M Davis wrote: One thing that screams out to me: this should be called rotate, not swap. That would probably be better. My immediate thought on reading Andrei's suggestion for swap was that it would be way too easy to forget what's actually

Re: DMD producing huge binaries

2016-05-20 Thread Observer via Digitalmars-d
On Saturday, 21 May 2016 at 01:29:18 UTC, Observer wrote: My recollection is that successively compiled binaries are rarely directly comparable, because of timestamps embedded by compilers. So I have to ask: are there standard tools to understand enough of the ELF binary format (or whatever,

Re: DMD producing huge binaries

2016-05-20 Thread Observer via Digitalmars-d
On Friday, 20 May 2016 at 21:09:23 UTC, cym13 wrote: It would make binary comparison of libraries and executables difficult which troubles me as comparing hashes is a basics of binary distribution security : you can check that a precompiled binary is legit by recompiling it in the same

Re: Killing the comma operator

2016-05-10 Thread Observer via Digitalmars-d
On Tuesday, 10 May 2016 at 09:52:07 UTC, Mathias Lang wrote: So, following DConf2016, I raised a P.R. to deprecate usage of the comma expressions, except within `for` loops increment [5]. ... It seems there is a reasonable ground to kill it. However, there have been legitimated concern about

Re: Always false float comparisons

2016-05-10 Thread Observer via Digitalmars-d
On Monday, 9 May 2016 at 19:39:52 UTC, tsbockman wrote: Educating programmers who've never studied how to write correct FP code is too complex of a task to implement via compiler warnings. The warnings should be limited to cases that are either obviously wrong, or where the warning is likely

Re: Researcher question – what's the point of semicolons and curly braces?

2016-05-03 Thread Observer via Digitalmars-d
On Tuesday, 3 May 2016 at 20:54:05 UTC, Observer wrote: I have to say, not to be too negative, ... Let me turn that around and suggest something in a positive light. If the researcher wants to investigate social phenomena around programming and gender, then I suspect that a more fruitful

Re: Researcher question – what's the point of semicolons and curly braces?

2016-05-03 Thread Observer via Digitalmars-d
On Tuesday, 3 May 2016 at 18:37:54 UTC, Chris wrote: On Tuesday, 3 May 2016 at 03:48:09 UTC, Joe Duarte wrote: Hi all, I'm a social scientist and I'm preparing some studies on the effects of programming language syntax on learning, motivation to pursue programming, as well as any

Re: Researcher question – what's the point of semicolons and curly braces?

2016-05-03 Thread Observer via Digitalmars-d
On Tuesday, 3 May 2016 at 12:47:42 UTC, qznc wrote: There are three methods to communicate blocks to the compiler: curly braces, significant whitespace (Python, Haskell), or an "end" keyword (Ruby, Pascal). Which one you prefer is subjective. Four methods. Let's not forget statement labels

Re: Opportunity: Software Execution Time Determinism

2016-04-16 Thread Observer via Digitalmars-d
On Friday, 15 April 2016 at 08:03:53 UTC, Nordlöw wrote: On Wednesday, 13 April 2016 at 22:25:12 UTC, Nick B wrote: What is absolute time-determinism in a CPU architectures ? Take the expression "absolute time-determinism" with a grain of salt. I'm saying that eventhough the machine code

Re: Opportunity: Software Execution Time Determinism

2016-04-14 Thread Observer via Digitalmars-d
On Friday, 15 April 2016 at 02:29:12 UTC, Walter Bright wrote: On 4/14/2016 5:28 PM, Observer wrote: Nobody should think that this area can be suitably addressed with just a few language tweaks. It's really a thesis-level topic. My worry would be coming up with a language feature,

Re: Opportunity: Software Execution Time Determinism

2016-04-14 Thread Observer via Digitalmars-d
On Thursday, 14 April 2016 at 22:33:15 UTC, Nordlöw wrote: On Thursday, 14 April 2016 at 01:49:03 UTC, Walter Bright wrote: I'd be interested if you can give an overview of the existing tools/techniques for dealing with this. A combination of time-consuming boring manual reviews (over and

Re: Reset all Members of a Aggregate Instance

2015-12-05 Thread Observer via Digitalmars-d-learn
On Thursday, 3 December 2015 at 21:04:00 UTC, Nordlöw wrote: Given class C { // lots of members } and a function f(C c) { } is there a generic way, perhaps through reflection, to reset (inside f) all members of `c` to their default values? Something along

Re: Persistent list

2015-11-16 Thread Observer via Digitalmars-d
On Monday, 16 November 2015 at 16:58:24 UTC, Lionello Lunesu wrote: If it's RC we want, then @mutable is an axe when what we need is a scalpel. The non-observability comes from the fact the refcount is changed when the caller has lost its (const) reference and constness is a moot point.

Re: Persistent list

2015-11-14 Thread Observer via Digitalmars-d
On Saturday, 14 November 2015 at 16:27:17 UTC, Dicebot wrote: All trouble comes from trying to use physical immutable as logical one while still pretending it gives physical guarantees. Even if existing immutability is not widely applicable, I'd prefer to have narrow applicability over wide

Re: Interesting user mistake

2015-09-04 Thread Observer via Digitalmars-d
On Thursday, 3 September 2015 at 17:15:25 UTC, Enamex wrote: On Thursday, 3 September 2015 at 16:46:30 UTC, Andrei Alexandrescu wrote: we should disallow during tokenization the sequence "=", "+", whitespace. Surely it's not a formatting anyone would aim for, but instead a misspelling of +=.

Re: Array start index

2015-08-03 Thread Observer via Digitalmars-d-learn
On Saturday, 1 August 2015 at 09:35:53 UTC, DLearner wrote: Does the D language set in stone that the first element of an array _has_ to be index zero? Wouldn't starting array elements at one avoid the common 'off-by-one' logic error, it does seem more natural to begin a count at 1. Actually,

Re: Wait, what? What is AliasSeq?

2015-07-08 Thread Observer via Digitalmars-d
On Wednesday, 8 July 2015 at 20:11:16 UTC, deadalnix wrote: Sequence fit the bill. I don't mind using another name that fit the bill as well. Nobody came up with that name yet. I find that naming objects is a key part of programming, and to that end I own one copy of Roget's International

Re: Wait, what? What is AliasSeq?

2015-07-08 Thread Observer via Digitalmars-d
On Thursday, 9 July 2015 at 00:48:40 UTC, Tofu Ninja wrote: Languages with something called a list that is indexable... Java C# Python Perl Tcl (lists are an absolutely fundamental part of this language) Lisp Haskell Icon