Re: How to use Code::Block with D compiler ?

2014-08-09 Thread Larry Hemsley via Digitalmars-d-learn
Is the d compiler on the path? Also, check the compiler settings for the d compiler and make sure that the d compiler is the default compiler. On 08/08/2014 11:15 AM, Borneq wrote: I want use dmd compiler with COde:Blocks. IDE detect compiler but is error "can't find compiler executable". I ha

Re: Small part of a program : d and c versions performances diff.

2014-07-09 Thread Larry via Digitalmars-d-learn
The actual code is not that much slower according to the numerous other operations we do. And certainly faster than D version doing almost nothing. Well it is about massive bitshifts and array accesses and calculations. With all the optimizations we are on par with fortran numerical code (tha

Re: Small part of a program : d and c versions performances diff.

2014-07-09 Thread Larry via Digitalmars-d-learn
Right

Re: Small part of a program : d and c versions performances diff.

2014-07-09 Thread Larry via Digitalmars-d-learn
On Wednesday, 9 July 2014 at 18:18:43 UTC, Ali Çehreli wrote: On 07/09/2014 03:57 AM, Larry wrote: > struct timeval s,e; [...] > gettimeofday(&e,NULL); > > printf("so ? %d %lu %d %d %d",g,e.tv_usec - s.tv_usec, > arr[4],arr[9],pol); Changing the to

Re: Small part of a program : d and c versions performances diff.

2014-07-09 Thread Larry via Digitalmars-d-learn
@Chris : Actually yes. If we consider the device to run 20h a day, by shaving a few microseconds there and there on billions of operations a day over a whole machine park, you can enable yourself to shut down some of them for maintenance more easily, or pause some of them letting their battery

Re: Small part of a program : d and c versions performances diff.

2014-07-09 Thread Larry via Digitalmars-d-learn
I may definitely help on the D project. I noticed that gdc doesn't have profile guided optimization too. So yeah, I cannot use D right now, I mean for this project. Ok, I will do my best to have some spare time on Dlang. Didn't really looked at the code already and I code for years in C, which

Re: Small part of a program : d and c versions performances diff.

2014-07-09 Thread Larry via Digitalmars-d-learn
On Wednesday, 9 July 2014 at 14:30:41 UTC, John Colvin wrote: On Wednesday, 9 July 2014 at 13:46:59 UTC, Larry wrote: The rest of the code is numerical so it will not change by much the fact that d cannot get back the huge launching time. At the microsecond level(even nano) it counts because

Re: Small part of a program : d and c versions performances diff.

2014-07-09 Thread Larry via Digitalmars-d-learn
@Bearophile: just tried. No dramatic change. import core.memory; void main() { GC.disable; ... }

Re: Small part of a program : d and c versions performances diff.

2014-07-09 Thread Larry via Digitalmars-d-learn
On Wednesday, 9 July 2014 at 13:46:59 UTC, Larry wrote: Yes you are perfectly right but our need is to run the fastest code on the lowest powered machines. Not servers but embedded systems. That is why I just test the overall structures. The rest of the code is numerical so it will not

Re: Small part of a program : d and c versions performances diff.

2014-07-09 Thread Larry via Digitalmars-d-learn
Yes you are perfectly right but our need is to run the fastest code on the lowest powered machines. Not servers but embedded systems. That is why I just test the overall structures. The rest of the code is numerical so it will not change by much the fact that d cannot get back the huge launch

Re: Small part of a program : d and c versions performances diff.

2014-07-09 Thread Larry via Digitalmars-d-learn
On Wednesday, 9 July 2014 at 12:25:40 UTC, bearophile wrote: Larry: Now the performance : D : 12 µs C : < 1µs Where does the diff comes from ? Is there a way to optimize the d version ? Again, I am absolutely new to D and those are my very first line of code with it. Your C code is

Small part of a program : d and c versions performances diff.

2014-07-09 Thread Larry via Digitalmars-d-learn
Hello, I extracted a part of my code written in c. it is deliberately useless here but I would understand the different technics to optimize such kind of code with gdc compiler. it currently runs under a microsecond. Constraint : the way the code is expressed cannot be changed much we need

Re: Error compiling test code

2014-05-23 Thread Larry Hemsley via Digitalmars-d-learn
Sometimes I am such a dunce. That is exactly what I did. Fixed now. Somehow I read import stdio.d as import std.stdio.d must have been a late night. On Tuesday, 20 May 2014 at 03:21:52 UTC, Rikki Cattermole wrote: On 20/05/2014 3:17 p.m., Larry Hemsley wrote: I just installed dmd on Mint

Error compiling test code

2014-05-19 Thread Larry Hemsley via Digitalmars-d-learn
I just installed dmd on Mint Linux distro using the Ubuntu dep package. Ran a simple test program test.d and recieved this error. test.d(1): Error: module stdio is in file 'stdio.d' which cannot be read import path[0] = /usr/include/dmd/phobos import path[1] = /usr/include/dmd/druntime/import Ch

Re: PyD status and tutorials

2013-08-31 Thread Larry
Ok python3-dev was missing. Now, it is a gdc problem: [code] def: hello wrap_struct: 'RangeWrapper' class.def: __iter__ class.def: next wrapped_struct_init, S is 'struct pyd.make_object.RangeWrapper' library_dirs: [] runtime_library_dirs: [] libraries: [] gdc -fPIC -nostartfiles -shared -fdebug

Re: PyD status and tutorials

2013-08-30 Thread Larry
Ah, forgot to say : I executed "python3.3 setup.py pydexe --compiler=gdc" Any other way won't work. tried hacking dcompiler.py in the python local packages, no luck. Libraries won't be taken into account. May I read something wrong..

Re: PyD status and tutorials

2013-08-30 Thread Larry
Hello, Not working here on a Debian sid : gdc -fproperty -c -fversion=Python_2_4_Or_Later -fversion=Python_2_5_Or_Later -fversion=Python_2_6_Or_Later -fversion=Python_2_7_Or_Later -fversion=Python_3_0_Or_Later -fversion=Python_3_1_Or_Later -fversion=Python_3_2_Or_Later -fversion=Python_3_3_O

Re: Sql -> Any tuto ?

2013-08-09 Thread Larry
:) You are perfectly right !

Re: Sql -> Any tuto ?

2013-08-09 Thread Larry
So many thanks ! Yes it is not very polished yet. But now I see how I can manage it, I will follow your lead and try things. :) Thanks again, Larry

Sql -> Any tuto ?

2013-08-08 Thread Larry
. Thanks, Larry

Re: Mysql - Sql things ?

2013-08-01 Thread Larry
On Wednesday, 31 July 2013 at 12:09:02 UTC, David wrote: https://github.com/rejectedsoftware/mysql-native Waw ! Many thanks, Completely missed it :) See you

Mysql - Sql things ?

2013-07-31 Thread Larry
Hello, I was searching the web for anything relating D to mysql but didn't find my way. Is it on the roadmap to add mysql support ? There is a c++ connector on debian, but no mention of a D connector.. Thanks, Larry

Re: Types of regex

2013-07-16 Thread Larry
AAAh !! Got it ! I will make the switch ! Thanks a lot :) Larry

Re: Types of regex

2013-07-15 Thread Larry
I have gdc 4.6 on Debian testing. Is that so old ?

Re: Types of regex

2013-07-15 Thread Larry
Humm, A copy-paste of your code lead to : "[[segmentation fault" So it doesn't work for me. I use gdc if it might help !

Types of regex

2013-07-15 Thread Larry
Hello, I read the library reference for regex. I really miss python's equivalent of finditer. Sometimes matching is not on purpose and one will want to match all the occurences to iterate over it since it is much more regarding concerning the orders and repetitions. my code : -

Documentation suggestion

2010-06-15 Thread Larry Luther
For those writing documentation, I would recommend: http://docs.eiffel.com/book/method/et-dynamic-structure-execution-model If I had had something like that for D it would have saved me a lot of guessing and grief. Larry

Re: template specialization

2010-06-10 Thread Larry Luther
Thanks everyone.

Re: template specialization

2010-06-08 Thread Larry Luther
Thanks guys. Simen asked: "Is there a problem?". Well, I kind of expected a "ubyte" buffer to be matched with a "get(T:ubyte)". I thought methods were searched for the "best" match. Larry

template specialization

2010-06-08 Thread Larry Luther
uot;get(T:ubyte)" then "get(T:byte)" would be called in both cases. Q: Is this the way it's supposed to be? Thanks, Larry

Re: Newbie: Inheritance & slicing problem

2010-06-02 Thread Larry Luther
"Steven Schveighoffer" wrote in message news:op.vddvhs17eav...@localhost.localdomain... | On Thu, 27 May 2010 17:04:35 -0400, Larry Luther | wrote: | | > "bearophile" wrote in message | > news:ht4krg$17l...@digitalmars.com... | > | On the base of your long ex

Re: Newbie: copy, assignment of class instances

2010-05-27 Thread Larry Luther
quot; can be used several ways: private member_function () {) private { member_function () {} } private: member_function () {} I'm anxiously waiting for something of the quality of the "Annotated C++ Reference Manual". Larry

Re: Newbie: copy, assignment of class instances

2010-05-27 Thread Larry Luther
"bearophile" wrote in message news:ht4g3r$vu...@digitalmars.com... | Larry Luther: | | > I did not get an error when building and running with DMD 2.042: | | I am using dmd v2.046, and I have taken the good habit of compiling with -w (warnings on). | It seems this error I see

Re: Newbie: copy, assignment of class instances

2010-05-27 Thread Larry Luther
lass instances don't need to copy their contents and instances of D structs do? While migrating C++ code to D I've had to convert "struct"s to "class"es because of the need for inheritance. Why would the need to copy an instance's contents to another instance disappear? Larry

Re: Newbie: copy, assignment of class instances

2010-05-27 Thread Larry Luther
Thank you, I had no idea that scope was doing this. I thought that when the docs said that it was being allocated on the stack that I was getting "struct" like behavior. "Simen kjaeraas" wrote in message news:op.vc0qlpjovxi...@biotronic-pc.home... | Larry Luther wrote:

Re: Newbie: copy, assignment of class instances

2010-05-20 Thread Larry Luther
Ok, Ok, I'm a newbie to D, not to programming. The first computer I got to program was a Digital PDP-8L. I'm learning D. I'm learning how to use SlickEdit as an IDE for D. I've never used it to compile, debug, and execute before. Therefore it will take a while before I can figure

Re: Newbie: copy, assignment of class instances

2010-05-20 Thread Larry Luther
I did not get an error when building and running with DMD 2.042: import std.stdio; class A { int x, y; void copy (in A a) { x = a.x; y = a.y; } void dump (string s) { writefln( "%s.A = { %s, %s }", s, x, y); } } class B : A { int z; void copy (in B b) { super.co

Re: Newbie: copy, assignment of class instances

2010-05-20 Thread Larry Luther
void copy (in B b) { super.copy( b); z = b.z; } } B foo = new B, B bar = new B; Q: Do I copy the member variables contributed by class A from "foo" to "bar", this way: "(cast(A) bar).copy( foo);"? Or maybe "bar.A.copy( foo);"? Larry

Newbie: copy, assignment of class instances

2010-05-20 Thread Larry Luther
ow do I do a deepcopy of foo to bar? In C++: bar = foo; Q3: Is the object "alpha" on the stack (per documentation)? Q4: What happens when I do "alpha = foo;"? "printf( "%p\n", alpha);" indicates that the address of "alpha" has changed. Thanks, Larry

Re: Operators overloading in D2

2010-05-17 Thread Larry Luther
Hi, Dan used the following method for his vector class: void opOpAssign (string op:"+=")(ref Vector3 other) {...} Why the "ref"? As I understand it, objects of class vector would already be passed as references. Larry

Re: newbie: Circular references across modules

2010-04-30 Thread Larry Luther
Thanks for your help.

Re: newbie: Access violation because of "class"

2010-04-30 Thread Larry Luther
Thanks for your help.

newbie: Circular references across modules

2010-04-29 Thread Larry Luther
This code describes the concept: module a; import B; struct A { B *ptr; } - module b; import A; struct B { A *ptr; } - Can this be done? Do both classes have to be in the same module?

newbie: Access violation because of "class"

2010-04-29 Thread Larry Luther
Why do I get an "object.Error: Access Violation" in the following code? If I change "class" to "struct" and remove "public:" I don't get an error. I'm using D2. import std.stdio; class Plane { public: int xres, yres; }; void main (string[] args) { Plane p; p.xres = 1920;