That is a different approach, but I don't think you've demonstrated why it's better. Seems like that approach forces you to introduce a new scope for every resource, which might otherwise be unnecessary:
using (var resource1 = acquire() {
using (var resource2 = acquire()) {
using (var resource3 = acquire()) {
// use resources here..
}
}
}
Compared to:
var resource1 = acquire();
defer { release(resource1); }
var resource2 = acquire();
defer { release(resource2); }
var resource3 = acquire();
defer { release(resource3); }
// use resources here
Of course if you want the extra scopes (for whatever reason), you can still do that with defer, you're just not forced to.
While the macro version doesn't permit this, if it were built-in syntax (as in C#) we can write something like:
using (auto res1 = acquire1(); free(res1))
using (auto res2 = acquire2(); free(res2))
using (auto res3 = acquire3(); free(res3))
{
// use resources here
}
// free(res3); free(res2); free(res1); called in that order.
The argument for this approach is it is structural. `defer` statements are not structural control flow: They're `goto` or `comefrom` in disguise.
---
Even if we didn't want to introduce new scope, we could have something like F#'s `use`[1], which makes the resource available until the end of the scope it was introduced.
use auto res1 = acquire1() defer { free(res1); };
use auto res2 = acquire2() defer { free(res2); };
use auto res3 = acquire3() defer { free(res3); };
// use resources here
In either case (using or use-defer), the acquisition and release are coupled together in the code. With `defer` statements they're scattered as separate statements. The main argument for `defer` is to keep the acquisition and release of resources together in code, but defer statements fail at doing that.
There were multiple times I wanted to contribute to SO but couldn't because I didn't have sufficient "reputation", or something. I shrugged and moved on.
Economically, producing less to start with is not very different from what is currently done, destroying excess inventory. Therefore I don't think it's at all a given that prices will go up.
> The world is yet to create a lab as innovative as Bell Labs.
That was entirely accidental. There's absolutely no guarantee that any given monopoly will produce anything remotely like Bell Labs, and I don't believe that a monopoly was required to do what Bell Labs did.
And yet they sat on transformers until OpenAI kicked off the AI boom by actually productizing that research in ChatGPT. Though it's possible they were just being cautious, my uncharitable view is that they knew this would disrupt their highly lucrative ads business, which is always the problem with monopolies.
Also you're overlooking other top-notch corporate research institutions like Microsoft Research, which arguably are more "Blue Sky" in the sense they are not constrained to any current product lines.
I believe they're referring to running Zed entirely in a browser. This opens up possibilities like using zed for something like codepen, or embedding it into a git web frontend like gitea. Many projects like this basically embed vscode, a rare benefit of being an electron app which Zed is not.
> Taxing assets is inflationary because it forces sales.
I can see how taxing assets could result in more selling than would have occurred otherwise.
But all else being equal, an increase in selling tends to put downward pressure on prices. So I don't see why an asset tax would be expected to cause inflation.
I've been using c++ for over 30 years. 20-30 years ago I was mostly using MSVC (including version 6), and it absolutely had bugs, sometimes in handling the language spec correctly and sometimes regarding code generation.
Today, I use gcc and clang. I would say that compiler bugs are not common in released versions of those (i.e. not alpha or beta), but they do still occur. Although I will say I don't recall the last time I came across a code generation bug.
I attended the Arkansas Governor's School in '92. The last with Clinton's influence. They had remarkably liberal programs to expose kids to the broader world. After that year the J-freaks took over and eliminated all of that programming to suit their flavor of bigotry but that doesn't erase the people that were and still are there.
reply