Please create an account to participate in the Slashdot moderation system


Forgot your password?
Programming Graphics Technology

Cairo 2D Graphics May Become Part of ISO C++ 430

An anonymous reader sends this news from Phoronix: "The C++ standards committee is looking at adopting a Cairo C++ interface as part of a future revision to the ISO C++ standard to provide 2D drawing. Herb Sutter, the chair of the ISO C++ standards committee, sent out a message to the Cairo developers this week about their pursuit to potentially standardize a basic 2D drawing library for ISO C++. The committee right now is looking at using a C++-ified version of Cairo. Sutter wrote, 'we are currently investigating the direction of proposing a mechanically C++-ified version of Cairo. Specifically, "mechanically C++-ified" means taking Cairo as-is and transforming it with a one-page list of mechanical changes such as turning _create functions into constructors, (mystruct*, int length) function parameters to vector<struct>& parameters, that sort of thing — the design and abstractions and functions are unchanged.'"
This discussion has been archived. No new comments can be posted.

Cairo 2D Graphics May Become Part of ISO C++

Comments Filter:
  • That's unfortunate (Score:3, Interesting)

    by PhrostyMcByte ( 589271 ) <> on Saturday January 04, 2014 @09:26PM (#45867995) Homepage
    Cairo is a great library, I've used it and found it very easy, but it's not remotely approaching a standards-quality design. The closest I've seen would be Anti-Grain Geometry [], which makes phenomenal use of templates.
  • by VortexCortex ( 1117377 ) <VortexCortex.project-retrograde@com> on Saturday January 04, 2014 @10:01PM (#45868163)

    Hey let's get a standardized vector and 2D drawing library going! Fuck the hardware or implementation details which indicate you'd be better off not limiting the dimensions to 2. Never mind the fact that we'll be filling triangles on a GPU for any sort of efficiency at all. Nope. Fuck starting at the actual primitives present and working up from there, let's do the top-down approach yet again -- When the performance conscious folks include messed up limitations, like the Diamond Inheritance pattern (Which has no reason to exist, variable placement should be virtual too, dimwits).

    Yeah, I'll stick with C. At least it doesn't pretend to do anything but present the Von Neumann architectural constructs to me and let me build my OOP, etc atop them. It's still not optimal because it has the moronic assumption that functions should be on the stack and not the heap -- thus hindering or outright preventing closures, co-routines, and arbitrarily limiting recursion despite the system's available RAM -- but it's miles beyond C++ in terms of idealic design splattering all over the hard brick wall of reality's implementations. I mean really, if you can't use method overloading properly with templates and polymorphism then the language is broken by design, and there are no complete implementations.

    Hey! I got an idea. You know what would be nice in C++? How about a standardized ANSI terminal interface, like VT100 -- Get ncurses into the spec. Oh! And you know what else? How about RMI! Yeah! Oh oh oh!! I got one I got one! INTER-fucking-FACES for IPC! Yeah! So you could query a program's interface and pass data between processes transparently in a language independent way -- and the doc comments could be lexical tokens too, so that if the .dat file was present even a terminal mode program could query a program's usage without needing a manually constructed manpage, and other programs could implement the same interfaces allowing us to assemble programs from sets of features. You know, something smarter than STDIN and STDOUT and a char**? Something actually fucking useful for a damn change?

  • Re:Sure, why not (Score:4, Interesting)

    by VanGarrett ( 1269030 ) on Saturday January 04, 2014 @10:33PM (#45868295) Homepage

    As something of a .NET programmer myself, I can testify to the veracity of this. .NET does a great deal for you, and I really think the handicap has prevented me from learning what's really going on.

  • Re:Sure, why not (Score:5, Interesting)

    by dreamchaser ( 49529 ) on Saturday January 04, 2014 @10:39PM (#45868323) Homepage Journal

    It's sad but true. My wife works in the CS department at a major University, and I'm appalled at what they are churning out with regards to graduates. I know I'll probably get modded down and see the inevitable jokes about 'get off my lawn' and such, but it's really true. The vast majority of new programmers are more or less clueless aside from pushing out cookie cutter bloated code.

  • Re:Sure, why not (Score:3, Interesting)

    by beelsebob ( 529313 ) on Saturday January 04, 2014 @11:13PM (#45868449)

    To be honest, I love headers, and I'd love to see more languages use them. Not as a necessity to allow the compiler to see what's declared, but instead, as enforced documentation of what's a public API.

  • by mraeormg ( 3480869 ) on Saturday January 04, 2014 @11:16PM (#45868465)
    While AGG is one of the most cleanest and high quality 2D rendering APIs, it's improbable that AGG will be accepted by the c++ committee, Herb Sutter works for microsoft, and AGG's author is very critical of many graphical features of windows, like the sub par font rendering. An example of this is the the dialog window for enabling high dpi font scaling. []
  • Re:But... why? (Score:5, Interesting)

    by mytec ( 686565 ) on Saturday January 04, 2014 @11:27PM (#45868497) Journal

    So, my question really is why they are doing this? I'm betting the answer is not one where they have actual usecases in mind.

    There was a keynote done by Herb Sutter this past September and at roughly the 57 minute mark of his presentation Keynote: Herb Sutter - One C++ [] he shows a 15 LOC example of numbers being input and then output sorted. He then said, "We need to get past the VT100 era." He continued saying that the standard C++ program cannot even exercise the abilities of the VT100 which has underscore and bold, etc. Pure, portable C++ code cannot even drive a 1970s era VT100.

    If you continue watching you'll see the point Herb is trying to make and that point may help explain why they are looking to do this.

  • Re:Sure, why not (Score:4, Interesting)

    by ShanghaiBill ( 739463 ) on Sunday January 05, 2014 @12:50AM (#45868783)

    I wonder how many of us, who now have a great deal more experience, would have said the same thing regarding 1980's college freshmen.

    I would. I graduated in the 1970's and was a manager in the 1980's. The majority of the CS graduates that I interviewed back then were worthless. I see less incompetence when interviewing new grads today, but that is probably because I have become better at pre-screening resumes.

  • Re:Sure, why not (Score:5, Interesting)

    by rsilvergun ( 571051 ) on Sunday January 05, 2014 @02:07AM (#45868997)
    Actually you turn away 95% of ppl who send in resumes because 30 years of attacks on the middle class have let you be _way_ too picky with your candidates and to force people to pay to train themselves.

    Self taught programmers aren't superior, they're just more desperate. They'll give you 20 hours of free labor a week to keep up. People are people. Your expectations are either a) unrealistic or b) only possible due to a warped labor market that exists to enrich a lucky few (re: 1%).
  • Re: C++ GC (Score:2, Interesting)

    by Anonymous Coward on Sunday January 05, 2014 @02:19AM (#45869025)
    Most modern GC based languages can be faster and reduce memory fragmentation with heavy allocate and deallocate work loads, compared to C/C++. The trade off is less control and more jitter, but the benefit is potentially higher throughput. Without heavy micro-optimizations and essentially your own GC, C/C++ cannot compete.

    What it comes down to is the GC keeps working memory highly compacted in a very efficient way, such that it allows memory allocations to be nothing more than incrementing a pointer. No searching for free space involved. It can also do background compaction while your program is running, and on different threads. These things are less efficient than micromanaging this stuff yourself in C/C++, but the amount of work involved makes it an expensive optimization, which is virtually free in a GC language.

    I'm not trying to say that GC languages are faster in general, but in many common work loads, the GC compensates enough to make a GC language near C/C++ speeds. If I can write a program 5x faster, have fewer bugs, and have it running 80% the speed, that's a win.

    Most of the time, programs are not CPU or memory limited, just limited by bugs and development speed. The more popular programs are actually heavily IO bound. .Net with ASync and tasks will give most other languages a run for their money, it has better scaling than most others. It heavily focuses on reducing context switching and increasing data locality.

    Many C/C++ programs have negative scaling with lots of IO. Once you've hit peak performance, it actually gets slower instead of maintaining current rates.
  • Re:But... why? (Score:3, Interesting)

    by serviscope_minor ( 664417 ) on Sunday January 05, 2014 @04:31AM (#45869363) Journal

    "We need to get past the VT100 era." He continued saying that the standard C++ program cannot even exercise the abilities of the VT100 which has underscore and bold, etc. Pure, portable C++ code cannot even drive a 1970s era VT100.

    Not sure I get that, or, Herb is less knowledgable about VT100s than he is about C++. This will work in a VT100 compatible terminal, like just about any common terminal program:

    std::cout << "\e[1mBold \e[0m\e[4munderline\e[0m\e[5m blink \e[0m\e[7minverse\e[0m text\n";

    Works on xterm. I have a CPU monitor written using xterm, C++ and swallowed by FVWM buttons. It has a 5 character number (up to 100.0) changing about once per second and a much more responsive backgroud colour which goes green to yellow to red smoothly as the load changes.

    It's 100% ISO C++. Of course, it only works on xterm-like terminals.

    Pure, portable C++ can certainly drive a VT100 fully but it won't look good on any other terminal.

  • Re:Sure, why not (Score:2, Interesting)

    by rsilvergun ( 571051 ) on Sunday January 05, 2014 @12:03PM (#45870827)
    My point is that in the past you would have offered them training.

    True though, I'm making some assumptions though about your political views because you're so harsh on people. I'm assuming your politically and economically conservative, and would be opposed to high taxes on the wealthy to train and educate people and support them while they receive that training and education. I'm also assuming you've bought into the 'Job Creator' narrative that says employers are responsible for creating livelihoods for employees and that this excuses the obscene wealth they've been granted. Sorta like how the kings treated serfs back in the day, only worse.

    If my assumptions are wrong and you're in favor of the sorts of socialistic that correct for training then you're free to go on rejecting 95% of the candidates w/o a shred of guilt ( or more appropriately culpability).

    OTOH, if you're thinking of yourself as a noble lord protecting your serfs then I wish you'd just drop that fantasy and admit all you're really after is winner take all with yourselves as the winners.

People who go to conferences are the ones who shouldn't.