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.'"
Sure, why not (Score:5, Funny)
C++ stopped being a fully-humanly comprehensible language a long time ago. Might as well just add more crap to it like it's going out of style.
Re: (Score:3)
You got +5 Funny, I don't know why, this comment is damn insightful.
Re: (Score:2)
Why can't they just eliminate header files first?
Why is C/C++ practically the only language that requires headers?
Why do I need to type each function declaration twice. It is so cumbersome!
Re: (Score:3, Insightful)
don't have to, you could mark everything inline and define in the header without typing each function declaration twice.
not recommended for general practice 8D
Re: (Score:2)
Your second sentence says it all.
Re: (Score:3, Interesting)
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.
Re: (Score:2)
I find the keywords "public" and "private" work very well for that, no need for a separate file :)
Re: (Score:3)
The problem is that large proportions of the populace of programmers are idiots, and if you show them the private things, they will rely on them.
One simple file that says "this is the public interface, and it's documentation" is an extremely useful tool.
Re: (Score:2)
As much as I'm a fan of C/C++, I expect the headers could be generated at compile time for distribution with libraries or for compiling against - I see no reason for the developer to maintain the header file. That way you can still hide your implementation etc and not have the burden of flicking between headers & source etc.
Re: (Score:2)
Except that in most cases, headers dont declare just the public API, but bring in a ton of implementation details. Unless you are using PIMPL or bridge design a lot.
Both come with their own downsides. Or unless you are using .. fast PIMPL without the allocation overhead, but then did C++11 give you out of the box template for implementing fast PIMPL ? Of course not.
It will give you a pretty dumb version of a 2D rasterization library with outdated narrow usage drawing primitives, which i am going to run on w
Re: (Score:2)
Oh, also finally coming up with an ABI standard for the thing would be a big help, thank you !
Re: (Score:2)
In C++, certainly, headers tend to contain way more than it would be nice for them to. That's one of the reasons I don't like C++ much.
Re: (Score:2)
In my opinion, this is one of the things that Modula-2 got right: a Definition Module for the API, and an Implementation Module for the code. PIMPL just ain't the same.
Re: (Score:3)
Why can't they just eliminate header files first?
Why is C/C++ practically the only language that requires headers?
Because templates.
But they're working on it - it's called the "modules" proposal. It has been floating around since C++0x days. It won't get into C++14, but it probably will in C++17 - and, given how things are going in C++ standardization land, it'll likely be implemented in gcc and maybe even VC before the final standard is published.
Re: (Score:2)
Re: (Score:2)
C/C++ is undefined behavior. Don't do that, kids!
Re: (Score:2)
I've been programming only in C++, and to tell you the truth, I seldom have crashes, and when I do, 99% of the time they're easy to fix. Most bugs I get are not crashes, just bugs in the business logic, and they would still happen in Java.
I must admit that I'm kind of envious of how you get a nice stack trace when you have a crash in Java (an unhandled exception).
Re: (Score:2)
I'd rather add headers to all other languages. Most of the time, when I look at a class I want the hilights- the functionality it exports, maybe the major variables it uses. Its damn difficult to tell those at a glance in Java, C#, etc- you need to scroll past hundreds or thousands of lines of code. Headers are absolutely perfect for this. Javadoc was pretty much created to work around the lack of headers in Java.
Re:Sure, why not (Score:5, Funny)
C++ stopped being a fully-humanly comprehensible language a long time ago.
That's a lie! BEEP. BOOP. I'm a fully humanly and I can comprehensible language just fine a long time ago. BEEP. BEEP.
Re: (Score:2)
You don't need to use the aspects you find incomprehensible and those aspects don't negate the value of the bits you can comprehend.
Re:Sure, why not (Score:4, Interesting)
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)
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:5, Insightful)
Re:Sure, why not (Score:5, Interesting)
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:Sure, why not (Score:4, Insightful)
Wrong. I turn away 95% of the people who send in resumes because they don't understand what they're doing. They don't understand the logic behind anything, or what's happening in the background. I personally interview everyone, and I can attest to this fact. Self-taught people typically have drive, intelligence, and interest, and those things combined enable them to be competent.
Your expectations are either a) unrealistic
They're unrealistic in the sense that most people don't meet them. That's fine by me, as I don't accept garbage. But the fact is, some people do meet or exceed my expectations, and I'm quite happy even though there aren't many who do.
Re: (Score:2)
Re: (Score:2)
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.
I think the real question is whether or not there's a long-term trend here. 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.
Re:Sure, why not (Score:4, Interesting)
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: (Score:2)
Re: (Score:2)
I think much has to do with the way computers are taught, with focus more on "Karel the Robot" or Logo type machines-- is step one - step two - step three.
instead of focusing on von Neumann architectures like Mix ( well not as much ) or the "little man computer". most modern programmers have no idea what's going on inside.
Re: (Score:2, Insightful)
"The JAVA/.NET generation is a fucking disaster."
Fucking disasters is more like it and all the coupling is creating a whole new generation of mega disasters.
Re: (Score:3)
Re: (Score:2)
Except the VB generation was always a separate group from your more traditionally educated software engineers. Java, on the other hand, has wholesale infected CompSci education.
(While I will admit that I've done a fair amount of Java and .NET development in the real world, I'm also forever grateful that I went to college *before* it took over there.)
Re: (Score:3)
Some of us .NET developers started off as C developers; we're only working in C# now because that's what people want. I'm honestly completely fed up of the entire software development profession now; I just want to change careers. Maybe in a few years I can go back to writing software as something I do for enjoyment again.
Re: (Score:3)
Say what you will about the language itself but C++ has a very small standard library. Compare it to something like .Net or Java which is huge. This is one if the big complaints about the language is any real program written in it will have to use a ton of 3rd party libraries. Everyone uses different libraries and it this makes it difficult to combine code together.
That is why I prefer using Qt these ways. It's a great standard library, it's the C++ answer to Java and .NET.
That's unfortunate (Score:3, Interesting)
Re:That's unfortunate (Score:5, Funny)
Cairo is a great library, I've used it and found it very easy, but it's not remotely approaching a standards-quality design.
Yeah, to make it C++ standards-quality they'll need to make it much less intuitive, add tons of templates to make it unreadable, and change the method names to something that makes much less sense...
Re: (Score:3)
Why are all the insightful posts in this thread being modded "funny"?
C++ is *way* too big a language already. It's got the PL/1 problem (yeah, get off my lawn) -- when everyone only understands 0.8 of your language (or some amount under 1.0) it winds up being a different 0.8 for everyone. And this means that virtually any programmer will write code that is unreadable to another. (and if there is one thing that over 25 years of programming has taught me is that code readability trumps almost everything else)
Re: (Score:3)
Re: (Score:2)
Re: (Score:3, Interesting)
http://i1.wp.com/www.istartedsomething.com/wp-content/uploads/2006/12/dpi480_3_l.jpg [wp.com]
Re: (Score:2)
Re: (Score:2, Insightful)
glVertex2d
glVertex2f
glVertex2i
glVertex2s
glVertex3d
glVertex3f
glVertex3i
glVertex3s
glVertex4d
glVertex4f
glVertex4i
glVertex4s
glVertex2dv
glVertex2fv
glVertex2iv
glVertex2sv
glVertex3dv
glVertex3fv
glVertex3iv
glVertex3sv
glVertex4dv
glVertex4fv
glVertex4iv
glVertex4sv
Re: (Score:3)
No, templates will still work in the later case. How do you think hash-tables are implemented? It is possible to do specialization in templates, for instance specialize all integer and floating point versions.
Re: (Score:3)
You seriously need to look at the eigen [tuxfamily.org] project to understand that C++ with its templates can actually generate better numerical machine code than C. Yes, all with different math for different things. You demonstrably don't grok idiomatic C++. A whole lot has happened there in the last 13 years. Yes, admittedly it all reads like functional-style workarounds for stuff that was mostly a solved problem with LISP, but hey, at least it's a mainstream language that produces efficient assembly.
Re: (Score:2)
It's not exactly a secret that C++ iostream library is ridiculously badly designed, even among C++ programmers.
meh (Score:3, Informative)
i sincerely hope cairo itself remains 1. pure c and 2. as a project, entirely unconstrained by complaince to whatever 'standard' these c++/microsofty goons want. if they want to take a snapshot of cairo's api as a model for some c++ api, fine, whatever, couldn't even stop 'em if we tried. though the effort would be better spent finding more active maintainers for cairomm.
but cairo underlies current versions of major linux gui toolkits. i can't help but view this as some sort of convoluted gambit on microsoft's part to infest it with bureaucracy and c++ architecture astronautism and eventually seize control of the direction or just kill it.
Re: (Score:3)
ISO C++ only standardizes APIs, not implementations.
But... why? (Score:3)
One of the hallmark problems of design-by-committee is that they extend languages for the sake of doing fun things, not because people need it.
While everyone needs containers (like vector/hashmap), nobody needs a simple graphics library. There is practically no hardware out there that doesn't have some sort of hardware accelerated graphics and simple operations just make no sense there.
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.
Re: (Score:2)
Re:But... why? (Score:5, Insightful)
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.
Firstly, I take issue with your premise that Cairo is no more than a toy and useless in actual work.
Secondly, One very important usecase for a simple drawing library in the standard is to provide an easy route for novices to write cool, interactive and meaningful programs, without needing to write several hundred lines of scaffolding code and be well-versed in 6 different layers of abstraction from OSes to frameworks and graphics API.
I don't know how other people learned programming, but in my case, the most engaging things I wrote all those years back in BASIC and Pascal (under DOS) were graphical programs in nature (extremely simple games, GUI-like apps that didn't really need the GUI, function plotting and other graphical toys, etc.) I'm guessing that I'm not unique in the fact that having access to simple, straightforward, inefficient, well-documented, built-in 2D graphics API led me to all sorts of cool experiences in programming and (majorly) determined my pursuit for the rest of the two decades since.
Now, it is obvious that there will always be more novice programmers than experienced ones, so, I don't see the problem with the ISO C++ committee to explore standardizing such a library. Do you, really? Who is this going to hurt?! For most of us, this is pretty much out of our way, since we either write more serious graphical applications and need platform-specific, performance-oriented APIs that offer much more control and features, or we haven't written anything that needed a 2D immediate-mode graphics API in years. So, I ask the Slashdot readership again, what's wrong with standardizing a simple, straightforward 2D drawing API to help the novices and the occasional non-performance-sensitive drawing needs of the community?
Re: (Score:2)
Re:But... why? (Score:5, Interesting)
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++ [msdn.com] 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: (Score:3, Interesting)
"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 o
Re:But... why? (Score:5, Insightful)
Qt doesn't get out much beyond Win/Lin/Mac.
Qt isn't available for enough platforms because it only runs on Windows, Mac, Linux, Android, iOS, Blackberry, Kindle, vXWorks, BSD, Solaris, Haiku, WebOS, OS/2, Tizen and AmigaOS? Anything that passes the "does it run on Amiga?" test is good enough for me.
Re: (Score:2)
Qt doesn't get out much beyond Win/Lin/Mac.
Qt isn't available for enough platforms because it only runs on Windows, Mac, Linux, Android, iOS, Blackberry, Kindle, vXWorks, BSD, Solaris, Haiku, WebOS, OS/2, Tizen and AmigaOS? Anything that passes the "does it run on Amiga?" test is good enough for me.
But can it run on Emacs?
Re: (Score:3, Informative)
Last I checked Qt is "free" for open source projects but requires an expensive commercial license for anything else.
wxWidgets on the other hand is licensed under much more liberal terms and not owned by a commercial enterprise looking to make a buck or subject developers to strange licensing schemes.
Re:But... why? (Score:5, Informative)
Unless things have changed I never paid Qt any attention because it is dually licensed and therefore not truly free software and its ownership keeps changing between commercial companies.
Last I checked Qt is "free" for open source projects but requires an expensive commercial license for anything else.
You last checked about a decade ago, then.
Here's how it works now (and has worked for a while now): Qt is Free. Not "free", but Free. It's under the LGPL. And the GPL.
"But it's owned by a commercial company, and they can just close off the source."
Nope. Still stays open. Back a few years ago, the KDE group got a special concession from Nokia. They set up the KDE Free Qt Foundation [kde.org]; if the commercial owners of Qt (Digia) stop releasing Qt under the LGPL and GPL3, KDE has the right to make the whole thing BSD. Irrevocably. And the agreement stays, even if Digia is sold, bought, etc. Read the link if you'd like to know more.
Basically, Qt is Free. If the owners ever stop releasing it for Free, KDE gets to release it under an even more Free license.
Qt has been Free for a while. Qt is still Free. It will remain Free
Re: (Score:2)
Re: (Score:2)
"Write once, run anywhere? "
Doesn't exist. Its write once, debug, rewrite, fiddle with, and get it 95% working with 90% of the effort it would have taken to start from scratch everywhere.
As usual, fuck the implementation. (Score:3, Interesting)
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?
C coroutines (Score:2)
Re:As usual, fuck the implementation. (Score:4, Informative)
Okay you don't like C++, that much is clear but...
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).
Cairo is not limited to outputing raster graphics. It also supports vector formats such as PostScript, PDF and SVG. You may be doing the work on the GPU, or the GPU may have nothing to do with it at all. Even for raster graphics, it is not guarnateed that a GPU is even present or the fastest option. Seperation of vector 2D graphics and 3D graphics output is a long established tradition and hardly a design descision of the C++ standards commitee.. They are after all only looking to standardise on an existing C library in widespread use.
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.
C++ sure has its warts and I am definitely keeping my eye on Rust and D but what exactly would you consider a good way of handling method overloading + templates + polymorphism, and as a C fan why do you want to introduce such complexity to your code? KISS works well in C++ as well. On a side note C++ does handle the combination of features (http://stackoverflow.com/questions/4525984/overloading-c-template-class-method), albeit it is hardly pretty
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?
If you want IPC abstractions use Boost (http://www.boost.org/doc/libs/1_55_0/doc/html/interprocess.html). Maybe one day these abstractions will be added to the standard library as well. You could also look at platform specific IPC solutions such as COM, which seems fairly close to what you describe. However, until there is a commonly accepted base set of features which can be supported on all major platforms, looking to the C++ standards committe to provide guidance seems very odd to me.
Re: (Score:2)
C [...] has the moronic assumption that functions should be on the stack and not the heap
Dear Mr. experienced C programmer,
There is no such assumption in C.
Seems like a bit of a can of worms... (Score:2)
Obviously this is early stages, and I am not outright opposed to the concept of having a standard vector graphics library. The creation of formatted documents (pdf) and images is a low level and common task. The productivity of many programmers could be increased by having a standard library which can be easily linked against.
However I do feel like this opens up a can of worms. Will they also include a FreeType interface to support text output? What backends will be included by default?
A vector graphics lib
You see "implementation-defined" a lot in C spec (Score:2)
Create a standard interface and leave the actual implementation to be platform dependent. In this case rendering results will differ depending on platform.
C and C++ leave even operations on signed integers implementation-defined, so leaving the precise appearance of text implementation-defined shouldn't be too much of a problem.
Re: (Score:2)
C and C++ leave even operations on signed integers implementation-defined, so leaving the precise appearance of text implementation-defined shouldn't be too much of a problem.
Right. Except that is complexity exposed to the programmer and easily dealt with via int32_t, uint32_t .etc. This is inconsistency exposed to the user.
Floating-point types (Score:2)
Re: (Score:3)
I think he's referring to signed integer overflow conditions, which don't behave as most people would probably expect and aren't trivial to handle correctly.
Re:huh? (Score:5, Informative)
This is redundant. High level concepts like drawing graphics are always going to be system dependent, and today's operating systems come with them already. I don't see why having this as part of the C++ base library benefits..
Blitting to the screen may be OS-dependent, but rendering to a canvas need not be.
Re: (Score:2)
It had better be both damn well specified, and super under specified at the same time.
If it's not well enough specified, different OSes will do different things re (for example) antialiasing, where they decide the centre of a pixel is, etc
If it's too well specified, no OS will be able to implement it efficiently.
My suspicion is that it'll end up under-specified, and useless because of it, in the same way as java's drawing libraries are typically an endless source of bugs (common ones being that the develope
Re: (Score:2, Insightful)
Stop ranting already.
Re: (Score:2)
You seem to be confusing "this works well on linux" with "this is the perfect solution for all platforms, and it works perfectly across all platforms".
Re: (Score:2)
No, he isn't. He's saying that people who code for Windows only aren't even aware of the fact that there are great cross-platform libraries available to them which work just fine on Windows. And he is right.
libxml2 has a similar story, by the way.
Re: (Score:2)
No, he's assuming that the existence of one cross platform library for one well specified task means that another task can be well specified in a way that it can be efficiently implemented on all platforms. That's not true of graphics. This isn't even true of different implementations of graphics drivers on one platform, let alone across platforms.
Re: (Score:2)
Why isn't it true for rendering 2D graphics to a memory or a file? What, exactly, is different between Windows and Linux in drawing a line of a given color and thickness from (x1, y1) to (x2, y2)?
(And don't say "anti-aliasing algorithm" - that should just be a configurable parameter.)
Re: (Score:2)
You seem to be confusing "this works well on linux" with "this is the perfect solution for all platforms, and it works perfectly across all platforms".
Cairo works fine on Windows. Firefox used it for quite a few releases, and I believe still has it included as a fallback if their custom "Azure" rendering library is turned off or can't work for some reason. In fact, it was Mozilla that contributed the Direct2D back-end to Cairo. (Cairo is quite flexible - you can make it render its canvas to almost anythin
Java, C#, and JavaScript all have graphics libs (Score:2, Informative)
Re: (Score:3)
The problem is, what's efficient, or nice, is not well defined. Should you antialias lines? If so, what type of antialiasing? Is that type of AA efficient on the graphics card in use? If you don't do that, do certain programs break?
These are all questions that have been answered before by java –yes, everything breaks, because everyone needs to implement graphics subtly differently.
Re: (Score:3)
The problem is, what's efficient, or nice, is not well defined. Should you antialias lines? If so, what type of antialiasing? Is that type of AA efficient on the graphics card in use? If you don't do that, do certain programs break?
You're making this more complicated than it needs to be.
First of all, why would you ever want to draw Bresenham-style non-anti-aliased lines? The only reasons I can think of would be if you're emulating some sort of legacy system, or if you are working on an embedded platform w
Re: (Score:3)
"It's implemented on the CPU" is the first gigantic red flag here. The implication of this is that it's so tightly specified that it's impossible to implement efficiently (i.e. on all vendors different GPUs which do subtly different things re how the exact pixel colours come out).
Re: (Score:2)
A real world complex cross platform program using Cairo is Firefox (most recent might use something different by default on Windows, I haven't kept up). It works pretty good on all platforms including non-main stream with (at least on my platform) options to control things like anti-aliasing.
Re: (Score:2)
I'll finish it for him...'anyone.'
Re: huh? (Score:2)
Re: (Score:2)
Well, not to the extent that it approximates a Turing machine.
Re:standard c++ (Score:5, Insightful)
Is there anything it cannot do?
Garbage collection.
Re: (Score:2)
Conservative ones, yes.
But accurate ones? Multithreaded? Without "stopping-the-world"?
Re: (Score:3)
There was a paper in committee that would make it possible (authored by Boehm, no less). It didn't live to see C++11, though.
Re: (Score:2, Interesting)
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 s
Re: (Score:3)
Most modern GC based languages can be faster and reduce memory fragmentation with heavy allocate and deallocate work loads, compared to C/C++.
Suspicious sounding statement. Such things are ususally based on writing C++ like java (i.e. new everything). C++ uses stack allocation for very much stuff, and that is free (the pointer increment is already done on function entry) and 100% guaranteed fragmentation free.
If I can write a program 5x faster, have fewer bugs, and have it running 80% the speed, that's a
Re: (Score:3)
I've noticed that regardless of all claims about how Java can be faster than C++, I've never seen Java desktop applications beat C++ at the most important thing - startup time. I'll give you an example with JDownloader - that application takes 10-15 seconds to start.
Speed perception from the user's point of view is based on startup time and latency. I still haven't seen a Java desktop application that feels responsive.
Re: (Score:2)
The old C++ looks better and better as they nail every bit of crap they can find to her wretched offspring.
Some people were saying that back in the 80s (specifically, Ken Thompson). It's always been the C++ design strategy.
Re: (Score:2)
what a load of cobblers ALL other languages are C++ wanna-bes,
This comment shows the limitations of your own knowledge, not anything about languages.
Check out APL sometime if you really want to blow your mind. FORTH is something interesting, too.
Unredirected stdin/stdout is itself superseded (Score:2)
Graphics libraries and their APIs are Here Today, Gone Tomorrow. The hot thing today will most likely be superseded and irrelevant in 10-15 years time.
Glass-TTY [catb.org] interfaces, like the implementations of stdin and stdout in C++ compilers targeting PCs when not redirected to a file or pipe, have for the most part been superseded by GUIs. At least Cairo would provide a starting point toward a bare-minimum image manipulation and GUI component that a C++ program can expect, much as Tkinter does for Python.
Freestanding vs. hosted (Score:2)
the STL isn't part of the standard runtime
I thought apart from <iostream> and friends, the STL was the C++ standard library. Are you by any chance referring to the difference between a "freestanding" implementation and a "hosted" one, where a "freestanding" implementation is permitted to leave out standard libraries?
Re: (Score:3)
The STL is *part of* the C++ standard library. Its the various container classes, algorithms functions, etc. There's also iostream, the old C header files, and some new stuff like threading in the C++ standard library.
Also, not all C++ compilers implement all of the C++ spec (in fact, none of the major ones do, see export keyword). Most embedded compilers leave out the STL, because they don't support templates or do so only partially. Many others require you to separately build and link the STL, and don
Re: (Score:2)
The only 2 parts of STL that I use, like 99% of the time, is std::string and std::vector.
Re: (Score:2)
just like the STL isn't part of the standard runtime.
STL is the part of the standard C++ library - has been that way sinco ISO C++98.
Re: (Score:3)
Heh, that's correct.
Here's the proper link to Herb's post. http://lists.cairographics.org/archives/cairo/2013-December/024858.html [cairographics.org]
(You have to flip to 2014 archives to see the full thread.)
Re: (Score:2)
Since when do libraries become the "standard"?
Since ANSI C89 standardized things like fopen()?