Re: crashing with no stack trace, why?

2019-01-31 Thread NX via Digitalmars-d-learn
I can't say for sure, but there are some cases I know where you don't get stack trace (mostly dmd bugs): - inside module constructors `shared static this()` - null function pointer call

Re: shared - i need it to be useful

2018-10-17 Thread NX via Digitalmars-d
I don't see any problem with this proposal as long as these points hold: - Shared <-> Unshared is never implicit, either requiring an explicit cast (both ways) or having a language support which allows the conversion gracefully. - Shared methods are called by compiler if the type is shared or

Re: Converting a character to upper case in string

2018-09-21 Thread NX via Digitalmars-d-learn
On Friday, 21 September 2018 at 12:34:12 UTC, Laurent Tréguier wrote: I would probably go for std.utf.decode [1] to get the character and its length in code units, capitalize it, and concatenate the result with the rest of the string. [1] https://dlang.org/phobos/std_utf.html#.decode So by

Converting a character to upper case in string

2018-09-21 Thread NX via Digitalmars-d-learn
How can I properly convert a character, say, first one to upper case in a unicode correct manner? In which code level I should be working on? Grapheme? Or maybe code point is sufficient? There are few phobos functions like asCapitalized() none of which are what I want.

How to understand context type of a delegate?

2018-09-05 Thread NX via Digitalmars-d-learn
I was sketching some simple event-listener code and looked up std.signals module for some inspiration. Documentation says that it only works if the delegate used for slots are a class/interface member function. Digging into the code it seems like it's because _d_toObject(void*) function is

Re: Dscanner - DCD - Dfix ... Editor support or the lack of it.

2018-01-27 Thread NX via Digitalmars-d
On Thursday, 25 January 2018 at 15:20:15 UTC, Benny wrote: I can download Go, C#, C, C++, Delphi, Rust and get proper working plugins for the above mentioned editors but D is always that frustrating problem child. And i can not blame the plugin authors because the issues always seem to stem

Re: So why double to float conversion is implicit ?

2017-10-22 Thread NX via Digitalmars-d
On Sunday, 22 October 2017 at 02:25:44 UTC, codephantom wrote: On Saturday, 21 October 2017 at 20:17:12 UTC, NX wrote: Interestingly enough, I realized that atan() returns double (in this case) but wait, it's assigned to a float variable! Compiler didn't even emit warnings, let alone errors.

So why double to float conversion is implicit ?

2017-10-21 Thread NX via Digitalmars-d
I was working on some sort of math library for use in graphical computing and I wrote something like this: const float PiOver2 = (atan(1.0) * 4) / 2; Interestingly enough, I realized that atan() returns double (in this case) but wait, it's assigned to a float variable! Compiler didn't even

[vibe.d] How to create authentication system via REST interface?

2017-03-15 Thread NX via Digitalmars-d-learn
I'm trying to understand how to create some json-rest api that would return data (in json format) related to that specific logged in user. I see the documentation covers these but I'm totally new to vibe.d so can't quite figure out putting these two things together and make them work. Some

Re: LDC, GDC command line args

2016-09-30 Thread NX via Digitalmars-d
There is one for GDC[1], couldn't find anything for LDC. [1] https://wiki.dlang.org/GDC/Using_GDC

Re: 16MB static arrays again...

2016-08-24 Thread NX via Digitalmars-d
Maybe you can merge this: https://github.com/dlang/dmd/pull/6081

Re: Compiling DMD on Windows: A journey of mystery and madness

2016-08-21 Thread NX via Digitalmars-d
On Sunday, 21 August 2016 at 16:49:53 UTC, Andrei Alexandrescu wrote: On 08/21/2016 12:41 PM, NX wrote: For God's sake no place in docs say that I need DMC, which is something I figured from make error output. I reinstalled dmd and this time I checked that box which makes installer

Compiling DMD on Windows: A journey of mystery and madness

2016-08-21 Thread NX via Digitalmars-d
[warning: rant ahead] I'm amazed by the lack of documentation - or to say it better, documentation that works - on how to compile DMD and eventually Phobos. Here [https://wiki.dlang.org/Starting_as_a_Contributor#Windows_2] we have awfully categorized yet promising information on how to

Re: Why 16Mib static array size limit?

2016-08-15 Thread NX via Digitalmars-d
You can apply a patch if you're willing to compile dmd from source by doing the following: Find the following code in file 'mtype.d' at line 4561: bool overflow = false; if (mulu(tbn.size(loc), d2, overflow) >= 0x100 || overflow) // put a 'reasonable' limit

Re: Why 16Mib static array size limit?

2016-08-15 Thread NX via Digitalmars-d
https://issues.dlang.org/show_bug.cgi?id=14859 This limitation is put there because of optlink (which fails to link when you have enough static data), and is actually entirely meaningless when combined with -m32mscoff & -m64 switches (since other linkers handle huge static data just fine).

Re: DUB saying my Linux exe file is "not an executable file" even though DUB built it

2016-08-14 Thread NX via Digitalmars-d-learn
On Sunday, 14 August 2016 at 03:10:28 UTC, WhatMeWorry wrote: On Sunday, 14 August 2016 at 01:05:33 UTC, Basile B. wrote: On Saturday, 13 August 2016 at 21:56:49 UTC, WhatMeWorry wrote: $ sudo chmod -v 777 * mode of 'HelloWindow' changed from 0644 (rw-r--r--) to 0777 (rwxrwxrwx) $ ls -al

Re: D-Man culture

2016-07-27 Thread NX via Digitalmars-d-announce
░▒░▒██░ ▓▒░░█ ▓ ░█▓ ▓ ▒▒█░░█▓░ ░█▒░▒▓▓▒▒ ▒██▒ ░██▒░▒▒ ░██▒ ██▓

Re: Why D isn't the next "big thing" already

2016-07-27 Thread NX via Digitalmars-d-learn
Lack of production quality tools Lack of good marketing Lack of man power & corporate support Lack of idiomatic D libraries These are pretty much the core of all other negative consequences. Ex: GDC is few versions behind DMD because lack of man power. If only we could break the vicious

Re: Why D isn't the next "big thing" already

2016-07-27 Thread NX via Digitalmars-d-learn
On Wednesday, 27 July 2016 at 09:28:49 UTC, chmike wrote: The reason I'm switching to Go is because 3. GC performance (no stop the world hiccups) IIRC, there is a concurrent GC implementation used by sociomantic but it's linux only. (It uses fork() sys call) 4. Web server && IO performance

Re: Using external libraries the correct way

2016-07-17 Thread NX via Digitalmars-d-learn
On Sunday, 17 July 2016 at 17:52:59 UTC, solidstate1991 wrote: Up to this day, I have to use them by dragging the source into my project. When I tried to import imageformats, the compiler looks up for the file imageformats.d and fails to finish the program. I'm not using command line for

Re: Passing a sting as 'in char[]' yields "immutable is not callable using argument types ()"

2016-06-08 Thread NX via Digitalmars-d-learn
String is an alias for 'immutable(char)[]'. I assume you meant const(char)[] instead of 'const string'? P.S. always use parentheses.

Re: Andrei's list of barriers to D adoption

2016-06-06 Thread NX via Digitalmars-d
And this forum is impossible to use on smart phones... I gave up. You know the rest...

Re: Andrei's list of barriers to D adoption

2016-06-06 Thread NX via Digitalmars-d
On Monday, 6 June 2016 at 13:51:30 UTC, NX wrote: This. I think the biggest problem about D is it's trying to satisfy *everyone*. It's literally combining C++, Java, Python, and ~the like. At some point it even tries to mimic Rust! Trying to be everything at once is key po- ---int

Re: Andrei's list of barriers to D adoption

2016-06-06 Thread NX via Digitalmars-d
On Monday, 6 June 2016 at 08:15:42 UTC, Russel Winder wrote: On Sun, 2016-06-05 at 19:20 -0700, Walter Bright via Digitalmars-d wrote: […] * The garbage collector eliminates probably 60% of potential users right off. And i bet over 80% of them are just saying this based on zero evidence,

Re: Some questions on latest work

2016-04-27 Thread NX via Digitalmars-d
On Wednesday, 27 April 2016 at 20:30:56 UTC, Israel wrote: Lol, i hope youre being paid and not doing it for free. Don't feed the evil.

Re: XDG-APP and D

2016-04-23 Thread NX via Digitalmars-d-announce
I will just leave it here: http://www.zdnet.com/article/linux-expert-matthew-garrett-ubuntu-16-04s-new-snap-format-is-a-security-risk/

Re: Calling .NET from D

2016-03-26 Thread NX via Digitalmars-d
I used this[1] code for interfacing between C# and D once. It[2] demonstrates how to use a function callback passed from C# code. C# use winapi calling convention by default which caused me hours of headache untill I figured it out. Fortunately, there is an attribute to specify it. [1]

Re: Potential GSoC project - GC improvements

2016-03-09 Thread NX via Digitalmars-d
On Wednesday, 9 March 2016 at 22:49:28 UTC, Jeremy DeHaan wrote: Hey all, I'm trying to think of good project ideas for this years GSoC, and one in particular I thought would be a great was working on and improving the GC. I'm not sure what the scope of this project would be like, but at the

Re: Parameterized Keywords

2016-03-07 Thread NX via Digitalmars-d
On Monday, 7 March 2016 at 05:56:54 UTC, Patience wrote: Just curious if anyone can see the use for them? I believe 'new' keyword can take advantage of this quite good. For example you can pass memory usage strategy like so: MyClass mc = new[stream] MyClass(); MyClass mc2 = new[static]

Re: Disappointing inflexibility of argument passing with "alias this"

2016-02-23 Thread NX via Digitalmars-d
On Tuesday, 23 February 2016 at 15:07:08 UTC, NX wrote: It's arguably the right design. When I say arguably I don't mean arguably :D "It's not the right design in my opinion"

Re: Disappointing inflexibility of argument passing with "alias this"

2016-02-23 Thread NX via Digitalmars-d
On Tuesday, 23 February 2016 at 14:35:35 UTC, Adam D. Ruppe wrote: There's no ambiguity there and no bug; it is working as defined. alias this is only ever invoked if the outer type doesn't fit. It does fit here, A is A, so no need to check alias this at all. It's arguably the right design.

Re: Disappointing inflexibility of argument passing with "alias this"

2016-02-23 Thread NX via Digitalmars-d
On Tuesday, 23 February 2016 at 12:43:42 UTC, Kagamin wrote: Don't we already have implicit conversions with alias this, so what's the deal? The deal is you can't have implicit construction like: A a = 5; // Error a = 5 // okay struct A { int i; alias i this; } void f(int i){} void f(string

Re: Things that keep D from evolving?

2016-02-09 Thread NX via Digitalmars-d-learn
On Monday, 8 February 2016 at 17:51:02 UTC, Ola Fosheim Grøstad wrote: C++ compilers have lots of optional warnings/errors, so it is quite possible. But I suppose those that want it would rather use Go, C# or some other GC language than can do ahead of time compilation. There are several

Re: Things that keep D from evolving?

2016-02-09 Thread NX via Digitalmars-d-learn
On Monday, 8 February 2016 at 22:21:50 UTC, Laeeth Isharc wrote: The GC itself may still be far from perfect but its much better than it was, and there are more options now. I have found emsi containers (built on top of Andrei's allocator) pretty nice myself for my own use. Well, GC being

Re: Things that keep D from evolving?

2016-02-09 Thread NX via Digitalmars-d-learn
On Tuesday, 9 February 2016 at 14:35:48 UTC, Ola Fosheim Grøstad wrote: Not incredibly high level abstraction... But I get what you mean. It is fairly high level for a low level language. Coming from C#, it looks amazing but probably not that incredible when coming from C++. So you want

Re: Things that keep D from evolving?

2016-02-08 Thread NX via Digitalmars-d-learn
On Monday, 8 February 2016 at 11:22:45 UTC, thedeemon wrote: On Saturday, 6 February 2016 at 08:07:42 UTC, NX wrote: What language semantics prevent precise & fast GC implementations? Unions and easy type casting prevent precise GC. Lack of write barriers for reference-type fields prevent

Re: Things that keep D from evolving?

2016-02-06 Thread NX via Digitalmars-d-learn
On Saturday, 6 February 2016 at 10:29:32 UTC, Ola Fosheim Grøstad wrote: What makes it impossible to have ref counted classes? Nothing. Then why do we need DIP74 ? And why documentation says RefCounted doesn't work with classes?

Things that keep D from evolving?

2016-02-06 Thread NX via Digitalmars-d-learn
So I came here to ask about things that prevent D to become better. What language semantics prevent precise & fast GC implementations? What makes it impossible to have ref counted classes? What are some other technical / design problems you encountered? (other than poor implementation and

Re: Determine type of property

2016-02-02 Thread NX via Digitalmars-d-learn
On Tuesday, 2 February 2016 at 03:36:25 UTC, Steven Schveighoffer wrote: int y() { return 1;} No need for meta-programming hackery, mark it as @property: int y() @property { return 1;}

Re: Downtime of gdc ftp, bugzilla, site, et. al.

2016-01-24 Thread NX via Digitalmars-d
On Sunday, 24 January 2016 at 20:07:47 UTC, rsw0x wrote: Where can I find GDC explorer? I believe that's it: https://d.godbolt.org

Re: Collapsing n-dimensional array to linear (1 dimensional)

2016-01-22 Thread NX via Digitalmars-d-learn
On Friday, 22 January 2016 at 12:07:11 UTC, abad wrote: Let's say I have an array like this: int[][][] array; And I want to generate a linear int[] based on its data. Is there a standard library method for achieving this, or must I iterate over the array manually? What I'm thinking of is

Regression vs Bug

2016-01-14 Thread NX via Digitalmars-d-learn
Please explain.

Re: extern(C++, ns)

2016-01-13 Thread NX via Digitalmars-d
On Wednesday, 13 January 2016 at 10:53:06 UTC, Ola Fosheim Grøstad wrote: Next version of C++ will probably allow this: namespace a::b::c::d::e { ... } Current version of D2 allow this: module a.b.c.d.e;

Re: Error message improvement ideas

2015-12-20 Thread NX via Digitalmars-d
On Friday, 18 December 2015 at 18:55:29 UTC, Adam D. Ruppe wrote: [...] The biggest problem is overly templated functions. We should seriously find a way to make them error friendly. Maybe: auto find(Range : [InputRange], V)(Range haystack, V needle) Rather than: auto find(Range, V)(Range

Re: __traits(getAttributes, ...) gets attributes for the first overload only

2015-12-07 Thread NX via Digitalmars-d
On Sunday, 6 December 2015 at 02:00:30 UTC, Andrei Alexandrescu wrote: Yah, error is the way to go. -- Andrei Can I ask a question?: Why we don't have a way to get an exact overload of function? Something like: void foo(int i); int foo(float f); //... int function(float) foop = ::(float);

Re: "Getting involved" on dlang.org?

2015-12-02 Thread NX via Digitalmars-d
On Wednesday, 2 December 2015 at 16:22:32 UTC, bachmeier wrote: Another is that there is no guide for contributing to the documentation. I didn't know lines are supposed to be no more than 80 columns. Actually there is such documentation about it but guess what? It's hidden -like many other

Re: ARC on Objects not Class Definitions

2015-11-07 Thread NX via Digitalmars-d
On Thursday, 5 November 2015 at 01:42:18 UTC, Adam D. Ruppe wrote: The object itself needs to know it because the object may pass out references to itself. Consider something like this: class MyString { private char[128] data_; private int length_; char[] getData() { return

Re: Example code on D homepage does not run successfully

2015-10-17 Thread NX via Digitalmars-d
On Saturday, 17 October 2015 at 12:57:25 UTC, Ralph Tandetzky wrote: If I understand this cryptic error message correctly, the problem is missing or inadequate input. There is no floating point number to be parsed and hence the string "" is parsed unsuccessfully which leads to an exception

Which GDC to download?

2015-10-01 Thread NX via Digitalmars-d-learn
Windows X86 64bit (x86_64-w64-mingw32) Standard builds Target DMDFE Runtime GCC GDC revisionBuild Date arm-linux-gnueabi 2.066.1 yes 5.2.0 dadb5a3784 2015-08-30 arm-linux-gnueabihf 2.066.1 yes 5.2.0 dadb5a3784

Re: Which GDC to download?

2015-10-01 Thread NX via Digitalmars-d-learn
Thanks both to you for answers... On Thursday, 1 October 2015 at 14:07:02 UTC, Johannes Pfau wrote: Unfortunately Windows GDC builds are very unstable right now. I'd recommend using DMD or LDC for Windows. Well... To me it's surprising GDC is not usable on windows but I doubt LDC is more

Re: Get AA key and value type

2015-09-20 Thread NX via Digitalmars-d-learn
On Saturday, 19 September 2015 at 18:13:09 UTC, Marc Schütz wrote: You can also do it with built-in syntax: template AATypes(AA : K[V], K, V) { alias Key = K; alias Value = V; } K[V] supposed to be V[K] btw...

What kind of sorcery is that?

2015-09-16 Thread NX via Digitalmars-d-learn
import std.stdio; void main() { Stuff!(Thing!float) s; writeln(typeid(s.var)); writeln(typeid(s.var.varling)); writeln(typeid(s)); } class Stuff(T) { T!int var; } class Thing(T) { T varling; }

Re: Speeding up text file parser (BLAST tabular format)

2015-09-14 Thread NX via Digitalmars-d-learn
On Monday, 14 September 2015 at 16:33:23 UTC, Rikki Cattermole wrote: A lot of this hasn't been covered I believe. http://dpaste.dzfl.pl/f7ab2915c3e1 I believe that should be: foreach (query, ref value; hitlists) Since an assignment happenin there..?

Re: A collection of DIPs

2015-09-12 Thread NX via Digitalmars-d
On Saturday, 12 September 2015 at 15:54:53 UTC, Adam D. Ruppe wrote: D programs *never* have a GC thread. Remember, the D GC isn't magic and isn't actually even that complicated, it is just an ordinary function call. That's what I was afraid of :'(

Re: A collection of DIPs

2015-09-12 Thread NX via Digitalmars-d
On Friday, 11 September 2015 at 19:30:56 UTC, ponce wrote: Some of us use and need @nogc all the time. The other parts of an application can use the GC: best of both worlds. Is there even a compiler switch to disable GC altogether so the program doesn't have a GC thread? No, I can't see it...

Re: Multidimension AA's and remove

2015-09-12 Thread NX via Digitalmars-d-learn
On Saturday, 12 September 2015 at 05:54:13 UTC, NX wrote: import std.stdio : writeln, std.algorithm.mutation : remove; Ooops, this is so wrong! Corrected version: void main() { import std.stdio : writeln; import std.algorithm.mutation : remove; int[][string]

Re: Difference between back (`) and double (") quoted strings

2015-09-12 Thread NX via Digitalmars-d-learn
On Saturday, 12 September 2015 at 08:13:33 UTC, Bahman Movaqar wrote: Is there any or they are just simply syntactically equivalent? Are there any official docs on this? What if I told you, you should search the official reference before asking such things in the forum?

Re: A collection of DIPs

2015-09-11 Thread NX via Digitalmars-d
On Wednesday, 9 September 2015 at 21:27:02 UTC, deadalnix wrote: You can make a difference. Yes you probably don't have as much experience, but that's a great opportunity to learn. Many here would be willing to mentor you if you want. I can do it if you want to contribute to SDC. I'm sure

Huge output size for simple programs

2015-09-11 Thread NX via Digitalmars-d-learn
I compile a simple hello world program in C and the results: hello_world.o -> 1.5 KB hello_world (linux executable) -> 8.5 KB Then I compile a simple hello world program in D (using DMD) and the results: hello_world.o -> 9.3 KB hello_world (linux executable) -> 575.9 KB Then I compile a

Re: Multidimension AA's and remove

2015-09-11 Thread NX via Digitalmars-d-learn
On Saturday, 12 September 2015 at 03:44:50 UTC, Prudence wrote: At the very least: Is T[][S] an associative array with keys of type S and values of an array of type T or is it backwards? Also, how to disambiguate Thanks. Indeed. void main() { import std.stdio : writeln,

Re: Huge output size for simple programs

2015-09-11 Thread NX via Digitalmars-d-learn
On Friday, 11 September 2015 at 13:45:03 UTC, Adam D. Ruppe wrote: Just D's isn't preinstalled so it carries what it needs with the executable for broadest compatibility. You could dynamically link if you like (`-defaultlib=libphobos2.so` on dmd linux) So I did some testing: # dmd

Re: A collection of DIPs

2015-09-09 Thread NX via Digitalmars-d
On Wednesday, 9 September 2015 at 06:13:59 UTC, Dominikus Dittes Scherkl wrote: On Tuesday, 8 September 2015 at 17:07:50 UTC, NX wrote: And, can somebody show me a working example code of how to solve that friend class problem without some horrible hacktic way and agressive template/mixin

Re: A collection of DIPs

2015-09-09 Thread NX via Digitalmars-d
On Wednesday, 9 September 2015 at 14:00:52 UTC, Brandon Ragland wrote: It's slow, really slow, and stopping the entire world is painful, even in trivial user applications. A pause for even half a second or less on the UI makes the application looks "chunky" and broken. If you're having that

Re: A collection of DIPs

2015-09-08 Thread NX via Digitalmars-d
Thanks all your thoughts and criticisms... - I'm fine if DMD ever starts to support multiple `alias this`, just to see if it would be easier for compiler to use opCast for implicit casts. - Those who think ^ would cause problems as it's already used for xor must be forgetting * is widely

Re: Windows Header consts

2015-09-08 Thread NX via Digitalmars-d-learn
On Tuesday, 8 September 2015 at 17:22:44 UTC, NX wrote: I have figure out typo: ...I had to figure out...

Re: Windows Header consts

2015-09-08 Thread NX via Digitalmars-d-learn
On Monday, 7 September 2015 at 19:06:48 UTC, Prudence wrote: It's called encapsulation. Do you have any idea how much I struggled when I try to use enums in OpenTK library because they were "encapsulated" ? Whenever I read OpenGL tutorials I have figure out which enum-name they used as

A collection of DIPs

2015-09-07 Thread nx via Digitalmars-d
https://github.com/NightmareX1337/DX Don't kill me, I'm just trying to help... You can report issues and create pull requests :) Destroy!

Re: Static arrays inside struct and class - bug?

2015-08-01 Thread NX via Digitalmars-d-learn
Typo: *scenario

Static arrays inside struct and class - bug?

2015-08-01 Thread NX via Digitalmars-d-learn
I wonder if the followings are compiler bugs: class stuff_class { byte[1024*1024*16] arr; // Error: index 16777216 overflow for static array } struct stuff { byte[1024*1024*16] arr; // Error: index 16777216 overflow for static array } My project has just stopped for this reason, I

Re: Static arrays inside struct and class - bug?

2015-08-01 Thread NX via Digitalmars-d-learn
On Saturday, 1 August 2015 at 17:29:54 UTC, Adam D. Ruppe wrote: On Saturday, 1 August 2015 at 17:22:40 UTC, NX wrote: I wonder if the followings are compiler bugs: No, it is by design, the idea is to keep static arrays smallish so null references will be caught by the processor. (An overly

Re: Static arrays inside struct and class - bug?

2015-08-01 Thread NX via Digitalmars-d-learn
On Saturday, 1 August 2015 at 18:47:00 UTC, Daniel Kozak wrote: Still same problem, You can`t allocate more then 16M on stack. Use dynamic allocation I don't think new MyStruct allocates on stack, actually allocating ~16MB on stack will immediatelly crash the program which is not the case

Re: Static arrays inside struct and class - bug?

2015-08-01 Thread NX via Digitalmars-d-learn
On Saturday, 1 August 2015 at 18:50:09 UTC, Daniel Kozak wrote: No you don't. You still use static allocation for array Can clarify why does that happen and I still suspect it's a static allocation it would increase output exe if it was really that static..?

Re: Static arrays inside struct and class - bug?

2015-08-01 Thread NX via Digitalmars-d-learn
On Saturday, 1 August 2015 at 19:33:26 UTC, Daniel Kozak wrote: My fault It is not on stack, but still it is a static allocation I think you're misusing static allocation and static declaration for each other.