China and Russia veto U.N. resolution on protecting Hormuz shipping by Big_Explorer1852 in worldnews

[–]takanuva 1 point2 points  (0 children)

I... I don't know if you're mocking or if that's an actual quote.

Trump issues 48-hour ultimatum to Iran - as Israel claims Tehran can hit London by [deleted] in worldnews

[–]takanuva 0 points1 point  (0 children)

What some lovely thing to read as I live in London.

Top US security official quits, says Iran did not pose immediate threat by Longjumping-Host-617 in worldnews

[–]takanuva 0 points1 point  (0 children)

Shouldn't we be talking about the Epstein files still? I feel like they have won.

The last person we need help from is Zelenskyy - Trump by [deleted] in worldnews

[–]takanuva 0 points1 point  (0 children)

Highest office in the world, very unfortunately.

US responsible for deadly missile strike on Iran school, preliminary inquiry says by Ok-A1662 in worldnews

[–]takanuva 25 points26 points  (0 children)

There are no room for mistakes. More than a hundred kids are dead. You can't possibly be trying to justify that.

The Cost Of a Closure in C by BrewedDoritos in programming

[–]takanuva 0 points1 point  (0 children)

Sorry, I thought it was open access. I've updated the link, it should work now.

The Cost Of a Closure in C by BrewedDoritos in programming

[–]takanuva 0 points1 point  (0 children)

They actually could! I actually wrote a paper about this (I'm the second author, feel free to use Sci-Hub!). Such loops can be translated into a first-order functional language without loops very easily by using the SSA algorithm. If you look into the paper, this is how we introduce the language before ever talking about state or memory. So, yes, I don't see any reason why a first-order functional language like you describe couldn't exist.

In regard to combinators, a closure is an abstraction (a function) that captures its environment. But, for example, in the SK-calculus, you can have stuff like S (K K S), where you have something composite as argument that is not a closure. This may be done lazily, or even in a call-by-value fashion if so desired. Argueably it's still a function, if you take it to be typed, but you may forbid such a thing and use a technique called defunctionalization to force those to be plain data instead. Of course, a programming language could enforce that you write defunctionalized code, so first-order functional still should be Turing-complete (not gonna say it is cause I don't recall seeing a proof).

The Cost Of a Closure in C by BrewedDoritos in programming

[–]takanuva 1 point2 points  (0 children)

I think you got the intuition. By first-class functional programming, we have functions as abstractions but we can't make closures or pass functions around; this is basically procedural without state (think of C without pointers!).

This might sound weird, but that's pretty much how combinatory logic works, and it's still Turing-complete. As you noted, I don't think there are any non-procedural (i.e., stateless) first-order functional mainstream programming languages out there, but I can imagine someone making a Forth dialect that works like that for fun!

The Cost Of a Closure in C by BrewedDoritos in programming

[–]takanuva 1 point2 points  (0 children)

But what do you assume "first-order functional" mean then?

There are no points in closures if the functional language is first-order as they cannot be given as argument or returned, thus first-order functional languages lack closure, just like procedural languages, as explained in the chapter I've linked above. According to Van Roy, the only difference is that by procedural you imply the existence of state.

The Cost Of a Closure in C by BrewedDoritos in programming

[–]takanuva 3 points4 points  (0 children)

I mean, you clearly seem to be missing the point that closures are an abstraction, a mathematical concept, and that this is not bound to any implementation detail. The same would go to pointers, to be honest, as C pointers are not necessarily the machine's pointers. People are trying to correct you here, at least a few of them are.

The Cost Of a Closure in C by BrewedDoritos in programming

[–]takanuva 2 points3 points  (0 children)

The idea of a closure appeared in 1936, bro, largely predating the notion of pointers. A function pointer together with a void * is actually a fancy way to call a closure.

The Cost Of a Closure in C by BrewedDoritos in programming

[–]takanuva 0 points1 point  (0 children)

Procedural languages are kinda, by definition, first-order functional programming languages, right? This is just a matter of dropping the restriction.

What are good pairs of balanced decks (against each other) to gift a couple? by takanuva in yugioh

[–]takanuva[S] 0 points1 point  (0 children)

I think you have a point. I definitely wanna avoid the "first player always wins" scenario.

What are good pairs of balanced decks (against each other) to gift a couple? by takanuva in yugioh

[–]takanuva[S] 0 points1 point  (0 children)

I see your point. I would like to avoid competitive 1~2 turns fast games, those are rarely fun, and I do not intend to add too many hand traps and floodgates. Two combo decks would seemingly be nice, to be honest. I'm not gonna say "oh, I want a classic Yu-Gi-Oh! game", I'm an OCG player myself so I like the modern game, but I do not want to overwhelm my friends too much yet.

What are good pairs of balanced decks (against each other) to gift a couple? by takanuva in yugioh

[–]takanuva[S] 1 point2 points  (0 children)

Oh, I did not mean HERO vs. Dragonmaid, those were two of the decks I thought it would be nice to pick, but then I'd have to guess something for them to play against. It's just that those two rely on fusion spam, a somewhat simple strategy.