Live data from Hacker News

Why I don't spend time with Modern C++ anymore

linkedin.com

131–140 of 264 posts

Re: Why I don't spend time with Modern C++ anymore

#131
post #92

Earlier quoted context omitted.

HFT = Insider trading + Algorithm trading

No, it's just fast algorithmic trading, aka latency arbitrage. It's still quite risky and you don't have any special information anyone else doesn't have.

I think I see what commenter meant. You have to physically be on the inside in the sense you need a direct, short connection to the network that cost ridiculous money along with HW and SW that costs ridiculous money. A prestigious position most stock traders couldn't compete with if they wanted to. Plus, you get to preempt all of them from this position without them even knowing it.

Re: Why I don't spend time with Modern C++ anymore

#132
post #101
post #93

Earlier quoted context omitted.

Well, we also have to thank C for the set back in optimizing compilers. Fran Allen. In Coders at Work (pp. 501-502): --- Begin Quote --- -Seibel-: When do you think was the last time that you programmed? -Allen-: Oh, it was quite a while ago. I kind of stopped when C came out. That was a big blow. We were making so much good progress on optimizations and transformations. We were getting rid of just one nice problem a…

ah your siding on the lisp machine vs todays hardware arch. I think if the lisp hardware architecture has significant advantages we`ll see that emerging in "soft cpu`s" on fpga`s. Particularly as the Xeon/FPGA gear gathers steam.

We've already seen the advantages although the total cost-benefit is unknown. For one, several CPU's for Scheme/LISP in past had hardware-accelerated garbage collection and/or a bunch of cores. Automatic, memory management and multicore are now mainstream due to perceived benefits. Works down to CPU in LISP machines.

Also, I've seen some of these benefits of Genera in modern stacks but I still don't have all of these capabilities:

http://www.symbolics-dks.com/Genera-why-1.htm

Any jump out at you as particularly awesome for a developer OS?

Re: Why I don't spend time with Modern C++ anymore

#133

Earlier quoted context omitted.

have you tried ccache? the 5x to 10x improvement isn't a bogus statement in my experience

ccache eliminates spurious rebuilds, but doesn't make compilation of things which actually need to be recompiled any faster. It's basically just a workaround for that Make only uses file mtimes and not the contents to decide what needs to be built.

In theory, agreed. In practice I see a lot of re-compilation in large projects.

Re: Why I don't spend time with Modern C++ anymore

#134
post #27

Earlier quoted context omitted.

Parallelism: yes, although OpenMP isn't nearly as accessible as e.g. Swift async closures. C++ only got proper language-native threading in C++11. for large scale programming the only sane model is a flat, cache coherent one Do google view their datacenters as a single flat cache-coherent memory space? No, they built mapreduce instead. That's the point of view I'm coming from: distributed systems engineering working…

"Parallelism: yes, although OpenMP isn't nearly as accessible as e.g. Swift async closures." I'm not familiar with them, do you have a pointer? Cilk does have powerful semantics and a very light weight syntax. "C++ only got proper language-native threading in C++11." Sure, but OpenMP and Cilk are significantly older. "Do google view their datacenters as a single flat cache-coherent memory space?" No, but I'm pretty s…

Exactly. We had older stuff that could handle this. There was a ton of innovation in MPP's and clusters that could be applied to today's problems with ASIC's or FPGA's with interesting results. I intend to do just that at some point.

Far as nanosecond comms, they might want to consider using the old Active Messages or Fast Messages schemes. Their latency was tiny even on Ethernet. SGI also put FPGA's on NUMA interconnect back in the day. What Intel is doing is an increment on that rather than revolutionary or anything. One could use NUMAscale's chips to connect these things together.

There's also academic tools that could be polished for producing Verilog/VHDL automatically from higher-level descriptions. High-level synthesis it's called. Works well enough for simple constructs like he says he uses. Don't have to go straight to RTL level haha.

Re: Why I don't spend time with Modern C++ anymore

#135
post #105
post #93

Earlier quoted context omitted.

Well, we also have to thank C for the set back in optimizing compilers. Fran Allen. In Coders at Work (pp. 501-502): --- Begin Quote --- -Seibel-: When do you think was the last time that you programmed? -Allen-: Oh, it was quite a while ago. I kind of stopped when C came out. That was a big blow. We were making so much good progress on optimizations and transformations. We were getting rid of just one nice problem a…

That's some serious sour grapes by Allen. Her assertion that Fortran and COBOL are higher level than C is .. difficult to support given the reliance of both languages on GOTO. The assertion that compilers weren't taught any more is just silly.

Here's an experienced C programmer and fan telling you a list of ways Fortran is higher-level and superior to C for numeric programming:

http://www.ibiblio.org/pub/languages/fortran/ch1-2.html

Re: Why I don't spend time with Modern C++ anymore

#136
post #127
post #105

Earlier quoted context omitted.

That's some serious sour grapes by Allen. Her assertion that Fortran and COBOL are higher level than C is .. difficult to support given the reliance of both languages on GOTO. The assertion that compilers weren't taught any more is just silly.

Fortran is certainly higher level than C, given lack of aliasing and no decay of arrays into pointers.

You should bookmark this for future discussions bringing up Fortran. Great write-up.

http://www.ibiblio.org/pub/languages/fortran/ch1-2.html

Re: Why I don't spend time with Modern C++ anymore

#137
post #65

As has always been the case, effective use of modern C++ requires knowing which subset of the language to use and which to avoid. I agree with the author's criticisms of many C++ features. At the same time, I think that a proper simple, modern subset of C++ exists that is much more productive and safer than C, without sacrificing performance. You can also optimize progressively, for example start with using std::stri…

"Not to mention, FPGA compile times can take hours or even days, which pales in comparison to most C++ template overhead."

It's really funny to see him bitching about iterations with templates then suggest using a FPGA and synthesis tools. I'm glad it amused someone else, too. :)

Re: Why I don't spend time with Modern C++ anymore

#138
post #84

Earlier quoted context omitted.

As far as the complexity of programs are concerned, there is a similarity between statements at one level of abstraction and functions at a higher level. I have seen many cases where small functions have been assembled into complicated programs. These programs often have a proliferation of 'helper' classes and functions, where you have to trace through long series of calls to get to where the work is done. They often…

I think what you're describing is a case where you can't understand what those helpers do, and therefore can't understand what the function that calls them does. I maintain that if each individual function makes sense then the whole will too.

This holds if the small functions are built around a coherent top-down design, respecting each other's invariants. Once the project is too large to fit in one's head, it is no longer sufficient for each function to be 'correct' in a local sense.

Re: Why I don't spend time with Modern C++ anymore

#139
post #114

Earlier quoted context omitted.

Because it's a C++11 header that doesn't exist in C++98. And I cannot compile that version without switching to C++11 mode. Edit: there appears to be some confusion here. I don't include the C++11 header myself. I include a public API header of another project which now happens to include a C++11 header in their public include file. Unless I want to stay on the old version of that API and accept the risks, I don't ha…

> Because it's a C++11 header that doesn't exist in C++98. That is supposed to be a fault of C++11?

I don't understand your argument. An upstream project I use put a C++11 header in their public API's header. Now, I also have to build in C++11 language mode. If you're saying it's not the language standard's fault that CXX is slower, sure, but how or why should I differentiate between ISO C++ and g++/clang++ with libstd++/libc++?

Re: Why I don't spend time with Modern C++ anymore

#140
post #43
post #24

Ok. Try a different language :)? A single language needed to solve all problems is a fallacy. I don't see FPGA programming ousting c++, but expect higher level languages with strong parallel semantics to gain "market share". You can always call a dedicated process written in optimized c for the hottest components. Compose the rest in go, elixir, or any high level language (lisp). Architectures will naturally gravitat…

> A single language needed to solve all problems is a fallacy. Has that been proven and do we have pointers to any peer reviewed papers on that? Because else its just an old's wives tale. I don't see any logical impossibilities for one language to solve all problems (meaning, to work well for at least 4 domains: OS and drivers a la C, apps/games a la C++, network programming a la Go, Java etc, and scripting a la Pyth…

You just described Modula-3 basically.

https://en.wikipedia.org/wiki/Modula-3

As in Pascal or Oberon, language was simple and close to the metal enough for fast, production code. As Wirth language, it compiled lightening fast. It had support for manual or GC management of memory depending on your use-case (eg performance or OS stuff). It had a subset of C++ features for programming in the large. It was a clean, consistent design for a language rather than a pile of other language features added to C. Simple language, GC, and fast compiles mean it could be used for scripting although not as high-level.

It was used in SPIN OS, CVSup, and some businesses. Also had first stdlib with formal verification of some properties. If Oracle wins on API's, then I'm reviving Modula-3 immediately as a Java or C# alternative given its history is open with many features tracing back to ETH Zurich.

Post reply on HN