Re: protobuf-d

2020-09-29 Thread Denis Feklushkin via Digitalmars-d-learn
On Tuesday, 29 September 2020 at 15:38:43 UTC, Robert Aron wrote: Hello! I am currently working on "D Language Client Libraries for Google APIs" project[0][1]. The first step was to familiarize myself with protobuf and to generate client library for cloud/vision using python plugin with

Trying to create a trivial 64 bit D Lang DLL on a Windows 10 machine and cant get past linking.

2020-09-29 Thread WhatMeWorry via Digitalmars-d-learn
module user; export { int myAddSeven(int a, int b); } void main() { int total = myAddSeven(2, 3); } dmd -m64 -c user.d module mydll; export extern(D) { int myAddSeven(int a, int b) { return a+b+7; } /* <-- function body */ } dmd -c -shared -m64 mydll.d link mydll.obj

Re: Memory management

2020-09-29 Thread Ola Fosheim Grøstad via Digitalmars-d-learn
On Tuesday, 29 September 2020 at 16:03:39 UTC, IGotD- wrote: That little simple example shows that you don't necessarily need to know things in advance in order to have static lifetimes. However, there are examples where there is no possibility for the compiler to infer when the object goes

Re: Accessing non-binary Unicode properties with std.uni

2020-09-29 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Sep 29, 2020 at 06:14:45PM +, Chloé Kekoa via Digitalmars-d-learn wrote: > On Tuesday, 29 September 2020 at 17:04:51 UTC, H. S. Teoh wrote: > > OTOH, the relevant Unicode data file that contains East_Asian_Width > > data (EastAsianWidth.txt) is relatively straightforward to parse. > >

Re: Deprecation in traits

2020-09-29 Thread Ali Çehreli via Digitalmars-d-learn
On 9/29/20 10:08 AM, Frak wrote: Hi folks, I've this: /Users/frak/dlang/ldc-1.23.0/bin/../import/std/traits.d(3711): Deprecation: function `std.typecons.Nullable!long.Nullable.get_` is deprecated - Implicit conversion with `alias Nullable.get this` will be removed after 2.096. Please use

Re: Memory management

2020-09-29 Thread bachmeier via Digitalmars-d-learn
On Tuesday, 29 September 2020 at 10:57:07 UTC, novice3 wrote: Naive newbie question: Can we have (in theory) in D lang memory management like V lang? Quote: https://github.com/vlang/v/blob/master/doc/docs.md#memory-management "V doesn't use garbage collection or reference counting. The

Re: Deprecation in traits

2020-09-29 Thread Steven Schveighoffer via Digitalmars-d-learn
On 9/29/20 1:08 PM, Frak wrote: Hi folks, I've this: /Users/frak/dlang/ldc-1.23.0/bin/../import/std/traits.d(3711): Deprecation: function `std.typecons.Nullable!long.Nullable.get_` is deprecated - Implicit conversion with `alias Nullable.get this` will be removed after 2.096. Please use

Re: Accessing non-binary Unicode properties with std.uni

2020-09-29 Thread Chloé Kekoa via Digitalmars-d-learn
On Tuesday, 29 September 2020 at 17:04:51 UTC, H. S. Teoh wrote: OTOH, the relevant Unicode data file that contains East_Asian_Width data (EastAsianWidth.txt) is relatively straightforward to parse. In one of my projects, I wrote a little helper program to parse this file and generate a

Re: Safe to remove AA elements while iterating over it via .byKeyValue?

2020-09-29 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Sep 29, 2020 at 09:56:41AM +, ikod via Digitalmars-d-learn wrote: > Hello, > > Sorry if I unintentionally hurt anybody in this thread. > I'll try to implement sane and correct iteration behavior for AA > without noticeable performance loss, and propose it if I succeed. No feelings

Deprecation in traits

2020-09-29 Thread Frak via Digitalmars-d-learn
Hi folks, I've this: /Users/frak/dlang/ldc-1.23.0/bin/../import/std/traits.d(3711): Deprecation: function `std.typecons.Nullable!long.Nullable.get_` is deprecated - Implicit conversion with `alias Nullable.get this` will be removed after 2.096. Please use `.get` explicitly. I'm trying to

Re: Accessing non-binary Unicode properties with std.uni

2020-09-29 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Sep 29, 2020 at 04:22:18PM +, Dukc via Digitalmars-d-learn wrote: > On Monday, 28 September 2020 at 18:23:43 UTC, Chloé Kekoa wrote: > > The documentation of std.uni [1] says that the unicode struct > > provides sets for several binary properties. I am looking for a way > > to query

Re: Accessing non-binary Unicode properties with std.uni

2020-09-29 Thread Dukc via Digitalmars-d-learn
On Monday, 28 September 2020 at 18:23:43 UTC, Chloé Kekoa wrote: The documentation of std.uni [1] says that the unicode struct provides sets for several binary properties. I am looking for a way to query non-binary properties of a character. Is that possible with std.uni or do I need to use a

Re: Memory management

2020-09-29 Thread IGotD- via Digitalmars-d-learn
On Tuesday, 29 September 2020 at 15:47:09 UTC, Ali Çehreli wrote: I am not a language expert but I can't imagine how the compiler knows whether an event will happen at runtime. Imagine a server program allocates memory for a client. Let's say, that memory will be deallocated when the client

Re: Memory management

2020-09-29 Thread Ali Çehreli via Digitalmars-d-learn
On 9/29/20 3:57 AM, novice3 wrote:> Naive newbie question: > > Can we have (in theory) in D lang memory management like V lang? > > Quote: > https://github.com/vlang/v/blob/master/doc/docs.md#memory-management > > "V doesn't use garbage collection or reference counting. The compiler > cleans

protobuf-d

2020-09-29 Thread Robert Aron via Digitalmars-d-learn
Hello! I am currently working on "D Language Client Libraries for Google APIs" project[0][1]. The first step was to familiarize myself with protobuf and to generate client library for cloud/vision using python plugin with protoc. Today I generated the same library with protobuf-d[2]. When I

Re: help: cannot build profdump, dub error (bug): Enforcement failed

2020-09-29 Thread drug via Digitalmars-d-learn
On 9/29/20 4:38 PM, drug wrote: It reproduces. As a workaround you can use ``` dub run profdump ``` this command works as expected, I guess it is a bug of dub Do not execute this command in cloned `profdump` repository - it will fail too. It works if is called from other places, for example

Re: help: cannot build profdump, dub error (bug): Enforcement failed

2020-09-29 Thread drug via Digitalmars-d-learn
On 9/29/20 3:41 PM, mw wrote: I remember I used to able to build this package: https://github.com/AntonMeep/profdump but now, I cannot. Since that package haven't changed for 2 years, maybe it's a dub bug? System information $ uname -a Linux  4.15.0-117-generic #118-Ubuntu SMP Fri Sep 4

Re: Array Slicing

2020-09-29 Thread DMon via Digitalmars-d-learn
On Sunday, 27 September 2020 at 14:25:34 UTC, H. S. Teoh wrote: On Sun, Sep 27, 2020 at 01:59:07PM +, DMon via Digitalmars-d-learn wrote: Are these in the Specification or Phobos? See: https://dlang.org/articles/d-array-article.html T Or in Articles? Thanks, Teoh.

help: cannot build profdump, dub error (bug): Enforcement failed

2020-09-29 Thread mw via Digitalmars-d-learn
I remember I used to able to build this package: https://github.com/AntonMeep/profdump but now, I cannot. Since that package haven't changed for 2 years, maybe it's a dub bug? System information $ uname -a Linux 4.15.0-117-generic #118-Ubuntu SMP Fri Sep 4 20:02:41 UTC 2020 x86_64

Memory management

2020-09-29 Thread novice3 via Digitalmars-d-learn
Naive newbie question: Can we have (in theory) in D lang memory management like V lang? Quote: https://github.com/vlang/v/blob/master/doc/docs.md#memory-management "V doesn't use garbage collection or reference counting. The compiler cleans everything up during compilation. If your V

Re: Safe to remove AA elements while iterating over it via .byKeyValue?

2020-09-29 Thread ikod via Digitalmars-d-learn
Hello, Sorry if I unintentionally hurt anybody in this thread. I'll try to implement sane and correct iteration behavior for AA without noticeable performance loss, and propose it if I succeed. Igor

Re: App hangs, GC.collect() fixet it. Why?

2020-09-29 Thread Bastiaan Veelo via Digitalmars-d-learn
On Monday, 28 September 2020 at 21:58:31 UTC, Steven Schveighoffer wrote: On 9/28/20 3:28 PM, Bastiaan Veelo wrote: I’m leaning towards ditching the memory mapped I/O on the D end, and replace it by regular serialisation/deserialisation. That will be a manual rewrite though, which is a bit of

Re: Safe to remove AA elements while iterating over it via .byKeyValue?

2020-09-29 Thread Mike Parker via Digitalmars-d-learn
On Sunday, 27 September 2020 at 13:02:04 UTC, Per Nordlöw wrote: Is it safe to remove AA-elements from an `aa` I'm iterating over via aa.byKeyValue? I'm currently doing this: foreach (ref kv; aa.byKeyValue) { if (pred(kv.key)) aa.remove(kv.key); // ok? } if