Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
letzjuc
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
7 ms
·
1.
▲
by
letzjuc
13y ago
> how a container is searched should be abstracted away in the container's implementation lol, no, god no. I think you got the STL completely wrong.
2.
▲
by
letzjuc
13y ago
Indeed. It should be: >TL;DR: concurrency is unspecified in _C99_. Since it is specified in C11's memory model.
3.
▲
by
letzjuc
13y ago
Anyone knows why anyone would impose these limits to crowdfunding?
4.
▲
by
letzjuc
13y ago
In a non-deterministic garbage collector memory _might not_ be released when the last reference goes out of scope (and this is often the case).
5.
▲
by
letzjuc
13y ago
forcing strict evaluation feels like a mess, template haskell feels like a mess, debugging space leaks feels like a mess, not to mention that the haskell learning curve is very high Haskell is pretty good at a lot of things, so don't
6.
▲
by
letzjuc
13y ago
Do that and tell us how many people use your language. We'll be waiting.
7.
▲
by
letzjuc
13y ago
Why use new/delete when you have make_shared and make_unique? Like 99.99999999% of the time you can use those. Like the only situation where I think they might be not enough is for some weird uses of placement new.
8.
▲
by
letzjuc
13y ago
> And reference counting also renders the point of determinism moot - now you never know if releasing a reference while trigger freeing a resource. You know that releasing the last reference will. That is why the important concept is sin
9.
▲
by
letzjuc
13y ago
>You asked for a situation where the lifetime of a resource can't be directly tied to the lifetime of a single storage location. I don't think I asked for that but correct me if I did (maybe I'm just not understanding your
10.
▲
by
letzjuc
13y ago
The solution above works even if your graph has cycles. Of course if you know that it doesn't you can just build the graph with unique_ptrs.
11.
▲
by
letzjuc
13y ago
It's simple. The key is that something has to have _ownership_ of the products. [1] User decides to view a couple of orders. Orders reference products. Those products are managed by something (e.g. an unordered_map of shared_ptr). The
12.
▲
by
letzjuc
13y ago
Could you elaborate?
13.
▲
by
letzjuc
13y ago
I fail to see why you need cycles' support for that.
14.
▲
by
letzjuc
13y ago
Have a vector of shared_ptr that own the objects in the graph and build a graph with weak_ptr ? Removing an object is just as easy as removing an element from the vector. (If you test the weak_ptrs on use, that's actually the only thin
15.
▲
by
letzjuc
13y ago
Then the lists should only have a weak_ptr to the object. Something is handling both list [1], that something could own the object, or maybe something external to that. Giving ownership of the object to both list is a design error [2]. [1]
16.
▲
by
letzjuc
13y ago
Because it is deterministic? (i'm just guessing that what you call "proper" garbage collector is non-deterministic). Furthermore, the only "advantage" I see in garbage collectors is that they can deal with cycles. I
17.
▲
by
letzjuc
13y ago
In Germany I get paid around 3.500 Euro brutto per Month for pursuing my PhD at my university. Same conditions as the parent post: expected duration 5 years, 20% work time dedicated to university,... That's around ~44.000 Euros per yea
18.
▲
by
letzjuc
13y ago
well there is clang-format and clang-tidy and they are really easy to set up in CMake (I use "make format").
19.
▲
by
letzjuc
13y ago
This is no gotcha; he deliberately shoots himself in the foot by using a "weird" integer type. The right solution is to use value_type from container/iterator_traits (that is what it is there for): accumulate(begin(v),
20.
▲
by
letzjuc
13y ago
> but I don't think "Run your code through a formatter when you're done hacking it together" is a viable, maintainable, or scalable policy. Just hook clang-format or clang-tidy with your build system. A lot of project
21.
▲
by
letzjuc
13y ago
Yes, it does. Drepper's two points on the mails are the same points I made above: - your code is not valid C code, fix that. - these changes are pointless, since _unused0 could create problems in another system using invalid C code. So
22.
▲
by
letzjuc
13y ago
In ISO C (7.1.3): All identifiers that begin with an underscore are always reserved for use as identifiers with file scope in both the ordinary and tag name spaces. In ISO C++ (17.4.3.2.1): Each name that begins with an underscore is reserv
23.
▲
by
letzjuc
13y ago
Well, I'm sorry to disagree with you but Drepper is right. In C and C++ identifiers starting with an underscore are reserved for the implementation. Standard library implementors deal with extremely ugly code full of underscores everyw
24.
▲
by
letzjuc
13y ago
Disclaimer: this is a rant, it is obvious that I don't like OpenCL and that I think that it was designed by monkeys so take it with a grain of salt. In short: don't learn OpenCL. Both CUDA and C++AMP are good languages for program