Jump to page: 1 28  
Page
Thread overview
[OT] Programming language WATs
Jan 20, 2012
Robert Clipsham
Jan 20, 2012
Timon Gehr
Jan 20, 2012
Brad Anderson
Jan 20, 2012
Mehrdad
Jan 20, 2012
Jonathan M Davis
Jan 20, 2012
Denis Shelomovskij
Feb 06, 2012
HansBKK
Feb 06, 2012
Timon Gehr
Feb 06, 2012
H. S. Teoh
Feb 07, 2012
H. S. Teoh
Feb 07, 2012
Stewart Gordon
Jan 20, 2012
Nick Sabalausky
Jan 21, 2012
Andrej Mitrovic
Jan 21, 2012
Zachary Lund
Jan 21, 2012
Andrej Mitrovic
Jan 21, 2012
Jonathan M Davis
Jan 21, 2012
Nick Sabalausky
Jan 21, 2012
Jonathan M Davis
Jan 21, 2012
Adam D. Ruppe
Jan 21, 2012
Jonathan M Davis
Jan 21, 2012
Timon Gehr
Re: [OT] [ot Programming language WATs
Jan 21, 2012
Adam D. Ruppe
Re: [OT] destroy all software (was Programming language WATs)
Jan 21, 2012
Adam D. Ruppe
Jan 21, 2012
Caligo
Jan 21, 2012
Adam D. Ruppe
Jan 21, 2012
Nick Sabalausky
Jan 21, 2012
Adam D. Ruppe
Jan 21, 2012
Nick Sabalausky
Jan 21, 2012
F i L
Jan 21, 2012
Nick Sabalausky
Jan 21, 2012
Paulo Pinto
Jan 21, 2012
Adam D. Ruppe
Jan 21, 2012
Jonathan M Davis
Jan 21, 2012
Nick Sabalausky
Jan 22, 2012
Jonathan M Davis
Jan 22, 2012
Adam D. Ruppe
Jan 22, 2012
bearophile
Jan 22, 2012
Nick Sabalausky
Jan 22, 2012
Jonathan M Davis
Jan 22, 2012
Tobias Pankrath
Jan 21, 2012
Chad J
Jan 21, 2012
Nick Sabalausky
Jan 21, 2012
Chad J
Jan 21, 2012
Peter Alexander
Jan 21, 2012
Nick Sabalausky
Jan 21, 2012
Chad J
Jan 21, 2012
Adam D. Ruppe
Jan 22, 2012
Nick Sabalausky
Jan 22, 2012
Adam D. Ruppe
Jan 22, 2012
Adam D. Ruppe
Jan 22, 2012
Nick Sabalausky
Jan 21, 2012
Nick Sabalausky
Jan 21, 2012
Bernard Helyer
Jan 21, 2012
Andrej Mitrovic
Jan 21, 2012
Kapps
Jan 21, 2012
Marco Leise
Jan 21, 2012
Caligo
Jan 22, 2012
Nick Sabalausky
Jan 22, 2012
bcs
Jan 22, 2012
Matt Soucy
Jan 22, 2012
bcs
Jan 23, 2012
Jonathan M Davis
Jan 23, 2012
Timon Gehr
Feb 07, 2012
Jonathan M Davis
Feb 07, 2012
Stewart Gordon
Feb 07, 2012
H. S. Teoh
Feb 07, 2012
Timon Gehr
Feb 07, 2012
Jonathan M Davis
Feb 07, 2012
H. S. Teoh
Feb 07, 2012
Jonathan M Davis
std.stream vs std.stdio (Was: Re: [OT] Programming language WATs)
Feb 07, 2012
H. S. Teoh
Feb 09, 2012
Bruno Medeiros
January 20, 2012
Just came across this amusing 4 minute video:

https://www.destroyallsoftware.com/talks/wat

Anyone have any other WATs you can do in other languages? Bonus points for WATs you can do in D.

-- 
Robert
http://octarineparrot.com/
January 20, 2012
On 01/20/2012 04:40 PM, Robert Clipsham wrote:
> Just came across this amusing 4 minute video:
>
> https://www.destroyallsoftware.com/talks/wat
>
> Anyone have any other WATs you can do in other languages? Bonus points
> for WATs you can do in D.
>

I think there are no spectacular WATs in D, but I'll give it a try.

$ short s = -1;
$ s >>> 1
> 2147483647

$ int[] a   = [];
$ int[][] b = [];
$ a ~ []
> []
$ b ~ []
> [[]]

$ const(int)[] a;
$ int[] b;
$ immutable(int)[] c;
$ typeof(a ~ b)
> int[]
$ typeof(a ~ c)
> int[]
$ typeof(a ~ a)
> const(int)[]

$ class A{}
$ class B : A{}
$ __traits(compiles, {A[] a = [new B];})
> true
$ __traits(compiles, {A[] a = [new A]~[new B];})
> false
$ __traits(compiles, {A[] a = [new A]; a~=[new B];});
> true


(BTW: We have an almost complete D interpreter. Why don't we have a REPL?)	

January 20, 2012
On Fri, Jan 20, 2012 at 8:40 AM, Robert Clipsham <robert@octarineparrot.com>wrote:

> Just came across this amusing 4 minute video:
>
> https://www.**destroyallsoftware.com/talks/**wat<https://www.destroyallsoftware.com/talks/wat>
>
> Anyone have any other WATs you can do in other languages? Bonus points for WATs you can do in D.
>
> --
> Robert
> http://octarineparrot.com/
>

I don't know of any for D but Stack Overflow had a great list that contained many of these.  The deletionists (which I thought we had successfully quarantined to Wikipedia) have gotten it deleted though.

I found a copy on Archive.org: http://web.archive.org/web/20101221234152/http://stackoverflow.com/questions/1995113/strangest-language-feature

Regards,
Brad Anderson


January 20, 2012
On Friday, January 20, 2012 15:40:43 Robert Clipsham wrote:
> Just came across this amusing 4 minute video:
> 
> https://www.destroyallsoftware.com/talks/wat

Hilarious!

- Jonathan M Davis
January 20, 2012
On 1/20/2012 8:43 AM, Brad Anderson wrote:
> On Fri, Jan 20, 2012 at 8:40 AM, Robert Clipsham <robert@octarineparrot.com <mailto:robert@octarineparrot.com>> wrote:
>
>     Just came across this amusing 4 minute video:
>
>     https://www.destroyallsoftware.com/talks/wat
>
>     Anyone have any other WATs you can do in other languages? Bonus
>     points for WATs you can do in D.
>
>     -- 
>     Robert
>     http://octarineparrot.com/
>
>
> I don't know of any for D but Stack Overflow had a great list that contained many of these.  The deletionists (which I thought we had successfully quarantined to Wikipedia) have gotten it deleted though.
>
> I found a copy on Archive.org: http://web.archive.org/web/20101221234152/http://stackoverflow.com/questions/1995113/strangest-language-feature
>
> Regards,
> Brad Anderson
I just voted to undelete... if anyone has enough rep please do the same. :)
January 20, 2012
20.01.2012 19:40, Robert Clipsham пишет:
> Just came across this amusing 4 minute video:
>
> https://www.destroyallsoftware.com/talks/wat
>

Good talk!
But with a mistake: there are 15 delimiters in 16 element array (printing/join result), not 16.
January 20, 2012
"Robert Clipsham" <robert@octarineparrot.com> wrote in message news:jfc1ts$2hck$1@digitalmars.com...
> Just came across this amusing 4 minute video:
>
> https://www.destroyallsoftware.com/talks/wat
>


OMGWTFBBQ! I ROFLed!

(That really was hilarious.)

> Anyone have any other WATs you can do in other languages? Bonus points for WATs you can do in D.
>


I think just about any WAT in D would be a compiler or library bug. Or this:

> dmd a.d -c
> typeof("a.obj")
  >OMF

http://memegenerator.net/instance/13443461



January 21, 2012
Probably Windows-only:

void main()
{
    string a = "foo";
    "foo" = "bar";
    writeln(a);  // "foo"
    assert(a == "foo");  // failure
}
January 21, 2012
To give you a hint:

void main()
{
    "foo" = "bar";
    writeln("foo");
}
January 21, 2012
On 01/20/2012 08:44 PM, Andrej Mitrovic wrote:
> Probably Windows-only:
>
> void main()
> {
>      string a = "foo";
>      "foo" = "bar";
>      writeln(a);  // "foo"
>      assert(a == "foo");  // failure
> }

I think this is a bug. This causes a segmentation fault on Linux DMD 2.057. Plus, assigning a literal to a literal doesn't make sense...
« First   ‹ Prev
1 2 3 4 5 6 7 8