News for hackers. Stuff that matters.

paulriddle

Ask HN: What's your opinion on Win32 API?

It is an old thing, yeah. Some interfaces are inconvenient to use and take a lot of options, most of which tend to be set to 0. There are plenty of macros and typedefs. String handling can be a bit of a pain with it's distinction of ASCII vs UTF-16.Overall though it seems to be well documented and compared to other alreanatives more lightweight and performant. I heared it referred to as Windows...

( Read More... | no comments | on HN )
Re:Ask HN: When it is better to use printf vs. a debugger? on Thursday November 12, 2020 @06:46AM (#25068798)
I think for the vast majority of cases it is better to use whatever you're most comfortable with. Some people just don't have the endurance to learn gdb or lldb, or they are allergic to Visual Studio on Windows because of how big and slow it is. They just use print statements instead. Some people have learned a few workflows with a debugger of their choice and for them it is easy to fire up a debugger.

However, for some things like debugging Windows kernel trickery it is impossible to use print statements.

Personally I like debuggers.

But unless you're investing other people's money, you are a small fish in the sea. Like, if all you have is 200k then none of your decisions being public would affect you in a negative way. Admittedly, I don't know much about the stock market but I can't imagine anyone caring if you want to short some company's stock.
Re:GitHub Design Preview on Thursday June 18, 2020 @07:11AM (#23561942)
I know some people are going to complain as with every redesign. But I really like how clean and uncluttered this feels. Lighter blue color, less bold text, dense side panel, misaligned repository header. Ok, it's not really uncluttered. But I think it's good that contributors are more explicitly credited now.

Ask HN: How to Cross-Compile with Clang?

From x86_64 to AArch64 on Linux. Without: - Relying on GCC, but glibc is ok. - Recompiling LLVM for AArch64. - Recompiling LLVM for x86_64 but during that compilation process using whatever is in clang/cmake/caches, so that runtime stuff like compiler-rt gets compiled for both x86_64 and AArch64. Without that. - Without using Zig. -...

( Read More... | no comments | on HN )
It's funny how carefully you're stepping around financially rewarding people who do the work. It's like you know your status does not allow you to own the money generated, so you're settling for owning the results, the process, the method, the responsibility, the all. You are weak.
Re:Small C Compilers on Wednesday October 09, 2019 @11:43PM (#21210677)
There is also https://git.sr.ht/~mcf/cproc inspired by several other small C compilers including 8cc, c, lacc, and scc. I did not take a deep look at it yet, but it looks interesting.
Re:RemedyBG 0.2.8.3 a lightweight debugger for Windows on Monday September 16, 2019 @05:56AM (#20982523)
A debugger inspired and somewhat popularized by the Handmade Hero screencast series. Primarily for C and C++. Some people say good things about it and happy that it is being developed. Since it is a paid tool with no demo, you might want first to see it in action before purchasing. A good introduction to the debugger is simply watching a few videos of it being discussed and used by Casey Muratori. Go to the screencast page [0], scroll down, and and the search field (which accepts regexes by the way) type 'remedy'. Click on everything. You might also watch a 2 hour long episode discussing debuggers in general [1] and why Visual Studio debugger is not ideal [2].

[0]: https://handmadehero.org/watch [1]: https://youtu.be/GfGNPo9Z6mA [2]: https://youtu.be/vohsUKjg9tU?t=33

It is still early days for the debugger, so it has bugs and might crash. Another downside is that it is closed source which might be difficult to reconcile with today's culture of open source. It is really unfortunate because author said it is developed completely from scratch using very few third party libraries. Because of that it would be interesting to take a look at the source and perhaps hack on it. But people are buying it anyway.

I urge everyone who might be interested to support the development of remedy, because I want the project to succeed.

Re:How to overcome information overload. Any advice? on Thursday September 05, 2019 @03:17AM (#20884552)
I'd like to go a little meta.

If you really want to do it, then stop looking for a reason to do it. Because any piece of text containing the answer is probably going to fit in a few HN comments, because that's what you're currently looking at, an HN thread. You are looking for a small piece of text giving you the reason to limit your information intake and providing a technique to do so.

Most likely you won't find what you're looking for. And even if you do find something that appears to be that, it will be inferior to your experience of actually doing that. Imagive a set of all possible HN comments. It contains no element that is better than you simply deciding, without any good reason or a way to do it clearly formulated in your mind, to simply set aside a couple of weeks and read only one book exclusively.

Now you might have two objections.

First, what if the piece of text is large, like a book? To that I'll say that books have to satisfy publishers and earn a profit, which manifests itself in disgusting ways like containing a lot of filler text and flawed case studies that presumably prove the author's point. I couldn't read "Shallows: What the Internet Does to Our Brains" and "Deep Work" because of that. All books about talent or peak performance are pretty much worthless in my eyes. I might be wrong about their value, but one thing is certain - they do not contain a clear answer and come with it's own set of issues.

Second, my claim that taking two weeks and doing one thing is better than any HN comment. I'll say it doesn't even matter. Two weeks are gonig to pass regardless, so you might as well try doing that instead of simply looking for a piece for text saying whatever. You might decide to do two things or three. That's fine, the point is to get meaningful experience doing a few things over a period of time. It could be that it is simply not for you. It also could be that your brain, physically, reached the point where neurons are wired in such a way that you're never be effective. Good luck rewiring this mess with an HN comment.

Re:Ask HN: Where do the real hackers hangout? on Wednesday August 14, 2019 @08:02AM (#20694582)
You misunderstand me. What if I'm the monopoly who wants to jack up prices and extort? I. Me. And a few select people working for me who I reward, plus a bunch of nameless employees who I don't care about. But primarily me. Then there is no problem is there?

Anyways, my apologies. I see I really pinched a nerve here. I will become smarter and understand the basics of big businesses. It's a good thing to do especially if you want to become the monopoly, right?

Re:Ask HN: Where do the real hackers hangout? on Wednesday August 14, 2019 @07:02AM (#20694261)
I see what you're saying. But I'm curious what the future you described will actually look like. I am NOT curious in the least about the good old days. I know it, it's boring to me. Having privacy and total control over your computing is fine, whatever, I've seen it a thousand times already. It's good. But in today's world what is the benefit of that? The market doesn't respond to that, does not reward it. Human psychology likes the alternative of thin client and total survelience much better because it's more convenient and because it already has more momentum.

So I'm curious what will happen when you can't do almost anything on your computer without it being inside proprietary cloud. When everything I do is recorded, aggregated, and analyzed by mismanaged big data experts. When real life decisions are made that affect me based on this data by some faceless entity without consulting me. Kind of like what China does with their social credit score but much more elaborate. When there are people who are within this system and those who are outside because they are rich and powerful.

It really fascinates me. It can't get so bad as to be intolerable in my lifetime. And what if I become rich and get real power? The ability to make important decisions that change the global landscape. Will I be good or evil? Nowadays rather than complain about the top 0.0001% it's better to put the energy into becoming the top 0.0001%.

And by the way, you never owned Warcraft or Diablo. I suspect that to satisfy you all one needs to do is to realse a few really good and engaging games. You shall have your games and you will play them in the evenings. But during the day you WILL write survelience code for collecting plausable reasons to crush somebody inconvenient to the illuminati.

These companies provide political value. I think of them as black boxes that don't really do anything to its input but give political weight to the arbitrary claim associated with the input. Want to cover your fuckup on a project? Hire Accenture for a few months to do something meaningless, like produce a report with all the problems in the project. Change nothing. Then say that clearly the project is more difficult than you've anticipated, you even retained a consultant that said this and that. More resources are required.

You can do training sessions for people you want to advance or hold back. In both cases sessions would be meaningless and void of any real value, except that they assign attribute Foo to the group of people. Then you can say that only people with Foo can do Bar, moving those people forward in their career. Alternatively you can overcome some bureaucratic obstacle by claiming that you do Foo regularly, which is a requirement from some authority for some reason.

I don't really know how this kind of politics works, but this is how I tend to think about it.

Re:Mini review of tog: the new OpenBSD git browser on Sunday August 11, 2019 @01:00AM (#20666331)
I wanted to try it out just for 5 minutes, but alas, I'm on Arch Linux and can't compile. GNU Make complains about dots in the Makefile (things like .include and .if) and there are probably more issues like BSD specific .include <bsd.subdir.mk>.

It's the early days for the tool but hopefully it will become available on Linux in the future. Because the world totally needs yet another git wrapper and visualisation tool. I jest of course, but there are already a few tools I wanted to learn but never dedicated the time for. For example hub command line utility for working with github. git-extras for lots of small things like repository statistics. fugitive.vim, a vim plugin that claims to be a git wrapper so awesome it should be illegal.

Recently I had to find out why a section of code was written a certain way and decided to hunt for the commit that introduced it. The only way to do it that I'm currently familiar with is by using github blame interface. The code was moved around so regular blame showed the commit that moved the code instead of introduced it. Github allows you to jump to a commit before the change, so I did that a couple of times while looking at the diff of where the code was removed from, because this was the place I actually needed. Overall I felt rather clumsy doing that and wondered if learning to do it on command line would be easier in the future. How can tog help here? Avoiding learning to use git on command line by itself isn't a good idea in any case, but a proper browser that allows to easily dive through history without shell trickery or a dozen of HTTP requests is a welcome addition.

Also, for tools like this I think video demonstration is best.

Re:Batch Style Guide on Friday August 09, 2019 @07:21AM (#20653246)
I heard some people say screw these CMake, Autotools, Makefiles, Ninjas, mesons, etc. Compilation of even big projects takes seconds. Just use a batch file on Windows and shell script on Linux. It was Casey Muratori on his Handmade Hero stream. I think he is right and most projects don't need even a Makefile.

I've been learning CMake recently and it seems that quite literally every part of it is ridden with edge cases and weird bumps. Like:

  - Variables can have a type, but it's not really a type, it's for GUI only.
  - There are cache variables but regular variables take precedence except if you set a cache variable with FORCE. But if you do so, then it hides the normal variable and you get different behaviour on subsequent runs.
  - Variables can be combined in an array, except it is a string separated by ;.
  - There is a bunch of deprecated syntax that you shouldn't use but should be aware of. You should start your CMakeList.txt files with a weird conditional that sets the minimum required version using a syntactic hack.
  - It ignores $CPPFLAGS in some cases, Arch Wiki said so.
  - There are multiple values for true and false. Things like YES, 1, ON, TRUE, NO, 0, OFF, FALSE.
  - For older versions of CMake a string literal can evaluate to the value of similarly named variable.
  - It is really a programming language. There is seems to be so much to it, it doesn't look limited
I just started to learn. It's not a big deal, but it feels messy.
Re:Huawei Announces HarmonyOS on Friday August 09, 2019 @06:35AM (#20653010)
Yeah, I always forget about that. Of course somebody works on the factory and has to pee in the bottle. I'm wondering how is it really like for those who actually make stuff for giant corporations? I heard it's pretty bad, that these people are being exploited, but I also heard that it's not that simple and the conditions are not that bad actually, and the alternative is even worse.
I'm wondering if hedge funds would buy something that would allow access to private data. I heard insider trading is not an unusual thing, so a polished series of exploites wrapped up as a tool with clear interface might be taken seriously.
There is a related thread with some discussion https://news.ycombinator.com/item?id=20651984
Re:Huawei Announces HarmonyOS on Friday August 09, 2019 @05:47AM (#20652780)
Google has more potential to harm. Imagine if they come up with a technology to replace HTTP and HTML, so that you can't modify web pages you visit. You open up a website and it's like you're looking at a video stream of it, except you can interact with UI elements but can't remove ads. Then they make your browsing history immutable and available to companies that can affect your career and finances. Of course they will leave the option to make it "private" if buy a premium account. Then they become an internet provider and ban VPNs and proxies. Then they make it required for you to consume ads for one hour per week, otherwise you loose access to the internet and your data. Then they implant an electronic device in your brain so that this happy hour of ad consumption happens against your will. Of course you will have the freedom to choose when to engage in it: 15 minutes before going to bed for a few days, or the whole hour right away. It interacts deeply with your brain, ruthlessly rewriting neural connections unlike visiual stumulation by eye. Then the government acquires this technology and they choose to inflict pain on those who disobey or has something to say. Then they learn to read the minds in a crude way. If you plan to do something about it then your brain is forced to experience the maximum pain it is capable of experiencing. It all happpens automatically. Those in control do not wear such devices.

Does anybody have any science fiction recommendations along these lines?

Re:Huawei Announces HarmonyOS on Friday August 09, 2019 @04:53AM (#20652428)
Now that I think about it more, I think you're right. Huawei is not good. I remember about two months ago there was a github repository https://github.com/996icu/996.ICU made by Chinese programmers in protest of 996 work week. I bet Huawei enforces these long hours on their employees.
Re:Huawei Announces HarmonyOS on Friday August 09, 2019 @04:04AM (#20652195)
I don't get the hate against Huawei. Not that I've seen much of it. Google are not the good guys overall, neither is Huawei. The two companies do good things and bad.

I've recently watched a talk by Jonathan Corbet on Linux Kernel Report [0]. At one point he asked the audience "Who's running Linux on their phone?". Lots of people raised their hand. He then said "Well, are you? Because a lot of companies have as much as 2+ millions of lines of custom kernel code on their devices. Huawei in particular has 2.7+ millions. If the kernel currently is at about 24 million lines of code, and you only need a small subset of that for a phone, then what you end up with is something different than Linux." It happens at approximately 30:40 in the video. I have a suspicion that HarmonyOS is just what they have now plus another 200k+ lines of code or so to change the look.

[0]: https://youtu.be/yt29BKVfI0I

Correct, but I'd like to point out that responsibility does not imply consequences. If the higher-ups mess up they can blame it on those below them. Usually it is done in an indirect way by setting expectations. For a lot of people, if they are the ones setting expectations they mentally take themselves out of the equation, assuming they are good. They might be wrong.
Re:Linux Journal Ceases Publication: An Awkward Goodbye on Thursday August 08, 2019 @05:56AM (#20643085)
A lot of companies might be using curl but in limited ways. For them there are plenty of alternatives because their requirements are small. They are choosing curl by default just because it's there and it works.

Older »