On Saturday, 16 April 2016 at 14:08:05 UTC, newB wrote:
Let's say you have decided to use D programming language. For
what kind of applications would you choose D programming
language and For what kind of applications you won't choose D
programming.
I would use D for web programming and
I'm writing currently a library, that is 100% @nogc but not
nothrow, and I slowly begin to believe that I should publish it
already, though it isn't ready yet. At least as example.
std.experimental.allocator doesn't work nicely with @nogc. for
example dispose calls destroy, that isn't @nogc.
I
On Tuesday, 5 July 2016 at 08:24:43 UTC, O/N/S wrote:
Hi ("Grüss Gott")
I like the asynchronous events in Javascript.
Is something similar possible in D?
Found Dragos Carp's asynchronous library
(https://github.com/dcarp/asynchronous).
Are there any more integrated (in Phobos/in D) ways to
On Wednesday, 6 July 2016 at 08:39:03 UTC, chmike wrote:
On Tuesday, 5 July 2016 at 20:38:53 UTC, Eugene Wissner wrote:
On Tuesday, 5 July 2016 at 08:24:43 UTC, O/N/S wrote:
Hi ("Grüss Gott")
I like the asynchronous events in Javascript.
Is something similar possible in D?
Found Dragos
On Wednesday, 6 July 2016 at 14:57:08 UTC, chmike wrote:
On Wednesday, 6 July 2016 at 11:33:53 UTC, Eugene Wissner wrote:
The only reason libev was choosen is that it is the simplest
implementation I know about. A few C files. I had an
educational purpose: I wanted to see how an event loop
I have a problem, that .stringof doesn't return what I'm
expecting. Consider the following:
template A(string T)
{
enum A : bool
{
yes = true,
}
}
void main()
{
A!"asdf" a1;
typeof(a1) a2;
mixin(typeof(a1).stringof ~ " a3;");
}
I
On Wednesday, 17 August 2016 at 12:39:18 UTC, ag0aep6g wrote:
On 08/17/2016 02:08 PM, Eugene Wissner wrote:
I have a problem, that .stringof doesn't return what I'm
expecting.
Consider the following:
template A(string T)
{
enum A : bool
{
yes = true,
}
}
void main()
{
On Saturday, 25 February 2017 at 20:02:56 UTC, ikod wrote:
On Saturday, 25 February 2017 at 19:59:29 UTC, ikod wrote:
Hello,
I have a method for range:
struct Range {
immutable(ubyte[]) _buffer;
size_t _pos;
@property void popFront() pure @safe {
enforce(_pos
On Saturday, 25 February 2017 at 20:49:51 UTC, Adam D. Ruppe
wrote:
On Saturday, 25 February 2017 at 20:40:26 UTC, Eugene Wissner
wrote:
it builds and doesn't throw if I compile with:
dmd -release
though it causes a segfault, what is probably a dmd bug.
No, that's by design. assert(0)
fullyQualifiedName doesn't work with BitFlags for example:
import std.stdio;
import std.typecons;
import std.traits;
enum Stuff
{
asdf
}
void main()
{
BitFlags!Stuff a;
typeof(a) b;
mixin(fullyQualifiedName!(typeof(a)) ~ " c;");
mixin(typeof(a).stringof
Hey,
the code bellow compiles with dmd 2.071.2, but doesn't compile
with the same command with dmd 2.072.0 beta2. Maybe someone knows
what's going wrong or whether it is a bug in 2.071.2/2.072.0 (it
is a reduced part from memutils):
app.d:
import memutils.utils;
struct HashMap(Key, Value)
On Tuesday, 10 January 2017 at 03:02:40 UTC, Elronnd wrote:
Thank you! Would you mind telling me what you changed aside
from pow() and powm()? diff isn't giving me readable results,
since there was some other stuff I trimmed out of the original
file. Also, while this is a *lot* better, I
On Sunday, 8 January 2017 at 07:52:33 UTC, Elronnd wrote:
I'm working on writing an RSA implementation, but I've run into
a roadblock generating primes. With a more than 9 bits, my
program either hangs for a long time (utilizing %100 CPU!) or
returns a composite number. With 9 or fewer bits,
On Monday, 19 December 2016 at 14:45:07 UTC, biocyberman wrote:
On Monday, 19 December 2016 at 14:18:17 UTC, Jacob Carlborg
wrote:
On 2016-12-19 13:11, biocyberman wrote:
I can write a short script to clone the remote git repo and
use it as a
submodule. But if it is possible to do with dub, it
On Wednesday, 21 December 2016 at 09:08:51 UTC, Ezneh wrote:
Hi, in one of my projects I have to get a slice from a BitArray.
I am trying to achieve that like this :
void foo(BitArray ba)
{
auto slice = ba[0..3]; // Assuming it has more than 4
elements
}
The problem is that I get an
On Wednesday, 21 December 2016 at 12:32:51 UTC, Nicholas Wilson
wrote:
On Wednesday, 21 December 2016 at 11:45:18 UTC, Eugene Wissner
wrote:
Consider we have a function that returns a struct. So for
example:
import std.stdio;
struct A {
~this() {
writeln("Destruct");
}
}
A
Consider we have a function that returns a struct. So for example:
import std.stdio;
struct A {
~this() {
writeln("Destruct");
}
}
A myFunc() {
auto a = A(), b = A();
if (false) {
return a;
}
return b;
}
void main() {
myFunc();
}
This prints 3
On Wednesday, 21 December 2016 at 17:49:22 UTC, kinke wrote:
Basic stuff such as this is appropriately tested. The named
return value optimization is enforced by D (incl. unoptimized
builds), so behavior doesn't change by this optimization. It's
you who changed the behavior by removing the if.
On Wednesday, 21 December 2016 at 14:15:06 UTC, John C wrote:
On Wednesday, 21 December 2016 at 11:45:18 UTC, Eugene Wissner
wrote:
This prints 3 times "Destruct" with dmd 0.072.1. If I remove
the if block, it prints "Destruct" only 2 times - the behavior
I'm expecting. Why?
Possibly to do
On Tuesday, 7 March 2017 at 20:15:37 UTC, XavierAP wrote:
On Tuesday, 7 March 2017 at 18:21:43 UTC, Eugene Wissner wrote:
To avoid this from the beginning, it may be better to use
allocators. You can use "make" and "dispose" from
std.experimental.allocator the same way as New/Delete.
Thanks!
On Sunday, 5 March 2017 at 20:54:06 UTC, XavierAP wrote:
I was going to name this thread "SEX!!" but then I thought
"best memory management" would get me more reads ;) Anyway now
that I have your attention...
What I want to learn (not debate) is the currently available
types, idioms etc.
On Tuesday, 7 March 2017 at 17:37:43 UTC, XavierAP wrote:
On Tuesday, 7 March 2017 at 16:51:23 UTC, Kagamin wrote:
There's nothing like that of C++.
Don't you think New/Delete from dlib.core.memory fills the
bill? for C++ style manual dynamic memory management? It looks
quite nice to me,
On Saturday, 29 July 2017 at 16:01:07 UTC, piotrekg2 wrote:
Hi,
I'm trying to port some of my c++ code which uses sse2
instructions into D. The code calls the following intrinsics:
- _mm256_loadu_si256
- _mm256_movemask_epi8
Do they have any equivalent intrinsics in D?
I'm compiling my c++
On Saturday, 29 July 2017 at 14:41:32 UTC, Kagamin wrote:
People who don't use IDE, use printf debugging.
or gdb which has several GUI-frontends if needed.
On Wednesday, 19 July 2017 at 16:00:56 UTC, Piotr Mitana wrote:
Hello, I have this code:
immutable class Base
{
this() {}
}
immutable class Derived : Base {}
void main()
{
new immutable Derived();
}
I'd like class Derived to automatically inherit the default
constructor from
On Thursday, 27 July 2017 at 14:52:18 UTC, Stefan Koch wrote:
On Thursday, 27 July 2017 at 14:30:33 UTC, Eugene Wissner wrote:
I have a multi-threaded application, whose threads normally
run forever. But I need to profile this program, so I compile
the code with -profile, send a SIGTERM and
I have a multi-threaded application, whose threads normally run
forever. But I need to profile this program, so I compile the
code with -profile, send a SIGTERM and call exit(0) from my
signal handler to exit the program. The problem is that I get the
profiling information only from the main
On Friday, 28 July 2017 at 06:32:59 UTC, Jacob Carlborg wrote:
On 2017-07-27 16:30, Eugene Wissner wrote:
I have a multi-threaded application, whose threads normally
run forever. But I need to profile this program, so I compile
the code with -profile, send a SIGTERM and call exit(0) from
my
On Sunday, 30 July 2017 at 19:22:07 UTC, Jiyan wrote:
Hey,
just wanted to know whether something like this would be
possible sowmehow:
struct S
{
int m;
int n;
this(this)
{
m = void;
n = n;
}
}
So not the whole struct is moved everytime f.e. a function is
called, but only n has to be
On Sunday, 14 May 2017 at 11:45:12 UTC, ag0aep6g wrote:
On 05/14/2017 01:40 PM, Nicholas Wilson wrote:
dynamic array literals is what I meant.
I don't follow. Can you give an example in code?
void main()
{
ubyte[] arr = [ 1, 2, 3, 4, 5 ];
assert(arr == [ 1, 2, 3, 4, 5 ]);
}
Both,
On Wednesday, 21 June 2017 at 19:39:14 UTC, timvol wrote:
Hi! I've a simple array of bytes I received using sockets. What
I want to do is to calculate the target length of the message.
So, I defined a calcLength() function for each function code
(it's the first byte in my array). My problem is
On Monday, 22 May 2017 at 13:11:15 UTC, Andrew Edwards wrote:
Sorry if this is a stupid question but it eludes me. In the
following, what is THING? What is SOME_THING?
#ifndef THING
#define THING
#endif
#ifndef SOME_THING
#define SOME_THING THING *
#endif
Is this
On Sunday, 18 June 2017 at 16:08:36 UTC, Russel Winder wrote:
I believe DMD, LDC, and GDC all have the -m32 or -m64 option to
determine the word size of compiled object and executable.
I also believe there are 32-bit and 64-bit builds of the three
compilers. Or are there?
It appears at some
On Sunday, 18 June 2017 at 17:57:28 UTC, Eugene Wissner wrote:
On Sunday, 18 June 2017 at 16:08:36 UTC, Russel Winder wrote:
I believe DMD, LDC, and GDC all have the -m32 or -m64 option
to determine the word size of compiled object and executable.
I also believe there are 32-bit and 64-bit
On Monday, 18 September 2017 at 11:47:07 UTC, Vino.B wrote:
Hi All,
Can some one explain me on the below question.
Q1: void main (Array!string args) : Why can't we use container
array in void main?
Q2: What is the difference between the below?
insert, insertBack
stableInsert,
On Monday, 18 September 2017 at 20:55:21 UTC, Sasszem wrote:
On Monday, 18 September 2017 at 20:30:20 UTC, Jerry wrote:
On Monday, 18 September 2017 at 20:26:05 UTC, Sasszem wrote:
[...]
It's called inbetween the destructors of wherever you put the
scope(exit).
import std.stdio;
struct
On Tuesday, 19 September 2017 at 17:40:20 UTC, EntangledQuanta
wrote:
writeln(x + ((_win[0] == '@') ? w/2 : 0));
writeln(x + (_win[0] == '@') ? w/2 : 0);
The first returns x + w/2 and the second returns w/2!
WTF!!! This stupid bug has caused me considerable waste of
time.
On Thursday, 24 August 2017 at 07:23:15 UTC, Timothy Foster wrote:
I've started a thread at the beginning of my program that waits
for user input:
`thread = new Thread().start;`
`static void checkInput(){
foreach (line; stdin.byLineCopy) { ... }
}`
I need to stop checking for user input
On Friday, 25 August 2017 at 05:25:09 UTC, Hasen Judy wrote:
What libraries are people using to run webservers other than
vibe.d?
Don't get me wrong I like the async-io aspect of vibe.d but I
don't like the weird template language and the fact that it
caters to mongo crowd.
I think for D
On Wednesday, 27 September 2017 at 14:23:01 UTC, Ky-Anh Huynh
wrote:
Hi,
I am from Ruby world where I can have `!` (or `?`) in method
names: `!` indicates that a method would modify its object
(`foo.upcase!` means `foo = foo.upcase`). ( I don't know if
there is any official Ruby
On Monday, 4 December 2017 at 20:14:15 UTC, Ali Çehreli wrote:
6) 'git push -force' so that your GitHub repo is up-to-date
right? (There, I mentioned "force". :) )
The right option name is --force-with-lease ).
On Sunday, 12 November 2017 at 11:01:39 UTC, Dibyendu Majumdar
wrote:
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
On Saturday, 18 November 2017 at 17:28:14 UTC, David Zhang wrote:
Hi,
Is there a way for a templated function to deduce or apply the
@safe/@nogc attributes automaticaly? I feel like I remember dmd
doing so at one point, but it doesn't appear to work anymore.
In particular, I need to call a
On Sunday, 12 November 2017 at 15:25:43 UTC, Dibyendu Majumdar
wrote:
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
On Saturday, 11 November 2017 at 14:26:34 UTC, Nordlöw wrote:
Have anybody used allocators to construct class instances?
Do you mean phobos allocators? or allocators as concept?
What is the problem?
On Sunday, 5 November 2017 at 13:43:15 UTC, user1234 wrote:
Hello, try this:
---
import std.stdio;
alias Proc = size_t function();
size_t allInnOne()
{
asm pure nothrow
{
mov RAX, 1;
ret;
nop;nop;nop;nop;nop;nop;nop;
mov RAX, 2;
ret;
}
}
On Wednesday, 1 November 2017 at 20:53:44 UTC, Dr. Assembly wrote:
Hey guys, if I were to get into dmd's source code to play a
little bit (just for fun, no commercial use at all), which
books/resources do you recommend to start out?
A few more resources on writing a frontend (lexer, syntactic
On Monday, 11 December 2017 at 20:40:09 UTC, vit wrote:
This code doesn't compile with -dip1000:
struct Foo{
int foo;
ref int bar(){
return foo;
}
}
Error: returning `this.foo` escapes a reference to parameter
`this`, perhaps annotate with `return`
How can be
On Tuesday, 15 May 2018 at 14:25:31 UTC, Dr.No wrote:
Has gdc been supported for Windows? if so, where can I find it?
I've only find Linux versions so far...
Just the same as GCC, you need mingw or cygwin to run gdc on
windows. Unfortunately GDC doesn't provide pre-built binaries
currently,
On Saturday, 18 August 2018 at 04:16:11 UTC, Sean O'Connor wrote:
What calling convention is used for assembly language in Linux
AMD64?
Normally the parameters go in fixed order into designated
registers.
import std.stdio;
// Linux AMD64
float* test(float *x,ulong y){
asm{
On Saturday, 18 August 2018 at 06:47:36 UTC, Eugene Wissner wrote:
On Saturday, 18 August 2018 at 04:16:11 UTC, Sean O'Connor
wrote:
What calling convention is used for assembly language in Linux
AMD64?
Normally the parameters go in fixed order into designated
registers.
import std.stdio;
//
On Thursday, 15 March 2018 at 19:36:10 UTC, jmh530 wrote:
I recall some talk Andrei did where he said it was a bad idea
to make the allocator part of the type. However, the container
library in dlang-community(says it is backed with
std.experimental.allocator) contains allocator as part of
On Sunday, 17 March 2019 at 07:20:47 UTC, Joel wrote:
macOS 10.13.6
dmd 2.085.0
dub 1.3.0
{
"name": "server",
"targetType": "executable",
"description": "A testing D application.",
"sourcePaths" : ["source"],
"dependencies":
{
"vibe-d" : "~>0.8.0"
}
}
On Saturday, 2 February 2019 at 16:56:45 UTC, Ron Tarrant wrote:
Hi guys,
I ran into another snag this morning while trying to implement
a singleton. I found all kinds of examples of singleton
definitions, but nothing about how to put them into practice.
Can someone show me a code example
On Saturday, 2 February 2019 at 09:58:25 UTC, XavierAP wrote:
I've heard here and there that D guarantees RVO, or is even
specified to do so...
Is it spelled out in the language specification or elsewhere? I
haven't found it.
The D spec is often not the right place to look for the
struct Container
{
}
static struct Inserter
{
private Container* container;
private this(return scope ref Container container) @trusted
{
this.container =
}
}
auto func()()
{
Container container;
return Inserter(container);
}
void main()
{
static
On Tuesday, 25 June 2019 at 11:16:47 UTC, Jonathan M Davis wrote:
On Tuesday, June 25, 2019 1:32:58 AM MDT Eugene Wissner via
Digitalmars-d- learn wrote:
struct Container
{
}
static struct Inserter
{
private Container* container;
private this(return scope ref Container container
On Tuesday, 25 June 2019 at 12:04:27 UTC, Jonathan M Davis wrote:
On Tuesday, June 25, 2019 1:32:58 AM MDT Eugene Wissner via
Digitalmars-d- learn wrote:
struct Container
{
}
static struct Inserter
{
private Container* container;
private this(return scope ref Container container
On Tuesday, 25 June 2019 at 16:51:46 UTC, Nathan S. wrote:
On Sunday, 23 June 2019 at 21:24:14 UTC, Nathan S. wrote:
https://issues.dlang.org/show_bug.cgi?id=2.
The fix for this has been accepted and is set for inclusion in
DMD 2.080.
088 :)
On Tuesday, 25 June 2019 at 07:32:58 UTC, Eugene Wissner wrote:
struct Container
{
}
static struct Inserter
{
private Container* container;
private this(return scope ref Container container) @trusted
{
this.container =
}
}
auto func()()
{
Container container;
On Thursday, 23 May 2019 at 14:50:12 UTC, Per Nordlöw wrote:
How do I specify a druntime flag such as
--DRT-gcopt=gc:precise
when running with dub as
dub run --compiler=dmd --build=unittest
?
The precise GC flag was introduced in verison 2.085.0
See:
-
On Sunday, 5 May 2019 at 08:24:29 UTC, Vladimirs Nordholm wrote:
Hello.
I have dub dependency which has a `shared static this()`.
In my project, can I run code code before the dependency's
`shared static this()`?
"Static constructors within a module are executed in the lexical
order in
On Thursday, 4 July 2019 at 10:56:50 UTC, Nick Treleaven wrote:
immutable(int[]) f() @nogc {
return [1,2];
}
onlineapp.d(2): Error: array literal in `@nogc` function
`onlineapp.f` may cause a GC allocation
This makes dynamic array literals unusable with @nogc, and adds
to GC pressure
On Wednesday, 21 August 2019 at 13:41:20 UTC, Orfeo wrote:
I've:
```
module anomalo.util;
// Foo doesn't exist anywhere!
Foo toJsJson(string type, Args...)(string id, Args args) {
static if (type == "int" || type == "outcome") {
return Json(["id" : Json(id), "type" : Json(type),
On Monday, 23 December 2019 at 15:51:17 UTC, bachmeier wrote:
On Monday, 23 December 2019 at 15:07:32 UTC, H. S. Teoh wrote:
On Sun, Dec 22, 2019 at 05:20:51PM +, BoQsc via
Digitalmars-d-learn wrote:
There are lots of editors/IDE's that support D language:
https://wiki.dlang.org/Editors
On Saturday, 13 March 2021 at 14:20:01 UTC, frame wrote:
Is there a tool to view module import graph?
The compiler verbose output shows that the module is
imported/parsed but not why. I wan't to avoid unnecessary
imports to speed up compile times or avoid issues if the module
contents are
66 matches
Mail list logo