Re: Optional and NotNull version 0.5.0 - swift optional like and scala option like

2018-08-24 Thread Paul Backus via Digitalmars-d-announce

On Friday, 24 August 2018 at 20:59:34 UTC, aliak wrote:
THis is true. And might be interesting to try out actually. Can 
you access the types in a SumType via index?


I'm thinking because Optional behaves like a range, and I guess 
I'd define a SumType!(T, None), then a rough outline may be:


struct None {}
immutable none = None();

struct(T) {
  SumType(T, None) opt;
  T front() {
return opt[0]; // what to do here?
  }
}

Or I guess I should maybe do it like this?:

return opt.match!(
  (T val) => val,
  (None) => T.init,
);


I think this is probably the best way:

@property T front() {
return opt.match!(
(T val) => val,
(None) {
assert(false, "called .front on an empty range");
return T.init; // for return type inference
}
);
}

You could also do it with `tryMatch` and 
`std.exception.assertNotThrown`. It makes the code a little 
nicer, but involving exceptions at all seemed like unnecessary 
overhead to me.


Re: Optional and NotNull version 0.5.0 - swift optional like and scala option like

2018-08-24 Thread aliak via Digitalmars-d-announce

On Wednesday, 22 August 2018 at 22:49:52 UTC, Paul Backus wrote:

On Wednesday, 22 August 2018 at 22:11:05 UTC, aliak wrote:

On Monday, 20 August 2018 at 19:52:53 UTC, jmh530 wrote:


It's interesting that both sumtype and optional have match 
templates. Maybe scope to combine these projects?


That'd be cool. Optional uses .match on a "some" or "none" 
range, while SumType uses it on a union. So ideas on how to go 
about it?


In theory, Optional(T) could be implemented as a wrapper around 
SumType!(T, None), which would let it reuse SumType's match 
method. I'm not sure if it'd be worth the effort to convert at 
this point, though.


THis is true. And might be interesting to try out actually. Can 
you access the types in a SumType via index?


I'm thinking because Optional behaves like a range, and I guess 
I'd define a SumType!(T, None), then a rough outline may be:


struct None {}
immutable none = None();

struct(T) {
  SumType(T, None) opt;
  T front() {
return opt[0]; // what to do here?
  }
}

Or I guess I should maybe do it like this?:

return opt.match!(
  (T val) => val,
  (None) => T.init,
);






Re: Beta 2.082.0

2018-08-24 Thread Martin Nowak via Digitalmars-d-announce
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512

On 08/17/2018 10:01 PM, Martin Nowak wrote:
> Glad to announce the first beta for the 2.082.0 release, ♥ to the 
> 47 contributors for this release.
> 
> http://dlang.org/download.html#dmd_beta 
> http://dlang.org/changelog/2.082.0.html
> 
> As usual please report any bugs at https://issues.dlang.org

Second Beta live now.
-BEGIN PGP SIGNATURE-

iQIzBAEBCgAdFiEEpzRNrTw0HqEtE8TmsnOBFhK7GTkFAluAW24ACgkQsnOBFhK7
GTn/Dg/8Daattu9zLZL8C7KdEjuMZnJoJk+SeXsFdbDHa3Y1mndRuu+Fq/m1xSCp
gbBcnVedD64N4iLfSP2rvJusbcVR9s7F+Q2YqcYPsa7AKNTjTUMgrqCD71DbFx1l
Zq+HEnOmdS5ZabcHVl9zt29w91Y4uGQXWhKKmxq9l1YCmR4Y7dIW2xYNmNfjuNFQ
c5yQk/+UrLyxQmpiR1g+E/NChUJYwG8fhYFtUDHChSksvCxqZkgUUyONM+oV9g5J
fJ04S0xUSVhf2m++q8TaHBw3NexG0oI/Rs78yLY31l/9BRU6bvgZEd0QBBSyUWRK
c8vx+SvxsGnzgK1N+xOupug1IWHg1fN/nUMmNYm5F2dyHAp0oeW8G/OqAT8DtHYp
xD/Tam+vHaPPq/jl1POPECz2hMtT+yd2wRsL/+2WrO6FiE5l7LayVCmAsLtqqHjn
UplpjhObmt/VstvgaFzobI5+C0EzbJJUwe+S+ErhVFcazud6fjb3SOnwA3cSuJXt
rHi9Jzbwrk+T15JjKF1LZf/+r99Awi9igSRAA3Qa+Qx/CXCu845vyTG0Uodqx65E
2QTS4IItdrR6sNL44w38JJdhfle8O6xFgSX6wLSbJ7GTGVNclTaIMuHi+lW/6ai2
XdmJg/eHoXWzWW0WGq5peb5MeT4OkqGWKe1JhICU+DU5WP7Wmt8=
=BLdX
-END PGP SIGNATURE-


Re: GDC with D frontend 2.081.2

2018-08-24 Thread Pjotr Prins via Digitalmars-d-announce

On Friday, 24 August 2018 at 05:35:13 UTC, Eugene Wissner wrote:
I prepared GDC/GCC 7.3.0 binaries for x86-64 Linux built on 
Ubuntu 18.04:


Thank you, this is very important work! I'll add a gdc package to 
GNU Guix (the packager for GNU) sometime soon.




Bitcoin in D

2018-08-24 Thread zeus via Digitalmars-d-announce
I write code in D to serialize and deserialize bitcoin block 
headers for educations puropseses as i just start with D, i add 
some more function and i upload it to github 
https://github.com/cvsae/bitcoind


Re: LDC 1.11.0

2018-08-24 Thread Joakim via Digitalmars-d-announce

On Friday, 24 August 2018 at 12:21:32 UTC, Uknown wrote:

On Tuesday, 21 August 2018 at 15:31:16 UTC, Joakim wrote:

On Sunday, 19 August 2018 at 10:11:42 UTC, 鲜卑拓跋枫 wrote:

[...]
I tried looking for a RISC-V VPS or dev board recently and 
found basically nothing, just two boards from SiFive that are 
too small or too expensive.


There is the SHAKTI Program by IIT Madras : 
http://shakti.org.in/about.html


I've actually heard of it, what of it? Is someone using it in a 
production environment, or do they have a VPS or dev board? If 
not, academic projects sitting half-finished in some grad 
students' computers somewhere aren't relevant to my questions.


Re: LDC 1.11.0

2018-08-24 Thread Uknown via Digitalmars-d-announce

On Tuesday, 21 August 2018 at 15:31:16 UTC, Joakim wrote:

On Sunday, 19 August 2018 at 10:11:42 UTC, 鲜卑拓跋枫 wrote:

[...]
I tried looking for a RISC-V VPS or dev board recently and 
found basically nothing, just two boards from SiFive that are 
too small or too expensive.


There is the SHAKTI Program by IIT Madras : 
http://shakti.org.in/about.html


Re: GDC with D frontend 2.081.2

2018-08-24 Thread Matthias Klumpp via Digitalmars-d-announce

On Friday, 24 August 2018 at 08:50:22 UTC, Daniel Kozak wrote:
On Fri, Aug 24, 2018 at 10:40 AM Basile B. via 
Digitalmars-d-announce < digitalmars-d-announce@puremagic.com> 
wrote:



[...]
Great news. Best of luck for a wide adoption in the official 
package managers of the linux distributions.


I do not think this will be an issue. I believe as soon as gdc 
will be

part of gcc it will be part of many linux distribution


Indeed. Having GDC merged into GCC is *huge* for the D language. 
It means that pretty much every Linux distribution out there will 
have a supported D compiler available, and this includes 
enterprise distributions like RHEL. Even if enterprise distros 
might not give full support for GDC, it will still be available.
I know from experience that this is something people look at when 
deciding whether using a programming language is viable and can 
be long-time supported in their company, so for D and the public 
image of D, being in GCC is absolutely awesome.


FWIW, Debian already has an up-to-date GDC 8, so does Ubuntu. 
"Unfortunately"[1] for GDC though, the default compiler for D 
stuff in Debian is LDC on most architectures, because it still 
works quite a bit better (as in: more D code can be compiled with 
it).


[1]: Not really, LDC is really good too!


Re: RFC: initial release of dtoh

2018-08-24 Thread Mike Franklin via Digitalmars-d-announce

On Friday, 24 August 2018 at 10:09:07 UTC, Uknown wrote:

This is all very nice. I agree that this kind of thing should 
be a part of the compiler, but I think it should be a compiler 
plugin. If dmd had compiler plugins, I think stuff like this 
and `dpp` would be much nicer to use.


I agree.  We also need compiler plugins for things like this: 
https://github.com/dlang/dmd/pull/6961


Mike


Re: RFC: initial release of dtoh

2018-08-24 Thread Uknown via Digitalmars-d-announce

On Wednesday, 22 August 2018 at 11:01:02 UTC, Mihails wrote:

https://gitlab.com/mihails.strasuns/dtoh

Tool to grab all `extern(C)` declarations in a D module and 
generate C header file based on it. Partially addresses 
https://issues.dlang.org/show_bug.cgi?id=9285 but is intended 
to be much more simple (no C++, no human-readable emphasis).

[...]


This is all very nice. I agree that this kind of thing should be 
a part of the compiler, but I think it should be a compiler 
plugin. If dmd had compiler plugins, I think stuff like this and 
`dpp` would be much nicer to use.


Re: reduxed - Redux for D

2018-08-24 Thread Lurker! (me) via Digitalmars-d-announce

On Friday, 24 August 2018 at 03:47:03 UTC, Jonathan Marler wrote:


 I tried to find my forum posts on this but the post is so old 
I couldn't find it in search.




You mean this?

https://forum.dlang.org/thread/ibwazxrngcsrfolgb...@forum.dlang.org


Re: RFC: initial release of dtoh

2018-08-24 Thread Walter Bright via Digitalmars-d-announce

On 8/22/2018 4:01 AM, Mihails wrote:
In my opinion, this functionality _should_ be part of 
compiler itself, similar to .di generation.


This is not a bad idea.


Re: GDC with D frontend 2.081.2

2018-08-24 Thread Daniel Kozak via Digitalmars-d-announce
On Fri, Aug 24, 2018 at 10:40 AM Basile B. via Digitalmars-d-announce <
digitalmars-d-announce@puremagic.com> wrote:

> On Friday, 24 August 2018 at 05:35:13 UTC, Eugene Wissner wrote:
> > As some of you may know D frontend was merged into GDC some
> > time ago and is up to date. D version currently supported by
> > GDC is 2.081.2
>
> Great news. Best of luck for a wide adoption in the official
> package managers of the linux distributions.
>
> I do not think this will be an issue. I believe as soon as gdc will be
part of gcc it will be part of many linux distribution


Re: GDC with D frontend 2.081.2

2018-08-24 Thread Basile B. via Digitalmars-d-announce

On Friday, 24 August 2018 at 05:35:13 UTC, Eugene Wissner wrote:
As some of you may know D frontend was merged into GDC some 
time ago and is up to date. D version currently supported by 
GDC is 2.081.2


Great news. Best of luck for a wide adoption in the official 
package managers of the linux distributions.





Re: GDC with D frontend 2.081.2

2018-08-24 Thread Daniel Kozak via Digitalmars-d-announce

On Friday, 24 August 2018 at 05:35:13 UTC, Eugene Wissner wrote:
As some of you may know D frontend was merged into GDC some 
time ago and is up to date. D version currently supported by 
GDC is 2.081.2 and it can be found in "gdc-7" and "gdc-8" 
branches. I will say a bit more about GDC development and 
development plans later.


[...]


Btw. there are packages for archlinux on AUR
gdc-8 with d frontend: https://aur.archlinux.org/packages/gdc/
gdc-8-stable with c++ frontend: 
https://aur.archlinux.org/packages/gdc-stable/


Re: GDC with D frontend 2.081.2

2018-08-24 Thread M.M. via Digitalmars-d-announce

On Friday, 24 August 2018 at 05:35:13 UTC, Eugene Wissner wrote:
As some of you may know D frontend was merged into GDC some 
time ago and is up to date.


Really cool, and very much appreciated.

I will say a bit more about GDC development and development 
plans later.


Really looking forward to it.