Just save yourself lots of headaches and abandon the optlink/omf
crap with -m64 resp. -m32mscoff.
the long-term solution is to include the [win32] headers in
druntime
™
On Wednesday, 8 October 2014 at 18:56:31 UTC, Etienne wrote:
I can't seem to find this function anywhere: __simd(void16*,
void16)
MOVDQU => void _mm_storeu_si128 ( __m128i *p, __m128i a)
MOVDQU => __m128i _mm_loadu_si128 ( __m128i *p)
Is there a module by now that allows to directly write In
On Saturday, 6 September 2014 at 21:54:00 UTC, David Nadlinger
wrote:
On Saturday, 6 September 2014 at 17:51:16 UTC, Trass3r wrote:
SEH was patented, so llvm doesn't support it.
That has changed.
Has it? SEH on Win64 is something entirely different from the
original (x86) SEH design
SEH was patented, so llvm doesn't support it.
That has changed.
Yeah that's the price we pay for the simplicity.
Also most constraints directly or indirectly consist of a complex
boolean expressions and you don't get any hint which part failed
and why.
http://forum.dlang.org/thread/pxotrowaqcenrpnnw...@forum.dlang.org
The only question I have is what happens when you use
SUBSYSTEM:WINDOWS:4.0 (Which I understand means XP or higher)
and the program runs on something older?
I think it should be possible to run DustMite on some big project
like phobos to actually search for such internal errors.
... the order of files matters? Yuck.
Yep it's a bug.
dmd: glue.c:542: virtual void FuncDeclaration::toObjFile(int): Assertion
`semanticRun == PASSsemantic3done' failed.
Aborted
wouter@carillon:~/code/d/DustMite$
... and I'm not yet that fluent in D to understand what's going on. Any
ideas?
pass dustmite.d before dsplit.d
known problem, but the
A notice for some unused imports would be great too...
You could create a brute-force tool.
Rip off an import statement at a time and see if it still compiles.
One could probably modify DustMite to do that.
If you want to convert a range to an array, use std.array.array
This is a constant source of confusion and it also is a crappy design to
use a function in a totally different module for this purpose imho.
Can't these Result types get an eval() method and/or be made implicitly
convertible to
Cause align doesn't work the way you think it does.
In fact I still don't understand how it works at all.
The language align keyword can only reduce the alignment from the
platform default (typically 8). A serious flaw if you ask me . . . .
The doc page doesn't even clearly state this, it i
I think it has been fixed for the next version of DMD already. Any idea
why align isn't letting me use movdqa?
Cause align doesn't work the way you think it does.
In fact I still don't understand how it works at all.
import std.stdio, core.simd;
void main()
{ int4 v;
}
Internal error: ..\ztc\cgcod.c 1447
Building Debug\dtest1.exe failed!
Works fine on Linux.
Maybe the 32Bit check doesn't work for Windoze?
-m32 on Linux yields Error: SIMD vector types not supported on this
platform
test code please
I found out that OpenFileMapping is not needed and CreateFileMapping is
sufficient. I managed to code this with std.c.windows only however
MmFile is not working even with simplest examlple maybe a bug under win
7?
Possible. Feel free to file a bug report or create a pull request.
Though I was under the impression that the new Derelict2 hierarchy / d
interface files in Derelict2/import reduced the neccesity for command
line arguments, that is a Derelict related question.
You may try to use --chatty and compare the output.
bool compareByMemb(string[] ignores, T)(T obj1, T obj2) {
foreach (name; __traits(getAllMembers, T)) {
...
}
In this particular case you could try
foo(T, U...)(T obj1, T obj2, U ignores)
Am 15.04.2012, 21:20 Uhr, schrieb sclytrack :
this( const size_t step) const
{
this.step = step;
}
Error: cannot modify const/immutable/inout expression this.step
Is this the expected behavior? Thanks.
Yep.
this works on every dll I try to inject apart from dll's written in D
(starting with dmd version 2,054 or something like that).
If this is a regression, please narrow it down to the exact version.
I inject it but it returns nothing and the App(where the dll is
injected) is hanging( not responding).
Could you try it maybe?
I would like to know whether it's a Problem with D or with me.
Are dlls without injection working?
Maybe it's because I have no def file.
Very possible.
Just pass it to dmd like the other files.
Or try the new -shared flag.
The flags you want are -O, -inline -release.
If you don't have those, then that might explain some of the slow down
on slicing, since -release drops a ton of runtime checks.
-noboundscheck option can also speed up things.
I guess Tango provides something like that via the VFS stuff.
https://github.com/SiegeLord/Tango-D2 resp.
https://github.com/mtachrono/tango
What is the status at the moment? What compiler and with which compiler
flags I should use to achieve maximum performance?
In general gdc or ldc. Not sure how good vectorization is though, esp.
auto-vectorization.
On the other hand the so called vector operations like a[] = b[] + c[];
are l
There's a pull request to help with debugging string mixins:
https://github.com/D-Programming-Language/dmd/pull/426
Am 06.03.2012, 20:13 Uhr, schrieb maarten van damme
:
I wouldn't say that it sucks. It has really helped a lot in
porting some simple header files. It goes terribly bad on the more
complex though.
Sadly, using regular expressions is much more efficient.
At least those don't destroy the so
Why is 'const' removed?
cause htod sucks.
D1 didn't have const and htod wasn't updated for ages.
OK, so what's the right way to do it then? I have some changes in a
branch, but master has been updated since, so I want to merge in the
latest updates so that the branch changes are compatible with the latest
code.
I use a quite crappy way to rebase my feature branch:
git stash && git checkout
A blocker for using x64 on linux then.
Use gdc. Better codegen anyway.
http://d.puremagic.com/issues/show_bug.cgi?id=5570
You may try -L--gc-sections (in case of gdc in combination with
-ffunction-sections -fdata-sections) and -L-s
void foo(T, T2, alias thing = (){})(T a, T2 b)
{
thing();
}
void bar(){}
void main()
{
foo!(int,int,bar)(1,2);
foo(1,2);
}
Lots of symbols and stuff.
You can get it down with -ffunction-sections -fdata-sections
-Wl,-s,--gc-sections
Phobos should also be compiled with -ffunction-sections -fdata-sections to
get the whole effect though.
scope auto e1 = new EntryInt();
Foo = e1.toFoo();
You don't need auto there.
And scope is deprecated, use std.typecons' scoped
I guess GDC uses COFF? That would definitely be handy... although I
couldn't compile and debug from VS anymore in that case, and that would
be unfortunate^^"
Just recently Rainer added gdc support to cv2pdb.
Can I use OpenGL or DirectX with D?
Of course.
E.g. there's a D1 game engine: http://yage3d.net
I think http://3d.benjamin-thaut.de/?p=16 is D2, but it's rendering code
only.
LuaD works fine, but I'd rather learn to compile stuff like this myself.
It will get me further in the long run^^
Try to switch to gdc.
dmc, optlink & Co. must die a bloody death anyway :)
dmd simply doesn't keep those information about aliases.
So why not just use classes? I've understood it as there may be a
performance gain by using structs over classes, and in my program Point
and Coordinate are used heavily.
The other big difference is value vs. reference type.
You can use alias this to achieve something like "struct inheritance
Thanks a lot, So I just need to "detect" user locale using How to do
that?
You can always use the functions you would use in C.
The main question is how do I either compile the library with the right
version suffix (@12)
Or get the linker to use the right version suffix (@8)
That's no version suffix. It's the number of bytes of the arguments IIRC.
Windows calling convention.
I deduce so that there is no "official" support for that. If it's, it's
a pain.
Pain? Writing such a system can be done in a couple of lines.
I am using DMD 2.057 on Ubuntu 64bit. Are you sure that it does not
work? Can anyone reproduce the error?
import std.variant;
struct Foo {
Variant a;
ref Variant refA(){
return a;
}
}
void main(){
Foo f1;
f1.refA() = 24;
}
Compiles fine on Ubuntu x64 with git
*whispers gee dee c*
windows binaries please...
Seek and you shall find.
https://bitbucket.org/goshawk/gdc/downloads
I was reading the C++ Object Model book recently (well, I'm still
reading) and was amazed at how many edge-cases there are in C++, and
how lucky I am to be using D. Well, minus the Optlink that is. :)
*whispers gee dee c*
I want to write a regex to check if a whole string is a number.
With my current regex("[0-9]+") numbers will be carved out of things like
"aaa456" (hit: 456) and I circumvent this by checking the lengths for
inequality, which is stupid. My regex is surely missing something?
Try ^ and $ if applic
However, I cannot, by default, scope my custom allocations.
Any ideas?
std.typecons.scoped
What is the idiom for handling
a case where multiple exceptions of different types may be thrown?
I think you could catch a common baseclass like Exception and test if it's
a specific Exception by casting.
I looked up ldc recently, and it seems that it hasn't been updated for
years. Seems that gdc is the only other D compiler that's still actively
maintained.
Please don't spread such misinformation.
https://github.com/ldc-developers/ldc/commits/master
Building gcc in general is a pain. It's just a little less painful on
*nix systems, but still painful.
I can't agree.
The build instructions contain everything. Has been straightforward for me
right from the beginning.
There is also gdmd : dmd front end that use gdc
It's nothing but a perl script that translates dmd command line
options into gdc ones.
On Thursday, 26 January 2012 at 11:46:19 UTC, sami wrote:
my question is if there thing i can do with dmd only and visa
versa?
what the feature of one of them over the other?
what the different between them in term of inline assembly,
performance, platform and bugs?
They share the frontend, i
I was pretty sure it's somewhere in the spec.
void main(){
for ({int x=0; short y=0;} x < 10; x++, y++){
}
}
wtf?
for (int x = 0, int y = 0; .)
for (int x=0, y=0; ...)
StringHash sh = "SomeString"; // ok
That's the only thing that works.
An @implicit tag for constructors to allow all implicit conversions would
really be helpful.
In general we need finer control of implicit conversions.
Just have a look at ProxyOf:
https://github.com/D-Programming-Languag
What's the definition of Display?
Sorry, didn't read the rest. ^^
MapTile[] map; // It's a struct
ref MapTile tile=map[y*w+x];
tile.id=something;
tile.isWall=true;
MapTile* tile = &map[y*w+x];
Basically it was deprecated because it's poorly defined and implemented.
There are several types of typedefs that need to be available: parallel,
opaque, supertype and subtype.
See http://d.puremagic.com/issues/show_bug.cgi?id=5467
is there a template or something in phobos to get the same typesafe
behaviour of good old typedef ?
I've brought this up several times.
People just don't give a shit.
http://d.puremagic.com/issues/show_bug.cgi?id=5467
5. Align attribute.
http://dlang.org/attribute.html#align
struct S {
align(4) byte a; // placed at offset 0
align(4) byte b; // placed at offset 1
}
Explain this please.
align is a huge mess imo.
"It matches the corresponding C compiler behavior"
So what's the point of align in the firs
I'd really like to have 'if (instance is ClassType)' syntax in D.
Can't really answer your original question, but
1. Why don't you use opApply?
2. Why do you use ref int even in the const version?
3. You could also use alias this to allow iteration, don't know if that's
what you want in general though.
Am 19.12.2011, 23:13 Uhr, schrieb Martin Drašar :
Dne 19.12.2011 23:09, Trass3r napsal(a):
It actualy returns a procedure address and the procedure is called. It
lands inside export extern (C) int magicNumber() and crashes when
attempting to allocate memory for Something.
Did you properly
It actualy returns a procedure address and the procedure is called. It
lands inside export extern (C) int magicNumber() and crashes when
attempting to allocate memory for Something.
Did you properly initialize druntime?
Am 19.12.2011, 13:04 Uhr, schrieb Bear :
Using D1, I have a program that creates tons of float[] ; for performance
reasons, I would like them to be uninitialized.
std.array.uninitializedArray
Am 16.12.2011, 19:45 Uhr, schrieb dune :
I didn't realize that stuff like this will not work as expected:
[code]
/***
* Brief summary of what
* myfunc does, forming the summary section.
*
* First paragraph of synopsis description.
*
* Second paragraph of
*
Page generated by href="http://www.digitalmars.com/d/2.0/ddoc.html";>Ddoc.
Ah looks like that must be updated to dlang.org too
What I posted was an example, in reality there is tons of code inside
the d file.
Show the file, or part of it.
Am 16.12.2011, 17:47 Uhr, schrieb dune :
Never tried this before:
Tried (with D2.057) to use the embedded documentation option with:
/**
* documentation here
*/
and the html files are generated but they only contain a html skeleton
and no documentation.
This comment doesn't refer to any
I think something like this is implemented in a dmd pull request.
http://lists.puremagic.com/pipermail/digitalmars-d/2011-March/098950.html
The type has to be deduced anyway for type checking the
assignment/initialization.
Makes sense. Overseen that.
Well the runtime performance is equal but of course compilation takes
slightly longer since it has to deduce the type first.
Just curious: I would be surprised if there was actually a measurable
difference between the two – did you ever try to measure it?
Actually not. Would be interesting,
is there any performance gap using auto instead of int or other
type? For example
int[] ar1 = new int[1000];
auto[] ar2 = new int[1000];
are these equivalent by a perfomance point of view?
Well the runtime performance is equal but of course compilation takes
slightly longer since it has to d
Please check if your case is equal to
http://d.puremagic.com/issues/show_bug.cgi?id=4414
Don't think so.
You could also wrap it in a struct with disabled opAssign, but this would
also change the type.
test.d(16): Error: cannot implicitly convert expression ([1,2,3]) of
type int[] to immutable(Typedef!(int[]))
OT: this shows another possible problem.
See http://clang.llvm.org/diagnostics.html, section "Typedef Preservation
and Selective Unwrapping"
Phobos contains a lot of templates and if a template isn't instantiated
it won't be compiled. Meaning there can be hidden compile errors if you
start to remove imports and they will not show until a template that
uses something from the import is instantiate.
Wouldn't it be possible/better
2. what is your opinion about public import ? In C++, "hidden" or
"implicit" #includes is a common source of compilation problems (order
of #includes), I tend to think it's a bad thing.
It can be quite useful. I use it often for C library wrappers. As soon as
you import the wrapper code you
Am 09.11.2011, 13:39 Uhr, schrieb Reklen :
Is there a project to export D in .Net world? I see this
http://dnet.codeplex.com/
but it seems dead.
Feel free to continue that project ;)
Apart from that you are left with C interface dlls.
I am a little disapointed, so if you have many request for a web page
this lib http://arsdnet.net/dcode/ is usable or not ?
If they are any other method to do a web application in D2 programming
do not hesitate and tell to me which lib used.
There's also a project named Serenity
http://www.dig
You can do this and/or use the convention of extends first, implements
second:
class Rectangle : Drawable, IShape, IOtherInterface {}
It's not a convention, the spec demands that.
http://d-programming-language.org/class.html
If you're really concerned about clarity, use comments:
class Rect
Cool stuff, thanks guys. This thing kicks some serious C++ ass. ^^
How? You can use using in C++ to do the same.
class Foo
{
@property void test(int) {}
@property int test() { return 1; }
}
class Bar : Foo
{
alias super.test test;
override @property void test(int) {}
void bartest() { auto x = test; }
}
And it actually works! Is this a documented feature?
http://d-programming-language.
I was thinking about porting http://eigen.tuxfamily.org/index.php in D.
Don't we have a LinAlg library now thx to that GSoC project?
I'm currently on SFML2 but it goes quite fast (thanks to Trass3r for
porting SFML to D2 so a big part of the job is done).
You're welcome.
Make sure your source file is saved in UTF-8 format.
Am 20.10.2011, 00:06 Uhr, schrieb Sean Silva :
== Quote from Jesse Phillips (jessekphillip...@gmail.com)'s article
Right now D isn't ready to be used in this fashion
It looks there's a more-or-less functional kernel written in D (and
pretty well documented too):
http://wiki.xomb.org/index.php?
ahead = n._next;
The C/C++ equivalent of this is `ahead = n->next;`, or equivalently
`ahead = (*n).next;`. This is a difference in semantics from C/C++ with
respect to the `.`---it seems like D turns pointer to struct property
accesses into property access with indirection.
Yes. It w
[DllImport("mydll.dll",
CallingConvention = CallingConvention.Cdecl,
SetLastError = false, CharSet = CharSet.Auto)]
private static extern bool concatenate(
string str1, // in
string str2, // in
StringBuilde
I believe that the primary reasoning for allowing the implicit conversion
between int and dchar is so that code like this
dchar c = 'a' + 7;
That's a '+' though, not a '~'.
I think it shouldn't be allowed with ~ since it's misleading.
Newbies would probably expect "abc" ~ 10 to yield "abc10" r
Talk about stuff that's hard to do or impossible in C++ (or just a PITA
like the whole language) and compare it to some nifty D code.
For example template metaprogramming. No easy way to do template
constraints, no is expressions nor a proper typeof so you have to use
specialization a lot.
Just wanted to point out how it's implemented with language tools.
I feel a little stupid, but how to convert a wchar* zero terminated
string into a wstring (DMD 2.055)?
wstring w = cstr[0 .. strlenw(cstr)];
Am 29.09.2011, 06:51 Uhr, schrieb Cheng Wei :
extern(C) {
struct ab;
}
ab*[int] map;
void main() {
map.clear();
}
Cannot be compiled. Why?
Thanks.
Just use void* for opaque pointers in D.
DSFML2's dsss file is just a remnant from the old DSFML.
Also I don't really update DSFML2 anymore. A SWIG wrapper would be a
better idea but it's hard to make it use our custom system module instead
of wrapping the original one.
In general using dsss isn't advisable, since rebuild is horrib
1 - 100 of 365 matches
Mail list logo