Khronos: A Plugin for Ageing Gracefully

A collection of especially useful xplorer² topics and ideas. New users may find it helpful to look here before searching the other forums for information. >>>>>> Please post new material in the relevant forum. (New stuff posted here will be removed.) Thanks. -fg-

Moderators: fgagnon, nikos

Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Khronos: A Plugin for Ageing Gracefully

Post by Kilmatead »

Tuxman wrote:...there is still Clang...
So, just for the laughs and giggles, I spent some time playing around with Clang LLVM to see what the fuss is about...

Curiously enough, despite a ridiculous install-size of 830Mb it doesn't actually ship with any Windows-compatible includes or libraries - essentially all you get is a compiler (which, I guess, is all it's supposed to be, so fair enough).

Thus, we have to supply libraries and sundry ourselves... ironically by using those from either MSVC or GCC itself. Naturally, I just used the ones from GCC as (at least in my opinion) the goal is to avoid installing the mega-bloat of VC & its SDK's in the first place. :shrug:

Anyway, aside from being rather pushy with its default set of warnings, and downright cantankerous when it comes to convincing the x64 LLVM to build an x86 binary (building x64 works fine with a few extra linker directives, "out of the box"), I can at least say that it works, and (surprisingly) integrates well enough with CodeBlocks (as IDE), having its own compiler profile (customised options related to Clang, though "under the bonnet" Clang accepts most GCC directives from legacy anyway).

Considering that both GCC and Clang compile Khronos in well under a second, there's not much to compare there, so as a test, I compiled the whole PCRE (RegExp) library, which didn't help much as SSD's and overclocked quadcores pretty much seem to make compile-times irrelevant these days. Just for fun I might try compiling LLVM itself, just to see what its intestines look like. But god, Clang really does like to warn about every little floating piece of dust possible... a very opinionated compiler. Very opinionated.

Ultimately, though, the best I can say of it is that it generated a 6Kb smaller binary than GCC - one assumes that if I recompiled the GCC library sources against LLVM, then the binary could shrink proportionally still more.

But still... the nagging question... why is the incomplete package more than twice the size of GCC which comes replete with full libraries and includes? Very odd.

Have to spend more time testing the actual code produced to see if there are any real runtime benefits, depending on Clang optimisations, so the jury is out, there.

May the militant arm of the Free Software Foundation have mercy on my soul for flirting with this slight indiscretion. :wink: Incidentally, the whole reason Apple decided to throw all sorts of money at LLVM (when it used to use GCC exclusively) is because Apple couldn't live with the FSF licensing. Funny how that works... Apple (like MS) has a history of "embrace, welcome, exterminate" when it comes to open-source projects. Give them enough time, and they'll hit the Exterminate phase soon enough (as in "oh, yeah, we're making this proprietary now, so feck off ye freethinkers"). Always just a matter of time with them. :sad:

Methinks I'll stick with GCC - it's rough and ready, has about two decades' worth of tested code behind it out in the wild, and doesn't have anywhere near as much evil corporate stink about it. :D

A fun experiment, though.
Tuxman
Platinum Member
Platinum Member
Posts: 1610
Joined: 2009 Aug 19, 07:49

Re: Khronos: A Plugin for Ageing Gracefully

Post by Tuxman »

Kilmatead wrote: 2017 Oct 10, 21:29 Clang really does like to warn about every little floating piece of dust possible...
Which is one of the reasons why I like it and usually add /Wall to the clang-cl calls (old habits etc. etc.): Meaningful style and compatibility warnings with random suggestions how to make them go away - with colors! :D
Plus, the built-in static code analyzer (GCC needs a plug-in for that according to what I pretend to know) is not the worst option you have on Windows.

Sure: If you write standards-compliant code anyway, this is not quite as relevant. I, however, do not: Most of my recent software is at least portable to FreeBSD, and it is rather easy to get lost in the #ifdef jungle. Modern times.
Kilmatead wrote: 2017 Oct 10, 21:29 Apple couldn't live with the FSF licensing
I'm not proud to stand with Apple, but this is the time I'll have to. Computers are not Utopia. :baaa:
Tux. ; tuxproject.de
registered xplorer² pro user since Oct 2009, ultimated in Mar 2012
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Khronos: A Plugin for Ageing Gracefully

Post by Kilmatead »

Tuxman wrote:Plus, the built-in static code analyzer (GCC needs a plug-in for that according to what I pretend to know) is not the worst option you have on Windows.
Given the tentacles which IDE's have taken to extending into the mix, the distinction between what is a plugin for GCC or what is a plugin for another product which utilises GCC can get rather blurry at times.

The ubiquitous (and continuously developed) cppCheck for static code analysis seems rather popular (for VS as well), though personally such things irk my sense of adventure and take all the fun out of the programmer's ability to hurt themselves. But that's me... I like delving into my own code to divulge my own flaws - not mad about having computers tell me about my typos. Next they'll be making moral judgements about how much time I spend ignoring the pseudo-responsibilities of this world. That said, I couldn't live without superficial nonsense like astyle; a personal weakness, to be sure, but what's a cup of tea without a scone? :D

Before I got into the habit of just disabling all the bloody plugins my IDE ships with, I was amused by incomprehensible things like Nassi–Schneiderman plugins... seems more like what the Americans would call "Suicide by Cop", than a productivity tool. Maybe I'm just strange, but the more the world encourages me to be productive, the more inclined I am to light a cigarette and blow smoke in that world's face.
Tuxman wrote:I'm not proud to stand with Apple, but this is the time I'll have to.
Apple's a funny pumpkin, they used to be a technology company, but have since (mostly in the last decade) become little more than a very-rich-yet-failing fashion company who have yet to have an original idea. LLVM by Vidal Sassoon. At least he was a philanthropist... Apple have never done anything generous (which they didn't later renounce and burn) without ulterior motives, a duplicitous trait they inherited directly from that Jobs fellow. That alone is cause for future suspicion. :shrug:
Tuxman wrote:Computers are not Utopia.
Maybe not, but they do present a milieux wherein we can unleash own own inner Stalins and fashion a more perfect world from the more despicable dregs of our own frail psychologies. Programmers are mostly control-freaks after all... I mean, look out the window: can you control that world? Probably not. So, indulge your illusions in this one. 'Tis a curious realm which celebrates its depravities so openly - Sir Thomas More (he who so aptly coined Utopia) would be redeemed. :wink:
Tuxman
Platinum Member
Platinum Member
Posts: 1610
Joined: 2009 Aug 19, 07:49

Re: Khronos: A Plugin for Ageing Gracefully

Post by Tuxman »

Kilmatead wrote: 2017 Oct 11, 21:27 That said, I couldn't live without superficial nonsense like astyle; a personal weakness, to be sure, but what's a cup of tea without a scone? :D
What a coincidence: Clang has clang-format which seems to do just that. You, being someone who continuously adds weird stuff into a file manager, should be a strong advocate of the "one less external tool" thing that fascinates modern media so much. Look, so shiny! Still not convinced? :)
Kilmatead wrote: 2017 Oct 11, 21:27 Maybe I'm just strange, but the more the world encourages me to be productive, the more inclined I am to light a cigarette and blow smoke in that world's face.
I think we can agree that you are just strange (not so much when compared to other Irishmen, I admit), but I wonder what would be the particular reason to threaten the world with your smoking habits. Eternal youth, mid-life crisis, something in-between? I mean, I know this feeling - but I'd still prefer a fast death to everyone, not a nicotine-inducted one. Too unreliable!
Kilmatead wrote: 2017 Oct 11, 21:27 Programmers are mostly control-freaks after all... I mean, look out the window: can you control that world? Probably not.
Can you control the outcome of your magic WinAPI tricks? You basically assume that the documentation, a paraphrase of what should come out of a certain input, is everything you need to know - but it is not. Can you control the world of unified microprocessors, written for a market full of people who don't know nor care what works in which way? Have you understood the depths of modern CISC instruction sets and, more importantly, are you aware of the degree to which you can control it? (Good old 80586 did not even do Math correctly - how is this notably better than the "world behind the window"?)
O tempora, o More(s).
Tux. ; tuxproject.de
registered xplorer² pro user since Oct 2009, ultimated in Mar 2012
Kilmatead
Platinum Member
Platinum Member
Posts: 4569
Joined: 2008 Sep 30, 06:52
Location: Dublin

Re: Khronos: A Plugin for Ageing Gracefully

Post by Kilmatead »

Tuxman wrote:You, being someone who continuously adds weird stuff into a file manager, should be a strong advocate of the "one less external tool" thing that fascinates modern media so much.
Actually, I'm not - Buckminster Fuller's synergistic observations relating to "behaviour of whole systems being unpredicted by the behaviour of their parts taken separately" taught me that while a man should cultivate the mind of a generalist, the things the man busies himself with should be specialised. While I'm against the common programming doctrine about using "the right language for the right job" (what a load of tosh - we don't need 20 programming languages - a single one is just fine as long as it's C :wink:), I am a big fan of having 20 specialised applications hackysacked-together to do their respective tasks. That is, after all, why we have an operating system... if you just want one tool to do everything, buy a Netbook. :shrug:

Since astyle is already built into the CodeBlocks IDE... and as LLVM doesn't provide an IDE, implementing clang-format is akin to reinventing the wheel: like any good bonobo, I've trained myself to just hit <Ctrl+T> every 2 minutes, and the Shakespearian Monkeys magically transform my screen of error-prone mush into a well-organised screen of error-prone mush. What more could I wish for? (Wait, don't answer that...)
Tuxman wrote:Can you control the outcome of your magic WinAPI tricks? You basically assume that the documentation, a paraphrase of what should come out of a certain input, is everything you need to know - but it is not. [...] how is this notably better than the "world behind the window"?
You seem to have missed that I used the word "illusions" before. In the same way as all human endeavour comes to naught in the end, history teaches that all attempts at control in this (or any other) world ultimately fail. Not a bad state of affairs, really - imposing a well organised predictive existence onto real-life would probably be like integrating Switzerland with Cuba. Not, perhaps, a place I'd like to languish - but the music of the lower-classes would certainly have style and the trains would run on time.

Much the same way as the hardware itself is in a constant state of entropic decay, I have no faith in documentation, rules, predictions, or horse-racing. If you spend much time reading the endless (and endlessly unreliable) WinAPI dox, you'll quickly come to the conclusion that most functions are rather "hacky" as originally written - which is understandable when you have a codebase that's been around for decades and has had so many nameless "contributors" that fluid continuity is but a pipedream. It's all quirky, spooky, and not a little bit creepy from time to time, but that's kind of what gives it its charm, in a masochistic sort of way. Take away the masochism and you're left with the shame of being a productive member of society. Who would want that?

And besides, you damn-well knew what I meant in the first place, you're just being contrary (which is my job around here!). :wink:
Tuxman
Platinum Member
Platinum Member
Posts: 1610
Joined: 2009 Aug 19, 07:49

Re: Khronos: A Plugin for Ageing Gracefully

Post by Tuxman »

Kilmatead wrote: 2017 Oct 12, 21:25 While I'm against the common programming doctrine about using "the right language for the right job" (what a load of tosh - we don't need 20 programming languages - a single one is just fine as long as it's C :wink:), I am a big fan of having 20 specialised applications hackysacked-together to do their respective tasks.
Even with (or because of) my recent experiences with multi-platform C things, I really would not want to write just everything in C, at least not before Windows finally gives in and lets me fork(); but my use cases are rather different than yours anyway. Servers don't maintain themselves! (Ah, job security - and that is not even my paid job!) But how is a file manager with 20 plug-ins working towards your fandom goals?
Kilmatead wrote: 2017 Oct 12, 21:25That is, after all, why we have an operating system... if you just want one tool to do everything, buy a Netbook. :shrug:
You can, admittedly, hammer a nail into a wall with a Netbook better than you could with a programming language, but a Netbook without an operating system written in a programming language would not make quite as much sense; or does it?
Kilmatead wrote: 2017 Oct 12, 21:25 What more could I wish for?
Not being a bonobo (I think their solution to social rifts is inviting at first, but somewhat uncreative), better UX design skills, less commitments to IDEs, being young again, speaking German fluently (so you can read all your precious originals with their ambiguous puns), having more interesting hobbies than that (plus: no Tuxman answering your rhetorical questions because I'd still have the same hobbies), being rich and/or famous, ...
Kilmatead wrote: 2017 Oct 12, 21:25 (Wait, don't answer that...)
... oops!
Kilmatead wrote: 2017 Oct 12, 21:25 history teaches that all attempts at control in this (or any other) world ultimately fail.
Which, ironically, applies to "uncontrolled" states even faster than those under a (formal) control. There are many kingdoms left in our civilization and there is an expanding market for "journalism" concerning the newest stories from the streets about what "the king", "the queen", "the prince", "the princess" and/or their mishpocha among older women and those who feel like they were. Monarchy seems to be the only style of government which is loved by a notable number of people, some more than others.

Errare humanum est, I guess.
Kilmatead wrote: 2017 Oct 12, 21:25 imposing a well organised predictive existence onto real-life would probably be like integrating Switzerland with Cuba. Not, perhaps, a place I'd like to languish - but the music of the lower-classes would certainly have style and the trains would run on time.
Oh, please - have you ever listened to Swiss pop music? You better won't! But I like their economic system which lets their lower-classes still have enough money to live in Switzerland. The upper part of Germany is jealous; and yes, I just called myself "the upper part of Germany". In our Federal Republic, the current strength of conservative politicians leads to amazing side-effects, including the return of "We are the people", implying "and you are not!", yelled by those who think it would magically make them be good people. Ah, "politics". Never disappoint me.
Kilmatead wrote: 2017 Oct 12, 21:25 Take away the masochism and you're left with the shame of being a productive member of society. Who would want that?
I would want that, but my personal interests won't let me. - Productivity would be much easier without computers which require their part of the time cake. Probably they were a bad idea from the beginning. But it is telling a lot that Unix started as a gaming runtime. Some things never change.
Kilmatead wrote: 2017 Oct 12, 21:25you're just being contrary (which is my job around here!). :wink:
No, I'm not! :biggrin:
Tux. ; tuxproject.de
registered xplorer² pro user since Oct 2009, ultimated in Mar 2012
Post Reply