Re: Blog series to teach and show off D's metaprogramming by creating a JSON serialiser
On Sunday, 3 November 2019 at 21:35:18 UTC, JN wrote: On Sunday, 3 November 2019 at 08:37:07 UTC, SealabJaster wrote: On Sunday, 3 November 2019 at 08:35:42 UTC, SealabJaster wrote: On Friday, 1 November 2019 at 21:14:56 UTC, SealabJaster wrote: ... Sorry, seems it cut out the first half of that reply. New posts are out, and I don't want to spam Announce with new threads, so I'm just replying to this one. #1.1 https://bradley.chatha.dev/Home/Blog?post=JsonSerialiser1_1 #2 https://bradley.chatha.dev/Home/Blog?post=JsonSerialiser2 "This often seems to confuse people at first, especially those coming from other languages" I think what's confusing people is that enum (short for ENUMERATION) is suddenly used like a constant/alias. I don't get why it confuses people. In all languages I know (C, C++, Java, Pascal, etc..) they are used to associate a compile time symbols with some quantities, i.e. the definition of constants. When an enumeration only consists of 1 value, then the enumeration is this value itself.
Re: Blog series to teach and show off D's metaprogramming by creating a JSON serialiser
On Monday, 4 November 2019 at 08:25:11 UTC, Patrick Schluter wrote: On Sunday, 3 November 2019 at 21:35:18 UTC, JN wrote: On Sunday, 3 November 2019 at 08:37:07 UTC, SealabJaster wrote: On Sunday, 3 November 2019 at 08:35:42 UTC, SealabJaster wrote: On Friday, 1 November 2019 at 21:14:56 UTC, SealabJaster wrote: ... Sorry, seems it cut out the first half of that reply. New posts are out, and I don't want to spam Announce with new threads, so I'm just replying to this one. #1.1 https://bradley.chatha.dev/Home/Blog?post=JsonSerialiser1_1 #2 https://bradley.chatha.dev/Home/Blog?post=JsonSerialiser2 "This often seems to confuse people at first, especially those coming from other languages" I think what's confusing people is that enum (short for ENUMERATION) is suddenly used like a constant/alias. I don't get why it confuses people. In all languages I know (C, C++, Java, Pascal, etc..) they are used to associate a compile time symbols with some quantities, i.e. the definition of constants. When an enumeration only consists of 1 value, then the enumeration is this value itself. Yes and no, because the fist case for using enum described at [1] is something very different: This defines a new type X which has values X.A=0, X.B=1, X.C=2: enum X { A, B, C } // named enum [1] https://dlang.org/spec/enum.html And it might be good to change the docs to point out the very often taken use case for declaring a singe compile time constant.
Re: Release D 2.089.0
On Sunday, 3 November 2019 at 13:35:36 UTC, Martin Nowak wrote: Glad to announce D 2.089.0, ♥ to the 44 contributors. This release comes with corrected extern(C) mangling in mixin templates, atomicFetchAdd and atomicFetchSub in core.atomic, support for link driver arguments, better support of LDC in dub, and plenty of other bug fixes and improvements. http://dlang.org/download.html http://dlang.org/changelog/2.089.0.html -Martin Something has changed with core.atomic.cas - it used to work with `null` as the `ifThis` argument, now it throws an AV. Is this intentional? If I use `cast(shared)null` it doesn't throw but if the change was deliberate shouldn't it be mentioned?
Re: Blog series to teach and show off D's metaprogramming by creating a JSON serialiser
On Monday, 4 November 2019 at 08:25:11 UTC, Patrick Schluter wrote: I don't get why it confuses people. In all languages I know (C, C++, Java, Pascal, etc..) they are used to associate a compile time symbols with some quantities, i.e. the definition of constants. When an enumeration only consists of 1 value, then the enumeration is this value itself. If I'm not mistaken `enum` must come from "enumerate" or "enumeration", so it's easy to instinctively think of enums as having multiple possible values; using such a word for a single value is a bit counter-intuitive IMO.
Re: Dlang documentation as CHM file + transform C# project
UPD: https://github.com/a11e99z/DlangChm/tree/master/releases file: Dlang.2_089.chm
D for microservices: ldc, rdmd, dub now available on Alpine x86_64
Hi all, Recently there have been inquiries about support for D on Alpine Linux, a distribution mostly used in combination with Docker to create lightweight container images for microservices. At BPF Korea, we're working on a blockchain written in D, and wanted to be able to easily test and distribute our node using Alpine images, but there was no package for it yet. However, thanks to the work of many contributors before (Joakim Noah, yshui, Petar Kirov/zombinedev, and many others), most of the porting was already done and it was just a matter of fixing a few small issues and and creating the package definitions. A package for `dub` (v1.18.0), `dtools` (ddemangle & rdmd), and `ldc` (v1.18.0) are now available in the `testing` repository of Alpine Linux edge. As `testing` is not enabled by default, you will need to specify the repository (or add it to your `/etc/apk/repositories`) when installing the packages. For example: ``` apk --no-cache add -X http://dl-cdn.alpinelinux.org/alpine/edge/testing ldc ldc-static dtools-rdmd dub ``` This command needs to originate from an `alpine:edge` image as it links with a recent libc and LLVM. If you just want the compiler, you still need to provide `ldc` & `ldc-static` for things to work out of the box. More complete example of how we use it to build a D program, using multi-stage builds: ``` # Build from source FROM alpine:edge AS Builder ARG DUB_OPTIONS RUN apk --no-cache add build-base git RUN apk --no-cache add -X http://dl-cdn.alpinelinux.org/alpine/edge/testing ldc ldc-static dtools-rdmd dub ADD . /root/myproject/ WORKDIR /root/myproject/ # Note: This will redownload your dependencies every time, which doesn't play well with docker # We use submodules for dependencies, hence we have `--skip-registry=all` RUN dub build --compiler=ldc2 ${DUB_OPTIONS} # Runner FROM alpine:edge COPY --from=Builder /root/project/executable /usr/bin/executable RUN apk --no-cache add libexecinfo WORKDIR /root/ ENTRYPOINT [ "/usr/bin/executable" ] ``` `DUB_OPTIONS` can be used to select a build, for example enabling coverage in a CI pipeline. What's next ? 1) There is a pending PR (https://github.com/alpinelinux/aports/pull/12006) to have GDC working on all architectures alpine supports, not just x86_64. 2) Adding a package for gdmd 3) Rebuild packages based on GDC, so that all architectures are supported. 4) Move the packages to community so they are available out of the box. It would be great for it to happen by the end of the month, as the next alpine release would be around end of December according to their schedule, but that depends on how long PR take to be reviewed. 5) A DMD package for x86 and x86_64 shouldn't be hard to make either
Re: When will you announce DConf 2020?
On Sunday, 3 November 2019 at 19:49:48 UTC, Manu wrote: On Sun, Nov 3, 2019 at 8:20 AM Murilo via Digitalmars-d-announce wrote: If you have ideas for an interesting talk, submit a proposal, and perhaps you may have your costs covered? It's great to see people coming from such different parts of the world! Oh, so they cover the costs if I can give an interesting talk? I already had several ideas in mind to speak during DConf but I never imagined that could get my costs covered.
Re: When will you announce DConf 2020?
On 05/11/2019 4:04 PM, Murilo wrote: On Sunday, 3 November 2019 at 19:49:48 UTC, Manu wrote: On Sun, Nov 3, 2019 at 8:20 AM Murilo via Digitalmars-d-announce wrote: If you have ideas for an interesting talk, submit a proposal, and perhaps you may have your costs covered? It's great to see people coming from such different parts of the world! Oh, so they cover the costs if I can give an interesting talk? I already had several ideas in mind to speak during DConf but I never imagined that could get my costs covered. Travel + accommodation as I understand it. But yes that is covered if you do a talk.
Re: When will you announce DConf 2020?
On Tuesday, 5 November 2019 at 03:04:30 UTC, Murilo wrote: Oh, so they cover the costs if I can give an interesting talk? I already had several ideas in mind to speak during DConf but I never imagined that could get my costs covered. If you submit a talk proposal and it's accepted, then you are eligible after the conference to have your travel and accommodation expenses reimbursed. As long as they're reasonable (e.g. no first-class plane tickets or 5-star hotels, etc.).
Re: Release D 2.089.0
On Mon., 4 Nov. 2019, 2:05 am John Chapman via Digitalmars-d-announce, < digitalmars-d-announce@puremagic.com> wrote: > On Sunday, 3 November 2019 at 13:35:36 UTC, Martin Nowak wrote: > > Glad to announce D 2.089.0, ♥ to the 44 contributors. > > > > This release comes with corrected extern(C) mangling in mixin > > templates, atomicFetchAdd and atomicFetchSub in core.atomic, > > support for link driver arguments, better support of LDC in > > dub, and plenty of other bug fixes and improvements. > > > > http://dlang.org/download.html > > http://dlang.org/changelog/2.089.0.html > > > > -Martin > > Something has changed with core.atomic.cas - it used to work with > `null` as the `ifThis` argument, now it throws an AV. Is this > intentional? > > If I use `cast(shared)null` it doesn't throw but if the change > was deliberate shouldn't it be mentioned? > Changes were made because there were a lot of problems with that module... but the (reasonably comprehensive) unit tests didn't reveal any such regressions. We also build+test many popular OSS projects via buildkite, and there weren't problems. Can you show the broken code? >
Re: Release D 2.089.0
On Tuesday, 5 November 2019 at 06:44:29 UTC, Manu wrote: On Mon., 4 Nov. 2019, 2:05 am John Chapman via Digitalmars-d-announce, < digitalmars-d-announce@puremagic.com> wrote: Something has changed with core.atomic.cas - it used to work with `null` as the `ifThis` argument, now it throws an AV. Is this intentional? If I use `cast(shared)null` it doesn't throw but if the change was deliberate shouldn't it be mentioned? Changes were made because there were a lot of problems with that module... but the (reasonably comprehensive) unit tests didn't reveal any such regressions. We also build+test many popular OSS projects via buildkite, and there weren't problems. Can you show the broken code? Sure - this AVs on DMD 2.088 Windows: import core.atomic; void main() { Object a, b = new Object; cas(cast(shared)&a, null, cast(shared)b); }
Re: Release D 2.089.0
On Tuesday, 5 November 2019 at 07:52:12 UTC, John Chapman wrote: Sure - this AVs on DMD 2.088 Windows: import core.atomic; void main() { Object a, b = new Object; cas(cast(shared)&a, null, cast(shared)b); } Sorry, I meant it AVs 2.089, but works on 2.088.