On Tuesday, 24 November 2015 at 23:22:24 UTC, Joseph Rushton
Wakeling wrote:
On Tuesday, 24 November 2015 at 23:14:14 UTC, Joseph Rushton
Wakeling wrote:
I'm considering creating some D bindings for a C library.
I should probably clarify that I know what to do assuming I
have to write all the
On Tuesday, 17 November 2015 at 05:37:55 UTC, Domain wrote:
Thank you! Now another question: how to handle endianness?
If your file follow a file format:
the endianness should be defined there.
else it's a random text file:
either it will have a BOM with endianness,
or you will hav
On Wednesday, 11 November 2015 at 16:06:57 UTC, Jacob Carlborg
wrote:
On 2015-11-11 10:29, Daniel Kozak via Digitalmars-d-learn wrote:
I find only this one:
http://code.dlang.org/packages/derelict-cocoa
Also, there's no point in complicate the bindings by using
function pointers like this.
On Tuesday, 10 November 2015 at 20:37:00 UTC, Fyodor Ustinov
wrote:
assert(false) AKA assert(0) - is a part of this language that I
think it is absolute evil.
WBR,
Fyodor.
I would say it's a minor evil, that create problems by needing an
explanation.
At this point it has been discusse
On Tuesday, 10 November 2015 at 13:09:09 UTC, Fyodor Ustinov
wrote:
Hi!
Is it possible when using the "-release" indicate that this one
in/out/invariant/assert should not to be disabled?
WBR,
Fyodor.
Since assert(false) is special (cf.
http://p0nce.github.io/d-idioms/#assert%28false%29
On Friday, 6 November 2015 at 13:16:46 UTC, Suliman wrote:
I wrote Application in D. That use next components:
"colorize": ">=1.0.5",
"ddbc": ">=0.2.11",
"vibe-d": "~>0.7.26"
On Windows 7 it's work fine. On Windows 10 (clean install) it's
do not start and require MSVCR120.dll And I can't under
On Monday, 26 October 2015 at 21:25:58 UTC, Cleverson wrote:
Hello,
Is there any library or module for easily managing basic audio
functions, e.g., play/pause/stop a sound? I can't find it
amongst the standard library and the packages colection, or
maybe I don't know how to search properly, s
On Saturday, 24 October 2015 at 11:28:17 UTC, Sebastien Alaiwan
wrote:
Hi ponce,
Thanks for your suggestion.
I think I may have found the beginning of a solution:
class E
{
import std.traits;
void apply(this F, U)(void delegate(U e) f)
if(is(Unqual!U == E))
{
f(this);
}
int v
On Saturday, 24 October 2015 at 08:51:58 UTC, Sebastien Alaiwan
wrote:
Hi all,
I'm trying to get the following code to work.
(This code is a simplified version of some algebraic type).
Is it possible to only declare one version of the 'apply'
function?
Or should I declare the const version and
On Thursday, 1 October 2015 at 21:13:30 UTC, Marco Leise wrote:
Nice to have in Phobos. I assume you have to set the correct
control word depending on whether you perform math on the FPU
or via SSE (as is standard for x86_64)? And I assume further
that DMD always uses FPU math and other compi
On Thursday, 1 October 2015 at 11:40:28 UTC, Marco Leise wrote:
Note that the FP control word is per thread and any external
code you call or even buggy interrupt handlers could change or
reset it to defaults. Known cases include a faulty printer
driver and Delphi's runtime, which enables FP
On Tuesday, 29 September 2015 at 09:44:58 UTC, Sebastiaan Koppe
wrote:
On Tuesday, 29 September 2015 at 09:15:29 UTC, ponce wrote:
On Monday, 28 September 2015 at 16:01:54 UTC, Sebastiaan Koppe
wrote:
I could not find out which redistributable I had to install
(what version of VS did you have i
On Monday, 28 September 2015 at 16:01:54 UTC, Sebastiaan Koppe
wrote:
I could not find out which redistributable I had to install
(what version of VS did you have installed / on what version of
windows are you?). I decided to install them all, but couldn't
install the one for 2015 (due to Windo
On Monday, 28 September 2015 at 15:10:25 UTC, ponce wrote:
Does it also affect executable made with DMD and linked with MS
linker?
Just tested: no.
On Monday, 28 September 2015 at 16:01:54 UTC, Sebastiaan Koppe
wrote:
On Monday, 28 September 2015 at 15:10:25 UTC, ponce wrote:
On Tuesday, 22 September 2015 at 09:38:12 UTC, thedeemon wrote:
On Monday, 21 September 2015 at 15:00:24 UTC, ponce wrote:
All in the title.
DMD 64-bit links with t
On Tuesday, 22 September 2015 at 09:38:12 UTC, thedeemon wrote:
On Monday, 21 September 2015 at 15:00:24 UTC, ponce wrote:
All in the title.
DMD 64-bit links with the VS linker.
Do users need to install the VS redistributable libraries?
I think they don't.
Generated .exe seems to depend only
Sorry I don't know the answers but these questions are
interesting so BUMP ;)
On Friday, 25 September 2015 at 15:19:27 UTC, bitwise wrote:
1) Are the following two snippets exactly equivalent(not just
in observable behaviour)?
a)
Mutex mut;
mut.lock();
scope(exit) mut.unlock();
b)
Mutex mu
On Tuesday, 22 September 2015 at 09:38:12 UTC, thedeemon wrote:
I think they don't.
Generated .exe seems to depend only on kernel32.dll and
shell32.dll, i.e. things users already have.
Great then.
On Monday, 21 September 2015 at 18:47:10 UTC, anonymous wrote:
On Monday 21 September 2015 14:47, ponce wrote:
1. What is the minimum Windows version required by programs
created with DMD?
http://dlang.org/dmd-windows.html says: "Windows XP or later,
32 or 64 bit".
Thanks to all.
All in the title.
DMD 64-bit links with the VS linker.
Do users need to install the VS redistributable libraries?
1. What is the minimum Windows version required by programs
created with DMD?
2. What is the minimum Windows version required by programs
created with LDC?
3. What is the minimum OS X version required by programs created
with LDC?
You would believe such information would be easy to find, b
On Saturday, 19 September 2015 at 17:02:37 UTC, Russel Winder
wrote:
English and Spanish meanings of the word are very different. In
UK (not sure about Canada, USA, Australia, New Zealand, South
Africa,…) it is generally a somewhat derogatory term.
In French it means "to rub down with abrasive
On Sunday, 20 September 2015 at 17:43:01 UTC, Lambert Duijst
wrote:
Is it because:
- The GC did decide to run and cleanup memory straight after
the call to s.destroy()
- An object being in an invalid state means the program
segfaults when the object is used ?
- Another reason..
All meth
On Saturday, 19 September 2015 at 16:32:18 UTC, Russel Winder
wrote:
(*) ponce is arguably not the most positive or constructive
name to go
by.
Friend call me like this IRL since forever.
It seems to be a swear word in english?
On Saturday, 19 September 2015 at 16:25:28 UTC, Laeeth Isharc
wrote:
What is the difference between shared static this and the
global constructor ? Russell, if you use shared static this
for dmd does it work ? Laeeth.
Would like to know too. On OSX I've found that shared static
this() was
On Saturday, 19 September 2015 at 15:42:15 UTC, Russel Winder
wrote:
Hummm… I now do not get a segfault, and the code runs as
expected :
-) but the program never terminates. :-(
Where is it stuck?
Also, what would I need to cover the DMD and the GDC situations?
I don't know. :(
On Saturday, 19 September 2015 at 12:50:51 UTC, Pierre wrote:
So how can I get types without instance ?
Thanks for help.
-->8-
template AATypes(T)
{
// todo: static assert if T is no AA type here
alias ArrayElementType!(typeof(T.init.keys)) key;
alias ArrayElementType!(t
On Saturday, 19 September 2015 at 10:45:22 UTC, Russel Winder
wrote:
Calling D from Python. I have two functions in D, compiled to a
shared object on Linux using LDC (but I get same problem using
DMD).
The sequential code:
extern(C)
double sequential(const int n, const double delta) {
On Friday, 18 September 2015 at 22:54:43 UTC, Random D user wrote:
So I tried to build my project in release for the first time in
a long while. It takes like 25x longer to compile and finally
the compiler crashes. It seems to go away if I disable the
optimizer.
I get:
tym = x1d
Internal erro
On Saturday, 19 September 2015 at 01:54:08 UTC, Joel wrote:
I accidentally wiped off a small source file. I've been trying
to put it back together. Now I get unrelated errors. I've tried
resetting dub.
To reset DUB state completely:
- remove .dub/ directory in the project directory
- remove
On Saturday, 19 September 2015 at 03:53:12 UTC, Enjoys Math wrote:
I know there's fmax for floats, but what about ints?
Thanks.
http://p0nce.github.io/d-idioms/#Minimum-or-maximum-of-numbers
On Thursday, 17 September 2015 at 19:44:36 UTC, BBasile wrote:
On Thursday, 17 September 2015 at 19:36:10 UTC, BBasile wrote:
Each time I execute
`dub.exe --build=release` (or any other the build type)
DUB tries to run the project after the build.
This generates often generates an error when
On Monday, 14 September 2015 at 20:54:55 UTC, Jonathan M Davis
wrote:
So, you _can_ have low heap allocation in a C++ program, and
many people do, but from what I've seen, that really isn't the
norm across the C++ community in general.
- Jonathan M Davis
Fully agreed, C++ in the wild often
On Sunday, 13 September 2015 at 19:39:20 UTC, Ola Fosheim Grostad
wrote:
The theoretical limit for 10ms mark sweep collection on current
desktop cpus is 60 megabytes at peak performance. That means
you'll have to stay below 30 MiB in total memory use with
pointers.
30 MiB of scannable hea
On Sunday, 13 September 2015 at 17:00:30 UTC, Ola Fosheim Grøstad
wrote:
On Sunday, 13 September 2015 at 16:53:20 UTC, ponce wrote:
GC is basically ok for anything soft-realtime, where you
already spend a lot of time to go fast enough. And if you want
hard-realtime, well you wouldn't want mallo
On Sunday, 13 September 2015 at 15:35:07 UTC, Jonathan M Davis
wrote:
But the idea that your average D program is going to run into
problems with the GC while using Phobos is just plain wrong.
The folks who need to care are the rare folks who need extreme
enough performance that they can't affo
On Wednesday, 9 September 2015 at 20:17:44 UTC, cym13 wrote:
This is subtly missing the main question: isn't C++-like memory
management of D classes possible with Unique, RefCounted and
Scoped?
- Unique
C++ has move semantics which make moves explicit. D's Unique is
more like the deprecat
On Wednesday, 9 September 2015 at 19:53:55 UTC, ponce wrote:
Oops, posted by mistake.
On Wednesday, 9 September 2015 at 19:48:00 UTC, cym13 wrote:
Hi,
I know C++ and D without being a C++ or D guru (I know way
more about D though). When talking about memory management the
problem of RAII is
On Wednesday, 9 September 2015 at 19:48:00 UTC, cym13 wrote:
Hi,
I know C++ and D without being a C++ or D guru (I know way more
about D though). When talking about memory management the
problem of RAII is often mentioned along with the fact that
classes use the GC. I know well the difference
On Wednesday, 9 September 2015 at 14:36:24 UTC, Q wrote:
But if others use my code they must think about finalizing the
classes? That is very awkward.
classes, yes but structs, no.
I'll take a look at Rust and otherwise I will stick with C++.
Thanks for you answer. :)
Well, resource managem
On Wednesday, 9 September 2015 at 07:19:58 UTC, Q wrote:
Hi. I'm playing around with D for a while and I would like to
switch. But here is one thing, I need an answer for. In the
Docs is mentioned that it is not sure that the DTor of a class
is called. But what if I have struct, which holds a C
On Wednesday, 2 September 2015 at 18:31:32 UTC, spec00 wrote:
On Wednesday, 2 September 2015 at 01:07:01 UTC, Mike Parker
wrote:
To compile 64-bit programs on Windows, DMD requires the
Microsoft toolchain. The easiest thing to do is to install the
Community Edition of Visual Studio 2013 (DMD
On Wednesday, 2 September 2015 at 21:22:59 UTC, John Carter wrote:
On Wednesday, 2 September 2015 at 11:03:00 UTC, ponce wrote:
Everything Bjarne said still applies equally to D code, since
integer promotion is identical with C from what I understand.
Hmm. What Robert Elder says also applies
On Tuesday, 1 September 2015 at 23:06:50 UTC, John Carter wrote:
C/C++ discussion here
http://blog.robertelder.org/signed-or-unsigned-part-2/
D rules here...
http://dlang.org/type.html#integer-promotions
Everything Bjarne said still applies equally to D code, since
integer promoti
On Wednesday, 29 July 2015 at 09:25:50 UTC, Snape wrote:
I'm in the early stages of building a little game with OpenGL
(in D) and I just want to know the facts about the GC before I
decide to either use it or work around it. Lots of people have
said lots of things about it, but some of that inf
On Thursday, 16 July 2015 at 09:49:03 UTC, Jarl André Hübenthal
wrote:
Why?
The syntax for delegate literals with braces is
listenHTTP(settings, (req, res) {
res.writeBody("Hello, World!");
});
On Friday, 10 July 2015 at 13:54:47 UTC, Steven Schveighoffer
wrote:
On 7/10/15 9:20 AM, ponce wrote:
Example:
void process(float[] input, float[] output)
{
// do stuff
}
I'd like to sometimes have overlapping slices, and don't want
the
compiler to assume they do not o
Example:
void process(float[] input, float[] output)
{
// do stuff
}
I'd like to sometimes have overlapping slices, and don't want the
compiler to assume they do not overlap.
On Wednesday, 8 July 2015 at 05:22:34 UTC, ketmar wrote:
On Tue, 07 Jul 2015 12:33:38 +, ponce wrote:
Is this secret knowledge?
yes. ;-)
i believe that there are not so many people doing asm in D, and
many of them using "write and forget" technique (i.e. write and
don't touch if it wor
On Monday, 6 July 2015 at 08:54:48 UTC, ponce wrote:
What registers can I safely modify in asm {} blocks? Especially
XMM registers.
I can't find the information on http://dlang.org/iasm.html
Note that this question isn't for function-call boundaries but
asm{} boundaries since I do not use "na
On Sunday, 5 July 2015 at 06:53:36 UTC, Szabo Bogdan wrote:
"you don't want to crash the user app, because this will make
the user unhappy."
This type reasoning is always flawed. It's like saying that the
Earth is flat.
http://p0nce.github.io/d-idioms/#Unrecoverable-vs-recoverable-errors
What registers can I safely modify in asm {} blocks? Especially
XMM registers.
I can't find the information on http://dlang.org/iasm.html
Note that this question isn't for function-call boundaries but
asm{} boundaries since I do not use "naked;"
On Sunday, 28 June 2015 at 21:26:52 UTC, Walter Bright wrote:
On 6/28/2015 2:48 AM, ponce wrote:
I don't quite get what code could be generating that
reference, since I don't
call format or toString on a Throwable.
You can grep the .obj files for the symbol.
Thanks.
Fixed by upgrading. I th
I have a program that is almost ported from D1 to D2 but there is
still a problem with a reference to
object.Throwable.toString(scope void delegate(in string) sink);
With OPTLINK (32-bit):
Error 42: Symbol Undefined
_D6object9Throwable8toStringMxFMDFxAyaZvZv (const(void
function(scope void
On Wednesday, 13 May 2015 at 11:24:10 UTC, Kagamin wrote:
On Tuesday, 12 May 2015 at 12:53:59 UTC, ponce wrote:
I already have such a dispose() function.
The problem is that to support Unique! and scoped! and
friends, the destructor must call dispose(). Thus my need for
a way to separate the G
On Tuesday, 12 May 2015 at 12:31:35 UTC, Adam D. Ruppe wrote:
Let me suggest a completely different option: make a destructor
that works while the GC is running by managing the resources
manually in both construction and destruction.
I see, but not all ressources can be disposed by any thread.
I need a robust "isCalledByGC" function to leak intentionally
when a destructor is called as a result of the GC.
It is a way to enforce deterministic destruction without ever
relying on accidental correctness.
class A
{
~this()
{
if(iscalledByGC())
{
[leak
On Thursday, 12 February 2015 at 10:24:38 UTC, Mike Parker wrote:
On 2/12/2015 6:09 PM, weaselcat wrote:
On Thursday, 12 February 2015 at 08:33:35 UTC, Kagamin wrote:
Truth be told, D has no guideline for deterministic
destruction of
managed resources.
+1
don't complain about people wonderi
On Thursday, 12 February 2015 at 09:50:39 UTC, ketmar wrote:
On Thu, 12 Feb 2015 09:04:27 +, ponce wrote:
http://p0nce.github.io/d-idioms/#The-trouble-with-class-destructors
I've also made one for "D can't do real-time because it has a
stop-the-world GC"
http://p0nce.github.io/d-idioms/#Th
On Thursday, 12 February 2015 at 08:14:49 UTC, Mike Parker wrote:
On 2/12/2015 6:42 AM, ketmar wrote:
this problem has very easy solition: we should stop calling
class dtors
"destructors", and rename them to "finalizers".
Absolutely. So many people coming from C++ see "destructor" and
wa
On Saturday, 7 February 2015 at 22:09:03 UTC, Gan wrote:
Is there a better D graphics library in the works?
I'm using SFML(which is very easy and has lots of features) but
it seems to use a lot of ram(if you leave it running for a
while on a graphic intensive scene) and trying to make it
incl
On Thursday, 4 December 2014 at 02:01:26 UTC, Ola Fosheim Grøstad
wrote:
On Thursday, 4 December 2014 at 01:36:13 UTC, Ola Fosheim
Grøstad wrote:
So I suppose none of your threads are suspended unless you
suspend it with Thread on call_back entry? But why suspend a
@nogc thread?
What a mess o
I have a DLL written in D that gets called by two different
threads, created by a non-D host program (audio plugin). I did
not create those threads, but my understanding is that they get
"attached" to the D runtime.
Thread A is a real-time callback and should not ever block. @nogc
seems perfe
On Wednesday, 3 December 2014 at 22:53:48 UTC, ponce wrote:
I have a DLL written in D that gets called by two different
threads, created by a non-D host program (audio plugin). I did
not create those threads, but my understanding is that they get
"attached" to the D runtime.
Thread A is a rea
COn Friday, 7 November 2014 at 02:58:15 UTC, Daren Scot Wilson
wrote:
What's the current recommended way to read and write audio
files?
I don't need to play it on the speakers or deal with anything
real time - just read a file's data into an array, fiddle with
it, and write it out to a file.
On Sunday, 2 November 2014 at 12:37:13 UTC, Mike Parker wrote:
On 11/2/2014 8:59 PM, "Marc Schütz" " wrote:
On Saturday, 1 November 2014 at 21:00:54 UTC, Kagamin wrote:
D claims compatibility with system C compiler, which usually
have
32-bit int.
... and for C/C++ long which can be 32 or 64
On Saturday, 27 September 2014 at 15:45:20 UTC, Meta wrote:
Also, you might want to use This* instead of This[], unless you
want an Atom to be able to contain a whole array of other atoms.
That's indeed what I want.
On Saturday, 27 September 2014 at 14:08:18 UTC, H. S. Teoh via
Digitalmars->
What about using Atom*[] instead of Atom[]?
Atom[] seems simpler to me.
On Saturday, 27 September 2014 at 11:40:19 UTC, Rikki Cattermole
wrote:
How to get out of this trap?
Do I have to drop Algebraic and go back to manual tagged
unions?
Converting Function to a class. No where near ideal. But it'll
work.
It does work! Thanks.
Actually it's quite appropriate to
I'm dabbling with Scheme interpreter and ultimately I would need
to declare the following types.
--
struct Function
{
Environment env;
Atom params;
Atom body_;
}
// An atom is either a string, a double, a symbol, a function or
a list of atoms
alias Atom = Algebraic!(s
On Friday, 29 August 2014 at 11:23:34 UTC, Robin Schroer wrote:
I'm not entirely sure where to post, so I will put it here.
I'm playing around with D and Derelict 3 to make something with
OpenGL (don't really know what yet). I managed to open a
window, add an OpenGL context, clear the screen a
Is there a way to have cross-module inlining but with separate
compilation?
Like with link-time generation in C++ compilers.
On Saturday, 2 August 2014 at 20:38:59 UTC, David wrote:
Hi, not too sure if there's still someone reading this post,
but i do have another question. So, I heared so much good stuff
about D, it's powerfull, fast the syntax is nice, but well, why
is D actually not used for common games yet? (I m
On Wednesday, 16 July 2014 at 21:12:00 UTC, bachmeier wrote:
Have you tried them? Do they work? I couldn't get scid to work
last year. I've never heard of dstats before, but it hasn't
seen any activity in two years. I'd be surprised if it worked
with the latest release of DMD.
Can't speak for
On Tuesday, 15 July 2014 at 20:46:32 UTC, Martijn Pot wrote:
To make a long story short:
Is there any math library with e.g. mean, std, polynomial
fitting, ...?
https://github.com/kyllingstad/scid
https://github.com/dsimcha/dstats
I don't know about Windows, but on Linux, you can just press
ctrl-s and
ctrl-q to pause/resume the console. (This is a Linux terminal
function,
not specific to D.)
In the Windows shell, the "pause" key will halt a program and
"return" will resume it.
On Monday, 14 July 2014 at 18:43:36 UTC, Ali Çehreli wrote:
It is guaranteed by the language spec that yes, myFunction()
takes an A by reference. However, you can't know where that A
is coming from; so, the safety of that cast is up to you.
Consider:
void foo(A a) // <-- Already slice
On Monday, 14 July 2014 at 18:43:36 UTC, Ali Çehreli wrote:
On 07/14/2014 10:35 AM, ponce wrote:
> Ok, solved it, I just use pointer casts and it seems to work
when the
> struct is sliced.
I think there is a terminology issue here. Slicing cannot be
undone; once the object is sliced, the non-A
Ok, solved it, I just use pointer casts and it seems to work when
the struct is sliced.
On Monday, 14 July 2014 at 13:23:57 UTC, ponce wrote:
Hi,
I am porting C++ code that undo "Object Slicing" by casting
const-references:
http://en.wikipedia.org/wiki/Object_slicing
My translation in D C
Hi,
I am porting C++ code that undo "Object Slicing" by casting
const-references:
http://en.wikipedia.org/wiki/Object_slicing
My translation in D Code
struct A
{
// stuff
}
struct B
{
A a;
alias a this;
// stuff
}
void myFunction(ref const(A) a)
{
if ()
{
// here
On Thursday, 3 July 2014 at 10:15:25 UTC, pgtkda wrote:
why is this possible?
int count = 50_000_000;
int is always 4 bytes, it can contains from -2_147_483_648 to
2_147_483_647.
On Thursday, 3 July 2014 at 10:17:59 UTC, Kashyap wrote:
Hi,
Is there a source transformation for D available?
Could someone please point me to it?
If not, I'd like to work on one - I'd appreciate any pointers
on getting started. I am considering writing the whole thing in
D and not relying th
On Thursday, 3 July 2014 at 04:46:02 UTC, K.K. wrote:
Is the only thing I'm missing the .dll's?
Thanks!
Yes, everything went fine, and you find the missing DLL here:
https://www.libsdl.org/download-2.0.php
On Friday, 27 June 2014 at 12:51:45 UTC, bioinfornatics wrote:
Hi,
I have a linux network and i would like to know if they are a D
library to communicate between computer efficiently.
I do not know if that is better to use websocket and if they
exists into dlang:
-
http://planet.jboss.org/
On Thursday, 22 May 2014 at 15:39:36 UTC, David wrote:
Hey, I'm really new to D, and pretty new to programming overall
too,
But I want to make a 3d Game, (just sth. small). I really like
D and want to do it in D, but in the Internet there is no shit
about programming a game in D ^^
Is there an
On Sunday, 18 May 2014 at 07:10:29 UTC, Dmitry wrote:
Hi everyone!
I want to play video in my D-application (maybe WebM or
Theora). However didn't find any library for operation with
video in D. I am a beginner in D, experience of transfer of
libraries with C/C++, certainly isn't present.
May
86 matches
Mail list logo