Re: Where is GDC being developed?

2019-03-21 Thread Mike Franklin via Digitalmars-d-learn

On Thursday, 21 March 2019 at 22:51:21 UTC, James Blachly wrote:

Thanks -- I also tried to figure out how to install GDC just 
yesterday and gave up. All wiki links and google top results 
seemed dead ends.


I'm also a little puzzled by how GDC is structured, but I have 
learned a few things with the help of some of the GDC developers, 
and I'll share my understanding below (though be aware that my 
assumptions may be wrong).


GDC is in a weird state right now where it needs to boostrap 
itself.  The bootstrap compiler has a front-end written in C++, 
but the lastest GDC on GitHub has a front-end written in D.


My understanding is that this bootstrap compiler with the 
front-end written in C++ is what is being released with GCC 9.  
Since GCC always needs to be able to be built with a prior 
version of GCC, GCC 10 will be the first release with the latest 
D frontend.


So, to build your own GDC compiler, you need to first build the 
bootstrap compiler.  I have a script for that at 
https://github.com/JinShil/native-gdc


Then, using the bootstrap compiler, you can build the latest GDC 
with the D frontend from GitHub.  I have a script for that too, 
but it is only for building an ARM cross-compiler.  See 
https://github.com/JinShil/arm-none-eabi-gdc


Mike


Re: Where is GDC being developed?

2019-03-21 Thread James Blachly via Digitalmars-d-learn

On 3/21/19 6:51 PM, James Blachly wrote:

On 3/21/19 6:01 AM, Johannes Pfau wrote:

On Thursday, 21 March 2019 at 08:19:56 UTC, Per Nordlöw wrote:

At

https://github.com/D-Programming-GDC/GDC/commits/master

there's the heading

"This repository has been archived by the owner. It is now read-only."

Where will the development of GDC continue?


We use https://github.com/D-Programming-GDC/gcc for CI, but commits 
will go to the GCC SVN first, so GCC SVN or snapshot tarballs is the 
recommended way to get the latest GDC.


There is one exception: When GCC development is in feature freeze, we 
might provide newer DMD frontends in a gdc-next branch at 
https://github.com/D-Programming-GDC/gcc . However, so far we have not 
set up this branch, this will probably happen in the next two weeks. 
Maybe I'll also provide DDMD-FE backports for GCC9 in that repo, but 
I'm not sure yet. The latest DDMD-FE is somewhere in the archived 
repos, but it hasn't been updated for some time.


Thanks -- I also tried to figure out how to install GDC just yesterday 
and gave up. All wiki links and google top results seemed dead ends.




A little bit of further information: the downloads listed on

https://gdcproject.org/downloads

are 2016 versions.


Re: Where is GDC being developed?

2019-03-21 Thread James Blachly via Digitalmars-d-learn

On 3/21/19 6:01 AM, Johannes Pfau wrote:

On Thursday, 21 March 2019 at 08:19:56 UTC, Per Nordlöw wrote:

At

https://github.com/D-Programming-GDC/GDC/commits/master

there's the heading

"This repository has been archived by the owner. It is now read-only."

Where will the development of GDC continue?


We use https://github.com/D-Programming-GDC/gcc for CI, but commits will 
go to the GCC SVN first, so GCC SVN or snapshot tarballs is the 
recommended way to get the latest GDC.


There is one exception: When GCC development is in feature freeze, we 
might provide newer DMD frontends in a gdc-next branch at 
https://github.com/D-Programming-GDC/gcc . However, so far we have not 
set up this branch, this will probably happen in the next two weeks. 
Maybe I'll also provide DDMD-FE backports for GCC9 in that repo, but I'm 
not sure yet. The latest DDMD-FE is somewhere in the archived repos, but 
it hasn't been updated for some time.


Thanks -- I also tried to figure out how to install GDC just yesterday 
and gave up. All wiki links and google top results seemed dead ends.




Re: Another Tuesday (Friday?), Another GtkDcoding Blog Post

2019-03-21 Thread Michelle Long via Digitalmars-d-learn

On Tuesday, 12 March 2019 at 14:44:59 UTC, Ron Tarrant wrote:
It was suggested that I do all these posts in one thread, so 
this is the thread where that'll happen. With that said...


It's Tuesday! (and that used to be a Theatresports game when 
Keith Johnstone still ran things)


OR...

It's Friday!

And that (the Tuesday OR Friday part) means it's time for 
another post on the gtkDcoding blog. Here it is: 
http://gtkdcoding.com/2019/03/12/0017-change-pointer.html


Today's topic: Changing the mouse pointer

You'll be thrilled by the heart-shaped point and tickled by the 
Gumby. Man, this stuff is exciting!


Sign up for RSS or follow on Facebook or drop me some email.

Anyway. 'Nuff said.


I'd suggest adding pictures! It's very easy to take a screen shot 
and not much harder to link them and they offer far more interest.




Re: Another Tuesday (Friday?), Another GtkDcoding Blog Post

2019-03-21 Thread number via Digitalmars-d-learn

On Tuesday, 12 March 2019 at 14:44:59 UTC, Ron Tarrant wrote:

another post on the gtkDcoding blog.


0010 says

Here’s the code file.
Here’s a second code file for you.


but no links. I guess it's
https://github.com/rontarrant/gtkDcoding/blob/master/003_box/box_003_03_checkbutton.d
and
https://github.com/rontarrant/gtkDcoding/blob/master/003_box/box_003_04_togglebutton.d



Re: Reading data from the network without knowing the size of the buffer that is coming

2019-03-21 Thread Adam D. Ruppe via Digitalmars-d-learn

On Thursday, 21 March 2019 at 18:27:56 UTC, Andre Pany wrote:
If the data received is smaller than 256 bytes, the array will 
contain NULL (character 0 value in the ascii table). This you 
might could use as indicator you received all values.



That's wrong, the correct thing to check is the return value of 
receive(). It gives the length it actually filled in (or 0 if the 
connection is finished, or negative on error conditions)


Re: Reading data from the network without knowing the size of the buffer that is coming

2019-03-21 Thread Roman Sztergbaum via Digitalmars-d-learn

On Thursday, 21 March 2019 at 18:27:56 UTC, Andre Pany wrote:
On Thursday, 21 March 2019 at 16:54:01 UTC, Roman Sztergbaum 
wrote:

[...]


I am also not a  expert in this area. If the message received 
from the server exceeds 256 bytes, you have to call the receive 
message several times until you know you received all bytes.


If the data received is smaller than 256 bytes, the array will 
contain NULL (character 0 value in the ascii table). This you 
might could use as indicator you received all values.


Is the server really without protocol? If the server code is 
under your control, you could switch to http, which has a 
message length attribute.


Ps. In case there is a network error, your program will 
terminate (out contract throws Error) without any chance to 
avoid this. You should throw an Exception at the end of method 
body instead for resource issues.


Kind regards
Andre

Hello,

I didn't precise it, but i use unix local socket communication, 
the layer is the KERNEL, and not TCP. I think i cannot use module 
http then.


But, i'm surprise that is not an other way that's is more simple, 
i will wait for some other answers i think.


Thank's for your help


Re: gtkD: How to paint to screen for animation

2019-03-21 Thread Michelle Long via Digitalmars-d-learn

On Tuesday, 19 March 2019 at 15:33:19 UTC, Ron Tarrant wrote:

On Tuesday, 19 March 2019 at 00:54:34 UTC, Michelle Long wrote:
I've added a function to addOnDraw for a DrawingArea and it 
paints using the code I have when I resize.


I added a queueDraw in threadsAddIdle and it seems to draws 
the screen immediately but it does not seem to be called again.


If I put queueDraw inside the addOnDraw routine then the 
animation works but it is quite slow, about 1 fps and cpu 
usage is 100% without it, it is 0%.


I haven't dug into this stuff yet for my blog, but I have 
sourced some references. Here's one that may help:


https://www.cairographics.org/threaded_animation_with_cairo/


Not really what I'm after(maybe later).  Seems the code was 
running quite fast but I thought it should have displayed the 
results faster


Re: gtkD: How to paint to screen for animation

2019-03-21 Thread Michelle Long via Digitalmars-d-learn

On Tuesday, 19 March 2019 at 19:03:37 UTC, Mike Wey wrote:

On 19-03-2019 01:54, Michelle Long wrote:
I've added a function to addOnDraw for a DrawingArea and it 
paints using the code I have when I resize.


I added a queueDraw in threadsAddIdle and it seems to draws 
the screen immediately but it does not seem to be called again.


If I put queueDraw inside the addOnDraw routine then the 
animation works but it is quite slow, about 1 fps and cpu 
usage is 100% without it, it is 0%.


You will probably want to use glib.Timeout to make the time 
between redraws consistent.
The callBack for treadsAddIdle or glib.Idle is only called when 
the mainloop has nothing else to do.


The cairo clock demo is a good example: 
https://github.com/gtkd-developers/GtkD/blob/master/demos/cairo/cairo_clock/clock.d


If performance is an issue one option would be to save your 
context in a cairo surface and only redraw the parts that have 
changed.



This seems to be not any different than calling queueDraw inside 
AddOnDraw. I did the timing code and it does seem to say that I'm 
getting max 60fps so maybe it is quite fast.


I was bitting an imagine and moving a rect across the screen at 
1px per frame. I though it should be moving much faster but 
apparently my mental calculations are not all that great. 1680/60 
~= 28 so it should take nearly half a minute to move the rect 
from one side to the other.


The behavior was essentially identical. I'm curious if the 
drawing routine itself uses Timeout to get 60fps and adding 
another timeout is only useful to regulate a slower fps?





Re: Reading data from the network without knowing the size of the buffer that is coming

2019-03-21 Thread Andre Pany via Digitalmars-d-learn
On Thursday, 21 March 2019 at 16:54:01 UTC, Roman Sztergbaum 
wrote:

Hello !

in my function :

```D
  private config_load_answer load_config(string[] args)
in(args !is null, "args cannot be null")
in(args.length == 2, "need 1 arguments")
out(r; r.state == "SUCCESS", "load_config should succeed")
out(r; !r.config_name.empty, "config_name should not be 
empty")
out(r; r.config_id > 0, "config_id should be different than 
0")

{
string config_key;
string readonly_config_key;
getopt(args, "key", _key, "readonly_key", 
_config_key);
auto cfg = 
deserialize_to!config_load("../API_doc/json_recipes/config_load.json");

cfg.config_key = config_key;
cfg.readonly_config_key = readonly_config_key;
writeln(cfg);
writeln(cfg.serializeToJsonPretty);
client_.socket.send(cfg.serializeToJson);
auto answer = new ubyte[256]; //
client_.socket.receive(answer);
(cast(string) answer).writeln;
return (cast(string) 
answer).deserialize!config_load_answer;

}
```

I would like to get rid of the "ubytes[256]" because I do not 
know the size of the data that is comming, I would like to read 
the entire buffer that I send at once. Can someone point me?


(i'm pretty new to D langage, but i'm familiar with C++, and 
for example in boost asio  we have `byte_transfered` so we can 
create a buffer with this size and read the incoming data)


Thank's a lot for your help !


I am also not a  expert in this area. If the message received 
from the server exceeds 256 bytes, you have to call the receive 
message several times until you know you received all bytes.


If the data received is smaller than 256 bytes, the array will 
contain NULL (character 0 value in the ascii table). This you 
might could use as indicator you received all values.


Is the server really without protocol? If the server code is 
under your control, you could switch to http, which has a message 
length attribute.


Ps. In case there is a network error, your program will terminate 
(out contract throws Error) without any chance to avoid this. You 
should throw an Exception at the end of method body instead for 
resource issues.


Kind regards
Andre


Reading data from the network without knowing the size of the buffer that is coming

2019-03-21 Thread Roman Sztergbaum via Digitalmars-d-learn

Hello !

in my function :

```D
  private config_load_answer load_config(string[] args)
in(args !is null, "args cannot be null")
in(args.length == 2, "need 1 arguments")
out(r; r.state == "SUCCESS", "load_config should succeed")
out(r; !r.config_name.empty, "config_name should not be 
empty")
out(r; r.config_id > 0, "config_id should be different than 
0")

{
string config_key;
string readonly_config_key;
getopt(args, "key", _key, "readonly_key", 
_config_key);
auto cfg = 
deserialize_to!config_load("../API_doc/json_recipes/config_load.json");

cfg.config_key = config_key;
cfg.readonly_config_key = readonly_config_key;
writeln(cfg);
writeln(cfg.serializeToJsonPretty);
client_.socket.send(cfg.serializeToJson);
auto answer = new ubyte[256]; //
client_.socket.receive(answer);
(cast(string) answer).writeln;
return (cast(string) 
answer).deserialize!config_load_answer;

}
```

I would like to get rid of the "ubytes[256]" because I do not 
know the size of the data that is comming, I would like to read 
the entire buffer that I send at once. Can someone point me?


(i'm pretty new to D langage, but i'm familiar with C++, and for 
example in boost asio  we have `byte_transfered` so we can create 
a buffer with this size and read the incoming data)


Thank's a lot for your help !



Re: Where is GDC being developed?

2019-03-21 Thread Johannes Pfau via Digitalmars-d-learn

On Thursday, 21 March 2019 at 08:19:56 UTC, Per Nordlöw wrote:

At

https://github.com/D-Programming-GDC/GDC/commits/master

there's the heading

"This repository has been archived by the owner. It is now 
read-only."


Where will the development of GDC continue?


We use https://github.com/D-Programming-GDC/gcc for CI, but 
commits will go to the GCC SVN first, so GCC SVN or snapshot 
tarballs is the recommended way to get the latest GDC.


There is one exception: When GCC development is in feature 
freeze, we might provide newer DMD frontends in a gdc-next branch 
at https://github.com/D-Programming-GDC/gcc . However, so far we 
have not set up this branch, this will probably happen in the 
next two weeks. Maybe I'll also provide DDMD-FE backports for 
GCC9 in that repo, but I'm not sure yet. The latest DDMD-FE is 
somewhere in the archived repos, but it hasn't been updated for 
some time.


Re: Where is GDC being developed?

2019-03-21 Thread JN via Digitalmars-d-learn

On Thursday, 21 March 2019 at 08:19:56 UTC, Per Nordlöw wrote:

At

https://github.com/D-Programming-GDC/GDC/commits/master

there's the heading

"This repository has been archived by the owner. It is now 
read-only."


Where will the development of GDC continue?


I am not exactly sure, but if GDC got merged into GCC, doesn't 
that mean that any new development will be done on the GCC 
repository?


Where is GDC being developed?

2019-03-21 Thread Per Nordlöw via Digitalmars-d-learn

At

https://github.com/D-Programming-GDC/GDC/commits/master

there's the heading

"This repository has been archived by the owner. It is now 
read-only."


Where will the development of GDC continue?