Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Joakim via Digitalmars-d

On Saturday, 30 June 2018 at 05:36:52 UTC, Jonathan M Davis wrote:
On Saturday, June 30, 2018 02:34:00 Joakim via Digitalmars-d 
wrote:
On Saturday, 30 June 2018 at 02:23:57 UTC, Jonathan M Davis 
wrote:

> [...]

That's nice, but since you present no arguments other than 
simply stating that it's "valuable" or "a very good idea" 
that's "gone up"- why? who knows? That would require actually 
supplying an argument- the 99.9% of D users who've never 
attended Dconf are unlikely to be persuaded that it's ever 
worth attending DConf or wasting any more time with a language 
that is more focused on blowing time and money on that 
outdated conference format than getting work done on the 
language.


As I stated previously, having people meet in person can be a 
game changer. It gives you a different perspective on people 
and allows for much more efficient communication in many cases. 
Some stuff does work best when communicated online, but a lot 
of stuff works better when you have people in the same place 
discussing things.


It could certainly be argued that we should do more with less 
traditional stuff like birds of a feather sessions or other 
activities that are geared specifically towards folks 
interacting, but the talks convey lots of useful information 
and ideas, and there's a lot of discussions that go on about 
the talks and other topics during the time that talks aren't 
happening. It would be a real loss to the D community if we 
lost that.


As I stated previously and Adam reiterates, then do the actual 
in-person stuff that you find worthwhile and cut out the stuff 
that's "best when communicated online." I completely disagree 
that talks are in the former category and not the latter, 
particularly when a large majority of the scheduled time is spent 
on them.


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Jonathan M Davis via Digitalmars-d
On Saturday, June 30, 2018 02:34:00 Joakim via Digitalmars-d wrote:
> On Saturday, 30 June 2018 at 02:23:57 UTC, Jonathan M Davis wrote:
> > On Saturday, June 30, 2018 02:08:08 Joakim via Digitalmars-d
> >
> > wrote:
> >> [...]
> >
> > The response is that those of us who have gone to dconf have
> > found it to be valuable. It's not just that we're doing what
> > others have done or that we think that it might be a good idea.
> > It's actually been valuable in practice.
> >
> > Honestly, this is this first time that I've ever seen anyone
> > try to argue that conferences like this are a bad idea. My
> > experience has been that it has been a very good idea, and
> > there are plenty of people out there who attend conferences
> > regularly and try to get others to go because of how much value
> > they see in it (and not just for dconf). If anything, the
> > number of conferences that I've been hearing about has gone up,
> > not down, and plenty of new conferences have started up in
> > recent years (e.g. BSD Taiwan started up last year, the OpenZFS
> > guys have started up a at least a couple of related conferences
> > in the last few years, and RustConf is quite new). If you think
> > that it's a bad sign that we have dconf, then that's certainly
> > your choice, but the arguments that you've presented are
> > unlikely to be persuasive to those of us who have actually
> > attended dconf.
>
> That's nice, but since you present no arguments other than simply
> stating that it's "valuable" or "a very good idea" that's "gone
> up"- why? who knows? That would require actually supplying an
> argument- the 99.9% of D users who've never attended Dconf are
> unlikely to be persuaded that it's ever worth attending DConf or
> wasting any more time with a language that is more focused on
> blowing time and money on that outdated conference format than
> getting work done on the language.

As I stated previously, having people meet in person can be a game changer.
It gives you a different perspective on people and allows for much more
efficient communication in many cases. Some stuff does work best when
communicated online, but a lot of stuff works better when you have people in
the same place discussing things.

It could certainly be argued that we should do more with less traditional
stuff like birds of a feather sessions or other activities that are geared
specifically towards folks interacting, but the talks convey lots of useful
information and ideas, and there's a lot of discussions that go on about the
talks and other topics during the time that talks aren't happening. It would
be a real loss to the D community if we lost that.

- Jonathan M Davis



Re: High memory usage in vibe.d application

2018-06-29 Thread rikki cattermole via Digitalmars-d-learn

On 30/06/2018 4:49 AM, Bauss wrote:
I wouldn't really blame the GC. There is a higher chance you're just not 
using it how it's meant to be, especially since it looks like you're 
mixing manual memory management with GC memory.


Let's be honest, I don't think it was meant to live in a container with 
64mb of ram. I just don't think it is kicking in to collect.


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Adam D. Ruppe via Digitalmars-d

On Saturday, 30 June 2018 at 02:23:57 UTC, Jonathan M Davis wrote:
Honestly, this is this first time that I've ever seen anyone 
try to argue that conferences like this are a bad idea.


I argued it (though I don't remember how vigorously) back when 
the kickstarter was done. I still think there's far more useful 
things we could have spent that money on.


So, I literally just got home - as in about 20 minutes ago - from 
a work trip, an organization-wide retreat that consumed this 
whole week (and btw a LOT of money). I'll grant there was some 
value in the powerpoint presentations, but they were a tiny 
minority of the time.


The "talks" of this week were frequently intercut with questions, 
comments, arguments. The plan included various break-out sessions 
that mixed people across teams that don't usually mix in order to 
share more and see the other perspectives.


And, of course, before 9 and after 5, were the parts that most 
people felt were most valuable, just kinda hanging out and yes, 
even doing a little bit of work.


Overall, I'm actually still not sure it was worth the time and 
money that went into it... but there's a good case to be made 
that it was, even limiting it to just the 9-5 parts. But there 
were a few people saying they think it would have been more worth 
it if we cut out even more of the structure, to make the 9-5 more 
resemble the 5-9.




So when we criticize dconf, it is because the official time is 
devoted almost entirely to the most useless part of a meeting - 
the powerpoint presentations. (Like you could have just emailed 
that to me.)


And the powerpoints themselves btw are frequently trash. Really, 
the point of a talk like this is to market something - get people 
interested enough to read your book or use your project or 
whatever. Reading text or code off a slide is really pretty 
pointless, again, you could have just emailed that to me.




But anyway, if we are going to get people together, why not focus 
on the together aspects? Instead of having a traditional talk, 
try doing 5 minutes of talk to market interest in the idea, 
followed by 20 minutes of break-out interactive groups to 
collaboratively explore it, followed by conference share-outs and 
questions from those groups to the whole. And mix up the groups 
too. We did a fair amount of this at my work thing this week and 
I actually thought it worked fairly well. I actually rarely even 
had my computer out all week - we can youtube and email and IRC 
some other time, while in person, let's in person stuff.


Instead of having another talk immediately follow, just have 
some... together time. Make the lunch break 3 hours long instead 
of 1, so people have more of a chance to mingle and organically 
collaborate. You say the best part is what happens after the 
conference... so let's try to bring that after-conference stuff 
TO the conference itself!



If we're going to spend the money, let's not spend it on more 
powerpoints. Let's emphasize the parts you already like better, 
and actually focus on the unique benefits of in-person time.




Re: 64bit DMD on Windows

2018-06-29 Thread rikki cattermole via Digitalmars-d

On 30/06/2018 8:57 AM, Jonathan M Davis wrote:

It could be fixed, even if it's just adding a compiler switch to indicate
that you want it to use the GC to collect memory


Currently leaks memory like crazy.


Re: I have a plan.. I really DO

2018-06-29 Thread Adam D. Ruppe via Digitalmars-d-announce

On Saturday, 30 June 2018 at 03:02:15 UTC, Joakim wrote:

Honestly, Dmitry's posts


The writing style doesn't match the name.


Re: I have a plan.. I really DO

2018-06-29 Thread Joakim via Digitalmars-d-announce

On Friday, 29 June 2018 at 22:54:34 UTC, bachmeier wrote:

On Friday, 29 June 2018 at 07:03:52 UTC, Dmitry Olshansky wrote:

P.S. I mean what you think the future of native code is??? 
Rust? Crystal?? Nim???


The future of native code will be replacing scripting 
languages. D is really good at that task.


This will never happen, doesn't matter how good D is at it, they 
will always be better because they sacrifice performance for ease 
of use.


The future of native code will not be one language. I don't 
know why the discussion always turns to that, because it goes 
against the steady increase in the number of good languages 
that are available. Different folks have different preferences, 
many of us use multiple languages, and our preferences change 
over our lifetimes. These days language interoperability is 
getting so good that "choosing a language" is becoming 
obsolete. If we keep reducing the obstacles to using D, the 
number of users will continue to grow.


Yep, agreed.

WRT donating money, isn't it natural to explain what will be 
done with the money? There's been some movement in the 
direction of transparency. I'll only say there's more to be 
done in that area and leave it at that.


Let me echo this: transparency has historically been a big 
problem for D.  AFAIK, nobody in the broader community was ever 
told that the D foundation money would be used to fund a bunch of 
Romanian interns, it just happened. In the end, it appears to 
have worked out great, but why would anybody donate without being 
given transparency on where the money was going in the first 
place, when it could have ended badly?


I understand Andrei had connections with that Romanian 
university, but some donor might have had connections with a 
Brazilian or Chinese university that might have worked out even 
better. We'll never explore such connections and alternatives 
without transparency.


The current move to fund some IDE work with Opencollective is 
better in that regard, but with no concrete details on what it 
entails, not significantly better:


https://forum.dlang.org/post/pxwxhhbuburvddnha...@forum.dlang.org

Anyway, I don't use such IDEs, so not a reason for me to donate 
anyway.


Honestly, Dmitry's posts starting this thread are incoherent, I'm 
not sure what he was trying to say. If he feels D users should be 
donating much more, he and others need to make clear how that 
money will be spent.


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Joakim via Digitalmars-d

On Saturday, 30 June 2018 at 02:23:57 UTC, Jonathan M Davis wrote:
On Saturday, June 30, 2018 02:08:08 Joakim via Digitalmars-d 
wrote:

[...]


The response is that those of us who have gone to dconf have 
found it to be valuable. It's not just that we're doing what 
others have done or that we think that it might be a good idea. 
It's actually been valuable in practice.


Honestly, this is this first time that I've ever seen anyone 
try to argue that conferences like this are a bad idea. My 
experience has been that it has been a very good idea, and 
there are plenty of people out there who attend conferences 
regularly and try to get others to go because of how much value 
they see in it (and not just for dconf). If anything, the 
number of conferences that I've been hearing about has gone up, 
not down, and plenty of new conferences have started up in 
recent years (e.g. BSD Taiwan started up last year, the OpenZFS 
guys have started up a at least a couple of related conferences 
in the last few years, and RustConf is quite new). If you think 
that it's a bad sign that we have dconf, then that's certainly 
your choice, but the arguments that you've presented are 
unlikely to be persuasive to those of us who have actually 
attended dconf.


That's nice, but since you present no arguments other than simply 
stating that it's "valuable" or "a very good idea" that's "gone 
up"- why? who knows? That would require actually supplying an 
argument- the 99.9% of D users who've never attended Dconf are 
unlikely to be persuaded that it's ever worth attending DConf or 
wasting any more time with a language that is more focused on 
blowing time and money on that outdated conference format than 
getting work done on the language.


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Jonathan M Davis via Digitalmars-d
On Saturday, June 30, 2018 02:08:08 Joakim via Digitalmars-d wrote:
> Simple, D is a collective effort. If the core team wants to waste
> one of its key funding sources in getting a bunch of hobbyists
> together in a room showing off to each other then going on a
> European vacation, completely ignoring how the world and tech has
> changed from back when that could actually be worthwhile, that
> signals to me and others that D is not a serious effort to build
> a viable programming language. Such an egregious waste of
> resources signals that this is just a bunch of boys having fun
> with their toys, only now out on the town in Europe.
>
> I'm not saying that was the intent all along: I suspect that like
> most people and institutions, DConf simply blindly aped what was
> done in the past, which is why conferences still happen. However,
> I'm now presenting arguments for why that doesn't make sense and
> why that outdated ritual is dying off, as Marco notes, and if the
> response is merely, "That's the way things have been done and
> we'll just keep doing it regardless," well, congrats, you just
> explained the thinking for why C and C++ will never be displaced
> by D.

The response is that those of us who have gone to dconf have found it to be
valuable. It's not just that we're doing what others have done or that we
think that it might be a good idea. It's actually been valuable in practice.

Honestly, this is this first time that I've ever seen anyone try to argue
that conferences like this are a bad idea. My experience has been that it
has been a very good idea, and there are plenty of people out there who
attend conferences regularly and try to get others to go because of how much
value they see in it (and not just for dconf). If anything, the number of
conferences that I've been hearing about has gone up, not down, and plenty
of new conferences have started up in recent years (e.g. BSD Taiwan started
up last year, the OpenZFS guys have started up a at least a couple of
related conferences in the last few years, and RustConf is quite new). If
you think that it's a bad sign that we have dconf, then that's certainly
your choice, but the arguments that you've presented are unlikely to be
persuasive to those of us who have actually attended dconf.

- Jonathan M Davis



Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Joakim via Digitalmars-d

On Saturday, 30 June 2018 at 01:52:15 UTC, Jonathan M Davis wrote:
On Saturday, June 30, 2018 01:43:32 Joakim via Digitalmars-d 
wrote:
On Saturday, 30 June 2018 at 01:33:34 UTC, Jonathan M Davis 
wrote:

> On Saturday, June 30, 2018 01:12:10 Joakim via Digitalmars-d
>
> wrote:
>> Yes, this is about those people, who as that blog post 
>> notes, are wasting a ton of money on an outdated ritual 
>> that no longer makes sense. If you believe the core team 
>> and a few key devs like you need to get together once a 
>> year in person and hash things out, then do that as an 
>> offline retreat somewhere, just don't sucker in a bunch of 
>> other paying DConf attendees to help defray your costs.

>>
>> The ultimate question here is what is the best use of the 
>> money that's being expended every year at DConf? Is that 
>> money best spent mostly on hotel/conference rooms and 
>> airline tickets for marginal benefit to most or on actually 
>> getting shit done? I think it's obvious that the model I've 
>> sketched out to Mike above would get a _lot_ more done.

>
> A lot of people would disagree with you. If you don't want 
> to go, then don't go. If others don't want to go, then they 
> don't have to go. No one is being forced to go. There are 
> clearly plenty of folks interested in going to dconf, and I 
> expect that it will continue to happen so long as there is 
> such interest. If folks aren't interested, then they won't 
> show up, and if attendance is too low, then presumably, 
> dconf won't be held anymore. However, the interest is 
> clearly there even if you aren't interested, and I don't 
> understand why you would be trying to get folks to stop 
> going when they're very much interested in going and see 
> value in doing so. If all you care about is being able to 
> get online content, then just watch the videos online.


My point is obvious from the arguments I've made, including 
the one you just responded to while ignoring the substance of 
the argument. And not that many people are actually interested 
in attending DConf as presently run, I counted what, maybe 
100-150 people at the one in Munich last month?


If you're going to keep ignoring Marco's and my arguments and 
simply repeatedly state that it's worth it for those who 
attend despite all the flaws, then there's no point in 
discussing it. Clearly the current conference format is like a 
religious ritual for you then, something that must be blindly 
done regardless of any considerations of value.


Those of us who take the time and spend the money to go to 
dconf consider it worth the expenditure, or we wouldn't take 
the time or spend the money to go. It's our money to spend, and 
we see real value in what we get out of it, or we wouldn't keep 
going. If you don't agree with us, fine, but I don't see how it 
makes sense to try and talk us out of doing what we see value 
in doing. If you want to spend your time and money on something 
else, then do so.


Simple, D is a collective effort. If the core team wants to waste 
one of its key funding sources in getting a bunch of hobbyists 
together in a room showing off to each other then going on a 
European vacation, completely ignoring how the world and tech has 
changed from back when that could actually be worthwhile, that 
signals to me and others that D is not a serious effort to build 
a viable programming language. Such an egregious waste of 
resources signals that this is just a bunch of boys having fun 
with their toys, only now out on the town in Europe.


I'm not saying that was the intent all along: I suspect that like 
most people and institutions, DConf simply blindly aped what was 
done in the past, which is why conferences still happen. However, 
I'm now presenting arguments for why that doesn't make sense and 
why that outdated ritual is dying off, as Marco notes, and if the 
response is merely, "That's the way things have been done and 
we'll just keep doing it regardless," well, congrats, you just 
explained the thinking for why C and C++ will never be displaced 
by D.


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Jonathan M Davis via Digitalmars-d
On Saturday, June 30, 2018 01:43:32 Joakim via Digitalmars-d wrote:
> On Saturday, 30 June 2018 at 01:33:34 UTC, Jonathan M Davis wrote:
> > On Saturday, June 30, 2018 01:12:10 Joakim via Digitalmars-d
> >
> > wrote:
> >> Yes, this is about those people, who as that blog post notes,
> >> are wasting a ton of money on an outdated ritual that no
> >> longer makes sense. If you believe the core team and a few key
> >> devs like you need to get together once a year in person and
> >> hash things out, then do that as an offline retreat somewhere,
> >> just don't sucker in a bunch of other paying DConf attendees
> >> to help defray your costs.
> >>
> >> The ultimate question here is what is the best use of the
> >> money that's being expended every year at DConf? Is that money
> >> best spent mostly on hotel/conference rooms and airline
> >> tickets for marginal benefit to most or on actually getting
> >> shit done? I think it's obvious that the model I've sketched
> >> out to Mike above would get a _lot_ more done.
> >
> > A lot of people would disagree with you. If you don't want to
> > go, then don't go. If others don't want to go, then they don't
> > have to go. No one is being forced to go. There are clearly
> > plenty of folks interested in going to dconf, and I expect that
> > it will continue to happen so long as there is such interest.
> > If folks aren't interested, then they won't show up, and if
> > attendance is too low, then presumably, dconf won't be held
> > anymore. However, the interest is clearly there even if you
> > aren't interested, and I don't understand why you would be
> > trying to get folks to stop going when they're very much
> > interested in going and see value in doing so. If all you care
> > about is being able to get online content, then just watch the
> > videos online.
>
> My point is obvious from the arguments I've made, including the
> one you just responded to while ignoring the substance of the
> argument. And not that many people are actually interested in
> attending DConf as presently run, I counted what, maybe 100-150
> people at the one in Munich last month?
>
> If you're going to keep ignoring Marco's and my arguments and
> simply repeatedly state that it's worth it for those who attend
> despite all the flaws, then there's no point in discussing it.
> Clearly the current conference format is like a religious ritual
> for you then, something that must be blindly done regardless of
> any considerations of value.

Those of us who take the time and spend the money to go to dconf consider it
worth the expenditure, or we wouldn't take the time or spend the money to
go. It's our money to spend, and we see real value in what we get out of it,
or we wouldn't keep going. If you don't agree with us, fine, but I don't see
how it makes sense to try and talk us out of doing what we see value in
doing. If you want to spend your time and money on something else, then do
so.

- Jonathan M Davis



Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Joakim via Digitalmars-d

On Saturday, 30 June 2018 at 01:33:34 UTC, Jonathan M Davis wrote:
On Saturday, June 30, 2018 01:12:10 Joakim via Digitalmars-d 
wrote:
Yes, this is about those people, who as that blog post notes, 
are wasting a ton of money on an outdated ritual that no 
longer makes sense. If you believe the core team and a few key 
devs like you need to get together once a year in person and 
hash things out, then do that as an offline retreat somewhere, 
just don't sucker in a bunch of other paying DConf attendees 
to help defray your costs.


The ultimate question here is what is the best use of the 
money that's being expended every year at DConf? Is that money 
best spent mostly on hotel/conference rooms and airline 
tickets for marginal benefit to most or on actually getting 
shit done? I think it's obvious that the model I've sketched 
out to Mike above would get a _lot_ more done.


A lot of people would disagree with you. If you don't want to 
go, then don't go. If others don't want to go, then they don't 
have to go. No one is being forced to go. There are clearly 
plenty of folks interested in going to dconf, and I expect that 
it will continue to happen so long as there is such interest. 
If folks aren't interested, then they won't show up, and if 
attendance is too low, then presumably, dconf won't be held 
anymore. However, the interest is clearly there even if you 
aren't interested, and I don't understand why you would be 
trying to get folks to stop going when they're very much 
interested in going and see value in doing so. If all you care 
about is being able to get online content, then just watch the 
videos online.


My point is obvious from the arguments I've made, including the 
one you just responded to while ignoring the substance of the 
argument. And not that many people are actually interested in 
attending DConf as presently run, I counted what, maybe 100-150 
people at the one in Munich last month?


If you're going to keep ignoring Marco's and my arguments and 
simply repeatedly state that it's worth it for those who attend 
despite all the flaws, then there's no point in discussing it. 
Clearly the current conference format is like a religious ritual 
for you then, something that must be blindly done regardless of 
any considerations of value.


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Jonathan M Davis via Digitalmars-d
On Saturday, June 30, 2018 01:12:10 Joakim via Digitalmars-d wrote:
> Yes, this is about those people, who as that blog post notes, are
> wasting a ton of money on an outdated ritual that no longer makes
> sense. If you believe the core team and a few key devs like you
> need to get together once a year in person and hash things out,
> then do that as an offline retreat somewhere, just don't sucker
> in a bunch of other paying DConf attendees to help defray your
> costs.
>
> The ultimate question here is what is the best use of the money
> that's being expended every year at DConf? Is that money best
> spent mostly on hotel/conference rooms and airline tickets for
> marginal benefit to most or on actually getting shit done? I
> think it's obvious that the model I've sketched out to Mike above
> would get a _lot_ more done.

A lot of people would disagree with you. If you don't want to go, then don't
go. If others don't want to go, then they don't have to go. No one is being
forced to go. There are clearly plenty of folks interested in going to
dconf, and I expect that it will continue to happen so long as there is such
interest. If folks aren't interested, then they won't show up, and if
attendance is too low, then presumably, dconf won't be held anymore.
However, the interest is clearly there even if you aren't interested, and I
don't understand why you would be trying to get folks to stop going when
they're very much interested in going and see value in doing so. If all you
care about is being able to get online content, then just watch the videos
online.

- Jonathan M Davis



Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Joakim via Digitalmars-d

On Friday, 29 June 2018 at 19:50:32 UTC, Jonathan M Davis wrote:
On Friday, June 29, 2018 11:54:48 Joakim via Digitalmars-d 
wrote:
On Friday, 29 June 2018 at 11:32:13 UTC, Jonathan M Davis 
wrote:

> On Friday, June 29, 2018 10:50:52 Joakim via Digitalmars-d
>
> wrote:
>> I coincidentally just read this blog post, that summarizes 
>> a lot of my thoughts against conferences and meetups:

>>
>> https://marco.org/2018/01/17/end-of-conference-era
>>
>> Maybe a good first step would be a mostly online DConf 
>> geared towards Asian timezones? I could help out with 
>> arranging those online talks.

>
> That article seems to pre-suppose that the only benefit from 
> conferences is the talks. A _lot_ of good comes from having 
> a bunch of the key developers in the same place for a few 
> days where they can talk in person.


It "pre-supposes" nothing, points like yours are specifically 
addressed:


"But all of that media can’t really replace the socializing, 
networking, and simply fun that happened as part of (or 
sometimes despite) the conference formula."


Well, then I clearly read over it too quickly, but regardless, 
I think that you're going to have a hard time convincing the 
folks that attend dconf that meeting in person is not highly 
valuable, and for those who aren't there in person and only 
care about the talks, the talks are livestreamed and then made 
available separated out later. I don't see how trying to kill 
off the in-person aspect of things makes it any worse for those 
online, and I can say from experience that meeting in person 
can be a game changer. It gives you a very different 
perspective on someone if you've actually talked with them in 
person, and there's lots of communication that works far better 
that way. dconf is valuable for both the talks and the 
communication that happens before, between, and after them. And 
regardless of its location, I would hate to see it stop 
happening or stop being an actual, physical conference. Much as 
I prefer it when it's closer to where I live so that the travel 
time and expenses are lower, I've gone even when it's been 
halfway around the world, and I wasn't speaking (and thus 
wasn't reimbursed), and I will continue to do so. And I hate 
flying.


I honestly don't see how convincing folks to do just online 
videos instead of meeting in purpose and recording the talks is 
any kind of improvement. At best, it could be argued that if 
folks could give their talks from home that the travel expenses 
would be avoided, but that's not even vaguely worth the loss of 
being able to have most of the core devs and many D enthusiasts 
meet and talk in the same place for a few days - even if 
several hours of that time is spent listening to talks that 
could arguably have been done from home.


As I just told Mike, if you can't defend wasting time watching 
talks together, then do all those things you mention without the 
talks. And simply stating that the in-person talks are "valuable" 
is no defense.


If you don't want to show up in person, then just watch the 
livestream and don't show up. The rest of us actually want to 
show up in person.


I have never shown up in person, I suspect I never will.

I feel sorry for those who want to come but can't afford to (be 
it due to the time required or the money required), but they 
wouldn't be any better off if everyone were livestreaming their 
talks from home instead of a central location that they 
couldn't afford to go to.


This is not about them, as you say, they can just watch the talks 
online either way.


Many of us pay to go to dconf and consider the money very well 
spent.


Yes, this is about those people, who as that blog post notes, are 
wasting a ton of money on an outdated ritual that no longer makes 
sense. If you believe the core team and a few key devs like you 
need to get together once a year in person and hash things out, 
then do that as an offline retreat somewhere, just don't sucker 
in a bunch of other paying DConf attendees to help defray your 
costs.


The ultimate question here is what is the best use of the money 
that's being expended every year at DConf? Is that money best 
spent mostly on hotel/conference rooms and airline tickets for 
marginal benefit to most or on actually getting shit done? I 
think it's obvious that the model I've sketched out to Mike above 
would get a _lot_ more done.


Re: 64bit DMD on Windows

2018-06-29 Thread pedro6655 via Digitalmars-d
I think you should consult this matter with 
https://mailhelp.net/yahoo-support/. they will definitely solve 
your issue. Whenever I faced any issue, every time I consult with 
them. So I am suggesting their name to you.


Re: Call different member functions on object sequence with a generic handler function?

2018-06-29 Thread Ali Çehreli via Digitalmars-d-learn

On 06/29/2018 02:11 PM, Timoses wrote:

>  How would one print the address of the object then though?
> Since  is the address of the reference' types stack location.

Casting the reference to void* produces the address of the object:

import std.stdio;

class C {
int i;
}

void main() {
auto r = new C();
writeln("Reference is at ", );
writeln("Object is at", cast(void*)r);
writeln("Member is at", );
}

Sample output:

Reference is at 7FFE735E6698
Object is at7F78F02B0060
Member is at7F78F02B0070

Ali



Re: Call different member functions on object sequence with a generic handler function?

2018-06-29 Thread Ali Çehreli via Digitalmars-d-learn

On 06/29/2018 02:40 PM, Robert M. Münch wrote:
> How does it work if one of the members takes an argument that is deduced
> inside the handler function?
>
>
> On 2018-06-29 18:05:00 +, Ali ‡ehreli said:
>
>> Passing a lambda or a string mixin:
>>
>> import std.stdio;
>>
>> class C {
>>  void A() {
>>  writeln(__FUNCTION__);
>>  }
>>
>>  void B() {
>>  writeln(__FUNCTION__);
>>  }
>
> void C(bool flag) {
>  writln(__FUNCTION__):
> }

So the others still don't have a parameter?

It's not clear how the general function should know what member function 
is being passed. One way is to check the signature of the lambda and 
decide to pass the flag or not. The other way is to always pass the flag 
but the caller does not use it.


import std.stdio;

class C {
void A() {
writeln(__FUNCTION__);
}

void B() {
writeln(__FUNCTION__);
}

void C(bool flag) {
writeln(__FUNCTION__);
}
}

void handler(alias func)(C[] cs) {
bool flag;
foreach (c; cs) {
func(c, flag); // Always passes the flag
}
}

void main() {
auto cs = [ new C(), new C() ];

// flag is used only sometimes
handler!((o, flag) => o.A())(cs);
handler!((o, flag) => o.B())(cs);
handler!((o, flag) => o.C(flag))(cs);
}

But it started to feel unnatural at this point. What is the exact use 
case? Perhaps there are better ways...


Ali



Re: Call different member functions on object sequence with a generic handler function?

2018-06-29 Thread Basile B. via Digitalmars-d-learn

On Friday, 29 June 2018 at 16:44:36 UTC, Robert M. Münch wrote:

I hope this is understandable... I have:

class C {
void A();
void B();
void C();
}

I'm iterating over a set of objects of class C like:

foreach(obj; my_selected_objs){
...
}

The iteration and code before/afterwards always looks the same, 
I need this iteration for many of the memember functions like 
C.A() and C.B(), etc.


foreach(obj; my_selected_objs){
...
obj.A|B|C()
...
}

So, how can I write a generic handler that does the iteration, 
where I can specify which member function to call?


void do_A() {
handler(C.A()); ???
}

void do_B() {
handler(C.B()); ???
}

handler(???){
foreach(obj: my_selected_objs){
???
}
}

Viele Grüsse.


Using opDispatch we can manage to get a voldemort able to resolve 
the member func A, B or C etc.


---
import std.stdio;

class C
{
void A(){writeln(__FUNCTION__);}
void B(int i){writeln(__FUNCTION__, " ", i);}
}

auto handler(T)(T t)
{
struct Handler
{
auto opDispatch(string member, Args...)(Args args)
{
import std.algorithm.iteration : each;
mixin( `t.each!(a => a.` ~ member ~ `(args));` );
}
}
Handler h;
return h;
}

void main()
{
auto cs = [new C(), new C()];
handler(cs).A();
cs.handler.B(42); // UFCS style
}
---

which results a very natural expression.


Re: 64bit DMD on Windows

2018-06-29 Thread H. S. Teoh via Digitalmars-d
On Fri, Jun 29, 2018 at 11:41:41PM +, SonicFreak94 via Digitalmars-d wrote:
> On Friday, 29 June 2018 at 20:57:24 UTC, Jonathan M Davis wrote:
> > [...]
> > It could be fixed, even if it's just adding a compiler switch to
> > indicate that you want it to use the GC to collect memory, because
> > you're going to run out of memory if you don't. As I understand it,
> > the compiler already can have that turned on internally. It's just
> > that it hurt compilation times enough to do so that it's been left
> > off - which makes sense for many, many cases, but is a definite
> > problem when your project is large enough or doing enough CTFE that
> > compiling it causes it to run out of memory.

This has been a showstopper for me on low-memory machines. If I hadn't
been using a high-memory system when I first tried out D, I might have
just walked away.

This *needs* to be an option.

Though the last time I tried compiling DMD with the GC enabled, it
segfaulted on me, so there may be bugs that need to be fixed in order
for this to work.


[...]
> I managed to get around this issue by using LDC to compile a test
> project, but the memory usage was insane. It used more than 4GB of
> memory. I would rather have slower compile times, personally. I bet
> letting the GC do its job and free memory is less time consuming than
> letting the compiler eventually run out of memory, halt, and leave me
> to scramble to free up system memory so that I can try again.

Absolutely agree.  As I said, this issue has been a showstopper for me
on low-memory machines; it basically makes D unusable. (And one of the
environments I was trying to use dmd in is a remote colocated server for
which adding additional memory is not a practical option.)


T

-- 
It only takes one twig to burn down a forest.


Re: 64bit DMD on Windows

2018-06-29 Thread SonicFreak94 via Digitalmars-d

On Friday, 29 June 2018 at 20:57:24 UTC, Jonathan M Davis wrote:

[...]

It could be fixed, even if it's just adding a compiler switch 
to indicate that you want it to use the GC to collect memory, 
because you're going to run out of memory if you don't. As I 
understand it, the compiler already can have that turned on 
internally. It's just that it hurt compilation times enough to 
do so that it's been left off - which makes sense for many, 
many cases, but is a definite problem when your project is 
large enough or doing enough CTFE that compiling it causes it 
to run out of memory. What the best way to handle ti is, I 
don't know, since we do want the compilation speed in the 
typical case, but we also don't want to run out of memory. A 
compiler switch would be an easy out but less than ideal.


[...]


I managed to get around this issue by using LDC to compile a test 
project, but the memory usage was insane. It used more than 4GB 
of memory. I would rather have slower compile times, personally. 
I bet letting the GC do its job and free memory is less time 
consuming than letting the compiler eventually run out of memory, 
halt, and leave me to scramble to free up system memory so that I 
can try again.


Re: I have a plan.. I really DO

2018-06-29 Thread bachmeier via Digitalmars-d-announce

On Friday, 29 June 2018 at 20:13:07 UTC, Ecstatic Coder wrote:

Have a look at Crystal's Github project, you will see that 
Crystal, still in development and quite far from its 1.0 mile 
version (= despite no parallism and windows support, etc) 
ALREADY has 11206 stars, 881 forks and 292 contributors :


https://github.com/crystal-lang/crystal

Not bad for a language in its 0.25 version and first released 
in June 2014 (4 years), especially compared to D in its 2.0 
version and first released in December 2001 (16 years), whose 
official compiler has 1806 stars, 452 forks and 168 
contributors :


https://github.com/dlang/dmd

If those numbers means anything, I think its that Crystal is 
probably getting popularity much quicker than D, and honestly, 
after having tried it, I think it's really deserved, even if I 
agree that there are still many things that remain to be 
implemented before it's really ready for an official 
"production-ready" 1.0 release.


Do you by chance work as a manager? Managers like comparisons 
that involve one number, with a higher number being better. I 
don't know what can be learned about D from that comparison and I 
don't think anyone else does either.


Re: I have a plan.. I really DO

2018-06-29 Thread bachmeier via Digitalmars-d-announce

On Friday, 29 June 2018 at 07:03:52 UTC, Dmitry Olshansky wrote:

P.S. I mean what you think the future of native code is??? 
Rust? Crystal?? Nim???


The future of native code will be replacing scripting languages. 
D is really good at that task.


The future of native code will not be one language. I don't know 
why the discussion always turns to that, because it goes against 
the steady increase in the number of good languages that are 
available. Different folks have different preferences, many of us 
use multiple languages, and our preferences change over our 
lifetimes. These days language interoperability is getting so 
good that "choosing a language" is becoming obsolete. If we keep 
reducing the obstacles to using D, the number of users will 
continue to grow.


WRT donating money, isn't it natural to explain what will be done 
with the money? There's been some movement in the direction of 
transparency. I'll only say there's more to be done in that area 
and leave it at that.


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Walter Bright via Digitalmars-d

On 6/29/2018 2:34 AM, Mike Franklin wrote:
I doubt there'd be any problem have DConf anywhere in the world as long is it is 
properly funded.  Who in Asia would be willing to sponsor it?



Mike is right on both counts.


Re: I have a plan.. I really DO

2018-06-29 Thread Walter Bright via Digitalmars-d-announce

On 6/29/2018 1:43 AM, Ecstatic Coder wrote:
Game development is a very special use case, but personally I don't think that 
many of those who use C++ for close-to-the-metal development should be that much 
interested in switching to D, because most of its standard libraries depend on 
the presence of a GC...


DasBetterC resolves that, though the library issue remains.



And Rust, despite it has perfect C/C++-like performance


D has perfect C/C++ like performance, if you code it the same way.


Re: Call different member functions on object sequence with a generic handler function?

2018-06-29 Thread Robert M. Münch via Digitalmars-d-learn
How does it work if one of the members takes an argument that is 
deduced inside the handler function?



On 2018-06-29 18:05:00 +, Ali ‡ehreli said:


Passing a lambda or a string mixin:

import std.stdio;

class C {
 void A() {
 writeln(__FUNCTION__);
 }

 void B() {
 writeln(__FUNCTION__);
 }


void C(bool flag) {
writln(__FUNCTION__):
}


}

void handler(alias func)(C[] cs) {
 foreach (c; cs) {
 func(c);


func(c)(flag);


 }
}

void handler_2(string func)(C[] cs) {
 foreach (c; cs) {
 enum expr = "c." ~ func ~ "();";
 mixin(expr);
 }
}

void main() {
 auto cs = [ new C(), new C() ];

 handler!(o => o.A())(cs);


How to get the parameter spec into the lambda?


 handler!(o => o.B())(cs);

 handler_2!"A"(cs);
 handler_2!"B"(cs);
}

Ali



--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster



Re: Call different member functions on object sequence with a generic handler function?

2018-06-29 Thread Timoses via Digitalmars-d-learn

On Friday, 29 June 2018 at 20:28:55 UTC, Timoses wrote:

On Friday, 29 June 2018 at 16:44:36 UTC, Robert M. Münch wrote:

Trying to fiddle around a bit with delegates.. But why is the 
context for delegates not working for classes??


Aw.. Class = reference type so

class A { }
struct B { }
void delegate() del;
A a = new A();
del.ptr = a;   // NOT its address, as that would be the address 
of the reference on the stack

B b = B();
del.ptr =// value type => address of object in stack

... How would one print the address of the object then though?
Since  is the address of the reference' types stack location.

cast(void*)a

would be on solution I guess.


Re: I have a plan.. I really DO

2018-06-29 Thread Ecstatic Coder via Digitalmars-d-announce

On Friday, 29 June 2018 at 20:51:56 UTC, bauss wrote:

On Friday, 29 June 2018 at 20:13:07 UTC, Ecstatic Coder wrote:

On Friday, 29 June 2018 at 19:46:06 UTC, bauss wrote:

On Friday, 29 June 2018 at 19:42:56 UTC, Ecstatic Coder wrote:

On Friday, 29 June 2018 at 17:09:44 UTC, JN wrote:
On Friday, 29 June 2018 at 08:43:34 UTC, Ecstatic Coder 
wrote:
Once Crystal integrates parallelism (at 1.0), it should 
become de facto one of the best alternative to Go, Java, 
C#, etc, because it's actually "Go-made-right". For 
instance it's genericity system works well, and its type 
inference system natively support union types.




Except it has no Windows support and doesn't look like it 
will happen anytime soon. Some people might be living in a 
UNIX bubble, but Windows is a big market, and a language 
won't make it big without Windows support.


Right :)

But remember that Crystal is still in its infancy, as it 
hasn't reached its 1.0 version yet.


Parallelism is on its way, and Windows support too...

Don't forget that nowadays many (can I say most ?) servers 
are based on unix variants, so their platform support order 
looks perfectly fine and logical to me.


Actually a large share of servers run Windows Server and/or 
Azure servers running Windows too.


It's not logical to not support both.

D already has that advantage supporting pretty much every 
platform you can think of.


I agree, but you must compare what is comparable.

Have a look at Crystal's Github project, you will see that 
Crystal, still in development and quite far from its 1.0 mile 
version (= despite no parallism and windows support, etc) 
ALREADY has 11206 stars, 881 forks and 292 contributors :


https://github.com/crystal-lang/crystal

Not bad for a language in its 0.25 version and first released 
in June 2014 (4 years), especially compared to D in its 2.0 
version and first released in December 2001 (16 years), whose 
official compiler has 1806 stars, 452 forks and 168 
contributors :


https://github.com/dlang/dmd

If those numbers means anything, I think its that Crystal is 
probably getting popularity much quicker than D, and honestly, 
after having tried it, I think it's really deserved, even if I 
agree that there are still many things that remain to be 
implemented before it's really ready for an official 
"production-ready" 1.0 release.


Yes. Crystal is a fantastic language already.

As someone who uses many languages, I tend to just use what 
does the task at hand best.


I'm sure I'll be able to find some usage for Crystal when it's 
production ready, but it doesn't mean I'll abandon D. That'll 
probably never happen, especially considering I have a lot of 
projects written in D with thousands of lines of code.


Same for me :)


Re: 64bit DMD on Windows

2018-06-29 Thread Jonathan M Davis via Digitalmars-d
On Friday, June 29, 2018 20:23:05 bauss via Digitalmars-d wrote:
> On Friday, 29 June 2018 at 16:11:56 UTC, Seb wrote:
> > I hope we manage to ship it with the official releases soon.
>
> I can't wait.
>
> Honestly, a compiler should never run out of memory and it's a
> major issue that DMD does it.
>
> Regardless of that it has fast compilation, it should never run
> out of memory.
>
> I assume it's something that will never be fixed in DMD however,
> because of its memory model.

It could be fixed, even if it's just adding a compiler switch to indicate
that you want it to use the GC to collect memory, because you're going to
run out of memory if you don't. As I understand it, the compiler already can
have that turned on internally. It's just that it hurt compilation times
enough to do so that it's been left off - which makes sense for many, many
cases, but is a definite problem when your project is large enough or doing
enough CTFE that compiling it causes it to run out of memory. What the best
way to handle ti is, I don't know, since we do want the compilation speed in
the typical case, but we also don't want to run out of memory. A compiler
switch would be an easy out but less than ideal.

Regardless of all of that, I expect that newCTFE will have a fairly large
impact on memory consumption once it's finally ready, because the current
CTFE is an absolute memory hog (e.g. as I understand it, it allocates a new
object every time a variable is mutated, so doing something like
incrementing an integer in a loop in CTFE means that the compiler is doing a
_lot_ of allocating). So, depending on why folks run out of memory when
compiling, newCTFE alone may fix the problem for most folks.

Still, we really should have the 64-bit compiler binary available on
Windows. For most developers, there's really no reason to use a 32-bit
binary, and if it solves the running out of memory problem (even if it's
only by being able to throw more memory at the compiler), then that will be
a big help even if it doesn't fix the underlying problem that the compiler
isn't versatile enough to be able to free memory when it needs to without
paying the full cost of memory management when it doesn't need to.

- Jonathan M Davis



Re: I have a plan.. I really DO

2018-06-29 Thread bauss via Digitalmars-d-announce

On Friday, 29 June 2018 at 20:13:07 UTC, Ecstatic Coder wrote:

On Friday, 29 June 2018 at 19:46:06 UTC, bauss wrote:

On Friday, 29 June 2018 at 19:42:56 UTC, Ecstatic Coder wrote:

On Friday, 29 June 2018 at 17:09:44 UTC, JN wrote:
On Friday, 29 June 2018 at 08:43:34 UTC, Ecstatic Coder 
wrote:
Once Crystal integrates parallelism (at 1.0), it should 
become de facto one of the best alternative to Go, Java, 
C#, etc, because it's actually "Go-made-right". For 
instance it's genericity system works well, and its type 
inference system natively support union types.




Except it has no Windows support and doesn't look like it 
will happen anytime soon. Some people might be living in a 
UNIX bubble, but Windows is a big market, and a language 
won't make it big without Windows support.


Right :)

But remember that Crystal is still in its infancy, as it 
hasn't reached its 1.0 version yet.


Parallelism is on its way, and Windows support too...

Don't forget that nowadays many (can I say most ?) servers 
are based on unix variants, so their platform support order 
looks perfectly fine and logical to me.


Actually a large share of servers run Windows Server and/or 
Azure servers running Windows too.


It's not logical to not support both.

D already has that advantage supporting pretty much every 
platform you can think of.


I agree, but you must compare what is comparable.

Have a look at Crystal's Github project, you will see that 
Crystal, still in development and quite far from its 1.0 mile 
version (= despite no parallism and windows support, etc) 
ALREADY has 11206 stars, 881 forks and 292 contributors :


https://github.com/crystal-lang/crystal

Not bad for a language in its 0.25 version and first released 
in June 2014 (4 years), especially compared to D in its 2.0 
version and first released in December 2001 (16 years), whose 
official compiler has 1806 stars, 452 forks and 168 
contributors :


https://github.com/dlang/dmd

If those numbers means anything, I think its that Crystal is 
probably getting popularity much quicker than D, and honestly, 
after having tried it, I think it's really deserved, even if I 
agree that there are still many things that remain to be 
implemented before it's really ready for an official 
"production-ready" 1.0 release.


Yes. Crystal is a fantastic language already.

As someone who uses many languages, I tend to just use what does 
the task at hand best.


I'm sure I'll be able to find some usage for Crystal when it's 
production ready, but it doesn't mean I'll abandon D. That'll 
probably never happen, especially considering I have a lot of 
projects written in D with thousands of lines of code.


Re: Call different member functions on object sequence with a generic handler function?

2018-06-29 Thread Timoses via Digitalmars-d-learn

On Friday, 29 June 2018 at 16:44:36 UTC, Robert M. Münch wrote:

I hope this is understandable... I have:

class C {
void A();
void B();
void C();
}

I'm iterating over a set of objects of class C like:

foreach(obj; my_selected_objs){
...
}

The iteration and code before/afterwards always looks the same, 
I need this iteration for many of the memember functions like 
C.A() and C.B(), etc.


foreach(obj; my_selected_objs){
...
obj.A|B|C()
...
}

So, how can I write a generic handler that does the iteration, 
where I can specify which member function to call?


void do_A() {
handler(C.A()); ???
}

void do_B() {
handler(C.B()); ???
}

handler(???){
foreach(obj: my_selected_objs){
???
}
}

Viele Grüsse.


Trying to fiddle around a bit with delegates.. But why is the 
context for delegates not working for classes??


https://run.dlang.io/is/Rxeukg

import std.stdio;

class Aclass
{
int i;
void foo() { writeln("called ", i); }
}
struct Bstruct
{
int i;
void foo() { writeln("called ", i); }
}


template callFoo(T)
{
alias Dun = void delegate();

void callFoo(T t)
{
Dun fun;
fun.funcptr = 
fun.ptr = cast(void*)();

Dun gun;
gun = 

writeln(fun.ptr, " (fun.ptr of " ~ T.stringof ~ ")");
writeln(gun.ptr, " (gun.ptr of " ~ T.stringof ~ ")");
writeln(, " (Address of instance (context))");

fun();
gun();
}

}

void main()
{
auto a = new Aclass();
a.i = 5;
auto b = Bstruct();
b.i = 7;
writeln(" Doesn't work ");
callFoo(a);
writeln("\n Works ");
callFoo(b);
}


Re: 64bit DMD on Windows

2018-06-29 Thread bauss via Digitalmars-d

On Friday, 29 June 2018 at 16:11:56 UTC, Seb wrote:

I hope we manage to ship it with the official releases soon.


I can't wait.

Honestly, a compiler should never run out of memory and it's a 
major issue that DMD does it.


Regardless of that it has fast compilation, it should never run 
out of memory.


I assume it's something that will never be fixed in DMD however, 
because of its memory model.


Re: Call different member functions on object sequence with a generic handler function?

2018-06-29 Thread Timoses via Digitalmars-d-learn

On Friday, 29 June 2018 at 20:08:56 UTC, Robert M. Münch wrote:

On 2018-06-29 18:05:00 +, Ali ‡ehreli said:


On 06/29/2018 09:44 AM, Robert M. Münch wrote:
void handler(alias func)(C[] cs) {
 foreach (c; cs) {
 func(c);
 }
}


Is it possible to make C[] a template type so that I can use 
different classes and lambdas?


My guess would be:

void handler(alias func, T)(T[] ts) {

}



Ok, the "strange" syntax for me is the handler(alias func) or 
handler(string func) ... I'm alway thinkin in lines of a 
parameter... which of course doesn't work.


Looking at the D grammer for functions these things should be 
the FuncDeclaratorSuffix, is this right? And then, which part 
does this fall into?


FuncDeclaratorSuffix:
   Parameters MemberFunctionAttributesopt
   TemplateParameters Parameters MemberFunctionAttributesop


It's definitely the "TemplateParameters" one:

void func()() { ... }

is the short form of

template()
{
void func() { ... }
}

https://dlang.org/spec/template.html


Re: I have a plan.. I really DO

2018-06-29 Thread Ecstatic Coder via Digitalmars-d-announce

On Friday, 29 June 2018 at 19:46:06 UTC, bauss wrote:

On Friday, 29 June 2018 at 19:42:56 UTC, Ecstatic Coder wrote:

On Friday, 29 June 2018 at 17:09:44 UTC, JN wrote:

On Friday, 29 June 2018 at 08:43:34 UTC, Ecstatic Coder wrote:
Once Crystal integrates parallelism (at 1.0), it should 
become de facto one of the best alternative to Go, Java, C#, 
etc, because it's actually "Go-made-right". For instance 
it's genericity system works well, and its type inference 
system natively support union types.




Except it has no Windows support and doesn't look like it 
will happen anytime soon. Some people might be living in a 
UNIX bubble, but Windows is a big market, and a language 
won't make it big without Windows support.


Right :)

But remember that Crystal is still in its infancy, as it 
hasn't reached its 1.0 version yet.


Parallelism is on its way, and Windows support too...

Don't forget that nowadays many (can I say most ?) servers are 
based on unix variants, so their platform support order looks 
perfectly fine and logical to me.


Actually a large share of servers run Windows Server and/or 
Azure servers running Windows too.


It's not logical to not support both.

D already has that advantage supporting pretty much every 
platform you can think of.


I agree, but you must compare what is comparable.

Have a look at Crystal's Github project, you will see that 
Crystal, still in development and quite far from its 1.0 mile 
version (= despite no parallism and windows support, etc) ALREADY 
has 11206 stars, 881 forks and 292 contributors :


https://github.com/crystal-lang/crystal

Not bad for a language in its 0.25 version and first released in 
June 2014 (4 years), especially compared to D in its 2.0 version 
and first released in December 2001 (16 years), whose official 
compiler has 1806 stars, 452 forks and 168 contributors :


https://github.com/dlang/dmd

If those numbers means anything, I think its that Crystal is 
probably getting popularity much quicker than D, and honestly, 
after having tried it, I think it's really deserved, even if I 
agree that there are still many things that remain to be 
implemented before it's really ready for an official 
"production-ready" 1.0 release.




Re: Issues with undefined symbols when using Vibe on Windows

2018-06-29 Thread Chris M. via Digitalmars-d-learn

On Friday, 29 June 2018 at 19:53:04 UTC, Timoses wrote:

On Friday, 29 June 2018 at 19:25:42 UTC, Chris M. wrote:
This doesn't appear to specifically be a Vibe issue, just 
noticing this error when I use eventcore from it (trying to 
use async).


C:\dmd2\windows\bin\lld-link.exe: warning: 
eventcore.lib(sockets_101f_952.obj): undefined symbol: 
SetWindowLongPtrA
C:\dmd2\windows\bin\lld-link.exe: warning: 
eventcore.lib(sockets_101f_952.obj): undefined symbol: 
GetWindowLongPtrA


I'm using DMD 2.080 from the zip file provided on the 
downloads page, plus DMC (unfortunately acquiring a Visual 
Studio license would not be easy at my workplace, and I don't 
see how to use the provided DMD installer without it). As far 
as I can tell, this issue seems to be happening because 
user32.lib from the windows/lib64/mingw folder does not define 
these two functions. Seems to work when I build the project as 
32-bit though. Wondering if someone could double-check my 
reasoning here.


Did you see this?
https://github.com/vibe-d/vibe.d#note-for-building-on-win64
Perhaps it could be that?


Unfortunately made it worse

C:\dmd2\windows\bin\lld-link.exe: warning: 
vibe-d_core.lib(win32_13b7_601.obj): undefined symbol: 
SetWindowLongPtrA
C:\dmd2\windows\bin\lld-link.exe: warning: 
vibe-d_core.lib(win32_13b7_601.obj): undefined symbol: 
GetWindowLongPtrA
C:\dmd2\windows\bin\lld-link.exe: warning: 
vibe-d_core.lib(threadedfile_1361_70d.obj): undefined symbol: open
C:\dmd2\windows\bin\lld-link.exe: warning: 
vibe-d_core.lib(threadedfile_1361_70d.obj): undefined symbol: 
chmod
C:\dmd2\windows\bin\lld-link.exe: warning: 
vibe-d_core.lib(threadedfile_1361_70d.obj): undefined symbol: 
lseek
C:\dmd2\windows\bin\lld-link.exe: warning: 
vibe-d_core.lib(threadedfile_1361_70d.obj): undefined symbol: 
close
C:\dmd2\windows\bin\lld-link.exe: warning: 
vibe-d_core.lib(threadedfile_1361_70d.obj): undefined symbol: read
C:\dmd2\windows\bin\lld-link.exe: warning: 
vibe-d_core.lib(threadedfile_1361_70d.obj): undefined symbol: 
write


Re: Call different member functions on object sequence with a generic handler function?

2018-06-29 Thread Robert M. Münch via Digitalmars-d-learn

On 2018-06-29 18:05:00 +, Ali ‡ehreli said:


On 06/29/2018 09:44 AM, Robert M. Münch wrote:

So, how can I write a generic handler that does the iteration, where I 
can specify which member function to call?


Passing a lambda or a string mixin:


Hi, that was somehow in my mind but didn't made to get the syntax 
clear... Thanks a lot.



import std.stdio;

class C {
 void A() {
 writeln(__FUNCTION__);
 }

 void B() {
 writeln(__FUNCTION__);
 }
}

void handler(alias func)(C[] cs) {
 foreach (c; cs) {
 func(c);
 }
}


Is it possible to make C[] a template type so that I can use different 
classes and lambdas?




void handler_2(string func)(C[] cs) {
 foreach (c; cs) {
 enum expr = "c." ~ func ~ "();";
 mixin(expr);
 }
}


Ok, the "strange" syntax for me is the handler(alias func) or 
handler(string func) ... I'm alway thinkin in lines of a parameter... 
which of course doesn't work.


Looking at the D grammer for functions these things should be the 
FuncDeclaratorSuffix, is this right? And then, which part does this 
fall into?


FuncDeclaratorSuffix:
   Parameters MemberFunctionAttributesopt
   TemplateParameters Parameters MemberFunctionAttributesop



--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster



Re: Issues with undefined symbols when using Vibe on Windows

2018-06-29 Thread Chris M. via Digitalmars-d-learn

On Friday, 29 June 2018 at 19:53:27 UTC, bauss wrote:

On Friday, 29 June 2018 at 19:25:42 UTC, Chris M. wrote:

[...]


Are you compiling to 64bit?

Else the functions will be named GetClassLongA and SetClassLongA


Yeah, that's what I'm targeting

Vibe builds fine on 64bit for me and I think that's outdated. 
It hasn't been modified for 4 years.


Seems to be an issue when I import vibe.core.concurrency


Re: Issues with undefined symbols when using Vibe on Windows

2018-06-29 Thread bauss via Digitalmars-d-learn

On Friday, 29 June 2018 at 19:53:04 UTC, Timoses wrote:

On Friday, 29 June 2018 at 19:25:42 UTC, Chris M. wrote:
This doesn't appear to specifically be a Vibe issue, just 
noticing this error when I use eventcore from it (trying to 
use async).


C:\dmd2\windows\bin\lld-link.exe: warning: 
eventcore.lib(sockets_101f_952.obj): undefined symbol: 
SetWindowLongPtrA
C:\dmd2\windows\bin\lld-link.exe: warning: 
eventcore.lib(sockets_101f_952.obj): undefined symbol: 
GetWindowLongPtrA


I'm using DMD 2.080 from the zip file provided on the 
downloads page, plus DMC (unfortunately acquiring a Visual 
Studio license would not be easy at my workplace, and I don't 
see how to use the provided DMD installer without it). As far 
as I can tell, this issue seems to be happening because 
user32.lib from the windows/lib64/mingw folder does not define 
these two functions. Seems to work when I build the project as 
32-bit though. Wondering if someone could double-check my 
reasoning here.


Did you see this?
https://github.com/vibe-d/vibe.d#note-for-building-on-win64
Perhaps it could be that?


Vibe builds fine on 64bit for me and I think that's outdated. It 
hasn't been modified for 4 years.


https://github.com/vibe-d/vibe.d/blame/master/README.md#L130


Re: Issues with undefined symbols when using Vibe on Windows

2018-06-29 Thread Timoses via Digitalmars-d-learn

On Friday, 29 June 2018 at 19:25:42 UTC, Chris M. wrote:
This doesn't appear to specifically be a Vibe issue, just 
noticing this error when I use eventcore from it (trying to use 
async).


C:\dmd2\windows\bin\lld-link.exe: warning: 
eventcore.lib(sockets_101f_952.obj): undefined symbol: 
SetWindowLongPtrA
C:\dmd2\windows\bin\lld-link.exe: warning: 
eventcore.lib(sockets_101f_952.obj): undefined symbol: 
GetWindowLongPtrA


I'm using DMD 2.080 from the zip file provided on the downloads 
page, plus DMC (unfortunately acquiring a Visual Studio license 
would not be easy at my workplace, and I don't see how to use 
the provided DMD installer without it). As far as I can tell, 
this issue seems to be happening because user32.lib from the 
windows/lib64/mingw folder does not define these two functions. 
Seems to work when I build the project as 32-bit though. 
Wondering if someone could double-check my reasoning here.


Did you see this?
https://github.com/vibe-d/vibe.d#note-for-building-on-win64
Perhaps it could be that?


Re: Issues with undefined symbols when using Vibe on Windows

2018-06-29 Thread bauss via Digitalmars-d-learn

On Friday, 29 June 2018 at 19:25:42 UTC, Chris M. wrote:
This doesn't appear to specifically be a Vibe issue, just 
noticing this error when I use eventcore from it (trying to use 
async).


C:\dmd2\windows\bin\lld-link.exe: warning: 
eventcore.lib(sockets_101f_952.obj): undefined symbol: 
SetWindowLongPtrA
C:\dmd2\windows\bin\lld-link.exe: warning: 
eventcore.lib(sockets_101f_952.obj): undefined symbol: 
GetWindowLongPtrA


I'm using DMD 2.080 from the zip file provided on the downloads 
page, plus DMC (unfortunately acquiring a Visual Studio license 
would not be easy at my workplace, and I don't see how to use 
the provided DMD installer without it). As far as I can tell, 
this issue seems to be happening because user32.lib from the 
windows/lib64/mingw folder does not define these two functions. 
Seems to work when I build the project as 32-bit though. 
Wondering if someone could double-check my reasoning here.


Are you compiling to 64bit?

Else the functions will be named GetClassLongA and SetClassLongA


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Jonathan M Davis via Digitalmars-d
On Friday, June 29, 2018 11:54:48 Joakim via Digitalmars-d wrote:
> On Friday, 29 June 2018 at 11:32:13 UTC, Jonathan M Davis wrote:
> > On Friday, June 29, 2018 10:50:52 Joakim via Digitalmars-d
> >
> > wrote:
> >> I coincidentally just read this blog post, that summarizes a
> >> lot of my thoughts against conferences and meetups:
> >>
> >> https://marco.org/2018/01/17/end-of-conference-era
> >>
> >> Maybe a good first step would be a mostly online DConf geared
> >> towards Asian timezones? I could help out with arranging those
> >> online talks.
> >
> > That article seems to pre-suppose that the only benefit from
> > conferences is the talks. A _lot_ of good comes from having a
> > bunch of the key developers in the same place for a few days
> > where they can talk in person.
>
> It "pre-supposes" nothing, points like yours are specifically
> addressed:
>
> "But all of that media can’t really replace the socializing,
> networking, and simply fun that happened as part of (or sometimes
> despite) the conference formula."

Well, then I clearly read over it too quickly, but regardless, I think that
you're going to have a hard time convincing the folks that attend dconf that
meeting in person is not highly valuable, and for those who aren't there in
person and only care about the talks, the talks are livestreamed and then
made available separated out later. I don't see how trying to kill off the
in-person aspect of things makes it any worse for those online, and I can
say from experience that meeting in person can be a game changer. It gives
you a very different perspective on someone if you've actually talked with
them in person, and there's lots of communication that works far better that
way. dconf is valuable for both the talks and the communication that happens
before, between, and after them. And regardless of its location, I would
hate to see it stop happening or stop being an actual, physical conference.
Much as I prefer it when it's closer to where I live so that the travel time
and expenses are lower, I've gone even when it's been halfway around the
world, and I wasn't speaking (and thus wasn't reimbursed), and I will
continue to do so. And I hate flying.

I honestly don't see how convincing folks to do just online videos instead
of meeting in purpose and recording the talks is any kind of improvement. At
best, it could be argued that if folks could give their talks from home that
the travel expenses would be avoided, but that's not even vaguely worth the
loss of being able to have most of the core devs and many D enthusiasts meet
and talk in the same place for a few days - even if several hours of that
time is spent listening to talks that could arguably have been done from
home.

If you don't want to show up in person, then just watch the livestream and
don't show up. The rest of us actually want to show up in person. I feel
sorry for those who want to come but can't afford to (be it due to the time
required or the money required), but they wouldn't be any better off if
everyone were livestreaming their talks from home instead of a central
location that they couldn't afford to go to. Many of us pay to go to dconf
and consider the money very well spent.

- Jonathan M Davis




Re: I have a plan.. I really DO

2018-06-29 Thread Ecstatic Coder via Digitalmars-d-announce

On Friday, 29 June 2018 at 18:48:19 UTC, bauss wrote:

On Friday, 29 June 2018 at 17:08:12 UTC, Ecstatic Coder wrote:
If you're a web developer with no dependencies then youre 
either reinventing the wheel (could cause trouble in the long 
run, if your implementations aren't correct.) Or your 
application just isn't more than a hobby project.


Most enterprise projects will have dependencies outside 
standard libraries and that is true for ex. Go too.


I agree with you, but what I mean is that all those nice Go 
and Crystal web frameworks are actually implemented using 
exactly the same building blocks, so that their authors didn't 
have to reinvent the wheel to reimplement them.


That's why there are so many available frameworks, and you can 
easily pick one which closely matches your needs and 
preferences...


Well you don't really need to re-invent the wheel at all with D 
either tbh.


You would need to with vibe.d, because it's really just the 
skeleton of a web application, but with Diamond? Not so much. 
It supports things that other frameworks don't even support, 
which you will end up implementing yourself anyway in 99% of 
all other frameworks. To give an example, consent, privacy and 
GDPR. There is no framework, at least what I have seen, that 
has compliance for such things implemented, but Diamond has it 
usable straight out of the box. Another example would be 
validation for email, url, various credit-cards, files (Not 
just extension, but also whether the data is correct.) etc. 
most of such validations are very limited in other frameworks 
or non-existent at all.


My point is that, even if those languages has http somewhat 
standard, they do not implement actual features that are useful 
to your business logic, application design etc. only to the 
skeleton.


However with frameworks in D you do get the best of both worlds.

http://diamondmvc.org/


Indeed this framework looks really complete, and should get much 
more promotion from D's official website.


But I still think that D's vision of what should be included in 
the standard library really diverges from those of Go and 
Crystal, despite this strategy has worked pretty well for them, 
and that Diamond clearly proves that D has all the basic language 
features to compete well with them (native performance, 
fiber-based concurrency, great string and array support, etc).





Re: I have a plan.. I really DO

2018-06-29 Thread bauss via Digitalmars-d-announce

On Friday, 29 June 2018 at 19:42:56 UTC, Ecstatic Coder wrote:

On Friday, 29 June 2018 at 17:09:44 UTC, JN wrote:

On Friday, 29 June 2018 at 08:43:34 UTC, Ecstatic Coder wrote:
Once Crystal integrates parallelism (at 1.0), it should 
become de facto one of the best alternative to Go, Java, C#, 
etc, because it's actually "Go-made-right". For instance it's 
genericity system works well, and its type inference system 
natively support union types.




Except it has no Windows support and doesn't look like it will 
happen anytime soon. Some people might be living in a UNIX 
bubble, but Windows is a big market, and a language won't make 
it big without Windows support.


Right :)

But remember that Crystal is still in its infancy, as it hasn't 
reached its 1.0 version yet.


Parallelism is on its way, and Windows support too...

Don't forget that nowadays many (can I say most ?) servers are 
based on unix variants, so their platform support order looks 
perfectly fine and logical to me.


Actually a large share of servers run Windows Server and/or Azure 
servers running Windows too.


It's not logical to not support both.

D already has that advantage supporting pretty much every 
platform you can think of.


Re: A Case for Oxidation: A potential missed opportunity for D

2018-06-29 Thread Jonathan Marler via Digitalmars-d

On Friday, 29 June 2018 at 09:25:08 UTC, Mike Franklin wrote:
Please allow me to bring your attention to an interesting 
presentation about  choosing a modern programming language for 
writing operating systems:


https://www.youtube.com/watch?v=cDFSrVhnZKo

It's a good talk and probably worth your time if you're 
interested in bare-metal systems programming.  The presenter 
mentions D briefly in the beginning when he discussed how he 
made his choice of programming language.


He shows the following (probably inaccurate) matrix.

Lang| Mem Safety | Min Runtime | Strong Type Syst. | 
Performance

C   || x   |   | x
C++ || x   |   | x
C#  | x  | | x |
D   | x  | | x | x
Go  | x  | | x | x
Rust| x  | x   | x | x
Java| x  | | x | x
Haskell | x  | | x |
Cycle   | x  | x   | x | x

It appears the deal-breaker for D was the lack of "minimal 
runtime".  Of course D has -betterC and, with 2.079, a way to 
use some features of D without the runtime, but he also goes on 
to discuss the importance of memory safety in his application 
of the language.


I hope we'll see something competitive with DIP25, DIP1000, and 
the `scope` storage class, namely *memory safety without a 
runtime*.


I'm currently waiting for 2.081 to reach LDC and GDC, and then 
I have a few ideas I'd like to begin working on myself, but I 
never have a shortage of ideas, just a shortage of time and 
energy.


Enjoy!

Mike


This just isn't true.  I've written a fair amount of a linux 
distro in D without druntime/phobos or even the standard C 
library.


https://github.com/marler8997/maros



Re: I have a plan.. I really DO

2018-06-29 Thread Ecstatic Coder via Digitalmars-d-announce

On Friday, 29 June 2018 at 17:09:44 UTC, JN wrote:

On Friday, 29 June 2018 at 08:43:34 UTC, Ecstatic Coder wrote:
Once Crystal integrates parallelism (at 1.0), it should become 
de facto one of the best alternative to Go, Java, C#, etc, 
because it's actually "Go-made-right". For instance it's 
genericity system works well, and its type inference system 
natively support union types.




Except it has no Windows support and doesn't look like it will 
happen anytime soon. Some people might be living in a UNIX 
bubble, but Windows is a big market, and a language won't make 
it big without Windows support.


Right :)

But remember that Crystal is still in its infancy, as it hasn't 
reached its 1.0 version yet.


Parallelism is on its way, and Windows support too...

Don't forget that nowadays many (can I say most ?) servers are 
based on unix variants, so their platform support order looks 
perfectly fine and logical to me.


Issues with undefined symbols when using Vibe on Windows

2018-06-29 Thread Chris M. via Digitalmars-d-learn
This doesn't appear to specifically be a Vibe issue, just 
noticing this error when I use eventcore from it (trying to use 
async).


C:\dmd2\windows\bin\lld-link.exe: warning: 
eventcore.lib(sockets_101f_952.obj): undefined symbol: 
SetWindowLongPtrA
C:\dmd2\windows\bin\lld-link.exe: warning: 
eventcore.lib(sockets_101f_952.obj): undefined symbol: 
GetWindowLongPtrA


I'm using DMD 2.080 from the zip file provided on the downloads 
page, plus DMC (unfortunately acquiring a Visual Studio license 
would not be easy at my workplace, and I don't see how to use the 
provided DMD installer without it). As far as I can tell, this 
issue seems to be happening because user32.lib from the 
windows/lib64/mingw folder does not define these two functions. 
Seems to work when I build the project as 32-bit though. 
Wondering if someone could double-check my reasoning here.


Re: A Case for Oxidation: A potential missed opportunity for D

2018-06-29 Thread Jacob Carlborg via Digitalmars-d

On 2018-06-29 12:55, kinke wrote:


I'd love to hear some reasons for -betterC from a competent guy like
yourself. I simply don't get what all the fuzz is about and what people
expect to gain from losing druntime (and language features depending on
it) and non-template-only Phobos. I understand the separate 'minimal
runtime' need for bare metal (no Type- and ModuleInfos etc.), but I
can't help myself in seeing betterC as, nicely put, worseD. I
acknowledge that it seems to attract wide-spread interest, and I'd like
to understand why.


You can potentially do a lot at compile time (which you cannot do in C 
or C++) while at the same time have a requirement of not using a 
runtime. There's a talk, I think at a Dconf, where the speaker was using 
D on bare metal. He used CTFE to parse a PDF file with the specification 
for op codes or something similar. The CTFE code generate some table or 
other code for the op codes. This resulted in the code always being up 
to date with the specification.


I've written a tiny plugin for an application where I used a tiny part 
of the D runtime. I didn't link with it but instead inlined the 
functions I needed directly in the plugin. For example, array copying.


There are several nice features that can be used without the runtime, like:

* Strings and arrays carry their length
* foreach
* Array slicing
* Compile time features


--
/Jacob Carlborg


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread bauss via Digitalmars-d

On Friday, 29 June 2018 at 17:04:46 UTC, 鲜卑拓跋枫 wrote:

On Friday, 29 June 2018 at 11:54:48 UTC, Joakim wrote:
On Friday, 29 June 2018 at 11:32:13 UTC, Jonathan M Davis 
wrote:
On Friday, June 29, 2018 10:50:52 Joakim via Digitalmars-d 
wrote:
I coincidentally just read this blog post, that summarizes a 
lot of my thoughts against conferences and meetups:


https://marco.org/2018/01/17/end-of-conference-era

Maybe a good first step would be a mostly online DConf 
geared towards Asian timezones? I could help out with 
arranging those online talks.


That article seems to pre-suppose that the only benefit from 
conferences is the talks. A _lot_ of good comes from having a 
bunch of the key developers in the same place for a few days 
where they can talk in person.


It "pre-supposes" nothing, points like yours are specifically 
addressed:


"But all of that media can’t really replace the socializing, 
networking, and simply fun that happened as part of (or 
sometimes despite) the conference formula."


Some communities (e.g. the BSD community) even have developer 
meetings connected to conferences where they specifically put 
a bunch of developers in a room together to discuss stuff. 
The talks are valuable, but in some ways, those face-to-face 
interactions are worth far more than the talks. So, while 
there's certainly value in finding ways to get more talks 
online, I think that it would be a huge mistake to try and 
push for online stuff to replace physical conferences where 
developers actually interact with each other in person.


I don't, I think it would be a huge improvement. There are 
very few benefits to getting people together in person in our 
hyperconnected age, and while "key developers in the same 
place" may be one of those, that excludes almost everybody 
else at DConf.


Honestly, getting everybody together in a room and having them 
stare straight ahead at a speaker is a blindingly stupid waste 
of time these days. The only advantage of everybody being 
together in a room is the heightened communication bandwidth, 
and then you all sit next to each other staring straight ahead 
silently. The conference format made sense when pretty much 
everybody attending didn't have high-speed internet and 
connected video displays decades ago, but they make no sense 
now, as that blog post notes.


Actually the network speed in China is not satisfied in some 
extent, and that of Korea and Japan are much better.


What about Hong Kong?


Re: I have a plan.. I really DO

2018-06-29 Thread bauss via Digitalmars-d-announce

On Friday, 29 June 2018 at 17:08:12 UTC, Ecstatic Coder wrote:
If you're a web developer with no dependencies then youre 
either reinventing the wheel (could cause trouble in the long 
run, if your implementations aren't correct.) Or your 
application just isn't more than a hobby project.


Most enterprise projects will have dependencies outside 
standard libraries and that is true for ex. Go too.


I agree with you, but what I mean is that all those nice Go and 
Crystal web frameworks are actually implemented using exactly 
the same building blocks, so that their authors didn't have to 
reinvent the wheel to reimplement them.


That's why there are so many available frameworks, and you can 
easily pick one which closely matches your needs and 
preferences...


Well you don't really need to re-invent the wheel at all with D 
either tbh.


You would need to with vibe.d, because it's really just the 
skeleton of a web application, but with Diamond? Not so much. It 
supports things that other frameworks don't even support, which 
you will end up implementing yourself anyway in 99% of all other 
frameworks. To give an example, consent, privacy and GDPR. There 
is no framework, at least what I have seen, that has compliance 
for such things implemented, but Diamond has it usable straight 
out of the box. Another example would be validation for email, 
url, various credit-cards, files (Not just extension, but also 
whether the data is correct.) etc. most of such validations are 
very limited in other frameworks or non-existent at all.


My point is that, even if those languages has http somewhat 
standard, they do not implement actual features that are useful 
to your business logic, application design etc. only to the 
skeleton.


However with frameworks in D you do get the best of both worlds.

http://diamondmvc.org/


[Issue 19042] New: Chunking a padRight'ed range leads to range violations

2018-06-29 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19042

  Issue ID: 19042
   Summary: Chunking a padRight'ed range leads to range violations
   Product: D
   Version: D2
  Hardware: x86_64
OS: Linux
Status: NEW
  Severity: normal
  Priority: P1
 Component: phobos
  Assignee: nob...@puremagic.com
  Reporter: asumf...@gmail.com

The following code exhibits a range violation:

import std.stdio;
import std.range;
import std.conv;

void main()
{
pragma(msg, [2,5,13].padRight(42, 10).chunks(5).to!string);
}

Compiler output:

/dlang/dmd/linux/bin64/../../src/phobos/std/range/package.d(12811): Error:
slice [5..3] exceeds array bounds [0..3]
/dlang/dmd/linux/bin64/../../src/phobos/std/range/package.d(12811):   
called from here: Result(null, 0, 0LU, 0LU, 0LU).this(b <= this.data.length ?
this.data[a..b] : this.data[a..this.data.length], this.element, b - a)
/dlang/dmd/linux/bin64/../../src/phobos/std/range/primitives.d(1743):   
called from here: r.opSlice(n, __dollar)
/dlang/dmd/linux/bin64/../../src/phobos/std/range/package.d(7704):   
called from here: popFrontN(this._source, this._chunkSize)
/dlang/dmd/linux/bin64/../../src/phobos/std/format.d(3299):called from
here: val.popFront()
/dlang/dmd/linux/bin64/../../src/phobos/std/format.d(4127):called from
here: formatRange(w, val, f)
/dlang/dmd/linux/bin64/../../src/phobos/std/format.d(1845):called from
here: formatValueImpl(w, val, f)
/dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(151):called from
here: formatValue(w, src, f)
/dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(1018):called from
here: toStr(value)
/dlang/dmd/linux/bin64/../../src/phobos/std/conv.d(222):called from
here: toImpl(_param_0)
onlineapp.d(7):called from here: to(chunks(padRight([2, 5, 13], 42,
10LU), 5LU))
onlineapp.d(7):while evaluating pragma(msg, chunks(padRight([2, 5, 13],
42, 10LU), 5LU).to!string)

The problem occurs almost indepentently from the supplied arguments and is not
restricted to compile-time evaluation, the only requirement that I could
determine is that padRight needs to extend its input by at least one element.
Replacing chunks with evenChunks results in the same error. padLeft does not
appear to be affected by this issue.
It can be reproduced in all versions since the introduction of padRight
(2.072).

--


Re: Call different member functions on object sequence with a generic handler function?

2018-06-29 Thread Ali Çehreli via Digitalmars-d-learn

On 06/29/2018 09:44 AM, Robert M. Münch wrote:

So, how can I write a generic handler that does the iteration, where I 
can specify which member function to call?


Passing a lambda or a string mixin:

import std.stdio;

class C {
void A() {
writeln(__FUNCTION__);
}

void B() {
writeln(__FUNCTION__);
}
}

void handler(alias func)(C[] cs) {
foreach (c; cs) {
func(c);
}
}

void handler_2(string func)(C[] cs) {
foreach (c; cs) {
enum expr = "c." ~ func ~ "();";
mixin(expr);
}
}

void main() {
auto cs = [ new C(), new C() ];

handler!(o => o.A())(cs);
handler!(o => o.B())(cs);

handler_2!"A"(cs);
handler_2!"B"(cs);
}

Ali


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Ali Çehreli via Digitalmars-d

On 06/29/2018 02:20 AM, Joakim wrote:
However, Ali notes significant interest in his D book in China and 
Russia (also see updated stats later in that thread):


https://forum.dlang.org/post/oarr8l$19rh$1...@digitalmars.com


Random stats of the day:

LocationPages   HitsBandwidth
-
United States   34,237  42,6081.34 GB
China   28,616  29,040  543.10 MB
Turkey  16,121  46,814  929.62 MB
Russian Federation  10,205  12,616  525.24 MB
Netherlands  8,559   8,747  148.16 MB
Norway   7,247   7,324   79.20 MB
Thailand 7,045   7,052   78.29 MB
Germany  6,172   7,734  495.69 MB
Brazil   5,272   5,604  128.59 MB
[...]

Ali


Re: High memory usage in vibe.d application

2018-06-29 Thread Anton Fediushin via Digitalmars-d-learn

On Friday, 29 June 2018 at 16:49:41 UTC, Bauss wrote:

On Friday, 29 June 2018 at 16:07:00 UTC, Anton Fediushin wrote:
On Friday, 29 June 2018 at 11:11:57 UTC, rikki cattermole 
wrote:

On 29/06/2018 11:09 PM, Anton Fediushin wrote:
It is GC's fault for sure, I built my program with 
profile-gc and it allocated a lot there. Question is, why 
doesn't it free this memory?


Probably doesn't know that it should deallocate so eagerly.
A GC.collect(); call may help.


That's a good idea. GC really needs to be kicked in once in a 
while because it did _nothing_ in 8 hours, even though my 
application is just a couple of timers - it isn't a hard task 
for CPU or memory and there's plenty of time to collect some 
garbage.


Now I finally understand why GC is not a great thing. I was 
writing apps utilizing GC for a long time and never had 
problems with it, but when it came down to this simple program 
it stabbed me in the back.


I wouldn't really blame the GC. There is a higher chance you're 
just not using it how it's meant to be, especially since it 
looks like you're mixing manual memory management with GC 
memory.


I am not quite sure what should I blame now, because even if I 
use malloc for memory allocation, memory goes... somewhere?


So, long story short:
- Usage of Mallocator instead of theAllocator made it a little 
bit better

- VibeManualMemoryManagement had no (or little) effect
- Manually calling GC.collect had no (or little) effect

It makes me think that error is somewhere else. I made a code 
snippet of my testing program: https://gitlab.com/snippets/1729304


There are some changes to it:
- It uses different stream with metaint of 32KB
- It calls nowPlaying() every second

Now I will take a break from this, dealing with this kind of 
nonsense annoys me.




Re: Why tuples are not ranges?

2018-06-29 Thread Ali Çehreli via Digitalmars-d-learn

On 06/28/2018 11:10 PM, Jonathan M Davis wrote:
> On Friday, June 29, 2018 05:52:03 Alex via Digitalmars-d-learn wrote:

>> Wouldn't this be weird from the semantic view?

I agree with all your concerns. The fact that Meta decided to make the 
element type Algebraic!T as opposed to my CommonType!T choice is another 
semantic problem.


> It wouldn't make any sense to turn a Tuple into a range. However, if 
all of
> the values are of the same type, it might make sense to create a 
range from

> each of the values in the Tuple.

I went a step further and used CommonType!T.

> a helper function could be created that takes a Tuple and
> returns a range which wraps it.

That's what my example did (with added bugs like 'length' being an enum 
by mistake).


> And at that point, talking about
> getting a range over a Tuple is basically the same thing as talking about
> creating a range from an arbitrary struct whose members all happen to 
have

> the same type - and that would be pretty weird.

Agreed.

Ali



Re: I have a plan.. I really DO

2018-06-29 Thread Ecstatic Coder via Digitalmars-d-announce
If you're a web developer with no dependencies then youre 
either reinventing the wheel (could cause trouble in the long 
run, if your implementations aren't correct.) Or your 
application just isn't more than a hobby project.


Most enterprise projects will have dependencies outside 
standard libraries and that is true for ex. Go too.


I agree with you, but what I mean is that all those nice Go and 
Crystal web frameworks are actually implemented using exactly the 
same building blocks, so that their authors didn't have to 
reinvent the wheel to reimplement them.


That's why there are so many available frameworks, and you can 
easily pick one which closely matches your needs and 
preferences...


Re: High memory usage in vibe.d application

2018-06-29 Thread Anton Fediushin via Digitalmars-d-learn

On Friday, 29 June 2018 at 16:19:39 UTC, 12345swordy wrote:

On Friday, 29 June 2018 at 16:07:00 UTC, Anton Fediushin wrote:
Now I finally understand why GC is not a great thing. I was 
writing apps utilizing GC for a long time and never had 
problems with it, but when it came down to this simple program 
it stabbed me in the back.


Which language that you had write apps in that utilize GC? 
Java? C#? You shouldn't treat D GC the same as other languages 
GC.


Alexander


Talking about D here.

GC can be the best option for some languages and environments, 
but it doesn't fit D that well. Writing programs in D I always 
know where stack-allocated structs get deleted and such, but I 
have no idea on what's going on with the GC. Does it collect 
anything at all? Why doesn't it collect this? How do I force it 
to collect this?




Re: I have a plan.. I really DO

2018-06-29 Thread JN via Digitalmars-d-announce

On Friday, 29 June 2018 at 08:43:34 UTC, Ecstatic Coder wrote:
Once Crystal integrates parallelism (at 1.0), it should become 
de facto one of the best alternative to Go, Java, C#, etc, 
because it's actually "Go-made-right". For instance it's 
genericity system works well, and its type inference system 
natively support union types.




Except it has no Windows support and doesn't look like it will 
happen anytime soon. Some people might be living in a UNIX 
bubble, but Windows is a big market, and a language won't make it 
big without Windows support.


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread 鲜卑拓跋枫 via Digitalmars-d

On Friday, 29 June 2018 at 11:54:48 UTC, Joakim wrote:

On Friday, 29 June 2018 at 11:32:13 UTC, Jonathan M Davis wrote:
On Friday, June 29, 2018 10:50:52 Joakim via Digitalmars-d 
wrote:
I coincidentally just read this blog post, that summarizes a 
lot of my thoughts against conferences and meetups:


https://marco.org/2018/01/17/end-of-conference-era

Maybe a good first step would be a mostly online DConf geared 
towards Asian timezones? I could help out with arranging 
those online talks.


That article seems to pre-suppose that the only benefit from 
conferences is the talks. A _lot_ of good comes from having a 
bunch of the key developers in the same place for a few days 
where they can talk in person.


It "pre-supposes" nothing, points like yours are specifically 
addressed:


"But all of that media can’t really replace the socializing, 
networking, and simply fun that happened as part of (or 
sometimes despite) the conference formula."


Some communities (e.g. the BSD community) even have developer 
meetings connected to conferences where they specifically put 
a bunch of developers in a room together to discuss stuff. The 
talks are valuable, but in some ways, those face-to-face 
interactions are worth far more than the talks. So, while 
there's certainly value in finding ways to get more talks 
online, I think that it would be a huge mistake to try and 
push for online stuff to replace physical conferences where 
developers actually interact with each other in person.


I don't, I think it would be a huge improvement. There are very 
few benefits to getting people together in person in our 
hyperconnected age, and while "key developers in the same 
place" may be one of those, that excludes almost everybody else 
at DConf.


Honestly, getting everybody together in a room and having them 
stare straight ahead at a speaker is a blindingly stupid waste 
of time these days. The only advantage of everybody being 
together in a room is the heightened communication bandwidth, 
and then you all sit next to each other staring straight ahead 
silently. The conference format made sense when pretty much 
everybody attending didn't have high-speed internet and 
connected video displays decades ago, but they make no sense 
now, as that blog post notes.


Actually the network speed in China is not satisfied in some 
extent, and that of Korea and Japan are much better.


Re: I have a plan.. I really DO

2018-06-29 Thread Bauss via Digitalmars-d-announce

On Friday, 29 June 2018 at 12:32:46 UTC, Ecstatic Coder wrote:

On Friday, 29 June 2018 at 10:06:12 UTC, bauss wrote:

On Friday, 29 June 2018 at 08:43:34 UTC, Ecstatic Coder wrote:
As you know, I'm convinced that D could be marketed as the 
perfect language to develop native web servers and mobile 
applications, and have its core libraries somewhat extended 
in thqg direction, like Go and Crystal which allow 
"plug'n'play" web server development for instance


D allows for plug n' play web server development too.


Then this should be more advertised...

For instance :



https://crystal-lang.org/

The FIRST paragraph of text of Crystal's web page is :

"Syntax

Crystal’s syntax is heavily inspired by Ruby’s, so it feels 
natural to read and easy to write, and has the added benefit of 
a lower learning curve for experienced Ruby devs.


# A very basic HTTP server
require "http/server"

server = HTTP::Server.new do |context|
  context.response.content_type = "text/plain"
  context.response.print "Hello world, got 
#{context.request.path}!"

end

puts "Listening on http://127.0.0.1:8080;
server.listen(8080)
"

So the FIRST thing you learn about Crystal is that the standard 
library already gives you all you need to program a simple 
"hello world" web server.


The Go standard library is also known to provide the same 
building blocks :


package main

import (
"fmt"
"net/http"
)

func main() {
	http.HandleFunc("/", func(w http.ResponseWriter, r 
*http.Request) {

fmt.Fprintf(w, "Hello, you've requested: %s\n", r.URL.Path)
})

http.ListenAndServe(":80", nil)
}

Both are batteries-included for web development. That's why 
many developers don't feel the need to use thirdparty 
frameworks to implement their microservices...


So if it's also the case for D, then sorry for my mistake...


Sorry. My misunderstanding.

I thought you meant there were no frameworks that could be used 
as plug n play for web development.


For this to ever happen std.socket needs to be deprecated already 
and rewritten so D can have a standard http module.


I don't really see that happening though.

However I agree with the third party libraries to an extended, 
but it's not really an issue. All developers will end up with 
third party dependencies in one way or another, especially for 
web development. Like you'll most likely end up with some kind of 
JavaScript library, some sass/less compiler etc.


If you're a web developer with no dependencies then youre either 
reinventing the wheel (could cause trouble in the long run, if 
your implementations aren't correct.) Or your application just 
isn't more than a hobby project.


Most enterprise projects will have dependencies outside standard 
libraries and that is true for ex. Go too.


You also have to remember that D has a very different philosophy.


Re: High memory usage in vibe.d application

2018-06-29 Thread Bauss via Digitalmars-d-learn

On Friday, 29 June 2018 at 16:07:00 UTC, Anton Fediushin wrote:

On Friday, 29 June 2018 at 11:11:57 UTC, rikki cattermole wrote:

On 29/06/2018 11:09 PM, Anton Fediushin wrote:
It is GC's fault for sure, I built my program with profile-gc 
and it allocated a lot there. Question is, why doesn't it 
free this memory?


Probably doesn't know that it should deallocate so eagerly.
A GC.collect(); call may help.


That's a good idea. GC really needs to be kicked in once in a 
while because it did _nothing_ in 8 hours, even though my 
application is just a couple of timers - it isn't a hard task 
for CPU or memory and there's plenty of time to collect some 
garbage.


Now I finally understand why GC is not a great thing. I was 
writing apps utilizing GC for a long time and never had 
problems with it, but when it came down to this simple program 
it stabbed me in the back.


I wouldn't really blame the GC. There is a higher chance you're 
just not using it how it's meant to be, especially since it looks 
like you're mixing manual memory management with GC memory.


Call different member functions on object sequence with a generic handler function?

2018-06-29 Thread Robert M. Münch via Digitalmars-d-learn

I hope this is understandable... I have:

class C {
void A();
void B();
void C();
}

I'm iterating over a set of objects of class C like:

foreach(obj; my_selected_objs){
...
}

The iteration and code before/afterwards always looks the same, I need 
this iteration for many of the memember functions like C.A() and C.B(), 
etc.


foreach(obj; my_selected_objs){
...
obj.A|B|C()
...
}

So, how can I write a generic handler that does the iteration, where I 
can specify which member function to call?


void do_A() {
handler(C.A()); ???
}

void do_B() {
handler(C.B()); ???
}

handler(???){
foreach(obj: my_selected_objs){
???
}
}

Viele Grüsse.

--
Robert M. Münch
http://www.saphirion.com
smarter | better | faster



Re: High memory usage in vibe.d application

2018-06-29 Thread 12345swordy via Digitalmars-d-learn

On Friday, 29 June 2018 at 16:07:00 UTC, Anton Fediushin wrote:

On Friday, 29 June 2018 at 11:11:57 UTC, rikki cattermole wrote:

On 29/06/2018 11:09 PM, Anton Fediushin wrote:
It is GC's fault for sure, I built my program with profile-gc 
and it allocated a lot there. Question is, why doesn't it 
free this memory?


Probably doesn't know that it should deallocate so eagerly.
A GC.collect(); call may help.


That's a good idea. GC really needs to be kicked in once in a 
while because it did _nothing_ in 8 hours, even though my 
application is just a couple of timers - it isn't a hard task 
for CPU or memory and there's plenty of time to collect some 
garbage.


Now I finally understand why GC is not a great thing. I was 
writing apps utilizing GC for a long time and never had 
problems with it, but when it came down to this simple program 
it stabbed me in the back.


Which language that you had write apps in that utilize GC? Java? 
C#? You shouldn't treat D GC the same as other languages GC.


Alexander


Re: 64bit DMD on Windows

2018-06-29 Thread Seb via Digitalmars-d

On Friday, 29 June 2018 at 14:39:29 UTC, 9il wrote:

Hi,

I am migrating a project to Windows.
DMD fails with

Fatal error: out of memory

Splitting the project to dozen subpackages allows to workaround 
the issue. In other hand, dub test doesn't test subpackages.


It would be nice to have 64 bit DMD.

Best Regards,
Ilya Yaroshenko


You can grab one at AppVeyor 
https://ci.appveyor.com/project/greenify/dmd/build/1.0.4829/artifacts (it gets build with every PR/commit at DMD).

I hope we manage to ship it with the official releases soon.


Re: High memory usage in vibe.d application

2018-06-29 Thread Anton Fediushin via Digitalmars-d-learn

On Friday, 29 June 2018 at 11:11:57 UTC, rikki cattermole wrote:

On 29/06/2018 11:09 PM, Anton Fediushin wrote:
It is GC's fault for sure, I built my program with profile-gc 
and it allocated a lot there. Question is, why doesn't it free 
this memory?


Probably doesn't know that it should deallocate so eagerly.
A GC.collect(); call may help.


That's a good idea. GC really needs to be kicked in once in a 
while because it did _nothing_ in 8 hours, even though my 
application is just a couple of timers - it isn't a hard task for 
CPU or memory and there's plenty of time to collect some garbage.


Now I finally understand why GC is not a great thing. I was 
writing apps utilizing GC for a long time and never had problems 
with it, but when it came down to this simple program it stabbed 
me in the back.


Re: High memory usage in vibe.d application

2018-06-29 Thread Anton Fediushin via Digitalmars-d-learn

On Friday, 29 June 2018 at 14:10:26 UTC, Daniel Kozak wrote:

Have you try use VibeManualMemoryManagement

https://github.com/TechEmpower/FrameworkBenchmarks/blob/3b24d0a21463edc536b30e2cea647fd425915401/frameworks/D/vibed/dub.json#L22



I'll try, not quite sure it'll help much.


Re: docker images

2018-06-29 Thread Seb via Digitalmars-d-announce

On Thursday, 28 June 2018 at 17:54:45 UTC, Radu wrote:

Created a couple of docker images useful for dlang dev.

LDC cross compiler for ARM

- https://hub.docker.com/r/rracariu/ldc-linux-armhf/

This image allows one to easily cross compile to ARM. Main 
use-case is continuous integration servers.


- https://hub.docker.com/r/rracariu/dub-registry/

Allows easily running a private dub repository on cloud.


We now setup auto-deploy to DockerHub from the official 
dlang/dub-registry:


https://github.com/dlang/dub-registry/pull/354
https://hub.docker.com/r/dlangcommunity/dub-registry/tags

So your private Dub registry docker instance should be able to 
update itself automatically.


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Joakim via Digitalmars-d

On Friday, 29 June 2018 at 12:13:09 UTC, 鲜卑拓跋枫 wrote:

On Friday, 29 June 2018 at 10:50:52 UTC, Joakim wrote:
I coincidentally just read this blog post, that summarizes a 
lot of my thoughts against conferences and meetups:


https://marco.org/2018/01/17/end-of-conference-era

Maybe a good first step would be a mostly online DConf geared 
towards Asian timezones? I could help out with arranging those 
online talks.



It seems that people in different countries of Asia may live in 
different timezone.


So do people in US and Europe, the vast majority of whom watching 
the livestream or online videos didn't attend DConf.


On Friday, 29 June 2018 at 12:30:49 UTC, Mike Parker wrote:

On Friday, 29 June 2018 at 11:54:48 UTC, Joakim wrote:


I don't, I think it would be a huge improvement. There are 
very few benefits to getting people together in person in our 
hyperconnected age, and while "key developers in the same 
place" may be one of those, that excludes almost everybody 
else at DConf.


Except it doesn't exclude anyone -- it's not just the key 
developers.


First off, I question there's much benefit to even the key devs 
beyond communicating through email and video conferencing to iron 
things out, as Andrei indicates he does with Walter.


And Jonathan only mentioned the key devs, so that does exclude. 
As for everybody else, see below.


Honestly, getting everybody together in a room and having them 
stare straight ahead at a speaker is a blindingly stupid waste 
of time these days. The only advantage of everybody being 
together in a room is the heightened communication bandwidth, 
and then you all sit next to each other staring straight ahead 
silently. The conference format made sense when pretty much 
everybody attending didn't have high-speed internet and 
connected video displays decades ago, but they make no sense 
now, as that blog post notes.


There are huge benefits to being there in person that extend 
beyond the time spent listening to the talks. People congregate 
in the lobby after hours, have three meals a day together, 
exchange ideas, make new contacts that lead to collaborations 
down the line... I wouldn't trade the time I've spent at the 
four DConfs I've attended for anything and very much regret 
missing the two I couldn't attend.


Then spend all your time doing those things: why waste the 
majority of conference time sitting through talks that you don't 
bother defending?


Here's what a "conference" in Asia or Europe or wherever should 
probably look like in this day and age:


- Have most talks prerecorded by the speaker on their webcam or 
smartphone, which produce excellent video these days with not 
much fiddling, and have a couple organizers work with them to get 
those home-brewed videos up to a certain quality level, both in 
content and presentation, before posting them online.


- Once the videos are all up, set up weekend meetups in several 
cities in the region, such as Tokyo, Hong Kong, and Bangalore, 
where a few livestreamed talks may talk place if some speakers 
don't want to spend more time producing a pre-recorded talk, but 
most time is spent like the hackathon, discussing various 
existing issues from bugzilla in smaller groups or brainstorming 
ideas, designs, and libraries for the future.


This is just off the top of my head; I'm sure I'm missing some 
small details here and there, as I was coming up with parts of 
this as I wrote it, but I estimate it'd be an order of magnitude 
more productive than the current conference format while being 
vastly cheaper in total cost to all involved. Since D is not 
exactly drowning in money, it makes no sense to waste it on the 
antiquated conference format. Some American D devs may complain 
that they no longer essentially get to go on a vacation to Berlin 
or Munich- a paid vacation if their company compensates for such 
tech conferences- but that's not our problem.


64bit DMD on Windows

2018-06-29 Thread 9il via Digitalmars-d

Hi,

I am migrating a project to Windows.
DMD fails with

Fatal error: out of memory

Splitting the project to dozen subpackages allows to workaround 
the issue. In other hand, dub test doesn't test subpackages.


It would be nice to have 64 bit DMD.

Best Regards,
Ilya Yaroshenko


Re: High memory usage in vibe.d application

2018-06-29 Thread Daniel Kozak via Digitalmars-d-learn
Have you try use VibeManualMemoryManagement

https://github.com/TechEmpower/FrameworkBenchmarks/blob/3b24d0a21463edc536b30e2cea647fd425915401/frameworks/D/vibed/dub.json#L22


On Fri, Jun 29, 2018 at 3:20 PM Anton Fediushin via Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com> wrote:

> On Friday, 29 June 2018 at 11:42:18 UTC, bauss wrote:
> > On Friday, 29 June 2018 at 11:24:14 UTC, Anton Fediushin wrote:
> >> On Friday, 29 June 2018 at 11:01:41 UTC, Anton Fediushin wrote:
> >>> On Friday, 29 June 2018 at 10:21:24 UTC, Radu wrote:
>  On Friday, 29 June 2018 at 09:44:27 UTC, Anton Fediushin
>  wrote:
> > Almost forgot, there are two timers which call this
> > function for two different streams.
> >
> > Value of `metaint` is 16000, which means that only 16KB of
> > memory are allocated for the `buffer`, then it reads
> > another byte which contains length of the metadata / 16 and
> > then it reads the metadata which is 100-200 bytes long.
> >
> > This gives us... 16KiB per one nowPlaying() call. Why
> > doesn't it free the memory?
> 
>  Maybe use the
>  https://dlang.org/phobos/std_experimental_allocator_mallocator.html
> instead of theAllocator as it defaults to GC.
> >>>
> >>> Thanks, I'll try that.
> >>> ...
> >>> I will deploy that and see if it changes anything.
> >>
> >> It did! Memory usage went down to 7MiB yet it still grows
> >> slightly. I'll monitor if it changes in a couple of hours but
> >> it is much better.
> >>
> >> Thank you a lot, Radu. It turns out that theAllocator is so
> >> tricky.
> >
> > Again you could do @nogc and see what memory is possibly
> > allocated by the GC and perhaps that way you can see what
> > memory the GC is holding on to.
>
> @nogc tells nothing new, just an error on every single line
> because neither `res.bodyReader.read` nor Mallocator's functions
> are marked as @nogc.
>
> Compiling with dmd's `-vgc` flag shows nothing but the last line.
>
> >
> > non-GC memory should be freed right away and those there
> > shouldn't be a leak from that.
>
> Using Mallocator instead of theAllocator improved the situation,
> but it still leaks for some reason. After 2 hours it went from
> 7MiB to 18MiB.
>
> I will compile it with profile-gc again and look for the possible
> cause of that, maybe I'll try valgrind too.
>
>
>


[Issue 14916] opDispatch: no property error for parameter type mismatch

2018-06-29 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14916

--- Comment #2 from teddybear12...@gmail.com ---
Same problem.

I wanted to provide key to field emulation and nothing works correctly
consistently. I have override various op's such as opCall and opDispatch and
they all are not called when the property is used. The code has worked in the
past but i changed a few internal things not related to the opDispatch and then
it started failing again. The error is

test.d: Error: no property `y` for type `X`

where X implements opDispatch but which is never called for x.y.

--


Re: Dutyl 1.5.0 released - dfmt support added

2018-06-29 Thread Timoses via Digitalmars-d-announce

On Sunday, 24 June 2018 at 15:40:31 UTC, Timoses wrote:

On Wednesday, 20 June 2018 at 19:08:49 UTC, Timoses wrote:

Timoses  wrote:

Any ideas why autocompletion doesn't?


How does it work??


It's ctrl-x ctrl-o. More info in
:help omnifunc


Re: High memory usage in vibe.d application

2018-06-29 Thread Anton Fediushin via Digitalmars-d-learn

On Friday, 29 June 2018 at 11:42:18 UTC, bauss wrote:

On Friday, 29 June 2018 at 11:24:14 UTC, Anton Fediushin wrote:

On Friday, 29 June 2018 at 11:01:41 UTC, Anton Fediushin wrote:

On Friday, 29 June 2018 at 10:21:24 UTC, Radu wrote:
On Friday, 29 June 2018 at 09:44:27 UTC, Anton Fediushin 
wrote:
Almost forgot, there are two timers which call this 
function for two different streams.


Value of `metaint` is 16000, which means that only 16KB of 
memory are allocated for the `buffer`, then it reads 
another byte which contains length of the metadata / 16 and 
then it reads the metadata which is 100-200 bytes long.


This gives us... 16KiB per one nowPlaying() call. Why 
doesn't it free the memory?


Maybe use the 
https://dlang.org/phobos/std_experimental_allocator_mallocator.html instead of theAllocator as it defaults to GC.


Thanks, I'll try that.
...
I will deploy that and see if it changes anything.


It did! Memory usage went down to 7MiB yet it still grows 
slightly. I'll monitor if it changes in a couple of hours but 
it is much better.


Thank you a lot, Radu. It turns out that theAllocator is so 
tricky.


Again you could do @nogc and see what memory is possibly 
allocated by the GC and perhaps that way you can see what 
memory the GC is holding on to.


@nogc tells nothing new, just an error on every single line 
because neither `res.bodyReader.read` nor Mallocator's functions 
are marked as @nogc.


Compiling with dmd's `-vgc` flag shows nothing but the last line.



non-GC memory should be freed right away and those there 
shouldn't be a leak from that.


Using Mallocator instead of theAllocator improved the situation, 
but it still leaks for some reason. After 2 hours it went from 
7MiB to 18MiB.


I will compile it with profile-gc again and look for the possible 
cause of that, maybe I'll try valgrind too.





Re: DIP 1014--Hooking D's struct move semantics--Final Review

2018-06-29 Thread aliak via Digitalmars-d

On Wednesday, 27 June 2018 at 07:24:05 UTC, Mike Parker wrote:

On Wednesday, 27 June 2018 at 07:13:14 UTC, Mike Parker wrote:


Thanks in advance for your participation.


For those of you using the NNTP or mailing list interfaces, 
this is the thread to respond in. Thanks!


Alo!

This is great!

Just a clarification about the last paragraph phrasing

The last line: "We can further reduce this problem by calling the 
function opPostMove." seemed to imply that an alternate name to 
opPostMove would be mentioned, but am I correct in understanding 
that it is just saying that "naming this second function as op* 
will keep code breakage to a minimum" ?


Also, what should happen if someone defines an opPostMove for a 
class. Compile error or? Should something about that be mentioned?


Cheers
- Ali




Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Mike Parker via Digitalmars-d

On Friday, 29 June 2018 at 11:54:48 UTC, Joakim wrote:


I don't, I think it would be a huge improvement. There are very 
few benefits to getting people together in person in our 
hyperconnected age, and while "key developers in the same 
place" may be one of those, that excludes almost everybody else 
at DConf.


Except it doesn't exclude anyone -- it's not just the key 
developers.




Honestly, getting everybody together in a room and having them 
stare straight ahead at a speaker is a blindingly stupid waste 
of time these days. The only advantage of everybody being 
together in a room is the heightened communication bandwidth, 
and then you all sit next to each other staring straight ahead 
silently. The conference format made sense when pretty much 
everybody attending didn't have high-speed internet and 
connected video displays decades ago, but they make no sense 
now, as that blog post notes.


There are huge benefits to being there in person that extend 
beyond the time spent listening to the talks. People congregate 
in the lobby after hours, have three meals a day together, 
exchange ideas, make new contacts that lead to collaborations 
down the line... I wouldn't trade the time I've spent at the four 
DConfs I've attended for anything and very much regret missing 
the two I couldn't attend.





Re: I have a plan.. I really DO

2018-06-29 Thread Ecstatic Coder via Digitalmars-d-announce

On Friday, 29 June 2018 at 10:06:12 UTC, bauss wrote:

On Friday, 29 June 2018 at 08:43:34 UTC, Ecstatic Coder wrote:
As you know, I'm convinced that D could be marketed as the 
perfect language to develop native web servers and mobile 
applications, and have its core libraries somewhat extended in 
thqg direction, like Go and Crystal which allow "plug'n'play" 
web server development for instance


D allows for plug n' play web server development too.


Then this should be more advertised...

For instance :

https://crystal-lang.org/

The FIRST paragraph of text of Crystal's web page is :

"Syntax

Crystal’s syntax is heavily inspired by Ruby’s, so it feels 
natural to read and easy to write, and has the added benefit of a 
lower learning curve for experienced Ruby devs.


# A very basic HTTP server
require "http/server"

server = HTTP::Server.new do |context|
  context.response.content_type = "text/plain"
  context.response.print "Hello world, got 
#{context.request.path}!"

end

puts "Listening on http://127.0.0.1:8080;
server.listen(8080)
"

So the FIRST thing you learn about Crystal is that the standard 
library already gives you all you need to program a simple "hello 
world" web server.


The Go standard library is also known to provide the same 
building blocks :


package main

import (
"fmt"
"net/http"
)

func main() {
	http.HandleFunc("/", func(w http.ResponseWriter, r 
*http.Request) {

fmt.Fprintf(w, "Hello, you've requested: %s\n", r.URL.Path)
})

http.ListenAndServe(":80", nil)
}

Both are batteries-included for web development. That's why many 
developers don't feel the need to use thirdparty frameworks to 
implement their microservices...


So if it's also the case for D, then sorry for my mistake...


Re: A Case for Oxidation: A potential missed opportunity for D

2018-06-29 Thread kinke via Digitalmars-d

On Friday, 29 June 2018 at 11:47:51 UTC, Jonathan M Davis wrote:

However, if you're trying to use D from a C or C++ application,
the fact that you have to deal with starting up and shutting
down druntime definitely causes problems.


Good point, thanks.


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread 鲜卑拓跋枫 via Digitalmars-d

On Friday, 29 June 2018 at 10:50:52 UTC, Joakim wrote:

On Friday, 29 June 2018 at 09:31:05 UTC, 鲜卑拓跋枫 wrote:

On Friday, 29 June 2018 at 09:20:55 UTC, Joakim wrote:

On Friday, 29 June 2018 at 09:03:19 UTC, 鲜卑拓跋枫 wrote:

   [...]


I get the sense that the US and Germany have the largest 
amount of heavy D users, which is why all the DConfs so far 
have been held in those two countries. Three of the five 
largest D Meetup groups are in those countries:


https://www.meetup.com/topics/dpl/

However, Ali notes significant interest in his D book in 
China and Russia (also see updated stats later in that 
thread):


https://forum.dlang.org/post/oarr8l$19rh$1...@digitalmars.com

Japan may be in third place for heavy users, as Kenji Hara 
and a few others are significant contributors, and they 
certainly tweet about dlang:


https://mobile.twitter.com/hashtag/dlang

It may be a good forward-looking move to hold one of the next 
two or three DConfs in Japan or Hong Kong, perhaps working 
with Laeeth and the Hong Kong Meetup group.



Thanks for sharing these info!
Maybe China is also a good candidate:), as we know that 
Chinese companies like
PuTao(http://www.huntframework.com/) is using D for their 
production environment and has been contributed to many D open 
source projects.


I coincidentally just read this blog post, that summarizes a 
lot of my thoughts against conferences and meetups:


https://marco.org/2018/01/17/end-of-conference-era

Maybe a good first step would be a mostly online DConf geared 
towards Asian timezones? I could help out with arranging those 
online talks.



It seems that people in different countries of Asia may live in 
different timezone.


Re: Visual D 0.47.0 released

2018-06-29 Thread Guillaume Piolat via Digitalmars-d-announce

On Sunday, 24 June 2018 at 13:08:53 UTC, Rainer Schuetze wrote:

Happy coding,
Rainer


Thanks!


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread 鲜卑拓跋枫 via Digitalmars-d

On Friday, 29 June 2018 at 10:14:42 UTC, bauss wrote:

On Friday, 29 June 2018 at 09:03:19 UTC, 鲜卑拓跋枫 wrote:

Dear all,
   How about set up DConf Asia every year? As far as I know, 
there are a few D  programmers and fans in Asia, but DConf was 
traditionally held in U.S. or Germany before,so that it may be 
not convenient for them to take part in these celebrations.
   Today more and more programmers in Asia are embracing Open 
Source, and many technology conferences have their Asia 
version such like the just concluded LinuxCon + ContainerCon + 
CloudOpen that has been held in Beijing for two years, and the 
KubeCon + CloudNativeCon will be held on Nov in Shanghai this 
year, and many Linux/BSD conferences for Kernel or 
Distributions have been held in Japan, Korea, and so on.
   For programming languages, PyCon APAC has been successfully 
held in many Asian
countries each year. And Gopher China has also been held for 
many years.
   So I wonder if DConf can be held in Asia will be sure to 
greatly expand the influence of D languages, and attract the 
eyes of the largest group of programmers in the world.

   All suggestions are welcome!


I would love a DConf in Asia.

Would give me a reason to travel there other than vacation :)


Welcome!


Re: A Case for Oxidation: A potential missed opportunity for D

2018-06-29 Thread kinke via Digitalmars-d

On Friday, 29 June 2018 at 11:31:17 UTC, Radu wrote:

There technical and political reason here.

BetterC offers a clean no-overhead strictly enforced subset of 
the language. This is great for porting over existing C code 
base and also for creating equivalent libs in D but without 
worrying that you carry over baggage from the D run-time.


It also serves as a good tire 1 target when porting D to other 
platforms. WebAssembly is one of those odd platforms were D 
could shine, and having betterC greatly easy the effort of 
porting it over (even though so far nobody stepped out to do 
this).


C is a beast and its hardcore programmers will not touch 
anything that has typeinfo, gc or classes. Selling betterC to 
them (this includes teammates) is a lot easier, you can show 
them the assembly on godblot.org and they see no extra fat is 
added. @safe is the added bonus and the final nail in the 
coffin to ditch C.


But ultimately betterC is also a sign of the design failure on 
both dlang and druntime in the way that it wasn't conceived to 
be modular and easier to use in a pay-as-you-go fashion. Until 
the GC and typeinfo is truly optional and reserved only for the 
top layers of the standard library betterC is the best we have.


Okay, thanks for the rationale. If it's mainly about 
Type-/ModuleInfos bloat and the GC, the compiler fed with 
-betterC could also


* continue to elide the Type-/ModuleInfo emission,
* additionally error out on all implicit druntime calls to the GC,
* still link in druntime and Phobos.

That should make more things work, incl. the above slice copy and 
(manually allocated) extern(C++) classes.


Re: A Case for Oxidation: A potential missed opportunity for D

2018-06-29 Thread SrMordred via Digitalmars-d

 and non-template-only Phobos.


unless they are using betterC (undefined reference to 
'_d_arraycopy')?


Are you sure about this?

//flags: -betterC -noboundscheck
extern(C):
void main()
{
import core.stdc.stdlib;
int[] x = ( cast(int*) malloc( int.sizeof * 10 ) )[0 .. 10];
int[] y = ( cast(int*) malloc( int.sizeof * 10 ) )[0 .. 10];

import std.algorithm : map;

x.map!( x => x * 2 );

x[] = y[];
}

//compiles and works ok.





Re: A Case for Oxidation: A potential missed opportunity for D

2018-06-29 Thread rikki cattermole via Digitalmars-d

On 29/06/2018 11:36 PM, kinke wrote:

On Friday, 29 June 2018 at 11:24:52 UTC, rikki cattermole wrote:
It is a language feature yes, and it doesn't define /how/ it gets 
implemented.


That's besides my actual point though (and I haven't even mentioned 
missing class support, which is everything but helping with developing 
against existing C++ codebases).


It was besides mine as well.

My question is: what do people expect to gain by not linking in druntime 
and Phobos? Is there a feeling the binaries are unnecessarily bloated 
(-> minimal runtime)? Is it making cross-compilation harder (LDC has the 
ldc-build-runtime tool for that)? Is it the cozy feeling that the GC 
won't used at all? ...


Simple, it isn't there to prevent technical issues, it is to remove 
mental barriers.


There is a field dedicated to researching this, called Human Computer 
Interaction (HCI) and so far, it seems to have been what was needed for 
its users.


You and I do not suffer this block. But many do, and it is as hard and 
concrete to them as not having actual proper shared library support is 
to me.


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Joakim via Digitalmars-d

On Friday, 29 June 2018 at 11:32:13 UTC, Jonathan M Davis wrote:
On Friday, June 29, 2018 10:50:52 Joakim via Digitalmars-d 
wrote:
I coincidentally just read this blog post, that summarizes a 
lot of my thoughts against conferences and meetups:


https://marco.org/2018/01/17/end-of-conference-era

Maybe a good first step would be a mostly online DConf geared 
towards Asian timezones? I could help out with arranging those 
online talks.


That article seems to pre-suppose that the only benefit from 
conferences is the talks. A _lot_ of good comes from having a 
bunch of the key developers in the same place for a few days 
where they can talk in person.


It "pre-supposes" nothing, points like yours are specifically 
addressed:


"But all of that media can’t really replace the socializing, 
networking, and simply fun that happened as part of (or sometimes 
despite) the conference formula."


Some communities (e.g. the BSD community) even have developer 
meetings connected to conferences where they specifically put a 
bunch of developers in a room together to discuss stuff. The 
talks are valuable, but in some ways, those face-to-face 
interactions are worth far more than the talks. So, while 
there's certainly value in finding ways to get more talks 
online, I think that it would be a huge mistake to try and push 
for online stuff to replace physical conferences where 
developers actually interact with each other in person.


I don't, I think it would be a huge improvement. There are very 
few benefits to getting people together in person in our 
hyperconnected age, and while "key developers in the same place" 
may be one of those, that excludes almost everybody else at DConf.


Honestly, getting everybody together in a room and having them 
stare straight ahead at a speaker is a blindingly stupid waste of 
time these days. The only advantage of everybody being together 
in a room is the heightened communication bandwidth, and then you 
all sit next to each other staring straight ahead silently. The 
conference format made sense when pretty much everybody attending 
didn't have high-speed internet and connected video displays 
decades ago, but they make no sense now, as that blog post notes.


Re: A Case for Oxidation: A potential missed opportunity for D

2018-06-29 Thread Jonathan M Davis via Digitalmars-d
On Friday, June 29, 2018 10:55:27 kinke via Digitalmars-d wrote:
> On Friday, 29 June 2018 at 10:00:09 UTC, Radu wrote:
> > While not necessarily targeting bare metal, I'm very interested
> > in a working version of @safe dlang. I believe that dlang with
> > betterC, @safe, C/C++ inter-op and dip1000 will be huge for
> > replacing C/C++.
>
> I'd love to hear some reasons for -betterC from a competent guy
> like yourself. I simply don't get what all the fuzz is about and
> what people expect to gain from losing druntime (and language
> features depending on it) and non-template-only Phobos. I
> understand the separate 'minimal runtime' need for bare metal (no
> Type- and ModuleInfos etc.), but I can't help myself in seeing
> betterC as, nicely put, worseD. I acknowledge that it seems to
> attract wide-spread interest, and I'd like to understand why.

I completely agree that -betterC means -worseD, and in general, I see no
reason to mess with it if I can avoid it. However, if you're trying to use D
from a C or C++ application, the fact that you have to deal with starting up
and shutting down druntime definitely causes problems (as does the GC - not
because of performance but due to the fact that you then have non-D code
interacting with GC-allocated memory, and that gets complicated). It's far
easier to have C/C++ code call D code that has a C API and doesn't require
an additional runtime. The result is definitely worse than just using D, but
if you're stuck with having C/C++ and are trying to use D from within that
environment, -betterC gives you a way. I'm honestly not sure that using a
stripped down D is enough better than using C/C++ to be worth it (especially
if you're stuck using D like C when you could be using C++ instead), but
there's certainly an argument to be made for it.

The other place that -betterC has real value is when porting a C/C++
application to D. By porting portions of it to -betterC, you can do the
porting piecemeal, and then once the porting is complete, you can ditch
-betterC and use proper D. In contrast, if you tried to go straight to
full-on D, you tend to have to port large portions of the program at a time
(perhaps even the entire thing), which is much harder to do. In such a case,
-betterC is really just a stepping stone and not something that you'd want
to use normally.

However, if you don't need to hook D into an existing C/C++ application (be
it to add functionality or to actually port the code), then personally, I
think that -betterC is definitely just -worseD and an utter waste of time.
But some folks (especially those who are really biased against the GC) do
seem to leap at the idea as if it fixes D.

- Jonathan M Davis



Re: Is it possible to set up DConf Asia?

2018-06-29 Thread bauss via Digitalmars-d

On Friday, 29 June 2018 at 11:32:13 UTC, Jonathan M Davis wrote:
On Friday, June 29, 2018 10:50:52 Joakim via Digitalmars-d 
wrote:
I coincidentally just read this blog post, that summarizes a 
lot of my thoughts against conferences and meetups:


https://marco.org/2018/01/17/end-of-conference-era

Maybe a good first step would be a mostly online DConf geared 
towards Asian timezones? I could help out with arranging those 
online talks.


That article seems to pre-suppose that the only benefit from 
conferences is the talks. A _lot_ of good comes from having a 
bunch of the key developers in the same place for a few days 
where they can talk in person. Some communities (e.g. the BSD 
community) even have developer meetings connected to 
conferences where they specifically put a bunch of developers 
in a room together to discuss stuff. The talks are valuable, 
but in some ways, those face-to-face interactions are worth far 
more than the talks. So, while there's certainly value in 
finding ways to get more talks online, I think that it would be 
a huge mistake to try and push for online stuff to replace 
physical conferences where developers actually interact with 
each other in person.


- Jonathan M Davis


A major difference between most conferences and DConf from my 
perspective are things like the Hackathon etc. which makes it 
more than just a conference, but more like a large social D event.


Re: High memory usage in vibe.d application

2018-06-29 Thread bauss via Digitalmars-d-learn

On Friday, 29 June 2018 at 11:24:14 UTC, Anton Fediushin wrote:

On Friday, 29 June 2018 at 11:01:41 UTC, Anton Fediushin wrote:

On Friday, 29 June 2018 at 10:21:24 UTC, Radu wrote:
On Friday, 29 June 2018 at 09:44:27 UTC, Anton Fediushin 
wrote:
Almost forgot, there are two timers which call this function 
for two different streams.


Value of `metaint` is 16000, which means that only 16KB of 
memory are allocated for the `buffer`, then it reads another 
byte which contains length of the metadata / 16 and then it 
reads the metadata which is 100-200 bytes long.


This gives us... 16KiB per one nowPlaying() call. Why 
doesn't it free the memory?


Maybe use the 
https://dlang.org/phobos/std_experimental_allocator_mallocator.html instead of theAllocator as it defaults to GC.


Thanks, I'll try that.
...
I will deploy that and see if it changes anything.


It did! Memory usage went down to 7MiB yet it still grows 
slightly. I'll monitor if it changes in a couple of hours but 
it is much better.


Thank you a lot, Radu. It turns out that theAllocator is so 
tricky.


Again you could do @nogc and see what memory is possibly 
allocated by the GC and perhaps that way you can see what memory 
the GC is holding on to.


non-GC memory should be freed right away and those there 
shouldn't be a leak from that.


Re: A Case for Oxidation: A potential missed opportunity for D

2018-06-29 Thread kinke via Digitalmars-d

On Friday, 29 June 2018 at 11:24:52 UTC, rikki cattermole wrote:
It is a language feature yes, and it doesn't define /how/ it 
gets implemented.


That's besides my actual point though (and I haven't even 
mentioned missing class support, which is everything but helping 
with developing against existing C++ codebases).
My question is: what do people expect to gain by not linking in 
druntime and Phobos? Is there a feeling the binaries are 
unnecessarily bloated (-> minimal runtime)? Is it making 
cross-compilation harder (LDC has the ldc-build-runtime tool for 
that)? Is it the cozy feeling that the GC won't used at all? ...


Re: A Case for Oxidation: A potential missed opportunity for D

2018-06-29 Thread Radu via Digitalmars-d

On Friday, 29 June 2018 at 10:55:27 UTC, kinke wrote:

On Friday, 29 June 2018 at 10:00:09 UTC, Radu wrote:
While not necessarily targeting bare metal, I'm very 
interested in a working version of @safe dlang. I believe that 
dlang with betterC, @safe, C/C++ inter-op and dip1000 will be 
huge for replacing C/C++.


I'd love to hear some reasons for -betterC from a competent guy 
like yourself. I simply don't get what all the fuzz is about 
and what people expect to gain from losing druntime (and 
language features depending on it) and non-template-only 
Phobos. I understand the separate 'minimal runtime' need for 
bare metal (no Type- and ModuleInfos etc.), but I can't help 
myself in seeing betterC as, nicely put, worseD. I acknowledge 
that it seems to attract wide-spread interest, and I'd like to 
understand why.


There technical and political reason here.

BetterC offers a clean no-overhead strictly enforced subset of 
the language. This is great for porting over existing C code base 
and also for creating equivalent libs in D but without worrying 
that you carry over baggage from the D run-time.


It also serves as a good tire 1 target when porting D to other 
platforms. WebAssembly is one of those odd platforms were D could 
shine, and having betterC greatly easy the effort of porting it 
over (even though so far nobody stepped out to do this).


C is a beast and its hardcore programmers will not touch anything 
that has typeinfo, gc or classes. Selling betterC to them (this 
includes teammates) is a lot easier, you can show them the 
assembly on godblot.org and they see no extra fat is added. @safe 
is the added bonus and the final nail in the coffin to ditch C.


But ultimately betterC is also a sign of the design failure on 
both dlang and druntime in the way that it wasn't conceived to be 
modular and easier to use in a pay-as-you-go fashion. Until the 
GC and typeinfo is truly optional and reserved only for the top 
layers of the standard library betterC is the best we have.


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Jonathan M Davis via Digitalmars-d
On Friday, June 29, 2018 10:50:52 Joakim via Digitalmars-d wrote:
> I coincidentally just read this blog post, that summarizes a lot
> of my thoughts against conferences and meetups:
>
> https://marco.org/2018/01/17/end-of-conference-era
>
> Maybe a good first step would be a mostly online DConf geared
> towards Asian timezones? I could help out with arranging those
> online talks.

That article seems to pre-suppose that the only benefit from conferences is
the talks. A _lot_ of good comes from having a bunch of the key developers
in the same place for a few days where they can talk in person. Some
communities (e.g. the BSD community) even have developer meetings connected
to conferences where they specifically put a bunch of developers in a room
together to discuss stuff. The talks are valuable, but in some ways, those
face-to-face interactions are worth far more than the talks. So, while
there's certainly value in finding ways to get more talks online, I think
that it would be a huge mistake to try and push for online stuff to replace
physical conferences where developers actually interact with each other in
person.

- Jonathan M Davis



Re: A Case for Oxidation: A potential missed opportunity for D

2018-06-29 Thread rikki cattermole via Digitalmars-d

On 29/06/2018 11:17 PM, kinke wrote:

On Friday, 29 June 2018 at 11:04:30 UTC, rikki cattermole wrote:

It greatly simplifies development against existing C/C++ codebases.


How so? By telling people you can express C++:

void cpy(char *dst, const char *src, size_t size)
{
     for (size_t i; i < size; ++i)
     dst[i] = src[i];
}

elegantly and safe like this in D:

void cpy(void[] dst, void[] src) { dst[] = src[]; }

unless they are using betterC (undefined reference to '_d_arraycopy')? 
Just to highlight one lost language feature.


It is a language feature yes, and it doesn't define /how/ it gets 
implemented.


In fact the spec[0][1] implies that it generates highly optimized 
assembly, not go and call a function.


[0] https://dlang.org/spec/simd.html
[1] https://dlang.org/spec/arrays.html#array-copying


Re: High memory usage in vibe.d application

2018-06-29 Thread Anton Fediushin via Digitalmars-d-learn

On Friday, 29 June 2018 at 11:01:41 UTC, Anton Fediushin wrote:

On Friday, 29 June 2018 at 10:21:24 UTC, Radu wrote:

On Friday, 29 June 2018 at 09:44:27 UTC, Anton Fediushin wrote:
Almost forgot, there are two timers which call this function 
for two different streams.


Value of `metaint` is 16000, which means that only 16KB of 
memory are allocated for the `buffer`, then it reads another 
byte which contains length of the metadata / 16 and then it 
reads the metadata which is 100-200 bytes long.


This gives us... 16KiB per one nowPlaying() call. Why doesn't 
it free the memory?


Maybe use the 
https://dlang.org/phobos/std_experimental_allocator_mallocator.html instead of theAllocator as it defaults to GC.


Thanks, I'll try that.
...
I will deploy that and see if it changes anything.


It did! Memory usage went down to 7MiB yet it still grows 
slightly. I'll monitor if it changes in a couple of hours but it 
is much better.


Thank you a lot, Radu. It turns out that theAllocator is so 
tricky.


Re: A Case for Oxidation: A potential missed opportunity for D

2018-06-29 Thread kinke via Digitalmars-d

On Friday, 29 June 2018 at 11:04:30 UTC, rikki cattermole wrote:
It greatly simplifies development against existing C/C++ 
codebases.


How so? By telling people you can express C++:

void cpy(char *dst, const char *src, size_t size)
{
for (size_t i; i < size; ++i)
dst[i] = src[i];
}

elegantly and safe like this in D:

void cpy(void[] dst, void[] src) { dst[] = src[]; }

unless they are using betterC (undefined reference to 
'_d_arraycopy')? Just to highlight one lost language feature.


Re: I have a plan.. I really DO

2018-06-29 Thread jmh530 via Digitalmars-d-announce

On Friday, 29 June 2018 at 07:03:52 UTC, Dmitry Olshansky wrote:

[snip]


I'm a little confused. You're going to send $10 a day to D 
Foundation because you're upset about people complaining about D?


I have my donation come through my paycheck. Company matches up 
to a certain amount a year. It's like I don't even see it.


Re: High memory usage in vibe.d application

2018-06-29 Thread rikki cattermole via Digitalmars-d-learn

On 29/06/2018 11:09 PM, Anton Fediushin wrote:
It is GC's fault for sure, I built my program with profile-gc and it 
allocated a lot there. Question is, why doesn't it free this memory?


Probably doesn't know that it should deallocate so eagerly.
A GC.collect(); call may help.


Re: High memory usage in vibe.d application

2018-06-29 Thread Anton Fediushin via Digitalmars-d-learn

On Friday, 29 June 2018 at 10:31:14 UTC, bauss wrote:

On Friday, 29 June 2018 at 10:21:24 UTC, Radu wrote:

On Friday, 29 June 2018 at 09:44:27 UTC, Anton Fediushin wrote:
Almost forgot, there are two timers which call this function 
for two different streams.


Value of `metaint` is 16000, which means that only 16KB of 
memory are allocated for the `buffer`, then it reads another 
byte which contains length of the metadata / 16 and then it 
reads the metadata which is 100-200 bytes long.


This gives us... 16KiB per one nowPlaying() call. Why doesn't 
it free the memory?


Maybe use the 
https://dlang.org/phobos/std_experimental_allocator_mallocator.html instead of theAllocator as it defaults to GC.


Also, why you .idup the array? .array already creates a new 
one on the heap.


This.

Which kind of makes the usage of theAllocator useless.


Indeed, because it uses GC by default my `theAllocator.dispose` 
did nothing, which basically made these two samples of code equal.




I was going to suggest using @nogc too, because it would most 
likely be GC allocated memory that is taking up space.


It is GC's fault for sure, I built my program with profile-gc and 
it allocated a lot there. Question is, why doesn't it free this 
memory?




I run multiple vibe.d applications and I have no issues with 
memory (Even with GC.)


Me neither, my other vibe.d project uses 7.5MB and that's it.




Re: A Case for Oxidation: A potential missed opportunity for D

2018-06-29 Thread rikki cattermole via Digitalmars-d

On 29/06/2018 10:55 PM, kinke wrote:

On Friday, 29 June 2018 at 10:00:09 UTC, Radu wrote:
While not necessarily targeting bare metal, I'm very interested in a 
working version of @safe dlang. I believe that dlang with betterC, 
@safe, C/C++ inter-op and dip1000 will be huge for replacing C/C++.


I'd love to hear some reasons for -betterC from a competent guy like 
yourself. I simply don't get what all the fuzz is about and what people 
expect to gain from losing druntime (and language features depending on 
it) and non-template-only Phobos. I understand the separate 'minimal 
runtime' need for bare metal (no Type- and ModuleInfos etc.), but I 
can't help myself in seeing betterC as, nicely put, worseD. I 
acknowledge that it seems to attract wide-spread interest, and I'd like 
to understand why.


It greatly simplifies development against existing C/C++ codebases.
To some people (for their given use cases) this can be a very good thing.

Removing barriers for adoption is a very noble but more importantly wise 
thing to do, and we should all aim to do it.


Re: High memory usage in vibe.d application

2018-06-29 Thread Anton Fediushin via Digitalmars-d-learn

On Friday, 29 June 2018 at 10:21:24 UTC, Radu wrote:

On Friday, 29 June 2018 at 09:44:27 UTC, Anton Fediushin wrote:
Almost forgot, there are two timers which call this function 
for two different streams.


Value of `metaint` is 16000, which means that only 16KB of 
memory are allocated for the `buffer`, then it reads another 
byte which contains length of the metadata / 16 and then it 
reads the metadata which is 100-200 bytes long.


This gives us... 16KiB per one nowPlaying() call. Why doesn't 
it free the memory?


Maybe use the 
https://dlang.org/phobos/std_experimental_allocator_mallocator.html instead of theAllocator as it defaults to GC.


Thanks, I'll try that.



Also, why you .idup the array? .array already creates a new one 
on the heap.


It does, but it creates char[] and I need a string. I changed 
code a little bit to remove unnecessary `map` and `idup` too.


Code now:

```
@safe string nowPlaying(string url) {
import vibe.core.stream;
import std.experimental.allocator;
import std.experimental.allocator.mallocator;
import std.string;

string r;
url.requestHTTP(
(scope req) {
req.headers.addField("Icy-MetaData", "1");
},
(scope res) {
RCIAllocator a = allocatorObject(Mallocator.instance);

auto metaint = res.headers.get("icy-metaint").to!int;
auto buffer = a.makeArray!ubyte(metaint);
scope(exit) a.dispose(buffer);
res.bodyReader.read(buffer, IOMode.all);

auto lengthBuffer = a.makeArray!ubyte(1);
scope(exit) a.dispose(lengthBuffer);
res.bodyReader.read(lengthBuffer, IOMode.all);

auto dataBuffer = a.makeArray!ubyte(lengthBuffer[0] * 
16);
scope(exit) a.dispose(dataBuffer);
res.bodyReader.read(dataBuffer, IOMode.all);

r = 
dataBuffer.split('\'').drop(1).front.array.assumeUTF;

res.disconnect;
}
);
return r;
}
```

I will deploy that and see if it changes anything.



Re: A Case for Oxidation: A potential missed opportunity for D

2018-06-29 Thread Dejan Lekic via Digitalmars-d

On Friday, 29 June 2018 at 10:55:27 UTC, kinke wrote:
Phobos. I understand the separate 'minimal runtime' need for 
bare metal (no Type- and ModuleInfos etc.), but I can't help 
myself in seeing betterC as, nicely put, worseD. I acknowledge


I *completely* agree. However, I have nothing against betterC as 
long as people like me, who do enterprise software, are 
guaranteed to see "-betterD" option (here I actually mean - as 
long as the "regular" D is improving)...


Re: A Case for Oxidation: A potential missed opportunity for D

2018-06-29 Thread kinke via Digitalmars-d

On Friday, 29 June 2018 at 10:00:09 UTC, Radu wrote:
While not necessarily targeting bare metal, I'm very interested 
in a working version of @safe dlang. I believe that dlang with 
betterC, @safe, C/C++ inter-op and dip1000 will be huge for 
replacing C/C++.


I'd love to hear some reasons for -betterC from a competent guy 
like yourself. I simply don't get what all the fuzz is about and 
what people expect to gain from losing druntime (and language 
features depending on it) and non-template-only Phobos. I 
understand the separate 'minimal runtime' need for bare metal (no 
Type- and ModuleInfos etc.), but I can't help myself in seeing 
betterC as, nicely put, worseD. I acknowledge that it seems to 
attract wide-spread interest, and I'd like to understand why.


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Joakim via Digitalmars-d

On Friday, 29 June 2018 at 09:31:05 UTC, 鲜卑拓跋枫 wrote:

On Friday, 29 June 2018 at 09:20:55 UTC, Joakim wrote:

On Friday, 29 June 2018 at 09:03:19 UTC, 鲜卑拓跋枫 wrote:

   [...]


I get the sense that the US and Germany have the largest 
amount of heavy D users, which is why all the DConfs so far 
have been held in those two countries. Three of the five 
largest D Meetup groups are in those countries:


https://www.meetup.com/topics/dpl/

However, Ali notes significant interest in his D book in China 
and Russia (also see updated stats later in that thread):


https://forum.dlang.org/post/oarr8l$19rh$1...@digitalmars.com

Japan may be in third place for heavy users, as Kenji Hara and 
a few others are significant contributors, and they certainly 
tweet about dlang:


https://mobile.twitter.com/hashtag/dlang

It may be a good forward-looking move to hold one of the next 
two or three DConfs in Japan or Hong Kong, perhaps working 
with Laeeth and the Hong Kong Meetup group.



Thanks for sharing these info!
Maybe China is also a good candidate:), as we know that Chinese 
companies like
PuTao(http://www.huntframework.com/) is using D for their 
production environment and has been contributed to many D open 
source projects.


I coincidentally just read this blog post, that summarizes a lot 
of my thoughts against conferences and meetups:


https://marco.org/2018/01/17/end-of-conference-era

Maybe a good first step would be a mostly online DConf geared 
towards Asian timezones? I could help out with arranging those 
online talks.


Re: Is it possible to set up DConf Asia?

2018-06-29 Thread Mike Parker via Digitalmars-d

On Friday, 29 June 2018 at 10:18:01 UTC, Michael wrote:

On Friday, 29 June 2018 at 10:12:28 UTC, Mike Parker wrote:


I can tell you that DConf Asia is something the Foundation is 
interested in. It's also something I plan to work toward 
making happen eventually. We discussed this at our Seoul 
meetup recently. What I need to know before anything can 
happen is how large the Chinese and Japanese D communities are.


I guess the best place to start is to organise meetups in the 
countries first to gauge interest and the size of the D 
community in those countries, and then there can be some 
communication between the local meetups aiming at organising a 
more regional DConf?


As I understand it, they already have active D communities with 
their own forums & blogs and probably meetups. Several of the D 
blog posts have been translated to Japanese and the D_Programming 
tweets are often retweeted by a Japanese account. We just need to 
tap into those existing communities and find out their size, 
composition, etc, and who can help us organize.


  1   2   >