March 29, 2022
On 28.03.22 16:34, H. S. Teoh wrote:
> 
> 	import std.stdio;
> 	int main() => !(1 + "Hello World".puts);

int main() => !~"Hello World".puts;
March 29, 2022

On Tuesday, 29 March 2022 at 07:06:57 UTC, Timon Gehr wrote:

>

On 28.03.22 16:34, H. S. Teoh wrote:

>

import std.stdio;
int main() => !(1 + "Hello World".puts);

int main() => !~"Hello World".puts;

Or simply int main() => "Hello World".puts < 0;

March 29, 2022

On Tuesday, 29 March 2022 at 07:25:57 UTC, Max Samukha wrote:

>

Or simply

int main() => "Hello World".puts < 0;

For starters, I'd like to point out that it's essentially the same as this:

import std.stdio;
//int main() => "Hello World".puts < 0;/*
int main() {
	"Hello World".puts;
	return 0;
}//*/
March 29, 2022

On Tuesday, 29 March 2022 at 09:25:56 UTC, Salih Dincer wrote:

>

On Tuesday, 29 March 2022 at 07:25:57 UTC, Max Samukha wrote:

>

Or simply

int main() => "Hello World".puts < 0;

For starters, I'd like to point out that it's essentially the same as this:

import std.stdio;
//int main() => "Hello World".puts < 0;/*
int main() {
	"Hello World".puts;
	return 0;
}//*/

No. Your variant loses error status and always reports success.

March 29, 2022

On Monday, 28 March 2022 at 05:23:22 UTC, FeepingCreature wrote:

>

On Saturday, 26 March 2022 at 04:03:08 UTC, Salih Dincer wrote:

>

Thank you...

I think this is a work of art. Just like the banana work that was attached to the wall with duct tape, which Italian sculptor Maurizio Cattelan called "Comedy".

Also, the end-of-line character is needed. In this way, there is the same number of characters as the line above. But I like this more:

     void main()
     {
          import std.stdio : writefln;
          "Hello".writefln!"%s, World!";
     }

Because it's functional...

SDB@79

Throwing my hat in the ring:

import std.stdio;
int main()
    => "Hello World".puts;
void main() => imported!`std`.writeln("Hello World");

:P

March 29, 2022

On Tuesday, 29 March 2022 at 09:29:30 UTC, Stanislav Blinov wrote:

>

On Tuesday, 29 March 2022 at 09:25:56 UTC, Salih Dincer wrote:

>

On Tuesday, 29 March 2022 at 07:25:57 UTC, Max Samukha wrote:

>

Or simply

int main() => "Hello World".puts < 0;

For starters, I'd like to point out that it's essentially the same as this:

import std.stdio;
//int main() => "Hello World".puts < 0;/*
int main() {
	"Hello World".puts;
	return 0;
}//*/

No. Your variant loses error status and always reports success.

Does it matter 😀

SDB@79

March 29, 2022

On Tuesday, 29 March 2022 at 10:12:13 UTC, Salih Dincer wrote:

>

On Tuesday, 29 March 2022 at 09:29:30 UTC, Stanislav Blinov wrote:

> >

Your variant loses error status and always reports success.

Does it matter 😀

Presumably it does if we're talking about a returning main. Otherwise you can simply define a void main and not spell out the return at all, i.e. as in original post. Although, the OP variant would throw if printing errors out (because it uses writeln and not puts). So... yeah, it does? :D

March 29, 2022

On Tuesday, 29 March 2022 at 09:36:20 UTC, Petar Kirov [ZombineDev] wrote:

>
void main() => imported!`std`.writeln("Hello World");

:P

Where's the import importing imported? )

March 29, 2022
On 29.03.22 13:56, Max Samukha wrote:
> On Tuesday, 29 March 2022 at 09:36:20 UTC, Petar Kirov [ZombineDev] wrote:
> 
>>
>> ```d
>> void main() => imported!`std`.writeln("Hello World");
>> ```
>>
>> :P
> 
> Where's the import importing imported? )
> 

https://github.com/dlang/dmd/blob/master/src/dmd/dmodule.d#L1139
https://github.com/dlang/druntime/blob/master/src/object.d#L5087
March 29, 2022
On Tuesday, 29 March 2022 at 12:52:17 UTC, Timon Gehr wrote:

>> 
>> Where's the import importing imported? )
>> 
>
> https://github.com/dlang/dmd/blob/master/src/dmd/dmodule.d#L1139
> https://github.com/dlang/druntime/blob/master/src/object.d#L5087

Nice! I didn't know it'd been added to object.d.