Size_t on x86 is uint,on x64 is ulong,it's a good thing?
I don't think is ok.
it creates many convert thing,such as length is ulong ,must
cast to int or cast to uint. It will be waste of time ,I think.
On Thursday, 17 April 2014 at 16:46:15 UTC, John Colvin wrote:
On Thursday, 17 April 2014 at 16:36:29 UTC, FrankLike wrote:
Size_t on x86 is uint,on x64 is ulong,it's a good thing?
I don't think is ok.
it creates many convert thing,such as length is ulong ,must
cast to int or cast to
It's the same in C and it reflects what the hardware is doing
underneath with regard to memory addresses. That's the point of
size_t. If it didn't change size then we'd all just use ulong
or uint for all our array lengths etc.
In c#,add the new attribute 'longlength' on the new version,keep
Hi,everyone,
Array's Length keeps the same value on x86 and on x64 ,it will be
help for compile the same codes.
Now,I compile the codes that works on x86 is ok,but on x64
,array's length's value type is ulong,the codes are very
more,modify them that is a big work.
I think
You've already asked this question:
http://forum.dlang.org/thread/uxovgaptnpmuusmdp...@forum.dlang.org
You've already been told its by design.
Thank you.
Hi,everyone,
Here has a error after run: main.exe 11 or main.exe 10 :
module main;
import std.stdio,std.conv;
template find(T)
{
size_t find(T[] Array,T Element)
{
size_t i;
foreach(T ArrayElement; Array)
{
Thank you,everyone.
I should use the 'int'.
I use the 'size_t',that lets the range changed by the
platform(X86 or X64),but forgot 'size_t' is another 'uint'.
Thank you everyone again.
Frank.
Hi,erveryone,
type Tuple!(int,int,int,string) can write[],but can't read[];
module main;
import std.stdio,std.typecons,std.conv;
void main(string[] argv)
{
alias Tuple!(int,int,string) tuple2;
alias Tuple!(int,int,string)[10] tupleS2;
void bbx(tupleS2 x)
{
On Tuesday, 29 April 2014 at 09:38:45 UTC, Andrea Fontana wrote:
On Tuesday, 29 April 2014 at 09:23:03 UTC, FrankLike wrote:
Hi,erveryone,
[...]
xy2[1][0]=100; // can write
[...]
writeln(xy2[0][i]); // can't read
[...]
If I'm right, index should be a compile-time value.
On Tuesday, 29 April 2014 at 09:53:29 UTC, John Colvin wrote:
foreach(i; TypeTuple!(0,1,2))
{
writeln(xy2[0][i]);
}
}
Thank you,John Colvin,
It works very good.
Frank.
I'm intersting for DQt is better than QML.
I think Get experience from QML to create a D binding to Qt,
that is better than binding to QML. the Go's The programming
thinking is not same to the C++,and D.
DQt is Working hard more, but has significant effect for D.
DQt is very clear.
http://forum.dlang.org/thread/wdddgiowaidcojbrk...@forum.dlang.org
Worth a reddit announcement tomorrow morning? -- Andrei
TkD is nice,but the exe's Memory usage is 6.8~7M,but DFL's only
2.8~3M,and only a single file on windows 7.
https://github.com/Rayerd/dfl,
I compare DFL with tkD and dlangui,find:
DFL can gets the smallest exe file and Minimal memory footprint.
Although it only works on windows,but it full wrote by D. and its
syntax is very similar to c#,that can help a lots of c# lovers
turn to D,this will help D to develop.
What's the status
Sweet, as I see it works and there's plenty of documentation
about swt.
Not much can beat a 2.6MB standalone application with a 2mb
footprint!
I test on windows 7,it's size is 2829k,with a 2836k footprint.
But DFL's is 778k with a 2724k.
example:github.com/SeijiFujita/dfl-examples-d2
https://github.com/SeijiFujita/dfl-examples-d2
I'm not sure if dfl would have layouts? Can you make the
elements stretch along with the window resize action without
writing custom algorithms?
DFL is so good,someone will do it.
Frank
On Thursday, 8 May 2014 at 05:17:09 UTC,
Johhttps://github.com/FrankLikeps://github.com/FrankLike/dflrote:
On Thursday, 8 May 2014 at 03:06:48 UTC, FrankLike wrote:
https://github.com/SeijiFujita/dfl-examples-d2
Do you have any screenshots? Thanks.
get the DFL by
On Thursday, 8 May 2014 at 16:16:22 UTC, Joakim wrote:
Well, Android/x86 for now. I've been plugging away at getting
D running on Android/x86 and got all of the druntime modules'
unit tests and 37 of 50 phobos modules' unit tests to pass. I
had to hack dmd into producing something like packed
http://www.reddit.com/r/programming/comments/251s5i/tkd_cross_platform_gui_toolkit_for_d_based_on/
https://twitter.com/D_Programming/status/464434846849179648
https://www.facebook.com/dlang.org/posts/843295265684156
https://hn.algolia.com/#!/story/forever/0/Tkd
Andrei
Hello,
TKD is very
http://www.reddit.com/r/programming/comments/251s5i/tkd_cross_platform_gui_toolkit_for_d_based_on/
https://twitter.com/D_Programming/status/464434846849179648
https://www.facebook.com/dlang.org/posts/843295265684156
https://hn.algolia.com/#!/story/forever/0/Tkd
Andrei
Hello,
TKD is very
On Saturday, 10 May 2014 at 09:32:30 UTC, Jacob Carlborg wrote:
Cross-posting to get noticed:
http://forum.dlang.org/thread/lkkrij$1r3j$1...@digitalmars.com#post-lkkrij:241r3j:241:40digitalmars.com
Good things.
Existing GC code: 15700ms (average)
My GC code: 500ms (Average)
Congratulations!
Can you share you good work for us? or exe? dll?
Thank you.
Frank
On Wednesday, 14 May 2014 at 08:11:37 UTC, Martin Nowak wrote:
On Wednesday, 14 May 2014 at 07:36:57 UTC, Joseph Rushton
Wakeling wrote:
On Wednesday, 14 May 2014 at 07:04:24 UTC, w0rp wrote:
I'm unsure about the learn x in y minutes tutorials, but I
did however think this was very neat.
1.DFL's Memory Usage is the least than other. winsamp.exe is
2.1M,DFL's example's exe is 2.7M.
2.The size of DFL's example's exe files is the least than other,
and only a single file.
3.DFL's source code is the most easy to understand.
D need Christopher E. Miller.
On Thursday, 15 May 2014 at 04:53:01 UTC, dennis luehring wrote:
Am 15.05.2014 05:58, schrieb FrankLike:
1.DFL's Memory Usage is the least than other. winsamp.exe is
2.1M,DFL's example's exe is 2.7M.
2.The size of DFL's example's exe files is the least than
other,
and only a single file.
Hi,everyone,
Many Chinese coders found under Chinese characters were not
display correctly under CodePage 936,but if use the Function
CharToOemW,it's ok.
import std.c.stdio;
import std.c.windows.windows;
import std.stdio;
extern (Windows) {
export BOOL CharToOemW(
LPCWSTR
On Saturday, 17 May 2014 at 03:30:14 UTC, sdvcn wrote:
On Saturday, 17 May 2014 at 03:17:46 UTC, FrankLike wrote:
Hi,everyone,
Many Chinese coders found under Chinese characters were not
display correctly under CodePage 936,but if use the Function
CharToOemW,it's ok.
import std.c.stdio;
I mean not use conv by us,writeln(”中文”),then ok.
Thank you.
import core.stdc.string;
char[] s2 = (toMBSz(s1)[0 .. strlen(toMBSz(s1))]).dup;
writeln(s2);
I mean only writeln(s1),transform inside.
Thank you.
'writeln' should support unicode,then a lot of characters can
work,the D will get a lot of epigones!
Thank you.
DFL isn't boost licensed, that's the problem for me. And
Christopher didn't answered anything on my proposal to change
the license.
I'd suggest to put the effort in DGui [1] instead because its
author, Antonio Davide Trogu, kindly changed the license to
Boost as he want the library to be
On Sunday, 18 May 2014 at 09:22:53 UTC, FrankLike wrote:
DFL isn't boost licensed, that's the problem for me. And
Christopher didn't answered anything on my proposal to change
the license.
I'd suggest to put the effort in DGui [1] instead because its
author, Antonio Davide Trogu, kindly
I'd suggest to put the effort in DGui [1] instead because its
author, Antonio Davide Trogu, kindly changed the license to
Boost as he want the library to be used.
By the way, see DGui examples at Downloads page [2], they are
smaller, than DFL ones. Also one of DGui goals was a source
code
*http://denis-sh.bitbucket.org/
Where is the DGui?
This dgui is very cool.
1.DFL's Memory Usage is the least than other. winsamp.exe is
2.1M,DFL's example's exe is 2.7M.
DGui's Memory Usage is 3.2M.
[1] https://bitbucket.org/dgui/dgui
[2] https://bitbucket.org/dgui/dgui/downloads
You will put it in code.dlang.org and github.com?
DGui is very cool,the exe's size
On Sunday, 18 May 2014 at 14:54:44 UTC, FrankLike wrote:
1.DFL's Memory Usage is the least than other. winsamp.exe is
2.1M,DFL's example's exe is 2.7M.
DGui's Memory Usage is 3.2M.
[1] https://bitbucket.org/dgui/dgui
[2] https://bitbucket.org/dgui/dgui/downloads
You will put it in
Hi,DFL is cool,why not continue the DFL?
Windows 7 x64 here.
Thank you.
Now,D is very cool for System Programming,but it's not cool for
Database Programming. It needs some controls such as
Calendar,DataTimePicker, DataGrid,DataView etc. DataGrid can
display a lot of data ,such as Chinese chars ,and filter
them,DataGrid's 'Data Source' maybe the DataView,DataView is
them.Now,only
DWT can work,but it's not easy to use.So D need some cool
I have used it,Now,only DWT can work!
There are at least 10 GUI toolkits for D, some are more
I have tested them all.only DWT can work!
I suggest you take a look at DWT, it has all you need and more.
Have you tested
I suggest you take a look at DWT, it has all you need and more.
Can you recommend a good IDE For DWT?
Thank you! If it's ok,I will use the DWT to work.
Thank you.
There's no GUI builder for DWT, if that's what you're looking
for. But there is a plugin for Eclipse called WindowBuilder
[1]. That will output Java code for SWT (which DWT is a port
of).
[1] http://www.eclipse.org/windowbuilder/
Will add it to VisualD? If do it,very cool.
Thank you.
There's no GUI builder for DWT, if that's what you're looking
Several years ago,there was a simple IDE ,that named 'Entice',it
could do for DFL and DWT.Will you want to continue it?
Thank you.
If somebody was to design (fully) how a set of controls for D
would look and act like I may have a go at building an OpenGL
based GUI toolkit. It was part of why I gave up on DOOGLE.
OpenGL? A good idea.But will have a large Memory Usage.
I don't know. As far as I can remember that only worked on
Windows. I do have long term plans to create a GUI builder for
DWT, sometime in the future.
Hope the DWT is easy to use as DFL ,DGui.
Thank you.
Apple's swift comes on,but only use on iOS,so D should develop
the LDC,let D keep the superiority.
Frank
And if one speak about compilation time... Yes dmd compiles
faster than ldc but the difference is not so great. And who
cares about compilation time when one write the code ?
LDC's performance is very cool.
I don't know. As far as I can remember that only worked on
Windows. I do have long term plans to create a GUI builder for
DWT, sometime in the future.
How to use the dwt on eclipse? search a plug-in 'dwt' ?
Thank you.
I usually use dmd for development and ldc for delivery (on
Linux).
It's a good job.
Developers develop dmd so ldc stays alone.
No,LDC is not easy to use as dmd,it must configure by Developers
,if it has the oneClickSetup,then many Developers like it.
[(1, 2, 3), (4, 5, 6), (7, 8, 9)]
Good idea.
And shoud easy to be used by foreach.
Frank
Many persons like go's goroutine,but how about is the same thing
in D?
Thank you everyone.
Hello,everyone,
I've writed some projects in C#,find the 'partial' key word is
very userful,which lets the auto codes in another single file,my
codes are very easy to update.
But what the same thing in D?
Thank you,every one.
Hello,everyone,
I've written some projects in C#,find the 'partial' keyword is
very userful,which lets the auto codes in another single file,my
codes are very easy to update.
But what the same thing in D?
Thank you,every one.
On Wednesday, 29 October 2014 at 10:25:54 UTC, Regan Heath wrote:
On Wed, 29 Oct 2014 07:54:39 -, Paulo Pinto
pj...@progtools.org wrote:
On Wednesday, 29 October 2014 at 07:41:41 UTC, FrankLike wrote:
Hello,everyone,
I've written some projects in C#,find the 'partial' keyword
is very
Partial classes are used in C# wherever you need to combine
auto-generated code and user code into a single class. So,
the Windows GUI builder does it placing all the GUI component
construction and property setting in one file, and allowing
the user to only have to see/edit the application
No human uses partial classes in .NET land other than the tools
themselves.
It is a language feature introduced to simplify how Visual
Studio supports round-trip editing of UI code in its designers,
instead of relying in metadata files.
--
Paulo
Very good,It makes your code look very
Entice.
On Thursday, 30 October 2014 at 07:20:24 UTC, Jacob Carlborg
wrote:
On 2014-10-30 00:00, deadalnix wrote:
What does it do ?
It lets you split the implementation of a class between
multiple source files. I think it's mostly used in C# for tools
that generate some codes, i.e. a GUI builder.
X86 COFF format static libraries is very important for d,such as
the x86 server, x86 small devices, and how to use them?
Most of x86 COFF format static libraries are built by c.
dmd -ms32coff ?
On Monday, 10 November 2014 at 10:21:34 UTC, Regan Heath wrote:
Sure, but that's not the point of partial. It's almost never
used by the programmer directly, and when it is used you almost
never need to look at the generated partial class code as it
just works. So, you effectively get what
It's -m32mscoff, but yeah, that's all you need to use with
dmd.
You'll also need to recompile druntime and phobos, which I
believe can be done for both with the following command:
make -fwin64.mak MODEL=32mscoff
win64.mak has the configuration to pull in MSVC and you need to
specify the
make -fwin64.mak MODEL=32mscoff
win64.mak has the configuration to pull in MSVC and you need to
specify the model so that it compiles for 32-bit. Of course,
this is only available in git HEAD, not in the stable release
yet. You can find info about building from source on Windows
here:
dmc can build some *.c,and can build some obj which from *.d,but
the d's obj there is some error : FIXLIB? What is it? How to do?
Thank you.
I suspect you are compiling the druntime/phobos library with
the 64-bit VC compiler. Make sure cl.exe is the compiler
targeting 32-bit when running make -fwin64.mak
MODEL=m32mscoff.
I've done it as you said:compiling the druntime/phobos library
with the 64-bit VC compiler.and cl.exe is the
You have to compile druntime and phobos with the x86 compiler
aswell. Otherwise the C files in the library are built for the
wrong architecture.
So you should be fine if you use x86 intead of amd64 in the
line above.
Sorry,get the same error.
Maybe you forgot to clean up the object files from the
win64/win32-dmc build?
This is extracted from my build batch:
set dm_make=c:\l\dmc\bin\make
set DMD=../windows/bin/dmd.exe
set cl32=%VCINSTALLDIR%/bin/cl.exe
set ar32=%VCINSTALLDIR%/bin/lib.exe
cd druntime
del /q errno_c.obj complex.obj
Many old projects need move from x86 to x64,but the 'length' type
is size_t,it will change on x64,so a lot of work must to do.but I
find some info which is help for d:
http://www.dotnetperls.com/array-length.
it means:
test length and longlength, and found 'test longlength' is
slower than
It means where you have uint x = arr.length you should have had
size_t x = arr.length from the very beginning.
I test it :
module aatest;
import std.stdio;
import std.datetime;
import std.conv;
size_t[string] aa;
void ada()
{
for(size_t i=0;i100;i++)
{
I test it:
module aasize_t;
import std.stdio;
import std.datetime;
import std.conv;
import std.string;
size_t[string] aa;
void gettime()
{
for(size_t i=0;i300;i++)
{
aa[to!string(i)] = i;
}
}
void main()
{ writeln(size_t.max,size_t.max);
Don't profile with out optimzation.
Add -O -inline -release -boundscheck=off to your dmd
arguments.
I mean projects moved from x86 to x64, 'cast(int)length ' is
better than 'size_t i=(something).length '.
I mean projects moved from x86 to x64, 'cast(int)length ' is
better than 'size_t i=(something).length '.
I think the reason for the existence of size_t, is that the C
designers thought that the second way is better than the first
way.
But now 'int' is enough, not huge and not small.
if
If you migrate your projct from x86 to x64,you will find the
length is error,you must modify it ,such as:
int i= (something).length
to
size_t i = (something).length
but now ,'int' is enough for use,not huge and not small,only
enough.
'int' is easy to write,and most people are used to it.
drop your C.
auto len = smth.length;
works ok for both x86 and x86_64 (don't know what x64 is).
Many excellent projects such as dfl,dgui,tango, many 'length'
which type is 'int' or 'uint',they are D's,many people like
it.but they should migrate to 64 bit.So if 'length' type is
'int',they
Many excellent projects such as dfl,dgui,tango, many 'length'
which type is 'int' or 'uint',they are D's,many people like
it.but they should migrate to 64 bit.So if 'length' type is
'int',they can work on 64 bit,but now,they must be modify for
'length''s type.
broken code must be fixed by the
but now ,'int' is enough for use,not huge and not small,only
enough.
'int' is easy to write,and most people are used to it.
Most importantly easier to migrate code,if 'length''s return
value type is 'int'.
How about your idea?
If I have two pencils of length 10 cm and 15 cm, then the first
one is -5 cm longer than the other.
Of course any physical pencil is always of positive length, but
that doesn't mean that typeof(pencil.length) can never be
negative.
Right.
'int' is easy to use,is enough,and easy to migrate
How is that a bug? Can you provide some code that exhibits this?
If you compile the dfl Library to 64 bit,you will find error:
core.sys.windows.windows.WaitForMultipleObjects(uint
nCount,void** lpHandles,) is not callable using argument
types(ulong,void**,...)
the 'WaitForMultipleObjects'
That I partially, fractionally even, agree with. We agonized
for a long time about what to do to improve on the state of the
art back in 2007 - literally months I recall. Part of the
conclusion was that reverting to int for object lengths would
be a net negative.
Andrei
All of these
auto x = foo();
auto y = bar();
auto z = baz();
if (x - y z) { ... }
This might be a bug, if one of these functions returns an
unsigned
type. Good luck finding that. Note that if all functions
return
unsigned, there isn't even any signed-unsigned mismatch.
I believe the correct
What about:
uint x;
auto z = x - 1;
?
When mixing signed and unsigned, as signed, it maybe no mistaken.
thhere is a small test,add 'cast(long)' before - operator,if it's
auto add,maybe fine.
-
import std.stdio;
void main()
{
size_t width = 10;
size_t height
On Friday, 21 November 2014 at 09:43:04 UTC, Kagamin wrote:
On Thursday, 20 November 2014 at 16:34:12 UTC, flamencofantasy
C# doesn't encourage usage of unsigned types and warns that
they are not CLS-compliant. You're going against established
practices there. And signed types for numbers
Druntime's checkint.d should be modify:
uint subu(uint x, uint y, ref bool overflow)
{
if (x y)
return y - x;
else
return x - y;
}
uint subu(ulong x, ulong y, ref bool overflow)
{
if (x y)
return y - x;
else
return x - y;
}
Frank
D already has them:
https://github.com/D-Programming-Language/druntime/blob/master/src/core/checkedint.d
Druntime's checkint.d should be modify:
uint subu(uint x, uint y, ref bool overflow)
{
if (x y)
return y - x;
else
return x - y;
}
ulong subu(ulong x, ulong y,
On Friday, 21 November 2014 at 13:59:08 UTC, ketmar via
Digitalmars-d wrote:
any code which does something like `if (a-b 0)` is broken. it
Modify it:
https://github.com/D-Programming-Language/druntime/blob/master/src/core/checkedint.d
Modify method: subu(uint ...) or subu(ulong ...)
On Friday, 21 November 2014 at 15:13:22 UTC, ketmar via
Digitalmars-d wrote:
and it will not do the same anymore too. it's not a fix at all.
But it is a part of bugs.
Sure,bug which is in mixing sign and unsign values should
be fix.
On Saturday, 22 November 2014 at 01:57:05 UTC, Andrei
Alexandrescu wrote:
On 11/21/14 1:55 PM, Marco Leise wrote:
Am Wed, 19 Nov 2014 18:20:24 +
schrieb Marc Schütz schue...@gmx.net:
I'd say length being unsigned is fine. The real mistake is
that
the difference between two unsigned
On Friday, 21 November 2014 at 21:22:55 UTC, Marco Leise wrote:
Inside opIndex, the unsigned types simplify the range checks
(by the compiler or explicit) by removing the need to test for
0.
At the end of the day I find myself using unsigned types much
more frequently than signed types because
On Monday, 24 November 2014 at 19:06:35 UTC, Matthias Bentrup
wrote:
Agreed, though I don't like the explosion of new operators. I'd
prefer the C# syntax like check(expression), wrap(expression),
saturate(expression).
You maybe like this:
---small test
Dgui is very good,but what status is about now?
Now,I use the win32.winioctl.d file,find
:IOCTL_STORAGE_EJECT_MEDIA ' Value is 0x0202,if you use it ,will
get the error value 50.(by GetLastError()).
It should be 0x2d4808.If you use it ,it works ok.
Why have this kind of mistake?
Frank
On Monday, 29 December 2014 at 12:19:34 UTC, dennis luehring
wrote:
Am 29.12.2014 um 13:00 schrieb FrankLike:
Now,I use the win32.winioctl.d file,find
:IOCTL_STORAGE_EJECT_MEDIA ' Value is 0x0202,if you use it
,will
get the error value 50.(by GetLastError()).
It should be 0x2d4808.If you use
On Friday, 26 December 2014 at 22:01:30 UTC, user wrote:
don't use crap - use
http://forum.dlang.org/thread/ovgoajvboltrtciqf...@forum.dlang.org
it is great. works for 64bit!!
Thank you,if you have any question,I will help for you.
Frank
On Monday, 29 December 2014 at 12:19:34 UTC, dennis luehring
wrote:
Am 29.12.2014 um 13:00 schrieb FrankLike:
Now,I use the win32.winioctl.d file,find
:IOCTL_STORAGE_EJECT_MEDIA ' Value is 0x0202,if you use it
,will
get the error value 50.(by GetLastError()).
It should be 0x2d4808.If you use
On Wednesday, 31 December 2014 at 14:20:28 UTC, Manu via
Digitalmars-d wrote:
Here's to an awesome 2015!
Nice D!
Now operate array is not very quick,such as contains
function,remove item function
can't get from arry module.
template contains(T)
{
bool contains(T[] Array,T Element)
{
foreach(T ArrayElement; Array)
{
On Thursday, 5 February 2015 at 14:47:40 UTC, Daniel Murphy wrote:
Contains: array.canFind(element)
Oh, canFind is better than Contains.
Thank you.
On Thursday, 5 February 2015 at 14:47:40 UTC, Daniel Murphy wrote:
But do you have some better way for remove item ?
such as c#: array.remove(item) ,array.removeAt(index)?
Thank you.
On Thursday, 5 February 2015 at 15:21:56 UTC, BBaz wrote:
On Thursday, 5 February 2015 at 14:09:06 UTC, FrankLike wrote:
Now operate array is not very quick,such as contains
function,remove item function
can't get from arry module.
template contains(T)
{
bool contains(T[] Array,T
On Wednesday, 14 January 2015 at 17:19:42 UTC, Ola Fosheim
Grøstad wrote:
On Wednesday, 14 January 2015 at 16:44:35 UTC, FrankLike wrote:
Not a good idea.
What is not a good idea? The default collation differs based on
the OS settings AFAIK. In western countries it probably is
ISO8859-1
On Thursday, 15 January 2015 at 15:38:05 UTC, Adam D. Ruppe wrote:
mssql.d - drivers for database.d (wrapping C libraries)
minigui.d - small, dependency-free (except for simpledisplay.d
and color.d but doesn't even need Phobos) widget set, using
Win32 native widgets where possible, custom
1 - 100 of 346 matches
Mail list logo