Re: Making an .exe that executes source file inside itself.

2018-04-26 Thread IntegratedDimensions via Digitalmars-d-learn
On Thursday, 26 April 2018 at 06:18:25 UTC, BoQsc wrote: On Wednesday, 25 April 2018 at 20:44:10 UTC, u0_a183 wrote: On Wednesday, 25 April 2018 at 19:54:26 UTC, BoQsc wrote: On Wednesday, 25 April 2018 at 19:43:31 UTC, Jonathan M Davis wrote: On Wednesday, April 25, 2018 19:19:58 BoQsc via

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 04/26/2018 08:03 PM, H. S. Teoh wrote: On Thu, Apr 26, 2018 at 07:14:17PM -0400, Nick Sabalausky (Abscissa) via Digitalmars-d wrote: On 04/26/2018 06:47 PM, H. S. Teoh wrote: If "less is more" were universally true, we'd be programming in BF instead of D. :-O (Since, after all, it's

Re: readonly member (but assignable at constructor time)

2018-04-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Friday, April 27, 2018 02:59:16 Dr.No via Digitalmars-d-learn wrote: > In C# you can have a readonly member assignable either at > declaration or constructor time, like this: > > class C > { >readonly myClass mc; > >this() >{ > mc = new myClass(); >} > > >void

readonly member (but assignable at constructor time)

2018-04-26 Thread Dr.No via Digitalmars-d-learn
In C# you can have a readonly member assignable either at declaration or constructor time, like this: class C { readonly myClass mc; this() { mc = new myClass(); } void doSomething() { mc = new myClass(); // wrong! result in compiler error, mc is readonly } } Does D

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread sarn via Digitalmars-d
On Friday, 27 April 2018 at 00:03:34 UTC, H. S. Teoh wrote: Actually, Turing-complete *does* mean it can do anything... well, anything that can be done by a machine, that is. No, it means there's some *abstract mapping* between what a thing can do and what any Turing machine can do. That

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread arturg via Digitalmars-d
On Thursday, 26 April 2018 at 22:29:46 UTC, Nick Sabalausky (Abscissa) wrote: On 04/26/2018 01:13 PM, arturg wrote: why do people use this syntax? if val == someVal or while val != someVal it makes editing the code harder then if you use if(val == someVal). The theory goes: A. "less

Re: Using D without libphobos

2018-04-26 Thread sarn via Digitalmars-d
On Thursday, 26 April 2018 at 03:04:55 UTC, A. Nicholi wrote: I am not sure if this is possible though I think you've got the technical answer already (just don't link in phobos2) but I'll add my 2c that Phobosless programming isn't just possible but realistically doable. It's a shame to go

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread H. S. Teoh via Digitalmars-d
On Thu, Apr 26, 2018 at 04:26:30PM -0700, Walter Bright via Digitalmars-d wrote: [...] > Having redundancy in the syntax makes for better, more accurate error > diagnostics. In the worst case, for a language with zero redundancy, > every sequence of characters is a valid program. Hence, no errors

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread H. S. Teoh via Digitalmars-d
On Thu, Apr 26, 2018 at 07:14:17PM -0400, Nick Sabalausky (Abscissa) via Digitalmars-d wrote: > On 04/26/2018 06:47 PM, H. S. Teoh wrote: > > > > If "less is more" were universally true, we'd be programming in BF > > instead of D. :-O (Since, after all, it's Turing-complete, which > > is all

Re: DIP 1013: The Deprecation Process -- Community Review Round 1

2018-04-26 Thread Martin Nowak via Digitalmars-d
On Tuesday, 24 April 2018 at 17:02:50 UTC, Jonathan M Davis wrote: Honestly, I'd hate to have major releases be that infrequent. It can already be annoying enough when something that doesn't get added doesn't end up being released for a two or three months, depending on the timing. The slower

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread Walter Bright via Digitalmars-d
On 4/26/2018 3:29 PM, Nick Sabalausky (Abscissa) wrote: The theory goes: A. "less syntax => easier to read". B. "There's no technical need to require it, and everything that can be removed should be removed, thus it should be removed". Personally, I find the lack of parens gives my brain's

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 04/26/2018 06:47 PM, H. S. Teoh wrote: If "less is more" were universally true, we'd be programming in BF instead of D. :-O (Since, after all, it's Turing-complete, which is all anybody really needs. :-P) Yea. Speaking of which, I wish more CS students were taught the the inherent

Re: which LLVM source should I use in order to use SPIRV through DCompute ?

2018-04-26 Thread Nicholas Wilson via Digitalmars-d
On Thursday, 26 April 2018 at 22:51:59 UTC, bioinfornatics wrote: Dear, Dcompute: https://github.com/libmir/dcompute need a SPIRV capable LLVM. For this Dcompute project show https://github.com/thewilsonator/llvm as a SPIRV capable LLVM. But it is not an official llvm source, moreover the

Re: Favorite GUI library?

2018-04-26 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 04/26/2018 03:20 PM, Johannes Pfau wrote: Maybe this will help: https://puri.sm/shop/librem-5/ Hope is the last thing to die ;-) Thanks for the link, looks interesting. Don't quite understand how that distributed telephony is supposed to work though, while still (hopefully)

which LLVM source should I use in order to use SPIRV through DCompute ?

2018-04-26 Thread bioinfornatics via Digitalmars-d
Dear, Dcompute: https://github.com/libmir/dcompute need a SPIRV capable LLVM. For this Dcompute project show https://github.com/thewilsonator/llvm as a SPIRV capable LLVM. But it is not an official llvm source, moreover the source is outdated. Indeed it provide LLVM 5.0.0 while the current

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread H. S. Teoh via Digitalmars-d
On Thu, Apr 26, 2018 at 06:29:46PM -0400, Nick Sabalausky (Abscissa) via Digitalmars-d wrote: > On 04/26/2018 01:13 PM, arturg wrote: > > > > why do people use this syntax? > > > > if val == someVal > > > > or > > > > while val != someVal > > > > it makes editing the code harder then if you

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread Nick Sabalausky (Abscissa) via Digitalmars-d
On 04/26/2018 01:13 PM, arturg wrote: why do people use this syntax? if val == someVal or while val != someVal it makes editing the code harder then if you use if(val == someVal). The theory goes: A. "less syntax => easier to read". B. "There's no technical need to require it, and

bitfields comparison in opEquals

2018-04-26 Thread Per Nordlöw via Digitalmars-d-learn
I have a struct with a mixin(bitfields) containing many small bitfields. I also have a class member in the struct. And because I want the class member to compare by using `is` I need to define bool opEquals(const scope typeof(this) that) const @safe pure nothrow @nogc {

Re: LDC 1.9.0 beta

2018-04-26 Thread Nick Sabalausky (Abscissa) via Digitalmars-d-announce
On 04/26/2018 03:11 AM, Joakim wrote: I don't know how those links are relevant. Yes, some projects are supporting WebAssembly, but that doesn't mean the web hasn't been declining, so this port likely isn't worth the effort. Nobody is stopping anyone from doing the port though: ldc has some

Re: Arguments of function as an array.

2018-04-26 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, April 26, 2018 21:28:27 Jonathan via Digitalmars-d-learn wrote: > Is there a way in D to take past arguments as an array? A like a > normal Variadic function. All the arguments should be of the > same type just as an array. > > Basically I want to allow a function like this to be

Re: Arguments of function as an array.

2018-04-26 Thread ag0aep6g via Digitalmars-d-learn
On 04/26/2018 11:28 PM, Jonathan wrote: Is there a way in D to take past arguments as an array?  A like a normal Variadic function.  All the arguments should be of the same type just as an array. Basically I want to allow a function like this to be called without square brackets. void

Arguments of function as an array.

2018-04-26 Thread Jonathan via Digitalmars-d-learn
Is there a way in D to take past arguments as an array? A like a normal Variadic function. All the arguments should be of the same type just as an array. Basically I want to allow a function like this to be called without square brackets. void fun(int[] intArray) { //... } void main()

Re: Favorite GUI library?

2018-04-26 Thread Johannes Pfau via Digitalmars-d
Am Wed, 25 Apr 2018 22:45:59 -0400 schrieb Nick Sabalausky (Abscissa): > On 04/25/2018 10:31 PM, Nick Sabalausky (Abscissa) wrote: >> >> Yea. Google's [complain, gripe, blah, blah, blah...] > I found this to be a very interesting, and not particularly surprising, > peek at the way things

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread ag0aep6g via Digitalmars-d
On 04/26/2018 09:11 PM, H. S. Teoh wrote: Fair enough. But if that's all there is to it, then why bring it up here? Not that I object, mind you, but it just seemed kinda random, why pick this one hobby project over any other, when there are tons of new languages out there being made almost

[Issue 18801] std.stdio.File doesn't work with MSVCRT's UTF-8 mode

2018-04-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18801 ag0aep6g changed: What|Removed |Added Keywords||pull

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread H. S. Teoh via Digitalmars-d
On Thu, Apr 26, 2018 at 06:26:03PM +, Meta via Digitalmars-d wrote: > On Thursday, 26 April 2018 at 15:07:37 UTC, H. S. Teoh wrote: > > On Thu, Apr 26, 2018 at 08:50:27AM +, Joakim via Digitalmars-d > > wrote: > > > https://github.com/felixangell/krug > > > > > >

[Issue 18801] New: std.stdio.File doesn't work with MSVCRT's UTF-8 mode

2018-04-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18801 Issue ID: 18801 Summary: std.stdio.File doesn't work with MSVCRT's UTF-8 mode Product: D Version: D2 Hardware: All OS: Windows Status: NEW Severity: normal

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread Meta via Digitalmars-d
On Thursday, 26 April 2018 at 15:07:37 UTC, H. S. Teoh wrote: On Thu, Apr 26, 2018 at 08:50:27AM +, Joakim via Digitalmars-d wrote: https://github.com/felixangell/krug https://www.reddit.com/r/programming/comments/8dze54/krug_a_systems_programming_language_that_compiles/ It's still too

[Issue 14536] Calling destroy() on a on an extern(C++) class causes a segfault

2018-04-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14536 Manu changed: What|Removed |Added Keywords||C++, industry

Idiomatic way to add examples to dub package

2018-04-26 Thread FreeSlave via Digitalmars-d-learn
Most dub packages are libraries and should provide runnable examples. What's the current idiomatic way to add examples? I used sub-packages with dependency on the library and "*" as version and running them as dub run :examplename Now I've noticed vibed uses a different scheme - examples are

Re: What's wrong with this alias?

2018-04-26 Thread Ali Çehreli via Digitalmars-d-learn
On 04/26/2018 10:56 AM, Dr.No wrote: > class C > { > > void error(A...)(string fmt, A args) > { > import report : error; > reportedAnyError = true; > error(fmt, args); > } > alias warning = report.warning; > } > > > I got this: > > Error: undefined

What's wrong with this alias?

2018-04-26 Thread Dr.No via Digitalmars-d-learn
consider this: module report; // output an error message on stderr void error(A...)(string fmt, A args) { import colorize : fg, color, cwriteln, cwritefln, cwrite; stderr.cwrite("error: ".color(fg.yellow)); cwritefln(fmt.color(fg.yellow), args); } void

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread Joakim via Digitalmars-d
On Thursday, 26 April 2018 at 15:07:37 UTC, H. S. Teoh wrote: On Thu, Apr 26, 2018 at 08:50:27AM +, Joakim via Digitalmars-d wrote: https://github.com/felixangell/krug https://www.reddit.com/r/programming/comments/8dze54/krug_a_systems_programming_language_that_compiles/ It's still too

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread arturg via Digitalmars-d
On Thursday, 26 April 2018 at 15:07:37 UTC, H. S. Teoh wrote: On Thu, Apr 26, 2018 at 08:50:27AM +, Joakim via Digitalmars-d wrote: https://github.com/felixangell/krug https://www.reddit.com/r/programming/comments/8dze54/krug_a_systems_programming_language_that_compiles/ It's still too

Re: Get files from directory sorted by name

2018-04-26 Thread Dr.No via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 19:25:11 UTC, Jesse Phillips wrote: On Wednesday, 25 April 2018 at 17:34:41 UTC, Dr.No wrote: Is there something implemented already to get the files from directory by name using D or I'm on my own and I have to write it myself? I didn't find how do that with

Re: Get files from directory sorted by name

2018-04-26 Thread Dr.No via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 18:06:07 UTC, Jonathan M Davis wrote: On Wednesday, April 25, 2018 17:34:41 Dr.No via Digitalmars-d-learn wrote: Is there something implemented already to get the files from directory by name using D or I'm on my own and I have to write it myself? I didn't find

Re: Template to retrieve compile-time enum member from run-time enum member?

2018-04-26 Thread Simen Kjærås via Digitalmars-d-learn
On Thursday, 26 April 2018 at 16:10:16 UTC, Timoses wrote: Is it possible to use a template to place the "static foreach" looping to find the correct enum value into? Like I am trying in the initial "draft" GetMenum? As the compiler says, the value of `e` is not known at compile-time. In

Template to retrieve compile-time enum member from run-time enum member?

2018-04-26 Thread Timoses via Digitalmars-d-learn
The following should depict what I'm trying to achieve: ``` import std.stdio; enum menum { A, B, C } void main() { foo(menum.B); } void foo(menum e) { // Not possible // run time variable 'e' in conjunction with template 'Temp' writeln(Temp!(GetMenum(e))); } static int i

Re: Troubles with template constraints on string and static if

2018-04-26 Thread Alex via Digitalmars-d-learn
On Thursday, 26 April 2018 at 15:06:49 UTC, sungal wrote: I have this piece of code and I can't understand why the `static if` conditionals are always false. ``` import std.digest.sha; import std.file; import std.stdio; void main() { auto hash1 = produceHash!string("prova.d"); auto

Troubles with template constraints on string and static if

2018-04-26 Thread sungal via Digitalmars-d-learn
I have this piece of code and I can't understand why the `static if` conditionals are always false. ``` import std.digest.sha; import std.file; import std.stdio; void main() { auto hash1 = produceHash!string("prova.d"); auto hash2 = produceHash!File(File("./prova.d")); } string

Re: Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread H. S. Teoh via Digitalmars-d
On Thu, Apr 26, 2018 at 08:50:27AM +, Joakim via Digitalmars-d wrote: > https://github.com/felixangell/krug > > https://www.reddit.com/r/programming/comments/8dze54/krug_a_systems_programming_language_that_compiles/ It's still too early to judge, but from the little I've seen of it, it seems

Re: Pre-DConf Meetup on May 1

2018-04-26 Thread Nicholas Wilson via Digitalmars-d-announce
On Wednesday, 25 April 2018 at 15:00:18 UTC, SimonN wrote: On Wednesday, 25 April 2018 at 14:13:55 UTC, Seb wrote: Our next D Munich Meetup will coincide with DConf to give our For those of you who stay at the hotel, we will be at the NH München Messe hotel at 18:00 and lead you towards the

[Issue 18800] New: [REG2.080.0-beta.1] Array.length setter segfaults for payloads with indirections

2018-04-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18800 Issue ID: 18800 Summary: [REG2.080.0-beta.1] Array.length setter segfaults for payloads with indirections Product: D Version: D2 Hardware: x86_64 OS: Linux

[Issue 14643] Safety violation with final switch and void initializer

2018-04-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14643 Radu Racariu changed: What|Removed |Added Keywords||safe

Re: Making an .exe that executes source file inside itself.

2018-04-26 Thread JN via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 19:19:58 UTC, BoQsc wrote: So there has been idea I've got for around few months now: making a software which executable would contain a source file. A software that anyone could modify by opening an executable and quickly change a few lines of it, rerun an

Re: Pre-DConf Meetup on May 1

2018-04-26 Thread Guillaume Piolat via Digitalmars-d-announce
On Wednesday, 25 April 2018 at 14:13:55 UTC, Seb wrote: Hi all, I hope you are all looking forward to DConf. We (Stefan, Dragos and I) have very good news for you. Our next D Munich Meetup will coincide with DConf to give our local community who can't join DConf an opportunity to meetup all

Re: Using D without libphobos

2018-04-26 Thread Mike Franklin via Digitalmars-d
On Thursday, 26 April 2018 at 09:24:19 UTC, A. Nicholi wrote: So in a way, the D runtime is similar to libstdc++, providing implementations of runtime language features. I would argue that Phobos is more analogous to libstc++, but there are some language features in C++ that are implemented

Re: Using an external Assembler with D

2018-04-26 Thread Stefan Koch via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 20:31:46 UTC, solidstate1991 wrote: On Wednesday, 25 April 2018 at 15:25:42 UTC, Stefan Koch wrote: Pass stuff on the stack ;) and use extern (C) functions. Thanks! What about extern (D)? Is there a big chaos in the D ABI under x86? I think the D abi is not

Re: The dlang-community releases DCD 0.9.3 and D-Scanner 0.5.2

2018-04-26 Thread wangwei via Digitalmars-d-announce
On Wednesday, 25 April 2018 at 09:45:56 UTC, WebFreak001 wrote: On Wednesday, 25 April 2018 at 03:59:12 UTC, wangwei wrote: On Monday, 23 April 2018 at 17:26:49 UTC, Seb wrote: [...] I use the dmd portable version and vscode with code-d, the dcd just failed (d.ext.dcdFail) no matter dcd is

Re: Using D without libphobos

2018-04-26 Thread A. Nicholi via Digitalmars-d
On Thursday, 26 April 2018 at 06:32:14 UTC, Radu wrote: LDC allows specifying default libs, something like `-defaultlib=phobos2-ldc,druntime-ldc`; you can remove phobos from the list. Alright, that sounds simple enough. Thanks! On Thursday, 26 April 2018 at 06:32:14 UTC, Radu wrote: I

Re: Using D without libphobos

2018-04-26 Thread A. Nicholi via Digitalmars-d
On Thursday, 26 April 2018 at 03:53:54 UTC, Mike Franklin wrote: I suggest reading the following 2 items before digging deeper: https://dlang.org/blog/2017/08/23/d-as-a-better-c/ https://dlang.org/changelog/2.079.0.html#minimal_runtime I didn’t know D had begun offering serious decoupling

Re: LDC 1.9.0 beta

2018-04-26 Thread Jacob Carlborg via Digitalmars-d-announce
On Wednesday, 25 April 2018 at 13:36:50 UTC, Rel wrote: This is nice to hear, but just to make it clear, what steps do I need to take to for example build a Mac OSX binary on Windows or Linux? Can I just download libs from prebuilt LDC for Mac OSX, put them somewhere in my current LDC

Found on proggit: Krug, a new experimental programming language, compiler written in D

2018-04-26 Thread Joakim via Digitalmars-d
https://github.com/felixangell/krug https://www.reddit.com/r/programming/comments/8dze54/krug_a_systems_programming_language_that_compiles/

[Issue 18493] [betterC] Can't use aggregated type with postblit

2018-04-26 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18493 --- Comment #6 from Radu Racariu --- I though more about this and I think betterC should imply nothrow *only for* compiler generated code. Making betterC nothrow by default will change semantics and basically split the

Re: LDC 1.9.0 beta

2018-04-26 Thread Joakim via Digitalmars-d-announce
On Thursday, 26 April 2018 at 05:34:51 UTC, meppl wrote: On Tuesday, 24 April 2018 at 15:53:23 UTC, Joakim wrote: On Monday, 23 April 2018 at 09:18:07 UTC, Suliman wrote: What about Webassembly support? Latest LLVM suppport it, so LDC should support also. We don't support a lot of platforms

Re: Using D without libphobos

2018-04-26 Thread Radu via Digitalmars-d
On Thursday, 26 April 2018 at 03:04:55 UTC, A. Nicholi wrote: Hello, I am working on a large cross-platform project, which will be written primarily in D, interfacing to C as necessary. To get finer control over memory safety, binary size, and use of the GC, we would like to disclude

Re: Making an .exe that executes source file inside itself.

2018-04-26 Thread BoQsc via Digitalmars-d-learn
On Wednesday, 25 April 2018 at 20:44:10 UTC, u0_a183 wrote: On Wednesday, 25 April 2018 at 19:54:26 UTC, BoQsc wrote: On Wednesday, 25 April 2018 at 19:43:31 UTC, Jonathan M Davis wrote: On Wednesday, April 25, 2018 19:19:58 BoQsc via Digitalmars-d-learn wrote: So there has been idea I've got

Re: Profiling with LDC

2018-04-26 Thread Dmitry Olshansky via Digitalmars-d
On Wednesday, 25 April 2018 at 17:31:06 UTC, H. S. Teoh wrote: I'm trying to figure out how to do a traditional instrumented profile with LDC. All docs that I've managed to find so far say to use -fprofile-instr-generate, but when I try that, I get a ton of linker errors complaining of