December 13, 2017
On Wednesday, 13 December 2017 at 06:53:02 UTC, rikki cattermole wrote:
> On 13/12/2017 6:46 AM, bauss wrote:
>> On Wednesday, 13 December 2017 at 01:14:26 UTC, Seb wrote:
>>> On Wednesday, 13 December 2017 at 00:32:11 UTC, rikki cattermole wrote:
>>>> On 12/12/2017 6:37 PM, Seb wrote:
>>>>> === Supported D Compilers ===
>>>>>
>>>>> * Latest DMD nightly
>>>>> * Latest DMD beta
>>>>> * Latest DMD
>>>>> * Latest LDC beta
>>>>> * Latest LDC
>>>>>
>>>>> The Docker images are rebuilt every day automatically.
>>>>
>>>> Can we please select a version we want to test against?
>>>
>>> While it would be rather easier to build more Docker images [1] and add them to the tour [2], I fear that this will be too much maintenance overhead and will lead to outdated compiler soon.
>>> Also the storage on the machine is limited and we can't drop an unlimited amount of Docker images there.
>>>
>>> [1] https://github.com/dlang-tour/core-exec
>>> [2] https://github.com/dlang-tour/core/blob/master/source/exec/docker.d#L22
>> 
>> What you could do is support the 3 latest versions of the compilers.
>> 
>> Ex. for DMD you would support:
>> 2.077.1
>> 2.076.1
>> 2.075.1
>
> Also the older c++ version (2.06x.x).

Shouldn't DMD be stable enough that latest is good enough for everyone?
As mentioned, I'm afraid that it will look similar like: http://asm.dlang.org
And FWIW before I started updating Wikipedia and our DWiki even the versions there got outdated.

Anyhow, everything is entirely automated, so if someone volunteers to make the update PRs to:

- https://github.com/dlang-tour/core-exec/blob/master/.travis.yml
- https://github.com/dlang-tour/core/blob/master/source/exec/docker.d#L22
- https://github.com/dlang-tour/core/blob/master/views/editor.dt#L27

I wouldn't mind.
December 13, 2017
On Wednesday, December 13, 2017 06:53:02 rikki cattermole via Digitalmars-d- announce wrote:
> On 13/12/2017 6:46 AM, bauss wrote:
> > On Wednesday, 13 December 2017 at 01:14:26 UTC, Seb wrote:
> >> On Wednesday, 13 December 2017 at 00:32:11 UTC, rikki cattermole wrote:
> >>> On 12/12/2017 6:37 PM, Seb wrote:
> >>>> === Supported D Compilers ===
> >>>>
> >>>> * Latest DMD nightly
> >>>> * Latest DMD beta
> >>>> * Latest DMD
> >>>> * Latest LDC beta
> >>>> * Latest LDC
> >>>>
> >>>> The Docker images are rebuilt every day automatically.
> >>>
> >>> Can we please select a version we want to test against?
> >>
> >> While it would be rather easier to build more Docker images [1] and
> >> add them to the tour [2], I fear that this will be too much
> >> maintenance overhead and will lead to outdated compiler soon.
> >> Also the storage on the machine is limited and we can't drop an
> >> unlimited amount of Docker images there.
> >>
> >> [1] https://github.com/dlang-tour/core-exec
> >> [2]
> >> https://github.com/dlang-tour/core/blob/master/source/exec/docker.d#L22
> >
> > What you could do is support the 3 latest versions of the compilers.
> >
> > Ex. for DMD you would support:
> > 2.077.1
> > 2.076.1
> > 2.075.1
>
> Also the older c++ version (2.06x.x).

What would be the point of that? That's old enough that no one should really be using it. Targetting it just runs the risk of your code not working with a recent version of the compiler and standard library.

- Jonathan M Davis

December 13, 2017
On 13/12/2017 7:56 AM, Jonathan M Davis wrote:
> On Wednesday, December 13, 2017 06:53:02 rikki cattermole via Digitalmars-d-
> announce wrote:
>> On 13/12/2017 6:46 AM, bauss wrote:
>>> On Wednesday, 13 December 2017 at 01:14:26 UTC, Seb wrote:
>>>> On Wednesday, 13 December 2017 at 00:32:11 UTC, rikki cattermole wrote:
>>>>> On 12/12/2017 6:37 PM, Seb wrote:
>>>>>> === Supported D Compilers ===
>>>>>>
>>>>>> * Latest DMD nightly
>>>>>> * Latest DMD beta
>>>>>> * Latest DMD
>>>>>> * Latest LDC beta
>>>>>> * Latest LDC
>>>>>>
>>>>>> The Docker images are rebuilt every day automatically.
>>>>>
>>>>> Can we please select a version we want to test against?
>>>>
>>>> While it would be rather easier to build more Docker images [1] and
>>>> add them to the tour [2], I fear that this will be too much
>>>> maintenance overhead and will lead to outdated compiler soon.
>>>> Also the storage on the machine is limited and we can't drop an
>>>> unlimited amount of Docker images there.
>>>>
>>>> [1] https://github.com/dlang-tour/core-exec
>>>> [2]
>>>> https://github.com/dlang-tour/core/blob/master/source/exec/docker.d#L22
>>>
>>> What you could do is support the 3 latest versions of the compilers.
>>>
>>> Ex. for DMD you would support:
>>> 2.077.1
>>> 2.076.1
>>> 2.075.1
>>
>> Also the older c++ version (2.06x.x).
> 
> What would be the point of that? That's old enough that no one should really
> be using it. Targetting it just runs the risk of your code not working with
> a recent version of the compiler and standard library.
> 
> - Jonathan M Davis

One word, dmd.

December 13, 2017
On Wednesday, December 13, 2017 08:04:19 rikki cattermole via Digitalmars-d- announce wrote:
> On 13/12/2017 7:56 AM, Jonathan M Davis wrote:
> > On Wednesday, December 13, 2017 06:53:02 rikki cattermole via
> > Digitalmars-d->
> > announce wrote:
> >> On 13/12/2017 6:46 AM, bauss wrote:
> >>> On Wednesday, 13 December 2017 at 01:14:26 UTC, Seb wrote:
> >>>> On Wednesday, 13 December 2017 at 00:32:11 UTC, rikki cattermole
wrote:
> >>>>> On 12/12/2017 6:37 PM, Seb wrote:
> >>>>>> === Supported D Compilers ===
> >>>>>>
> >>>>>> * Latest DMD nightly
> >>>>>> * Latest DMD beta
> >>>>>> * Latest DMD
> >>>>>> * Latest LDC beta
> >>>>>> * Latest LDC
> >>>>>>
> >>>>>> The Docker images are rebuilt every day automatically.
> >>>>>
> >>>>> Can we please select a version we want to test against?
> >>>>
> >>>> While it would be rather easier to build more Docker images [1] and
> >>>> add them to the tour [2], I fear that this will be too much
> >>>> maintenance overhead and will lead to outdated compiler soon.
> >>>> Also the storage on the machine is limited and we can't drop an
> >>>> unlimited amount of Docker images there.
> >>>>
> >>>> [1] https://github.com/dlang-tour/core-exec
> >>>> [2]
> >>>> https://github.com/dlang-tour/core/blob/master/source/exec/docker.d#L
> >>>> 22
> >>>
> >>> What you could do is support the 3 latest versions of the compilers.
> >>>
> >>> Ex. for DMD you would support:
> >>> 2.077.1
> >>> 2.076.1
> >>> 2.075.1
> >>
> >> Also the older c++ version (2.06x.x).
> >
> > What would be the point of that? That's old enough that no one should really be using it. Targetting it just runs the risk of your code not working with a recent version of the compiler and standard library.
> >
> > - Jonathan M Davis
>
> One word, dmd.

What about it?

- Jonathan M Davis

December 13, 2017
On 13/12/2017 8:11 AM, Jonathan M Davis wrote:
> On Wednesday, December 13, 2017 08:04:19 rikki cattermole via Digitalmars-d-
> announce wrote:
>> On 13/12/2017 7:56 AM, Jonathan M Davis wrote:
>>> On Wednesday, December 13, 2017 06:53:02 rikki cattermole via
>>> Digitalmars-d->
>>> announce wrote:
>>>> On 13/12/2017 6:46 AM, bauss wrote:
>>>>> On Wednesday, 13 December 2017 at 01:14:26 UTC, Seb wrote:
>>>>>> On Wednesday, 13 December 2017 at 00:32:11 UTC, rikki cattermole
> wrote:
>>>>>>> On 12/12/2017 6:37 PM, Seb wrote:
>>>>>>>> === Supported D Compilers ===
>>>>>>>>
>>>>>>>> * Latest DMD nightly
>>>>>>>> * Latest DMD beta
>>>>>>>> * Latest DMD
>>>>>>>> * Latest LDC beta
>>>>>>>> * Latest LDC
>>>>>>>>
>>>>>>>> The Docker images are rebuilt every day automatically.
>>>>>>>
>>>>>>> Can we please select a version we want to test against?
>>>>>>
>>>>>> While it would be rather easier to build more Docker images [1] and
>>>>>> add them to the tour [2], I fear that this will be too much
>>>>>> maintenance overhead and will lead to outdated compiler soon.
>>>>>> Also the storage on the machine is limited and we can't drop an
>>>>>> unlimited amount of Docker images there.
>>>>>>
>>>>>> [1] https://github.com/dlang-tour/core-exec
>>>>>> [2]
>>>>>> https://github.com/dlang-tour/core/blob/master/source/exec/docker.d#L
>>>>>> 22
>>>>>
>>>>> What you could do is support the 3 latest versions of the compilers.
>>>>>
>>>>> Ex. for DMD you would support:
>>>>> 2.077.1
>>>>> 2.076.1
>>>>> 2.075.1
>>>>
>>>> Also the older c++ version (2.06x.x).
>>>
>>> What would be the point of that? That's old enough that no one should
>>> really be using it. Targetting it just runs the risk of your code not
>>> working with a recent version of the compiler and standard library.
>>>
>>> - Jonathan M Davis
>>
>> One word, dmd.
> 
> What about it?
> 
> - Jonathan M Davis

It is required to be compiled by (I think) 2.068.2 for bootstrapping purposes.

So at the very least there is one code base in very active use by the D community using such an old version. Can't ignore it.
December 13, 2017
On Wednesday, December 13, 2017 08:33:36 rikki cattermole via Digitalmars-d- announce wrote:
> On 13/12/2017 8:11 AM, Jonathan M Davis wrote:
> > On Wednesday, December 13, 2017 08:04:19 rikki cattermole via
> > Digitalmars-d->
> > announce wrote:
> >> On 13/12/2017 7:56 AM, Jonathan M Davis wrote:
> >>> On Wednesday, December 13, 2017 06:53:02 rikki cattermole via Digitalmars-d->
> >>>
> >>> announce wrote:
> >>>> On 13/12/2017 6:46 AM, bauss wrote:
> >>>>> On Wednesday, 13 December 2017 at 01:14:26 UTC, Seb wrote:
> >>>>>> On Wednesday, 13 December 2017 at 00:32:11 UTC, rikki cattermole
> >
> > wrote:
> >>>>>>> On 12/12/2017 6:37 PM, Seb wrote:
> >>>>>>>> === Supported D Compilers ===
> >>>>>>>>
> >>>>>>>> * Latest DMD nightly
> >>>>>>>> * Latest DMD beta
> >>>>>>>> * Latest DMD
> >>>>>>>> * Latest LDC beta
> >>>>>>>> * Latest LDC
> >>>>>>>>
> >>>>>>>> The Docker images are rebuilt every day automatically.
> >>>>>>>
> >>>>>>> Can we please select a version we want to test against?
> >>>>>>
> >>>>>> While it would be rather easier to build more Docker images [1] and
> >>>>>> add them to the tour [2], I fear that this will be too much
> >>>>>> maintenance overhead and will lead to outdated compiler soon.
> >>>>>> Also the storage on the machine is limited and we can't drop an
> >>>>>> unlimited amount of Docker images there.
> >>>>>>
> >>>>>> [1] https://github.com/dlang-tour/core-exec
> >>>>>> [2]
> >>>>>> https://github.com/dlang-tour/core/blob/master/source/exec/docker.d
> >>>>>> #L
> >>>>>> 22
> >>>>>
> >>>>> What you could do is support the 3 latest versions of the compilers.
> >>>>>
> >>>>> Ex. for DMD you would support:
> >>>>> 2.077.1
> >>>>> 2.076.1
> >>>>> 2.075.1
> >>>>
> >>>> Also the older c++ version (2.06x.x).
> >>>
> >>> What would be the point of that? That's old enough that no one should really be using it. Targetting it just runs the risk of your code not working with a recent version of the compiler and standard library.
> >>>
> >>> - Jonathan M Davis
> >>
> >> One word, dmd.
> >
> > What about it?
> >
> > - Jonathan M Davis
>
> It is required to be compiled by (I think) 2.068.2 for bootstrapping
> purposes.
>
> So at the very least there is one code base in very active use by the D community using such an old version. Can't ignore it.

I don't see how that really has anything to do with a website that's used to test snippets of code, and the reality of the matter is that there's pretty much no way that dmd is going to continue to be compatible with that version of the language forever - especially with all of the stuff that Walter has been doing with scope. At some point, backwards compatibility will be sufficiently broken that dmd won't be able to compile with both 2.068.2 and the most recent version, meaning that bootstrapping will have to be done in more steps, or it will have to be done via cross-compiling. Regardless, it's not like anyone is going to be using run.dlang.io for building dmd.

- Jonathan M Davis

December 14, 2017
On Wednesday, 13 December 2017 at 00:54:07 UTC, H. S. Teoh wrote:
> On Wed, Dec 13, 2017 at 12:50:40AM +0000, Meta via Digitalmars-d-announce wrote:
>> On Tuesday, 12 December 2017 at 18:37:38 UTC, Seb wrote:
>> > After it has been in stealth mode for quite a while, I'm happy to announce that there's https://run.dlang.io
> [...]
>> This is a real life saver considering dpaste is blocked at work. It gets very tedious having to create a file, invoke the compiler, and run it in 3 separate steps just to test out some quick snippet.
>
> Can't you just do:
>
> 	rdmd --eval='<insert code here>'
>
> ?
>
>
> T

This works for short snippets that are one-off but I usually like to play around with a piece of code and that gets tedious as well trying to edit it on the command line. Not to mention trying to get quotation marks to match up and escape them correctly.
December 13, 2017
On Thu, Dec 14, 2017 at 12:22:15AM +0000, Meta via Digitalmars-d-announce wrote:
> On Wednesday, 13 December 2017 at 00:54:07 UTC, H. S. Teoh wrote:
> > On Wed, Dec 13, 2017 at 12:50:40AM +0000, Meta via Digitalmars-d-announce wrote:
> > > On Tuesday, 12 December 2017 at 18:37:38 UTC, Seb wrote:
> > > > After it has been in stealth mode for quite a while, I'm happy to announce that there's https://run.dlang.io
> > [...]
> > > This is a real life saver considering dpaste is blocked at work. It gets very tedious having to create a file, invoke the compiler, and run it in 3 separate steps just to test out some quick snippet.
> > 
> > Can't you just do:
> > 
> > 	rdmd --eval='<insert code here>'
[...]
> This works for short snippets that are one-off but I usually like to play around with a piece of code and that gets tedious as well trying to edit it on the command line. Not to mention trying to get quotation marks to match up and escape them correctly.

If you need to edit the code, you might as well use an editor anyway, and if you use a Real Editor (:-P) like vim or emacs you *could* just bind a single keystroke to invoking `dmd -run`.

Or better yet, use the new `dmd -` to compile the code directly from the editor buffer via stdin, with `-of` set to some generic filename (I like to use /tmp/text or /tmp/x, for example), then your keybinding could be something like `| dmd - -of /tmp/test && ./test`.  Then you could literally execute the editor buffer with one keystroke.  And this works even when you're offline.

Sadly, `dmd - -run` currently doesn't quite work just yet. I should look into fixing that.  And *then* we wouldn't need to invent a temporary filename for the executable in our keybinding.

(Of course, none of this negates the value of run.dlang.io -- I'm not arguing against that. It's just that testing out quick snippets seems to be a flimsy excuse to need to use it. :-P)


T

-- 
Heads I win, tails you lose.
December 13, 2017
On Wed, Dec 13, 2017 at 04:59:00PM -0800, H. S. Teoh via Digitalmars-d-announce wrote: [...]
> Sadly, `dmd - -run` currently doesn't quite work just yet. I should look into fixing that.  And *then* we wouldn't need to invent a temporary filename for the executable in our keybinding.
[...]

Turns out, the code change to make this happen is trivial:

	https://github.com/dlang/dmd/pull/7435

With this PR, you can compile and run code in standard input without needing to specify any filenames:

$ echo 'import std.stdio; void main() { writeln("Hello, World!"); }' | dmd -run -
Hello, World!
$

Of course, piping the output of `echo` to dmd isn't a big deal. A more interesting use case is being able to pipe the contents of an editor buffer to dmd as input, and instantly receiving the program output in the editor.

For example, I can open a new window in Vim (no filename), and type in
the following contents:

------
import std.stdio;
void main() {
	writeln("Instant win!");
}
------

Then type:

	:0,$!dmd -run -

and the buffer contents are now:

------
Instant win!
------

(In English, the vim magic word above means:
	:		Enter command mode
	0,$		Take the range of lines from 0 to the end of file
	!		And filter these lines by a shell command
	dmd -run -	The command to run
)

This can, of course, be bound to a custom keybinding, then you'll have your one-stop shop for compiling D snippets without ever seeing (much less typing) any temporary filenames. And without needing an internet connection.

Instant win!  :-P


T

-- 
When solving a problem, take care that you do not become part of the problem.
December 14, 2017
On Wednesday, 13 December 2017 at 01:14:26 UTC, Seb wrote:
> Also the storage on the machine is limited and we can't drop an unlimited amount of Docker images there.

Shouldn't the overhead from that be fairly manageable? After all, the last layer would only be as large as a single DMD/LDC installation. Surely you would have at least a few gigabytes spare on the server?

 — David