Live data from Hacker News

Classic computer science problems solved in JavaScript

github.com

11–13 of 13 posts

Re: Classic computer science problems solved in JavaScript

#11

Look, JS is a language like any other. If I can do something in assembly, I can do it in JS. Give me IF statements (preferably with nesting support) and variables, and there's nothing that cannot be done. What remains is how easy, how nice, how flexible, how enjoyable, how compatible, how reliable, how practical. For me, the answer is C++, but don't let that influence you ;-)

Give me IF statements (preferably with nesting support) and variables, and there's nothing that cannot be done.

I know you were exaggerating here, but simple conditional statements aren't actually sufficient. You need some construct that allows repetition, if only implicitly. "while" loops would be easy, but even simple function calls suffice if you have function pointers (in fact, allowing function pointers alone ought to be enough, without conditionals or even variables).

At any rate, it's the lack vs. presence of repetition constructs that makes SQL not a full general-purpose language, where XSLT actually is.

Re: Classic computer science problems solved in JavaScript

#12
post #8

Earlier quoted context omitted.

Yea, I wish I could

Seriously asking here: what would you like more about Ruby as opposed to Javascript if they were in the same boat (i.e. if Ruby had client ubiquity, no systems frameworks, no major non-browser platform, etc)?

Lack of curly braces?

Re: Classic computer science problems solved in JavaScript

#13

Look, JS is a language like any other. If I can do something in assembly, I can do it in JS. Give me IF statements (preferably with nesting support) and variables, and there's nothing that cannot be done. What remains is how easy, how nice, how flexible, how enjoyable, how compatible, how reliable, how practical. For me, the answer is C++, but don't let that influence you ;-)

Give me IF statements (preferably with nesting support) and variables, and there's nothing that cannot be done. I know you were exaggerating here, but simple conditional statements aren't actually sufficient. You need some construct that allows repetition, if only implicitly. "while" loops would be easy, but even simple function calls suffice if you have function pointers (in fact, allowing function pointers alone ou…

Add GoTo's to the list, and you're set :)

At the assembly level, everything is boiled down to (basically) bne, mov, and jmp.

Post reply on HN