On Thursday, 19 November 2020 at 14:34:38 UTC, Adam D. Ruppe
wrote:
On Thursday, 19 November 2020 at 00:20:50 UTC, Dibyendu
Majumdar wrote:
Okay thanks. Bad idea IMO.
That's kinda how I see C taking the address of various things
implicitly.
To be honest it seems irrelevant what C does.
On Thursday, 19 November 2020 at 09:23:25 UTC, Jacob Carlborg
wrote:
Yes, calling `writeln` like that is a bad idea. That was a bad
example.
But the actual reason is, this is how D implements properties
[1]. Any function that doesn't take an argument can be called
without parentheses. Any fun
On Thursday, 19 November 2020 at 01:42:16 UTC, Mike Parker wrote:
On Thursday, 19 November 2020 at 00:20:50 UTC, Dibyendu
Majumdar wrote:
On Thursday, 19 November 2020 at 00:18:54 UTC, rikki
cattermole wrote:
You don't need the brackets to call a function (and with a
little help from UFCS):
On Thursday, 19 November 2020 at 00:18:54 UTC, rikki cattermole
wrote:
You don't need the brackets to call a function (and with a
little help from UFCS):
void main() {
import std.stdio;
"Hello!".writeln;
writeln;
}
Okay thanks. Bad idea IMO.
On Thursday, 19 November 2020 at 00:08:59 UTC, Adam D. Ruppe
wrote:
On Thursday, 19 November 2020 at 00:07:12 UTC, Dibyendu
Majumdar wrote:
int function() fp = test;
You want &test to get the address.
Okay that works. Thanks
On Thursday, 19 November 2020 at 00:08:59 UTC, Adam D. Ruppe
wrote:
On Thursday, 19 November 2020 at 00:07:12 UTC, Dibyendu
Majumdar wrote:
int function() fp = test;
This tries to *call* the function test and assign its return
value to fp.
Really? why does it do that?
You want &test to
I have simple test program:
import core.stdc.stdio : printf;
void test() {
int* a;
printf("a == null %d\n", a == null);
}
int function() fp = test;
extern (C) void main() {
fp();
}
Why do I get:
\d\dmd-2.092.1\windows\bin64\dmd.exe -betterC tests.d
tests.d(5): Error: printf canno
On Saturday, 7 March 2020 at 14:33:29 UTC, Steven Schveighoffer
wrote:
It's D's version of implicit conversion.
You can make the alias this a no-arg function and it will try
calling that function.
Okay thank you.
On Saturday, 7 March 2020 at 12:26:32 UTC, drug wrote:
I am trying to understand
https://github.com/dlang/dmd/blob/master/src/dmd/backend/barray.d.
Two questions:
1. What does this mean and why is it needed?
line 95: alias array this;
This means that `array` can be used instead of `this`
Hi,
I am trying to understand
https://github.com/dlang/dmd/blob/master/src/dmd/backend/barray.d.
Two questions:
1. What does this mean and why is it needed?
line 95: alias array this;
2. The struct has no property called length - but this is
referenced. Where does this come from?
Thank y
On Monday, 13 November 2017 at 18:40:42 UTC, Basile B. wrote:
TBH I wonder if this is not worth a enhancement (or even a DIP)
to have in asm blocks a special alias syntax...
{
asm
{
version(...)
{
alias First = RDI;
alias Second = RSI;
//
On Sunday, 12 November 2017 at 22:40:06 UTC, Dibyendu Majumdar
wrote:
On Sunday, 12 November 2017 at 22:00:58 UTC, Basile B. wrote:
no in naked mode you have to save and restore by hand.
So how does one manually generate the .pdata and .xdata
sections?
Are you saying that this is what I woul
On Sunday, 12 November 2017 at 22:24:08 UTC, Basile B. wrote:
On Sunday, 12 November 2017 at 22:20:46 UTC, Dibyendu Majumdar
wrote:
On Sunday, 12 November 2017 at 22:00:58 UTC, Basile B. wrote:
On Sunday, 12 November 2017 at 21:27:28 UTC, Dibyendu Majumdar
I am not sure I have understood above;
On Sunday, 12 November 2017 at 22:00:58 UTC, Basile B. wrote:
On Sunday, 12 November 2017 at 21:27:28 UTC, Dibyendu Majumdar
Does the compiler generate appropriate unwind information on
Win64? Prsumably if a function is marked 'naked' then it
doesn't?
yeah about stack frame..., also don't f
On Sunday, 12 November 2017 at 18:48:02 UTC, Eugene Wissner wrote:
https://dlang.org/spec/iasm.html#agregate_member_offsets
aggregate.member.offsetof[someregister]
Sorry I didn't phrase my question accurately. Presumably to
use above with the mnemonics I would need additional mixin
templates
On Sunday, 12 November 2017 at 12:32:09 UTC, Basile B. wrote:
On Sunday, 12 November 2017 at 12:17:51 UTC, Dibyendu Majumdar
wrote:
On Sunday, 12 November 2017 at 11:55:23 UTC, Eugene Wissner
wrote:
[...]
Thank you - I probably could use something like this. It is
uglier than the simpler app
On Sunday, 12 November 2017 at 11:55:23 UTC, Eugene Wissner wrote:
On Sunday, 12 November 2017 at 11:01:39 UTC, Dibyendu Majumdar
wrote:
I have recently started work on building a VM for Lua
(actually a derivative of Lua) in X86-64 assembly. I am using
the dynasm tool that is part of LuaJIT. I
On Sunday, 12 November 2017 at 12:00:00 UTC, Basile B. wrote:
On Sunday, 12 November 2017 at 11:01:39 UTC, Dibyendu Majumdar
wrote:
[...]
The assembly code uses static allocation of registers, but
because of the differences in how registers are used in Win64
versus Unix X64 - different registe
Hi,
I have recently started work on building a VM for Lua (actually a
derivative of Lua) in X86-64 assembly. I am using the dynasm tool
that is part of LuaJIT. I was wondering whether I could also
write this in D's inline assembly perhaps, but there is one
aspect that I am not sure how to do.
On Friday, 26 February 2016 at 11:37:32 UTC, BBasile wrote:
Erratum! Actually you can, example:
import std.stdio;
string foo(double a)()
{
return "auto value = " ~ a.stringof ~ ";";
}
void main(string[] args)
{
mixin(foo!0.1);
writeln(value); // 0.1
writeln(typeof(value).string
On Friday, 26 February 2016 at 11:07:28 UTC, BBasile wrote:
On Friday, 26 February 2016 at 11:03:43 UTC, Dibyendu Majumdar
wrote:
How do I use a double value in a mixin template that is
generating string?
Have you an example of what's failing right now to show ?
I am trying something like th
Hi,
How do I use a double value in a mixin template that is
generating string?
Thanks and Regards
Dibyendu
Hi,
I am looking for example of types where memory management is
manual, and the type supports operator overloading, etc. Grateful
if someone could point me to sample example code.
Thanks and Regards
Dibyendu
On Friday, 22 January 2016 at 22:06:35 UTC, Dibyendu Majumdar
wrote:
Hi
I am trying to create a simple shared library that exports a D
function, but when I try to link to it I get errors such as:
error LNK2001: unresolved external symbol _D7xxx12__ModuleInfoZ
I have uploaded my small test
Hi
I am trying to create a simple shared library that exports a D
function, but when I try to link to it I get errors such as:
error LNK2001: unresolved external symbol _D7xxx12__ModuleInfoZ
Here xxx is the module inside the shared library.
I am using DMD and MS LINKER (Windows 64-bit) to c
On Friday, 22 January 2016 at 05:15:13 UTC, Mike Parker wrote:
On Thursday, 21 January 2016 at 23:06:55 UTC, Dibyendu Majumdar
wrote:
On Thursday, 21 January 2016 at 22:44:14 UTC, H. S. Teoh wrote:
Hi - I want to be sure that my code is not allocating memory
via the GC allocator; but when shipp
On Friday, 22 January 2016 at 01:53:53 UTC, Chris Wright wrote:
On Thu, 21 Jan 2016 21:52:06 +, Dibyendu Majumdar wrote:
Hi
I have C code where the struct has a trailing array member:
struct matrix {
int rows;
int cols;
double data[1];
};
D has bounds checking, which makes this
On Friday, 22 January 2016 at 00:52:59 UTC, W.J. wrote:
Counter question: What's so bad about the D std library ?
I am trying to create bindings for existing C library so I was
trying to use htod for that.
On Friday, 22 January 2016 at 01:03:09 UTC, Dibyendu Majumdar
wrote:
On Friday, 22 January 2016 at 00:52:59 UTC, W.J. wrote:
Counter question: What's so bad about the D std library ?
I am trying to create bindings for existing C library so I was
trying to use htod for that.
The library incl
I tried using htod but got errors as it could not handle the std
C header files (Visual C++). How do people work around this?
Thanks and Regards
Dibyendu
On Thursday, 21 January 2016 at 22:44:14 UTC, H. S. Teoh wrote:
Hi - I want to be sure that my code is not allocating memory
via the GC allocator; but when shipping I don't need to
disable GC - it is mostly a development check.
I want to manage all memory allocation manually via
malloc/free.
On Thursday, 21 January 2016 at 22:49:06 UTC, jmh530 wrote:
I'm not trying to created a shared library in D. My goal is to
use a shared library from C in D. Right now, I'm working with a
simple test case to make sure I could understand it before
working with the actual shared library I want t
On Thursday, 21 January 2016 at 22:34:43 UTC, cym13 wrote:
Out of curiosity, why would you force not being able to
allocate memory?
Hi - I want to be sure that my code is not allocating memory via
the GC allocator; but when shipping I don't need to disable GC -
it is mostly a development chec
On Thursday, 21 January 2016 at 22:23:36 UTC, jmh530 wrote:
Thanks. I had been trying to get 32bit code to work. I don't
think I did anything special with gcc to compile the dll as
64bit. Anyway, this is what I get when I try it again (stuff in
brackets I replaced).
C:>dmd -m64 .d -L/LIBPATH:
On Thursday, 21 January 2016 at 22:15:13 UTC, Chris Wright wrote:
Finally, you can use gc_setProxy() with a a GC proxy you
create. Have it throw an exception instead of allocating. That
means you will get crashes instead of memory leaks if something
uses the GC when it shouldn't.
gc_setProx
On Thursday, 21 January 2016 at 22:09:47 UTC, jmh530 wrote:
The -L/LIBPATH:c:\lib gives me an error that
OPTLINK : Warning 9: Unknown Option : LIBPATH
and then gives the path I put is not found.
At least when it's outputting the text, it's combining
:C:\lib\yourlib.lib
so it seemingly is finding
On Thursday, 21 January 2016 at 21:55:10 UTC, jmh530 wrote:
For the latter - on Windows 10 b64-bit - I am using following
options for example:
-shared -L/LIBPATH:c:\\lib -L//IMPLIB:mylib.lib
I'm not having any luck using your options with dmd either
(excluding -shared because I don't nee
Is there a way to disable GC in D?
I am aware of the @nogc qualifier but I would like to completely
disable GC for the whole app/library.
Regards
Dibyendu
Hi
I have C code where the struct has a trailing array member:
struct matrix {
int rows;
int cols;
double data[1];
};
In C code this is allocated dynamically to be variable size. The
array is used just as normal.
How should this be translated to D? Will D's array access allow
data ele
On Thursday, 21 January 2016 at 16:14:40 UTC, jmh530 wrote:
I'm trying to understand calling C libraries from D on Windows
with DMD. I made a simple example and compiled it with a static
library fine (so I've converted the .h file correctly). Then, I
compiled with gcc to a shared library (becau
Hi,
I am trying to understand the options for distributing a D app to
users. My assumption is that only the shared libraries and
binaries need to be distributed, and I need to include the D
libraries. Is this correct?
Thanks and Regards
Dibyendu
On Sunday, 17 January 2016 at 03:07:39 UTC, Mike Parker wrote:
Have you verified that this is the only DMD installation on
your path?
Looks like the problem is not in dub - but the fact that a shared
library in D requires a DllMain - as described in:
http://forum.dlang.org/post/eokrmosskw
On Saturday, 16 January 2016 at 20:50:51 UTC, Robert M. Münch
wrote:
Check your paths in sc.ini Looks like the D link libraries are
not found.
Well as far as I can tell they are correct (unchanged from
whatever the installer set them to):
; environment for both 32/64 bit
[Environment]
DFLA
Hi
I am using DUB on Windows 10 64-bit with DMD. I have simple
project with following configuration:
{
"name": "testing",
"description": "A minimal D application.",
"copyright": "Copyright © 2016, dibyendu",
"authors": ["dibyendu"],
"targetType": "dynami
On Monday, 4 January 2016 at 08:28:03 UTC, Luis wrote:
I suggest use dub instead of cmake. I did a try to use cmake
some time ago (a few years ago, before dub), and was a
nightmare to get ir working on GNU/Linux and Windows. With dub
, simply works fine with a simple json file.
CMake has wo
Does CMake recognise D in the enable_language command?
If not is there a workaround?
Thanks and Regards
Dibyendu
46 matches
Mail list logo