Re: Interpolated strings

2017-04-18 Thread Ola Fosheim Grøstad via Digitalmars-d
On Wednesday, 19 April 2017 at 03:49:09 UTC, bpr wrote: I don't think I've ever heard from Common Lisp, Scheme or Clojure programmers that they'd like to remove macros from their respective languages for the reasons you mention. I don't see the disasters there. The Julia folks looked at the Lis

Re: Immovable types

2017-04-18 Thread sarn via Digitalmars-d
On Wednesday, 19 April 2017 at 02:53:18 UTC, Stanislav Blinov wrote: I'd very much like to hear your thoughts on this, good/bad, if it already was proposed, anything. If it's found feasible, I could start a DIP. Destroy, please. I don't have comments about the syntax, but I did want this feat

Re: Optilink bugs(or DMD)

2017-04-18 Thread Stefan Koch via Digitalmars-d
On Wednesday, 19 April 2017 at 03:52:54 UTC, Nierjerson wrote: Major optilink bugs, blocker. Code is long but demonstrates the issue. Compiles with ldc. [...] There are two instances of void ForegroundColor(cSolidColor rhs)

Re: Optilink bugs(or DMD)

2017-04-18 Thread ketmar via Digitalmars-d
Nierjerson wrote: Major optilink bugs, blocker. not at optlink bug.

Optilink bugs(or DMD)

2017-04-18 Thread Nierjerson via Digitalmars-d
Major optilink bugs, blocker. Code is long but demonstrates the issue. Compiles with ldc. The source is large so I uploaded it https://ufile.io/odaee or https://files.fm/u/frmks29t OPTLINK (R) for Win32 Release 8.00.17 Copyright (C) Digital Mars 1989-2013 All rights reserved. http://www

Re: Interpolated strings

2017-04-18 Thread bpr via Digitalmars-d
On Wednesday, 19 April 2017 at 00:30:31 UTC, Walter Bright wrote: I'm not saying you cannot do cool and useful things with AST macros. My position is it encourages absolutely awful code as (usually inexperienced) programmers compete to show how clever their macros are. I'd think that that's a

Immovable types

2017-04-18 Thread Stanislav Blinov via Digitalmars-d
Currently, we have the ability to disable postblit and/or assignments, thus create non-copyable types. But it is always assumed that a value can be moved. Normally, this is great, as we don't have to deal with additional constructors explicitly. There are, however, occasions when move is undesi

Re: Interpolated strings

2017-04-18 Thread Jon Degenhardt via Digitalmars-d
On Saturday, 15 April 2017 at 20:04:13 UTC, Jonas Drewsen wrote: I've been wanting to have support for interpolated strings in D for some time now that will allow you to write e.g.: [...] One place I'd appreciate interpolated strings is as an option when working with heredoc strings. These

Re: Interpolated strings

2017-04-18 Thread Walter Bright via Digitalmars-d
On 4/18/2017 4:58 PM, bpr wrote: Here's how it's done in Nim, a statically typed language similar to D, but with Python syntax, and macros. It takes some knowledge to understand, sure, macros are not a beginner tool, but wouldn't say this is extremely complex. I bet a D-with-macros would have a s

Re: Interpolated strings

2017-04-18 Thread Walter Bright via Digitalmars-d
On 4/18/2017 2:56 PM, Jonathan Marler wrote: Have you thought about supporting format specifiers as well? I looked at the C# version and it looks like they can specify them using a colon like this: $"{a} in hex is {a:x}" There are additional problems, such as: $"{a} in %s {b}" and p

Re: Interpolated strings

2017-04-18 Thread bpr via Digitalmars-d
On Tuesday, 18 April 2017 at 08:01:14 UTC, Jacob Carlborg wrote: On 2017-04-18 08:59, Stefan Koch wrote: The corresponding ast-macros would be extremely complex No, it's not that complex. Here's how it's done in Nim, a statically typed language similar to D, but with Python syntax, and mac

Re: Interpolated strings

2017-04-18 Thread Faux Amis via Digitalmars-d
On 2017-04-18 23:56, Jonathan Marler wrote: I've thought about it and decided, I like this idea. I've only used interpolated strings in PHP which left a bad taste, but I realized that interpolating strings makes it impossible for your format string and your arguments to get out of sync. This m

Re: Interpolated strings

2017-04-18 Thread H. S. Teoh via Digitalmars-d
On Tue, Apr 18, 2017 at 09:56:28PM +, Jonathan Marler via Digitalmars-d wrote: [...] > I've thought about it and decided, I like this idea. I've only used > interpolated strings in PHP which left a bad taste, but I realized > that interpolating strings makes it impossible for your format stri

Re: Interpolated strings

2017-04-18 Thread Jonathan Marler via Digitalmars-d
On Tuesday, 18 April 2017 at 08:50:07 UTC, Walter Bright wrote: On 4/15/2017 4:51 PM, cym13 wrote: Removing imports is a good point, the first concrete one to be mentionned. I'm not sure it matters that much though as I think those imports are generic enough that I believe they would be importe

Re: Thoughts from newcommer

2017-04-18 Thread Andrei Alexandrescu via Digitalmars-d
On 04/18/2017 03:00 AM, Shachar Shemesh wrote: D would have the ability to have a nice container that would do RAII (for classes since for structs, __dtors are called automatically) That's just it, though. They are not. Not reliably. Yah, clearly there's a problem with the language implementa

Re: Thoughts from newcommer

2017-04-18 Thread Andrei Alexandrescu via Digitalmars-d
On 04/18/2017 10:55 AM, Russel Winder via Digitalmars-d wrote: On Tue, 2017-04-18 at 09:23 -0400, Andrei Alexandrescu via Digitalmars- d wrote: On 4/18/17 8:48 AM, prdan wrote: Thanks, maybe I will write a blog post about my experiences also. That would be great! Michael Parker may be of help

Re: D, SCons, Dub

2017-04-18 Thread H. S. Teoh via Digitalmars-d
On Tue, Apr 18, 2017 at 07:34:34AM +, Alex via Digitalmars-d wrote: [...] > I realise there are no headers, that is the problem. SCons can't tell > whether a change to a module affects the interface, only affects the > implementation or only affects a unit test. This means everything that > imp

Re: Thoughts from newcommer

2017-04-18 Thread Russel Winder via Digitalmars-d
On Tue, 2017-04-18 at 09:23 -0400, Andrei Alexandrescu via Digitalmars- d wrote: > On 4/18/17 8:48 AM, prdan wrote: > > Thanks, maybe I will write a blog post about my experiences also. > > That would be great! Michael Parker may be of help if you consider  > publishing in the official D Blog. --

Re: Thoughts from newcommer

2017-04-18 Thread Andrei Alexandrescu via Digitalmars-d
On 4/18/17 8:48 AM, prdan wrote: Thanks, maybe I will write a blog post about my experiences also. That would be great! Michael Parker may be of help if you consider publishing in the official D Blog. -- Andrei

Re: Thoughts from newcommer

2017-04-18 Thread prdan via Digitalmars-d
On Tuesday, 18 April 2017 at 12:22:10 UTC, Andrei Alexandrescu wrote: Cool, thanks for this work! However, a word of caution - experiments ran on different CPUs can't count as comparable. I didn't compare D times to numbers from benchmarks game site. I've ran other languages on the same CPU

Re: Thoughts from newcommer

2017-04-18 Thread rikki cattermole via Digitalmars-d
On 18/04/2017 1:22 PM, Andrei Alexandrescu wrote: On 04/17/2017 10:57 PM, prdan wrote: I've written multi-threaded regex-redux benchmark for D language and made some tests. This is my first program written in D, I didn't know much about D a week ago. Here are the results for other languages: h

Re: Thoughts from newcommer

2017-04-18 Thread Andrei Alexandrescu via Digitalmars-d
On 04/17/2017 10:57 PM, prdan wrote: I've written multi-threaded regex-redux benchmark for D language and made some tests. This is my first program written in D, I didn't know much about D a week ago. Here are the results for other languages: http://benchmarksgame.alioth.debian.org/u64q/regexre

Re: Interpolated strings

2017-04-18 Thread Kagamin via Digitalmars-d
On Tuesday, 18 April 2017 at 08:50:07 UTC, Walter Bright wrote: It may not be necessary to have any dependencies on any import. $"{a} times 3 is {a*3}" could be rewritten by the parser to: "%s times 3 is %s", a, a * 3 and that is that. (I.e. just an AST rewrite.) It would be quite a

Re: Interpolated strings

2017-04-18 Thread Jacob Carlborg via Digitalmars-d
On 2017-04-18 10:50, Walter Bright wrote: It may not be necessary to have any dependencies on any import. $"{a} times 3 is {a*3}" could be rewritten by the parser to: "%s times 3 is %s", a, a * 3 and that is that. (I.e. just an AST rewrite.) It would be quite a bit simpler than Jonas

Re: Thoughts from newcommer

2017-04-18 Thread prdan via Digitalmars-d
On Tuesday, 18 April 2017 at 07:22:29 UTC, thedeemon wrote: Which compiler did you use for D? I've used newest LDC. In benchmarks where some fixed amount of work should be done as fast as possible low CPU usage is not a good sign, it just means some cores were idle when they could really be

Re: Thoughts from newcommer

2017-04-18 Thread Guillaume Piolat via Digitalmars-d
On Tuesday, 18 April 2017 at 07:22:29 UTC, thedeemon wrote: In benchmarks where some fixed amount of work should be done as fast as possible low CPU usage is not a good sign, it just means some cores were idle when they could really be working. Minor note: sometimes high CPU usage isn't good e

Re: Interpolated strings

2017-04-18 Thread Walter Bright via Digitalmars-d
On 4/15/2017 4:51 PM, cym13 wrote: Removing imports is a good point, the first concrete one to be mentionned. I'm not sure it matters that much though as I think those imports are generic enough that I believe they would be imported anyway, but it's a real point. It may not be necessary to have

Re: Interpolated strings

2017-04-18 Thread Walter Bright via Digitalmars-d
On 4/15/2017 1:04 PM, Jonas Drewsen wrote: [...] Thanks for doing the work to make a sample implementation, too. I don't know if this will make it into D, but Jonas is a fine example of a champion.

Re: Interpolated strings

2017-04-18 Thread Jacob Carlborg via Digitalmars-d
On 2017-04-18 08:59, Stefan Koch wrote: The corresponding ast-macros would be extremely complex No, it's not that complex. , slow and worst of all not checkable. What do you mean "not checkable"? -- /Jacob Carlborg

Re: D, SCons, Dub

2017-04-18 Thread Russel Winder via Digitalmars-d
On Tue, 2017-04-18 at 07:34 +, Alex via Digitalmars-d wrote: > […] > I know, I have been using your work in SCons to build in this  > mode since it was first available. Excellent. :-) […] > > > > I realise there are no headers, that is the problem. SCons can't  > tell whether a change to a

Re: D, SCons, Dub

2017-04-18 Thread Alex via Digitalmars-d
On Tuesday, 18 April 2017 at 06:51:51 UTC, Russel Winder wrote: I have been trying to do the opposite with scons - incremental builds. In c++ the .h and .cpp files allowed the compilation from many edits to be limited to one translation unit. Per module compilation then linking is the default

Re: Thoughts from newcommer

2017-04-18 Thread thedeemon via Digitalmars-d
On Tuesday, 18 April 2017 at 02:57:59 UTC, prdan wrote: I've written multi-threaded regex-redux benchmark for D language and made some tests. Nice! Rust version 1.16 (newest stable) GCC ver 4.9.2 (newest debian 8 stable) Which compiler did you use for D? C was the fastest (1.32) but used t

Re: Thoughts from newcommer

2017-04-18 Thread Shachar Shemesh via Digitalmars-d
D would have the ability to have a nice container that would do RAII (for classes since for structs, __dtors are called automatically) That's just it, though. They are not. Not reliably. Shachar

Re: Interpolated strings

2017-04-18 Thread Stefan Koch via Digitalmars-d
On Tuesday, 18 April 2017 at 06:54:11 UTC, Jacob Carlborg wrote: On 2017-04-17 21:28, Jonas Drewsen wrote: The page could also list pre-approved language changes such as async functions (which Walter wants afaik). Another feature that can be implemented with AST macros. This is starting to g

Re: D, SCons, Dub

2017-04-18 Thread Russel Winder via Digitalmars-d
On Mon, 2017-04-17 at 18:53 +, Nordlöw via Digitalmars-d wrote: > […] > Nice. I'm using SCons in my everyday development. I'll give your  > feature a try. My pull request is currently being reviewed and some updates are needed. These will appear immediately in the SCons_D_Experiment. I'll pos