On 07/07/2021 11:54 PM, z wrote:
On Wednesday, 7 July 2021 at 10:27:47 UTC, notna wrote:
On Windows:
```
::> dmd curl_get.d
::> .\curl_get.exe
object.Error@(0): Access Violation
0x0283CA66
0x0041DE8D
0x004023A2
0x00402308
0x00414D33
0x00414CAD
0x00414B48
0x0040D41F
rdmd -main -unittest file.d
```d
import std.stdio;
unittest
{
writeln("first");
}
unittest
{
writeln("second");
assert(0);
}
```
Output:
```
first
second
onlineapp.d(11): [unittest] unittest failure
1/1 modules FAILED unittests
```
The first assert to execute should kill the
On 08/06/2021 2:47 PM, someone wrote:
https://dlang.org/articles/safed.html
https://dlang.org/dmd-linux.html#switches
http://ddili.org/ders/d.en/functions_more.html
Neither man dmd nor man dmd.conf appear to have a related/switch setting.
Does it means safeD is achieved by placing @safe
On 06/06/2021 4:53 AM, kinke wrote:
- Greatly improved DLL support on Windows, including bundled druntime
and Phobos DLLs, making it almost as easy as on Posix.
Nicee!
On 04/06/2021 8:50 PM, Max Samukha wrote:
On Tuesday, 1 June 2021 at 11:57:34 UTC, Mike Parker wrote:
Dylan Graham writes about his experience using D in a microcontroller
project and why he chose it. Does anyone know of any similar projects
using D? I don't. This may well be the first time
On 31/05/2021 1:05 PM, Dylan Graham wrote:
I haven't put any thought into the license. Since LWDR is derived from
DRuntime, I assume I'll have to use its license. If not, I'd like to go
with something permissive like MIT.
Boost is permissive.
On 27/05/2021 1:04 PM, Iain Buclaw wrote:
- New aliases have been added to gcc.attributes for compatibility
with ldc.attributes.
mm compact, very nice!
On 25/05/2021 3:39 AM, zjh wrote:
use chrome ,cannot open the DEV.
press `F12` of no use.
`Alt+U`of no use.
continue rotating the small circle.You can do nothing.
There is something seriously wrong with your install then.
It isn't related to the website itself.
Use the dev tools, network + performance tabs could be very useful
information for debugging this.
On 15/05/2021 9:42 AM, DLearner wrote:
I am getting 'Error 42: Symbol Undefined' while testing some (fairly)
complex imports.
There was a reference in January to an Optlink bug that seemed like it
could be responsible.
If rdmd can use another linker (and one was recommended), I might be
On 10/05/2021 6:41 AM, Blatnik wrote:
Do thread local variables work in -betterC? Or maybe it's better to ask
are they _supposed_ to work in -betterC?
No.
It is tied to druntime. I.e. on Linux it calls __tls_get_addr to get the
address.
On 22/04/2021 7:51 AM, Alain De Vos wrote:
import bindc.opengl;
bindbc
dub run dfmt -- ./app.d
You passed "./app.d" to dub, not dfmt.
On 10/04/2021 11:44 PM, Alain De Vos wrote:
In order to run commands correctly I have to put soft links :
I.e.
dfmt -> /home/x/.dub/packages/dfmt-0.13.4/dfmt/bin/dfmt
or,
dscanner -> /home/x/.dub/packages/dscanner-0.11.0/dscanner/bin/dscanner
Then ./dfmt or ./dscanner run fine.
I use freebsd
On 04/04/2021 2:48 AM, DLearner wrote:
On Saturday, 3 April 2021 at 13:38:25 UTC, rikki cattermole wrote:
On 04/04/2021 2:34 AM, DLearner wrote:
However, changing extern(C) to extern(D) causes linker failures.
To me, that is bizarre.
extern(D) sets the ABI AND mangling.
D mangling
On 04/04/2021 2:34 AM, DLearner wrote:
However, changing extern(C) to extern(D) causes linker failures.
To me, that is bizarre.
extern(D) sets the ABI AND mangling.
D mangling incorporates things like the module name.
--- main.d
module main;
extern(C) __gshared int foo;
import std;
void main()
{
import foo : func;
func;
writeln(foo);
}
--- foo.d
module foo;
extern extern(C) __gshared int foo;
void func() {
foo++;
}
The __gshared is irrelevant to it working between modules, but it is
On 03/04/2021 11:17 PM, DLearner wrote:
On Saturday, 3 April 2021 at 10:05:45 UTC, rikki cattermole wrote:
On 03/04/2021 11:01 PM, DLearner wrote:
[...]
TLS variable with D mangling, not a c global.
[...]
That is a regular variable.
Setting the calling convention/mangling like that
On 03/04/2021 11:01 PM, DLearner wrote:
'Testmain' imports module 'testmod'.
Both are shown below.
I expected 1,1,2,2.
I got 1,0,2,1 - which speaks to scope/extern misunderstanding
Any ideas?
Best regards
Testmain:
int xvar;
TLS variable with D mangling, not a c global.
import testmod;
On 03/04/2021 10:58 PM, rikki cattermole wrote:
Nullable has an alias this which has been deprecated.
It is due for removal (the alias this).
You can remove it manually from your copy of phobos source.
Otherwise you'll just have to wait until it is removed upstream.
(deprecation are not
Nullable has an alias this which has been deprecated.
It is due for removal (the alias this).
You can remove it manually from your copy of phobos source.
Otherwise you'll just have to wait until it is removed upstream.
(deprecation are not errors, so you can ignore them).
"Whether the attributes are values or types is up to the user, and
whether later attributes accumulate or override earlier ones is also up
to how the user interprets them."
This doesn't explain it well, but you were adding types as attributes on
to those symbols. Not struct instances.
On 02/04/2021 6:10 PM, Computermatronic wrote:
On Friday, 2 April 2021 at 05:02:52 UTC, mw wrote:
Ahh, I got what I see (from writeln) is not what get string here ;-)
And I just tried:
string t = text("head-", strip(s), "-tail");
It's the same behavior.
So how can I trim the leading &
On 02/04/2021 5:51 PM, mw wrote:
Then how can I construct `t`? to make this assertion true:
assert(t == "head-abc-tail"); // failed!
Slice it.
string t = text("head-", s[0 .. 3], "-tail");
http://ddili.org/ders/d.en/slices.html
On 02/04/2021 5:38 PM, mw wrote:
On Friday, 2 April 2021 at 04:36:01 UTC, rikki cattermole wrote:
On 02/04/2021 5:32 PM, mw wrote:
---
import std;
import std.conv : text;
void main()
{
char[6] s;
s = "abc";
writeln(s, s.length); // abc6, ok it's the static array's length
On 02/04/2021 5:32 PM, mw wrote:
---
import std;
import std.conv : text;
void main()
{
char[6] s;
s = "abc";
writeln(s, s.length); // abc6, ok it's the static array's length
string t = text("head-", s, "-tail");
writeln(t, t.length); // head-abc-tail16, why?
assert(t[9]
On 31/03/2021 7:28 AM, Chris Piker wrote:
Since I'm not orphaning packages soon and since physical science
packages have a relatively small user base, it sounds like interaction
with the dlang-community group is not recommended at this time.
It is neither not recommended, nor recommended.
On 30/03/2021 3:55 PM, James Blachly wrote:
Does this [hiding to non org members] really help D's visibility and
adoption? What sorts of things are discussed that do not benefit from
openness? For example, I am a bona fide scientist using Dlang, but had
no idea dlang-science was even an active
On 29/03/2021 12:16 PM, Chris Piker wrote:
On Sunday, 28 March 2021 at 04:06:57 UTC, mw wrote:
On Friday, 26 March 2021 at 21:55:18 UTC, Chris Piker wrote:
Let's discuss it here:
https://github.com/orgs/dlang-community/teams/science/discussions
@wilzbach is the maintainer of the group.
On 28/03/2021 2:45 PM, Dylan Graham wrote:
I might join some time after work (late afternoon) AEST if you guys will
still be on. I have some progress updates on the D powered automatic
gearbox system and a new project I've got in the works.
Ah huh an aussie.
I'll be on in the AM from CHCH
On 27/03/2021 10:51 AM, dan wrote:
Are there any d compilers that run natively on the Mac Mini with an M1
chip?
If so, does anybody here have any experience with them that can be shared?
If not, and your machine is a mac mini, how would you go about
programming in d on it?
TIA for any
Try it with:
-allinst
It may just be deciding a template instance isn't required.
Pipe it to grep should work
| grep -v "__D2"
https://github.com/dlang/phobos/blob/master/std/socket.d#L190
Might be of some use to you
On 01/03/2021 8:02 PM, Keivan Shah wrote:
If possible, Can you also help me understand that why are the threads
not despawned once the GC is done collecting in this example?
There was a PR about this ages ago.
But one thing to consider is that keeping threads around not doing
anything
Do you still get them when you call your app like this?
./app --DRT-gcopt=parallel:0
On 28/02/2021 11:05 PM, Max Haughton wrote:
Do the windows APIs expect the length in memory rather than as a parameter?
This sounds like its being sent via a user field to be passed to a callback.
I.e. event loop for a window.
In this sort of case you only get one parameter on the callback
On 28/02/2021 8:05 PM, Jack wrote:
int[] arr = [1, 2, 3];
size_t l = cast(size_t)arr.ptr;
Okay, so far so good
int[] a = cast(int[]) cast(void*) l;
Umm, you haven't specified a length?
int[] a = (cast(int*)l)[0 .. 3];
If the callback is being called (in effect under the current stack
On 20/02/2021 8:13 PM, tsbockman wrote:
Well, that's just another reason not to use the GC for my current
project, then: I'm using 256-bit AVX vectors extensively.
You can still use the GC.
You just can't use it to allocate the classes you care about.
On 17/02/2021 9:45 AM, Rumbu wrote:
On Tuesday, 16 February 2021 at 08:53:06 UTC, rikki cattermole wrote:
All of the symbols and modules need to be documented so that the
documentation generators will generate documentation for them.
Sincerely, I doubt that it's a good idea to duplicate
On 16/02/2021 9:45 PM, Rumbu wrote:
The D Windows SDK projection reached first version. Generated bindings
were compiled succesfully.
https://github.com/rumbu13/windows-d
Destroy!
All of the symbols and modules need to be documented so that the
documentation generators will generate
https://github.com/dlang-community/containers
It uses the older design for allocators (dependency).
On 07/02/2021 4:22 AM, frame wrote:
On Saturday, 6 February 2021 at 13:30:03 UTC, rikki cattermole wrote:
Okay, its still seeing something is alive then.
That's why I used the scope guard. I know it shouldn't have any effect
but I want to give the GC an extra hint ;)
The GC shouldn't be
On 07/02/2021 12:38 AM, Siemargl wrote:
On Saturday, 6 February 2021 at 11:20:18 UTC, Imperatorn wrote:
On Saturday, 6 February 2021 at 09:42:38 UTC, rikki cattermole wrote:
On 06/02/2021 3:32 PM, frame wrote:
[...]
This won't do anything.
[...]
Don't forget to stdout.flush; Otherwise
On 06/02/2021 3:32 PM, frame wrote:
On Friday, 5 February 2021 at 22:46:05 UTC, Bastiaan Veelo wrote:
?? Do you mean no collections happen? 32bit GC should just work.
No, it doesn't - this code fails on memory allocation and works fine
with -m64 switch:
import std.stdio;
import
The only difference between dmd, ldc and gdc (in effect) is the backend.
While druntime and Phobos will be patched for other platform targets,
over all its the same library.
The same goes for core.atomic. You should not need to know that it has
been patched. If you can call it and it gives
On 28/01/2021 1:16 PM, tsbockman wrote:
The documentation build on dlang.org is broken. Check the source code or
Adam D. Ruppe's dpldocs.info for the complete documentation:
http://dpldocs.info/experimental-docs/core.thread.osthread.html
Fixed: https://issues.dlang.org/show_bug.cgi?id=21309
https://d-apt.sourceforge.io/
Or you could use dub and not worry about where its installed.
https://github.com/gtkd-developers/GtkD/wiki/Hello-World-Example-on-Ubuntu-19.10-(Linux)
What you are describing sounds like regular reference counting.
All resources (i.e. windows) are pinned somewhere in memory. Its just
that you have to use special API's to destroy them rather than free.
On Wednesday, 13 January 2021 at 13:47:55 UTC, Roguish wrote:
On Wednesday, 13 January 2021 at 13:30:48 UTC, Roguish wrote:
Anything else I need to know when debugging on Linux, without
an IDE?
One specific question I have is: what's the difference between
-g and -debug and -d-debug?
From
On 12/01/2021 3:12 AM, zack wrote:
A beginner question: How to pass strings properly to functions in D?
Is there any allocation going on if just use a function as "myPrint"? In
C++ I have often seen calls where one just passes a reference/const
reference to a string to avoid allocation.
C++:
Your definition of Image is probably wrong.
You may have missed a pointer (8 bytes).
import std;
void main()
{
int[] a = [1, 2, 3, 4, 5];
int[3] b;
b[0 .. 3] = a[1 .. 4];
b.writeln;
}
Same principle, just remember to null terminate after slicing your
dynamic array and assigning it to your static array.
$ dub upgrade
https://dub.pm/commandline.html#upgrade
dub.selections.json hasn't been deleted/upgraded so the versions would
have gotten pinned to a known good state. Unless you change the version
invalidating it, it most likely won't upgrade by itself.
On 14/12/2020 9:56 AM, kdevel wrote:
On Sunday, 13 December 2020 at 20:25:06 UTC, KapyoniK wrote:
Is it really a bug ? \0 truncates the string, as mentionned on this
page :
https://en.wikipedia.org/wiki/Null-terminated_string
I thought the D runtime is written in D (with D strings)?!?
Did you initialize the D runtime before you called the D code? (assuming
C main).
On 12/12/2020 12:32 AM, rikki cattermole wrote:
Further, when the parameter name is not provided it will infer based
upon what is passed in. In effect it is templated.
What I meant was: the type is inferred if you only provide a single
identifier in a parameter.
string is not a built in type. It is an alias defined by druntime.
https://github.com/dlang/druntime/blob/master/src/object.d#L35
int on the other hand is defined by the compiler. It understands it.
Further, when the parameter name is not provided it will infer based
upon what is passed in.
On 05/12/2020 2:42 AM, Andrey wrote:
Hm, you mean that enum variable is not a real variable?
It is not a variable. It is a constant that cannot be changed and does
not exist in the executable.
I thought that to make CT variable you should mark it as enum (in c++ as
constexpr).
How to do
On 05/12/2020 1:54 AM, Andrey wrote:
Hello,
void test(const ref string[3] qazzz) { qazzz.writeln; }
void main()
{
enum string[3] value = ["qwer", "ggg", "v"];
That is a compile time constant (remove the enum).
test(value);
}
Gives errors:
onlineapp.d(26): Error: function
On 01/12/2020 7:39 PM, z wrote:
On Tuesday, 1 December 2020 at 04:50:03 UTC, rikki cattermole wrote:
...
What puzzles me is that the dependencies are indeed declared, but "dub
describe" refuses to recognize the dependencies and "dub build" fails.
"dub list" does recognize the root folder,
dub add-local, adds a directory as a known package that it can use as a
dependency (or to be executed).
You need to specify in the package that depends on the dependency what
dependencies you have.
I.e.
See the dependencies key:
{
"name": "myproject",
"description": "A
I was the person who wrote that example.
It was just an example to show how it can be used.
I would not write a function call like that when using a literal.
As Mike said, its all up to personal preference.
On 19/11/2020 1:11 PM, Dibyendu Majumdar wrote:
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.
On 09/11/2020 2:58 PM, Ali Çehreli wrote:
Does the D GC know the complete function call stack of the C program all
the way up from 'main'? Is there the concept of "bottom of the stack" or
does the D GC can only know the value of the stack pointer at the time
rt_init() was called. If the
On 29/10/2020 10:06 PM, Jan Hönig wrote:
On Thursday, 29 October 2020 at 09:01:12 UTC, Jan Hönig wrote:
This would mean, that this one should work as well.
It does not work as I intended, as `() => {}` has not the return type of
`void`.
(I don't know how to print: `ReturnType!(() => {})`)
(Params){ FunctionBody; }
Rule: ref|opt ParameterWithMemberAttributes FunctionLiteralBody
https://dlang.org/spec/expression.html#function_literals
void function()
Is a type https://dlang.org/spec/type.html#delegates
() => {}
Is actually:
() => Expression
Rule: ref|opt
On 26/10/2020 8:14 PM, Patrick Schluter wrote:
You underestimate how spoiled windows developer are. Even these simple
step are completely out of character for most software on the platform.
20 years ago it wasn't a problem, now on Windows 10 it's a whole other
story. How many clicks to get the
On 25/10/2020 11:03 PM, Ali Çehreli wrote:
Does the GC see that local variable 'name' that is on the C side? What I
don't know is whether the GC is aware only of the stack frames of D
functions or the entire thread, which would include the C caller's 'name'.
The thread stack frame that is
https://dlang.org/phobos/std_format.html#formattedWrite
Uses GC for exception (so cannot be @nogc yet), but otherwise it should
be GC free.
On 16/10/2020 9:13 AM, Atmosfear wrote:
I'm a newby. Can you show me an example? In which module is it?
You can search for it on Github and it'll show up.
https://github.com/dlang/druntime/search?q=QueryPerformanceCounter
On 02/10/2020 9:33 PM, Imperatorn wrote:
Did you create a D-partition just for D. Pro
You can mount directories as a drive on Windows.
https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/subst
On 21/09/2020 6:24 AM, Vladimirs Nordholm wrote:
I am unsure what the dub file would look like. I read that there is
something called "subPackages", but in my mind I see them as
dependencies. Is "subPackages" the right approach here?
Yes but no.
Normally all of these (what appear to be small
On 28/08/2020 3:59 AM, Jesse Phillips wrote:
DMD installer still is unable to find "VS installed"
One of the reasons for this is that the environment variables have not
been updated.
You need to restart to do this.
On 07/08/2020 5:12 AM, wjoe wrote:
There's core.memory.GC.reserve which requests memory from the OS.
Basically pre-allocating memory for the GC heap.
Is the GC heap shared among all threads ?
That is up to the GC implementation.
And is it correct that even if I call GC.disable, the GC may
Old frontend:
Up to 2.060 : Failure with output: onlineapp.d(2): Error: valid
attribute identifiers are @property, @safe, @trusted, @system, @disable
not @nogc
2.061 to 2.065.0: Failure with output:
-
onlineapp.d(2): Error: user defined attributes cannot appear as postfixes
On 18/07/2020 9:14 PM, blizzard wrote:
Can anybody explain the difference between readln() and readln? I read
somewhere that the () were optional, so why this difference?
The brackets are optional when calling a function. You are not calling a
function if you wrap it in typeof.
"The
On 10/07/2020 9:04 PM, Walter Bright wrote:
I hope cv2pdb is in D, as that is a fine way to get C++ people used to D!
https://github.com/rainers/cv2pdb
Nope.
On 09/07/2020 10:22 PM, Manu wrote:
Then the general autocomplete engine, which is fairly dependent on the
detail expressed in the project files.
DCD is due for a rewrite into using dmd-fe.
However as it stands, I do not believe it is mature enough to use as a
library for this purpose. So I
https://dlang.org/spec/pragma.html#mangle
pragma(mangle, "body")
extern(C) void body_func();
On 28/06/2020 4:59 PM, Kirill wrote:
module something;
extern(C)
int add(int a, int b);
Compile as static library some.c, add to command line of dmd.
Should be this simple more or less, depending on compilers and target
involved.
Thank you Walter.
On 28/05/2020 12:33 AM, aberba wrote:
On Thursday, 21 May 2020 at 18:36:51 UTC, H. S. Teoh wrote:
On Thu, May 21, 2020 at 05:49:27PM +, Paul Backus via
Digitalmars-d-announce wrote: [...]
Even if we suppose for the sake of argument that the decision is
sound on a technical level, this
On 27/05/2020 10:12 PM, Johannes Loher wrote:
Am 27.05.20 um 11:25 schrieb Walter Bright:
On 5/24/2020 3:40 AM, Stefan Koch wrote:
The distinction is that you can find a slapped on trusted with a grep.
It's just as easy to use grep to *not* find @trusted.
But that's not enough. You need a
On 27/05/2020 10:03 PM, Walter Bright wrote:
Frankly, I feel that if I could sit down with you folks, I can get the
idea across what I'm trying to accomplish.
Okay, how is your camera and mic situation?
Lets do a Twitch stream, make sure there are some moderators in place as
well.
Open to
On 27/05/2020 9:50 PM, Walter Bright wrote:
BTW, one good thing that has come out of this issue is people are
strongly in favor of what @safe does. That bodes well for DIP1000 and
the @live code, for a long time I seemed to be the only one who cared
about it.
Most of the arguments against
On 25/05/2020 10:29 PM, Zoadian wrote:
you complain about @trusted losing it's meaning, but @safe was ment to
mean "mechanically verified memory safety". it should be forbidden to
add @safe to any function that can not be verified by the compiler.
It is meant to mean that at some point it has
On 23/05/2020 5:40 AM, Atila Neves wrote:
On Friday, 22 May 2020 at 17:33:11 UTC, rikki cattermole wrote:
On 23/05/2020 5:07 AM, Atila Neves wrote:
[...]
It is not about the linkage.
The problem is solely does the compiler have the source to the
function body to verify it?
That's what I
On 23/05/2020 5:07 AM, Atila Neves wrote:
On Friday, 22 May 2020 at 12:28:56 UTC, rikki cattermole wrote:
On 23/05/2020 12:19 AM, Joseph Rushton Wakeling wrote:
With the rationale laid out clearly as it is here, I do have some
responses in mind. But before sharing them, I'd like to know
On 23/05/2020 12:19 AM, Joseph Rushton Wakeling wrote:
With the rationale laid out clearly as it is here, I do have some
responses in mind. But before sharing them, I'd like to know whether
that would be useful right now: I've no wish to just press for a
re-hashing of conversations that have
if (Child child = cast(Child)parent) {
assert(child !is null);
}
On 22/05/2020 12:21 PM, Daniel C wrote:
Can this library be used in a 64-bit build? I only see the one lib, and
was curious if the function definitions make any assumptions about
argument size or stack configuration etc.
There are no binary files provided in the bindbc-sdl repository.
On 19/05/2020 12:51 AM, a beginner wrote:
@rikki cattermole
Dmd and ldc's codegen haven't stood still for 10 years. They both will be
emitting instructions your cpu cannot handle. Hence crashes.
So... was I wrong to assume it generates code for the cpu it's running
on (a P4 Northwood in my
It isn't just about the OS.
Dmd and ldc's codegen haven't stood still for 10 years. They both will
be emitting instructions your cpu cannot handle. Hence crashes.
On 05/05/2020 9:05 PM, Robert M. Münch wrote:
On 2020-05-04 21:34:27 +, rikki cattermole said:
On 05/05/2020 7:26 AM, notna wrote:
Maybe you want to add an additional constraint... It would be great
if this would result in a tool, scripts or at least a
simple-to-follow to-do (say
On 05/05/2020 7:26 AM, notna wrote:
Maybe you want to add an additional constraint... It would be great if
this would result in a tool, scripts or at least a simple-to-follow
to-do (say Wiki?!)... so best case we could use this also for the next
updates / releases in the future?!
It wouldn't
On 29/04/2020 10:27 PM, Sam E. wrote:
To be honest, I haven't yet found the way to switch between -m32 and
-m64 (or other) via dub :)
$ dub build --arch=x86
$ dub build --arch=x86_64
On 27/04/2020 1:52 AM, Ali Çehreli wrote:
However, currently dmdcache doesn't seem to look for string imports;
opportunity for improvement. :)
That should not be necessary if you base it on -J instead.
On 10/04/2020 7:42 AM, Dennis wrote:
On Thursday, 9 April 2020 at 19:27:16 UTC, Quantium wrote:
I see this code imports drivers and does it depend on processor
architecture? Would it work only on 64-bit or 32-bit or some special
architechtures?
kernel32.dll and psapi.dll should be present on
How old is your build of dub?
"betterC" build option was introduced in 1.20.0
201 - 300 of 2710 matches
Mail list logo