News for hackers. Stuff that matters.
Re:OpenBSD base now free of C++ by 16s on Monday March 14, 2011 @01:12PM (#2323361)
You can still add g++, boost and other high-quality C++ libraries to OpenBSD via ports/packages. They just prefer plain C in the base install. Plain C is inline with their "keep it simple" philosophy.
Re:OpenBSD base now free of C++ by tedunangst on Monday March 14, 2011 @02:16PM (#2323687)
g++ hasn't gone anywhere.
Re:OpenBSD base now free of C++ by henryprecheur on Monday March 14, 2011 @03:53PM (#2324107)
Indeed, just to make it clear: There's no more C++ code in the OpenBSD's base, but g++ the C++ compiler is still present.

I don't think that g++ will be removed. Too many things are written in C++. And as long as GCC is present in OpenBSD, there's no reason to remove G++.

Re:OpenBSD base now free of C++ by alextingle on Monday March 14, 2011 @04:59PM (#2324431)
And what will they do when GCC moves over to C++?
Re:OpenBSD base now free of C++ by 16s on Monday March 14, 2011 @05:12PM (#2324505)
I believe they are working on pcc (for various reasons).
Re:OpenBSD base now free of C++ by tedunangst on Monday March 14, 2011 @10:16PM (#2325520)
Unless that version of GCC is released under GPL 2, nothing.
Re:OpenBSD base now free of C++ by goalieca on Monday March 14, 2011 @01:06PM (#2323323)
What an interesting development. The year is 2011 and we are proudly announcing removal of C++ due to bloat.
Re:OpenBSD base now free of C++ by troutwine on Monday March 14, 2011 @01:31PM (#2323464)
I didn't catch the word "bloat" in the linked article, nor really any hint of such a complaint. Rather, it seems like the OpenBSD has happily announced the removal of C++ in their base because of compilation speed issues.

> Groff was also one of the slowest parts in a full build...

C++ compilers might be many things, but zippy they are not.

Re:OpenBSD base now free of C++ by dchest on Monday March 14, 2011 @01:33PM (#2323472)
Well, C++ compiler is bloat, as is standard library. There's an effort to use Portable C Compiler (which recently reached 1.0 http://pcc.ludd.ltu.se/news/) to compile OpenBSD.

Plus, from mandoc website (http://mdocml.bsd.lv/):

Why? groff amounts to over 5 MB of source code, ...

Re:OpenBSD base now free of C++ by goalieca on Monday March 14, 2011 @01:36PM (#2323483)
> and its replacement is much faster in rendering manpages

Besides the build bloat, that certainly hints at it.

Re:OpenBSD base now free of C++ by tzs on Monday March 14, 2011 @01:54PM (#2323568)
Mandoc is a tool specifically for formatting man pages. Groff is a general typesetting tool. That probably accounts for most if not all of the difference in speed.
Re:OpenBSD base now free of C++ by jrockway on Monday March 14, 2011 @02:07PM (#2323637)
Probably a good choice. For a workstation, you might encounter the need for a typesetting system. But for your router, you probably don't need it. So I think OpenBSD made the right choice about what to ship in core.
Re:OpenBSD base now free of C++ by JoachimSchipper on Monday March 14, 2011 @03:29PM (#2324007)
troff is technically a general-purpose typesetting system, but how many people are still using it for anything other than formatting man pages? (La)TeX and other formats have pretty much taken over.
Re:OpenBSD base now free of C++ by wladimir on Tuesday March 15, 2011 @03:29AM (#2326449)
Indeed. I hope Linux distributions will follow with replacing Groff. It's a huge, slow, ancient system and for the purpose of formatting manpages it can be replaced by a 15-line Python script.

(this has nothing to do with C++ versus C, simply with removing some bloated UNIX legacy code)

Re:OpenBSD base now free of C++ by JoachimSchipper on Tuesday March 15, 2011 @05:48AM (#2326707)
Well, 15 lines is a bit optimistic. mandoc is ~25 000 lines of C, and not yet complete.
Re:OpenBSD base now free of C++ by wladimir on Tuesday March 15, 2011 @06:29AM (#2326777)
I was figuratively speaking. In Python it'd be less lines than C, but still a substantial project.
Re:OpenBSD base now free of C++ by jckarter on Monday March 14, 2011 @01:54PM (#2323571)
Orthogonal to bloat, libstdc++ is a large, ugly, and hard-to-audit attack surface that I'm sure OpenBSD is glad to push out of core.
Re:OpenBSD base now free of C++ by tedunangst on Monday March 14, 2011 @02:17PM (#2323692)
libstdc++ remains as much a part of core as it ever was.
Re:OpenBSD base now free of C++ by wnoise on Monday March 14, 2011 @03:21PM (#2323975)
But if nothing links with it, so there are no executables using it, that would seem to reduce the attack surface.
Re:OpenBSD base now free of C++ by tedunangst on Monday March 14, 2011 @04:26PM (#2324253)
The attack surface of "there is groff in /usr/bin" was never very substantial.
Re:OpenBSD base now free of C++ by wnoise on Monday March 14, 2011 @06:47PM (#2324864)
Get root to run "man foo" with the right manpath...
Re:OpenBSD base now free of C++ by jckarter on Monday March 14, 2011 @03:05PM (#2323899)
I see. So does this purge only consist of compiled executables then, with the standard C++ headers and libstdc++ still getting a pass?
Re:OpenBSD base now free of C++ by tedunangst on Monday March 14, 2011 @04:34PM (#2324309)
I think it's rather sad that HN has mostly ignored the meat of this story, and is instead focusing on a not entirely true one line throwaway.
Re:OpenBSD base now free of C++ by jckarter on Monday March 14, 2011 @04:39PM (#2324337)
Sad, but understandable. "OpenBSD writes their own ROFF interpreter" isn't very interesting, but "OpenBSD purges C++ from core" appeals to developers' strong emotional responses toward C++.
Re:OpenBSD base now free of C++ by JoachimSchipper on Monday March 14, 2011 @03:36PM (#2324043)
Yes. And it's not so much a C++ purge as it is a "unmaintainable GPL-licensed slow software" purge, as far as I understand. C++ does hurt comprehension, but it's not the main complaint.
Re:OpenBSD base now free of C++ by j_baker on Monday March 14, 2011 @09:06PM (#2325340)
Wait... so then libstdc++ isn't written in C++? Or is "core" different from "base"?
Re:OpenBSD base now free of C++ by tedunangst on Monday March 14, 2011 @10:11PM (#2325510)
Option 3: core/base is not actually free of C++.
Re:OpenBSD base now free of C++ by rch on Monday March 14, 2011 @02:25PM (#2323725)
I write more C++ than C, but this still makes me happy.

Some people set an objective, for whatever reason, and accomplished it. Other people seem happy with the result.

I'd call that a positive outcome for OpenBSD and all the developers involved. Cheers!

Re:OpenBSD base now free of C++ by ChuckMcM on Monday March 14, 2011 @02:34PM (#2323768)
Wow, another reason to check back in with OpenBSD. Regardless of the meta debate on C++'s virtues or issues, having the core system build with just C would seem to help in simplifying things.

I am perhaps in the minority but I would really like a straight forward to build and maintain UNIX derivative and perhaps this can be it.

Re:OpenBSD base now free of C++ by silentbicycle on Tuesday March 15, 2011 @01:02AM (#2326061)
I know I'm just one data point, but I've been quite happy with OpenBSD as my primary OS for over 7 years.

I'm running Debian on a spare laptop for "common Linux distro" testing purposes, but am continually annoyed by it.

Re:OpenBSD base now free of C++ by adbge on Tuesday March 15, 2011 @03:00AM (#2326390)
Not being familiar with OpenBSD, what are some of the pain points you have when using Debian that you don't experience with OpenBSD?
Re:OpenBSD base now free of C++ by silentbicycle on Tuesday March 15, 2011 @12:41PM (#2328238)
I don't like apt-get. The way they break up packages is annoying and sometimes leads to debian-specific forks. I also hoped that Debian's vastly larger community would mean discovering several good packages apt-get (which I'd port to OpenBSD), but there really hasn't been much that OpenBSD doesn't already have. Disappointing.

GNU coreutils. The BSD userland (the core system) is much better integrated, which affects a great many things. In particular, I really prefer BSD top.

When I installed some recommended package so that closing my netbook's lid would make it suspend, it didn't work. I read the source, and it was so obviously broken (among other things, it was suspending on lid-close AND lid-open) that I just wrote my own. Usually I contribute patches, but...eh. Other stuff that tried to "automagically" configure itself, but didn't work quite right, and interfered with manual configuration.

"This project only has a man page because we want to note that man pages suck, look at the info page instead." I hate empty man pages, and it's particularly annoying because the documentation on OpenBSD is phenomenal.

I prefer /etc/rc.conf to /etc/init.d/ , though that's fairly minor. (I usually run daemons via runit anyway.)

There are probably several other things that don't come to mind at the moment.

Re:OpenBSD base now free of C++ by danieldk on Monday March 14, 2011 @02:40PM (#2323799)
Language purity for a project is never bad, it makes it easier to contribute to a project. However, this is barely a feature, given that C is weakly typed and common C functions do not use boundary checks.

For an operating system that aims to be secure, one would expect a more progressive stance, and heavy (intellectual) investment in a language that makes safety easier.

Yes, I know that OpenBSD prefers more secure variants of common functions.

Re:OpenBSD base now free of C++ by protomyth on Monday March 14, 2011 @03:02PM (#2323889)
When you only have 1 program using another language and it slows the builds, you tend to want to replace it. There are still scripts and such in different languages (ksh and I do believe some perl).
Re:OpenBSD base now free of C++ by danieldk on Monday March 14, 2011 @03:40PM (#2324061)
Right, just as I said, it is always a good idea to make a project more (language) uniform. But that wasn't my main point.
Re:OpenBSD base now free of C++ by protomyth on Monday March 14, 2011 @04:30PM (#2324275)
Since OpenBSD still compiles on a VAX, removing C++ from the build is a decent feature. As you say, OpenBSD has function with bounds checking and that seems to satisfy their requirements. Also, they haven't achieved language purity and I don't think they are trying.
Re:OpenBSD base now free of C++ by alexeiz on Monday March 14, 2011 @10:53PM (#2325612)
It's funny, they are so proud of it. Groff is so ancient, you can't seriously claim it's written in C++. It's written in C++ circa 1988. Pre-template collections, no Standard library, no namespaces, no exceptions, practically plain C code. Well, not plain exactly, C with classes and virtual functions. I guess, OpenBSD folks didn't like virtual functions...
Re:OpenBSD base now free of C++ by sliverstorm on Monday March 14, 2011 @02:53PM (#2323855)
It'd probably be too much to hope that this catches on and becomes a trend.
Re:OpenBSD base now free of C++ by mhd on Monday March 14, 2011 @02:02PM (#2323614)
So they replaced a generic roff system with a specialized man page viewer? Why? I mean, if you're rewriting everything and include a bevvy of output formats, why not make it a proper replacement? Would be quite a bit more unix-y. Yes, maybe a bit more work in the end, but you could always have "oroff 0.1" which only supports a -man subset evolve into a full-fledged implementation. Going from mandoc to "oroff" seems less likely.

(Or I'm just the only one who still occasionally uses ms/tbl/pic…)

Re:OpenBSD base now free of C++ by henryprecheur on Monday March 14, 2011 @02:12PM (#2323661)
The main reasons for replacing groff were:

1. Groff is buggy

2. Groff is slow to compile & execute

3. Groff is not BSD licensed

mandoc has none of these problems. If you want a "generic" roff system, groff is available as a package.

According to http://mdocml.bsd.lv/

> groff amounts to over 5 MB of source code, most of which is C++ and all of which is GPL. It runs slowly, produces uncertain output, and varies in operation from system to system. mdocml strives to fix this (respectively small, C, ISC-licensed, fast and regular).

Re:OpenBSD base now free of C++ by mhd on Monday March 14, 2011 @04:45PM (#2324365)
Those are reason why you wouldn't use groff, it still doesn't explain why – if you're taking the effort – you're not building a proper roff replacement, but some subset bastard program. And then hack stuff like tbl into the main executable. (Never mind that there's Plan 9 roff or the heirloom version)

I get it, nobody really seems to use non-man roff anymore. Still, subsetting and reinventing the wheel (partially) seems a odd solution for this.

Re:OpenBSD base now free of C++ by protomyth on Monday March 14, 2011 @05:06PM (#2324470)
Resources, need, and code audits are the reason to build a simple tool that does the job you want.
Re:OpenBSD base now free of C++ by tedunangst on Monday March 14, 2011 @10:14PM (#2325517)
Why is reducing the scope of the problem in order to simplify the solution so odd?
Re:OpenBSD base now free of C++ by dexen on Monday March 14, 2011 @02:20PM (#2323702)
This isn't the program you are looking for [[ http://man.cat-v.org/plan_9/1/troff ]]
Re:OpenBSD base now free of C++ by __david__ on Monday March 14, 2011 @04:12PM (#2324201)
> So they replaced a generic roff system with a specialized man page viewer? Why?

Because no one uses roff format for anything other than man pages any more. And even then, it's extremely common to use it only as "object code", output from some higher level/cleaner input format (perldoc, pydoc, docbook/asciidoc). I like that they have high level output formats (pdf, html, ascii) and hope that the package becomes an option in Debian at some point.

Re:OpenBSD base now free of C++ by j_baker on Monday March 14, 2011 @09:09PM (#2325351)
I'm curious if someone can elaborate more on this. Is C++ in general that much more time-consuming to compile than C code? Or is it just an issue with gcc vs g++? Or is this issue unique to Groff?
Re:OpenBSD base now free of C++ by theatrus2 on Tuesday March 15, 2011 @01:31AM (#2326152)
C++, especially template heavy code, is orders of magnitude slower in compiling.

Clang and LLVM is faster but not that much faster.