On Wednesday, 27 April 2022 at 14:34:27 UTC, rikki cattermole
wrote:
This works:
Cool, thanks.
Unfortunately, with that implementation, I need to know the
maximum size for the array. It works for that particular example,
but in the context of an XML file analysis, it's a bit awkward.
On Wednesday, 27 April 2022 at 14:27:43 UTC, Stanislav Blinov
wrote:
This is a long-standing pain point with BetterC (see
https://issues.dlang.org/show_bug.cgi?id=19268).
That's what I was afraid of... Thanks for the link to the
bug-report.
On Wednesday, 27 April 2022 at 14:27:43 UTC,
Hello,
I want to make a SAX XML parser in D that I could both use at
run-time or compile-time.
Also when I use it at compile-time, I would like to use BetterC
so I don't have to link D-runtime.
But I have some compilation problems. I use GDC (GCC 9.4.0).
Here's a reduced sample code:
```
On Tuesday, 26 April 2022 at 12:49:21 UTC, Alain De Vos wrote:
PS :
I use
```
ldc2 --gcc=cc ,
cc -v : clang version 11.0.1
```
We only have gcc in our toolchain (we target an ARM-based
embedded system).
---
I also encountered problems while I was trying to use CTFE only
functions (using
On Tuesday, 26 April 2022 at 10:29:39 UTC, Iain Buclaw wrote:
On Tuesday, 26 April 2022 at 10:23:15 UTC, Claude wrote:
Hello,
Hello,
<%--SNIP--%>
Does anyone have any idea what's going on?
(if I just compile a single D file with "int main() { int* a =
new int(42); return *a; }", it
On Tuesday, 26 April 2022 at 10:23:15 UTC, Claude wrote:
It seg-faults...
Just to make it clear, it seg-faults at run-time (not at
compilation or link time) when I launch the executable "test".
Hello,
I'm working on a C++ project requiring an XML parser. I decided
to make it in D so I could easily parse at run-time or
compile-time as I wish.
As our project uses a gcc tool-chain, I naturally use GDC (GCC
9.4.0).
But I have a few problems with D, linking with it, trying to use
On Wednesday, 27 May 2020 at 13:42:08 UTC, Andrej Mitrovic wrote:
Is the actual problem those `@trusted:` declarations at the top
of C headers?
There could be a simple solution to that:
Ban `@trusted:` and `@trusted { }` which apply to multiple
symbols. Only allow `@trusted` to apply to a
On Wednesday, 27 May 2020 at 10:51:54 UTC, Walter Bright wrote:
On 5/27/2020 3:01 AM, Timon Gehr wrote:
I've addressed exactly this a dozen times or more, to you and
others. Repeating myself has become pointless.
It's fine to disagree with me. Argue that point. But don't say
I didn't address
On Wednesday, 13 May 2020 at 14:39:13 UTC, Mike Parker wrote:
I've recently implemented some improvements centered on
bindbc-sdl.
As a user of BindBC (and former Derelict), I really enjoy using
those binding libraries. It's some great work, thanks.
On Wednesday, 5 February 2020 at 11:50:47 UTC, IGotD- wrote:
[...]
The language is used as an academic sandbox for testing
stuff by their creators. Theres no direction whatsoever.
Ignoring the lack of tools, documentation, etc
I must say that it is summarized very well. Especially
On Thursday, 4 October 2018 at 06:43:02 UTC, Gopan wrote:
Any advices?
In C, I will layout my functions like that (that's especially
good for initializer functions):
int init(struct my_handle *handle, ...)
{
if (handle == NULL)
return -EINVAL; // direct return for parameter safety
On Tuesday, 18 September 2018 at 17:20:26 UTC, Atila Neves wrote:
I was envious of std::sync::Mutex from Rust and thought: can I
use DIP1000 to make this work in D and be @safe? Turns out, yes.
Beautiful! The only current downside, is the fact the application
using that library has to be
On Monday, 10 September 2018 at 13:43:46 UTC, Joakim wrote:
Despite all this, D may never do very well on mobile or
AArch64, even though I think it's well-suited for that market.
But at the very least, you should be looking at mobile and
AArch64, as they're taking over the computing market.
On Thursday, 10 May 2018 at 23:22:02 UTC, Steven Schveighoffer
wrote:
However, I am struggling to find a use case for this that
showcases why you would want to use it. While it does work, and
works beautifully, it doesn't show any measurable difference
vs. the array allocated buffer that
On Thursday, 30 November 2017 at 09:39:20 UTC, Basile B. wrote:
On Wednesday, 29 November 2017 at 21:14:57 UTC, Claude wrote:
On Wednesday, 29 November 2017 at 14:32:54 UTC, Basile B.
wrote:
Did I miss anything?
Sorry but yes, i think so, the handle is indirectly accessible
with
On Wednesday, 29 November 2017 at 14:32:54 UTC, Basile B. wrote:
Hello, most of the changes made during the current year to the
std.experimental.logger package are related to the cosmetic
style. Isn't this a sign showing that the experimentation is
achieved ?
I tried deriving FileLogger
On Thursday, 28 September 2017 at 09:26:19 UTC, Claude wrote:
However, I did not find any SDL2-2.0.6 package for Ubuntu... :(
I built it, it works fine.
On Saturday, 23 September 2017 at 12:16:46 UTC, Mike Parker wrote:
SDL 2.0.6 was just released [1], so I've updated DerelictSDL2
[2] to support it. It's available in DerelictSDL2
3.1.0-alpha.1. I've tested that the loader works, but beyond
that I've done nothing with it.
I also fixed some
I think "betterC" can be a good tool to use D on embedded
systems, keep as few dependencies as possible, a low ROM
footprint and a good C interoperability.
I'll try to find some time to play with it.
On Wednesday, 29 March 2017 at 19:43:52 UTC, Vladimir Panteleev
wrote:
On Wednesday, 29 March 2017 at 19:32:50 UTC, Vladimir Panteleev
wrote:
On Wednesday, 29 March 2017 at 11:16:28 UTC, deadalnix wrote:
I was wondering. When uniitests aren't going to run, it may
be desirable to skip parsing
On Friday, 17 March 2017 at 06:33:38 UTC, ketmar wrote:
* pure D audio code, no external decoder libraries required
(and no SDL);
* supports FLAC, Vorbis, Opus, MP3 playback;
* various hardware sampling rates with transparent resampling
of source audio;
* multiband equalizer (the code is
1. Why your company uses D?
My company does not use D. If I had the time, I really think I
could integrate D into our build system, probably forcing it a
bit: "Oh and by the way, that new library I wrote happens to be
written in D..." (We have Vala in our build system, how worse
could it
On Wednesday, 1 February 2017 at 21:16:30 UTC, Walter Bright
wrote:
6. Valgrind isn't available on all platforms, like Windows,
embedded systems, phones (?), etc.
You can use valgrind on embedded systems as long as they run a
GNU/Linux OS. I've used valgrind successfully many times on ARM
On Tuesday, 24 January 2017 at 11:01:46 UTC, Stefan Koch wrote:
Green means it passes all tests on auto-tester.
Yes, I understood. I was playing with the idea of
eco-friendliness as well... :)
On Tuesday, 24 January 2017 at 09:52:13 UTC, Stefan Koch wrote:
NEW CTFE IS GREEN ON 64 BIT!
GREEN!
I felt first a bit surprised about that "green" thing, but
somehow if the new-ctfe engine consumes less CPU, it means it
consumes less power, and therefore less carbone dioxyde is
released
On Friday, 13 January 2017 at 15:15:14 UTC, Ignacious wrote:
On Friday, 13 January 2017 at 12:01:22 UTC, bachmeier wrote:
This is not the proper place to blog about software license
preferences or to make unsubstantiated accusations against an
organization you don't like. There are other sites
Druntime uses this for its translation of POSIX header files:
https://github.com/dlang/druntime/blob/master/src/core/sys/posix/config.d
An example:
https://github.com/dlang/druntime/blob/master/src/core/sys/posix/sys/resource.d#L96
Ok, I see. Thanks!
(I've gotta try reggae someday) :)
On Friday, 6 January 2017 at 13:27:06 UTC, Mike Parker wrote:
version(Windows)
enum bool WindowsSupported = true;
else
enum bool WindowsSupported = false;
Well, yes, that was a bad example. I thought to change it before
sending my post but I could find any other meaningful
On Thursday, 20 October 2016 at 09:58:07 UTC, Claude wrote:
I'm digging up that thread, as I want to do some multiple
conditional compilation a well.
Well I'm digging up that thread again, but to post some positive
experience feedback this time as I've found an answer to my own
questions,
1/ Carry on doing my 3D engine pet project, slowly but steadily.
2/ Small tool to automatically backup some files on an USB drive
upon insertion (with a GUI).
3/ An audio/video streaming framework (a light gstreamer). I want
to make it fast, with low memory footprint, suitable for embedded
It's strange to see "assembly language" as an entry, the target
is not specified, so I suppose it includes them all, and is more
a way of programming. It would be interesting to see which target
(x86, ARM?) are the most used.
On Friday, 25 November 2016 at 07:14:45 UTC, Patrick Schluter
wrote:
Hey, sounds suspicously similar to Ariane 5 explosion. Does ESA
not learn from its errors or am I only reading too much in it
(probably)?
Well, from the little information we have, I suppose we can only
be reading too much
Sorry, I sent my post before finishing it, so...
It's in same vein as using:
if (cond)
{
singleStatement;
}
instead of:
if (cond)
singleStatement;
Because, you can more easily insert statements within the block
(without having to navigate to different to insert the brackets).
On Friday, 25 November 2016 at 11:10:44 UTC, Timon Gehr wrote:
On 25.11.2016 11:33, Claude wrote:
...
Between "for(;;)", "while(true)" and "do while(true)", I would
use the
"while (true) { }" for pure readability and semantic reasons.
...
What semantic reasons?
In the general sense:
-
On Thursday, 24 November 2016 at 22:09:22 UTC, Dennis Ritchie
wrote:
On Thursday, 24 November 2016 at 22:04:00 UTC, LiNbO3 wrote:
As you can see [1] the `while (true)` is lowered into `for
(;true;)` so it's all about what construct pleases you the
most.
[1]
On Saturday, 13 June 2015 at 12:21:50 UTC, ketmar wrote:
On Fri, 12 Jun 2015 20:41:59 -0400, bitwise wrote:
Is there a way to compile for multiple conditions?
Tried all these:
version(One | Two){ }
version(One || Two){ }
version(One && Two){ }
version(One) | version(Two){ }
version(One) ||
On Friday, 23 September 2016 at 12:55:42 UTC, deed wrote:
// Maybe you can try using std.variant?
Thanks for your answer.
However I cannot use variants, as I have to store the components
natively in a void[] array (for cache coherency reasons).
So I found a way to solve that problem:
On Tuesday, 27 September 2016 at 08:12:58 UTC, Walter Bright
wrote:
On 9/27/2016 12:03 AM, Jacob Carlborg wrote:
You're not linking druntime.
That's one issue. The other one is druntime needs to be
initialized, and calling a random D function won't do that.
We've got to consider that when
On Thursday, 22 September 2016 at 18:26:15 UTC, Andrei
Alexandrescu wrote:
Parameters:
r | The range subject to partitioning.
Returns:
Something awesome.
This is incorrect because one is not supposed to punctuate
sentence fragments as full sentences. Next attempt:
I also prefer that
It's more a general meta-programming question than a specific D
stuff.
For an entity-component engine, I am trying to do some run-time
composition: registering a certain type (component) to a
structure (entity).
I would like to know how I can iterate an entity and get the
different type
There are a lot metal fans in here. :)
When I code, I listen most of time psychedelic 70's stuff:
- Pink Floyd
- Led Zeppelin
- Lynyrd Skynyrd
- Queen
- ACDC
- Black Sabbath
- Rammstein
- Robert Wyatt
- Renaud
Most of the time, I prefer early stuff... When band members don't
die chocking in
On Monday, 1 August 2016 at 06:21:48 UTC, Kai Nacke wrote:
Thanks! That's really awesome!
Did you manage to build more complex applications? EABI is a
bit different from the hardfloat ABI and there may be still
bugs lurking in LDC...
Unfortunately no, I didn't have the time.
I was
On Thursday, 21 July 2016 at 10:30:55 UTC, Andrea Fontana wrote:
On Thursday, 21 July 2016 at 09:59:53 UTC, Claude wrote:
I can build a "Hello world" program on ARM GNU/Linux, with
druntime and phobos.
I'll write a doc page about that.
It's a good idea :)
Done:
On Wednesday, 20 July 2016 at 16:10:48 UTC, Claude wrote:
R_ARM_TLS_IE32 used with non-TLS symbol ??
Oh, that was actually quite obvious... If I revert the first
android patch on LLVM sources, and build it back it works!
I can build a "Hello world" program on ARM GNU/Linux, with
druntime
So I'm trying to build druntime correctly, I corrected some
problems here and there, but I still cannot link with
libdruntime-ldc.a:
/opt/arm-2009q1/bin/arm-none-linux-gnueabi-gcc loire.o
lib/libdruntime-ldc.a -o loire
I get many errors like:
I think my cross-compile LDC is fine.
I tried to build this D program:
/// loire.d
int main()
{
return 42;
}
However, the run-time is not (neither is phobos), most of the
linker issues come from the druntime. So...
I wrote my own druntime. Here's the code:
/// dummyruntime.d
// from
On Friday, 15 July 2016 at 15:24:36 UTC, Kai Nacke wrote:
There is a reason why we do not distribute a binary version of
LDC with all LLVM targets enabled. LDC still uses the real
format of the host. This is different on ARM (80bit on
Linux/x86 vs. 64bit on Linux/ARM). Do not expect that
On Friday, 15 July 2016 at 15:05:53 UTC, Ilya Yaroshenko wrote:
On Friday, 15 July 2016 at 12:10:22 UTC, Claude wrote:
[...]
Yes! Finally we need the final code for LDC, it support ARM
assembler.
http://wiki.dlang.org/LDC_inline_assembly_expressions
[...]
No, I have not. Thank you for
On Friday, 15 July 2016 at 15:02:15 UTC, Radu wrote:
Hi,
LDC on Linux ARM is fairly complete. I think it is a fully
supported platform (all tests are passing). Check in
https://wiki.dlang.org/Compilers the LDC column.
This is the close for a tutorial for cross-compiling
Hello,
I would like to cross-compile a D program from a x86 machine to
an ARM target.
I work on GNU/Linux Ubuntu 64-bit.
I have an ARM gcc toolchain, which I can use to make programs on
an ARM Cortex-A9 architecture running a Linux kernel 3.4.11+.
I managed to build and install LLVM 3.8.1
On Monday, 11 July 2016 at 16:30:44 UTC, Ilya Yaroshenko wrote:
ARM contributors are wanted!
What exactly do you need for ARM architecture?
I have an ARM target and I have tried to run a library[1] to get
some CPU info.
I hacked in the source files to just build and link the CPU info
code.
Intel Core i5:
https://gist.github.com/claudemr/aa99d03360dccc65d7967651011dc8ca
On Tuesday, 5 July 2016 at 12:43:14 UTC, ketmar wrote:
On Tuesday, 5 July 2016 at 10:04:05 UTC, Claude wrote:
So here's my question: Is it normal???
yes. `ubyte` arrays by definition cannot hold pointers, so GC
doesn't bother to scan 'em.
Ah ok. I tried using void[size] static array and it
Hello,
I've been working on some kind of allocator using a dynamic array
as a memory pool. I used emplace to allocate class instances
within that array, and I was surprised to see I had to use
GC.addRange() to avoid the GC to destroy stuff referenced in that
array.
Here's a chunk of
On Monday, 27 June 2016 at 11:05:49 UTC, cym13 wrote:
What's unintuitive about it (real question)? It would make it
behave more like a standard if and early returns are very
common, well understood and good practice:
void func(int* somepointer) {
if (somepointer == null)
return;
On Saturday, 25 June 2016 at 11:27:01 UTC, cym13 wrote:
We are talking about early returns (checking for something and
returning as soon as possible) which are a well-known and
efficient
way to reduce indentation levels and increase modularity. You
can't
come and say "What? You want it to
On Friday, 24 June 2016 at 15:24:48 UTC, Andrei Alexandrescu
wrote:
Does anyone else find this annoying?
https://issues.dlang.org/show_bug.cgi?id=16201 -- Andrei
My 2 cents. I don't find that annoying at all. It's perfectly
normal IMHO.
It may introduce an additional indentation level for
On Monday, 13 June 2016 at 21:34:45 UTC, Guillaume Chatelet wrote:
Sounds good to me.
How about next Wednesday (15th) at "Bière et Malt" (4 rue
Poissonnière
in the 2nd district) at say 19:00?
In case someone else wants to join. This has been postponed to
next week. Wednesday 22nd same
On Thursday, 9 June 2016 at 17:35:32 UTC, Guillaume Chatelet
wrote:
On Thursday, 9 June 2016 at 16:27:41 UTC, Claude wrote:
On Thursday, 9 June 2016 at 09:11:05 UTC, Guillaume Chatelet
wrote:
Sounds good to me.
How about next Wednesday (15th) at "Bière et Malt" (4 rue
Poissonnière
in the 2nd
On Thursday, 9 June 2016 at 09:11:05 UTC, Guillaume Chatelet
wrote:
Sounds good to me.
How about next Wednesday (15th) at "Bière et Malt" (4 rue
Poissonnière
in the 2nd district) at say 19:00?
Ok, great!
On Wednesday, 1 June 2016 at 20:33:40 UTC, Guillaume Chatelet
wrote:
On Wednesday, 1 June 2016 at 19:25:13 UTC, Claude wrote:
On Wednesday, 18 May 2016 at 15:05:21 UTC, Guillaume Chatelet
wrote:
I got inspired by Steven's thread :)
Anyone in Paris interested in D meetups?
Sorry for the later
On Wednesday, 18 May 2016 at 15:05:21 UTC, Guillaume Chatelet
wrote:
I got inspired by Steven's thread :)
Anyone in Paris interested in D meetups?
Sorry for the later reply, but yes, I'd be interested by a meetup
in Paris. Anyone else?
On Thursday, 26 May 2016 at 20:10:57 UTC, ikod wrote:
Will it not hang in the loop if you send it SIGINT?
Looks like not, but is strange for me.
Yes, I had the same feeling the first time I came across that.
I remember why we had to use that loop in C: when we were using
gdb to do some
On Thursday, 26 May 2016 at 18:44:22 UTC, ikod wrote:
Is there any recommended workaround for this problem? Is this a
bug?
I don't think it's a bug. Even without a GC, on GNU/Linux OS, I
would enclose the receive function (or any blocking system
function like poll etc) in a do-while loop
int x;
while( scanf("%d", ), x!= 0) // until user input 0.
{
//do something with x
}
Does anybody think that this is a useful case of comma operator?
I think it's not a safe way to write code. The only time I use
comma in C (outside for loops) is when I write some clever macros
to do
On Saturday, 7 May 2016 at 06:08:01 UTC, Nicholas Wilson wrote:
In Dicebot's DConf talk he mentioned that it is possible to use
the top 16 bits for tagging pointers and the associated risks.
Regarding the GC not seeing a pointer if the top 16 bits are
used, whats to stop us from changing the
LOL. Well, every language has its quirks - especially with the
commonly used words (they probably get munged the most over
time, because they get used the most), but I've found that
French is far more consistent than English - especially when
get a grammar book that actually explains things
The same goes with French. e.g. body parts which one would
think would be obviously masculine are feminine (and vice
versa).
Funny, it's actually true. I've never figured that out... :)
In french, there are 2 specials cases about gender. "orgue"
(organ) and "amour" (love) are masculine on
"supplying import module paths manually" ? How would that even
work? Suppose you want to compile main.d separately. You'd need
to supply to the compiler an option for each module with
non-standard path, such as `xxx.foo=foo.d;xxx.bar=bar.d`, etc..
No, the command-line option could be much
On Friday, 29 April 2016 at 14:50:34 UTC, Dicebot wrote:
On 04/29/2016 05:32 PM, Bruno Medeiros wrote:
Imagine you have a module "main.d" with the line `import
xxx.foo;`, and you have a file "foo.d" with the module
declaration `module xxx.foo;`. Now imagine the files are laid
out like this:
On Wednesday, 27 April 2016 at 02:57:47 UTC, Walter Bright wrote:
To prepare for a week in Berlin, a few German phrases is all
you'll need to fit in, get around, and have a great time:
1. Ein Bier bitte!
2. Noch ein Bier bitte!
3. Wo ist der WC!
4. Ich bin ein Berliner!
That may you get
Thanks for your replies, John and Ali. I wasn't sure I was clear.
I'm going to try to see if I can fit Ali concept (totally lazy,
which is what I was looking for) within ndslices, so that I can
also use it in 3D and apply window() function to the result and
mess around with it.
Hello,
I come from the C world and try to do some procedural terrain
generation, and I thought ndslice would help me to make things
look clean, but I'm very new to those semantics and I need help.
Here's my problem: I have a C-style rough implementation of a
function drawing a disk into a
I'll do more work on my OpenGL 3D engine/game in D.
Later, I'd like to either:
1/ write a RT streaming framework (kind of like gStreamer, but
without the gLib non-sense).
or:
2/ write a baremetal OS in D and assembly towards ARMv5
compatible architecture (on Rasberry Pi maybe). Something
Bottom line is, if you are competent enough, you can be
successfull with D, just like you would be if you were using
C/C++. D's superior compile-time meta programming allows you to
express zero cost abstractions give you the edge that makes
things more enjoyable.
There are several
I tested it on linux (64-bit distro), and it segfaults as well:
-
$ echo "struct S { ushort a, b; ubyte c, d; } struct T { ushort
e; S s; }" > test.d
$ dmd -v test.d
binarydmd
version v2.069.0
config/etc/dmd.conf
parse test
importall test
importobject
I just saw this post, which is essentially the same question as
Basile Burg's. I hope that a college (in France?) is teaching D
and that this is a homework assignment. Cool stuff! :)
Maybe using templates to create properties is a bit overkill in
this example. But I could not solve what I
Hello, I'm trying to use templates to define several methods
(property setters) within a class to avoid some code duplication.
Here is an attempt:
class Camera
{
private:
Vector4 m_pos;
float m_fov, m_ratio, m_near, m_far;
bool m_matrixCalculated;
public:
void SetProperty(Tin,
Thanks Steven and Daniel for your explanations.
mixin template opAssign(alias Field) {
void opAssign(Tin)(auto ref Tin param) @property pure
@safe
{
Field = param;
m_matrixCalculated = false;
}
}
mixin opAssign!(m_pos) pos;
I
80 matches
Mail list logo