Re: Can we ease WASM in D ?

2022-11-16 Thread bioinfornatics via Digitalmars-d-learn

Thanks Adam, H. S., max for your point of view

On Wednesday, 16 November 2022 at 23:23:48 UTC, Adam D Ruppe 
wrote:
On Wednesday, 16 November 2022 at 23:16:26 UTC, H. S. Teoh 
wrote:
You mean with Phobos and everything included?  I think there 
may be issues with that...



Yes that would be really fantastic to get those enhancement. As 
example I see this wasm framework wrote in rust: 
https://github.com/yewstack/yew


Get a such framework in D wold be helpful


Can we ease WASM in D ?

2022-11-16 Thread bioinfornatics via Digitalmars-d-learn

Dear community,

I look some day ago to the D wasm page:
-> https://wiki.dlang.org/Generating_WebAssembly_with_LDC

And since then I ask myself can we at  compile time convert a D 
code to an extern C code for wasm ?


Indeed, if a library/framework  would wrap this to let end user 
write his code in plain D that would be awesome.


So did you think it is possible to do it by using 
metaprogramming, mixin, mixin template, mixin string … ?


Thanks for your ideas


Re: CalderaD - SDL2 Vulkan renderer for windows, linux, and android

2021-05-14 Thread bioinfornatics via Digitalmars-d-announce

On Friday, 14 May 2021 at 17:38:54 UTC, Danny Arends wrote:

On Friday, 14 May 2021 at 17:29:13 UTC, evilrat wrote:

On Friday, 14 May 2021 at 16:39:53 UTC, Danny Arends wrote:


Find the GPL-v3 licensed code here: 
https://github.com/DannyArends/CalderaD




You can set up platform filters in dub to automatically match 
target platforms without specifying configuration for build.


See this 
https://github.com/Superbelko/android-sdl-d/blob/master/dub.json


P.S. No idea why you choose GPL, I usually don't bother with 
GPL libraries because of license, and I think this is also the 
majority of people on this forum.


Hmm, things gotta have a license, why not GPL would CC0 be 
better? is attribution and sharing code so weird ?


I think: "license": "proprietary" also doesn't sound very 
inviting

Any suggestions license-wise ?

Thanks for the configuration tip


To complete the subject,
A GPL licence imply that any software that use your library have 
to be a GPL like licence.


Usually for a library we use a LGPL licence. That is a non viral 
licence bases on GPL.


Below a list if compatible licence :
https://fedoraproject.org/wiki/Licensing:Main?rd=Licensing#SoftwareLicenses


How DerelictCL works

2020-07-21 Thread bioinfornatics via Digitalmars-d-learn

Dear,

I would like to use OpenCL in D. Thus I try to use DerelictCL.
But I fail to use it I encounter this error message:
--
/opt/jonathan/jonathan-dlang_ldc2092/root/usr/include/d/derelict/opencl/constants.di(835):
 Error: genCLVectorTypes cannot be interpreted at compile time, because it has 
no available source code
/opt/jonathan/jonathan-dlang_ldc2092/root/usr/include/d/derelict/opencl/constants.di-mixin-835(835):
 Error: declaration expected, not <
--


The tiny D file is:
--test_opencl.d

import derelict.opencl.cl;

void main() {
// Load the OpenCL library.
DerelictCL.load();
}
---


The compile line is:

--
ldc2  -I /opt/jonathan/jonathan-dlang_ldc2092/root/usr/include/d/ 
\

  -L-L/usr/lib64 \
  -L-L/opt/jonathan/jonathan-dlang_ldc2092/root/usr/lib64 \
  -L-lOpenCL \
  -L-lDerelictUtil \
  -L-lDerelictCL \
  -of test \
  test_opencl.d
--

library are located at:
OpenL   /usr/lib64/libOpenCL.so
DerelictUtil
/opt/jonathan/jonathan-dlang_ldc2092/root/usr/lib64/libDerelictUtil.so
DerelictCL  
/opt/jonathan/jonathan-dlang_ldc2092/root/usr/lib64/libDerelictCL.so


Derelict include files:= are located at:
 - /opt/jonathan/jonathan-dlang_ldc2092/root/usr/include/d/


Thanks for your help

Best regards






Re: Using an async buffer

2019-11-08 Thread bioinfornatics via Digitalmars-d-learn

On Friday, 8 November 2019 at 14:32:25 UTC, bioinfornatics wrote:
On Friday, 8 November 2019 at 08:58:36 UTC, bioinfornatics 
wrote:

[...]


I do not have found yet why the line counter is false.
I can tell if the amount to read imply that the last read is 
not not strictly equal to the buffer then the result is false 
as if it left less thing to read the result is not shorter than 
requested buffer size as it is told into the documentation:

https://dlang.org/phobos/std_stdio.html#.File.rawRead

[...]



Updating the code with: (ref ubyte[] buffer){ buffer = 
file.rawRead(buffer); }


fix the problem.



Re: Using an async buffer

2019-11-08 Thread bioinfornatics via Digitalmars-d-learn

On Friday, 8 November 2019 at 08:58:36 UTC, bioinfornatics wrote:

the error message was understandable to me,


... the error message was not understandable to me ...


I do not have found yet why the line counter is false.
I can tell if the amount to read imply that the last read is not 
not strictly equal to the buffer then the result is false as if 
it left less thing to read the result is not shorter than 
requested buffer size as it is told into the documentation:

https://dlang.org/phobos/std_stdio.html#.File.rawRead

as example I change the code in order to shuffle line content to 
get the ability to locate the bug


Real last lines are:
1
190121746114132251381321230342516302196252336238211523943272873744285119323293314107
31631221132661353262123081115418570291330356278322215013742329426
71421331023593822146521912312869120169289362332157427352432313112226373403123825
681210152462691294263101232
90182312212511430133514352114282271133753782360462351124233948222161956731321
11822481725231121323330910521376234322119392811262411335432102108273
463633112212153255811679207


while the code give:
1
190121746114132251381321230342516302196252336238211523943272873744285119323293314107
31631221132661353262123081115418570291330356278322215013742329426
71421331023593822146521912312869120169289362332157427352432313112226373403123825
681210152462691294263101232
90182312212511430133514352114282271133753782360462351124233948222161956731321
11822481725231121323330910521376234322119392811262411335432102108273
4636331122121532558116792071512
1553203330299234738282167126033321272154232912111312416461868182323242
111932223509162312223104310231321116573254736811479599513441112318312221230321154
11363210249282132717260536372386522748224512596323581311
121932131303243861212327470532121636029110222323531121763
2499315312114672213683218207122451351984311032612832096363463812


I think we see the buffer content which is reused. so A big part 
of last read come from the previous chunk




Re: Using an async buffer

2019-11-08 Thread bioinfornatics via Digitalmars-d-learn

On Friday, 8 November 2019 at 01:12:37 UTC, Ali Çehreli wrote:

On 11/07/2019 07:07 AM, bioinfornatics wrote:
> Dear,
>
> I try to use the async buffer describe into std.parallelism
> documentation but my test code core dump!

I admit I don't fully understand the lifetime issues but 
removing the "code smell" of the modul-level File object solved 
the issue for me, which requires four changes:


// (1) Comment out the module-level variable
// File file;

// ...

@system
void next(File file, ref ubyte[] buf)
{
  // (2.a) Use the parameter 'file'
  // (2.b) Adjust the length of the buffer
  //   (rawRead may read less than the requested size)
buf = file.rawRead(buf);
}

// ...

// (3) Define a local variable
auto file = File(filePath, "rb");

// ...

// (4) Use "callables" that use the local 'file':
auto asyncReader = taskPool.asyncBuf((ref ubyte[] buf) => 
next(file, buf),

 () => file.eof,
 bufferSize);

Ali


Thanks a lot Ali, the error message was understandable to me, and 
the way you fixed differ from the documentation. Does that means 
they are a bug ?


Moreover, this snippet is used to evaluate how to parse 
efficiently versus the wc -l command.


fixed snippet: 
https://paste.fedoraproject.org/paste/B~PjobIlVXIaJPfMjCcWSA


And I have 2 problems
1/ the executable is at least twice a time slower than wc -l
  I try to increase
a) the buffer with a multiple of page size (parameter -n)
b) the number of thread (parameter -t)
2/ the result is not exactly the same as wc -l give wich imply a 
bug while counting \n inside the buffer.


$ time ./build/wc_File_by_chunks_async_buffer -n 4 -t 8 -i 
test_100M

1638656 test_100M

real0m0.106s
user0m0.101s
sys 0m0.051s

$ time wc -l test_100M
1638400 test_100M

real0m0.067s
user0m0.030s
sys 0m0.037s


Thanks again Ali without you It was impossible to me



Re: Using an async buffer

2019-11-08 Thread bioinfornatics via Digitalmars-d-learn

the error message was understandable to me,


... the error message was not understandable to me ...


Using an async buffer

2019-11-07 Thread bioinfornatics via Digitalmars-d-learn

Dear,

I try to use the async buffer describe into std.parallelism 
documentation but my test code core dump!


documentation: 
https://dlang.org/phobos/std_parallelism.html#.TaskPool.asyncBuf.2


snipptet: 
https://paste.fedoraproject.org/paste/K5W1O1dLzZ0sPV8NeGztUg


Trace:

$ gdb test
(gdb) r
Starting program: 
/env/export/v_home/q_unix/jmercier/Projets/wc/test

[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
nb octets: 10485760
nb iterations: 10240
Done
[New Thread 0x7681f700 (LWP 34340)]
[New Thread 0x7601e700 (LWP 34341)]
[New Thread 0x7581d700 (LWP 34342)]
[New Thread 0x7501c700 (LWP 34343)]
[New Thread 0x7481b700 (LWP 34344)]
[New Thread 0x7fffd700 (LWP 34345)]
[New Thread 0x7fffdf7fe700 (LWP 34346)]
[New Thread 0x7fffdeffd700 (LWP 34347)]

Program received signal SIGUSR1, User defined signal 1.
[Switching to Thread 0x7fffdeffd700 (LWP 34347)]
0x772119f5 in pthread_cond_wait@@GLIBC_2.3.2 () from 
/lib64/libpthread.so.0
Missing separate debuginfos, use: debuginfo-install 
glibc-2.17-292.el7.x86_64 libgcc-4.8.5-39.el7.x86_64

(gdb) bt
#0  0x772119f5 in pthread_cond_wait@@GLIBC_2.3.2 () from 
/lib64/libpthread.so.0

#1  0x77f2cae0 in core.sync.condition.Condition.wait() ()
   from 
/env/ig/soft/ig/ldc2-1.18.0/el7-x86_64-generic/lib64/libdruntime-ldc-shared.so.88

#2  0x77addd06 in std.parallelism.TaskPool.pop() ()
   from 
/env/ig/soft/ig/ldc2-1.18.0/el7-x86_64-generic/lib64/libphobos2-ldc-shared.so.88
#3  0x77addbcf in 
std.parallelism.TaskPool.startWorkLoop() ()
   from 
/env/ig/soft/ig/ldc2-1.18.0/el7-x86_64-generic/lib64/libphobos2-ldc-shared.so.88

#4  0x77f2e8bc in thread_entryPoint ()
   from 
/env/ig/soft/ig/ldc2-1.18.0/el7-x86_64-generic/lib64/libdruntime-ldc-shared.so.88
#5  0x7720de65 in start_thread () from 
/lib64/libpthread.so.0

#6  0x76a1e88d in clone () from /lib64/libc.so.6


Thanks for your help

Best regards



Re: Using shared memory and thread

2019-11-05 Thread bioinfornatics via Digitalmars-d-learn

On Tuesday, 5 November 2019 at 00:07:40 UTC, bioinfornatics wrote:
On Tuesday, 5 November 2019 at 00:04:05 UTC, bioinfornatics 
wrote:
On Monday, 4 November 2019 at 22:19:29 UTC, bioinfornatics 
wrote:
On Monday, 4 November 2019 at 21:53:45 UTC, bioinfornatics 
wrote:
On Monday, 4 November 2019 at 19:53:29 UTC, bioinfornatics 
wrote:

[...]


One image reveals more than a thousand words, see my picture 
:-)

   -> http://pix.toile-libre.org/?img=1572906675.png


oups got a problem with the alpha layer:
   -> http://pix.toile-libre.org/?img=1572908302.png


here my (not working) snippet code:
   -> 
https://run.dlang.io/gist/75429dcb8612e00635f7d53aabc4776f


the example do not meet exactly the spec and he do not compile.


arf the generated link raise a 404, here a gist


I got some help from `feep` on IRC and he show me that the task 
pool can not to be const as reduce is not.

So now I have this script:
> 
https://gist.github.com/run-dlang/46c753f7233a624bb5639db615c9634a

And this error:
> 
/dlang/dmd/linux/bin64/../../src/phobos/std/parallelism.d(2730): 
Error: function std.parallelism.TaskPool.reduce!"a + 
b".reduce!(MapResult!(__lambda3, Result)).reduce cannot get frame 
pointer to onlineapp.countAllLines


I found this thread which talk about this error, but that did not 
help me to fix it: https://github.com/dlang/phobos/pull/4915


Thanks for your help





https://gist.github.com/run-dlang/4ffcc0641acef5eedf52a17c4995599b





Re: Using shared memory and thread

2019-11-04 Thread bioinfornatics via Digitalmars-d-learn

On Tuesday, 5 November 2019 at 00:04:05 UTC, bioinfornatics wrote:
On Monday, 4 November 2019 at 22:19:29 UTC, bioinfornatics 
wrote:
On Monday, 4 November 2019 at 21:53:45 UTC, bioinfornatics 
wrote:
On Monday, 4 November 2019 at 19:53:29 UTC, bioinfornatics 
wrote:

[...]


One image reveals more than a thousand words, see my picture 
:-)

   -> http://pix.toile-libre.org/?img=1572906675.png


oups got a problem with the alpha layer:
   -> http://pix.toile-libre.org/?img=1572908302.png


here my (not working) snippet code:
   -> https://run.dlang.io/gist/75429dcb8612e00635f7d53aabc4776f

the example do not meet exactly the spec and he do not compile.


arf the generated link raise a 404, here a gist 
https://gist.github.com/run-dlang/4ffcc0641acef5eedf52a17c4995599b


Re: Using shared memory and thread

2019-11-04 Thread bioinfornatics via Digitalmars-d-learn

On Monday, 4 November 2019 at 22:19:29 UTC, bioinfornatics wrote:
On Monday, 4 November 2019 at 21:53:45 UTC, bioinfornatics 
wrote:
On Monday, 4 November 2019 at 19:53:29 UTC, bioinfornatics 
wrote:

Dear,

I would like to put a buffer `shared(char[])` into a shared 
memory ( L2 cache ) and provide a start and end index to 
multiple thread in order to perform computation on a piece of 
original buffer.


[...]


One image reveals more than a thousand words, see my picture 
:-)

   -> http://pix.toile-libre.org/?img=1572906675.png


oups got a problem with the alpha layer:
   -> http://pix.toile-libre.org/?img=1572908302.png


here my (not working) snippet code:
   -> https://run.dlang.io/gist/75429dcb8612e00635f7d53aabc4776f

the example do not meet exactly the spec and he do not compile.


Re: Using shared memory and thread

2019-11-04 Thread bioinfornatics via Digitalmars-d-learn

On Monday, 4 November 2019 at 21:53:45 UTC, bioinfornatics wrote:
On Monday, 4 November 2019 at 19:53:29 UTC, bioinfornatics 
wrote:

Dear,

I would like to put a buffer `shared(char[])` into a shared 
memory ( L2 cache ) and provide a start and end index to 
multiple thread in order to perform computation on a piece of 
original buffer.


[...]


One image reveals more than a thousand words, see my picture :-)
   -> http://pix.toile-libre.org/?img=1572906675.png


oups got a problem with the alpha layer:
   -> http://pix.toile-libre.org/?img=1572908302.png


Re: Using shared memory and thread

2019-11-04 Thread bioinfornatics via Digitalmars-d-learn

On Monday, 4 November 2019 at 19:53:29 UTC, bioinfornatics wrote:

Dear,

I would like to put a buffer `shared(char[])` into a shared 
memory ( L2 cache ) and provide a start and end index to 
multiple thread in order to perform computation on a piece of 
original buffer.


[...]


One image reveals more than a thousand words, see my picture :-)
   -> http://pix.toile-libre.org/?img=1572906675.png


Using shared memory and thread

2019-11-04 Thread bioinfornatics via Digitalmars-d-learn

Dear,

I would like to put a buffer `shared(char[])` into a shared 
memory ( L2 cache ) and provide a start and end index to multiple 
thread in order to perform computation on a piece of original 
buffer.


I read doc from std.concurrency, std.parallelism, core.thead 
(druntime) and vectorization (simd) .  But I found any example or 
unittest which perform such calculus.


1/ So did you have an example somewhere ?
2/ about shared keyword do we ensure that its size is lower than 
L2 or L3 cache using :


```
core.sys.posix.unistd: sysconf, _SC_LEVEL2_CACHE_SIZE, 
_SC_LEVEL3_CACHE_SIZE;
immutable size_t L2_CACHE_SIZE = cast(size_t) 
sysconf(_SC_LEVEL2_CACHE_SIZE);
immutable size_t L3_CACHE_SIZE = cast(size_t) 
sysconf(_SC_LEVEL3_CACHE_SIZE);


```
3/ variable flagged as `shared` does at mean the variable is put 
into L2 cache ?


thanks for your help

best regards


Re: Gtkd and libgtksourceview

2019-10-30 Thread bioinfornatics via Digitalmars-d-learn

On Wednesday, 30 October 2019 at 22:26:41 UTC, Mike Wey wrote:

On 30-10-2019 20:17, Ron Tarrant wrote:

[...]


Thanks.


[...]


The installer could use an update, Sourceview 4 is available 
for windows.



[...]


For windows there isn't an easy command to regenerate the 
source, but running this command should work (Its been a while 
since i tried it on windows):


---
girtod -i src --use-runtime-linker --use-bind-dir
---


Thanks a lot Mike and Ron for your help.

Have a nice day


Gtkd and libgtksourceview

2019-10-30 Thread bioinfornatics via Digitalmars-d-learn

Dear,

I tried the latest gtkd release and it try to open dynamically 
libgtksourceview-4.so.0 however  I have only 
libgtksourceview-3.so.1


so which version should I used to be compatible with 
libgtksourceview-3 (I use centos 7)


Code:

$ ldc2 container_014_10_notebook_basic.d 
-I=$LDC2_ROOT/include/d/gtkd-3 -L=-lgtk-3 -L=-latk-1.0 
-L=-lgtkd-3 -L=-lgtkdgl-3 -L=-lgtkdsv-3 -of container

$ ./container
object.Exception@generated/gtkd/gtkd/Loader.d(125): Library load 
failed (libgtksourceview-4.so.0): libgtksourceview-4.so.0: cannot 
open shared object file: No such file or directory

Illegal instruction (core dumped)



Re: Packaging and Distributing Dlang Applications with GtkD Dependency?

2019-09-26 Thread bioinfornatics via Digitalmars-d-learn
On Thursday, 26 September 2019 at 10:07:34 UTC, bioinfornatics 
wrote:
On Wednesday, 25 September 2019 at 17:03:51 UTC, Ron Tarrant 
wrote:
On Wednesday, 25 September 2019 at 13:52:48 UTC, 
bioinfornatics wrote:


I think I misunderstood your need but are lo looking for dub 
tool with its repository https://code.dlang.org/


I don't think so, but I could be wrong. I tried reading up on 
dub, but got lost in the docs, so I really don't understand 
what all it can do.


dub is more or less like pip from python, npm from javascript 
and so on ...

The code source is here: https://github.com/dlang/dub

you can open an issue there or open a thread about how to write 
package file for dub doc: https://dub.pm/package-format-json)


have a nice day


I prefer to use meson a builder tool (same category tool as Make, 
CMake ...)

doc: https://mesonbuild.com/Dlang-module.html

Is better as it ease the packaging for fedora, debian, ubuntu and 
so on ...


Re: Packaging and Distributing Dlang Applications with GtkD Dependency?

2019-09-26 Thread bioinfornatics via Digitalmars-d-learn
On Wednesday, 25 September 2019 at 17:03:51 UTC, Ron Tarrant 
wrote:
On Wednesday, 25 September 2019 at 13:52:48 UTC, bioinfornatics 
wrote:


I think I misunderstood your need but are lo looking for dub 
tool with its repository https://code.dlang.org/


I don't think so, but I could be wrong. I tried reading up on 
dub, but got lost in the docs, so I really don't understand 
what all it can do.


dub is more or less like pip from python, npm from javascript and 
so on ...

The code source is here: https://github.com/dlang/dub

you can open an issue there or open a thread about how to write 
package file for dub doc: https://dub.pm/package-format-json)


have a nice day


Re: Packaging and Distributing Dlang Applications with GtkD Dependency?

2019-09-25 Thread bioinfornatics via Digitalmars-d-learn
On Wednesday, 25 September 2019 at 11:46:04 UTC, Ron Tarrant 
wrote:

Hi y'all,

I've been Googling how to do this, but coming up with nothing 
definitive. Are there any articles for how to do this for:


Windows?
Linux?
other UNIX-alike OSs?


I think I misunderstood your need but are lo looking for dub tool 
with its repository https://code.dlang.org/


Re: Question about D hirearchy and include directory

2018-10-16 Thread bioinfornatics via Digitalmars-d

On Sunday, 14 October 2018 at 12:14:06 UTC, bioinfornatics wrote:

Dear,

Some projects seem to have an extra directory for their include 
directory, such as:

- stdx-allocator
- containers
- msgpack
- dparse
...

[...]


up


Question about D hirearchy and include directory

2018-10-14 Thread bioinfornatics via Digitalmars-d

Dear,

Some projects seem to have an extra directory for their include 
directory, such as:

- stdx-allocator
- containers
- msgpack
- dparse
...

To draw the picture, I take as example the containers project and 
build using meson:


$ ls /usr/include/d/containers/containers/
cyclicbuffer.d  dynamicarray.d  hashmap.d  hashset.d  
immutablehashset.d  internal  openhashset.d  package.d  simdset.d 
 slist.d  treemap.d  ttree.d  unrolledlist.d


Why it is not : /usr/include/d/containers
Or why for (phobos/std) it is not /usr/include/d/std/std

Is it the expected behaviour or these meson.build should be fixed:
Example at line 94 
https://github.com/dlang-community/containers/blob/master/meson.build#L94

replace:
install_subdir('src/containers/', install_dir: 
'include/d/containers/')

to:
install_subdir('src/containers/', install_dir: 'include/d/')

Thanks

Have a good day


Re: Symmetry Autumn of Code

2018-08-06 Thread bioinfornatics via Digitalmars-d-announce

On Saturday, 14 July 2018 at 06:02:37 UTC, Mike Parker wrote:
Thanks to the sponsorship of Symmetry Investments, the D 
Language Foundation is happy to announce the Symmetry Autumn of 
Code!


We're looking for three university students to hack on D this 
autumn, from September - January. We're also in search of 
potential mentors and ideas for student projects. Head to the 
Symmetry Autumn of Code page for the details.


Spread the word!

https://dlang.org/blog/symmetry-autumn-of-code/


Example of idea for student:
A deep learning framework using together a LLVM SPIR-V enable and 
https://github.com/libmir/dcompute would be awesome





Re: When did gdc and ldc start?

2018-08-01 Thread bioinfornatics via Digitalmars-d

On Wednesday, 1 August 2018 at 13:49:30 UTC, bioinfornatics wrote:

On Tuesday, 31 July 2018 at 02:30:12 UTC, Walter Bright wrote:

I'm trying to pin down an accurate timeline of D


ldc2 compiler and D environnment language was introduce in 
fedora 16 (2011)

https://fedoraproject.org/wiki/Features/D2_programming


and ldc 1 in 2010 with fedora 14 
https://fedoraproject.org/wiki/Features/D_Programming


Re: When did gdc and ldc start?

2018-08-01 Thread bioinfornatics via Digitalmars-d

On Tuesday, 31 July 2018 at 02:30:12 UTC, Walter Bright wrote:

I'm trying to pin down an accurate timeline of D


ldc2 compiler and D environnment language was introduce in fedora 
16 (2011)

https://fedoraproject.org/wiki/Features/D2_programming


Re: D GPU execution module: A survey of requirements.

2018-05-14 Thread bioinfornatics via Digitalmars-d

On Thursday, 10 May 2018 at 07:25:32 UTC, Nicholas Wilson wrote:

On Thursday, 10 May 2018 at 00:10:07 UTC, H Paterson wrote:

On Wednesday, 9 May 2018 at 23:37:14 UTC, Henry Gouk wrote:

On Wednesday, 9 May 2018 at 23:26:19 UTC, H Paterson wrote:

Hello,

I'm interested in writing a module for executing D code on 
GPUs. I'd like to bounce some ideas off D community members 
to see what this module needs do.


[...]


Check out https://github.com/libmir/dcompute


Welp... It's not quite what I would have envisioned, but seems 
to fill the role.


Thanks for pointing Dcompute out to me - I only found it 
mentioned in a dead link on the D wiki.


Time to find a new project...


It's not dead, it's just pining for the fjords^H^H^H^H  
hibernating waiting for me to finish undergrad (~7 weeks). You 
are more than welcome to join the development.


Nic


Dcompute seems really promising, unfortunately I have not yet 
successfully build the ldc compiler using a LLVM fork with SPIRV 
enabled: https://github.com/libmir/dcompute/issues/46


Maybe you should try with a ldc 1.7 or less (I tried 1.8 and 1.9 )

Good luck



Re: iopipe v0.0.4 - RingBuffers!

2018-05-14 Thread bioinfornatics via Digitalmars-d-announce
On Thursday, 10 May 2018 at 23:22:02 UTC, Steven Schveighoffer 
wrote:
OK, so at dconf I spoke with a few very smart guys about how I 
can use mmap to make a zero-copy buffer. And I implemented this 
on the plane ride home.


However, I am struggling to find a use case for this that 
showcases why you would want to use it. While it does work, and 
works beautifully, it doesn't show any measurable difference 
vs. the array allocated buffer that copies data when it needs 
to extend.


If anyone has any good use cases for it, I'm open to 
suggestions. Something that is going to potentially increase 
performance is an application that needs to keep the buffer 
mostly full when extending (i.e. something like 75% full or 
more).


The buffer is selected by using `rbufd` instead of just `bufd`. 
Everything should be a drop-in replacement except for that.


Note: I have ONLY tested on Macos, so if you find bugs in other 
OSes let me know. This is still a Posix-only library for now, 
but more on that later...


As a test for Ring buffers, I implemented a simple "grep-like" 
search program that doesn't use regex, but phobos' canFind to 
look for lines that match. It also prints some lines of 
context, configurable on the command line. The lines of context 
I thought would show better performance with the RingBuffer 
than the standard buffer since it has to keep a bunch of lines 
in the buffer. But alas, it's roughly the same, even with large 
number of lines for context (like 200).


However, this example *does* show the power of iopipe -- it 
handles all flavors of unicode with one template function, is 
quite straightforward (though I want to abstract the line 
tracking code, that stuff is really tricky to get right). Oh, 
and it's roughly 10x faster than grep, and a bunch faster than 
fgrep, at least on my machine ;) I'm tempted to add regex 
processing to see if it still beats grep.


Next up (when my bug fix for dmd is merged, see 
https://issues.dlang.org/show_bug.cgi?id=17968) I will be 
migrating iopipe to depend on 
https://github.com/MartinNowak/io, which should unlock Windows 
support (and I will add RingBuffer Windows support at that 
point).


Enjoy!

https://github.com/schveiguy/iopipe
https://code.dlang.org/packages/iopipe
http://schveiguy.github.io/iopipe/

-Steve


Hi Steve,

It is an exciting works, that could help in bioinformatics area.
Indeed in bioinformatics we are I/O bounding and we process lot 
of big files the amount of data can be in gigabytes, terabytes 
and even some times in petabytes.


So processing efficiently these amount of data is critic. Some 
years ago I got a request 'How to parse fastq file format in D?' 
and monarch_dodra wrote a really fast parser (code: 
http://dpaste.dzfl.pl/37b893ed )


It could be interesting to show how iopipe is fast.

You can grab a fastq file from 
ftp://ftp.1000genomes.ebi.ac.uk/vol1/ftp/phase3/data/HG00096/sequence_read/ and take a look at iopipe perf .


fastq file is plain test format and it is usually a repetition of 
four lines:

1/ title and description
this line starts with @
2/ sequence line
this line contains ususally DNA letters (ACGT)
3/ comment line
this line starts with +
4/ quality of amino acids
this line has the same length as the sequence line (n°2)

Rarely, the comment section is over multiple lines.
Warning the @ and + characters can be found inside the quality 
line, thus I search a pattern of two characters '\n@' and '\n+'. 
I never split file by line as it is a waste of time instead I 
read the content as a stream.


I hope this show case help you

Good luck :-)



Re: [dub] How to specify with dub a custom repository and build directory ?

2018-05-03 Thread bioinfornatics via Digitalmars-d

On Thursday, 3 May 2018 at 15:30:28 UTC, rikki cattermole wrote:

On 04/05/2018 3:27 AM, bioinfornatics wrote:

[...]


dub doesn't do platform specific installing.
It just handles building. What you want is out of scope and has 
been discussed.


Ok but as all D projects can be built only with dub, How can we 
do ?
should I to create and maintain a makefile or others for each D 
projects ?


Thanks


[dub] How to specify with dub a custom repository and build directory ?

2018-05-03 Thread bioinfornatics via Digitalmars-d

Dear,

As 99% of d project use dub as build and package manager. I would 
like to know how to use D libraries and D software shared to all 
user on linux architecture ?


When I run:

 dub fetch 

A .dub directory is created into $HOME. I tried to provide 
another directory with --root parameter but that do not work.


Currently I do not see how to build and install various D 
software at my works (HPC environment).


To be able to use D in this environment I need to be able to set 
at least:

- BUILD_DIR directory to perform build stage
- DESTDIR directory to tell where the root "start", it is useful 
for staged build such as rpm do
- PREFIX directory which will contains bin, include, lib(64), 
share directories
- use installed D library by reading env var LIBRARY_PATH, PATH, 
CPATH



Any highlight is welcome

Thanks


Fail to build ldc with a llvm SPIR-V enabled

2018-04-27 Thread bioinfornatics via Digitalmars-d

Dear,

After to build the llvm lib from 
https://github.com/thewilsonator/llvm . I tried to build ldc2


with v1.9-beta1

/ldc2-1.9/tools/ldc-profdata/llvm-profdata-5.0.cpp:175:6: error: 
no matching function for call to 
'llvm::InstrProfWriter::addRecord(std::remove_reference::type, const uint64_t&, loadInput(const WeightedFile&, WriterContext*)::)'



And we can see that the signature is not the same:

$ grep addRecord 
/env/ig/soft/ig/llvm-spirv-5.0.0/el6-x86_64-generic/include/llvm/ProfileData/InstrProfWriter.h

  Error addRecord(InstrProfRecord &, uint64_t Weight = 1);

with ldc2 1.8.0

/ldc2-1.8/runtime/jit-rt/cpp-so/disassembler.cpp:297:32: error: 
'const class llvm::object::SectionRef' has no member named 
'getIndex'



And we can see that the signature do not exists into the modifief 
LLVM:


$ grep -R getIndex 
/env/ig/soft/ig/llvm-spirv-5.0.0/el6-x86_64-generic/include/llvm/Object/ObjectFile.h

$

I would like to know if someone has built ldc2 with LLVM SPIR-V 
enabled in order to use dcompute ?


Thanks

Best regards


Re: which LLVM source should I use in order to use SPIRV through DCompute ?

2018-04-27 Thread bioinfornatics via Digitalmars-d

On Thursday, 26 April 2018 at 23:06:54 UTC, Nicholas Wilson wrote:
On Thursday, 26 April 2018 at 22:51:59 UTC, bioinfornatics 
wrote:

Dear,

Dcompute: https://github.com/libmir/dcompute need a SPIRV 
capable LLVM.
For this Dcompute project show 
https://github.com/thewilsonator/llvm as a SPIRV capable LLVM.


But it is not an official llvm source, moreover the source is 
outdated. Indeed it provide LLVM 5.0.0 while the current 
stable is the 6.0.0


It should provide 6.0.0, I'll fix this at DConf.

Furthermore kronos group provide too an old SPIRV capable LLVM 
https://github.com/KhronosGroup/SPIRV-LLVM (3.6.1)


Yep it's wayyy too old.


So can I use official LLVM source in order to use dcompute ?


No. I plan to fix this after DConf.
If no, why the SPIRV feature part added to LLVM was not send 
to the upstream ?


Because Khronos hasn't got their act together or doesn't 
understand the importance of widespread support.


Thanks Nicholas for this quick answer,

About to push your work on llvm SPIR V enabled , by official 
upstream (I was not very clear) I mean llvm.org not the khronos 
group. Indeed I see on the llvm.org page a project named  libclc 
: http://libclc.llvm.org/ and this project aims to implement the 
OpenCL standard library.


Maybe your work could be put to this official project ?

Have a nice day

Jonathan


which LLVM source should I use in order to use SPIRV through DCompute ?

2018-04-26 Thread bioinfornatics via Digitalmars-d

Dear,

Dcompute: https://github.com/libmir/dcompute need a SPIRV capable 
LLVM.
For this Dcompute project show 
https://github.com/thewilsonator/llvm as a SPIRV capable LLVM.


But it is not an official llvm source, moreover the source is 
outdated. Indeed it provide LLVM 5.0.0 while the current stable 
is the 6.0.0


Furthermore kronos group provide too an old SPIRV capable LLVM 
https://github.com/KhronosGroup/SPIRV-LLVM (3.6.1)


So can I use official LLVM source in order to use dcompute ?
If no, why the SPIRV feature part added to LLVM was not send to 
the upstream ?


Thanks

Best regard



Re: Linux Game Jam 2018

2018-04-19 Thread bioinfornatics via Digitalmars-d

On Thursday, 5 April 2018 at 18:30:30 UTC, WebFreak001 wrote:
Hi guys, I am going to make a game for this years linux game 
jam hosted by TheLinuxGamer again, last year I made SpaceD[1]


Just in case anyone else wants to join too, the link is here 
(though joining is optional I think)


https://itch.io/jam/linux-game-jam-2018

It's a 10 day jam, there is a theme this time and it's 
`Versatile Verbs`, check the page for more information


[1]: https://github.com/WebFreak001/SpaceD and 
https://webfreak.itch.io/spaced


Good luck :-)


Re: DCompute is now in the master branch of LDC

2018-04-18 Thread bioinfornatics via Digitalmars-d-announce

On Monday, 19 June 2017 at 12:46:16 UTC, Nicholas Wilson wrote:

On Monday, 19 June 2017 at 08:24:09 UTC, bioinfornatics wrote:

 [...]


The library enables you to launch kernels written with the 
accompanying complier extensions (the focus of this 
announcement). It also provides the intrinsics to enable 
writing the kernels.

[...]


Yes, with some restrictions: recursion is prohibited, as are 
classes exceptions, the keyword 'synchronized' global variables 
(for now) and probably some others that I'm forgetting.

 [...]


There are some examples on the wiki 
(https://github.com/libmir/dcompute/wiki), although they are 
likely incomplete and slightly out of date. I will be updating 
and greatly improving them as development progresses 
(continuing about halfway through July).


If you have any questions feel free to ask them on 
https://gitter.im/libmir/public.


I take a look at dcompute example and find any example how to 
interact with FPGAs!
Could we have a tutorial how to build a D program in order to 
works with FPGA ?


Thanks,

Best regards


Re: D could catch this wave: web assembly

2017-10-23 Thread bioinfornatics via Digitalmars-d

On Thursday, 18 June 2015 at 08:05:48 UTC, John Colvin wrote:
This appears to have involvement from all major browser 
vendors, which provides hope it might actually catch on 
properly. An llvm backend will be created which will compile to 
"wasm", hopefully LDC and/or SDC could glue to this.


https://www.w3.org/community/webassembly/

https://github.com/WebAssembly

In particular, see 
https://github.com/WebAssembly/design/blob/master/HighLevelGoals.md https://github.com/WebAssembly/design/blob/master/FAQ.md and https://github.com/WebAssembly/design/blob/master/MVP.md


WebAssembly reach a first step a first consensus on the design of 
the initial (MVP) WebAssembly API and binary format:

- http://webassembly.org/
- https://developer.mozilla.org/en-US/docs/WebAssembly
- https://github.com/webassembly

To remember it will be the next  open standard by a W3C Community 
Group to create portable and efficient application across major 
web browser. A such feature can offer to D a chance to have a 
killer app in 3D web application instead to develop complex C++ 
code.


Some examples:
- https://github.com/JasonWeathersby/WASMSobel/
- https://github.com/mdn/webassembly-examples/


Re: DCompute is now in the master branch of LDC

2017-06-19 Thread bioinfornatics via Digitalmars-d-announce

On Monday, 29 May 2017 at 09:33:05 UTC, Nicholas Wilson wrote:

Hi all,

I'm happy to announce that the dcompute modifications to LDC 
are now in the master branch of LDC. The dcompute extensions 
require LLVM 3.9.1 or greater for NVPTX/CUDA and my fork[1] of 
LLVM for SPIRV.


Someone (sorry I've forgotten who!) at dconf said they'd make a 
docker image of the dependencies (ldc llvm), if you're reading 
please let me know! Or if someone else wants to do it thats 
good too.


I'm still quite busy until July (honours thesis), but if anyone 
wanting to contribute to either the runtime stuff [2](all D), 
LDC [3] or LLVM [1](mostly C++) I'm happy to answer any 
questions, providing testing and performance feedback on 
diverse systems is also appreciated. Feel free to drop a line 
at https://gitter.im/libmir/public


[1]: https://github.com/thewilsonator/llvm/tree/compute
[2]: https://github.com/libmir/dcompute
[3]: https://github.com/ldc-developers/ldc


Hi,

I would like to know :
 - what we can do with the library name "dcompute" ?
Does this means that I can wrote In Dlang a piece of code and 
execute it on the GPU ?


 - where can I find some example ?

Thanks


Metaprogramming get type and field at compile time

2015-10-27 Thread bioinfornatics via Digitalmars-d-learn

Dear,

I use FieldTypeTuple and FieldNameTuple to get type and 
correponding field name but I fail to loop over these tuple.


As example:

struct Person{
private string name;
private ushort age;
private bool   isMale;

this(string name, ushort age, bool   isMale){
this.name= name;
this.age = age;
this.isMale  = isMale;
}
}

I would like to print with pragma msg:
 string name
 ushort age
 bool   isMale

for this I tried:

template getDeclarationFields( FieldTypeName...){
enum typeIndex  = 0;
enum nameIndex  = FieldTypeName.length / 2;
enum  res   = FieldTypeName[typeIndex] ~ ' ' ~ 
FieldTypeName[nameIndex] ~';';

static if( FieldTypeName.length == 1)
enum getDeclarationFields = res;
else
enum getDeclarationFields = res ~ getDeclarationFields!( 
FieldTypeName[typeIndex+1..nameIndex] ~ 
FieldTypeName[nameIndex+1..$] );

}

but that don't build

I though that orange lib should do this somewhere but the lib usi 
his self trait method


thanks for your help




Re: Metaprogramming get type and field at compile time

2015-10-27 Thread bioinfornatics via Digitalmars-d-learn

On Tuesday, 27 October 2015 at 22:53:35 UTC, Ali Çehreli wrote:

On 10/27/2015 03:34 PM, bioinfornatics wrote:

> I use FieldTypeTuple and FieldNameTuple to get type and
correponding
> field name but I fail to loop over these tuple.

You can use the .tupleof property and a compile-time foreach:

  http://dlang.org/class.html (Search for .tuplof on that page)

  http://ddili.org/ders/d.en/tuples.html#ix_tuples..tupleof

  
http://ddili.org/ders/d.en/tuples.html#ix_tuples.compile-time%20foreach


Ali


 wow Nice without traits
thanks Ali for your amazing work

best regards


Re: Would a DSpin or DLab for Fedora make sense?

2015-10-12 Thread bioinfornatics via Digitalmars-d

On Sunday, 11 October 2015 at 13:27:12 UTC, Idan Arye wrote:

On Friday, 9 October 2015 at 18:10:59 UTC, tim wrote:

[...]


I doubt it'll be a good idea. These bundles seem to target 
areas of interest, never specific languages. You can see 
bundles geared towards graphic designers or gamers, but not 
ones for C++ or Java developers.


[...]


Fedora provides already A programming environment
I am the packager
Any help are welcome


Re: How to partially forward properties of struct array member to struct (disable length property) ?

2015-09-06 Thread bioinfornatics via Digitalmars-d-learn

On Sunday, 6 September 2015 at 07:34:36 UTC, ParticlePeter wrote:
I am working on a struct vector. The data is stored in a member 
static array and I want to be able to forward all array 
properties except length to vector.
Reason is I have free functions f that take vector(s) as 
arguments, such that f(vector) and vector.f via UFCS is 
possible. Using alias array this in the case of length 
function/array property is problematic, as length(vector) 
obviously uses the free function but vector.length the array 
property.


What would be the simplest way to disable the array.length 
property for the vector struct?


I would prefer not to implement length as a vector member 
function and call it inside the free function as this is 
inconsistent with the other free funcs.


Hi,

If you are looking for somethin like delegator from ruby: 
http://ruby-doc.org/stdlib-2.0.0/libdoc/forwardable/rdoc/Forwardable.html


they are in D template proxy; 
http://dlang.org/phobos/std_typecons.html#.Proxy
Or by using mixin delegates: 
http://forum.dlang.org/post/jitn9v$20u4$1...@digitalmars.com


Re: The most awesome forward to member solution?

2015-05-05 Thread bioinfornatics via Digitalmars-d
That is not exactly what I requested years ago --- 
http://forum.dlang.org/thread/1330792937.10754.7.camel@jonathan


Re: DDMD is now in the master branch

2015-04-08 Thread bioinfornatics via Digitalmars-d

Good news,

little question as ddmd generate a code does this means that ddmd
backend and frontend is full open source under boost license?

regards


Re: Which D IDE do you use?(survey)

2015-04-08 Thread bioinfornatics via Digitalmars-d

On Tuesday, 7 April 2015 at 22:58:44 UTC, weaselcat wrote:
Hi, I hope nobody minds but I'm just curious as to the 
popularity amongst D IDEs for a blog post. Sorry if I forgot 
your favorite $editor.


http://goo.gl/forms/MmsuInzDL0

thanks : )


It seem now intellij support D lang.
I use it for some java project is a good IDE.


Re: D, Python, and Chapel

2015-04-06 Thread bioinfornatics via Digitalmars-d

On Friday, 3 April 2015 at 10:18:11 UTC, Russel Winder wrote:
Chapel 1.11 just got release and they are making a big play on 
the
integration of Chapel with Python. This could be huge and 
potentially

disrupt the complacency of the NumPy based folk.

Chapel is a rather pleasant PGAS language that makes 
parallelism and

clustering quite nice. Certainly if the choice is Python+C++ vs
Python+Chapel, this is now a no contest.

This may put a kibosh on the whole Python+D thing.


wow this look nice.

as example:
Parallel I/O: parallel file I/O, scientific file formats, 
parallel disks, extend domain maps to support


exactly what I asked at Andrei Alexandrescu - 
http://forum.dlang.org/post/scgpiczjgzzvvtrcl...@forum.dlang.org


Re: Making byLine faster: we should be able to delegate this

2015-03-31 Thread bioinfornatics via Digitalmars-d
Little ping I hope an answer about IO in D and disruptor form 
java world


Disruptor seem to provide a smart implementation between IO and 
their buffer.


What did you think about it?
D could to provided a high level way to process efficiently a 
file. (using Range, forwardrange ... will be better)


I think for this kind of usual process D should to be battery 
included.


Whithout the need to know if you are on SSD or HD, if the page 
size is 4096, if hugepagesize is enabled ...


will be realy awesome to have an abstraction layer on this


Re: [OT]: Congrats Andrei!

2015-03-28 Thread bioinfornatics via Digitalmars-d


Congratz Andrei and Sanda


Re: Making byLine faster: we should be able to delegate this

2015-03-28 Thread bioinfornatics via Digitalmars-d

Java has disruptor to provide the fatest way to ring file.

website: http://lmax-exchange.github.io/disruptor/
technical information: 
http://lmax-exchange.github.io/disruptor/files/Disruptor-1.0.pdf




Re: Making byLine faster: we should be able to delegate this

2015-03-28 Thread bioinfornatics via Digitalmars-d

What about hugepagesize system on LINUX ?


Did D will try to get the vulkan opportunity?

2015-03-25 Thread bioinfornatics via Digitalmars-d

Dear,

I would like to know if D dev have a plan with vulkan : 
https://www.khronos.org/vulkan/ ?


D lang will be at same level than others language, nothing exists 
!


D could try to provide API and an environment around vulkan. To 
become a language  need to be used in this field.


Regards


Re: Git, the D package manager

2015-02-09 Thread bioinfornatics via Digitalmars-d

They are MakefileForD

https://github.com/bioinfornatics/MakefileForD

It is easy to use. You have only to set First lines:

export PROJECT_NAME =
export AUTHOR  =
export DESCRIPTION  =
export VERSION=
export LICENSE=
ROOT_SOURCE_DIR  =
EXE_NAME =

and that will find automatically file to build and install it 
with respect of the filesystem hierarchy standard (FHS).


Packager will love it is customizable as a packager want to be 
(not dub)

with standard var:
- INCLUDE_DIR
- BIN_DIR
- LIB_DIR
- DATA_DIR
- DESTDIR

Yes is not a D program but at least is well documented, used 
everywhere and does the job easily, any linux has make...






Re: About variant

2015-01-27 Thread bioinfornatics via Digitalmars-d-learn

I can do this
import std.variant;

struct Alpha {
Variant something;

this(Variant v){
something = v;
}

static Alpha build(T)(T v){
return Alpha( cast(Variant)v );
}

}

void main(){
auto a = Alpha.build!(int)( 6);
auto b = Alpha.build!(string)( hello);
auto l = new Alpha[](2);
l[0] = a;
l[1] = b;
}

If someone has better


Re: About variant

2015-01-27 Thread bioinfornatics via Digitalmars-d-learn

On Tuesday, 27 January 2015 at 21:00:16 UTC, Justin Whear wrote:

On Tue, 27 Jan 2015 20:46:59 +, bioinfornatics wrote:


void main(){
auto a = Alpha!(int)( 6);
auto b = Alpha!(string)( hello);


The Alpha struct is not a template, only the constructor is.  
Remove the

explicit instantiations and IFTI does the work:

void main(){
auto a = Alpha( 6);
auto b = Alpha( hello);


Oh really cool


About variant

2015-01-27 Thread bioinfornatics via Digitalmars-d-learn
Dear that do a lot time wehere I not used std.variant. i would 
like to hide extra cast from user by using a generic ctor


import std.variant;

struct Alpha {
Variant something;

this(T)(T v){
something = cast(Variant)v;
}

}

void main(){
auto a = Alpha!(int)( 6);
auto b = Alpha!(string)( hello);
auto l = new Alpha[](2);
l[0] = a;
l[1] = b;
}

but that do not works.

Someone know a trick?

thanks


Re: D, Dub, Debian, Fedora

2015-01-19 Thread Bioinfornatics via Digitalmars-d

Hi, I am a fedora packager.
I packaged libraries for fedora using a makefile, cmake and other 
but not dub.
I will not use dub until they support makefile. I have no time to 
add this feature and it seem we have all same problem  :-).

Using scons is fine to me, I could package it.
If you want to try makefile for any reason.  they are 
https://github.com/bioinfornatics/MakefileForD


Regards


Re: D and Nim

2015-01-04 Thread Bioinfornatics via Digitalmars-d

Thanks I will try it.  It seems really cool. Maybe my new
favorite language.


Re: Any LaTeX expers n da house?

2014-12-30 Thread bioinfornatics via Digitalmars-d

On Tuesday, 30 December 2014 at 18:04:06 UTC, Andrei Alexandrescu
wrote:
With 
https://github.com/D-Programming-Language/dlang.org/pull/736, 
beautiful PDF generation via LaTeX is now possible.


There are, of course, many details to tend to. For starters, 
currently the doc is overly sparse, which makes it large (520 
pages). But the basic framework is in place and works.


Who would want to give it a shot at beautifying it?


Andrei


cool I love Latex :-)


Re: What's missing to make D2 feature complete?

2014-12-23 Thread bioinfornatics via Digitalmars-d
I think in, out, inout and scope should go. Make all 
parameters that are by-value immutable by default.


I agree with this. In more that could to be interesting if
compiler could translate in  to something like const scope
ref  when it is an array or heavy object. to save memory
allocation and ease the way to get some better performance.


Re: What's missing to make D2 feature complete?

2014-12-22 Thread bioinfornatics via Digitalmars-d

On Saturday, 20 December 2014 at 20:14:21 UTC, Ola Fosheim
Grøstad wrote:
On Saturday, 20 December 2014 at 17:40:06 UTC, Martin Nowak 
wrote:

Just wondering what the general sentiment is.


I think the main problem is what is there already, which 
prevents more sensible performance features from being added 
and also is at odds with ensuring correctness.


By priority:

1. A well thought out ownership system to replace GC with 
compiler protocols/mechanisms that makes good static analysis 
possible and pointers alias free.  It should be designed before 
scope is added and a GC-free runtime should be available.


2. Redesign features and libraries to better support AVX 
auto-vectorization as well as explicit AVX programming.


3. Streamlined syntax.

4. Fast compiler-generated allocators with pre-initialization 
for class instancing (get rid off emplace). Profiling based.


5. Monotonic integers (get rid of modular arithmetics) with 
range constraints.


6. Constraints/logic based programming for templates

7. Either explict virtual or de-virtualizing class functions 
(whole program optimization).


8. Clean up the function signatures: ref, in, out, inout and 
get rid of call-by-name lazy which has been known to be a bug 
inducing feature since Algol60. There is a reason for why other 
languages avoid it.


9. Local precise GC with explicit collection for catching 
cycles in graph data-structures.


10. An alternative to try-catch exceptions that enforce 
error-checking without a performance penalty. E.g. separate 
error tracking on returns or transaction style exceptions 
(jump to root and free all resources on failure).


+1000

I will add be consistent into phobos:
- remove all old module as std.mmfile
- put everywere @safe system trusted ...
- use everywhere as possible immutability ( const ref, in,
immutable )
- doing a smaller project with only working and non-deprecated
module
- std.stream
- consistant use of range into phobos


Re: Lost a new commercial user this week :(

2014-12-18 Thread bioinfornatics via Digitalmars-d

On Monday, 15 December 2014 at 01:30:00 UTC, Dicebot wrote:
On Sunday, 14 December 2014 at 08:37:36 UTC, Manu via 
Digitalmars-d wrote:

We were trying to use vibe.d, and we encountered bugs.

We were unable to build Win64 code ...


Here is exactly your problem - trying to do a web development 
on Windows :P Really I have never understood that 
counter-productive obsession with a habit that makes people 
differentiate development environments and production 
environments so much. You aren't going to use Windows servers, 
are you?




Completely, I agree with dicebot.

For a webserver usually is a Linux for many reason not a windows.
Guy who want to use a windows as server :
case 1 is a noob
case 2 is a specifics needs

Even microsoft use some linux server for his resources.

So to me the problem of D that is the waste of energy.
D exist since 1999, if we look behind, what is done?
We have :
- a huge cimetery of project
- no D killer application
- miss the goal what to do to improve D experience
- each new D release your application is broken and often with
some D compiler bugs
With around 15 years of works we are at same state as the
beginning.
What to de:
  - Stop to add new feature in D (new annotation or whatever is
not an urgent needs)
  - Get a compiler and a language stable
  - When this is done work on some free (libre) framework in some
specific fields
 * grid computing (sub-field: data-computing)
 * web-server
 * graphics conputing (sub-field: gui )
And not more, not to disperse …

But after ) years in D i start to doubt …


Re: Lost a new commercial user this week :(

2014-12-18 Thread bioinfornatics via Digitalmars-d
they are in same way mmfile module which is deprecated since many 
years, xml was in same case


What is the D plan's to become a used language?

2014-12-18 Thread bioinfornatics via Digitalmars-d

Dear,

My topic is a kick in the anthill. I hope this will help D to 
think on his problems.


D exist since 1999, if we look behind, what is done?
We have :
- a huge cemetery of D project
- no D killer application
- miss the goal what to do to improve D experience
- each new D release your application is broken and often with
some D compiler bugs
With around 15 years of works we are at same state as the
beginning.
What to do:
  - Stop to add new feature in D (new annotation or whatever is
not an urgent needs)
  - Get a compiler and a language stable
  - When this is done work on some free (libre) framework in some
specific fields
 * grid computing (sub-field: data-computing)
 * web-server
 * graphics computing (sub-field: gui )
And not more, not to disperse …


From the beginning D had a bad start (1999-200X):
- dmd compiler was not totally open.
- we got a fight on standard library phobos - tango
With this language started to get a bad publicity
- d2 is come with a new syntax which kill lot of project: - 
http://www.dsource.org/

survivor are: phobos: derelict, gtkd all others are dead

We get for years deprecated module: xml, json, mmfile

When we introduce a new feature we release it with a partial use:
- @safe often is not used as is not yet implemented into phobos
- range even the basic io as ByLine which implement range can't 
work with std.range.takeOne as is not an Input Range. While a 
basic function such as takeOne do not really need to use save 
method to work a forward range is enough.


So we adding feature and going forward without consolidate the 
previous works.
That is like you give to a children a gift, barely opened you 
give another gift.


Currently D project are:
- not open project to make money (no code shared)
- personal code ( which fit only one point of view )

Really I hope to see D3 with a clean model and a stable language. 
Do not release it as a toy like was done for D1 and D2.
Release D3 with much ah possible no compiler bug and a well 
implemented standard library. We have get enough experience to do 
it.



Why we do not create a useful D programming environment as is 
done is java, python, ruby.


Re: What is the D plan's to become a used language?

2014-12-18 Thread bioinfornatics via Digitalmars-d

about Dub, I have another view.
This build system was created for end user to get a missing 
library when they want their killer application. As is done with 
PyPI or gem.
Dub to me is not a builder for developer and even less for an OS. 
dub install software in home user a la windows style. I prefer 
to use makefile at least with it I can to write a clean builder 
with respect of standard OS specification. For this I tool 
makefile template from makefileForD hosted on github.
But we have already give a lot of talk on this, so we could 
discuss on it into a separate thread.


Re: Lost a new commercial user this week :(

2014-12-18 Thread bioinfornatics via Digitalmars-d

please stop with this dub 

It do not respect OS specification
Is a monolith application,inside they are at least 3 kinds of 
software:

- a builder
- a package manager
- a package indexer

In any case the :
 - no respect of OS specification and standard path
 - any discussion with OS packager or development with their needs

it is to me no dub!!!


Re: Lost a new commercial user this week :(

2014-12-18 Thread bioinfornatics via Digitalmars-d


How do you intend to provide build tools and package 
distribution that work across all OS?





split dub in smaller project as this packager could integrate 
tools inside Os themself.


python with his setup.py is to me a nice win
with it packager can configure it to fit right on Os
end user can use pip install
and pypi index package

That is s hard ...


Re: Lost a new commercial user this week :(

2014-12-18 Thread bioinfornatics via Digitalmars-d

On Thursday, 18 December 2014 at 14:32:03 UTC, Dicebot wrote:
On Thursday, 18 December 2014 at 13:48:27 UTC, bioinfornatics 
wrote:

please stop with this dub 

It do not respect OS specification
Is a monolith application,inside they are at least 3 kinds of 
software:

- a builder
- a package manager
- a package indexer

In any case the :
- no respect of OS specification and standard path
- any discussion with OS packager or development with their 
needs


it is to me no dub!!!


There is nothing in dub which conflicts with doing solid 
packaging. Unless you miss `make install` of course. I don't.


I agree, after all , all is possible.
but maybe I missed a feature make generation with dub is not 
supported : 
https://github.com/D-Programming-Language/dub/issues/52


and some var like LIB_DIR, PREFIX, DFLAGS, INCLUDE_DIR will be 
required by packager to set correctly the package


Re: Lost a new commercial user this week :(

2014-12-18 Thread bioinfornatics via Digitalmars-d

So now you are making Python a dependency.

Besides porting D to a new platform, Python must also be ported.

Yes, there are computer systems without Python support.


What ?
I took an example what is done in a close field .
I haven't said to put python as dependencies ...


Re: Lost a new commercial user this week :(

2014-12-18 Thread bioinfornatics via Digitalmars-d

On Thursday, 18 December 2014 at 14:46:33 UTC, Dicebot wrote:
How one can consider pip a good thing for packaging and blame 
dub at the same time is beyond my comprehensions. I have 
nothing but hatred against both pip and gems.


You missed the point:
- to me dub is a pip like

but in python they split into 3 software
- a builder (setuptool and newer version)
- a package manager (pip)
- a package index (pypi)

This is better to me, people which do not care about pip and 
other can to use only the builder.

End user to get their killer app working can use pip

with the same file setup.py they add many software level:
- end user do not care about standard path and want something 
easy to use
- packager need to insert correctly the software inside OS 
environment


With the json file for dub I think that is possible to get it


Re: Lost a new commercial user this week :(

2014-12-17 Thread bioinfornatics via Digitalmars-d



- I want a gui toolkit that is accelerated e.g. OpenGL.
- That can be layered drawn on top of other OpenGL content.
- Completely configurable at runtime e.g. change of shaders.
- Centralized themeing.
- That works on all major platforms without heartache.

But here's the thing about guis in general.
Gui toolkits are not really designed to work with OpenGL like 
this.


They had in D1 an awesome project fully written in D named rae:
http://www.dsource.org/projects/rae

all ui was possible by using openGL

but since the beginning all D project go to the death. Language
es not enough stable and maybe lot of others problem.

I become not anymore a D enthousiast.


erf…



Re: UDA failling to build when using delegate

2014-11-05 Thread bioinfornatics via Digitalmars-d-learn

On Tuesday, 4 November 2014 at 22:06:03 UTC, Ali Çehreli wrote:

On 11/04/2014 01:58 PM, bioinfornatics wrote:

 test.d(40): Error: type Section!((letter) = letter == '',
 (letter) = letter == '\x0a') has no value

You have this line:

@Section!(/* ... */)

Although that is a type name, there is a bug somewhere and 
sometimes you have to use a 'value' as a UDA. (We talked about 
this recently but I don't remember the details.) So make it an 
object so that it is a 'value':


@Section!(/* ... */)()

(You have another instance of that.)

You will have to deal with the next set of error messages now. 
:-/


Ali


Thanks Ali

If i understand well, that is a dmdfe bug ?

i yes that is weird as using @Section!(/* ... */)() give to me
something type of void then I can't filter to the desired  uda


Re: UDA failling to build when using delegate

2014-11-05 Thread bioinfornatics via Digitalmars-d-learn

On Wednesday, 5 November 2014 at 21:57:42 UTC, bioinfornatics
wrote:

On Tuesday, 4 November 2014 at 22:06:03 UTC, Ali Çehreli wrote:

On 11/04/2014 01:58 PM, bioinfornatics wrote:

 test.d(40): Error: type Section!((letter) = letter == '',
 (letter) = letter == '\x0a') has no value

You have this line:

   @Section!(/* ... */)

Although that is a type name, there is a bug somewhere and 
sometimes you have to use a 'value' as a UDA. (We talked about 
this recently but I don't remember the details.) So make it an 
object so that it is a 'value':


   @Section!(/* ... */)()

(You have another instance of that.)

You will have to deal with the next set of error messages now. 
:-/


Ali


Thanks Ali

If i understand well, that is a dmdfe bug ?

i yes that is weird as using @Section!(/* ... */)() give to me
something type of void then I can't filter to the desired  uda


Oh that is ok, I replaced

static if(is(attr : Section!T, T...))
by
static if(is(Section!(T, T)))


undefined reference to `_D5xxxx6yyyyy12__ModuleInfoZ'

2014-11-05 Thread bioinfornatics via Digitalmars-d-learn

Dear,

maybe I'm too tired to see my errors or they are a bug. See below

I have this:
.
|-- fasta.d
`-- src
 `-- nicea
 |-- metadata.d
 |-- parser.d
 `-- range.d

when I try to build it:

$ dmd -I./src/  ./fasta.d 21
fasta.o:(.rodata+0x1f8): undefined reference to
`_D5nicea6parser12__ModuleInfoZ'
collect2: error: ld returned 1 exit status
--- errorlevel 1

If I merge all files in one that build!

What is it ?

I tried to minimize the problem with dustmite but it give to me 
at end an empty file …


thanks


Re: undefined reference to `_D5xxxx6yyyyy12__ModuleInfoZ'

2014-11-05 Thread bioinfornatics via Digitalmars-d-learn

On Wednesday, 5 November 2014 at 23:53:57 UTC, Ali Çehreli wrote:

On 11/05/2014 03:48 PM, bioinfornatics wrote:

Dear,

maybe I'm too tired to see my errors or they are a bug. See 
below


I have this:
.
|-- fasta.d
`-- src
 `-- nicea
 |-- metadata.d
 |-- parser.d
 `-- range.d

when I try to build it:

$ dmd -I./src/  ./fasta.d 21


Include all files no the command line:

$ dmd -I./src/  ./fasta.d ./src/nicea/metadata.d 
./src/nicea/parser.d ./src/nicea/range.d 21



fasta.o:(.rodata+0x1f8): undefined reference to
`_D5nicea6parser12__ModuleInfoZ'
collect2: error: ld returned 1 exit status
--- errorlevel 1

If I merge all files in one that build!

What is it ?

I tried to minimize the problem with dustmite but it give to 
me at end

an empty file …

thanks


Ali


Oh yes , …

I need to sleep thanks a lot guys


Re: UDA failling to build when using delegate

2014-11-04 Thread bioinfornatics via Digitalmars-d-learn

On Tuesday, 4 November 2014 at 00:32:52 UTC, bioinfornatics wrote:
On Monday, 3 November 2014 at 23:53:53 UTC, bioinfornatics 
wrote:

Dear,

why this code fail to build http://dpaste.dzfl.pl/8ef3898b05d2 
?


I try to have a structure which is used to fill information 
from

a file.
And I use UDA to tell : to get this field you need to read 
from x

to y using a delegate.


thanks for your advise


with ldc and dmdfe 2.066 i got:

$ ldc2 test.d
test.d(40): Error: type Section!((letter) = letter == '',
(letter) = letter == '\x0a') has no value
tuple((Section!((letter) = letter == '', (letter) = letter ==
'\x0a')))
Section!((letter) = letter == '', (letter) = letter == 
'\x0a')
test.d(92): Error: this for countUntil needs to be type Fasta 
not

type Parser!(Fasta, ByChunk)
test.d(99): Error: this for countUntil needs to be type Fasta 
not

type Parser!(Fasta, ByChunk)
test.d(101): Error: this for countUntil needs to be type Fasta
not type Parser!(Fasta, ByChunk)
test.d(109): Error: this for countUntil needs to be type Fasta
not type Parser!(Fasta, ByChunk)
test.d(43): Error: type Section!((letter) = letter = 'A' 
letter = 'z', (letter) = letter == '\x0a') has no value
tuple((Section!((letter) = letter = 'A'  letter = 'z',
(letter) = letter == '\x0a')))
Section!((letter) = letter = 'A'  letter = 'z', (letter) =
letter == '\x0a')
test.d(92): Error: this for countUntil needs to be type Fasta 
not

type Parser!(Fasta, ByChunk)
test.d(99): Error: this for countUntil needs to be type Fasta 
not

type Parser!(Fasta, ByChunk)
test.d(101): Error: this for countUntil needs to be type Fasta
not type Parser!(Fasta, ByChunk)
test.d(109): Error: this for countUntil needs to be type Fasta
not type Parser!(Fasta, ByChunk)
test.d(7): Error: template instance test.Parser!(Fasta, ByChunk)
error instantiating



No one can to help about uda?


Re: Why ByChunk is not regnize by st.range.takeOne and why Section has no value

2014-11-03 Thread bioinfornatics via Digitalmars-d-learn

On Monday, 3 November 2014 at 06:43:50 UTC, Ali Çehreli wrote:

On 11/02/2014 04:58 PM, bioinfornatics wrote:

 Dear,
 Some problem to build this code:
http://fpaste.org/147327/75948141/


 $ ldc2 fasta_test.d
 /usr/include/d/std/range.d(3605): Error: template
std.array.save
 cannot deduce function from argument types !()(ByChunk),
 candidates are:

I think that is due to the too permissive template constraint 
of takeOne in phobos/std/range.d. Even though it say 
isInputRange!R, it clearly needs isForwardRange!R because 
it calls .save() on that range:


@property auto save() { return Result(_source.save, empty); 
}


So, the following is wrong:

  auto takeOne(R)(R source) if (isInputRange!R)

It should be:

  auto takeOne(R)(R source) if (isForwardRange!R)

If you modify range.d locally to require ForwardRange, you will 
see that your following call will get an error message because 
byChunk is not a ForwardRange:


// Take a piece of byte from current file
ubyte[] buffer =  takeOne(inputRange);

I think this issue is already reported as a part of the 
following bug:


  https://issues.dlang.org/show_bug.cgi?id=9724

Ali


Ok but I do not see why to use save method for a takeOne function
is possible to write this function without to use it


Re: Why ByChunk is not regnize by st.range.takeOne and why Section has no value

2014-11-03 Thread bioinfornatics via Digitalmars-d-learn

On Monday, 3 November 2014 at 21:03:51 UTC, bioinfornatics wrote:

On Monday, 3 November 2014 at 06:43:50 UTC, Ali Çehreli wrote:

On 11/02/2014 04:58 PM, bioinfornatics wrote:

 Dear,
 Some problem to build this code:
http://fpaste.org/147327/75948141/


 $ ldc2 fasta_test.d
 /usr/include/d/std/range.d(3605): Error: template
std.array.save
 cannot deduce function from argument types !()(ByChunk),
 candidates are:

I think that is due to the too permissive template constraint 
of takeOne in phobos/std/range.d. Even though it say 
isInputRange!R, it clearly needs isForwardRange!R because 
it calls .save() on that range:


   @property auto save() { return Result(_source.save, empty); 
}


So, the following is wrong:

 auto takeOne(R)(R source) if (isInputRange!R)

It should be:

 auto takeOne(R)(R source) if (isForwardRange!R)

If you modify range.d locally to require ForwardRange, you 
will see that your following call will get an error message 
because byChunk is not a ForwardRange:


   // Take a piece of byte from current file
   ubyte[] buffer =  takeOne(inputRange);

I think this issue is already reported as a part of the 
following bug:


 https://issues.dlang.org/show_bug.cgi?id=9724

Ali


Ok but I do not see why to use save method for a takeOne 
function

is possible to write this function without to use it


Example:

auto takeOne(R)(ref R source) if (isInputRange!R)
{
 static if (hasSlicing!R)
 {
 return source[0 .. !source.empty];
 }
 else
 {
 typeof(R.front) r;
 if(!source.empty){
 r = source.front;
 source.popFront();
 }

 return r;
 }
}


UDA failling to build when using delegate

2014-11-03 Thread bioinfornatics via Digitalmars-d-learn

Dear,

why this code fail to build http://dpaste.dzfl.pl/8ef3898b05d2 ?

I try to have a structure which is used to fill information from
a file.
And I use UDA to tell : to get this field you need to read from x
to y using a delegate.


thanks for your advise


Re: UDA failling to build when using delegate

2014-11-03 Thread bioinfornatics via Digitalmars-d-learn

On Monday, 3 November 2014 at 23:53:53 UTC, bioinfornatics wrote:

Dear,

why this code fail to build http://dpaste.dzfl.pl/8ef3898b05d2 ?

I try to have a structure which is used to fill information from
a file.
And I use UDA to tell : to get this field you need to read from 
x

to y using a delegate.


thanks for your advise


with ldc and dmdfe 2.066 i got:

$ ldc2 test.d
test.d(40): Error: type Section!((letter) = letter == '',
(letter) = letter == '\x0a') has no value
tuple((Section!((letter) = letter == '', (letter) = letter ==
'\x0a')))
Section!((letter) = letter == '', (letter) = letter == '\x0a')
test.d(92): Error: this for countUntil needs to be type Fasta not
type Parser!(Fasta, ByChunk)
test.d(99): Error: this for countUntil needs to be type Fasta not
type Parser!(Fasta, ByChunk)
test.d(101): Error: this for countUntil needs to be type Fasta
not type Parser!(Fasta, ByChunk)
test.d(109): Error: this for countUntil needs to be type Fasta
not type Parser!(Fasta, ByChunk)
test.d(43): Error: type Section!((letter) = letter = 'A' 
letter = 'z', (letter) = letter == '\x0a') has no value
tuple((Section!((letter) = letter = 'A'  letter = 'z',
(letter) = letter == '\x0a')))
Section!((letter) = letter = 'A'  letter = 'z', (letter) =
letter == '\x0a')
test.d(92): Error: this for countUntil needs to be type Fasta not
type Parser!(Fasta, ByChunk)
test.d(99): Error: this for countUntil needs to be type Fasta not
type Parser!(Fasta, ByChunk)
test.d(101): Error: this for countUntil needs to be type Fasta
not type Parser!(Fasta, ByChunk)
test.d(109): Error: this for countUntil needs to be type Fasta
not type Parser!(Fasta, ByChunk)
test.d(7): Error: template instance test.Parser!(Fasta, ByChunk)
error instantiating


Why ByChunk is not regnize by st.range.takeOne and why Section has no value

2014-11-02 Thread bioinfornatics via Digitalmars-d-learn

Dear,
Some problem to build this code: 
http://fpaste.org/147327/75948141/



$ ldc2 fasta_test.d
/usr/include/d/std/range.d(3605): Error: template std.array.save
cannot deduce function from argument types !()(ByChunk),
candidates are:
/usr/include/d/std/array.d(554):std.array.save(T)(T[] a)
fasta_test.d(46): Error: template instance
std.range.takeOne!(ByChunk) error instantiating
fasta_test.d(88):instantiated from here: Parser!(Fasta,
ByChunk)
fasta_test.d(79): Error: type Section!((words) = words[0] ==
'', (words) = words[0] == '\x0a') has no value
fasta_test.d(50): Error: template std.algorithm.countUntil cannot
deduce function from argument types !(__lambda3)(ubyte[]),
candidates are:
/usr/include/d/std/algorithm.d(5406):
std.algorithm.countUntil(alias pred = a == b, R, Rs...)(R
haystack, Rs needles) if (isForwardRange!R  Rs.length  0 
isForwardRange!(Rs[0]) == isInputRange!(Rs[0]) 
is(typeof(startsWith!pred(haystack, needles[0])))  (Rs.length
== 1 || is(typeof(countUntil!pred(haystack,
needles[1..__dollar])

Thanks for your help


Re: DUB 0.9.22 released

2014-10-06 Thread bioinfornatics via Digitalmars-d-announce

Thanks for your works,

One question, what about makefile support ?

Regards


Re: DUB 0.9.22 released

2014-10-06 Thread bioinfornatics via Digitalmars-d-announce

On Monday, 6 October 2014 at 18:15:08 UTC, Sönke Ludwig wrote:

Am 06.10.2014 13:36, schrieb bioinfornatics:

Thanks for your works,

One question, what about makefile support ?

Regards


It's still in need for a volunteer. The implementation itself 
should be pretty straightforward (by inheriting from the 
ProjectGenerator class), but I currently have too much higher 
priority stuff on my table to get that done (plus generally 
severely limited time due to an accumulation of work and 
non-work related things).


I take a look but without a hacker doc that is not easy. So I
have some question ( do nott blame me )

---
why class who inherit from ProjectGenerator:
- should to get PackageManager as parameter in ctor (1) while
Project(2) struct has a PackageManager. Project struct is send
too in the ctor.

1)
https://github.com/D-Programming-Language/dub/blob/master/source/dub/generators/build.d#L39
2)
https://github.com/D-Programming-Language/dub/blob/master/source/dub/project.d#L39

---
why method:
generateTargets( in GeneratorSettings settings, in
TargetInfo[string] targets)

take an associative array of targets always you use only one
target named m_project.rootPackage.name

---
why you assign project (3) this is  not done when super is called
(4)?
3)
https://github.com/D-Programming-Language/dub/blob/master/source/dub/generators/build.d#L42
4)
https://github.com/D-Programming-Language/dub/blob/master/source/dub/generators/generator.d#L48

thanks


What is best way to communicate between computer in local network ?

2014-06-27 Thread bioinfornatics via Digitalmars-d-learn

Hi,

I have a linux network and i would like to know if they are a D 
library to  communicate between computer efficiently.


I do not know if that is better to use websocket and if they 
exists into dlang:
- 
http://planet.jboss.org/post/rest_vs_websocket_comparison_and_benchmarks


Thanks for your help

Regards


Re: What is best way to communicate between computer in local network ?

2014-06-27 Thread bioinfornatics via Digitalmars-d-learn

On Friday, 27 June 2014 at 13:03:20 UTC, John Colvin wrote:

On Friday, 27 June 2014 at 12:51:45 UTC, bioinfornatics wrote:

Hi,

I have a linux network and i would like to know if they are a 
D library to  communicate between computer efficiently.


I do not know if that is better to use websocket and if they 
exists into dlang:
- 
http://planet.jboss.org/post/rest_vs_websocket_comparison_and_benchmarks


Thanks for your help

Regards


It's an application and network dependant decision, but I would 
suggest http://code.dlang.org/packages/zmqd as suitable for 
most situations.


Thanks i go to take a look


Re: What is best way to communicate between computer in local network ?

2014-06-27 Thread bioinfornatics via Digitalmars-d-learn

On Friday, 27 June 2014 at 13:02:55 UTC, Adam D. Ruppe wrote:

On Friday, 27 June 2014 at 12:51:45 UTC, bioinfornatics wrote:
I do not know if that is better to use websocket and if they 
exists into dlang:


you could use websocket in D but if you are talking between two 
separate D programs you can just use a regular socket


http://dlang.org/phobos/std_socket.html

If you have a copy of my book, I have a brief how-to on 
std.socket in chapter 2. But for two computers just talking to 
one another all you have to do is on one:


new Socket
bind
accept

and on the other one:

new Socket
connect


See the documentation for info on each of those methods.


Yes I bought your book i will read this chapter.

Thanks


Re: Swift is based LLVM,what will the D's LDC do?

2014-06-05 Thread bioinfornatics via Digitalmars-d

On Thursday, 5 June 2014 at 06:40:17 UTC, Walter Bright wrote:

On 6/4/2014 9:25 AM, Iain Buclaw via Digitalmars-d wrote:
This likewise gdc too.  All you need to do is look at the 
downloads

page on dlang.org !


It still says nothing about doing:

   sudo apt-get install gdc

on Ubuntu! Why keep it a secret? :-)



On Fedora
   sudo yum install ldc

;-)


Re: why it said no identifier for declarator …

2014-06-04 Thread bioinfornatics via Digitalmars-d-learn

On Wednesday, 4 June 2014 at 00:07:35 UTC, Jesse Phillips wrote:

On Tuesday, 3 June 2014 at 22:10:06 UTC, bioinfornatics wrote:
I do not see why it fail in debug output we see that tuple 
have a

field with given name.


Your generated output (short and formatted)

alias TL = Tuple!(int,x,  bool function( const ref string 
),

xStartsWith , bool function( const ref string ), xEndsWith ,
int,y,  bool function( const ref string ), yStartsWith , 
bool

function( const ref string ), yEndsWith );

TL.xStartsWith...

TL is a type.

TL variable;
variable.xStartsWith...


oh stupid me thanks Jesse sometime you do not see a problem 
visible as the nose on your face.


Re: why it said no identifier for declarator …

2014-06-04 Thread bioinfornatics via Digitalmars-d-learn

On Wednesday, 4 June 2014 at 00:07:35 UTC, Jesse Phillips wrote:

On Tuesday, 3 June 2014 at 22:10:06 UTC, bioinfornatics wrote:
I do not see why it fail in debug output we see that tuple 
have a

field with given name.


Your generated output (short and formatted)

alias TL = Tuple!(int,x,  bool function( const ref string 
),

xStartsWith , bool function( const ref string ), xEndsWith ,
int,y,  bool function( const ref string ), yStartsWith , 
bool

function( const ref string ), yEndsWith );

TL.xStartsWith...

TL is a type.

TL variable;
variable.xStartsWith...



after a tmeplate update


template toTuple(T){
static string maker(){
string assignFunction = TL tl; ;
string statement  = alias TL = Tuple!(;
foreach(const memberName; __traits(allMembers, T)){
mixin(`alias f = Filter!(isSection, 
__traits(getAttributes, T.` ~ memberName ~ `));`);

if( f.length == 1 )
{
statement   ~= typeof(__traits(getMember, T, 
memberName)).stringof  ~ ,\ ~ memberName ~ \, 
~  bool function( const ref string 
), \ ~ memberName ~ StartsWith\,
~  bool function( const ref string 
), \ ~ memberName ~ EndsWith\,  ;
assignFunction ~= tl. ~ memberName ~ 
StartsWith = __traits(getAttributes, T. ~ memberName ~ 
)[0].startsWith; 
   ~  tl. ~ memberName ~ EndsWith  
 = __traits(getAttributes, T. ~ memberName ~ )[0].endsWith; ;

}
}
statement = statement[0..$-2] ~ ) ; ; // $-2 to remove 
extra comma

return statement~assignFunction~ alias toTuple = tl;;
}
pragma( msg, maker() );
mixin( maker() );
}




which generate this string:

alias TL = Tuple!(int,x,  bool function( const ref string ), 
xStartsWith, bool function( const ref string ), xEndsWith, 
int,y,  bool function( const ref string ), yStartsWith, bool 
function( const ref string ), yEndsWith) ;

TL tl;
tl.xStartsWith = __traits(getAttributes, T.x)[0].startsWith;
tl.xEndsWith   = __traits(getAttributes, T.x)[0].endsWith;
tl.yStartsWith = __traits(getAttributes, T.y)[0].startsWith;
tl.yEndsWith   = __traits(getAttributes, T.y)[0].endsWith;
alias toTuple = tl;



This produce an error at mixin step:

attribute.d-mixin-62(62): Error: no identifier for declarator 
tl.xStartsWith

attribute.d-mixin-62(62): Error: Declaration expected, not '='
attribute.d-mixin-62(62): Error: no identifier for declarator 
tl.xEndsWith

attribute.d-mixin-62(62): Error: Declaration expected, not '='
attribute.d-mixin-62(62): Error: no identifier for declarator 
tl.yStartsWith

attribute.d-mixin-62(62): Error: Declaration expected, not '='
attribute.d-mixin-62(62): Error: no identifier for declarator 
tl.yEndsWith

attribute.d-mixin-62(62): Error: Declaration expected, not '='
;


Re: How to assign a delegate to a var ?

2014-06-03 Thread bioinfornatics via Digitalmars-d-learn

On Monday, 2 June 2014 at 23:27:03 UTC, Meta wrote:

On Monday, 2 June 2014 at 22:18:39 UTC, bioinfornatics wrote:

Hi,

I would like store the delegate to another var but when i try i
get:


testTraitsWithDelegate.d(13): Error: expression template
__lambda2 is void and has no value

I do not want to run it only to save the «function» somewhere.


--- CODE 
import std.stdio;
import std.typecons : Tuple;

struct attribute( alias Pred )
{
alias Predicate = Pred;
}



struct Data
{
@attribute!( (a) = a == 42 )
int x;
}



void main()
{

bool delegate( int ) tmp;

pragma( msg, __traits(getAttributes, Data.x)[0].Predicate( 
42

) );

tmp = __traits(getAttributes, Data.x)[0].Predicate;
}
--- END CODE 


The problem is that you're missing the type of a in (a) = a 
== 42. Without the type, it's actually a template lambda, not 
a lambda function. Try changing it to (int a) = a == 42.

auto


with this i got an error even if i do public alias Predicate in
struct attribute:
Error: struct testTraitsWithDelegate.attribute!(function (int a)
= a == 42).attribute member __lambda2 is not accessible

and i fail to do same with

struct attribute
{
   public:
 static bool delegate( int ) Predicate;
}


Re: How to assign a delegate to a var ?

2014-06-03 Thread bioinfornatics via Digitalmars-d-learn

On Tuesday, 3 June 2014 at 12:27:45 UTC, bioinfornatics wrote:

On Monday, 2 June 2014 at 23:27:03 UTC, Meta wrote:

On Monday, 2 June 2014 at 22:18:39 UTC, bioinfornatics wrote:

Hi,

I would like store the delegate to another var but when i try 
i

get:


testTraitsWithDelegate.d(13): Error: expression template
__lambda2 is void and has no value

I do not want to run it only to save the «function» somewhere.


--- CODE 
import std.stdio;
import std.typecons : Tuple;

struct attribute( alias Pred )
{
   alias Predicate = Pred;
}



struct Data
{
   @attribute!( (a) = a == 42 )
   int x;
}



void main()
{

   bool delegate( int ) tmp;

   pragma( msg, __traits(getAttributes, Data.x)[0].Predicate( 
42

) );

   tmp = __traits(getAttributes, Data.x)[0].Predicate;
}
--- END CODE 


The problem is that you're missing the type of a in (a) = a 
== 42. Without the type, it's actually a template lambda, not 
a lambda function. Try changing it to (int a) = a == 42.

auto


with this i got an error even if i do public alias Predicate in
struct attribute:
Error: struct testTraitsWithDelegate.attribute!(function (int a)
= a == 42).attribute member __lambda2 is not accessible

and i fail to do same with

struct attribute
{
   public:
 static bool delegate( int ) Predicate;
}





To have same code

- code ---
import std.stdio;
import std.typecons : Tuple;
//~ import std.functional : toDelegate;
//~ struct attribute( alias Pred )
//~ {
//~ public:
//~ alias Predicate = Pred;
//~ }

struct attribute
{
public bool delegate( int ) predicate;
public this(  bool delegate( int ) pred )
{
predicate = pred;
}
}

struct Data
{
@attribute( (int a) = a == 42 )
int x;
}



void main()
{

bool delegate( int ) tmp;

pragma( msg, __traits(getAttributes, Data.x)[0] );
pragma( msg, __traits(getAttributes, Data.x)[0].predicate( 42 
) );


pragma( msg, __traits(getAttributes, 
Data.x)[0].predicate.stringof );

tmp = __traits(getAttributes, Data.x)[0].predicate;
writeln( tmp(42 ) );
//~tmp = toDelegate(__traits(getAttributes, 
Data.x)[0].Predicate);

}
--




give at compile time this:

attribute(function (int a) = a == 42)
true
(attribute __ctmp1474;
 , __ctmp1474).this(function (int a) = a == 42).predicate


And segfault at run-time


Re: How to assign a delegate to a var ?

2014-06-03 Thread bioinfornatics via Digitalmars-d-learn

On Tuesday, 3 June 2014 at 15:00:05 UTC, Ali Çehreli wrote:

On 06/03/2014 05:57 AM, bioinfornatics wrote:

 On Tuesday, 3 June 2014 at 12:27:45 UTC, bioinfornatics wrote:

 I would like store the delegate to another var but when i
try i
 get:


 testTraitsWithDelegate.d(13): Error: expression template
 __lambda2 is void and has no value

 I do not want to run it only to save the «function»
somewhere.

 - code ---
 import std.stdio;
 import std.typecons : Tuple;
 //~ import std.functional : toDelegate;
 //~ struct attribute( alias Pred )
 //~ {
 //~ public:
 //~ alias Predicate = Pred;
 //~ }

 struct attribute
 {
  public bool delegate( int ) predicate;
  public this(  bool delegate( int ) pred )
  {
  predicate = pred;
  }
 }

 struct Data
 {
  @attribute( (int a) = a == 42 )
  int x;
 }



 void main()
 {

  bool delegate( int ) tmp;

  pragma( msg, __traits(getAttributes, Data.x)[0] );
  pragma( msg, __traits(getAttributes,
Data.x)[0].predicate( 42 ) );

  pragma( msg, __traits(getAttributes,
Data.x)[0].predicate.stringof );
  tmp = __traits(getAttributes, Data.x)[0].predicate;
  writeln( tmp(42 ) );
  //~tmp = toDelegate(__traits(getAttributes,
Data.x)[0].Predicate);
 }
 --




 give at compile time this:

 attribute(function (int a) = a == 42)
 true
 (attribute __ctmp1474;
   , __ctmp1474).this(function (int a) = a == 42).predicate


 And segfault at run-time

A delegate has a context pointer that it uses when executing at 
run-time. However, there can't be a run-time context of a 
delegate that is created at compile-time. I think that is why 
the segfault.


Is there a reason why it needs to be a delegate?

Replacing every 'delegate' with 'function' makes your code work.

Ali



The only reason that is because i do nor know how to do:

 @attribute( (int a) = a == 42 )
 int x;

without using a delegate, with a function that will not work as  
(int a) = a == 42 is a delegate no ?


struct attribute
{
public bool function( int ) predicate;
public this(  bool function( int ) pred )
{
predicate = pred;
}
}





Re: How to assign a delegate to a var ?

2014-06-03 Thread bioinfornatics via Digitalmars-d-learn

delegate has a context pointer that it uses when executing
at run-time. However, there can't be a run-time context of a 
delegate that is created at compile-time. I think that is why 
the segfault.


Is there a reason why it needs to be a delegate?

Replacing every 'delegate' with 'function' makes your code 
work.


Ali




i got it with function, thx Ali

-- code --
import std.stdio;
import std.typecons : Tuple;

struct attribute
{
public bool function( int ) predicate;
public this(  bool function( int ) pred )
{
predicate = pred;
}
}

struct Data
{
@attribute( (int a) = a == 42 )
int x;
@attribute( (int a) = a == 8 )
int y;
}



void main()
{

bool function( int ) tmp;

pragma( msg, __traits(getAttributes, Data.x)[0] );
pragma( msg, __traits(getAttributes, Data.x)[0].predicate( 42 
) );

tmp = __traits(getAttributes, Data.x)[0].predicate;
writeln( tmp(42 ) );
}


How to assign a delegate to a var ?

2014-06-02 Thread bioinfornatics via Digitalmars-d-learn

Hi,

I would like store the delegate to another var but when i try i
get:


testTraitsWithDelegate.d(13): Error: expression template
__lambda2 is void and has no value

I do not want to run it only to save the «function» somewhere.


--- CODE 
import std.stdio;
import std.typecons : Tuple;

struct attribute( alias Pred )
{
 alias Predicate = Pred;
}



struct Data
{
 @attribute!( (a) = a == 42 )
 int x;
}



void main()
{

 bool delegate( int ) tmp;

 pragma( msg, __traits(getAttributes, Data.x)[0].Predicate( 42
) );

 tmp = __traits(getAttributes, Data.x)[0].Predicate;
}
--- END CODE 


How to convert int type to string int ?

2014-06-01 Thread bioinfornatics via Digitalmars-d-learn

Hi,

All is in the title.
I need this to do a tupleof enhanced, that mean:
   - .tupleof need an instance me i want to do this on type
diretcly
   - .tupleof do not bind to member name i need this


for this i strat to this code:

import std.stdio;
import std.typecons;
import std.conv;

struct Coord
{
 int x;
 int y;
 int z;
}

template toTuple(T){
 static string maker(){
 string statement = alias Tuple!(;
 foreach(const memberName; __traits(allMembers, T)){
 statement ~=  to!string(typeof(__traits(getMember, T,
memberName)))  ~ ,\ ~ memberName ~ \,  ;
 }
 statement = statement[O..$-1] ~ ) t; ; // $-1 to remove
extra comma
 return statement;
 }
 enum toTuple = mixin( maker() );
}


but that fail on typeof(__traits(getMember, T, memberName) becase
that return a type and not a string.


Thaks for your help


Re: How to convert int type to string int ?

2014-06-01 Thread bioinfornatics via Digitalmars-d-learn

On Sunday, 1 June 2014 at 13:34:20 UTC, bioinfornatics wrote:

Hi,

All is in the title.
I need this to do a tupleof enhanced, that mean:
   - .tupleof need an instance me i want to do this on type
diretcly
   - .tupleof do not bind to member name i need this


for this i strat to this code:

import std.stdio;
import std.typecons;
import std.conv;

struct Coord
{
 int x;
 int y;
 int z;
}

template toTuple(T){
 static string maker(){
 string statement = alias Tuple!(;
 foreach(const memberName; __traits(allMembers, T)){
 statement ~=  to!string(typeof(__traits(getMember, 
T,

memberName)))  ~ ,\ ~ memberName ~ \,  ;
 }
 statement = statement[O..$-1] ~ ) t; ; // $-1 to 
remove

extra comma
 return statement;
 }
 enum toTuple = mixin( maker() );
}


but that fail on typeof(__traits(getMember, T, memberName) 
becase

that return a type and not a string.


Thaks for your help


I find this: typeid(typeof(__traits(getMember, T,
memberName))).toString
but that do not works at compile time.

Error: static variable typeid(int) cannot be read at compile time


Re: How to convert int type to string int ?

2014-06-01 Thread bioinfornatics via Digitalmars-d-learn

On Sunday, 1 June 2014 at 13:52:27 UTC, Tobias Pankrath wrote:

Maybe http://dlang.org/property.html#stringof helps.


yes that help a lot thanks


Re: How to convert int type to string int ?

2014-06-01 Thread bioinfornatics via Digitalmars-d-learn

I bam close to be done

import std.stdio;
import std.typecons;
import std.conv;

struct Coord
{
 int x;
 int y;
 int z;
}

template toTuple(T){
 static string maker(){
 string statement = alias Tuple!(;
 foreach(const memberName; __traits(allMembers, T)){
 statement ~=  typeof(__traits(getMember, T,
memberName)).stringof  ~ ,\ ~ memberName ~ \,  ;
 }
 statement = statement[0..$-2] ~ ) toTuple; ; // $-1 to
remove extra comma
 return statement;
 }
 pragma( msg, maker() );
 mixin( maker() );
}

void main()
{
 //auto a = c.tupleof;
 auto a = toTuple!Coord;
}



$ ldc2 -w -oftestTupleof testTupleof.d
alias Tuple!(int,x, int,y, int,z) toTuple;
testTupleof.d(29): Error: type Tuple!(int, x, int, y, int,
z) has no value


Re: How to convert int type to string int ?

2014-06-01 Thread bioinfornatics via Digitalmars-d-learn

On Sunday, 1 June 2014 at 13:58:03 UTC, bioinfornatics wrote:

On Sunday, 1 June 2014 at 13:52:27 UTC, Tobias Pankrath wrote:

Maybe http://dlang.org/property.html#stringof helps.


yes that help a lot thanks


End of spam ( joke ^^)


I found it :-)

import std.stdio;
import std.typecons;
import std.conv;

struct Coord
{
 int x;
 int y;
 int z;
}

template toTuple(T){
 static string maker(){
 string statement = alias toTuple = Tuple!(;
 foreach(const memberName; __traits(allMembers, T)){
 statement ~=  typeof(__traits(getMember, T,
memberName)).stringof  ~ ,\ ~ memberName ~ \,  ;
 }
 statement = statement[0..$-2] ~ ) ; ; // $-1 to remove
extra comma
 return statement;
 }
 pragma( msg, maker() );
 mixin( maker() );
}


void main()
{
 Coord c;
 alias A = toTuple!Coord;
 A a;
 a[0] = 1;
 a.x = 1;
}


DMD fail when using both reflection and UDA

2014-06-01 Thread bioinfornatics via Digitalmars-d-learn

DMD (dmdfe 2.066) fail when i use UDA which store a delegate


code below works if i remove @section UDA otheswise it give this
error:

dmd: statement.c:714: ErrorStatement::ErrorStatement(): Assertion
`global.gaggedErrors || global.errors' failed.


is a bug  ?



--- CODE also on dpaste http://dpaste.dzfl.pl/3a3d660bd3bc

import std.stdio;
import std.typecons : Tuple;
import std.typetuple : Filter;


struct attribute{}

@attribute
struct section( alias start, alias end)
{
 alias checkStart = start;
 alias checkEnd = end;
}

template hasSection(T)
{
 static bool helper()
 {
 foreach(memberName; __traits(allMembers, T))
 {
 foreach(attr; __traits(getAttributes,
__traits(getMember, T, memberName)))
 {
 static if(is(attr == Section))
 return true;
 }
 }
 return false;
 }

 enum hasSection = helper();
}

struct Data{
 @section!( ( words ) =  words[0] == '@' , (
words ) =  words[0] == '\n' )
 string a;
 @section!( ( words ) =  words[0]  63  words[0] 115  , (
words ) =  words[0] == '\n' )
 string b;
 @section!( ( words ) =  words[0] == '+' , (
words ) =  words[0] == '\n' )
 string c;
}

template toTuple(T){
 static string maker(){
 string statement = alias toTuple = Tuple!(;
 foreach(const memberName; __traits(allMembers, T)){
 //~ mixin(`alias f = Filter!(hasSection,
__traits(getAttributes, T.` ~ memberName ~ `));`);
 statement ~=  typeof(__traits(getMember, T,
memberName)).stringof  ~ ,\ ~ memberName ~ \,  ;
 }
 statement = statement[0..$-2] ~ ) ; ; // $-2 to remove
extra comma
 return statement;
 }
 mixin( maker() );
}


void main()
{
 alias A = toTuple!Data;
 A a;
 a[0] = 1;
 a.x = 1;
}


Re: DMD fail when using both reflection and UDA

2014-06-01 Thread bioinfornatics via Digitalmars-d-learn

On Sunday, 1 June 2014 at 16:02:47 UTC, bioinfornatics wrote:

DMD (dmdfe 2.066) fail when i use UDA which store a delegate


code below works if i remove @section UDA otheswise it give this
error:

dmd: statement.c:714: ErrorStatement::ErrorStatement(): 
Assertion

`global.gaggedErrors || global.errors' failed.


is a bug  ?



--- CODE also on dpaste http://dpaste.dzfl.pl/3a3d660bd3bc

import std.stdio;
import std.typecons : Tuple;
import std.typetuple : Filter;


struct attribute{}

@attribute
struct section( alias start, alias end)
{
 alias checkStart = start;
 alias checkEnd = end;
}

template hasSection(T)
{
 static bool helper()
 {
 foreach(memberName; __traits(allMembers, T))
 {
 foreach(attr; __traits(getAttributes,
__traits(getMember, T, memberName)))
 {
 static if(is(attr == Section))
 return true;
 }
 }
 return false;
 }

 enum hasSection = helper();
}

struct Data{
 @section!( ( words ) =  words[0] == '@' , 
(

words ) =  words[0] == '\n' )
 string a;
 @section!( ( words ) =  words[0]  63  words[0] 115  , 
(

words ) =  words[0] == '\n' )
 string b;
 @section!( ( words ) =  words[0] == '+' , 
(

words ) =  words[0] == '\n' )
 string c;
}

template toTuple(T){
 static string maker(){
 string statement = alias toTuple = Tuple!(;
 foreach(const memberName; __traits(allMembers, T)){
 //~ mixin(`alias f = Filter!(hasSection,
__traits(getAttributes, T.` ~ memberName ~ `));`);
 statement ~=  typeof(__traits(getMember, T,
memberName)).stringof  ~ ,\ ~ memberName ~ \,  ;
 }
 statement = statement[0..$-2] ~ ) ; ; // $-2 to 
remove

extra comma
 return statement;
 }
 mixin( maker() );
}


void main()
{
 alias A = toTuple!Data;
 A a;
 a[0] = 1;
 a.x = 1;
}



ok it seem problem from my code a type string i need to
understand why


Re: DMD fail when using both reflection and UDA

2014-06-01 Thread bioinfornatics via Digitalmars-d-learn

stupid me bug was at the end

a[0] = 1;
  become
  a[0] = 1;

but error error was so stnange to me i though that was a bug


How to detect a lambda expression get it is signature

2014-06-01 Thread bioinfornatics via Digitalmars-d-learn

Hi i am looking how to perform this action with traits. Below
some code to show what it fail


Regards


 CODE
import std.traits   : isDelegate, isSomeFunction,
MemberFunctionsTuple, ParameterIdentifierTuple;


struct section( alias start, alias end )
{
 alias checkStart = start;
 alias checkEnd = end;
}

void main()
{
 alias tmp = bool delegate( string ); // what i would like to
get
 alias s = section!( (word) = word ==a , (word) = word ==
b );
 pragma( msg, isSomeFunction!(s.checkStart) );   //
false
 pragma( msg, isDelegate!(s.checkStart) );   //
false
 pragma( msg, __traits(identifier, s.checkStart) );  //
__lambda1
 pragma( msg, ParameterIdentifierTuple!(s.checkStart) ); //
error
 pragma( msg, MemberFunctionsTuple!( s.checkStart ) );   //
error
}


  1   2   >