Re: [OT]new D2.0 + C++ language

2009-03-21 Thread Piotrek

bearophile pisze:

Piotrek:

(of course there are bugs but  when I write something in D
I'm so glad I don't have to to do it in something else).


D is surely not a puzzle language :-)
http://prog21.dadgum.com/38.html



Haha, I found good discussion on reddit

http://www.reddit.com/r/programming/comments/7vnm0/puzzle_languages/

Just couple of nice citations:

J language expample:
meanf=: 1 : '(0.255.])@:.@(m (+/ % #)@,;.3 ])2'
boxf=: 1 : '(0.255.])@:.@((2 2$m) (+/ % #)@,;.3 ])2'
pc=: .:([: 2 0 1|: 256 256 256#:)
inter=: ( [: , 2(({. , (+/%#))\) )1
inter2=: ([: (@inter pc) |:)^:2
fit=: [: .`./ ,
fit1=: [: .`./ (,~ (,~ -))~
histogram=: : @ (#/.~) @ (i...@#@[ , I.)

Does it look like the Matrix?

And the the one made me laugh the most:
CSS is the puzzliest puzzle that I ever puzzled

Every one should try CSS :D

Cheers


Re: [OT]new D2.0 + C++ language

2009-03-21 Thread bearophile
Piotrek:

 Haha, I found good discussion on reddit

On the other hand, D too for me becomes a puzzle language when I use many 
string mixins or templates in functional-style. D macros will possibly improve 
that situation some.


 J language expample:

K language seems worse to me, this is a full raytracer that saves in pgm (in 
C++ it's about 120 lines of code written in normal style):
http://www.nsl.com/k/ray/ray.k

U:{x%_sqrt x _dot x}
S:{[r;s]:[0d:_sqr[s 1]+_sqr[b:v _dot r 1]-v _dot v:s[0]-*r;0i;0t:b+e:_sqrt 
d;0i;0u:b-e;u;t]}
I:{[r;h;o]:[~4:*o;:[~S[r;*o]*h;h;h _f[r]/o 1];~h[0]l:S[r]o;h;(l;U 
r[0]-o[0]-l*r 1)]}
T:{[r;o;d;z;l]:[0i=*h:I[r;z]o;0.;~0g:h[1]_dot l;0.;0i=*I[(r[0]+(r[1]**h)+d*h 
1;-l);z]o;-g;0.]}
N:{[n;o;i]0{x+T[(0 0 -4.;U(i+(y%4)-n%2),n);o;_sqrt 2^-42;0i,,3#0.]U -1 -3 
2.}/+4_vs!16}
R:{[k;n]P5\n,(5:n,n),\n255\n,_ci _.5+15.9375*N[n*1.;C[k;0 -1 0.]1.]'+|@[n 
_vs!n*n;0;|:]}
C:{[k;c;r]:[k=1;(c;r);((c;r*3);(,(c;r)),C[k-1;;r%2]'+c+-3 3[2_vs 2 3 6 
7]*r%_sqrt 12)]}
\t q:R[3]32
temp.pgm6:q
\C:\\Program Files\\IrfanView\\i_view32.exe temp.pgm

APL-like languages are a dead-end...

Bye,
bearophile