HNHacker News
TopNewBestAskShowJobs

gcc_programmer

15 karma · joined March 3, 2016

submissionscomments
gcc_programmer··on A request to drill for lithium near Death Valley
If we can't even use electric vehicles, what's left? Horses?
gcc_programmer··on My Roommate's Tik Tok Fame Made My Life Hell (2018)
Are you serious? Are you naive ? Is OP a psychotherapist?
gcc_programmer··on Why I rewrote the mesh generator of Dust3D from Rust to C++
I wonder how many of the Rust defenders in this article actually know C++ and have written a production used Rust system, instead of a side-project on github, so that they can compare in an informed way? The author certainly has, but who else has? Step forth priests of Rust! As for me: I use C++ at my job daily but have never done Rust so I cannot compare. What I do know about is "memory safety" in C++, and to be honest, the tools available are enough to make you figure out any issue: gdb/core dumps/valgrind, when combined with good software practices and unit tests seem to work ok for the rest of us. The compilers now have sanitizers, and new versions of gcc actually tell you what your template errors are. It's 2019, not 2005 for C++. Smart pointers are now available: use them! Finally, if a Rust veteran could let me know: how does Rust deal with general resource management in the presence of exceptions? Not everything a program uses is memory: we sometimes need sockets! In C++ using RAII works well, does the Rust Type System statically error/type check non-memory resources automatically, or is that out of scope?
gcc_programmer··on The Hand Licking Incident
> Do you have kids? If so, have you thought about, sorted out and covered all the things that would be unacceptable? What about what other people might think unacceptable, but you don't? If you however don't have kids, imho you are hardly entitled to criticise.

You are overcomplicating things, while I keep them concrete: gloves in cold weather is common sense. I do not have kids (so points for you I guess), but it's a strawman argument: are you saying people cannot comment on situations that are not directly applicable to them? This is too weak. A more robust/practical approach is that I act the way I speak: when I have kids, I will make 100% sure they always wear gloves in cold weather :)

> There are many legit reasons that could cause the mother to not necessarily provide gloves.

There are exactly 0 reasons, especially since she later was telling the kid to wear them. Children need to wear gloves in cold weather otherwise they are cold. It's also recommended for adults.

> Then again yes, maybe she wasn't paying attention.

That's my point.

> That's not even the point.

Agreed: her point is completely different, and <unpopular opinion> to me the gloves are the signal in the story, the rest is noise</unpopular opinion>

> It's very easy for us here to voice our opinion and openly criticise

It is. If you put out your opinion in the public domain, you should expect support and/or criticism. People will attack your ideas, even if they are good. You are criticising me, yet I am not feeling sad at all.

gcc_programmer··on The Hand Licking Incident
Am I the only one who thinks the parent is to blame for this because she didn't have the common sense to give gloves to her kid in the cold weather... To me that's unacceptable.
gcc_programmer··on Do Developers Understand IEEE Floating Point? [pdf]
60% of the people who took the survey develop software to support their main role. So, 60% of the people are not really software engineers but coders by necessity: could this explain the results easily?
gcc_programmer··on Remote code execution vulnerability in SQLite
You test all possible executions of your program when you test with all possible data inputs, which is infinite.
gcc_programmer··on A History of the Sentence "Buffalo buffalo buffalo buffalo buffalo." (1999-2015)
This is useless. Also, as a non-native speakee, I don't get it.
gcc_programmer··on Rifts Break Open at Facebook Over Kavanaugh Hearing
Why are people outraged before a sentence is pronounced? Are allegations now enough to convict someone? What happened to the West? Is this the beginning of the end ?
gcc_programmer··on A friend of mine died and I didn't know because of algorithms
> If you re-read the post, this is inaccurate. The friendship began elsewhere.

Yes, but it didn't begin in the real world(irl) either. Quoting the tweet: "Our friendship started on an old gaming forum,". I used to play WoW: do I keep up with any of my online friends now ? No. Why ? Because I moved on and found friends irl.

> It is a company whose value proposition (to non advertisers) is its being reflective of or enhancing reality. This as opposed to, say, warcraft.

You pay NOTHING for Facebook. Any value they claim to bring you is subject to their discretion. If you expect anything else, go to a different network. Oh wait - you can't, since social networks are only valuable if everyone is on them. And please do not bring open source software as a counter example: open source software exists because it is more rational for companies to use it by cooperating to share the cost of projects that would otherwise be too big for each of them to handle (and also independent open source project are done by people out of curiosity, and to allow them to stand out when searching for a job). So the FREE in FREE SOFTWARE is not the same as the FREE in FACEBOOK. Also, as you correctly noted, the value proposition of Facebook is to advertisers (and also shareholoders), so to use the annoying cliche, you are the PRODUCT, does the product get to have a say on how it's handled?

> Managing friendships is exactly facebook's purpose. If it claims to be the best way to manage a friendship, and bad things happen as a result of presumptions the company makes in the course of managing said friendship, it's sane to associate facebook's tooling around friendship management with the actual management of friendships.

Does it? I didn't manage to find that product description on their website. Maybe I didn't look hard enough, so can you please share it? What I did find though was in the terms and conditions (https://www.facebook.com/legal/terms): point 15.3: >WE TRY TO KEEP FACEBOOK UP, BUG-FREE, AND SAFE, BUT YOU USE IT AT YOUR OWN RISK. WE ARE PROVIDING FACEBOOK AS IS WITHOUT ANY EXPRESS >OR IMPLIED WARRANTIES INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, AND NON->INFRINGEMENT. WE DO NOT GUARANTEE THAT FACEBOOK WILL ALWAYS BE SAFE, SECURE OR ERROR-FREE OR THAT FACEBOOK WILL ALWAYS FUNCTION >WITHOUT DISRUPTIONS, DELAYS OR IMPERFECTIONS. FACEBOOK IS NOT RESPONSIBLE FOR THE ACTIONS, CONTENT, INFORMATION, OR DATA OF THIRD >PARTIES, AND YOU RELEASE US, OUR DIRECTORS, OFFICERS, EMPLOYEES, AND AGENTS FROM ANY CLAIMS AND DAMAGES, KNOWN AND UNKNOWN, ARISING >OUT OF OR IN ANY WAY CONNECTED WITH ANY CLAIM YOU HAVE AGAINST ANY SUCH THIRD PARTIES.

Facebook's feed algorithms don't care about whether your friends die, they care about maximizing profits. If you care about your friends, you won't let that be managed by a stupid, free of charge piece of software, but you will call them regularly, or go meet them in person, so let's all be brutally honest not rationalise lack of empathy as failure due to external factors.

gcc_programmer··on Interactive workflows for C++ with Jupyter
I think jupyter with C++ is an amazing idea, and I hope it will help more people to start with, in my subjective opinion, one of the most important programming languages today.

That being said, I look down on all the commentators who say that C++ has a primitive build system/package manager etc. Lets be clear: C++ has no package manager, and , in my view of the world, no compiled language has a native build system, its just that most compiled languages dont separate compilation from linking and also most languages support modules :)

C++ is hard. Throwing some fancy frontend and and a REPL will only make you realise that sooner. The complexity is mostly unjustified, but the language is so powerful that you could do anything with it: from trading strategies to power plant control systems to game engines. I have been studying C++ for 9 years, have used it for 7, and have been a professional developer for only 2.5 years, and I think I have only scratched the surface. I have used python for a lot less time but I feel like I am more comfortable with it because Python is trivial to learn (to a person with a comp sci background ofc). What you think you are cutting away (dependencies/build jnfo) is something essential to learning C++ and how everything comes together. Better learn it sooner than later imho.

Rant over

gcc_programmer··on Pointer Free Programming and the Future of Nim
Have you heard of operator bool() ? If the library is implemented by people who know their stuff, each object will define operator bool() and you can then have code like:

Foo foo; foo.init_from_file("/tml/lol"); if (foo) { // do some stuff }

we could be getting Foo objects by value from a factory, which constructs and moves the Foo objects. References are meant for situations where the object CANNOT be null/invalid by contract, so you are missing the point amigo.

gcc_programmer··on Writing Performance Sensitive OCaml Code
In the first code snippet, they havr add $2, %rax but the function actually adds 1 to its argument.
gcc_programmer··on Learning to Superoptimize Programs
This article uses a very contrived data set (bit manipulation), and also a "synthetically generated dataset", which would never occur in real life applications. This means that the results are unreliable and need to be repeated on something more realisic, or at least on programs that are uses by peole in some context (spec2000, spec2006). Moreover, the authors never compare the performance with that of llvm or gcc on different levels of optimisations, or at least do not mention any of that.
gcc_programmer··on Why bad scientific code beats code following “best practices” (2014)
I am sure that the person who wrote this article did it for a reason and has been frustrated by "programmers". However, this is very anecdotal and, to be honest, doesn't desever more than a mere acknowledgement - yes, blindly applying software practices and adding more indirections is not always good, but creating robust, maintainable, non-ad-hoc software requires abstractions, indirections, and programmers.
gcc_programmer··on Hardware Graph Prefetchers
Most modern architectureshavs prefetch instructions. I'm not surprised compilers don't have this (they optimise for the average program), but I am surprised that specialised libraries like Boost aren't doing this.
gcc_programmer··on Mean of two floating point numbers can be dangerous
Lol'd . To the contrary, it _can_ happen, and when it does the behaviour is undefined for C/C++. However, rest assured - you are probably on a x86_64 machine programming in sth like Ruby or Java script, so your Apps should be alright :P
gcc_programmer··on Moving Forward on Basic Income
I can't help but wonder - if there is basic income, won't the economy adjust and prices would rise so that any basic income would be insufficient again to buy you anything more than food for a week (not enough for rent or anything fancier)?
gcc_programmer··on Jury in Oracle v. Google finds in Google's favour
Cooyright protects companies' interest, and companies by default will try to milk as much money as they can from anything, so while your argumentation is very well worded (and I do believe you sincerely mean it in a good way) copyright does very little to protect the author himself but only the corporation that enables him to publish his work in the first place.
gcc_programmer··on Intel's Changing Future: Smartphone SoCs Broxton and SoFIA Officially Cancelled
This is an empty statement. Let me nit pick it for you:

> With their experience In mobile/tablets? Did you read the article - there have only been a handful of intel devices (and less cores) out there that intel has had a part in. Virtually every mobile phone and tablet out there has been ARM (including Nokia from the past). > fabrication process You don't need to own a fabrication process to be competitive in mobile, since in that market cost and power efficiency matter more than performance, so OEMs will stick with a process that is good enough for now and then they'll al move to a newer one. This is not what the market competes on. > tech Yes, their tech is very performant. Yes, if I want to crunch numbers I will buy an Intel chip. But if my mobile phone has a Xeon, it will run out of batery in 30 minutes. Even Atom chips are an order of magnitude less power efficient than cores of other companies in mobile.

So, no, they can't 'rip the competition' in mobile easily.

gcc_programmer··on Unix’s file durability problem
All of it - these things aren't straightforward, you need to go knee-deep in this area of programming to have a good hnderstanding of it.
gcc_programmer··on Statically Recompiling NES Games into Native Executables with LLVM and Go (2013)
Free as in free beer, not free as in free speech :P
gcc_programmer··on Statically Recompiling NES Games into Native Executables with LLVM and Go (2013)
gcc -Wall -fno-diagnostics-color

If you are going to list architectures supported, also list the ones gcc supports - it's, basically, all of them.

Llvm+clang is nice, but not better, drink the kool aid. Gcc performance is still higher, and gcc is free software.

gcc_programmer··on What is “the stack”?
Those apps ain't going to write themselves.
gcc_programmer··on What is “the stack”?
> I found it pretty surprising that the x86 assembly instruction set knows about the C stack pointer and how the stack in C is laid out. Of course, you could invent your own new smart stack format, but you wouldn't be able to use the callq and retq instructions to call functions.

I find it pretty amazing how modern "programmers" are lacking in knowledge of basic computer science concepts. Let me nit-pick this statement as it is obviously wrong.

The x86 assembly language knows ABSOLUTELY nothing about the "C stack pointer and how the stack in C is laid out". I will now illustrate why the first part of this statement is wrong.

You can have a bare-metal x86 device that is only programmed though assembly and push/pop would still be available. You are clearly confusing the roles of the compiler, operating system, and the language your program is written in. On a modern operating system like Linux, each program, when started, runs in a new process, which has its own view of memory due to the virtual memory system. Each program has its view of memory split into several sections, and one of them is allocated as "stack space" (it's usually the high memory addresses but this is architecture and/or OS dependent). When the program is executed, %rsp would be set-up appropriately by the OS, and on context switches it would save/restore it. Moreover, the actual address of your stack in real memory is different for every program since each process/program has its own mapping of virtual to physical memory, again provided by the OS.

Now, the second part about the "layout of the stack". The language you write your program in (in this case C) knows ABSOLUTELY nothing about the layout of "the stack". However, when you give your source code to the compiler, it will analyse it and, because C is low-level and staticly typed, will infer HOW it actually needs to lay out the stack FOR you. The output of the compiler is assembly code, and the assembly code produced "knows" about the layout of the stack because it has been written that way, generated by the compiler. It is, actually, the compiler that knows about all of this, not the source or assembly language.

Also, the example with python was a bad one - python is an interpreted language, and AFAIK it has no concept of a stack, and even if it does, it is the interpreter that allocates frames for it's own computations, not the program that you are running. And, moreover, even if python does allocate stack frames, they are most probably on the heap since it needs to do so dynamically (again, since it's not compiled but interpreted).

← PreviousPage 2 of 2