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
SEH was patented, so llvm doesn't support it.
That has changed.
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
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?
WinXP is dead :)
I think it should be possible to run DustMite on some big project
like phobos to actually search for such internal errors.
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
... the order of files matters? Yuck.
Yep it's a bug.
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
test code please
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
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.
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 sclytr...@hotmail.com:
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.
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.
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?
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.
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
I guess Tango provides something like that via the VFS stuff.
https://github.com/SiegeLord/Tango-D2 resp.
https://github.com/mtachrono/tango
There's a pull request to help with debugging string mixins:
https://github.com/D-Programming-Language/dmd/pull/426
Why is 'const' removed?
cause htod sucks.
D1 didn't have const and htod wasn't updated for ages.
Am 06.03.2012, 20:13 Uhr, schrieb maarten van damme
maartenvd1...@gmail.com:
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
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
http://d.puremagic.com/issues/show_bug.cgi?id=5570
A blocker for using x64 on linux then.
Use gdc. Better codegen anyway.
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
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 :)
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.
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.
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
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.
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.
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.
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
However, I cannot, by default, scope my custom allocations.
Any ideas?
std.typecons.scoped
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
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*
*whispers gee dee c*
windows binaries please...
Seek and you shall find.
https://bitbucket.org/goshawk/gdc/downloads
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.
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.
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.
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
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:
What's the definition of Display?
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];
Sorry, didn't read the rest. ^^
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 first
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, 13:04 Uhr, schrieb Bear joanylepri...@yahoo.fr:
Using D1, I have a program that creates tons of float[] ; for performance
reasons, I would like them to be uninitialized.
std.array.uninitializedArray
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, 23:13 Uhr, schrieb Martin Drašar dra...@ics.muni.cz:
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
I think something like this is implemented in a dmd pull request.
Am 16.12.2011, 17:47 Uhr, schrieb dune do-...@email.com:
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
What I posted was an example, in reality there is tons of code inside
the d file.
Show the file, or part of it.
hrsmallPage generated by a
href=http://www.digitalmars.com/d/2.0/ddoc.html;Ddoc/a. /small
/body/html
Ah looks like that must be updated to dlang.org too
Am 16.12.2011, 19:45 Uhr, schrieb dune do-...@email.com:
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.
*
*
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.
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.
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
Am 09.11.2011, 13:39 Uhr, schrieb Reklen rek...@mymaill.com:
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.
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
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
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?
Cool stuff, thanks guys. This thing kicks some serious C++ ass. ^^
How? You can use using in C++ to do the same.
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
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 chisophu...@gmail.com:
== 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):
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
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
[DllImport(mydll.dll,
CallingConvention = CallingConvention.Cdecl,
SetLastError = false, CharSet = CharSet.Auto)]
private static extern bool concatenate(
string str1, // in
string str2, // in
StringBuilder
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.
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)];
Just wanted to point out how it's implemented with language tools.
Am 29.09.2011, 06:51 Uhr, schrieb Cheng Wei riverch...@gmail.com:
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
bool test(HDC dc, string str, int len, SIZE* s)
{
wchar[] wstr = toUTFz!(wchar*)str;
GetTextExtentPoint32W(dc wstr.ptr, wstr.length, s);
toUTFz returns a wchar*, not a wchar[].
Are you sure that the call requires the string to be null terminated? I
do not know that winapi function, but this might work:
bool test(HDC dc, string str, SIZE* s)
{
auto wstr = to!(wchar[])str;
GetTextExtentPoint32W(dc, wstr.ptr, wstr.length, s);
...
It doesn't need to be null-terminated
Am 18.09.2011, 18:55 Uhr, schrieb Ellery Newcomer
ellery-newco...@utulsa.edu:
Just came across some old D code that does this:
version(linux){
extern(C):
}
Hundreds of OpenGL decls
in dmd 2.055, the extern(C) is not being applied to the OpenGL decls.
should it?
Walter once said
So, my question is THIS:
Can I write a windows DLL file in D that would have functions that can
be accessible from a compiled C++ program? (Actually, in this case, it's
UnrealScript that is compiled into a C++ exe.)
It's perfectly possible to create DLLs with D, also see
Change it to the following, and you're golden.
extern(System):
Hundreds of OpenGL decls
That only fixes this particular issue.
I once had the following case that can't be done:
version(V1)
{
extern(System):
}
else
{
extern(C):
}
Am 15.09.2011, 13:37 Uhr, schrieb Matthias Pleh u...@example.net:
When porting c-code to D, I come consitently to the problem,
how to convert such a c-macro:
#define V(a,b,c) glVertex3d( a size, b size, c size );
#define N(a,b,c) glNormal3d( a, b, c );
N( 1.0, 0.0, 0.0); V(+,-,+); V(+,-,-);
Also by static function you probably mean private in D.
No, I meant for mixin I nead static functions, but I just realized,
it also works without the static keyword.
I think static has no meaning in global scope, only in function scope
where it tells the compiler you don't want a closure.
You could also use cv2pdb's -C option and Visual Studio to debug dmd.
1 - 100 of 315 matches
Mail list logo