It's obviously C, you can do EVERYTHING with it, I mean EVERYTHING. From games to applications and even a new kernel for your Turing machine, EVERYTHING, ᴇᴠᴇᴙᴉᴛḧᴉᴎ◶!!¡¡
Name:
Anonymous2012-09-15 19:50
Common Lisp.
>>2
C doesn't let one do everything since the programmer is finite. The very limited means of abstraction C provides ultimately limit your mind's power and thus the program's quality.
>>11
Hi, you must be new here. There's a nuance to that idiom, which you've missed.
Name:
Anonymous2012-09-15 22:33
>>9
Yes it does you nigger cum. You just need to explicitly declare what you take as the closing context. I'll post more later on about what I meant by having superior closure than JavaScript, since I'm now in the toilet taking a dump.
foreach ($callbacks as $callback) {
call_user_func($callback);
}
The above will print the numbers 1 2 3 each on its own line. Nothing surprising there.
JavaScript:
callbacks = [];
for (n = 1; n <= 3; n++) {
callbacks[n-1] = function() {
print(n);
};
}
for (i in callbacks) {
callbacks[i].apply();
}
While the seemingly equivalent JavaScript will print 4 4 4 like a retard. PHP in this regard is better for observing the principle of least astonishment. The PHP version can be easily converted into retard mode (which has it uses) by doing:
use (&$n)
instead.
Name:
node.js_gallery_programmer2012-09-16 7:27
>>17
Shit! What have I done all this time! PHP was clearly the superior language.
`>having to manually declare which local variable is used in this context `>my_anus_when.cpp
PHP confirmed for autism
Name:
Anonymous2012-09-16 7:38
>>19
You call it autism, I call it partial macro apply.
PHP confirm for being in the same league as Lisp.
Other languages are you even trying?
Name:
Anonymous2012-09-16 7:46
PHP variables are always function local unless declared otherwise so that keeps things consistent, PHP is shit but at least they didn't try to be clever here, it looks to be as close to a Scheme-tier scoping mechanism as you'll get out of any of the scripting languages. Look at the rest of them, they have magic quantum somewhere scoping, because nobody has read SICP and their language creators are all ``opinionated'' and seek ``elegance''.
Name:
Anonymous2012-09-16 12:36
." Forth"
Name:
Anonymous2012-09-16 13:10
>>22
Are Forth's inventors, Charles Moore, Jewish?
>>17
it doesn't really make much of a difference. to me JavaScript's way makes more sense. It never really comes up but all you'd need to do is add more closures:
for (var i = 0; i < 3; i++) {
a[i] = (function (j) { return function() { console.log(j) }; })(i);
}
The "use" thing from PHP is just plain weird... what other languages use that form?
>>21 it looks to be as close to a Scheme-tier scoping mechanism as you'll get out of any of the scripting languages.
I'd be surprised. For example, FFOC:
local x = 1
do
local x = 2
print(x) --> 2
do
local x = 3
print(x) --> 3
end
end
print(x) --> 1
local closures = { }
for i = 1, 5 do
closures[i] = function () return i end -- IIFEs? What are those?
end
print(closures[1](), closures[3](), closures[5]()) --> 1, 3, 5
local x, y = "foo", "bar"
function f ()
local x = "baz"
return x, y
end
print(f()) --> "baz", "bar"
print(x, y) --> "foo", "bar"
loadstring "local foo = 10"() -- Why even have a separate module scope when regular locals work just as well?
print(foo) --> nil
No magic here!
Name:
Anonymous2012-09-16 16:58
s9.postimage.org/qpgnhjybj/lang_joke.jpg
Name:
Anonymous2012-09-16 17:45
Javascript is best. It's fast, elegant, and you can use it on server AND on client, which was kind of a holy grail before the invention of node js. So you can just learn javascript, and you won't need to learn any other language!
Name:
Anonymous2012-09-16 17:51
>>29
Before JS the client wasn't hosted on a browser. Progress ain't linear.
D, because it has the best templates and it does concurrency right.
Name:
Anonymous2012-09-16 21:03
>>32
Bleh. D is just a better C++. It does have some phenomenal features for a C-family native assembly language, but you don't really need templates for generics. (What some languages call "metaprogramming" some other languages call, simply, "programming.")
I don't think anyone's gotten concurrency right. Actors are right to a limited degree. Join calculus also. If you really want one, the other will work but it won't do.
And if your language isn't safe with regards to shared memory, you still have all the issues we've had in the past. In that case, whatever model you've got it's worse than just about anything in the safe category.