| ||||
| Comment on GotW #7a Solution: Minimizing Compile-Time Dependencies, Part 1 by Herb Sutter
Catching up… @Sebastian: I cover those in the other parts, but you’re right it would be easier to add a short note here. Done. @bcs: The point, which I’ve now clarified, is that the caller can’t even invoke E h(E) unless he already has an E object — so he already has its definition. @Emmanuel: As above, I’ve improved the text to distinguish between parameter and return types. Thanks for the comments. Read More »Comment on Reader Q&A: Acquire/release and sequential consistency by Herb Sutter
@Fernando: C++98 didn’t cover this case because there was no notion of threads or other concurrency in the standard. Implementations generally did the right thing. Then when the standard introduced concurrency it also had to specify a memory model for concurrency. Read More »Comment on Reader Q&A: Acquire/release and sequential consistency by Fernando Pelliccioni
Herb, thanks for your answer. Comment on Reader Q&A: Acquire/release and sequential consistency by Herb Sutter
@Fernando: That code is fine and needs no special code generation for many reasons (disjoint stacks so those locals won’t be adjacent; escape analysis and constant propagation would eliminate c and b outright; even if c and b were static and laid out adjacent in memory it’s fine because all modern processors have single-byte reads so no need even to inject alignment/padding, etc.). Ah, and now I see Bjarne already answered this right in that FAQ. :) Read More »Comment on Reader Q&A: Acquire/release and sequential consistency by Fernando Pelliccioni
Hi Herb, I’ve seen the Atomics Weapons (1 and 2) videos, I found great, thanks! In all examples where you explain the Memory Model you’re using atomic declarations, right? My question is: // thread 1: // thread 2: … Does this mean that a C++11 compliance compiler must insert “lock” instructions (barrier, fences, adquire/release, etc…) to protect NON-Shared NON-atomic memory? Thanks and regards, Comment on atomic Weapons: The C++ Memory Model and Modern Hardware by KerrekSB
Could I ask for some clarification? In the “relaxed” section of the talk, you have a “stop” variable and a relaxed load from it to check whether a thread should end, paired with an SC store “stop = true;” in the main thread. Is it actually guaranteed that the store operation propagates and becomes visible eventually? Would such a guarantee depend on the existence of an acquire-release-pair? (I appreciate that actual synchronization isn’t required in the example and that we don’t need a release sequence, but I don’t see how eventual propagation is guaranteed.) Thanks! Read More »Comment on Reader Q&A: When will better JITs save managed code? by Ben Voigt
Sure, many times there are complex expressions (perhaps including loops) performing computations which are parameterized by the parameters are known at compile-time. Numeric integration of a function that has no closed-form algebraic integral, parameterized on the limits/bounds would be an example. In C++, meta-programming (formerly with templates, now with `constexpr`) can cause those to be precomputed at compile time. JITs won’t compute those at compile time, and in fact there would be no advantage to doing so, because the compile time cost is paid for every execution. In a JITted environment, you might as well just use memoization to ensure the computation is done at most once per execution. Read More »Comment on Reader Q&A: When will better JITs save managed code? by Jon Harrop
“This is a 199x/200x meme that's hard to kill…a JIT can never be as good as a regular optimizing compiler because a JIT compiler is in the business of being fast, not in the business of generating optimal code” In my experience, the variance between different C++ compilers is much greater than between C++ and managed languages. For example, I have found that MSVC++ usually generates poor code that runs slower than most managed languages. The Clang C++ compiler usually generates fast code but it uses the same backend (LLVM) that managed languages use. So I don’t believe your claim. Do you have any concrete examples of optimizations done by C++ compilers that are not done by JITs because compile times would be unacceptable? Read More »Comment on Perspective: "Why C++ Is Not 'Back'" by Craig
Managed languages are the right choice for the large majority of use cases. C is usually the most pragmatic choice for use cases that call for a lower level of abstraction and/or higher level of control. C++ just doesn’t have enough to offer to justify it’s horrifying complexity, internal inconsistency and glacial compilation speed. Ensuring the job security of and dependence upon the sadists willing to learn it is just about the only thing it has going for it. Read More »Comment on Trip Report: Fall ISO C++ standards meeting by terry
>whether the programmers start using all these wonderful features and leave the past behind Comment on Reader Q&A: When will better JITs save managed code? by [转]为什么移动Web 应用程序很慢
[…] 下面这段话出自于Herb Sutter ,现代C++中最著名的人物之一: […] Read More »Comment on Bjarne and I are speaking in Chicago on Tuesday night by Vipul S. Chawathe
@everyone thnx :))) Read More »Comment on Trip Report: Fall ISO C++ standards meeting by Kostas Dritsas
It is great to know that C++ is (undoubtedly) chaning for the better, my main concern is whether the programmers start using all these wonderful features and leave the past behind. it is very important to me to know when to use the right Comment on Bjarne and I are speaking in Chicago on Tuesday night by Philipp Lenk
I am very sorry for asking again despite it being off-topic, yet my rather limited understandig has left my quite confused. Was my observation of the codes behaviour wrong or is it simply no real problem because it has to be spelled out explicitly and would be hard to do without actually wanting to cause undefined behaviour? Read More »Comment on Bjarne and I are speaking in Chicago on Tuesday night by Herb Sutter
@GregM: Right. I don’t see why this would be a ‘ticking time bomb’ any more than similar code in C#, where lambdas *always* capture by reference and if you capture a Disposable object you get the same use-after-Dispose issue — only silently without saying “ref” or similar in the code. In this code, C++ actually forced him to write “&” everywhere to explicitly spell “capture by reference,” and he got exactly what he asked for. Read More »Comment on Bjarne and I are speaking in Chicago on Tuesday night by GregM
VC++ 2010 /W4 warns you that you’re going to shoot yourself in the foot, and if you are good and use warnings as errors, it won’t even compile: warning C4172: returning address of local variable or temporary Read More »Comment on Trip Report: Fall ISO C++ standards meeting by Herb Sutter
You can follow the graphics discussion group listed at isocpp.org/forums. Read More »Comment on Trip Report: Fall ISO C++ standards meeting by Michael Marcin
Is there any way to get involved in the Graphics study group? Read More »Comment on Trip Report: Fall ISO C++ standards meeting by Jesse Good
I was looking forward to std::dynarray a little, but I can see how there is an overlap with runtime sized arrays. However, ould you elaborate on “optional has moved to the Library Fundamental TS.”, what were the issues there? Read More »Comment on Bjarne and I are speaking in Chicago on Tuesday night by Philipp Lenk
@Yuriy Grishin: Comment on Bjarne and I are speaking in Chicago on Tuesday night by Vipul S. Chawathe
@Yuriy Thnx for reply. Comment on Trip Report: Fall ISO C++ standards meeting by Herb Sutter
There was a transient glitch (we’re investigating). It’s back up now. Read More »Comment on Trip Report: Fall ISO C++ standards meeting by Herb Sutter
@Magnus: Not yet, and probably won’t. The point was to break new-to-me ground — not to write a complete game clone (those already exist so that’s not new), but to see for myself as an existence proof that something interesting can be done in just Standard C++ plus one modern graphics framework from scratch in an afternoon (that *is* new information). Now I know it can. Having already exercised loading and displaying textures and doing drawing, animating the ghosts is just more of the same and so less interesting. However, I would not be surprised if someone else picked up the challenge and wrote a complete PacMan from scratch in a day and possibly even extended the original with cool new features (hint hint). Read More »Comment on Bjarne and I are speaking in Chicago on Tuesday night by Herb Sutter
@Paul: Thanks, I’ll switch to a better example of a Greek root. Read More »Comment on Trip Report: Fall ISO C++ standards meeting by James Curran
Have you taken it all back? All three major links (trip report, status, and timeline img) give 404s. Read More »Comment on Trip Report: Fall ISO C++ standards meeting by Herb Sutter
The TS’s shown in the graphic are just the ones that are currently actively open and have (or will soon have) working papers with standardese wording — even showing only the near-term work items due for completion in the next 12-24 months is getting pretty crowded! I used to show TM and other future TS’s in the graphic, and we still expect them, but there are now so many near-term ones that I trimmed the list for space to just the actual open projects, and will add the others as they reach the stage of having a working draft. At the Chicago meeting there was discussion of other SG work, including modules and transactional memory and graphics and other work. Those proposals are not yet far enough along to be in working drafts yet, though I expect we’ll see more of them reach that stage in the next few meetings. Read More »Comment on Trip Report: Fall ISO C++ standards meeting by Magnus
Did you ever finish that Pacman game? ;-) Read More »Comment on Trip Report: Fall ISO C++ standards meeting by Troy
Modules appear to be missing from the timeline :( Read More »Comment on Bjarne and I are speaking in Chicago on Tuesday night by Paul Keyser
I enjoyed your talk on Tues Sept 24, and especially the English to C++ parallels, and would like to suggest some small fixes: Comment on Bjarne and I are speaking in Chicago on Tuesday night by Yuriy Grishin
@Vipul S. Chawathe c:\prog\cpp\tests\cpp-core>g++ test1 c:\prog\cpp\tests\cpp-core>g++ test1.cpp c:\prog\cpp\tests\cpp-core>g++ -v c:\prog\cpp\tests\cpp-core> Read More »Comment on Bjarne and I are speaking in Chicago on Tuesday night by Vipul S. Chawathe
Kindly shed light on C++11 ticking time-bomb illustration at https://gist.github.com/quietfanatic/6746964 Thank you. :) Read More »Comment on Bjarne and I are speaking in Chicago on Tuesday night by Valentin
Will the talk be available online ? Read More »Comment on Bjarne and I are speaking in Chicago on Tuesday night by Herb Sutter
Yes, I saw those reports afterwards. What is most baffling is the (unfortunately-as-usual) vacuous and even hateful comment threads. In the first couple of pages, I saw nothing but angry comments that people are making this up and should get a life. As I mentioned in my talk on Tuesday night, my wife is a longtime satisfied iPhone user who is prone to motion sickness, and the gentler motion in iOS 6 and earlier never bothered her before. After installing iOS 7, she couldn’t even unlock her phone without a wave of nausea — the effect was immediate from the first unlock with iOS 7. And it isn’t just the parallax wallpaper (which wasn’t even enabled on her iPhone 4), it was the extra zoom motion everywhere but particularly on unlock, where the zoom animation was (a) slower and (b) irregular with different icons falling in at different speeds. Calling people who report these problems “stupid” and claiming they’re making it up and should “grow a pair” is just foolish, yet that’s what every user comment I’ve read so far has said. Now, I realize comment threads are usually 90% foolish, but this is the first comment thread that was 100% foolish (at least as far as I read it). Fortunately the commenters here are much better and well over 90% reasonable and thoughtful — thanks! it’s much appreciated. Read More »Comment on Bjarne and I are speaking in Chicago on Tuesday night by Dithermaster
Herb, thanks for the great talk. You mentioned the iOS 7 animations, and it seems some folks are affected by this: http://www.macrumors.com/2013/09/26/ios-7-users-complaining-about-motion-sickness-due-to-parallax-and-zooming-effects/ Read More »Comment on GotW #1 Solution: Variable Initialization – or Is It? by Mald
Just want to thank you Herb for your GotW articles. Your explanations by example has really helped me. I have a question that is related to Copy Constructors and c++11. I was making a class recently and I was writing the copy constructor for it. I realized that it was basically a duplicate of the explicit normal constructor that I just wrote. Fortunately c++11 allows constructors to call peer constructors using delegation. So could I just have my copy constructor call my explicit normal constructor? Is this acceptable? Read More »Comment on Recommended reading: Why mobile web apps are slow (Drew Crawford) by Taylan
I’m sorry but I urge you to reconsider your appreciation of Crawford’s article, and if possible, post a correction mentioning what I now will, for I don’t have the publicity to correct the misinformation spread by Crawford. As apparent from my e-mail exchange with him (linked below), he is extremely ignorant on garbage collection, loves misinterpreting academic papers, and the claims in his article regarding garbage collection are clearly a result of misinterpretation of a linked paper; the article grossly misrepresents the results of the paper, whose value are I think dubious even if interpreted correctly. http://taylan.uni.cx:8080/webapps-js-gc/ If you have difficulties with the above link, contact me via taylanbayirli at Google Mail and I will send you a copy. It disturbs me greatly that an article with this level of misinformation is nevertheless written this well, and enjoys the publicity and appreciation it does, please help correct this for the sake of the public’s information and education. Read More »Comment on Reader Q&A: "Will C++ remain indispensable…?" by Asoft Raiden
I am a medical doctor and I use C++. Read More »Comment on Reader Q&A: "Will C++ remain indispensable…?" by pjmlp
@Herb Thanks for the invitation, sadly it is a bit far from Düsseldorf. :) Read More »Comment on Visual Studio 2013 RC is now available by Another Layer
[…] MSVC 2013 is going to support static initialization of locally scoped variables. In the meanwhile, you can work around this shocking deficiency most of the time, by doing the […] Read More »Comment on Bjarne and I are speaking in Chicago on Tuesday night by Tom Kirby-Green
Will the talk be filmed and available later online Herb? Kind regards, Tom Read More »Comment on Bjarne and I are speaking in Chicago on Tuesday night by Al capone
Acccording to figures last week, that is the murder capital of gthe U.S. Read More »Comment on Bjarne and I are speaking in Chicago on Tuesday night by Petro
Can we expect video recordings later? Thanks in advance. Read More »Comment on Reader Q&A: "Will C++ remain indispensable…?" by Herb Sutter
@pjmlp: Yes. He is smart and a good guy, but so negative that I wonder whether we were at the same conference. He’s welcome to his opinion, and many people have said the same; but I don’t share it, and I disagree with most of his examples. Two particular things he’s wrong about involve compatibility: 1. He underestimates the importance of source backward compatibility. It’s extremely important, see here: http://herbsutter.com/2012/12/04/compatibility/ 2. He overestimates the complexity cost of source backward compatibility. It isn’t as high or important as he thinks. I’ll talk about this on Tuesday night in Chicago at the Chicago C++ Users Group meeting: https://sites.google.com/a/chicagoacm.org/chicago-chapter-of-the-acm/meeting-topics/2013-09-24-onec-herb-sutter (Note it says the event is at capacity, but they’re looking for a bigger room, so do add yourself to the waiting list.) Read More »Comment on Reader Q&A: "Will C++ remain indispensable…?" by pjmlp
Bartosz Milewski seems to have another opinion, http://bartoszmilewski.com/2013/09/19/edward-chands/ Read More »Comment on Reader Q&A: "Will C++ remain indispensable…?" by Magnus
Matt: Clang (and other tools) is getting really good at detecting undefined behaviours and unwanted memory accesses in debug builds. There is also a lot more emphasis on defining what standard behaviour should be in C++, and for compiler vendors to follow it. I think this the “one C++” thing Herb talked about, but I haven’t got to that video yet in my Going Native binge :). Lots of great work being done by Herb and others at the moment, thanks! Programmes operate on data in memory. C++ is a “real” programming language while others aren’t as far as I’m concerned because it lets me tell what the computer to do with that memory, without fuss. I don’t like working in languages that think I don’t even know what a pointer is. Read More »Comment on Reader Q&A: "Will C++ remain indispensable…?" by Herb Sutter
@Matt: Short answer: No, and they won’t be because it’s not what they’re for. See http://herbsutter.com/2012/04/02/reader-qa-when-will-better-jits-save-managed-code/ . I heard what you said a lot last decade (200x), and it’s dying out now that people are grokking that it isn’t so. Read More »Comment on Reader Q&A: "Will C++ remain indispensable…?" by Matt Campbell
I think it’s dangerous to promote C++ as a general-purpose programming language today, because C++ is not memory-safe. For the vast majority of code, we should use a language and runtime environment that provide a solid bedrock of abstraction, so that things like buffer overflows and stack smashes are simply impossible. Aren’t JIT compilers good enough now that we can relegate C++ to the last resort for the small amount of code that where performance really matters, rather than the first choice? See also: Comment on Reader Q&A: "Will C++ remain indispensable…?" by Magnus
It *should* be a silly question to ask if the main industrial-strength language that emits fast native code has a future. Otherwise, what’s the point of CPU manufacturers continuing to strive to make their chips faster and use less power? But here is the sad reality. The “critical measure” for writing code for server systems (besides the sector Herb mentioned) isn’t speed, it isn’t power efficiency, and it isn’t even programmer productivity. It’s programmer salaries. This is the overriding concern of the employers of most professional programmers today. Large companies might think they care about productivity, but to them driving down salaries is more important. Look at modern trends, and look at the FizzBuzz phenomenon to see how much value is really placed on competency. As for mobile platforms, C++’s benefits are even less important. The “critical measure” is getting your stupid (cr)applet out to as many tablets/phones as possible. Herb himself linked to an article a couple of weeks ago showing the dire state of the mobile ecosystem. Who cares if your finely-tuned, well-written app can run for ten hours straight if there are ten other dodgy apps that have killed the battery long within that time? This isn’t even an important issue, more urgent is how many apps that leak credit card or login details to the outside world in plaintext. Fast mobile code doesn’t matter even to OS developers, a guy wrote his own jpeg coder in C and assembler that outperform’s Apple’s native one for an app that can take lots of hires photos rapidly. Read More »Comment on Reader Q&A: "Will C++ remain indispensable…?" by AGPX
Until a language/technology have some advantage over others, it will survive. And C++ have a great advantage: the performance and this is a continuous demand, no matter how fast the processors will become. I like Java/C# languages, but C++ it’s still my prefered. Read More » | ||||
| | ||||
| ||||
Wednesday, November 6, 2013
FeedaMail: Comments for Sutterâs Mill
Subscribe to:
Comments (Atom)