Re: Reimplementing software building blocks like malloc and free in D

2018-08-11 Thread Mike Franklin via Digitalmars-d
On Sunday, 12 August 2018 at 04:16:24 UTC, Aruna Maurya wrote: So there are essentially two requirements here. Building the memory management functionalities from scratch in idiomatic D and implementing the existing runtime hooks as templates. The latter isn't quite a part of the idea as

Re: write a function template specialisation that tests if an argument is known at compile time

2018-08-11 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 12 August 2018 at 02:17:21 UTC, Cecil Ward wrote: I was thinking about reflection and powerful things like traits. Would a test to see if a static if compile do the trick ? You ask the question using traits : "does the following compile? : { static if ( mask == 3 ) { }; }" - any

Re: Reimplementing software building blocks like malloc and free in D

2018-08-11 Thread Aruna Maurya via Digitalmars-d
On Saturday, 11 August 2018 at 20:15:06 UTC, Mike Franklin wrote: On Saturday, 11 August 2018 at 18:59:00 UTC, Aruna Maurya wrote: [...] The compiler recognizes certain expressions and lowers them to functions in the D runtime that we call runtime hooks. See

[Issue 18788] static arrays with a length specified at runtime should dynamically allocate on the stack

2018-08-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18788 Mike Franklin changed: What|Removed |Added See Also||https://issues.dlang.org/sh

[Issue 19159] `alloca` does not work in -betterC

2018-08-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19159 Mike Franklin changed: What|Removed |Added Keywords||betterC --

[Issue 19159] `alloca` does not work in -betterC

2018-08-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19159 Mike Franklin changed: What|Removed |Added See Also||https://issues.dlang.org/sh

[Issue 19159] New: `alloca` does not work in -betterC

2018-08-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19159 Issue ID: 19159 Summary: `alloca` does not work in -betterC Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1

Re: dmd64 on Windows: how?

2018-08-11 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 11 August 2018 at 19:50:30 UTC, Ivan Kazmenko wrote: n This was most close to solving my problem. Thanks! I've installed the components shown in wiki image: v141 tools and the SDKs. VS 2017 Community includes everything you need. There's no reason to install the SDK

Re: Could you anybody using DerelictSDL2 on Android?

2018-08-11 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 11 August 2018 at 14:36:59 UTC, zhani wrote: On Saturday, 11 August 2018 at 08:47:59 UTC, Mike Parker wrote: On Tuesday, 7 August 2018 at 12:05:33 UTC, zhani wrote: [...] I don't do any sort of Android development, so I've never tested any Derelict packages on the platform. A

Re: Could you anybody using DerelictSDL2 on Android?

2018-08-11 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 11 August 2018 at 15:46:47 UTC, tide wrote: extern(C) is a feature, Derelict are libraries. https://dlang.org/spec/interfaceToC.html You can use Derelict "static" to the same effect I think, but they way they achieve it doesn't play well with auto completion and such. All of

Re: write a function template specialisation that tests if an argument is known at compile time

2018-08-11 Thread Cecil Ward via Digitalmars-d-learn
On Sunday, 12 August 2018 at 02:17:21 UTC, Cecil Ward wrote: On Sunday, 12 August 2018 at 00:55:50 UTC, Paul Backus wrote: On Sunday, 12 August 2018 at 00:15:37 UTC, Cecil Ward wrote: Paul, what would the calls look like? I am about to misunderstand things completely so here goes :-) It

Re: write a function template specialisation that tests if an argument is known at compile time

2018-08-11 Thread Cecil Ward via Digitalmars-d-learn
On Sunday, 12 August 2018 at 00:55:50 UTC, Paul Backus wrote: On Sunday, 12 August 2018 at 00:15:37 UTC, Cecil Ward wrote: Paul, what would the calls look like? I am about to misunderstand things completely so here goes :-) It would be a bit kludgy having to switch from one calling syntax to

Re: @nogc with opApply

2018-08-11 Thread ag0aep6g via Digitalmars-d-learn
On 08/11/2018 12:00 PM, Alex wrote: ´´´ import std.experimental.all; static assert(isIterable!S); [...] struct S { [...]     int opApply(scope int delegate(ref uint) /*@nogc*/ operations) //@nogc     { [...]     } } ´´´ Everything works fine, before I try to use the opApply function

Re: unimplemented abstract function compiles.

2018-08-11 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 11 August 2018 at 23:12:43 UTC, ag0aep6g wrote: On 08/11/2018 11:20 PM, rikki cattermole wrote: On 12/08/2018 8:55 AM, Eric wrote: Code below compiles while I would not expect it to compile. Is there a reason that this compiles? [...] No bug. You forgot to throw -unittest when

Re: @nogc with opApply

2018-08-11 Thread tide via Digitalmars-d-learn
On Saturday, 11 August 2018 at 10:00:34 UTC, Alex wrote: Hi all, maybe I misunderstand something but having this: ´´´ import std.experimental.all; static assert(isIterable!S); void main() { S s; s.each!(el => el.writeln); } struct S { private Nullable!uint member = 0;

Re: write a function template specialisation that tests if an argument is known at compile time

2018-08-11 Thread Paul Backus via Digitalmars-d-learn
On Sunday, 12 August 2018 at 00:15:37 UTC, Cecil Ward wrote: Paul, what would the calls look like? I am about to misunderstand things completely so here goes :-) It would be a bit kludgy having to switch from one calling syntax to another, putting the mask argument in the template parameters

Re: write a function template specialisation that tests if an argument is known at compile time

2018-08-11 Thread Cecil Ward via Digitalmars-d-learn
On Saturday, 11 August 2018 at 18:11:15 UTC, Paul Backus wrote: On Saturday, 11 August 2018 at 05:17:51 UTC, Cecil Ward wrote: T myfunc(T)( T x, uint mask ) if ( mask == 3 ) { return fast_func( x, mask ); } but of course this doesn't work because mask is not known at compile-time.

Re: unimplemented abstract function compiles.

2018-08-11 Thread ag0aep6g via Digitalmars-d-learn
On 08/11/2018 10:55 PM, Eric wrote: Code below compiles while I would not expect it to compile. Is there a reason that this compiles? [...] class I {   abstract void f(); } class C : I { } unittest {   C c = cast(C) Object.factory("C");   c.f(); } Not a bug, as far as I see. You

Re: unimplemented abstract function compiles.

2018-08-11 Thread rikki cattermole via Digitalmars-d-learn
On 12/08/2018 11:12 AM, ag0aep6g wrote: On 08/11/2018 11:20 PM, rikki cattermole wrote: On 12/08/2018 8:55 AM, Eric wrote: Code below compiles while I would not expect it to compile. Is there a reason that this compiles? [...] No bug. You forgot to throw -unittest when you compiled. [...]

Re: unimplemented abstract function compiles.

2018-08-11 Thread ag0aep6g via Digitalmars-d-learn
On 08/11/2018 11:20 PM, rikki cattermole wrote: On 12/08/2018 8:55 AM, Eric wrote: Code below compiles while I would not expect it to compile. Is there a reason that this compiles? [...] No bug. You forgot to throw -unittest when you compiled. [...] Error: program killed by signal 11 If

Re: unimplemented abstract function compiles.

2018-08-11 Thread rikki cattermole via Digitalmars-d-learn
On 12/08/2018 8:55 AM, Eric wrote: Code below compiles while I would not expect it to compile. Is there a reason that this compiles? Specs are a bit lite on abstract classes. Only thing I found that would need to allow this is: "19.4 functions without bodies"

unimplemented abstract function compiles.

2018-08-11 Thread Eric via Digitalmars-d-learn
Code below compiles while I would not expect it to compile. Is there a reason that this compiles? Specs are a bit lite on abstract classes. Only thing I found that would need to allow this is: "19.4 functions without bodies" https://dlang.org/spec/function.html#function-declarations But

Re: Reimplementing software building blocks like malloc and free in D

2018-08-11 Thread Mike Franklin via Digitalmars-d
On Saturday, 11 August 2018 at 18:59:00 UTC, Aruna Maurya wrote: 1. If it would have been C++, the above can be implemented by using the mmap() syscall to allocate memory from the heap. However, something that I am not able to understand in the idea description is 'runtime

Re: dmd64 on Windows: how?

2018-08-11 Thread Ivan Kazmenko via Digitalmars-d-learn
Well, I tried all your suggestions. (Actually re-tried a few times.) Thanks, Laurent and Kagamin! On Friday, 10 August 2018 at 14:47:04 UTC, Laurent Tréguier wrote: Did you have a look at the wiki ? It looks like the image shows what needs to be installed:

Re: Reimplementing software building blocks like malloc and free in D

2018-08-11 Thread Eugene Wissner via Digitalmars-d
On Saturday, 11 August 2018 at 18:59:00 UTC, Aruna Maurya wrote: Hello all! I am a Computer Science undergraduate student. Currently a junior, I find the idea of 're-implementing software building blocks like malloc and free in D' listed in the wiki page of SAOC(Symmetry Autumn of Code) quite

Re: Reimplementing software building blocks like malloc and free in D

2018-08-11 Thread rikki cattermole via Digitalmars-d
On 12/08/2018 6:59 AM, Aruna Maurya wrote: 1. If it would have been C++, the above can be implemented by using the mmap() syscall to  allocate memory from the heap. However, something that I am not able to understand in the idea description is 'runtime hooks'. A runtime hook

Reimplementing software building blocks like malloc and free in D

2018-08-11 Thread Aruna Maurya via Digitalmars-d
Hello all! I am a Computer Science undergraduate student. Currently a junior, I find the idea of 're-implementing software building blocks like malloc and free in D' listed in the wiki page of SAOC(Symmetry Autumn of Code) quite interesting. I don't have experience of coding in D however, I

Re: write a function template specialisation that tests if an argument is known at compile time

2018-08-11 Thread Paul Backus via Digitalmars-d-learn
On Saturday, 11 August 2018 at 05:17:51 UTC, Cecil Ward wrote: T myfunc(T)( T x, uint mask ) if ( mask == 3 ) { return fast_func( x, mask ); } but of course this doesn't work because mask is not known at compile-time. so I wondered if there is a way to do something like static if

[Issue 19158] declaration is already defined in another scope in main at line

2018-08-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19158 --- Comment #1 from Ali Ak --- *should be no different than... --

[Issue 18266] ICE: should allow reusing identifier in declarations in disjoint scopes in a function

2018-08-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18266 Ali Ak changed: What|Removed |Added CC||ali.akhtarz...@gmail.com --- Comment #3 from Ali

[Issue 19158] New: declaration is already defined in another scope in main at line

2018-08-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19158 Issue ID: 19158 Summary: declaration is already defined in another scope in main at line Product: D Version: D2 Hardware: x86 OS: Mac OS X Status:

Re: Could you anybody using DerelictSDL2 on Android?

2018-08-11 Thread tide via Digitalmars-d-learn
On Saturday, 11 August 2018 at 14:44:49 UTC, zhani wrote: On Saturday, 11 August 2018 at 14:03:21 UTC, tide wrote: On Tuesday, 7 August 2018 at 12:05:33 UTC, zhani wrote: howdy :-) can anybody use sdl2 on android? first, i got a ldc2 for android. i just followed here on windows:

Re: dtoh

2018-08-11 Thread Jacob Carlborg via Digitalmars-d-learn
On 2018-08-06 15:28, Laeeth Isharc wrote: Hi Walter. Can dtoh be open-sourced now that dmd is? If you mean htod, I would instead recommend DStep [1] or dpp [2]. Both of them are using libclang for parsing C/C++ code. DStep is cross-platform. [1] http://github.com/jacob-carlborg/dstep [2]

Re: Could you anybody using DerelictSDL2 on Android?

2018-08-11 Thread zhani via Digitalmars-d-learn
On Saturday, 11 August 2018 at 14:03:21 UTC, tide wrote: On Tuesday, 7 August 2018 at 12:05:33 UTC, zhani wrote: howdy :-) can anybody use sdl2 on android? first, i got a ldc2 for android. i just followed here on windows: https://wiki.dlang.org/Build_D_for_Android#Windows so i could

Re: Could you anybody using DerelictSDL2 on Android?

2018-08-11 Thread zhani via Digitalmars-d-learn
On Saturday, 11 August 2018 at 08:47:59 UTC, Mike Parker wrote: On Tuesday, 7 August 2018 at 12:05:33 UTC, zhani wrote: [...] I don't do any sort of Android development, so I've never tested any Derelict packages on the platform. A few years back someone did some work with the DerelictGLES

Re: Could you anybody using DerelictSDL2 on Android?

2018-08-11 Thread tide via Digitalmars-d-learn
On Tuesday, 7 August 2018 at 12:05:33 UTC, zhani wrote: howdy :-) can anybody use sdl2 on android? first, i got a ldc2 for android. i just followed here on windows: https://wiki.dlang.org/Build_D_for_Android#Windows so i could compile a sieve.d but didnt run it on android yet. then next?

[Issue 19157] New: template instance `object.RTInfo!(Bar)` recursive expansion

2018-08-11 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19157 Issue ID: 19157 Summary: template instance `object.RTInfo!(Bar)` recursive expansion Product: D Version: D2 Hardware: All OS: All Status: NEW

@nogc with opApply

2018-08-11 Thread Alex via Digitalmars-d-learn
Hi all, maybe I misunderstand something but having this: ´´´ import std.experimental.all; static assert(isIterable!S); void main() { S s; s.each!(el => el.writeln); } struct S { private Nullable!uint member = 0; Nullable!uint front() @nogc { return member; } //void

Re: DIP 1017--Add Bottom Type--Community Review Round 1

2018-08-11 Thread Nicholas Wilson via Digitalmars-d
On Friday, 10 August 2018 at 13:15:46 UTC, Dukc wrote: The benefit would be that null can be a regular pointer constant (enum null = typeof((false)).init) instead of a symbol with special meaning. I'd think it makes compiler rules less complex. I disagree. Another advantage is that you

Re: How to proceed with learning to code Windows desktop applications?

2018-08-11 Thread I Lindström via Digitalmars-d-learn
On Wednesday, 31 January 2018 at 12:56:31 UTC, Arredondo wrote: As other have said, WPF and C# is the way to go for Windows GUI programming, but you don't necessarily need to drop D. You could write your interface code in VS and have it call your D library via pinvoke (Platform Invoke). To

Re: Could you anybody using DerelictSDL2 on Android?

2018-08-11 Thread Mike Parker via Digitalmars-d-learn
On Tuesday, 7 August 2018 at 12:05:33 UTC, zhani wrote: howdy :-) can anybody use sdl2 on android? first, i got a ldc2 for android. i just followed here on windows: https://wiki.dlang.org/Build_D_for_Android#Windows so i could compile a sieve.d but didnt run it on android yet. then next?

Re: [SAoC'18]: Intergration of HTTP/2

2018-08-11 Thread Mike Parker via Digitalmars-d
On Friday, 10 August 2018 at 15:18:31 UTC, Aniketh Girish wrote: Over the past few months, I have been working on learning about different protocols and about their implementation. I understand the concept of HTTP/2 and I have a basic understanding of its implementation. I would like to be

Re: DIP 1017--Add Bottom Type--Community Review Round 1

2018-08-11 Thread Dukc via Digitalmars-d
On Saturday, 11 August 2018 at 05:01:50 UTC, docandrew wrote: On Thursday, 9 August 2018 at 15:50:02 UTC, w0rp wrote: A better name for this type is `never`, which is the name of the TypeScript type with similar semantics. https://www.typescriptlang.org/docs/handbook/basic-types.html#never

Re: write a function template specialisation that tests if an argument is known at compile time

2018-08-11 Thread Cecil Ward via Digitalmars-d-learn
On Saturday, 11 August 2018 at 05:17:51 UTC, Cecil Ward wrote: T myfunc(T)( T x, uint mask ) if ( mask == 3 ) { return fast_func( x, mask ); } but of course this doesn't work because mask is not known at compile-time. Actually is there an opportunity for some kind of language

Nice quote about D on twitter

2018-08-11 Thread Joakim via Digitalmars-d
Can we stick this in the testimonials webpage? ;) "Barely figuring out the #dlang design choices, and I'm already perceiving C++ as a knapsack with stone picks of random sizes.." https://mobile.twitter.com/nikos_maximus/status/1027519165937184768