Re: Migrating an existing more modern GC to D's gc.d

2018-04-10 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-10 08:47, Jonathan M Davis wrote: Regardless, I think that it's clear that in order to do anything with thread-local pools, we'd have to lock down the type system even further to disallow casts to or from shared or immutable, and that would really be a big problem given the inherent r

Re: lazy evaluation of logical operators in enum definition

2018-04-16 Thread Jacob Carlborg via Digitalmars-d
On Monday, 16 April 2018 at 05:57:01 UTC, Shachar Shemesh wrote: Consider the following program: struct S1 { enum member = 3; } struct S2 { enum member = 2; } struct S3 { } enum prop(T) = __traits(hasMember, T, "member") && T.member==3; pragma(msg, prop!S1); pragma(msg, prop!S2); pra

Re: CTFE in .di files

2018-04-18 Thread Jacob Carlborg via Digitalmars-d
On Wednesday, 18 April 2018 at 08:12:43 UTC, Jonathan M Davis wrote: Curiously, I can't reproduce the problem on my FreeBSD system, so I wonder if it's Windows-specific (or at least that the linker on FreeBSD doesn't choke in the same way - the object files may or may not have a similar probl

Re: CTFE in .di files

2018-04-18 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-18 11:35, Jonathan M Davis wrote: As in you're seeing the same problem Manu is, or as in you're not seeing it on Mac OS X, just like I'm not seeing it on FreeBSD? I'd guess the latter given how close FreeBSD and Mac OS X are, but the way you said it wasn't clear. I am seeing the sam

Re: What stops DMD from cross-compiling?

2018-04-27 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-27 12:56, Rel wrote: So, okey, bare with me here. As I once told here before the only one thing I love about Golang is the ability to easily cross-compile code from any supported OS targeting any supported OS. So I was thinking what actually stops DMD from doing the same thing? DMD h

Re: What stops DMD from cross-compiling?

2018-04-29 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-28 10:49, Rel wrote: Something like memcpy and similar stuff is easy to implement. If we are talking about Linux stuff like open, malloc and etc can be implemented either by using syscalls or by generating the binding to the libc.so of some minimal version that we decide to support (l

Re: What stops DMD from cross-compiling?

2018-04-29 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-28 12:02, Vladimir Panteleev wrote: Probably the closest thing to cross-platform building would be through LDC, as LLVM already includes everything for C cross compilation. Except for a C standard library. -- /Jacob Carlborg

Re: Favorite GUI library?

2018-04-29 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-28 19:39, User wrote: Dwt is nice, but no glade like gui editor.  when using dwt, I build gui manually. You might be able to use WindowBuilder [1] and port the Java code to D. [1] https://www.eclipse.org/windowbuilder/ -- /Jacob Carlborg

Re: core.stdc and betterC

2018-04-29 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-29 16:42, dd886k wrote: Hello! This is my first time posting, so do feel free to correct me and this post. I started writing in D around Q2 2017 and recently been re-writing some of my projects as betterC (entirely!). I noticed something weird. It started with DMD 2.074.0 and it's

Re: core.stdc and betterC

2018-04-30 Thread Jacob Carlborg via Digitalmars-d
On 2018-04-30 00:52, Walter Bright wrote: It is a macro on some platforms, and that's why it was done that way in core.stdc.stdio. That makes sense. These days, however, it is better to replace such macros with a template. That way it will not be necessary to link with druntime. That's a

Re: A pattern I'd like to see more of - Parsing template parameter tuples

2018-05-21 Thread Jacob Carlborg via Digitalmars-d
On Monday, 21 May 2018 at 00:13:26 UTC, Ethan wrote: Code for context: https://github.com/GooberMan/binderoo/blob/master/binderoo_client/d/src/binderoo/util/enumoptions.d Something struck me at DConf. I was watching the dxml talk and hearing about all these things that weren't being implemente

Re: A pattern I'd like to see more of - Parsing template parameter tuples

2018-05-21 Thread Jacob Carlborg via Digitalmars-d
On Monday, 21 May 2018 at 14:23:07 UTC, Steven Schveighoffer wrote: But how do you use it? SomeObject!(Options(true, false, 42, "guess what this does")) Yes, or if you want something more readable: enum Options options = { foo: true, bar: false, a: 42, b: "guess what this does" }; SomeOb

Re: A pattern I'd like to see more of - Parsing template parameter tuples

2018-05-22 Thread Jacob Carlborg via Digitalmars-d
On Tuesday, 22 May 2018 at 11:08:13 UTC, Jonathan M Davis wrote: That's basically what dxml does except that it takes advantage of the fact that each member is a different type (because each is a differnt instance of std.typecons.Flag) so that it can have a variadic function which takes any of

Re: Ideas for students' summer projects

2018-05-24 Thread Jacob Carlborg via Digitalmars-d
On Thursday, 24 May 2018 at 02:07:28 UTC, Mike Franklin wrote: Hope that helps at least a little. It'll probably just generate more questions, but keep them coming. This is all great, but nobody is going to be able to find the answers here in the forum. I recommend a Markdown document in the

Re: Why Is D So Slow?

2018-05-26 Thread Jacob Carlborg via Digitalmars-d
On 2018-05-25 18:05, Kagamin wrote: One approach to behavioral detection is when the antivirus has an emulator that executes the analyzed program to see if it will do something nasty. Viruses are usually not written in python, so this emulation can be skipped for python programs. I'm guessin

Re: DConf 2018 Videos

2018-05-26 Thread Jacob Carlborg via Digitalmars-d
On 2018-05-22 07:24, Jonathan M Davis wrote: As I understand it, the folks doing the recording were initially relying on the wifi, and the wifi connection was pretty poor, so something that they were up to went wrong, and the first three talks are unfortunately "proper lost." That being said, Wa

Re: DUB colored output proposal/showcase

2018-06-08 Thread Jacob Carlborg via Digitalmars-d
On 2018-06-08 15:38, Steven Schveighoffer wrote: Looks excellent! Two thumbs up from me. Is it cross-platform? Note on some platforms (ahem, Macos) the background is white, so this should be correctly colored for that possibility. On macOS everyone should use iTerm :), which has a dark backg

Re: DUB colored output proposal/showcase

2018-06-08 Thread Jacob Carlborg via Digitalmars-d
On 2018-06-08 15:38, Steven Schveighoffer wrote: Note on some platforms (ahem, Macos) the background is white, so this should be correctly colored for that possibility. I would assume that the theme of the terminal is setup so that all colors (except white and black) work together with the ba

Re: DUB colored output proposal/showcase

2018-06-19 Thread Jacob Carlborg via Digitalmars-d
On 2018-06-09 00:45, gdelazzari wrote: Actually, I was thinking about that too. In fact, what if a user is using a "classic" dark-background theme on macOS's terminal? Or another terminal which by default uses a dark background, like the one mentioned above? He would get all the colors and the t

Re: D community's view on syntactic sugar

2018-06-21 Thread Jacob Carlborg via Digitalmars-d
On 2018-06-16 04:44, Jonathan M Davis wrote: * The null conditional operator `?.` It's been discussed before, and maybe we'll get it or something like it at some point, but it really wouldn't help much with idiomatic D. The average D program does a _lot_ less with classes than a language like

Re: D community's view on syntactic sugar

2018-06-21 Thread Jacob Carlborg via Digitalmars-d
On 2018-06-16 07:48, Nick Sabalausky (Abscissa) wrote: If only D hadn't given up on the AST macros idea, we could actually implement most of this sugar AS A LIBRARY SOLUTION, just like modern D wants. AST macros are seriously awesome though: There's this one CLR language, Nemerle, kind of obsc

Re: DIP 1015--removal of implicit conversion from integer and character literals to bool--Community Review Round 1

2018-06-22 Thread Jacob Carlborg via Digitalmars-d
On 2018-06-20 10:16, Mike Parker wrote: This is the feedback thread for the first round of Community Review for DIP 1015, "Deprecation and removal of implicit conversion from integer and character literals to bool": The text says: "Only literals that evaluate to 0 or 1 are affected; all other

Re: DIP 1015--removal of implicit conversion from integer and character literals to bool--Community Review Round 1

2018-06-23 Thread Jacob Carlborg via Digitalmars-d
On 2018-06-22 17:46, Steven Schveighoffer wrote: On 6/22/18 11:31 AM, Jacob Carlborg wrote: On 2018-06-20 10:16, Mike Parker wrote: This is the feedback thread for the first round of Community Review for DIP 1015, "Deprecation and removal of implicit conversion from integer and character litera

Re: Parenthesis around if/for/while condition is not necessary

2018-06-23 Thread Jacob Carlborg via Digitalmars-d
On 2018-06-23 03:27, aedt wrote: for line in stdin.lines() {} if condition {} while condition {} for init; condition; op {} What's the rationale of keeping the requirement that the condition of if/for/while must be wrapped with a parenthesis (other than keeping parser simple)? Modern languag

Re: Parenthesis around if/for/while condition is not necessary

2018-06-24 Thread Jacob Carlborg via Digitalmars-d
On 2018-06-23 14:34, Tobias Müller wrote: AFAIK the if and else branches in Rust always have to be enclosed in curly braces because of this. I don't remember the exact ambiguity though. There's an ambiguity between the condition and the body. There needs to be some kind of symbol to separate

Re: `update` and `require` properties for AA

2018-06-27 Thread Jacob Carlborg via Digitalmars-d
On 2018-06-27 01:22, Seb wrote: On Tuesday, 26 June 2018 at 17:12:37 UTC, H. S. Teoh wrote: On Tue, Jun 26, 2018 at 12:54:11PM -0400, Steven Schveighoffer via Digitalmars-d wrote: [...] 1. The dlang.org repository is backwards -- master generates the docs for the default dlang.org. I've brought

Re: A Case for Oxidation: A potential missed opportunity for D

2018-06-29 Thread Jacob Carlborg via Digitalmars-d
On 2018-06-29 12:55, kinke wrote: I'd love to hear some reasons for -betterC from a competent guy like yourself. I simply don't get what all the fuzz is about and what people expect to gain from losing druntime (and language features depending on it) and non-template-only Phobos. I understand th

Re: Compilation is taking a ton of memory

2018-07-04 Thread Jacob Carlborg via Digitalmars-d
On 2018-06-27 18:00, Mario Silva wrote: Hello, Our code base has been growing steadily and it's currently at a point where my 16GB machine just freezes when we're compiling our code. This happens because DMD just consumes all my memory for a while. Also, it's taking a long time to compile it

Re: D and shared librery

2018-07-04 Thread Jacob Carlborg via Digitalmars-d
On 2018-07-02 04:15, Seb wrote: Shared libraries are working fine on Linux and OSX. For macOS LDC is required. -- /Jacob Carlborg

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-09 Thread Jacob Carlborg via Digitalmars-d
On 2018-07-08 22:55, John Carter wrote: On Saturday, 7 July 2018 at 01:18:21 UTC, wjoe wrote: But that's not how D works. It throws an Error which can be caught. If people are allowed to do something they assume it's legitimate. It should be a compile time error to catch an Error, but it doesn

Re: Sutter's ISO C++ Trip Report - The best compliment is when someone else steals your ideas....

2018-07-11 Thread Jacob Carlborg via Digitalmars-d
On 2018-07-11 03:50, Walter Bright wrote: On 7/10/2018 8:39 AM, H. S. Teoh wrote: The saving grace to real mode DOS was that rebooting was so fast. I beg to differ. Boot time has been about the same for the last 40 years :-) The boot time of my computer was reduced from several minutes to a

Re: Multiple functions, same signature

2018-07-11 Thread Jacob Carlborg via Digitalmars-d
On 2018-07-11 17:58, Luís Marques wrote: I was surprised to find out today that this compiles: void foo() {} void foo() {} void main() {} Is it a bug, or just a weird design decision? "alphaglosined" on IRC seemed to think it was a regression. Please confirm, so that I can file a bug, or unde

Re: REPL semantics

2018-07-12 Thread Jacob Carlborg via Digitalmars-d
On Friday, 13 July 2018 at 02:26:28 UTC, jmh530 wrote: No Windows support. For drepl: "Works on any OS with full shared library support by DMD (currently linux, OSX, and FreeBSD)." For macOS that means using LDC. -- /Jacob Carlborg

Re: REPL semantics

2018-07-12 Thread Jacob Carlborg via Digitalmars-d
On Thursday, 12 July 2018 at 22:17:29 UTC, Luís Marques wrote: Ah, that explains why my clone of drepl didn't compile: it was the Martin Novak's repo, not the D community one. Although on macOS it still doesn't compile, because of the lack of _rt_loadLibrary. Have you considered using LDC an

Re: Copy Constructor DIP

2018-07-14 Thread Jacob Carlborg via Digitalmars-d
On Friday, 13 July 2018 at 01:18:48 UTC, Andrei Alexandrescu wrote: On 7/12/18 2:30 PM, ag0aep6g wrote: You're still potentially changing the semantics of existing code. `@implicit` can be a UDA today: enum implicit = 0; struct C {     @implicit this(ref C another) {} } Today, th

Re: Copy Constructor DIP

2018-07-17 Thread Jacob Carlborg via Digitalmars-d
On Tuesday, 17 July 2018 at 00:04:12 UTC, Andrei Alexandrescu wrote: Then "negative" :o). In brief @implicit follows the same implementation as @safe and @nogc/ Why? This is a breaking change. Why not go with an approach that does not cause any breaking changes, which is just as easy to do?

Re: std.experimental.collections.rcstring and its integration in Phobos

2018-07-17 Thread Jacob Carlborg via Digitalmars-d
On 2018-07-17 17:21, Seb wrote: - _no_ range by default (it needs an explicit `.by!{d,w,}char`) (as in no auto-decoding by default) What do you think about this approach? Do you have a better idea? I vote for .by!char to be the default. -- /Jacob Carlborg

Re: std.experimental.collections.rcstring and its integration in Phobos

2018-07-18 Thread Jacob Carlborg via Digitalmars-d
On 2018-07-18 13:37, Seb wrote: The problem here is this would also lead to very confusing behavior for newcomers, e.g. ``` "ä".split.join("|") == �|� ``` How about not giving access to operate on individual characters. If they need to do that they should operate on an array of bytes. Too c

Re: DMD, Vibe.d, and Dub

2018-07-18 Thread Jacob Carlborg via Digitalmars-d
On 2018-07-18 18:11, Martin Tschierschke wrote: Even if the needed libs are named different on different systems, it would be cool to collect the information what is needed in the dub.sdl/dub.json file. So directly at the beginning you get a hint what is missing. And how to fix it, especial

Re: Struct Initialization syntax

2018-07-23 Thread Jacob Carlborg via Digitalmars-d
On 2018-07-23 18:26, Seb wrote: tl;dr: the currently proposed syntax options are: --- struct S {     int a = 2, b = 4, c = 6; } void foo() {     bar(S({c: 10})); // Option 1     bar(S(c: 10));   // Option 2     bar(S{c: 10});   // Option 3 } --- So the struct-initialization DIP has been st

Re: Moving druntime into the DMD repository

2018-07-31 Thread Jacob Carlborg via Digitalmars-d
On 2018-07-27 13:03, Seb wrote: This a thread to explore whether it would be feasible to do so. Motivation -- DRuntime and DMD heavily depend on each other. It happens very often that a PR needs to touch both and then a complicated three-step (or sometimes four-step PR series) needs to

Re: @betterC, @TestBetterC , @betterCTest or @("betterC") to annotate Phobos's unittests?

2018-07-31 Thread Jacob Carlborg via Digitalmars-d
On 2018-07-29 16:21, Seb wrote: Phobos has recently gotten a primitive way to run betterC tests (https://github.com/dlang/phobos/pull/6640). Now, it would be really cool if we can annotate existing tests with e.g. `@betterCTest` and thus ensure that those tests work with -betterC (i.e. extract t

Re: Is there any good reason why C++ namespaces are "closed" in D?

2018-07-31 Thread Jacob Carlborg via Digitalmars-d
On 2018-07-31 10:12, Manu wrote: Given your favourite example: module a; extern(C++, ns) void foo(); module b; extern(C++, ns) void foo(); - module c; import a, b; foo(); // error: ambiguous ns.foo(); // error, ambiguous (obviously) a.ns.foo(); // naturally, this works... it's the

Re: Is there any hope for "lazy" and @nogc?

2018-07-31 Thread Jacob Carlborg via Digitalmars-d
On 2018-07-31 09:17, Shachar Shemesh wrote: I'm trying to figure out what's the signature of the built-in assert. It does not seem that I can define a similar function myself. First attempt: void myAssert(bool cond, string msg) @nogc nothrow; No, because msg gets evaluated unconditionally. voi

Re: Is there any hope for "lazy" and @nogc?

2018-08-04 Thread Jacob Carlborg via Digitalmars-d
On 2018-08-02 13:33, Steven Schveighoffer wrote: // variadic lazy paramters void bar(int delegate()[] items...) { writeln(items[0]()); writeln(items[1]()); writeln(items[2]()); } Adding @nogc to this example works. -- /Jacob Carlborg

Re: Is there any hope for "lazy" and @nogc?

2018-08-04 Thread Jacob Carlborg via Digitalmars-d
On 2018-08-02 13:33, Steven Schveighoffer wrote: // variadic lazy paramters void bar(int delegate()[] items...) { writeln(items[0]()); writeln(items[1]()); writeln(items[2]()); } I'm surprised that this doesn't need to be called with a delegate syntax, i.e. bar({ return 0; });

Re: Is there any hope for "lazy" and @nogc?

2018-08-04 Thread Jacob Carlborg via Digitalmars-d
On 2018-07-31 09:17, Shachar Shemesh wrote: I'm trying to figure out what's the signature of the built-in assert. It does not seem that I can define a similar function myself. First attempt: void myAssert(bool cond, string msg) @nogc nothrow; No, because msg gets evaluated unconditionally. voi

Re: Signed DMD binaries

2018-08-13 Thread Jacob Carlborg via Digitalmars-d
On 2018-08-13 20:48, Seb wrote: As a few of you might have noticed, we bought a Code Signing Certificate a few days ago and while we're still investigating on how to integrate the code signing best into the release process, I thought a share a first preview of signed DMD binaries with you. So

Re: Signed DMD binaries

2018-08-14 Thread Jacob Carlborg via Digitalmars-d
On Tuesday, 14 August 2018 at 14:42:54 UTC, Seb wrote: On Monday, 13 August 2018 at 19:09:55 UTC, Jacob Carlborg wrote: Any plans for doing the same thing for the installer on macOS? It complains that it's from an unidentified developer and forces the user to go into System Preferences and reop

Re: Signed DMD binaries

2018-08-16 Thread Jacob Carlborg via Digitalmars-d
On Wednesday, 15 August 2018 at 09:39:42 UTC, Radu wrote: The say this: ``` Note: Apple uses the industry-standard form and format of code signing certificates. Therefore, if your company already has a third-party signing identity that you use to sign code on other systems, you can use it wit

Using a C++ class in a D associative array

2018-08-20 Thread Jacob Carlborg via Digitalmars-d
I'm playing around with using the DMD frontend as a library. I wanted to store some nodes from the AST in a set. Since there doesn't seem to be a set container that is shipped with Phobos I wrapped an associative array and added some functions to use the AA as a set. To my surprise when I did

Re: Using a C++ class in a D associative array

2018-08-22 Thread Jacob Carlborg via Digitalmars-d
On 2018-08-21 02:07, kinke wrote: On Monday, 20 August 2018 at 22:16:09 UTC, Jacob Carlborg wrote: At the third line there's a call from object.TypeInfo_Class.getHash. I looked up to see what the "getHash" method is doing in druntime [2], the method looks like this: override size_t getHash(sc

Re: D is dead

2018-08-22 Thread Jacob Carlborg via Digitalmars-d
On Thursday, 23 August 2018 at 05:37:12 UTC, Shachar Shemesh wrote: One that hurt me lately was a way to pass a scoped lazy argument (i.e. - to specify that the implicit delegate need not allocate its frame, because it is not used outside the function call). I don't see why we just can't ad

Re: D is dead

2018-08-23 Thread Jacob Carlborg via Digitalmars-d
On Thursday, 23 August 2018 at 06:34:04 UTC, Shachar Shemesh wrote: Here's the interesting question, though: is this *going* to happen? I didn't know about the issue until you recently brought it up. -- /Jacob Carlborg

Re: Using a C++ class in a D associative array

2018-08-25 Thread Jacob Carlborg via Digitalmars-d
On 2018-08-22 23:00, kinke wrote: It could be simpler (and slower ;)) by using `m_flags & ClassFlags.isCPPclass`. There's Objective-C classes as well, which does not seem to have an entry in TypeInfo_Class.ClassFlags. -- /Jacob Carlborg

Re: DMD cross compiler

2018-09-03 Thread Jacob Carlborg via Digitalmars-d
On Saturday, 1 September 2018 at 20:12:24 UTC, Manu wrote: I know there's been discussion on this before, I just want a definitive reference. It looks like it would be relatively straight forward for DMD to be a cross-compiler. A few version() statements could be runtime if's, and that's pre

Re: Random thought: Alternative stuct

2018-09-05 Thread Jacob Carlborg via Digitalmars-d
On 2018-09-04 06:03, Mike Franklin wrote: My suggestion:  forget about ProtoObject and investing more into the resource pit that is classes.  Just make a better struct and supporting features so noone would even want to use classes anymore. For that it needs to support all the features as cla

Re: Random thought: Alternative stuct

2018-09-07 Thread Jacob Carlborg via Digitalmars-d
On 2018-09-06 07:17, Mike Franklin wrote: In general, classes, to me, are looking more and more like syntax sugar over existing fundamental language features Technically a programming language _is_ syntax sugar. -- /Jacob Carlborg

Re: Why is CI not running dmd's unittests?

2018-09-25 Thread Jacob Carlborg via Digitalmars-d
On 2018-09-22 15:29, wolframw wrote: Hi, I ran the dmd unittests on my Windows machine today and one of the tests in filename.d asserted. The cause for this has already been noticed a few days ago by someone else [1] but not by CI. Is it well-known that the dmd unittests (at least for the Wi

Re: Rather D1 then D2

2018-09-25 Thread Jacob Carlborg via Digitalmars-d
On 2018-09-22 10:48, Nemanja Borić wrote: So it is possible to use D2 language and compiler and avoid all the features that you don't like, at least to a reasonable degree, and as a bonus you still get to cherry pick D2 features you like (and there are some even for D1 minded person). Yeah,

Re: How to correctly deal with dmd.conf with multiple dmd installations - [ref osx, brew, digger]

2018-09-25 Thread Jacob Carlborg via Digitalmars-d
On 2018-09-25 13:55, Jonathan M Davis wrote: Yes. You want dmd.conf, or certain paths won't be set correctly (like where to find Phobos). Personally, I'd strongly suggest against having multiple copies of dmd installed at the same time. It just sounds like a recipe for disaster. Regardless, here

Re: Updating D beyond Unicode 2.0

2018-09-25 Thread Jacob Carlborg via Digitalmars-d
On 2018-09-21 18:27, Neia Neutuladh wrote: D's currently accepted identifier characters are based on Unicode 2.0: * ASCII range values are handled specially. * Letters and combining marks from Unicode 2.0 are accepted. * Numbers outside the ASCII range are accepted. * Eight random punctuation ma

Re: Warn on unused imports?

2018-09-25 Thread Jacob Carlborg via Digitalmars-d
On 2018-09-25 16:20, FeepingCreature wrote: If that's the way D wanted to go, it shouldn't have turned itself into a metaprogramming monster that's completely unevaluable by Linter tools, *or* it should offer some way to dump a fixed-format lowered representation with line number information t

Re: Warn on unused imports?

2018-09-27 Thread Jacob Carlborg via Digitalmars-d
On Wednesday, 26 September 2018 at 15:57:57 UTC, rikki cattermole wrote: For those who are unaware, dmd-fe for usage as a library is completely worthless currently. So not having the tags is probably a good thing. For those who are unaware I'm using it in one of my projects [1] and so far e

Re: Quick C bindings

2018-10-02 Thread Jacob Carlborg via Digitalmars-d
On 2018-09-29 20:29, Arun Chandrasekaran wrote: Dstep has got better. Give it a try now. Yes, it's gone through some major changes. Please compile from master if you give it a try. -- /Jacob Carlborg

Re: Yet another binding generator (WIP)

2018-10-02 Thread Jacob Carlborg via Digitalmars-d
On 2018-10-02 03:25, evilrat wrote: To be honest I don't know. Also dstep is written in D and using only 'stable' clang C API, right? Yes. This tool is based on full 'unstable' C++ API, so in theory it is possible to do broader range of features, such as template substitution for wrapper ge

Re: Deep nesting vs early returns

2018-10-02 Thread Jacob Carlborg via Digitalmars-d
On 2018-10-02 20:14, Andrei Alexandrescu wrote: Kate Gregory makes a good argument on something I've often commented in code reviews: https://youtu.be/n0Ak6xtVXno?t=2682 Swift has the "guard" statement to help with early returns (and unwrap optionals). https://thatthinginswift.com/guard-stat

Re: Deep nesting vs early returns

2018-10-04 Thread Jacob Carlborg via Digitalmars-d
On Tuesday, 2 October 2018 at 20:53:40 Is it: For optional binding, Swift 2 has sugar for if let !( ){} Or am I missing the point of the guard statement? The variable declared in the guard statement is available after the statement. It’s like an if statement without the then part, only an e

Re: Deep nesting vs early returns

2018-10-04 Thread Jacob Carlborg via Digitalmars-d
On Thursday, 4 October 2018 at 06:43:02 UTC, Gopan wrote: Certain people recommend that there be only one return statement (usually at the end) from a function. The said advantage is that, in a maintenance code, if you later want to do something before returning, you can add it just above the

Re: Forums intermittently going down?

2018-10-06 Thread Jacob Carlborg via Digitalmars-d
On 2018-10-05 22:32, H. S. Teoh wrote: Yes, and have it go down when things like the infamous AWS Outage happens. Centralization is evil. And you think that cannot happen when you're managing the hardware yourself? If you're hardware is not failing you're ISP still can. If you're really par

Re: Forums intermittently going down?

2018-10-06 Thread Jacob Carlborg via Digitalmars-d
On 2018-10-05 22:32, H. S. Teoh wrote: Yes, and have it go down when things like the infamous AWS Outage happens. Centralization is evil. How is having single server (I assume) behind a single ISP any less centralization than a cloud provider? Another advantage of using the cloud is that i

Re: DMD license question

2017-08-08 Thread Jacob Carlborg via Digitalmars-d
On 2017-08-07 23:56, Joakim wrote: Yes, the idea of the Boost Software License is that you don't have to ask such questions. Boost allows you to do anything you want with the source, whether embedding, modifying, etc. and you don't have to ask anyone for permission or even mention that you're u

Re: DMD license question

2017-08-08 Thread Jacob Carlborg via Digitalmars-d
On 2017-08-08 16:28, meppl wrote: in case your main application is written in D, too: how do you avoid symbol name collisions? D symbols are mangled to include the package and module name. That will make a collision less likely. -- /Jacob Carlborg

digitalmars-d@puremagic.com

2017-08-08 Thread Jacob Carlborg via Digitalmars-d
On 2017-08-08 20:51, Johan Engelen wrote: Hi all, Currently, it is not possible to call the C++ function "void foo(Klass&)" when Klass is an extern(C++) _class_ on the D side. You have to declare Klass as a D _struct_, otherwise there is no way to get the correct mangling. When Klass has virtu

Re: DMD license question

2017-08-08 Thread Jacob Carlborg via Digitalmars-d
On 2017-08-08 22:50, Jacob Carlborg wrote: On 2017-08-08 16:28, meppl wrote: in case your main application is written in D, too: how do you avoid symbol name collisions? D symbols are mangled to include the package and module name. That will make a collision less likely. The pseudo-handle

Re: HTOD

2017-08-22 Thread Jacob Carlborg via Digitalmars-d
On 2017-08-22 19:47, 12345swordy wrote: Use Clang frontend? DStep [1] is doing that. It handles both GCC and Microsoft extensions. [1] https://github.com/jacob-carlborg/dstep -- /Jacob Carlborg

Re: HTOD

2017-08-24 Thread Jacob Carlborg via Digitalmars-d
On 2017-08-23 15:25, 12345swordy wrote: "Doesn't translate C++ at all" That's very disappointing. IMO, it should at least aim for the c++ 11 feature via using clang. Pull requests are welcome :). BTW, to my knowledge D doesn't support any features added after C++98/03. -- /Jacob Carlborg

Re: What are we going to do about mobile?

2017-08-24 Thread Jacob Carlborg via Digitalmars-d
On 2017-08-24 12:47, James W Hofmann wrote: Which leads me to a great armchair proposal: D should support Excel spreadsheets ;) Not sure what you had in mind but have a look at: http://forum.dlang.org/post/ubheswgdpafyeyboh...@forum.dlang.org -- /Jacob Carlborg

Re: HTOD

2017-08-24 Thread Jacob Carlborg via Digitalmars-d
On 2017-08-24 17:02, 12345swordy wrote: They have plans to add c++ support? D can already link with C++, but not all features are supported. Like lambdas, for example, are not supported. -- /Jacob Carlborg

Re: HTOD

2017-08-25 Thread Jacob Carlborg via Digitalmars-d
On 2017-08-25 02:43, Walter Bright wrote: I have no idea how that would even work. Since lambdas are nested functions, how would one write one in D and have it nested inside C++ code? I thought C++ lambdas were implemented as structs with the call operator overloaded. -- /Jacob Carlborg

Re: HTOD

2017-08-25 Thread Jacob Carlborg via Digitalmars-d
On 2017-08-25 13:07, Atila Neves wrote: Correct, the lambda syntax is just syntatic sugar. But how would D support that? The name of the compiler-generated struct is known only to the compiler, there'd be no way to link to the code. I don't know. I haven't suggested this should be implemented

Re: HTOD

2017-08-27 Thread Jacob Carlborg via Digitalmars-d
On 2017-08-25 16:58, Walter Bright wrote: Right, but please show me an example of how that might be used. I've never suggested that this should be implemented. -- /Jacob Carlborg

Re: HTOD

2017-08-27 Thread Jacob Carlborg via Digitalmars-d
On 2017-08-26 23:32, 12345swordy wrote: I am not asking that, I'm asking regarding the project mention earlier. Adding support for C++ to DStep is a long term goal, yes. But the compiler still needs to support those features. Unless DStep is going to generate C wrappers, which I would like t

Re: HTOD

2017-08-28 Thread Jacob Carlborg via Digitalmars-d
On 2017-08-28 20:24, 12345swordy wrote: What compiler are you referring to? Clang? LDC? DMD? The D compilers, DMD and LDC. -- /Jacob Carlborg

Re: Function pointer from mangled name at runtime?

2017-09-03 Thread Jacob Carlborg via Digitalmars-d
On 2017-09-01 22:53, bitwise wrote: Basically, the problem is deserializing a scene-graph from a json text file. The architecture of my scene-graph enforces that some template-function will be instantiated for every symbol that is reflected. So what I'm trying to avoid is having to store all o

Re: dub projects generate docs and host on code.dlang.org?

2017-09-04 Thread Jacob Carlborg via Digitalmars-d
On 2017-09-04 12:47, Manu via Digitalmars-d wrote: I've seen a lot of dub projects with embedded ddoc that follows phobos example. These projects are then hosted on code.dlang.org , but often, the docs are never generated and hosted anywhere. In the event they are, links

Re: Iteration over structure fields and properties

2017-09-07 Thread Jacob Carlborg via Digitalmars-d
On 2017-09-06 09:36, Void-995 wrote: I really appreciate traits and what they are introducing into the process. I'm curious how I can iterate over all fields of the structure (s.tupleof pretty much works for that) and properties while ignoring methods and sub data types that defined inside of s

Re: Iteration over structure fields and properties

2017-09-08 Thread Jacob Carlborg via Digitalmars-d
On 2017-09-07 09:22, Void-995 wrote: Would it work with: @property int propertyNameA() No, for that you need the traits getFunctionAttributes [1] (I think all functions are returned) and getFunctionAttributes [2]. And how to get key names then? As I remember tupleof return tuple of fields

Re: Greetings, New IDE Development

2017-09-22 Thread Jacob Carlborg via Digitalmars-d
On 2017-09-16 21:38, Answar Enchali wrote: Does dmd support outputting the full ast with symbol type information and full line mapping or will these features have to be added? If they are to be added, what would be a ball part man-hour cost to add these features? If we are able to integrate D

Re: Simple web server benchmark - vibe.d is slower than node.js and Go?

2017-09-25 Thread Jacob Carlborg via Digitalmars-d
On 2017-09-24 20:36, Vadim Lopatin wrote: nuald reverted change which enables multithreading since it's "unfair". That's kind of stupid. In a real world scenario one would do everything possible to get the best performance. If one of the frameworks doesn't support mutlithreading, too bad for

Re: Finding class template instantiations via runtime reflection (for openmethods)

2017-09-25 Thread Jacob Carlborg via Digitalmars-d
On 2017-09-21 22:32, Jean-Louis Leroy wrote: It did not take long! Someone tried to create templatized open methods and it didn't work right of the box. I expected that, but in fact there may be a bit of hope. You cannot have virtual function templates in C++ or in D because the layout of the v

Re: Finding class template instantiations via runtime reflection (for openmethods)

2017-09-26 Thread Jacob Carlborg via Digitalmars-d
On 2017-09-25 16:24, Jean-Louis Leroy wrote: On Monday, 25 September 2017 at 14:17:13 UTC, Jacob Carlborg wrote: Of course, that's a bit of a PITA, but you would not be dependent on any bugs getting fixed or new features/improvements implemented. How do you do that? On Posix you use "dlopen"

Re: Finding class template instantiations via runtime reflection (for openmethods)

2017-09-27 Thread Jacob Carlborg via Digitalmars-d
On 2017-09-26 18:08, Jean-Louis Leroy wrote: Ah, I suspected that. I don't want to go down that path, what of Windows? But thanks anyway... It's possible to do the same on Windows (using LoadLibrary instead of dlopen). You would need to have separate code for each binary format. On Windows t

Re: Compile-time reflection and templates

2017-09-28 Thread Jacob Carlborg via Digitalmars-d
On 2017-09-27 21:47, Jean-Louis Leroy wrote: I'd like to go further: find the template arguments There was a pull request that implemented this [1]. But it was closed, added to many new traits. [1] https://github.com/dlang/dmd/pull/5201 -- /Jacob Carlborg

Re: D's SwitchStatement accepts statements with ridiculous semantics

2017-09-30 Thread Jacob Carlborg via Digitalmars-d
On 2017-09-29 21:56, Timon Gehr wrote: Well, I have used the switch(...) with(...) idiom you mentioned in the original post a few times, and I'm quite confident you'd meet some opposition if you were to break it. I've used that as well, but the other way around. I put the switch statement ins

Re: Should we add `a * b` for vectors?

2017-10-04 Thread Jacob Carlborg via Digitalmars-d
On 2017-10-05 00:59, Walter Bright wrote: An example would be appreciated. Timon's example requires guesswork as to what he intended, because it does not compile in ways unrelated to his point. It's supposed to not compile, because D doesn't have ADL. $ cat foo.d module foo; import std.range

Re: Default allocator of container plus element type

2017-10-05 Thread Jacob Carlborg via Digitalmars-d
On 2017-10-05 13:35, Nordlöw wrote: Would it be possible to set up a mapping (either formal or informal) of each typical container (such as array, linked-list etc) plus element type to a suitable default allocator? And perhaps add this to the documentation of `std.experimental.allocator`? I c

Re: Should we add `a * b` for vectors?

2017-10-09 Thread Jacob Carlborg via Digitalmars-d
On 2017-10-07 09:24, Walter Bright wrote: Even for something that's not C++'s fault, the C preprocesser, I scrapped and completely rewrote it 4 times, I believe. I think I finally got it right with Warp :-) You mean you got it right with D ;) -- /Jacob Carlborg

Re: Multiline string literal improvements

2017-10-12 Thread Jacob Carlborg via Digitalmars-d
On 2017-10-11 10:35, Walter Bright wrote: On 10/10/2017 3:16 PM, sarn wrote: Works even better in D because it can run at compile time. Yes, I see no need for a language feature what can be easily and far more flexibly done with a regular function - especially since what |q{ and -q{ do gives

Re: My first experience as a D Newbie

2017-10-12 Thread Jacob Carlborg via Digitalmars-d
On 2017-10-11 19:55, Steven Schveighoffer wrote: I have to say as someone who uses mostly non-windows systems, these problems only seem to crop up for Windows developers. I don't know if it's a different expectation or a different mindset or something else. In my experience it's more common

<    6   7   8   9   10   11   12   13   14   15   >