www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.announce - run.dlang.io - a modern way to run D code

reply Seb <seb wilzba.ch> writes:
After it has been in stealth mode for quite a while, I'm happy to 
announce that there's https://run.dlang.io

=== Features ===

* Color-highlighted DMD errors
* Format source code with dfmt
* Generate a short URL for link sharing
* Import/Export to GitHub Gist
* Typical key shortcuts like CTRL+Enter -> Run
* Build cache for fast execution of common examples (e.g. the 
ones on front page of dlang.org)
* Usable on your phone
* Integrated with dlang.org (you can open any example on 
dlang.org in run.dlang.io by clicking the right arrow button)
* Integrated with tour.dlang.org (you can open any example on the 
DTour in run.dlang.io by clicking on the "Export" button)

=== Supported D Compilers ===

* Latest DMD nightly
* Latest DMD beta
* Latest DMD
* Latest LDC beta
* Latest LDC

The Docker images are rebuilt every day automatically.

=== Running DUB packages ===

Via "Add library" DUB packages can be added to the build.
Currently only a whitelist of packages is allowed.
Examples:

mir: https://run.dlang.io/is/FIc6rd
mir-algorithm: https://run.dlang.io/is/3pNRH8

=== DReg ===

When I watched CyberShadow's Bugzilla cruise [1] I spotted this 
amazing tool dreg [2] and it's not that hard to build a docker 
image [3] for it and make it available for everyone, s.t. no 
setup is required.
Dreg allows running old versions of the D compiler in parallel 
and compares their output.
However, it's a lot easier to show than to explain:

https://run.dlang.io/is/ckNT9i
https://run.dlang.io/is/UZhQDh

Currently all versions from 2.060 up to the latest greatest 
2.077.1 are run, so the execution will take a bit longer than a 
single run.

[1] https://youtu.be/qpUTvMokTCs
[2] https://github.com/CyberShadow/misc/blob/master/dreg.d
[3] https://github.com/dlang-tour/core-dreg


=== Source code & report issues ===

Please don't hesitate to open issues or submit pull requests:

-> https://github.com/dlang-tour/core

(it uses Vibe.d)
Dec 12 2017
next sibling parent reply rikki cattermole <rikki cattermole.co.nz> writes:
On 12/12/2017 6:37 PM, 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
 
 === Features ===
 
 * Color-highlighted DMD errors
 * Format source code with dfmt
 * Generate a short URL for link sharing
s/shorten/permalink/ Or something else more obvious.
 * Import/Export to GitHub Gist
 * Typical key shortcuts like CTRL+Enter -> Run
 * Build cache for fast execution of common examples (e.g. the ones on 
 front page of dlang.org)
 * Usable on your phone
 * Integrated with dlang.org (you can open any example on dlang.org in 
 run.dlang.io by clicking the right arrow button)
 * Integrated with tour.dlang.org (you can open any example on the DTour 
 in run.dlang.io by clicking on the "Export" button)
 
 === 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?
Dec 12 2017
parent reply Seb <seb wilzba.ch> writes:
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
Dec 12 2017
next sibling parent reply bauss <jj_1337 live.dk> writes:
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
Dec 12 2017
parent reply rikki cattermole <rikki cattermole.co.nz> writes:
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).
Dec 12 2017
next sibling parent Seb <seb wilzba.ch> writes:
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.
Dec 12 2017
prev sibling parent reply Jonathan M Davis <newsgroup.d jmdavisprog.com> writes:
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
Dec 12 2017
parent reply rikki cattermole <rikki cattermole.co.nz> writes:
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.
Dec 13 2017
parent reply Jonathan M Davis <newsgroup.d jmdavisprog.com> writes:
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
Dec 13 2017
parent reply rikki cattermole <rikki cattermole.co.nz> writes:
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.
Dec 13 2017
parent Jonathan M Davis <newsgroup.d jmdavisprog.com> writes:
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
Dec 13 2017
prev sibling next sibling parent reply David Nadlinger <code klickverbot.at> writes:
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
Dec 13 2017
parent reply Seb <seb wilzba.ch> writes:
On Thursday, 14 December 2017 at 02:57:42 UTC, David Nadlinger 
wrote:
 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
Yes, the docker images aren't too big: https://hub.docker.com/r/dlangtour/core-exec/tags FYI for the "import a dub library" feature, we compile a couple of important dub packages and bundle them within the docker image. It's a lot faster this way and allowed to ignore the issues of a common, shared dub package cache folder (parallel writes, growing size, prevent "delete all", ...) for now. Anyhow you are right, spare storage isn't a huge concern, but there isn't much free storage either as it's a rather small instance (I don't even know where the machine is hosted). As mentioned before, no one has mentioned a use case for which he would need an old, ugly compiler on run.dlang.io. A bit of history: the app emerged from the DLang-Tour backend, where small examples can be executed and for those you can't even choose the compiler. After several problems and outages with DPaste, we added it as a backend to the runnable examples on dlang.org, for which again, you can't choice the compiler. (To be technically correct, on the prerelease pages dmd-nightly is automatically selected.) It's interesting to see that no one complained about gdc not being there - I thought that this would be the first comment.
Dec 13 2017
parent reply Mike Franklin <slavo5150 yahoo.com> writes:
On Thursday, 14 December 2017 at 06:26:16 UTC, Seb wrote:

 It's interesting to see that no one complained about gdc not 
 being there - I thought that this would be the first comment.
Allow me to be the first. But seriously, considering the use case for run.dlang.io, I don't see the need for hosting any compilers other than dmd-latest and dmd-nightly. Everything else is just gravy. Mike
Dec 13 2017
parent reply Mengu <mengukagan gmail.com> writes:
On Thursday, 14 December 2017 at 06:43:58 UTC, Mike Franklin 
wrote:
 On Thursday, 14 December 2017 at 06:26:16 UTC, Seb wrote:

 It's interesting to see that no one complained about gdc not 
 being there - I thought that this would be the first comment.
Allow me to be the first. But seriously, considering the use case for run.dlang.io, I don't see the need for hosting any compilers other than dmd-latest and dmd-nightly. Everything else is just gravy. Mike
rust playground has plenty of choices in that matter but there's something better. it supports the top 100 most used dependencies so they are just an import away. seb, you think this could be added?
Dec 14 2017
parent Seb <seb wilzba.ch> writes:
On Thursday, 14 December 2017 at 13:22:54 UTC, Mengu wrote:
 On Thursday, 14 December 2017 at 06:43:58 UTC, Mike Franklin 
 wrote:
 On Thursday, 14 December 2017 at 06:26:16 UTC, Seb wrote:

 It's interesting to see that no one complained about gdc not 
 being there - I thought that this would be the first comment.
Allow me to be the first. But seriously, considering the use case for run.dlang.io, I don't see the need for hosting any compilers other than dmd-latest and dmd-nightly. Everything else is just gravy. Mike
rust playground has plenty of choices in that matter but there's something better.
As far as I can judge they also only support latest, beta and nightly as compilers, no?
 it supports the top 100 most used dependencies so they are just 
 an import away.
  seb, you think this could be added?
If I understand you correctly, we already support this - though the list of supported packages is rather limited for now. Two examples: mir: https://run.dlang.io/is/FIc6rd mir-algorithm: https://run.dlang.io/is/3pNRH8 If you want to add your favorite library to the list -> https://github.com/dlang-tour/core-exec/blob/master/Dockerfile#L43
Dec 14 2017
prev sibling parent Jacob Carlborg <doob me.com> writes:
On 2017-12-13 02:14, Seb wrote:

 Also the storage on the machine is limited and we can't drop an 
 unlimited amount of Docker images there.
There could be a job that cleans up the local Docker images. If a Docker image is needed it will be pulled down again automatically. Of course there can be a few common images that are never cleaned up to reduce the waiting time for pulling down an image. -- /Jacob Carlborg
Dec 14 2017
prev sibling next sibling parent Nicholas Wilson <iamthewilsonator hotmail.com> writes:
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

 [...]
Sweet! I will definitely use this for teaching.
Dec 12 2017
prev sibling next sibling parent reply Meta <jared771 gmail.com> writes:
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

 === Features ===

 * Color-highlighted DMD errors
 * Format source code with dfmt
 * Generate a short URL for link sharing
 * Import/Export to GitHub Gist
 * Typical key shortcuts like CTRL+Enter -> Run
 * Build cache for fast execution of common examples (e.g. the 
 ones on front page of dlang.org)
 * Usable on your phone
 * Integrated with dlang.org (you can open any example on 
 dlang.org in run.dlang.io by clicking the right arrow button)
 * Integrated with tour.dlang.org (you can open any example on 
 the DTour in run.dlang.io by clicking on the "Export" button)

 === Supported D Compilers ===

 * Latest DMD nightly
 * Latest DMD beta
 * Latest DMD
 * Latest LDC beta
 * Latest LDC

 The Docker images are rebuilt every day automatically.

 === Running DUB packages ===

 Via "Add library" DUB packages can be added to the build.
 Currently only a whitelist of packages is allowed.
 Examples:

 mir: https://run.dlang.io/is/FIc6rd
 mir-algorithm: https://run.dlang.io/is/3pNRH8

 === DReg ===

 When I watched CyberShadow's Bugzilla cruise [1] I spotted this 
 amazing tool dreg [2] and it's not that hard to build a docker 
 image [3] for it and make it available for everyone, s.t. no 
 setup is required.
 Dreg allows running old versions of the D compiler in parallel 
 and compares their output.
 However, it's a lot easier to show than to explain:

 https://run.dlang.io/is/ckNT9i
 https://run.dlang.io/is/UZhQDh

 Currently all versions from 2.060 up to the latest greatest 
 2.077.1 are run, so the execution will take a bit longer than a 
 single run.

 [1] https://youtu.be/qpUTvMokTCs
 [2] https://github.com/CyberShadow/misc/blob/master/dreg.d
 [3] https://github.com/dlang-tour/core-dreg


 === Source code & report issues ===

 Please don't hesitate to open issues or submit pull requests:

 -> https://github.com/dlang-tour/core

 (it uses Vibe.d)
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.
Dec 12 2017
next sibling parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
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 -- Real Programmers use "cat > a.out".
Dec 12 2017
parent reply Meta <jared771 gmail.com> writes:
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.
Dec 13 2017
next sibling parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
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.
Dec 13 2017
prev sibling parent reply "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
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.
Dec 13 2017
parent reply Ivan Kazmenko <gassa mail.ru> writes:
On Thursday, 14 December 2017 at 01:52:29 UTC, H. S. Teoh wrote:
 ...
 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.
That sounds powerful! Like you said, instant win.
Dec 14 2017
parent "H. S. Teoh" <hsteoh quickfur.ath.cx> writes:
On Thu, Dec 14, 2017 at 02:33:13PM +0000, Ivan Kazmenko via
Digitalmars-d-announce wrote:
 On Thursday, 14 December 2017 at 01:52:29 UTC, H. S. Teoh wrote:
 ...
 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.
That sounds powerful! Like you said, instant win.
As of this morning, the PR has been merged into git master, and now this works: ------ $ echo 'import std.stdio; void main(){ writeln("Instant win!"); }' |dmd -run - Instant win! $ ------ Hooray! T -- Why are you blatanly misspelling "blatant"? -- Branden Robinson
Dec 15 2017
prev sibling parent Seb <seb wilzba.ch> writes:
On Wednesday, 13 December 2017 at 00:50:40 UTC, Meta wrote:
 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.
Great to hear that it's useful for you! FYI: another life saver / convenience feature for this online editor is WIP: https://github.com/dlang/phobos/pull/5916
Dec 12 2017
prev sibling next sibling parent Mike Franklin <slavo5150 yahoo.com> writes:
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
I've actually been using it a lot recently to communicate bugs/ideas/patterns with others. Due to the nightlies, I can quickly see if a bug has been addressed in master. I've closed a couple of bugs recently with "worksforme" that way. I also use it to quickly try ideas when I'm out waiting somewhere, or just when an idea occurs to me. It is such a great resource. Thanks to those who put their time into it. Mike
Dec 12 2017
prev sibling parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 12/12/2017 10:37 AM, 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
Very impressive! Nice work! Can I add a suggestion? Have an option to show the assembler created. Being able to quickly look at the assembler output is a great way to learn the 'cost' of writing code in various ways. (This is invaluable for someone wanting to be an A-list programmer.)
Dec 14 2017
next sibling parent reply Radu <void null.pt> writes:
On Thursday, 14 December 2017 at 15:46:03 UTC, Walter Bright 
wrote:
 On 12/12/2017 10:37 AM, 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
Very impressive! Nice work! Can I add a suggestion? Have an option to show the assembler created. Being able to quickly look at the assembler output is a great way to learn the 'cost' of writing code in various ways. (This is invaluable for someone wanting to be an A-list programmer.)
You can use this one for nice assembly outputs https://d.godbolt.org/
Dec 15 2017
parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 12/15/2017 4:10 AM, Radu wrote:
 You can use this one for nice assembly outputs https://d.godbolt.org/
That is indeed nice and very useful. It should do dmd, too!
Dec 16 2017
parent reply Iain Buclaw <ibuclaw gdcproject.org> writes:
On 16 December 2017 at 11:01, Walter Bright via Digitalmars-d-announce
<digitalmars-d-announce puremagic.com> wrote:
 On 12/15/2017 4:10 AM, Radu wrote:
 You can use this one for nice assembly outputs https://d.godbolt.org/
That is indeed nice and very useful. It should do dmd, too!
However dmd doesn't do assembly output. ;-)
Dec 16 2017
parent reply Walter Bright <newshound2 digitalmars.com> writes:
On 12/16/2017 2:45 AM, Iain Buclaw wrote:
 However dmd doesn't do assembly output. ;-)
dmd -c test obj2asm test.obj >test.asm
Dec 17 2017
next sibling parent reply Seb <seb wilzba.ch> writes:
On Sunday, 17 December 2017 at 22:57:58 UTC, Walter Bright wrote:
 On 12/16/2017 2:45 AM, Iain Buclaw wrote:
 However dmd doesn't do assembly output. ;-)
dmd -c test obj2asm test.obj >test.asm
FYI: There's http://asm.dlang.org which seems to be a bit outdated. Moreover, there's an open issue to add DMD to d.godbolt.org: https://github.com/mattgodbolt/compiler-explorer/issues/306
Dec 17 2017
parent Iain Buclaw <ibuclaw gdcproject.org> writes:
On 18 December 2017 at 04:37, Seb via Digitalmars-d-announce
<digitalmars-d-announce puremagic.com> wrote:
 On Sunday, 17 December 2017 at 22:57:58 UTC, Walter Bright wrote:
 On 12/16/2017 2:45 AM, Iain Buclaw wrote:
 However dmd doesn't do assembly output. ;-)
dmd -c test obj2asm test.obj >test.asm
FYI: There's http://asm.dlang.org which seems to be a bit outdated. Moreover, there's an open issue to add DMD to d.godbolt.org: https://github.com/mattgodbolt/compiler-explorer/issues/306
I couldn't see any way to improve things. You get none of the nice features that compiler explorer offers, and supporting dmd requires you to put a sledgehammer in the app to force it to work nicely with a compiler that you can only observe via objdump, so saw no reason to update it.
Dec 18 2017
prev sibling parent reply Iain Buclaw <ibuclaw gdcproject.org> writes:
On 17 December 2017 at 23:57, Walter Bright via Digitalmars-d-announce
<digitalmars-d-announce puremagic.com> wrote:
 On 12/16/2017 2:45 AM, Iain Buclaw wrote:
 However dmd doesn't do assembly output. ;-)
dmd -c test obj2asm test.obj >test.asm
Lacks any form of line number information to let you see clearly which set of instructions relates to which expression. i.e: https://explore.dgnu.org/g/7WNiyt
Dec 18 2017
parent Walter Bright <newshound2 digitalmars.com> writes:
On 12/18/2017 10:11 AM, Iain Buclaw wrote:
 Lacks any form of line number information to let you see clearly which
 set of instructions relates to which expression.  i.e:
 https://explore.dgnu.org/g/7WNiyt
This is incorrect (if you compile with debug info on). Besides, it's not particularly relevant for the small code examples used there.
Dec 18 2017
prev sibling parent Seb <seb wilzba.ch> writes:
On Thursday, 14 December 2017 at 15:46:03 UTC, Walter Bright 
wrote:
 On 12/12/2017 10:37 AM, 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
Very impressive! Nice work! Can I add a suggestion? Have an option to show the assembler created. Being able to quickly look at the assembler output is a great way to learn the 'cost' of writing code in various ways. (This is invaluable for someone wanting to be an A-list programmer.)
FYI: run.dlang.io got a few small updates: 1) -asm (DMD only) https://run.dlang.io/is/qtk8Wq 2) -vcg-ast: Dumps the AST tree of DMD (after all semantic analysis) https://run.dlang.io/is/TAHzMZ 3) Stores the latest source file in the persistent localStorage of your browser i.e. the last modified example will be shown once you come back.
Jan 13