Re:Linus vs C++, again
by stcredzero on Thursday June 10, 2010 @05:03PM
(#1421671)
I started designing a language where you had lexically scoped "contexts" to specify the meanings of words. In general a package/library would be a context, and could declare its dependency on other contexts. Any words with conflicting interpretations would have to use its full global specifier to compile.
Perl does this, Perl 6 especially.
Sadly x86/arm/mips/sparc/power processors aren't Perl machines and Perl6 thusly can't be used to make a kernel for a Unix derivative.
Re:Linus vs C++, again
by stcredzero on Thursday June 10, 2010 @07:31PM
(#1422156)
One could probably get Scheme to do this and use it to make a kernel. But what would be the point of making it a Unix machine then? Make it a Scheme machine.
They aren't C machines, either. But I agree, that Perl is probably harder to compile to native code than C.
Yes, I think we all wept when we first learned that.
Actually, you refute his point. If they were actual classes instead of ad-hoc vtables, the flow would be clear.
Re:Linus vs C++, again
by bnoordhuis on Thursday June 10, 2010 @04:53PM
(#1421631)
No, he didn't. A call to ipv4_recv() is obvious, a call to impl->recv() less so.
[deleted]
This post makes me wish that I had enough karma to downvote.
You can save your spiteful single clicks. That post sinks its own ship plenty well.
It got deleted, a little context so that I understand?
Re:Linus vs C++, again
by tree_of_item on Friday June 11, 2010 @02:07PM
(#1424150)
I was under the impression things were easier to understand without context.
Maybe if you find it easier to work with figments of your own imagination rather than operating on actual data, perhaps.
Good point. Very good point.
Having spent few years developing for the Linux kernel I can say that the most cluttered code I dealt with was the network stack. And exactly because it was done in C++-ish way. It makes an extensive use of tables of function pointers, which is basically an analog of a C++ virtual table. A socket depending on its type would get a pointer to a different table and that table would define the actual flow, say, of the recv() call in the kernel. The concept is very elegant, and it translates into a more compact code, but it also makes tracing the code by hand hard.
So, yeah, Linus got a point there :)