language agnostic - What's the shortest code to cause a stack overflow? -
to commemorate public launch of stack overflow, what's shortest code cause stack overflow? language welcome.
eta: clear on question, seeing i'm occasional scheme user: tail-call "recursion" iteration, , solution can converted iterative solution relatively trivially decent compiler won't counted. :-p
eta2: i've selected “best answer”; see this post rationale. contributed! :-)
all these answers , no befunge? i'd wager fair amount it's shortest solution of them all:
1
not kidding. try yourself: http://www.quirkster.com/iano/js/befunge.html
edit: guess need explain one. 1 operand pushes 1 onto befunge's internal stack , lack of else puts in loop under rules of language.
using interpreter provided, eventually--and mean eventually--hit point javascript array represents befunge stack becomes large browser reallocate. if had simple befunge interpreter smaller , bounded stack--as case of languages below--this program cause more noticeable overflow faster.
Comments
Post a Comment