July 09, 2020
On Thu, Jul 09, 2020 at 03:58:19PM +0000, jmh530 via Digitalmars-d wrote:
> On Thursday, 9 July 2020 at 15:31:32 UTC, Petar Kirov [ZombineDev] wrote:
> > On Tuesday, 7 July 2020 at 22:29:36 UTC, H. S. Teoh wrote:
> > > [...]
> > > 
> > > Awesome stuff!!  We should collect a library of these one-liners, maybe on the wiki or something, that can serve as a useful reference.  It can also be used to show off D's capabilities too.
> > > 
> > > 
> > > T
> > 
> > dmd -run code.d | dmd -
> 
> So that compiles and runs code.d and then passes the result to dmd to build?

Meaning, code.d generates D code that is run on the spot.

Here's another one: the most powerful one-line D program that ever existed and will ever exist. It can do literally anything you tell it do, and best of all, it doesn't even take up that much space.  In fact, it takes literally no disk space at all.  All you have to do is to run the following one-liner, and type in what you want it to do as D code, and it will do it!  How amazing is that???

	cat | dmd -run -

:-P


T

-- 
Give me some fresh salted fish, please.
July 16, 2020
On Thursday, 9 July 2020 at 16:26:09 UTC, H. S. Teoh wrote:
> On Thu, Jul 09, 2020 at 03:58:19PM +0000, jmh530 via Digitalmars-d wrote:
>> On Thursday, 9 July 2020 at 15:31:32 UTC, Petar Kirov [ZombineDev] wrote:
>> > On Tuesday, 7 July 2020 at 22:29:36 UTC, H. S. Teoh wrote:
>> > > [...]
>> > 
>> > dmd -run code.d | dmd -
>> 
>> So that compiles and runs code.d and then passes the result to dmd to build?
>
> Meaning, code.d generates D code that is run on the spot.
>
> Here's another one: the most powerful one-line D program that ever existed and will ever exist. It can do literally anything you tell it do, and best of all, it doesn't even take up that much space.  In fact, it takes literally no disk space at all.  All you have to do is to run the following one-liner, and type in what you want it to do as D code, and it will do it!  How amazing is that???
>
> 	cat | dmd -run -
>
> :-P
>
>
> T

Without args cat reads from stdin and outputs to stdout which dmd -run - catches.
However, I typed writeln("hello D"); after the one-liner above, hit enter and nothing happened. Hit enter again, nothing.
July 16, 2020
On Thu, Jul 16, 2020 at 06:41:42PM +0000, tastyminerals via Digitalmars-d wrote:
> On Thursday, 9 July 2020 at 16:26:09 UTC, H. S. Teoh wrote:
[...]
> > Here's another one: the most powerful one-line D program that ever existed and will ever exist. It can do literally anything you tell it do, and best of all, it doesn't even take up that much space.  In fact, it takes literally no disk space at all.  All you have to do is to run the following one-liner, and type in what you want it to do as D code, and it will do it!  How amazing is that???
> > 
> > 	cat | dmd -run -
> > 
> > :-P
> > 
> > 
> > T
> 
> Without args cat reads from stdin and outputs to stdout which dmd -run
> - catches.
> However, I typed writeln("hello D"); after the one-liner above, hit
> enter and nothing happened. Hit enter again, nothing.

You have to end your input with ctrl-D.  DMD is not a REPL so it's not going to evaluate individual input lines immediately.

But anyway, this particular one is a joke that refers to one of the winning entries of the IOCCC from 1988 (see the entry by spinellis), consisting of the single line:

	#include "/dev/tty"

It probably no longer works on modern C compilers, but the intent ought to be obvious. :-)


T

-- 
We are in class, we are supposed to be learning, we have a teacher... Is it too much that I expect him to teach me??? -- RL
July 17, 2020
On 25/06/2020 18:25, Andrei Alexandrescu via Digitalmars-d wrote:
> On 6/25/20 10:27 AM, Petar Kirov [ZombineDev] wrote:
>> The way I see things is that we as a community need to focus on a vetted, well shaped collection of libraries.
>> We need to have process where third-party libraries are able to gain broader support and join dlang-community. Also we need dlang-community to have a healthy number of people who actually maintain the code.
>> We need the leadership to realize that investing just in dmd, druntime and phobos is necessary, but very insufficient.
>> W&A need to stop pretending that Dub doesn't exist. I feel that unless we embrace using code.dlang.org as method of distribution of everything that's currently part of the compiler archive, Dub's limitations will never be addressed and from that the broader community will suffer.
> 
> (By the way just to clarify "A" in "W&A" would stand for Atila. I'm commenting as just one in the community.)
> 
> I'm a bit confused by this argument. So there is the compiler and standard library, and then there's a community-supported library, which includes a copy of the standard library under an improved versioning schema. It's all legal and encouraged by the generous licensing of the compiler and standard library, both of which Walter and I fought hard in the past to obtain and maintain.
> 
> Dub is the perfect place where community leadership can set the tone and organized things as they need to without heavy-handed intervention from above. Several people have criticized "the leadership" for not doing things the way they wanted, so it seems perplexing that leadership intervention is now asked for. What's that nonsense with "pretending dub doesn't exist"? So now they need to take ownership of the community-driven dub as well? Isn't that a bit too much work for a handful of folks in the best of times?
> 

If I was to take some of it at face value, I'd probably turn around and say: you know what, I'm going to drop Phobos from GDC and tell people to get it from Dub instead.

Apart from std.math, there are no differences between upstream and downstream copies anyway (and I could always upstream version(GNU) asm implementations for x86, RISC-V, ...).

It would certainly make my life easier, would speed up both time to build compiler and run the testsuite, and no more worrying about getting the mathlib working on PPC64, or PA-RISC, or M68K, or VAX.  That's now someone else's problem, and I can think of better things I could be doing with my time anyway.

Would people be happy if I did this?  I doubt it.
July 18, 2020
On 18/07/2020 2:14 AM, Iain Buclaw wrote:
> Apart from std.math, there are no differences between upstream and downstream copies anyway (and I could always upstream version(GNU) asm implementations for x86, RISC-V, ...).
> 
> It would certainly make my life easier, would speed up both time to build compiler and run the testsuite, and no more worrying about getting the mathlib working on PPC64, or PA-RISC, or M68K, or VAX.  That's now someone else's problem, and I can think of better things I could be doing with my time anyway.
> 
> Would people be happy if I did this?  I doubt it.

How often does compiling Phobos as part of the testsuite catch bugs in gdc?

If the answer is never, then maybe some deferring could be possible.
July 17, 2020
On 17/07/2020 16:28, rikki cattermole via Digitalmars-d wrote:
> On 18/07/2020 2:14 AM, Iain Buclaw wrote:
>> Apart from std.math, there are no differences between upstream and downstream copies anyway (and I could always upstream version(GNU) asm implementations for x86, RISC-V, ...).
>>
>> It would certainly make my life easier, would speed up both time to build compiler and run the testsuite, and no more worrying about getting the mathlib working on PPC64, or PA-RISC, or M68K, or VAX.  That's now someone else's problem, and I can think of better things I could be doing with my time anyway.
>>
>> Would people be happy if I did this?  I doubt it.
> 
> How often does compiling Phobos as part of the testsuite catch bugs in gdc?
> 
> If the answer is never, then maybe some deferring could be possible.

We're usually very good at finding bugs in Phobos, rather than the other way round.

However, the combination of testsuite + druntime alone is not really representative of catching all issues that could happen on changes made to the code generator, and there have been a few fairly intrusive changes I've been testing in the last weeks where Phobos has proved to be a good litmus test for finding problems (especially in the changes being done to emission strategy - I can no longer ignore it due to newly added GC tests in druntime that depend on weak rather than vague linkage).

Though the same "representative" argument can be made of testsuite + druntime + phobos as well, and it shouldn't be too difficult to add a test script that obtains and builds a bunch of projects (similar to dmd buildkite) as a kind of expensive testsuite run.

July 17, 2020
On Wednesday, 8 July 2020 at 08:48:52 UTC, tastyminerals wrote:
> On Friday, 26 June 2020 at 09:10:57 UTC, Mike Parker wrote:
>> On Friday, 26 June 2020 at 05:39:59 UTC, H. S. Teoh wrote:
>>
>>>
>>> Maybe we should have a Most Useful One-Line D Program contest. :-P
>>>
>>
>> Or a blog post showing off all of this and explaining the compiler flags :-)
>
> That would be great if someone could do this! I would like to learn and show off the D one-liners in the company.

How interested are you in making this D one-line showcasing thing happen? Been thinking, its something that needs to happen.
July 17, 2020
On Friday, 17 July 2020 at 20:41:57 UTC, aberba wrote:
> On Wednesday, 8 July 2020 at 08:48:52 UTC, tastyminerals wrote:
>> On Friday, 26 June 2020 at 09:10:57 UTC, Mike Parker wrote:
>>> On Friday, 26 June 2020 at 05:39:59 UTC, H. S. Teoh wrote:
>>>
>>>>
>>>> Maybe we should have a Most Useful One-Line D Program contest. :-P
>>>>
>>>
>>> Or a blog post showing off all of this and explaining the compiler flags :-)
>>
>> That would be great if someone could do this! I would like to learn and show off the D one-liners in the company.
>
> How interested are you in making this D one-line showcasing thing happen? Been thinking, its something that needs to happen.

Especially now that there's some momentum in getting the D wiki up to speed.
July 17, 2020
On Fri, Jul 17, 2020 at 08:44:40PM +0000, aberba via Digitalmars-d wrote:
> On Friday, 17 July 2020 at 20:41:57 UTC, aberba wrote:
> > On Wednesday, 8 July 2020 at 08:48:52 UTC, tastyminerals wrote:
[...]
> > > That would be great if someone could do this! I would like to learn and show off the D one-liners in the company.
> > 
> > How interested are you in making this D one-line showcasing thing happen? Been thinking, its something that needs to happen.
> 
> Especially now that there's some momentum in getting the D wiki up to speed.

Check out the scriptlike dub package.  It has a bunch of stuff that makes scripting tasks easier (i.e., less verbose).  If you have scriptlike installed, one-liners could potentially be even more compact.


T

-- 
Don't modify spaghetti code unless you can eat the consequences.
July 17, 2020
On Friday, 17 July 2020 at 21:14:19 UTC, H. S. Teoh wrote:
> On Fri, Jul 17, 2020 at 08:44:40PM +0000, aberba via Digitalmars-d wrote:
>> On Friday, 17 July 2020 at 20:41:57 UTC, aberba wrote:
>> > On Wednesday, 8 July 2020 at 08:48:52 UTC, tastyminerals wrote:
> [...]
>> > > That would be great if someone could do this! I would like to learn and show off the D one-liners in the company.
>> > 
>> > How interested are you in making this D one-line showcasing thing happen? Been thinking, its something that needs to happen.
>> 
>> Especially now that there's some momentum in getting the D wiki up to speed.
>
> Check out the scriptlike dub package.  It has a bunch of stuff that makes scripting tasks easier (i.e., less verbose).  If you have scriptlike installed, one-liners could potentially be even more compact.
>
>
> T

Interesting. It's very well documented too.

2 3 4 5 6 7 8 9 10 11 12
Next ›   Last »