Re: DIP1000: Scoped Pointers

2016-08-12 Thread Marc Schütz via Digitalmars-d-announce

On Thursday, 11 August 2016 at 22:03:02 UTC, Walter Bright wrote:

On 8/11/2016 6:38 AM, Sönke Ludwig wrote:
What would be nice to add is a behavior specification for 
'scope' member
variables (lifetime considered equal or slightly shorter than 
parent object
lifetime). For example the `RefCountedSlice.payload` and 
`count` fields could be
annotated with 'scope' to let the compiler actually guarantee 
that they won't be
accessible in a way that conflicts with their lifetime (i.e. 
the 'scope' return

of 'opIndex' would actually be enforced).


That adds a fair amount of complication I haven't worked 
through.


It can probably be done by lowering:

scope T* payload;

Is conceptually:

private T* payload_;
@property scope T* payload() scope {
return payload_;
}


Re: Beta release DUB 1.0.0-beta.1

2016-06-07 Thread Marc Schütz via Digitalmars-d-announce

On Tuesday, 7 June 2016 at 09:54:19 UTC, Sönke Ludwig wrote:
DUB 1.0.0 is nearing completion. The new feature over 0.9.25 is 
support for single-file packages, which can be used to write 
shebang-style scripts on Posix systems:


#!/usr/bin/env dub
/++ dub.sdl:
name "colortest"
dependency "color" version="~>0.0.3"
+/


Hmm... `/++` is for DDoc. Is this a good idea? Does it matter?


Re: unit-threaded v0.6.13 - tags, autotags and support for integration tests

2016-05-17 Thread Marc Schütz via Digitalmars-d-announce

On Tuesday, 17 May 2016 at 14:22:51 UTC, Meta wrote:

On Tuesday, 17 May 2016 at 09:54:15 UTC, Marc Schütz wrote:

You surely mean "used to be destroy", right?


Good question... If I write this:

struct Test
{
~this() { writeln("destroying Test"); }
}

with (Test())
{
//Do stuff
}

Will Test's destructor be run once we exit the `with` scope?


Yes, it was fixed almost two years ago:

https://github.com/dlang/dmd/pull/3855


Re: unit-threaded v0.6.13 - tags, autotags and support for integration tests

2016-05-17 Thread Marc Schütz via Digitalmars-d-announce

On Monday, 16 May 2016 at 14:39:22 UTC, Meta wrote:

On Monday, 16 May 2016 at 08:37:48 UTC, Atila Neves wrote:

with(immutable Sandbox()) {
writeFile("foo.txt", "foobarbaz\ntoto"); // can also pass 
string[] for lines

shouldExist("foo.txt");
shouldNotExist("bar.txt");
shouldEqualLines("foo.txt", ["foobarbaz", "toto"]);
}


That's a really neat trick and an interesting use of `with`. I 
remember that variables initialized in the argument list of 
`with` used to not be destroyed after exiting the scope, I'm 
guessing that's not the case anymore? I vaguely remember a PR 
that fixed that.


You surely mean "used to be destroy", right? Yes, that's been 
fixed.




Anyway, congratulations on the new release!





Re: Logo for D

2016-01-18 Thread Marc Schütz via Digitalmars-d-announce

On Saturday, 16 January 2016 at 17:55:13 UTC, karabuta wrote:

How do you see it?

http://amazingws.0fees.us/wp-content/uploads/2016/01/dlang2.png

Many variants are on the way.


This URL redirects me to that Google page:
https://support.google.com/accounts/answer/61416

No, I'm not going to enable cookies.


Re: MurmurHash3

2015-12-20 Thread Marc Schütz via Digitalmars-d-announce
On Saturday, 19 December 2015 at 22:15:14 UTC, Guillaume Chatelet 
wrote:
The last version of the code is available here and is feature 
complete AFAICT

https://github.com/gchatelet/murmurhash3_d/blob/master/murmurhash3.d

Last concern, I declared blockSize in bytes where 
std.digest.digest says it should be in bits. Why does it need 
to be bits ? It looks like HMAC (which needs it) is explicitly 
making sure it's always a multiple of 8 bits.


I was the one who introduced it, and I chose bits instead of 
bytes because I didn't want to exclude the possibility that there 
are hashing algos that have a block size not divisible by 8. The 
algorithms are usually described in terms of bits, not bytes, so 
it's not unconceivable that such hash functions exist, though I 
don't know any. (Of course, HMAC wouldn't work with those, but 
that doesn't mean that other algorithms couldn't.)


I'd suggest you change `blockSize` to the number of bits, and 
introduce an enum `blockSizeInBytes` for internal use.


Re: MurmurHash3

2015-12-13 Thread Marc Schütz via Digitalmars-d-announce
On Saturday, 12 December 2015 at 20:12:49 UTC, Guillaume Chatelet 
wrote:

On Saturday, 12 December 2015 at 02:59:21 UTC, Ilya wrote:

Current version is suitable for arrays but not ranges or types.

Few examples:
1. Compute hash of ulong.
2. Compute hash of all elements in matrix column (element are 
in different arrays).


I have created output range API draft 
http://dpaste.dzfl.pl/a24050042758


Ilya


I created https://github.com/gchatelet/murmurhash3_d and 
updated the code a bit.
It conforms to the digest template interface, allows pushing 
ulong[2] and accept ranges.


PR welcome :)


AFAICS this doesn't conform to the digest interface. For example, 
there should be a `finish` method that returns the hash as a 
static array (see the ExampleDigest [1]). More importantly, I 
believe your `put()` implementation only works if it is fed the 
entire data at once. I haven't tested it, but I believe that the 
following two calls will have a different result, while they 
should result in the same hash:


hash.put([1,2,3,4,5,6]);

vs

hash.put([1,2,3]);
hash.put([4,5,6]);

[1] http://dlang.org/phobos/std_digest_digest.html#.ExampleDigest


Re: https everywhere update - dlang.org gets an "A" now!

2015-12-06 Thread Marc Schütz via Digitalmars-d-announce
On Sunday, 6 December 2015 at 14:17:18 UTC, Steven Schveighoffer 
wrote:

On 12/6/15 3:29 AM, Adil Baig via Digitalmars-d-announce wrote:

+1 Same error. This part may help :

This server could not prove that it is *www.dlang.org
*; its security certificate is 
from*dlang.org

*
*
*
You will need a wild-card certificate (cheaper) or a 
certificate that
allows multiple domain names (more expensive, and probably not 
required)

for the cert to work.



Or redirect www.dlang.org to dlang.org

-Steve


That won't help if someone already starts at 
https://www.dlang.org/ .


Re: Andrei's Quora comments on Reddit: "D has no vision. Go is out of its depth. Rust skipped leg day."

2015-11-12 Thread Marc Schütz via Digitalmars-d-announce

On Thursday, 12 November 2015 at 11:55:18 UTC, Namal wrote:
On Wednesday, 11 November 2015 at 19:51:45 UTC, Ali Çehreli 
wrote:

On 11/11/2015 06:42 AM, Namal wrote:


someone was saying that it is possible to call c++ standard
library from D. Is there an example how to do this?


Here is the spec e.g. saying 'extern (C++, std)':

  http://dlang.org/attribute.html#linkage

The following page is about interfacing with C++, which may 
not be up to date:


  http://dlang.org/cpp_interface.html

Others: is it up to date?

Ali


Ok than this is not what I have been thinking off. I thought I 
just can import the standard library of C++ and compile it with 
D compiler...oh well...


You might want to take a look at the Calypso project:
https://github.com/Syniurge/Calypso


Re: Please vote for the DConf logo

2015-11-05 Thread Marc Schütz via Digitalmars-d-announce
On Wednesday, 4 November 2015 at 09:30:30 UTC, Andrei 
Alexandrescu wrote:

3) by anonymous:

PNG: http://imgur.com/GX0HUFI
SVG: https://gist.github.com/anonymous/4ef7282dfec9ab327084



3 (but as others have noted, the font needs to change)


Re: Walter Bright, Scott Meyers and me live on the most watched morning show in Romania

2015-10-17 Thread Marc Schütz via Digitalmars-d-announce
On Saturday, 17 October 2015 at 09:36:08 UTC, Andrei Alexandrescu 
wrote:

D got mentioned as well.

It was an odd succession of events that ultimately had Walter, 
Scott, and myself live at ProTV's morning news.


Walter gives great advice to starting programmers. Here's the 
video (use Google Translate for the text).


http://stirileprotv.ro/ilikeit/smart-things/ilikeit-trei-dintre-cei-mai-mari-programatori-din-lume-invitatii-lui-george-buhnici-sfaturile-romanului-de-la-facebook.html


Wow, you're celebrities :-P This is nice publicity!

Off topic: I was surprised that this website doesn't use any 
diacritics, even though it is completely in Romanian. Is this 
usual practice?


Re: cpp_binder, a not-yet-useful tool for generating C++ bindings

2015-09-22 Thread Marc Schütz via Digitalmars-d-announce
On Tuesday, 22 September 2015 at 04:07:54 UTC, Ola Fosheim 
Grostad wrote:
On Tuesday, 22 September 2015 at 00:31:45 UTC, Paul O'Neil 
wrote:
While D and C++ const don't quite share semantics, they're 
petty close and they mangle the same way.  I do what ZombieDev 
has in the table.


Going from const to mutable like that breaks the type system...


Can pragma(mangle, ...) be used on types? Then we can define a 
C/C++ compatible `HeadConst` template that simulates C/C++ const 
semantics, while still being mangled correctly:


template HeadConst(T) {
pragma(mangle, const(T).mangleof)
struct HeadConst {
// @disable opAssign();
// and whatever else is necessary for head-const
}
}

The constructor would of course need to make sure that it accepts 
only types with non-const indirection.