I wrote up a thing in my blog about what I'd like to see from
dips and the steering of the language and there might be some
overlap with your vision document concepts:
http://dpldocs.info/this-week-in-d/Blog.Posted_2022_06_20.html
On Saturday, 18 June 2022 at 23:00:36 UTC, solidstate1991 wrote:
This is going to be a long match.
you might consider using another exisitng lib. my simpledisplay.d
does all this and much more for example
On Saturday, 4 June 2022 at 22:31:38 UTC, Ola Fosheim Grøstad
wrote:
So what do you have to do to avoid having Errors thrown? How do
you make your task/handler fault tolerant in 100% @safe code?
Run it in a separate process with minimum shared memory.
On Saturday, 4 June 2022 at 13:44:06 UTC, Alain De Vos wrote:
What happened to Deimos and why ?
Nothing, it does its job same as it always has.
On Tuesday, 24 May 2022 at 22:46:55 UTC, Andrey Zherikov wrote:
return S(s);
return S(s.dup);
The variadic lives in a temporary array that expires at the end
of the function. So copying it out to the GC lets it live on.
Your code was wrong on 2.099 too, but the compiler didn't
On Tuesday, 24 May 2022 at 18:54:33 UTC, frame wrote:
Usually that works fine as shown in module A but for some
reason not in module B.
Do you have some other definition of fun somewhere?
On Tuesday, 24 May 2022 at 14:11:57 UTC, Steven Schveighoffer
wrote:
Note it has no idea what the real object type is at this point,
just that it is an Object (which does not have a @nogc
destructor).
It actually has nothing to do with Object. It doesn't have a
destructor at all, so there's
On Thursday, 19 May 2022 at 21:41:50 UTC, Marcone wrote:
Are you using the `-L/entry:mainCRTStartup` or the
`L/entry:wmainCRTStartup` ?
-L/entry:mainCRTStartup
try the w one too. both doing the same result?
On Monday, 9 May 2022 at 19:20:27 UTC, Andrea Fontana wrote:
Thank you. Looking forward to getting feedback, bug reports and
help :)
BTW I'm curious, what made you not want to use my cgi.d which has
similar capabilities?
On Sunday, 8 May 2022 at 22:09:37 UTC, Ali Çehreli wrote:
That effectively uses multiple GCs. I always suspected that
approach would provide better latency.
My cgi.d has used some fork approaches for a very long time since
it is a very simple way to spread this out, it works quite well.
On Saturday, 7 May 2022 at 22:07:58 UTC, Iain Buclaw wrote:
I expect it only to increase as more of the old opaque
compiler-library interface is replaced with a templated
interface that exposes the guts of what each helper does (for
improved run-time performance, of course).
Well, I'm pretty
On Tuesday, 26 April 2022 at 18:31:49 UTC, H. S. Teoh wrote:
maybe look at Adam Ruppe's arsd library
(https://github.com/adamdruppe/arsd) for some lightweight
modules that read common image formats and do some primitive
image manipulations.
I don't actually have an image to image blit
On Tuesday, 26 April 2022 at 23:00:57 UTC, cc wrote:
If your draw code doesn't depend on any scoped state you can
use `function()` instead of `delegate()` to save a GC call.
`scope delegate` also works here and just reuses the stack.
On Saturday, 16 April 2022 at 20:41:25 UTC, WhatMeWorry wrote:
Is virtual memory entering into the equation?
Probably. Memory allocated doesn't physically exist until written
to a lot of the time.
On Saturday, 16 April 2022 at 14:29:09 UTC, Pierce Ng wrote:
```
pub const FRAMEBUFFER: *allowzero volatile [16320]u8 =
@intToPtr(*allowzero volatile [16320]u8, 0);
pub const TILES : *[8192]u8 = @intToPtr(*[8192]u8, 0x4000);
pub const SPRITES : *[8192]u8 = @intToPtr(*[8192]u8, 0x6000);
```
I
On Sunday, 3 April 2022 at 16:58:03 UTC, JG wrote:
Hi,
I have an png image that I generate (via pdf via pdflatex) that
I want to scale and display in a widget. Is this possible via
something in arsd? I tried resizeImage but that doesn't seem to
do what I expect. Any suggestions?
Which
In fact, using a pragma now, I think I got it so you don't even
need the manifest now (the pragma includes a default one now).
Only works when doing dmd -m32mscoff or dmd -m64 builds (which
are also what dub uses fyi), will NOT work with a default dmd
no-switch build.
oooh it actually is even easier than I thought, just a changed
flag plus the manifest.
Just pushed to minigui master. only ended up being 4 lines for
this little thing.
Try rebuilding with that AND be sure to use the manifest file
too, same as dwt. Then you should be able to find some joy.
On Monday, 28 March 2022 at 21:10:47 UTC, Sai wrote:
FWIW, DWT which uses native controls on windows can show
transparent pngs and also both image & text at the same time.
However I had to add the following app.exe.manifest
Yeah, this tells me they used owner-drawn buttons, which is only
On Monday, 28 March 2022 at 17:00:42 UTC, sai wrote:
1. I assume arsd-minigui library does not support transparent
images by itself, does it? I am trying to show a png image with
transparent areas on a button, but those transparent areas
shows as black color.
Well, I tried forwarding the
On Monday, 28 March 2022 at 17:00:42 UTC, sai wrote:
1. I assume arsd-minigui library does not support transparent
images by itself, does it? I am trying to show a png image with
transparent areas on a button, but those transparent areas
shows as black color.
I added that to simpledisplay
On Friday, 18 March 2022 at 21:54:55 UTC, WhatMeWorry wrote:
Isn't ulong an integer? And isn't memory addresses 64 bits long?
Only if you are doing a 64 bit build. Try using -m64
On Friday, 18 March 2022 at 18:21:46 UTC, Anonymouse wrote:
I use UDAs extensively in my project and I've historically been
doing the multiple-UDA approach you describe. Upon seeing
argparse a few months back I started rewriting it to use a
single UDA, and I found it allowed for a simpler
On Thursday, 17 March 2022 at 00:16:39 UTC, Mike Parker wrote:
On Wednesday, 16 March 2022 at 07:27:06 UTC, test wrote:
```c
struct Test {
int32_t a;
}
struct Test2 {
int32_t a;
Test arr[];
}
```
I need static const init Test2, then pass it to c library
late(third library, can not
On Monday, 24 January 2022 at 22:45:14 UTC, Ali Çehreli wrote:
I am not aware of any association between "alpha" and "man"
because I hear both "alpha male" and "alpha female" in e.g.
nature documentaries.
It isn't really accurate in nature either and when used with
people it tends to be
On Sunday, 23 January 2022 at 15:35:17 UTC, Paul Backus wrote:
The main benefit of having multiple versions available in
separate namespaces is that it allows them to coexist in the
same project, which means that users can migrate their code
incrementally from one to the other.
Yeah, I know
On Sunday, 23 January 2022 at 14:33:26 UTC, Paul Backus wrote:
Absolutely-no-breakage-ever is basically the C++ approach, and
I have already explained why I think it's a bad idea, though I
recognize that reasonable people can disagree on this point.
My view is it isn't worth shipping mixed
You can't forward to a local variable. Local variables will be a
copy of the tuple. forward only actually works if sent *directly*
to another function call.
There's a bunch of things in D that only work in function
parameter lists and not local variables. This is one of them.
On Thursday, 20 January 2022 at 00:55:33 UTC, Jack Stouffer wrote:
static foreach(member; __traits(allMembers,
Manager))
member here is a string, not the member. I prefer to call it
memberName.
Then you __traits(getMember, Manager, memberName) to actually get
the alias you can
On Tuesday, 28 December 2021 at 00:13:13 UTC, data pulverizer
wrote:
There are various requirements, sometimes I have to cast or
type convert, so I **need** the type to paste correctly and
explicitly.
You almost never actually need types as strings. I'm almost
certain there's a better way
On Monday, 27 December 2021 at 21:21:30 UTC, data pulverizer
wrote:
alias T = MyType!(INTEGER);
What is MyType?
enum code = "writeln(\"instance: \", adder(" ~
T.stringof ~ "(), " ~ U.stringof ~ "()" ~ "));";
And why is this a string mixin instead of a plain simple
On Monday, 27 December 2021 at 21:05:51 UTC, data pulverizer
wrote:
adder(MyType!MyEnum.INTEGER(), MyType!MyEnum.STRING());
The rule for !(args) is of you leave the parenthesis off, it only
uses the next single token as the argument. So it will never
include a dot; it is like you wrote
On Sunday, 26 December 2021 at 20:50:39 UTC, rempas wrote:
I want to do this without using any library by using the
"write" system call directly with 64-bit Linux.
write just transfers a sequence of bytes. It doesn't know nor
care what they represent - that's for the receiving end to figure
On Wednesday, 15 December 2021 at 22:24:42 UTC, H. S. Teoh wrote:
`__gshared` is needed to coax the compiler into making the
variable global in the C/C++ sense, i.e., only 1 instance
across all threads.
it is just normally __gshared implies static automatically. it
does in like every other
On Sunday, 12 December 2021 at 22:01:57 UTC, Martin Nowak wrote:
http://dlang.org/changelog/2.098.1.html
404'd!
On Saturday, 11 December 2021 at 23:17:17 UTC, Stanislav Blinov
wrote:
? No. If it was unsatisfied constraint, the error would've
shown that.
And if you try to instantiate it, you'll see it is an unsatisfied
constraint anyway. There's two layers of failure here.
Using Unqual there is pretty
On Saturday, 11 December 2021 at 22:50:45 UTC, apz28 wrote:
void foo2(T)(Unqual!T x) if(isUnsigned!T) {}
This means it treats foo2 as if it doesn't exist unless T is
unsigned...
onlineapp.d(15): Error: template `onlineapp.foo2` cannot deduce
function from argument types `!()(int)`
On Wednesday, 8 December 2021 at 23:43:48 UTC, Salih Dincer wrote:
Is this not a contradiction? : and 3.1415 aren't string:
```d
void foo(string...)(string args) {
`string...` there is a user-defined identifier representing a mix
of types.
string isn't special, yo can declare your own
On Friday, 19 November 2021 at 20:51:09 UTC, BoQsc wrote:
But the source file overwhelmed me by its size.
Yeah, the getch function in there builds on the rest of the
events the library offers, so it won't be that useful outside.
The OS functions for getch alone though are actually pretty
On Tuesday, 16 November 2021 at 03:41:31 UTC, Ben Jones wrote:
I'm trying to use Adam's simpledisplay on a mac with XQuartz
which is installed + running. When I try to create a window,
it crashes when calling `XDisplayConnection.get()`.
Hmm, I have never actually seen that fail since the mac
On Saturday, 13 November 2021 at 22:52:55 UTC, pascal111 wrote:
When I'm searching for "toUpper" and "toLower" functions that
string type uses
They are usable though `import std.string;` the docs just don't
do a great job showing that.
The newest test version of my doc generator does
On Saturday, 6 November 2021 at 19:45:49 UTC, Chris Bare wrote:
dbForeignKey!(Position)
static if(is(T == dbForeignKey!Arg, Arg)) {
// use Arg here
}
On Sunday, 17 October 2021 at 23:07:15 UTC, Elmar wrote:
Do you have a link for more information how to initialize the D
runtime?
Export a function that calls this:
http://druntime.dpldocs.info/core.runtime.Runtime.initialize.html
And also export a function that calls this:
On Sunday, 10 October 2021 at 23:11:56 UTC, Walter Bright wrote:
ImportC resolves a long standing serious issue where multiple
other substantial attempts at solving it have fallen short over
the years.
Why have the other approaches fallen short? How does importC
address these problems?
On Sunday, 10 October 2021 at 13:52:57 UTC, Elmar wrote:
The language subset "BetterC" is required for calling D
functions from C though.
This is false.
You can use any D features when calling it from C, you just need
to provide an init and term function that is called from C that
runtime
On Friday, 8 October 2021 at 22:16:16 UTC, Matheus wrote:
Adam beyond the continuation... we need a new and simply Web
Browser written in D. :)
You know back in 2013ish I actually was doing a little one.
htmlwidget.d in my github repo. It always sucked but it is
tempting to go back to it;
On Sunday, 3 October 2021 at 22:21:45 UTC, Tim wrote:
-gc DMD2 compiler switch
tried plain -g ?
-gc is a compatibility debug thing for things with zero D
support. p oboslete now
On Saturday, 2 October 2021 at 22:07:23 UTC, Ferhat Kurtulmuş
wrote:
The below code works as expected on https://run.dlang.io/, but
not on my computer. And I don't know why?
You used .stringof. That's undefined behavior. Never use
stringof. (except for debugging writes)
Now, I'd actually
On Tuesday, 28 September 2021 at 22:56:17 UTC, Tim wrote:
I'm doing the following:
int[25] window = 0;
Note that this array has a fixed size.
window = someInteger ~ window[].dropBackOne;
Here the window[] takes a variable-length slice of it. Turning it
from int[25] into plain int[]. Then
On Monday, 20 September 2021 at 22:16:47 UTC, rjkilpatrick wrote:
auto opBinary(string op)(int rhs) const if (op == "+") {
return new Super(_a + rhs); // Creates of type Super
even when called from derived class
}
Make this
auto opBinary(string op, this This)(int rhs)
On Wednesday, 1 September 2021 at 22:23:59 UTC, user1234 wrote:
I dont know why destructors are not virtual.
https://dlang.org/spec/class.html#destructors
"There can be only one destructor per class, the destructor does
not have any parameters, and has no attributes. It is always
virtual. "
On Saturday, 17 July 2021 at 20:42:06 UTC, someone wrote:
From the interface perspective: are these signatures identical
or not ?
No, they are very different.
But you also don't gain much from const here and that ref is
probably actively harmful so i wouldn't use them here.
On Saturday, 17 July 2021 at 20:49:58 UTC, someone wrote:
ref classTickerID robjTickerID
Why are you using ref here at all?
You probably shouldn't be using it. But if it is legitimately
needed you can do a pointer instead of ref.
On Thursday, 8 July 2021 at 22:24:26 UTC, Antonio wrote:
I supossed that ```mfp(c,20)``` and ```c.mfp(20)``` should be
equivalent because UFCS in second example, but it is not... why?
UFCS only works with functions defined at top level, not nested
inside other functions. That's just how it
Jacob Carlborg Wrote:
As long as the runtime and standard library is statically linked the
executables will be bigger than the corresponding C/C++ executable.
I just want to say it's very important to me that static linking
still just works very easily even if we start to offer dynamic
Vladimir Panteleev Wrote:
This raises a question: will the D1 compiler be made
redistributable when it's discontinued?
Isn't it already licensed for redistribution by the Tango folks?
Adrian Wrote:
[OT] As a side point from a not yet D developer, but someone who looks
at the language with great interest, but also someone with a commercial
responsibility: I am missing big projects developed in D and the most
logic project would be the compiler itself! I know this has been
Alex Rønne Petersen Wrote:
I really do not see the value in allowing such syntax in the first
place. I've been told that one argument was that generated code might
use it, but I have no idea why it would be needed.
Aside from the compiler's implementation, one possible use
is something I
Jacob Carlborg Wrote:
for e in arr
# do something with the element e
Heh, I used to think that would work in regular Javascript,
since it does have a for(blah in something) form...
But in regular javascript, that only works on objects!
Marco Leise Wrote:
This is really one of the largest shortcomings of the language that can
not be explained with a simple design choice.
Aye. One of the newer versions adds a forEach member to the
array prototype, that works like this:
[1, 2, 3].forEach(function(element) { use element here;
Jacob Carlborg Wrote:
Do you have any opinion about Dart from Google?
Google's MO is generally to take something bad... and make
it /worse/.
It compiles to Javascript, but script that doesn't actually work everywhere...
Nick Sabalausky Wrote:
The only problem now is that that would rule out the possibility of
sharing code between both server and client - Which is *NOT* something I
want to give up...
What kind of code is it? The main reason for the javascript
api thing in my web.d is to help minimize the
Adam Ruppe Wrote:
Of course, it keeps the JS down to size... but doesn't actually let you
run code on the client written in D.
Unless your client is a real application, of course :P
I did a Qt app using the modules from a work web app earlier
in the year. I interfaced with Qt via a message
Do you think it'd be a good thing to put the .di file in the
generated compiled lib?
That'd be somewhat similar to the c# example.
dmd myprog.d something.dll
searches something.dll for a .di reference, and adds it to the
compile command line if it's there.
Kagamin Wrote:
well, most people here seem to use nntp clients, so their requests (like
threaded view) can be safely ignored :) they have it in their clients.
Indeed. Hell, I probably won't use it very often, since I have
my precious mutt mail client!
But, regardless, I wrote that already and
Nick Sabalausky Wrote:
a:link vs a:visited
That was my original plan, but I like having multiple
posts on one page too, and you can't link them up
that way.
Or can you? Maybe with script, I can watch the scroll position
and change the anchor as each post scrolls into view.
The anchor could be
Vladimir Panteleev Wrote:
Hmm... Now what do I do with the half-written thing I started writing two
days ago (for news and newsgroups)?
We could always combine the best parts of both of them!
Walter Bright Wrote:
It's trivial with a news reader, because unread messages are in boldface.
Which is possible because the messages are sorted linearly in the
computer!
When you do a newnews command in NNTP, you tell it a time, not
a thread. Then it grabs everything since that time, and you
Peter Alexander Wrote:
Would this encourage vandalism? If people know they can get a post on
the front page of the D website just by posting to D.announce then I
think we could see some trouble.
Meh, I say we cross that bridge when we come to it. Right now,
the D newsgroups have a pretty
Jonathan M Davis Wrote:
Knowing the parent post of a particular post can be critical to understanding
that post - especially when the parent post isn't quoted in the reply.
Yeah, that's one of the few times I hit the o-t keys in my mail
reader to sort by thread.
Keep in mind that this
bcs Wrote:
Cut the tab size by about 60% and that's usable.
OK
OTOH it will still end
up with a column size of -10 pt about the time threads get interesting.
Another fundamentally broken aspect of tree views.
And if anyone keeps more than about 3 layers of quoting you need to be
Tolstoy
Walter Bright Wrote:
If that sin isn't enough, the other problem is there is no way to mark a post
as
read.
Every linear view web forum software I've ever seen handles this
automatically.
I don't really love the implementation of most of them, but they
usually do a good enough job anyway.
You can use opDispatch to make runtime methods and properties
by having it forward to a function to do the lookup.
Something alone these lines:
DynamicObject delegate(DynamicObject[] args) dynamicFunctions;
DynamicObject opDispatch(string name, T...)(T t) {
if(name !in dynamicFunctions)
Andrea Fontana:
other http methods have nothing special
Indeed. The only thing that might get you is if the data's
content type is different than the default.
That's possible on POST too, though, so still nothing special.
My cgi library has an enum to tell you what the requestMethod is,
and it
I found std.xml useless too, so I wrote my own lib.
https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff
Grab dom.d from there. First, convert your file to UTF-8. My lib
might work for you, but it assumes utf-8 so it will throw if it actually
encounters a non-ascii
Jacob Carlborg:
Why not just cache the generated HTML and let Apache handle it.
That sounds hard... configuring Apache to do anything beyond the most
trivial of tasks is a huge pain to me.
It is easy to call cgi.setCache(true); though.
Then it doesn't even need to start the application if the
Andrei Alexandrescu wrote:
The database engine should be codified in the connection string,
not in the type name.
Why?
If it's in the type, you can trivially specialize for different
engines and get static checking for functions not supported
across them all, or runtime checking if you
The way I'd do it is:
interface Database {
// support shared functions here, and other stuff useful enough to
// warrant emulation
}
class Postgres : Database {
// implement the interface, of course, but also all other postgres
// specific stuff
}
When you go to use it, if you're
What's the big advantage of
Person.find_all_by_name_and_age(Joe, 15)
over
db.query(select * from people where name = ? and age = ?, Joe, 15);
The latter is much easier to write in the library and you retain all
the flexibility of sql itself if needed.
In my database.d, I used a database row struct to provide both
integer and key based indexes.
Sean Kelly wote:
Does your Row equate to the ResultSet above?
Fairly similar.
Mine looks something like this:
interface ResultSet {
// name for associative array to result index
int getFieldIndex(string field);
string[] fieldNames();
bool empty();
Row
Andrei wrote:
We don't kind of have a MySQL library. We just don't have one.
Actually, we have three or four. Maybe more.
There aren't any in phobos, but they are still fairly easy
to find. (Or hell to just wrap C takes less than an hour.)
Andrei wrote:
link to a few
There's mine:
https://github.com/adamdruppe/misc-stuff-including-D-programming-language-web-stuff
see database.d and mysql.d for mysql. Also some code for postgres
and sqlite in there own modules.
Piotr Szturmaj's is postgres only, but generally vastly superior
to
I hope there's no D3 for a very long time. Maybe 2020.
There's several reasons backward compatibility is important:
1) Breaking it annoys me. There's still stuff I like for new features,
so I'm not at the point where I'll never update again yet, but I
don't want my code to break more. Especially if non-trivial.
2) It splits people. Suppose you
SWIG kinda scares me... doesn't it generate wrappers instead of
direct calls into the C++? That could easily double the size
of the library.
There's a bugzilla entry with a thing to allow calling into more
of C++'s functions with extern(C++). I'd like to see that pulled
into the tree if it passes
deadalnix wrote:
This makes Javascript's and D's closures the most readable for
somebody having this background.
Indeed! I find most the proposed lambdas to look like random noise.
D has it good just how it is.
zsxxsz wrote:
I think the cgi module is lower effecient.
That's not really true. The reason CGI has a perception of being
slow is because it's used by slow languages most the time, but with
D, it's fast.
That said, if you still want to use fast cgi, just use -version=fastcgi
when compiling with
zsxxsz wrote:
The fork process is expensive for any OS.
Have you actually measured this?
I feel the cgi library is too simple, so I doubt wether it supports
fcgi for Apache, Nginx or other Webserver.
Have you actually looked at it? I've personally used it on three web
servers (IIS, Apache,
Andrei Alexandrescu wrote:
Surely you're jesting.
Partially. For the most part, the metric system is better for science,
but for day to day stuff? Poo. Lots of silly things to remember and
the numbers don't line up well to regular stuff.
Could be due to the fact that I'm more used to it, but
Andrei Alexandrescu wrote:
Well I agree to that, but allow me to note that it's only one post
away you mentioned 0 as a memorable number.
I might have been unclear - it's not so much that it's memorable,
but it has a different gut reaction.
Below zero in my gut is akin to saying it's off the
Walter Bright wrote:
I don't think that is the reason PHP is such a bear to work with.
It is one of the problems with PHP, but I'm not sure it applies
to D the same way.
Almost *every time* I write PHP, I either mess up a name or the
argument order. (Sometimes, PHP functions go src, dest, and
Walter Bright wrote:
I agree that the XML and JSON libraries need to be scrapped and rewritten.
Ugh, I actually use the std.json.
Furthermore, in order to work successfully, gofix [...]
The easiest way to do that is run the compiler. If an error occurs,
go to the given line of the problem and
Andrei Alexandrescu wrote:
What should we use? xml2?
That might be a good idea. If D modules were to get in the habit
of writing their major version numbers as part of the name, it'd solve
this as well the dget automatic library downloading thingy in one go.
Going with new and old won't work if
Jacob Carlborg wrote:
I prefer to use old_.
There's two big problems with that though:
1) It still breaks the old code. It's an even easier fix, so this isn't
too bad, but it is still broken.
2) What if a third version of a module comes along?
Jacob Carlborg wrote:
You can always keep your own local copy of a module.
Yeah, though that comes with it's own set of pains.
But, let me ask you this. Which is better?
1) Ask an unknown number of people to change their code to keep up
with your changes and/or distribute the old module
or
Andrej Mitrovic wrote:
select deprecated functionality
The problem I have is old code isn't going to change itself
to select old functions.
New code, on the other hand, can decide to use new functions
since someone is actively writing it.
Therefore, it's less painful to opt in to using new
Andrej Mitrovic:
I assume people will just pick the first thing they see
That's why the links on the left should always point to the newest
version, and there might be notes in the docs pointing people to
newer and older versions.
std.xml looks standard so they would pick that over std.xml2
Daniel Murphy wrote:
How could [moving a module to your own code] be made easier?
Actually, ironically enough, removing it from Phobos would make
it easier, since they the file can simply be copied into my own
tree without needing to rename it to avoid conflicts.
This wouldn't apply to a
Count me as another who is sick and tired of the gratuitous breaking
changes every damned month.
The worst part is there's still some new stuff I actually want each
month, so I'm not doing my usual strategy of never, ever, ever updating
software.
It's just pain. Trivial changes are easy enough
1 - 100 of 378 matches
Mail list logo