On Wednesday, 11 May 2022 at 20:53:21 UTC, Marvin Hannott wrote:
On Wednesday, 11 May 2022 at 20:23:07 UTC, Ali Çehreli wrote:
[...]
Yeah, but you can't return `Cat` . And the documentation for
`scoped` says:
[...]
That's kinda very limiting.
Anyway, I cooked up another idea based on
On Tuesday, 26 April 2022 at 13:36:19 UTC, Claude wrote:
On Tuesday, 26 April 2022 at 12:49:21 UTC, Alain De Vos wrote:
---
I also encountered problems while I was trying to use CTFE only
functions (using betterC so I don't have to link
phobos/D-runtime).
However, if those functions use the
On Friday, 22 April 2022 at 05:28:52 UTC, dangbinghoo wrote:
On Thursday, 21 April 2022 at 07:38:04 UTC, Alexander Zhirov
wrote:
[...]
```d
struct ifreq {
private union ifr_ifrn_ {
char[IFNAMSIZ] ifrn_name; /* if name, e.g. "en0" */
}
On Thursday, 21 April 2022 at 07:38:04 UTC, Alexander Zhirov
wrote:
On Thursday, 21 April 2022 at 07:20:30 UTC, dangbinghoo wrote:
On Thursday, 21 April 2022 at 07:04:18 UTC, Alexander Zhirov
wrote:
I want to get the IP address of the network interface. There
is both a wireless interface and a
On Thursday, 21 April 2022 at 07:20:30 UTC, dangbinghoo wrote:
On Thursday, 21 April 2022 at 07:04:18 UTC, Alexander Zhirov
wrote:
I want to get the IP address of the network interface. There
is both a wireless interface and a wired one. Is it possible,
knowing the name of the network
On Thursday, 21 April 2022 at 07:04:18 UTC, Alexander Zhirov
wrote:
I want to get the IP address of the network interface. There is
both a wireless interface and a wired one. Is it possible,
knowing the name of the network interface, to get its IP
address?
```d
import
On Saturday, 9 April 2022 at 02:56:50 UTC, dangbinghoo wrote:
On Saturday, 9 April 2022 at 02:19:52 UTC, dangbinghoo wrote:
On Friday, 8 April 2022 at 03:26:29 UTC, dangbinghoo wrote:
On Friday, 8 April 2022 at 03:20:29 UTC, dangbinghoo wrote:
[...]
PS: I need the program link Phobos
On Saturday, 9 April 2022 at 02:19:52 UTC, dangbinghoo wrote:
On Friday, 8 April 2022 at 03:26:29 UTC, dangbinghoo wrote:
On Friday, 8 April 2022 at 03:20:29 UTC, dangbinghoo wrote:
[...]
PS: I need the program link Phobos statically, don't want to
use .so except the basic C library. so I
On Friday, 8 April 2022 at 03:26:29 UTC, dangbinghoo wrote:
On Friday, 8 April 2022 at 03:20:29 UTC, dangbinghoo wrote:
[...]
PS: I need the program link Phobos statically, don't want to
use .so except the basic C library. so I added option
`-link-defaultlib-shared=false` in dub.json by
On Friday, 8 April 2022 at 03:20:29 UTC, dangbinghoo wrote:
hi,
I just asked for help about this before, on that time, my
solution is to remove whatever dub dependencies which are
optional.
now, I'm re-examining the dlang program footprint size, and I
put a github example repo here:
hi,
I just asked for help about this before, on that time, my
solution is to remove whatever dub dependencies which are
optional.
now, I'm re-examining the dlang program footprint size, and I put
a github example repo here:
https://github.com/dangbinghoo/dlang_footprint_test.git
the
On Friday, 4 March 2022 at 01:30:00 UTC, Leonardo wrote:
Thanks but not worked here.
```
[leonardo@leonardo-pc dimportc]$ dmd --version
DMD64 D Compiler v2.098.1
Copyright (C) 1999-2021 by The D Language Foundation, All
Rights Reserved written by Walter Bright
[leonardo@leonardo-pc
On Wednesday, 3 November 2021 at 00:50:31 UTC, pascal111 wrote:
How can I include "ncurses" liberary in D? I'm using Ubuntu and
GDC!
Search ncurses in Dub registray shows that there's 3 ncurses D
bingdings.
https://code.dlang.org/search?q=ncurses
On Tuesday, 19 October 2021 at 00:01:47 UTC, James Blachly wrote:
On 10/18/21 12:03 PM, dangbinghoo wrote:
[...]
Not quite the same as tagged algebraic union ("sum type" ==
Rust enum) are not (yet?) a language feature.
That being said, I recently integrated mir's Algebraic and
Nullable
hi,
It seems that now we have `Optional` and `Result` packages in
Dub, are these enough or fully equal to Rust or Scala's
error-handling and pattern-matching?
if these are enough for real-code, any best practice advice?
thanks!
On Friday, 27 August 2021 at 06:52:10 UTC, Kirill wrote:
Is there a way to do mixin or similar during runtime?
I'm trying to read a csv file and extract data types. Any ideas
on how this should be approached in D are greatly appreciated.
remember D is a statically compiled language, `mixin`
On Friday, 30 July 2021 at 10:20:36 UTC, Stefan Koch wrote:
On Friday, 30 July 2021 at 09:30:13 UTC, Mike Parker wrote:
On Friday, 30 July 2021 at 08:38:24 UTC, dangbinghoo wrote:
but, where's these switch option documented? it seems it not
appears in dmd --help or man dmd, or online
On Friday, 30 July 2021 at 09:30:13 UTC, Mike Parker wrote:
On Friday, 30 July 2021 at 08:38:24 UTC, dangbinghoo wrote:
but, where's these switch option documented? it seems it not
appears in dmd --help or man dmd, or online document
https://dlang.org/dmd-linux.html
That's what he
On Friday, 30 July 2021 at 06:46:18 UTC, WebFreak001 wrote:
On Friday, 30 July 2021 at 06:00:41 UTC, dangbinghoo wrote:
Not sure if this is exactly what you want but there is a hidden
switch in dmd called `-vcg-ast` that prints out all the
templates instantiated.
but, where's these
On Friday, 30 July 2021 at 06:46:18 UTC, WebFreak001 wrote:
On Friday, 30 July 2021 at 06:00:41 UTC, dangbinghoo wrote:
Not sure if this is exactly what you want but there is a hidden
switch in dmd called `-vcg-ast` that prints out all the
templates instantiated.
On run.dlang.io you can use
hi, is there any D compiler option or other method to view the
final template instantiation but not compiled (in asm or binary)
code?
if there's a way, it might be very usefull for newbies like me to
learn and understand the the Meta programming of dlang.
thanks!
dbh
On Saturday, 10 July 2021 at 21:40:54 UTC, Bastiaan Veelo wrote:
On Friday, 9 July 2021 at 03:07:04 UTC, dangbinghoo wrote:
as questioned in the previous thread, I need to find out
something like `--as-needed` options available for D.
You are probably looking for the
On Friday, 9 July 2021 at 20:43:48 UTC, rempas wrote:
I'm reading the library reference for
[core.time](https://dlang.org/phobos/core_time.html#Duration)
and It says that the duration is taken in "hnsecs" and I cannot
understand if we can change that and choose the precision. Does
anyone know
On Friday, 9 July 2021 at 01:51:55 UTC, dangbinghoo wrote:
On Thursday, 8 July 2021 at 11:18:26 UTC, russhy wrote:
On Thursday, 8 July 2021 at 10:01:33 UTC, dangbinghoo wrote:
I have tried to add
```
"dflags": ["--link-defaultlib-shared"],
"lflags": ["--as-needed"],
```
to dub.json, and
On Thursday, 8 July 2021 at 11:18:26 UTC, russhy wrote:
On Thursday, 8 July 2021 at 10:01:33 UTC, dangbinghoo wrote:
I have tried to add
```
"dflags": ["--link-defaultlib-shared"],
"lflags": ["--as-needed"],
```
to dub.json, and my compiler is ldc2, with 800 loc program
used `hibernated`
I have tried to add
```
"dflags": ["--link-defaultlib-shared"],
"lflags": ["--as-needed"],
```
to dub.json, and my compiler is ldc2, with 800 loc program used
`hibernated` and `asdf` package. it compiled to 27MB binary not
stripped and even 4MB size after stripped. (When compiled to ARM,
On Sunday, 30 May 2021 at 12:27:34 UTC, Siemargl wrote:
On Thursday, 27 May 2021 at 01:17:44 UTC, someone wrote:
Yes, I know this is a question lacking a straightforward
answer.
Requirements:
- desktop only: forget about support for mobile tablets
whatever
You forget semi-official DWT
On Thursday, 17 September 2020 at 03:16:42 UTC, Paul Backus wrote:
On Thursday, 17 September 2020 at 03:14:08 UTC, JG wrote:
Perhaps there are other ways, but you can use enumerate. For
example
---
import std.algorithm;
import std.range;
import std.stdio;
void main() {
string s =
hi,
is there any way to get the index for an element when iteration
using each!(x)?
I know I can do this using foreach statement, but I prefer using
the each template.
---
string s = "hello";
foreach(i, c; s) {
}
--
how can I get to ?
Thanks!
binghoo dang
On Thursday, 11 June 2020 at 06:13:59 UTC, adnan338 wrote:
On Thursday, 11 June 2020 at 06:05:09 UTC, adnan338 wrote:
I would like to set a callback for the `download()` function
but I do not seem to find a way to add a callback to the
procedure.
[...]
I have also been told that Gtk is not
On Friday, 24 April 2020 at 13:45:22 UTC, Phrozen wrote:
I'm too new to DLang and I have a lot to learn. Probably that's
why I have a lot of difficulties. Has anyone tried using a GUI
library to the latest DMD 2.090 or DMD 2.091? I plan to use
this language for a specific Thermal calculator
On Sunday, 15 March 2020 at 17:58:58 UTC, Steven Schveighoffer
wrote:
I want to try and learn how to write 2d games. I'd prefer to do
it with D.
I've found a ton of tutorials on learning 2d gaming with other
languages. Is there a place to look that uses D for learning?
Should I just start
On Monday, 2 March 2020 at 17:45:26 UTC, Severin Teona wrote:
Hello,
I am working on a project that uses a Raspberry Pi (armv7l) and
the latest LDC version I found for this architecture is 1.13.0.
Can you help me install the latest version(1.20.0)?
Also, I'm having problems using the DPP
On Sunday, 3 November 2019 at 05:46:53 UTC, 9il wrote:
On Thursday, 31 October 2019 at 03:56:56 UTC, lili wrote:
Hi:
why writeln need GC?
See also Mir's @nogc formatting module
https://github.com/libmir/mir-runtime/blob/master/source/mir/format.d
hi, is mir right now fully implemented
On Saturday, 9 November 2019 at 22:46:16 UTC, kinke wrote:
druntime depends on OS, architecture and coupled C runtime -
what OS are you going to target?
thank you all first! I just made a basic mistake and didn't
realized that druntime is just libraries and onlymatter when
linking the final
On Friday, 8 November 2019 at 13:52:18 UTC, kinke wrote:
On Friday, 8 November 2019 at 10:40:15 UTC, dangbinghoo wrote:
hi,
I'm not sure what you are trying to achieve; you can easily
cross-compile druntime & Phobos with LDC, see
https://wiki.dlang.org/Building_LDC_runtime_libraries.
hmm,
hi,
is the runtime d code implemented purely with betterC?
i was thinking that what's happening when we building ARM dlang
compiler, when the dlang compiler ready in the first, there's no
ARM version of the runtime lib and phobos, so, it's likely we are
using bare metal D and trying to build
hi there,
Does anyone know what's D's status for ESP32?
I just getting started a few days programming with ESP32, and
found the official esp-idf SDK even get CPP enabled by default,
and this makes the HelloWorld app used 160KB of flash. What I
want to talk is that ESP32 might be a powerful
On Thursday, 20 June 2019 at 16:55:01 UTC, Jonathan Marler wrote:
On Thursday, 20 June 2019 at 06:20:17 UTC, dangbinghoo wrote:
[...]
rdmd adds a few different features as well, but the bigger
thing it does is cache the results in a global temporary
directory. So If you run rdmd on the
On Wednesday, 19 June 2019 at 11:19:17 UTC, Marco de Wild wrote:
On Wednesday, 19 June 2019 at 08:29:15 UTC, dangbinghoo wrote:
hi there,
Does anyone know the micro-service oriented design library or
framework in D?
thanks!
binghoo dang
What do you need from such a library?
Some
hi there,
a funny thing:
$ cat rgcc
#!/bin/sh
cf=$@
mycf=__`echo $cf|xargs basename`
cat $cf | sed '1d' > ${mycf}
gcc ${mycf} -o a.out
rm ${mycf}
./a.out
$ cat test.c
#!/home/user/rgcc
#include
int main()
{
printf("hello\n");
}
hi there,
Does anyone know the micro-service oriented design library or
framework in D?
thanks!
binghoo dang
On Tuesday, 11 June 2019 at 10:24:05 UTC, KnightMare wrote:
On Tuesday, 11 June 2019 at 08:05:31 UTC, dangbinghoo wrote:
I think that D compiler needs -nogc switch to fully disable gc
for a project,
LDC -nogc?
thanks for help. It's a shame that I didn't look in details of
the LCD help
On Tuesday, 11 June 2019 at 12:40:39 UTC, Adam D. Ruppe wrote:
On Tuesday, 11 June 2019 at 08:59:01 UTC, dangbinghoo wrote:
We need to make sure we use only @nogc API when writing code,
not when running the app.
That's what the @nogc annotation does, statically forces you to
only use other
On Tuesday, 11 June 2019 at 08:16:31 UTC, Basile B. wrote:
On Tuesday, 11 June 2019 at 08:08:14 UTC, Basile B. wrote:
you can do this with a druntime switch or by calling GC.disable
in your main()
the druntime switch is "--DRT-gc=gc:manual". You pass it the
compiled program after its own
hi there,
I think that D compiler needs -nogc switch to fully disable gc
for a project, and document of phobos also needs a friendly way
to list-out all @nogc API.
we already have -betterC, and betterC disabled GC, why we could
not have a standalone option for doing this?
binghoo
change gwlib buildtype to sourceLibrary solves the problem, but
it should work for static or shared library.
On Wednesday, 29 May 2019 at 05:04:54 UTC, dangbinghoo wrote:
On Wednesday, 29 May 2019 at 02:42:23 UTC, Adam D. Ruppe wrote:
Object.factory is pretty unreliable and has few supporters
among the developers. I wouldn't suggest relying on it and
instead building your own factory functions.
oh,
On Wednesday, 29 May 2019 at 02:42:23 UTC, Adam D. Ruppe wrote:
Object.factory is pretty unreliable and has few supporters
among the developers. I wouldn't suggest relying on it and
instead building your own factory functions.
oh, that's bad news, but the hibernated library is using this
On Tuesday, 28 May 2019 at 14:24:30 UTC, dangbinghoo wrote:
On Tuesday, 28 May 2019 at 14:16:44 UTC, Nick Treleaven wrote:
On Tuesday, 28 May 2019 at 09:25:51 UTC, dangbinghoo wrote:
yeah, I made a typo mistake in the forum post, but the code in
github repo is really with no typo problem.
On Tuesday, 28 May 2019 at 14:16:44 UTC, Nick Treleaven wrote:
On Tuesday, 28 May 2019 at 09:25:51 UTC, dangbinghoo wrote:
class NSconf
{
String name;
...
}
Does this class have a non-default constructor?
yes, I didn't provide constructor, as Class will have a
hi there,
I have a set of DB entity class in a library and creating Object
from another project which linked with the library returns Null.
I don't know what's wrong there.
the source is like this:
a. I have a library with such a structure:
gwlib/source/gwlib/entity/nsconf.d
On Monday, 27 May 2019 at 15:29:32 UTC, Daniel Kozak wrote:
On Monday, 27 May 2019 at 15:13:00 UTC, dangbinghoo wrote:
hello,
1.)
Yes this is by design. It is not easy to detect this at compile
time.
It does not break safety
2.)
https://dlang.org/spec/function.html#function-safety
hello,
code below:
-
class a {
string a1;
}
a a1;
writeln(a1.a1);
-
compiles and produce "core dump" or "segfault", does this fit the
original D design? why the compiler does not detect for accessing
a null object and refused to compile?
And, 2nd
On Friday, 26 April 2019 at 08:10:33 UTC, Bastiaan Veelo wrote:
std.experimental has been already moved to std.
Are you sure about that?
https://github.com/dlang/phobos/tree/master/std
I think you are confusing the package std.experimental.all that
moved to std. It means you can now import
On Thursday, 25 April 2019 at 10:33:00 UTC, Vladimirs Nordholm
wrote:
Hello.
Is there a current "Best Practices" for logging in D?
For the actual logging, I know of `std.experimental.logger`.
However, the `experimental` has kept me away from it.
Is it good, or are there any better
On Monday, 22 April 2019 at 15:50:11 UTC, dangbinghoo wrote:
On Monday, 22 April 2019 at 13:10:45 UTC, Adam D. Ruppe wrote:
On Monday, 22 April 2019 at 11:04:49 UTC, dangbinghoo wrote:
alias ifr_ifrn.ifrn_nameifr_name; /* interface name */
So, how to do alias for a C
On Monday, 22 April 2019 at 15:45:52 UTC, Arun Chandrasekaran
wrote:
On Monday, 22 April 2019 at 11:04:49 UTC, dangbinghoo wrote:
hi all,
as now we don't have the net/if.h binding, I need to do struct
ifreq binding myself, here's my code:
[...]
Looks like we both were working on the same
On Monday, 22 April 2019 at 13:10:45 UTC, Adam D. Ruppe wrote:
On Monday, 22 April 2019 at 11:04:49 UTC, dangbinghoo wrote:
alias ifr_ifrn.ifrn_nameifr_name; /* interface name */
So, how to do alias for a C struct member?
D doesn't support this kind of alias. There's two
hi all,
as now we don't have the net/if.h binding, I need to do struct
ifreq binding myself, here's my code:
struct ifreq {
private union ifr_ifrn {
byte[IFNAMSIZ] ifrn_name; /* if name, e.g. "en0" */
}
private union ifr_ifru {
On Sunday, 6 May 2018 at 11:18:17 UTC, drug wrote:
On 06.05.2018 06:10, Binghoo Dang wrote:
hi,
I'm a Chinese, and I just have done the test. I also copied
some Japanese text from Dlang twitter channel and added some
Chinese wide punctuation Char.
And It's all seems displayed correctly.
On Thursday, 22 November 2018 at 09:03:19 UTC, Gary Willoughby
wrote:
On Monday, 19 November 2018 at 06:46:55 UTC, dangbinghoo wrote:
So, can you experts give a more comprehensive compare with
perl6 and D?
Sure!
1). You can actually read and understand D code.
^_^, yeah, you're right.
D
hi,
What if D compared with the latest perl6? well, I know that perl6
is a VM targeted language. so which has the greater
modeling-power? And perl6 seems is selling for Concurrency[1],
but I think D will do this far better than a VM targeted
language, right?
with the pre-released version
On Saturday, 20 October 2018 at 15:40:07 UTC, karis njiru wrote:
Hi. Am a computer science student from Kenya and decided to use
D for my class project on Principles of Programming Languages.
Am having a lot of fun with D but have come across an issue. I
have been using Visual D for the past 2
On Friday, 19 October 2018 at 09:08:32 UTC, Vijay Nayar wrote:
Technically the code you have is syntactically correct. You
are permitted to create a class variable without assigning it
to a class object. (Assigning it to a class object would look
like "A a = new A();")
Which section of The
hi,
why the code bellow compiles?
---
import std.stdio;
class A {
int m;
}
void main() {
A a;
a.m = 1;
}
---
and running this code get:
`segmentation fault (core dumped) ./test`
I consider this couldn't be compiled according to book Programming Language>.
The latest dmd
On Thursday, 18 October 2018 at 05:59:36 UTC, rikki cattermole
wrote:
On 18/10/2018 6:38 PM, dangbinghoo wrote:
hi,
Is there any other documents related about ddoc usage? the
only thing I can find is:
https://dlang.org/spec/ddoc.html#using_ddoc_to_generate_examples
But I found it never
hi,
Is there any other documents related about ddoc usage? the only
thing I can find is:
https://dlang.org/spec/ddoc.html#using_ddoc_to_generate_examples
But I found it never mentioned something like $(LI a list item),
is there a full ddoc document available?
And, is there any info
On Wednesday, 26 September 2018 at 05:24:08 UTC, Radu wrote:
On Wednesday, 26 September 2018 at 03:46:21 UTC, dangbinghoo
wrote:
hi,
https://github.com/adamgreig/stm32-rs looks great, is there
something like this in Dlang?
thanks!
---
dangbinghoo
You might take a look at
hi,
https://github.com/adamgreig/stm32-rs looks great, is there
something like this in Dlang?
thanks!
---
dangbinghoo
On Thursday, 20 September 2018 at 10:51:52 UTC, braboar wrote:
I am going to play with serial port read/write, so I fetched
serial-port. After that, I wrote simple program:
auto port_name = "/dev/ttyUSB1";
auto reader = new SerialPort(port_name);
reader.dataBits(DataBits.data8);
On Friday, 14 September 2018 at 17:34:59 UTC, Mike Wey wrote:
You will also have to pass `--build=plain` to dub because of a
optlink bug.
https://issues.dlang.org/show_bug.cgi?id=15418
thanks Mike,
I tried using `--build-plain`, optlink didn't report out of
memory, but it hangs !
```
On Wednesday, 12 September 2018 at 15:13:36 UTC, Timoses wrote:
try `dub --build-mode=singleFile` ? I believe this will compile
each file and then link them together (instead of compiling it
all together what dub does, afaik).
There's been another topic on memory consumption of compilation
hi ,
When compiling gtkd using dub, dmd32 reported "Out for memory"
and exit.
OS: Windows 7 32bit.
RAM : 3GB
DMD version: v2.0.82.0 32bit.
No VC or Windows SDK installed, when setting up dmd, I selected
install vc2010 and use mingw lib.
On Thursday, 29 March 2018 at 09:16:11 UTC, dangbinghoo wrote:
On Thursday, 29 March 2018 at 09:13:27 UTC, dangbinghoo wrote:
On Thursday, 29 March 2018 at 09:02:16 UTC, Nicholas Wilson
wrote:
On Thursday, 29 March 2018 at 08:47:50 UTC, dangbinghoo wrote:
[...]
try
[...]
thanks for
On Thursday, 29 March 2018 at 09:13:27 UTC, dangbinghoo wrote:
On Thursday, 29 March 2018 at 09:02:16 UTC, Nicholas Wilson
wrote:
On Thursday, 29 March 2018 at 08:47:50 UTC, dangbinghoo wrote:
[...]
try
[...]
thanks for your reply, but it will also fail, the compiler just
gives me :
On Thursday, 29 March 2018 at 09:02:16 UTC, Nicholas Wilson wrote:
On Thursday, 29 March 2018 at 08:47:50 UTC, dangbinghoo wrote:
* #define SPI_MSGSIZE(N) \
N)*(sizeof (struct spi_ioc_transfer))) < (1 <<
_IOC_SIZEBITS)) \
? ((N)*(sizeof (struct spi_ioc_transfer))) : 0)
On Thursday, 29 March 2018 at 08:47:50 UTC, dangbinghoo wrote:
hi,
I'm doing a D binding myself to , and has
some problems to wrap the C macros.
[...]
PS: if I just _IOW!(char[])... it compiles, but does it mean it's
unsafe? thanks!
hi,
I'm doing a D binding myself to , and has
some problems to wrap the C macros.
```
import core.sys.posix.sys.ioctl;
...
/* IOCTL commands */
enum SPI_IOC_MAGIC = 'k';
/**
* Orginal C macros.
*
* #define SPI_MSGSIZE(N) \
N)*(sizeof (struct spi_ioc_transfer))) < (1 <<
hi there,
I just flased a armbain for nanoPi M3.
And, I just installed ldc2-1.2.0 armhf using apt-get. it compiles
d code with combination with gcc armhf and compiled program runs
great even the arch is aarch64.
But I realized that ldc2 is too old, I know that latest ldc2 is
1.8.0.
So,
80 matches
Mail list logo