Try to run clang with -v option and compare with gcc.
On Monday, 21 February 2022 at 09:04:06 UTC, bauss wrote:
Why are we even escaping them by default, it should be the
other way around, that slashes are only escaped if you ask for
it; that's how it literally is in almost every JSON library.
Really? I always see escaped slashes in JSON, e.g.
3AAF1A18E61F6FAA3B7193E4DB8C5218B9329CF8 is 0xDB8C5218B9329CF8
This shortening was supposed to improve user experience.
Isn't cross-linker enough? My regular mingw build of ld says it
supports elf64-x86-64 traget, so I assume something like this
should be enough:
ld -b elf64-x86-64 -L lib --dynamic-linker
/lib64/ld-linux-x86-64.so.2 --as-needed --gc-sections -s
lib/crt1.o lib/crti.o my.o -lc lib/crtn.o
On Monday, 27 December 2021 at 11:21:54 UTC, rempas wrote:
So should I just use UTF-8 only for Linux? What about other
operating systems? I suppose Unix-based OSs (maybe MacOS as
well if I'm lucky) work the same as well. But what about
Windows? Unfortunately I have to support this OS too with
On Monday, 27 December 2021 at 07:29:05 UTC, rempas wrote:
How can you do that? I'm trying to print the codes for them but
it doesn't work. Or you cannot choose to have this behavior and
there are only some terminals that support this?
Try it on https://en.wikipedia.org/wiki/Teletype_Model_33
D strings are plain arrays without any text-specific logic, the
element is called code unit, which has a fixed size, and the
array length specifies how many elements are in the array. This
model is most adequate for memory correctness, i.e. it shows what
takes how much memory and where it will
You can use the string type to hold non-ascii characters. Just a
substring of another string.
Unsigned integers aren't numbers.
assert(-abs(1)<0);
You can do something like
```d
enum LogSettings
{
func1,func2,func3
}
alias logger!LogSettings logf;
void func1()
{
logf(...);
}
```
Then the logger can inspect symbols in the template argument and
compare their names to the function name.
`debug(func1)writefln(...)`
But specify a global debug version for the compiler:
`dmd -debug=func1 app.d`
Actually C runtime is many megabytes in size.
On Tuesday, 12 October 2021 at 08:19:01 UTC, jfondren wrote:
and string literals weren't reliably in read-only memory as
recently as early 2017:
https://github.com/dlang/dmd/pull/6546#issuecomment-280612721
Sometimes sections have defined symbols for start and end, you
can check if the
On Sunday, 3 October 2021 at 22:22:48 UTC, rjkilpatrick wrote:
```d
import std.stdio : writeln;
import std.variant;
import std.conv;
// Arbitrary super class
class SuperClass {
this() {
}
}
// Derived class with members
class DerivedClass : SuperClass {
public:
this(float a) {
On Tuesday, 21 September 2021 at 09:37:30 UTC, Abby wrote:
Hi there,
I'm new in dlang I specially like betterC. I was hoping that d
fibers would be implemented in without using classes, but there
are not.
On windows you can use the fiber api
Yes, the `return` attribute is what should do it. You also need
to compile the code with -dip1000 option.
If you want only address, you can keep it as size_t:
ubyte[10] Arr;
immutable size_t Address;
static this() {
Address = cast(size_t)([0]);
}
Maybe you're trying to load a 32-bit library into a 64-bit
process.
On Wednesday, 18 August 2021 at 17:56:53 UTC, Ruby The Roobster
wrote:
When I removed those two lines of code, the program ran
perfectly without displaying any error or throwing any
exception...
The errors aren't always nicely located and can be elsewhere. Try
to write a minimal runnable
On Wednesday, 9 June 2021 at 19:13:10 UTC, JG wrote:
produces:
123
I would expect 0.
What is the rationale for this behaviour or is it a bug?
Processor just takes lower 6 bits for the shift amount and those
hold zero in your case, shifting by 65 will shift by 1.
https://forum.dlang.org/post/koxqrqqzadfefbgkd...@forum.dlang.org
On Friday, 16 April 2021 at 08:31:27 UTC, Imperatorn wrote:
One example would be a repl
That has little to do with what OP meant.
On Wednesday, 14 April 2021 at 20:38:16 UTC, Mario wrote:
Maybe I am just too short in D, but I wanted to find out if it
is possible to create classes dynamically. My problem is, I
just don't know where to start reading. Maybe at mixin
templates?
CreateClassWithName!("MyDynamicClassName");
class foo {
this ( foo p /* , other params */ ) {
parent = p;
}
foo create() {
return new foo(this);
}
void use() {
foo f = create();
}
foo parent;
}
On Monday, 29 March 2021 at 19:06:33 UTC, Marcone wrote:
Why can't I just use: import vibe.vibe; for import packages
like Nim or Python? Why I still use DUB?
Theoretically an rdmd-like tool can automatically infer
dependencies from imports (autodub?). But it can also easily
expose you to a
struct A
{
private int[] a;
this(int[] b){a=b;}
int[] c(){ return a; }
@disable void opAssign();
}
struct B
{
A a;
this(int){ a=new int[5]; }
int[] b(){ return a.c; }
void f(){ a=new int[5]; }
}
struct S
{
this(string s)
{
type = Type.type1;
}
this(int n)
{
type = Type.type2;
}
Type type;
int n;
}
int value(S s)()
{
static if(s.type == Type.type2) {
// do something
On Thursday, 18 March 2021 at 17:57:30 UTC, Patrick Schluter
wrote:
It's important to understand that [] is just a practical syntax
for a fat pointer.
Thinking of [] just as a fancy pointer helps imho to clarify
that the pointed to memory nature is independant of the pointer
itself.
I
I suppose commercial vendors aren't interested in suckless
paradigm, so this library is for people and only for people.
On Wednesday, 3 March 2021 at 20:54:43 UTC, Anthony Quizon wrote:
I'm having some success pulling out small bits of code from
other libraries and keeping things minimal and c-style-ish.
If you're really ok with minimalism, I'm writing such a library
https://filebin.net/7gtyh5j01gk1ofly
I
mangleof should give _D4file6addOneFiZi, not _D6patron6addOneFiZi
Add libraries that provide missing symbols.
You can make it opt in, it's insurance.
You can define a symbol that will conflict with GC and prevent
linking with it.
Try to compile in debug mode, maybe you breach some contract.
You can compare like time1 > time2 + 100.msec, though posix
specifies only second precision.
On Thursday, 10 December 2020 at 21:01:30 UTC, Marcone wrote:
In this very generic example && not work to finalize the
instruct and start a new instruct. Yes, I know dmd can build
and run without it, but this is only a example.
execute(["cmd", "/c", "dmd test.d", "&&", "start test.exe"]);
On Sunday, 29 November 2020 at 19:09:07 UTC, Mark wrote:
Looking at Ada now.
I found: Ada is not good for me. It has no augmented
assignment. It's just that I want DRY because I use very
verbose variable names
Using a reasonable naming convention should be much easier than
looking for a
Maybe Ada.
The delegate is stored on the stack of the calling thread, the
created thread loads it from there, but the calling thread
doesn't wait for that and clobbers the stack right away. If you
were lucky your code would crash.
On Saturday, 14 November 2020 at 23:30:58 UTC, Adam D. Ruppe
wrote:
On Saturday, 14 November 2020 at 23:20:55 UTC, Martin wrote:
Is this intentional?
In the current language design, yes.
It's a bug, it breaks data sharing guarantees.
On Sunday, 8 November 2020 at 10:47:34 UTC, Per Nordlöw wrote:
dchar
Surrogate pairs are used in rules because java strings are utf-16
encoded, it doesn't make much sense for other encodings.
On Thursday, 22 October 2020 at 18:24:47 UTC, Bruce Carneal wrote:
Per the wiki on termination analysis some languages with
dependent types (Agda, Coq) have built-in termination checkers.
What they do with code that does, say, a hash preimage attack?
On Tuesday, 6 October 2020 at 18:24:14 UTC, Alaindevos wrote:
A logical one. For the last one higher classes might be needed.
Also assert(5/3==1);
See
https://forum.dlang.org/post/kqvpjwbkpravywald...@forum.dlang.org
if(GetFileType(GetStdHandle(STD_OUTPUT_HANDLE))==FILE_TYPE_PIPE)setvbuf()
That said, full buffering for pipes may be not all that
profitable, so it makes sense to always set line buffering for
pipes and leave full buffering only for file.
On Tuesday, 18 August 2020 at 19:01:17 UTC, Marcone wrote:
SFX zip in it is properties: https://i.imgur.com/dH7jl5n.png
Opening with winRar: https://i.imgur.com/s7C9mZn.png
Probably winrar messing with your file manager. Try to uninstall
ungerister winrar from your file manager or try a
On Sunday, 16 August 2020 at 18:13:07 UTC, Anonymouse wrote:
Just as a drive-by comment, the main stdio thing I came across
that I couldn't do from within @safe was stdout.flush(), which
I need to call manually for Cygwin terminals and some terminals
embedded in editors (vscode). If someone
Because it's used with C `time` function
https://github.com/dlang/druntime/blob/master/src/core/stdc/time.d#L37 which is provided by msvcrt as 32-bit function. 64-bit variant has a different name.
On Monday, 27 July 2020 at 09:41:44 UTC, wjoe wrote:
But it's possible when bound with the socket option
SO_REUSEPORT (at least that's the name of the flag on linux
since 3.9).
The docs say it can't be used to hijack an address.
This option must be set on each socket (including the first
On Wednesday, 22 July 2020 at 16:14:24 UTC, wjoe wrote:
If you send a UDP datagram to a single address, however, it
will still be delivered to every program on that PC which
receives UDP datagrams from that port.
Normally binding two sockets to the same port is not allowed.
Yes, all the synchronization and casting pretty much mandates
that shared data must be behind some kind of abstraction for
better ergonomics and better correctness too.
---
import std;
shared class TimeCount {
synchronized void startClock() {
auto me = cast()this;
me.startTime = Clock.currTime;
}
synchronized void endClock() {
auto me = cast()this;
me.endTime =
---
import std;
shared class TimeCount {
void startClock() {
auto me = cast()this;
me.startTime = Clock.currTime;
}
void endClock() {
auto me = cast()this;
me.endTime = Clock.currTime;
}
void
On Monday, 13 July 2020 at 07:26:06 UTC, Arafel wrote:
That's exactly why what I propose is a way to *explicitly* tell
the compiler about it, like @system does for safety.
With __gshared you can opt out from sharing safety, then you're
back to old good C-style multithreading.
I mean runas your own program.
Well, you can elevate your own program and tell it to run that
command, collect the result and send it back through e.g. shared
memory.
You call ShellExecute with "runas" verb:
https://docs.microsoft.com/en-us/windows/win32/api/shellapi/nf-shellapi-shellexecutea
On Friday, 10 July 2020 at 17:18:25 UTC, mw wrote:
On Friday, 10 July 2020 at 08:48:38 UTC, Kagamin wrote:
On Friday, 10 July 2020 at 05:12:06 UTC, mw wrote:
looks like we still have to cast:
as of 2020, sigh.
Why not?
Because cast is ugly.
Implicitly escaping thread local data into
On Friday, 10 July 2020 at 05:12:06 UTC, mw wrote:
looks like we still have to cast:
as of 2020, sigh.
Why not?
Without contradictions the solution is trivial:
module config;
version(LogEnabled) enum isEnabled=true;
else enum isEnabled=false;
shared int level;
Contradictions that don't let you glue it all together.
If you suspect there's a contradiction in requirements, you need
to specify them with better precision.
try
https://docs.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-setunhandledexceptionfilter
You can store the delegate in an array and invoke it by index.
bson_t* bson_new_from_json(in char* data, long len, bson_error_t*
error);
string str_utf8 = "{\"a\":1}";
bson_error_t error;
auto bson = bson_new_from_json(str_utf8.ptr, str_utf8.length,
);
You have a wrong declaration for bson_error_t too.
On Monday, 29 June 2020 at 19:55:59 UTC, Steven Schveighoffer
wrote:
Yep, for sure. I'll file an issue. Anyone know why the calling
convention would differ?
It's easier to enforce left to right evaluation order this way:
arguments are pushed to stack as they are evaluated, which is
pascal
On Saturday, 27 June 2020 at 14:49:34 UTC, James Gray wrote:
I have produced something which essentially reproduces my
problem.
What is the problem? Do you have a leak or you want to know how
GC works?
On Sunday, 28 June 2020 at 07:09:53 UTC, Виталий Фадеев wrote:
I want light-weight runtime !
How to ?
Runtime provides language features that rely on extra code.
Removing that code from runtime means to give up on corresponding
language features. This way you can implement only features you
On Saturday, 27 June 2020 at 07:51:21 UTC, adnan338 wrote:
On Saturday, 27 June 2020 at 07:31:56 UTC, Kagamin wrote:
std.concurrency is for noninteractive appications, the
approach with gui timer was the correct one.
Thank you. That works but my progress bar is sometimes getting
stuck
std.concurrency is for noninteractive appications, the approach
with gui timer was the correct one.
On Friday, 26 June 2020 at 10:12:09 UTC, Jacob Carlborg wrote:
Downloading files over TLS. This seems that it's something that
should be quite simple to do. My high level goals are
cross-platform and easy distribution. I don't need anything
fancy just a simple API like this:
If you want to use them from D, you need those classes and
methods declared in the D language, in text.
Not sure how much synchronization do you want to do.
import gio.Application : GioApplication = Application;
import gtk.Application : Application;
import gtk.ApplicationWindow : ApplicationWindow;
import gtk.ProgressBar : ProgressBar;
import glib.Timeout : Timeout;
import gtkc.gtktypes :
string param="aa";
parameters[param]=Parameter();
in id=parameters[param].id;
that's
int id=parameters[param].id;
Logic is apparently still in flux, too early to document.
On Thursday, 21 May 2020 at 17:19:10 UTC, Konstantin wrote:
Hi all! I will try to ask again(previous two posts still have
no answers) : are there any site/page/docs somewhere to track
actual info about @nogc support in language itself and in
phobos library? Or, at least plans to extend such
On Monday, 18 May 2020 at 17:20:17 UTC, BoQsc wrote:
It would be great if we could change/customise the icon of the
Command line application that run the HelloWorld application.
But I have a bad feeling that it is probably not possible
without a GUI library.
I think the window icon is just
On Monday, 18 May 2020 at 17:02:02 UTC, BoQsc wrote:
The important question is: how can we change the name/title of
this Command Line application.
As the simplest solution, you can set the window title in
shortcut properties.
On Monday, 27 April 2020 at 10:28:04 UTC, mark wrote:
I renamed the class shown in my previous post from View to
InnerView, then created a new View class:
class View : ScrolledWindow {
import qtrac.debfind.modelutil: NameAndDescription;
InnerView innerView;
this() {
Maybe if you teach dparse to do this check.
On Thursday, 19 March 2020 at 13:10:29 UTC, Steven Schveighoffer
wrote:
Similar for me but not GameMaker but RPG Maker.
I've seen all your work on the language, and this is a pretty
good endorsement.
Not sure if I'm ready to pay for it though, I want to make sure
his motivation/drive is
https://issues.dlang.org/show_bug.cgi?id=19495#c1
On Monday, 18 November 2019 at 06:44:43 UTC, Joel wrote:
```
http://www.w3.org/2001/XMLSchema-instance;>
```
You're missing a closing tag.
On Wednesday, 13 November 2019 at 16:43:27 UTC, IGotD- wrote:
On Wednesday, 13 November 2019 at 15:30:33 UTC, Dukc wrote:
I'm not 100% sure what managed pointers mean -Are they so that
you can't pass them to unregistered memory? A library solution
would likely do -wrap the pointer in a
On Wednesday, 23 October 2019 at 11:20:59 UTC, Per Nordlöw wrote:
Does DMD/LDC avoid range-checking in slice-expressions such as
the one in my array-overload of `startsWith` defined as
bool startsWith(T)(scope const(T)[] haystack,
scope const(T)[] needle)
{
if
On Wednesday, 23 October 2019 at 11:20:59 UTC, Per Nordlöw wrote:
Does DMD/LDC avoid range-checking in slice-expressions such as
the one in my array-overload of `startsWith` defined as
bool startsWith(T)(scope const(T)[] haystack,
scope const(T)[] needle)
{
if
On Sunday, 29 September 2019 at 02:09:56 UTC, Hossain Adnan wrote:
On Saturday, 28 September 2019 at 13:37:12 UTC, Kagamin wrote:
https://ddbus.dpldocs.info/ddbus.bus.requestName.html
It requires a Connection type which I cannot find in the API.
It's in ddbus.thin, missing documentation
On Sunday, 29 September 2019 at 02:09:56 UTC, Hossain Adnan wrote:
On Saturday, 28 September 2019 at 13:37:12 UTC, Kagamin wrote:
https://ddbus.dpldocs.info/ddbus.bus.requestName.html
It requires a Connection type which I cannot find in the API.
It's in ddbus.thin, missing documentation
https://ddbus.dpldocs.info/ddbus.bus.requestName.html
Maybe you upgraded SFML and now binding doesn't match?
On Thursday, 5 September 2019 at 12:46:06 UTC, berni wrote:
OK. This are two solutions and although I'll probably not going
to use any of those (due to other reasons), I still don't
understand, why the original approach does not work. If I've
got a book an put it in a box and later I'll get it
Maybe something like this
https://forum.dlang.org/post/hloitwqnisvtgfoug...@forum.dlang.org
On Monday, 26 August 2019 at 12:02:12 UTC, GreatSam4sure wrote:
I want customizable GUI toolkit like JavaFX and adobe spark
framework in D.
DWT was translated from java SWT, you can do the same for JavaFX,
D is heavily based on java and there's an automatic translation
tool from java to D.
You're probably interested in readiness, not possibility?
On Wednesday, 31 July 2019 at 22:30:52 UTC, Alexandre wrote:
1) Improve as a programmer
2) Have fun doing programs
Thats it basically. I am planning to study all "free" time I
have. I am doing basically this since last year.
Try Basic. It has builtin graphics, seeing you program draw is
On Sunday, 28 July 2019 at 12:56:12 UTC, BoQsc wrote:
Right now, I'm thinking what is correct way to run another .d
script from a .d script. Do you have any suggestions?
You mean something like execute(["rdmd", "another.d"]); ?
On Thursday, 25 July 2019 at 12:46:48 UTC, Oleg B wrote:
What reason for such restrictions? It's fundamental idea or
temporary implementation?
I think it's a dmd limitation. Currently it has a bug that it can
still generate code for ctfe templated functions, and they will
fail to link if
1 - 100 of 842 matches
Mail list logo