HNHacker News
TopNewBestAskShowJobs

near

5,473 karma · joined January 21, 2012

submissionscomments
near··on Google’s Monopoly is Stifling Free Software?
Google receives 92.42% of US search results. If you want new customers or users to find you, there's no choice but to do as they say. Also see AMP and media publishers.
near··on Google’s Monopoly is Stifling Free Software?
DDG isn't going to break a monopoly on search, much as I want it to (I use it myself.) It's also browsers that may begin blocking pages and downloads outright. Basically Google is telling me now that I have to remove the links and are flagging them as a (false) security issue. I don't know what happens next or when if I choose not to, so the links are now gone.
near··on Google’s Monopoly is Stifling Free Software?
All of my software is either ISC or GPLv3. Source code links are available on all of my download pages. I've had to remove the pre-compiled binaries for users.

Both Microsoft and Apple ban my specific class of software (emulators) in spite of unanimous court rulings establishing them as legal under fair use laws.

near··on Google’s Monopoly is Stifling Free Software?
Every indication I've read is that simply linking to the binary download, even if it's offsite, will be enough to flag the page hosting the link. So I would have to link to an alternate site hosting the link, and risk that page being blocked instead, and then I'm right back where I started.

I would, if at all possible, prefer to find a solution to this problem so that I can directly host my software.

near··on Google’s Monopoly is Stifling Free Software?
> However, for the sake of argument: Is there any reason you couldn't get someone else to lend you their name so that they act under their real name for you?

It's possible, but I would find it to be rather unethical. I am much more willing to allow an EV certificate to sign my software, or if I could get the BBB to respond to my requests to register with them, I could even consider purchasing my own EV certificate for my LLC. (my understanding is that the EV validation process confirms your business' validity through its BBB listing, and an article of incorporation is not enough.)

> The whole point of a code signing requirement is to add a paywall so that only two kinds of people will have access to it

Why is the web and Let's Encrypt any different? Websites execute code that can potentially harm your computer (via zero-days.) A paywall harms free software developers who can't afford hundreds of dollars a year for certificates, which is not a problem for me, but would be for many folks.

near··on Google’s Monopoly is Stifling Free Software?
Firefox uses Google's Safe Browsing service to flag websites and downloads, so that would not help me. Even if not, it would be a pretty bad idea to tell 70% of visitors trying to download my software to use another browser first.
near··on Google’s Monopoly is Stifling Free Software?
That may possibly be a solution for many, but Microsoft and Apple both forbid emulators (the software I create and distribute) from their app stores, in spite of repeated and unanimous court rulings establishing their fair use legality.

I still don't in general like the slow erosion of the web, however.

near··on Google’s Monopoly is Stifling Free Software?
If it happens to flag my GitHub page, I'm not really in a better position as far as being able to distribute my software goes. It would also be problematic if other sites began linking to my releases page instead of my official page which also includes documentation, screenshots, feature lists, etc.

If I can get a confirmation from someone at Google that they will trust GitHub download links more, then I'm willing to go this route for now.

near··on Tell HN: Google should drop Quora from search results
Google has given up on improving search, much like Microsoft did with IE6 when it became the dominant player. Only real competition would force them to start improving again.

Here is my own userscript that removes any matching URL portions from Google search. It does it in a fancy way with stylesheets so that you never see the Quora, etc results even temporarily before they're removed. It also fixes Google Images to link directly to images again, removes all the tracking URL obfuscations, and more.

https://code.byuu.org/google

Should be more robust than the other alternatives listed, but if not, let me know. I'm always up for improving it more. Contributions also welcome.

near··on Cooperative Threading
> as modifying the CPU context registers and stack frame directly is not permitted by most sane programming languages

My point was, if C++ had a global variable named "stack_pointer" you could assign to, that would indeed be rather insane.

near··on Cooperative Threading
You could well be right. In my own tests, the ESP swap is what tanked performance. A more limited stackless test did not have nearly the same overhead. And indeed, the largest speedup was from moving to set ESP as soon as possible, get the return address into EAX, and finally jump to it. CALL+RET with late ESP set behaved poorly, leading me to believe it was due to the CPU stalling on the ESP change.

I did also try inlining this, but it was much less portable and actually performed slower in my emulator. I won't claim that will be the case for everyone, of course. YMMV.

near··on Instagram now forces people to sign in to view public profiles
They also use meta robots=noimageindex,noarchive on every page without an opt-out which is so incredibly stupid and walled-gardeny for an image sharing site. I wanted to use Flickr instead but nobody else uses Flickr, then I tried making my own image gallery and I learned that browsers do not honor the JPEG rotation EXIF data and I don't want to write my own rotation/cropping code (that and Google completely ignores it), so now I'm trying Pinterest, but that one also wants you to log in to view full images.

Kind of silly I can't find a good image sharing site in 2019.

near··on Show HN: Bsnes, a Super Nintendo Emulator
bsnes is an SNES emulator I've spent the last 15 years working on.

I'd love some help from anyone who's interested in working on improving the project with me, so I'm submitting my GitHub project page link here for anyone interested.

Back in 2004, computers were much slower and so performance was a much larger concern with emulators. I was worried that many fan translations, ROM hacks, and homebrew games were depending on bugs in the other emulators to function, and feared this could lead to a loss of those games in the future, should emulators one day improve. And so I started bsnes with the goal to writing an emulator that was as accurate as possible. Needless to say, I underestimated the complexity by a few orders of magnitude.

In 2010, I led a fundraiser to decap coprocessors inside of game cartridges to extract their firmware. This allowed bsnes to be the first emulator to reach 100% game compatibility [1]

In arguably the most surreal moment of my life, it turned out that one of these coprocessors (NEC uPD7720) was used in professor Stephen Hawking's voice machine. Having written the only emulator for this processor, his assistants reached out to me and I was able to donate a portion of code to their project, which was ultimately successful in replacing the original failing voice machine with a much more portable version. [2]

In 2012, to improve emulation of cartridge PCBs, I started a goal of purchasing (and reselling after to break even) every SNES game cartridge. I started with the USA collection (725 games), finished it, moved onto the Japanese collection (1,450 games), finished that, and now I've been working on the European collection (540 games.) I've spent around $30,000 and 1200+ hours working on this goal.

Something I don't like to talk about, but it happened: once a person graciously lended me 100 PAL games worth around $5,000 - $10,000. It was lost in the mail. After a long, stressful five-month wait, I reached out to the media and within a few weeks, the package was recovered, and the games were analyzed and returned to their owner intact. [3]

A few years back, bsnes grew to emulate dozens of systems, and so I made the decision to move the multi-system emulation platform to a new project called higan. [4] This project is likely far too ambitious, but it keeps me occupied.

With bsnes once again a standalone SNES emulator, over the past year I've set about trying to create an easier to use, friendly emulator that is more performance oriented. One of the key insights was developing a method of parallelizing the video rendering in such a way that does not add any input latency.

This parallel renderer provided for another first: the ability to analyze the entire screen before rendering the first pixel. A programmer by the name of DerKoun came along and realized that by interpolating at higher precision the affine transformation coordinates of the screen, that 256x240-resolution SNES games could be upscaled to basically any resolution, even 3840x2160. The results were something no one else believed possible, and it received a good deal of press as a result.

DerKoun has continued with this project, adding new features to SNES emulation such as widescreen support, true color gradients (to remove banding from the system's 15-bit color palette), etc.

Recently, in an effort to try and preserve more history, I've gone back to emulate the older emulators themselves, so that the oldest fan-made SNES software can still be played.

It's never been bsnes' goal to be #1, and over the years I've contributed code, notes, and explanations to basically every known SNES emulator. Both free software and commercial, both open source and closed. My underlying goal has always been to improve emulation quality for everyone.

Thanks for reading!

[1] https://www.tested.com/tech/gaming/44376-16_bit-time-capsule...

[2] https://www.sfchronicle.com/bayarea/article/The-Silicon-Vall...

[3] http://www.nintendolife.com/news/2017/02/usps_recovers_lost_...

[4] https://github.com/byuu/higan

[5] https://arstechnica.com/gaming/2019/04/hd-emulation-mod-make...

near··on Cartridge Printed Circuit Boards
MAME follows the internal database approach to emulation. The primary issue with this approach is that it does not support homebrew, fan translations, and ROM hacks. If you modify games, checksum lookups fail. For a ROM hack, you could still boot something where the original was in the database by manually specifying the name and accepting the warning (which is fine), but for a new unlicensed / homebrew title, you could only maybe possibly boot it by faking being another very similar game, which feels quite wrong.

I'm not saying the MAME approach is wrong: every approach has its pros and cons, regrettably.

near··on How Do Developers Promote Open Source Projects?
A very useful article, thank you for sharing.

This is definitely a hard problem for solo developers who are like me and have significant difficulty with social aspects. I've never submitted any of my projects or writing here, because I have this underlying feeling that I'd be bothering people. It also doesn't help to be on a site filled daily with dozens of really incredible projects that feel so much more deserving of attention. Yet I've often found myself bewildered by concepts such as SEO and promotion, and I much prefer to spend my time coding. I hate to generalize, but I can't imagine I'm particularly unique in this regard.

But indeed, it's a serious growth limiter when we are stuck working alone. I feel like any serious open source project really needs someone on the team who groks all the social stuff and can get the word out to the right parties who would be interested. A networking service to connect these two types of people would truly be invaluable, I feel.

I was also told that technical writing helps a lot, and indeed, despite being a little guy in a small niche, two of my articles were submitted by others recently, and seeing such a positive response has been a huge boost to my self-esteem and confidence. (It did ruin my bounce rate stats though, went from 44% to 87% in two days :p)

But yeah, I'll agree with the arXiv conclusion that HN is an incredibly valuable resource for open source developers, with a very friendly community behind it.

near··on Cartridge Printed Circuit Boards
At some point, I want to talk about CDs as well.

A proper CD archival format would include the lead-in sectors, with which it is absolutely trivial to extract track information from the Q-subchannel of it. Easier than parsing a CUE sheet, or MDF, or CCF, or whatever else have you.

I do understand it's hard to rip this data from CDs (usually requires an older Plextor drive), but worst case, as bad as it'd be, generating the TOC from a CUE sheet is very simple, and if it's marked with a special entry to denote it being machine-generated, I feel that would be a good compromise.

Then you'd have a single CD image format in a single file that captures all data on CDs. If you wanted to, you could then compress that image with either ZIP, or a custom-purpose tool that combines things like Reed-Solomon prediction, subchannel prediction, FLAC encoding for audio tracks, etc, resulting in images not any larger than ISO+FLAC.

But well, https://xkcd.com/927 and all, right?

> I for one would definitely welcome a format with built-in cheats

A thing I do with bsnes is bundle a database with most known cheat codes for all games, so you've got all the cheats nicely labeled and ready to go whenever you play a game.

I kinda wish this idea caught on more for all the other systems and emulators, but it hasn't been all that popular.

near··on Firefox 69.0 Released
I mean that's exactly how Firefox operates. They divide the opposition to feature removals by continually allowing the most vocal critics a workaround, until finally when it's removed completely most people have already learned to live without them.

They moved the option to keep browsing history but not keep download history to a user-pref, and then later removed it.

They moved the option for tabs-on-bottom to a user-pref, and then later removed it.

They moved the disable-automatic-updates to a user-pref, and then later buried it in an external policy JSON, which I guess it's okay to see if that file exists at startup but not the user*.css files.

And on and on.

near··on Xfce 4.14
Not the original poster, but the trouble I had with lxde was that it never felt consistent. It felt more like openbox where you made a desktop out of dozens of indepedent projects that each did things their own way.

Xfce, by comparison, feels like each program is part of a package. That is not to say it's perfect: I still have to pull in Mate applications for things like a task manager, archive manager, and calculator. I also had to write my own replacements for things like a text editor that doesn't open every new document in a new window. But I get a whole lot of mileage out of Xfce's file browser, desktop, panel, terminal, settings panel, etc.

I'm a bit nervous about the Xfce move to GTK3, and I hope I won't end up with any client-side decorated windows, or the GTK3-style file picker.

near··on Modern C++ Won't Save Us
Because C++ is my primary language, and I always work on my codebases alone, I dropped the standard library and implemented my own replacement. It's not at all practical for most I'm sure, but it allows me to evolve the library with new revisions of the C++ standard without being absolutely fixed on backward compatibility.

One of the things I did for safety is that all access methods of all of my containers will bounds check and throw on null pointer dereferences ... in debug and stable mode. And all of that will be turned off in the optimized release mode, for applications where performance is absolutely critical. The consistency is very important.

Whenever I get a crash in a release mode, I can rebuild in debug mode and quickly find the issue. And for code that must be secure, I leave it in stable mode and pay the small performance penalty.

near··on Ask HN: Best things in your bash_profile/aliases?
Definitely not for everyone, but:

  set +H
  export HISTIGNORE="&"
  alias reset="printf '\033\143'"
  alias ls="ls --color=never -p -D '%Y-%m-%d %H:%M'"
  alias pmake="gmake -j30"
  PS1="\[\e[0;32m\][\w]$\[\e[m\] "
  history -w
  history -c
I turn off history substitution (sometimes ! get into my program arguments and I don't like surprises), and start with no history on new terminals. I don't trust myself not to run an rm * from a previous session, open another terminal, and hit up one too many times.

A little colorization of the terminal prompt, and spicing up of ls output (the colors actually give me trouble, and often I can't read the dark blue items at all.)

But most specifically, I adore the reset alias. Unlike clear, it isn't undone when you scroll up. The built-in reset command takes forever to run and does a bunch of things I don't want.

HISTIGNORE is my absolute favorite. It doesn't log your last command to history if it's the same as the one already there. I'll often run make multiple times to fix compilation errors, and with HISTIGNORE, the command to run the resulting binary is only ever two up keystrokes away.

near··on Why did I spend 1.5 months creating a Gameboy emulator? (2017)
The Game Boy is only simple in the early stages of emulator development.

You find quickly that it is full of excruciatingly complex edge cases that aren't documented, and aren't well understood by anyone.

We're still making significant progress to this day on it.

And even in the early stages, the Z80-like Sharp LR35902 is quite a hassle. If you want an educational project, consider an NES emulator instead. Still has lots of edge cases, but the documentation and reverse engineering work is far ahead of the Game Boy.

Some reading if you like:

https://mgba.io/2017/05/29/holy-grail-bugs/#pinball-fantasie...

https://mgba.io/2018/03/09/holy-grail-bugs-revisited/#the-ph...

near··on W3C abandons consensus, standardizes DRM, EFF resigns
The web has been engineered to a complexity level so grossly obscene that it is all but impossible for independent developers to produce fully independent web browsers anymore. You would need hundreds of millions of dollars in capital and strong leadership to produce a browser that would be successful in today's world.

I could dedicate the rest of my life working 100 hours a week on a browser, and I would die before I had something that could compete with browsers of 2017, let alone of the browsers far into the future at my demise. The standards grow in complexity faster than a small team of developers could possibly keep up with.

The best we have are attempts at forks of major browser engines, which will never gain any serious traction to have any power over the direction of web standards.

If people want to do something about it, they need to fork the web itself. HTTP, TLS, HTML, CSS, JS ... the entire stack needs to be scrapped and replaced with something sensible with a focus on simplicity. If a single highly talented developer working full-time can't implement a reasonable browser within a year, then the standard is too complex. This will of course never happen.

And so, on the subject of DRM, we've officially lost the war today. And combined with the impending loss of net neutrality, brace yourselves everyone: it's only going to get worse from here on out.

near··on A comment left on Slashdot
Unfortunately, it's just bad design that's very typical of the 'modern web' these days.

My site didn't even top 5% of its resources when it was on the front page of HN, Reddit, Kotaku, Destructoid, Eurogamer, The Informer, Slashdot, etc all at the same time. (Well okay, Slashdot four days later.)

You don't need Node, Ruby on Rails, PHP, Apache, PostgreSQL, Wordpress, etc to serve up a simple text blog that you post on once a week. If you put all of that on a $5/mo VPS, it's not going to handle any kind of serious load.

We're mostly all developers here. It's not even a weekend project to set up a simple blog from scratch.

Host your site on nginx, don't include a bunch of massive Javascript libraries, serve your content statically or without using a dynamic scripting language, and you'll be fine.

near··on Releases for XFCE
I feel like they still have a choice ... at least for now.

CSDs are still optional in GTK3. True, they are forced on for the common dialogs, so if you use GTK's file chooser or font picker, then you're going to end up with them. But at least then they're child modal dialogs to a parent application.

The Gnome 3 desktop team decided to move every application possible to them, but there's no reason Xfce has to follow suit there.

Again, at least for now. It's certainly possible the GTK team will decide to enforce this and remove the option for window manager decorations in a future release.

I would really love to see a maintained fork of GTK2, however.

near··on Releases for XFCE
Sigh, are they seriously bringing GTK3's client-side decorations and lack of title bars to Xfce??!

Applications should have title bars. This is how it's been done everywhere since pretty much the first Xerox GUI. Monitors are bigger than ever today. I promise, people can spare 10 pixels of vertical space so that they can see the name of the application being run (and the name of documents open in said application), and have a very easy area to click on to move the window around with. GTK3 CSDs also break the user's ability to choose a window manager theme. It also removes the possibility to disable the toolbar area from certain applications, eg text editors. They also tend to result in applications that lack traditional menubars, which are very useful for complex programs.

I have already dropped every last Gnome 3 application over this nonsense. This is going to be horrendous to have to stop using Xfce now, too.

Sorry, I know HN doesn't like negativity, but this "change for the sake of it" stuff is getting really old. I just want to keep using my computer the way that's worked just fine for me for the past 25 years. This really is a step backward in usability. I don't want to have to target tiny slivers between widgets, or hold down Alt to move windows around. And for applications I want an actual toolbar in, I don't like how most of the toolbar icons disappear so that things can be merged into the titlebar area.

near··on Coroutines in C, revisited
It's not, they're two separate things. Unfortunately, nobody can agree on terminology for this stuff. I try not to ever use the word 'coroutine' anymore because of this.

libco is what I call a cooperative threading library. It allocates a stack for each thread. This means that thread A can call six functions deep into helper functions, and suspend in the middle of a helper function, and then resume right back at that same point.

Thus, you program libco very similarly to how you do preemptive threading, only you don't ever need any locks, and you have to do your own scheduling (which can be as simple as "co_call and co_return", or "co_jump" in assembly terms.)

The CORO #define wrappers in the article is what I would call a very simple state machine. There is no thread, there is no state machine, there is no user-space context switching going on. You only get the call/ret style behavior, and you can't ret from a subroutine called inside of it. It's far, far less useful.

However, when you can get away with it, CORO will be about ten times faster on average. libco is optimized as much as possible with pure assembler. On ARM, it's literally three instructions. On x86, it's ten. The entirety of the burden is because modern CPUs do not enjoy having their stack pointer changed. Go to older CPUs and the overhead drops substantially, but few people are coding on a 68000 anymore. This also means that libco is not ISO C. It requires an assembly implementation or a platform that lets you poke at jmpbuf from setjmp/longjmp to work. In practice, it'll work anywhere you'd reasonably want. x86, amd64, ppc, ppc64, arm, mips, sparc, alpha; Windows, macOS, Linux, *BSD, Haiku; etc have all been tested. And even if you find something crazy obscure, you only have to write about twenty lines of code to port it.

The magic of libco is that it's about 100 times faster than preemptive threading would be for the context switching overhead. So when you actually need subroutines, and when you don't want to be swamped in locks/semaphores/critical sections, it can eliminate giant swaths of nested state machines (switch tables) by keeping all that state inside each local stack frame, transparently and out of your codebase. Deeply nested state machines are a serious pain in the ass to reason about and maintain, trust me.

Also ... both of these methods have a serious flaw (as does preemptive threading): serialization. If you want to save the state of your program in the middle of working, and restore to that position later (think save states in an emulator) ... it'll be a bit tricky with libco. But since the state is hidden by the #define, it'll be absolutely impossible with CORO, unless you redesigned it to use external state, which would make it even clunkier to use.

In conclusion: both complement each other. I feel C++20 or whatever should add CORO-style stackless state machine wrappers to the language for convenience. But it should definitely leave stack-based cooperative threading out, because that can easily be done as a library. (It can include library functions for that purpose, but it doesn't need language-level primitives.)

There's a hundred cooperative threading libraries, by the way. My aim with libco was to make a library that has four functions (co_create, co_delete, co_active, co_switch) and zero types/structs. As simple and fast as possible, supplying as many optimized backends as possible. Then let people build on top of that. The downside is most people still choose to write their own libraries from scratch, so there's a lot of wheel reinventing going on.

near··on Amazon seller’s account suspended after changing profile name on Kindle Fire
I feel really bad for the guy and I hope this gets enough media attention for Amazon to actually care about helping him.

But this is the world we are headed toward with people continuing to stake their entire livelihoods on services with almost non-existent customer service. Companies like Amazon, Google, Paypal, you name it.

If they won't give you a phone number that rings through to an actual human being promptly, you shouldn't allow yourself to become dependent upon said service continuing to work. Let alone base your entire income and the incomes of employees under you on it. That's just incredibly irresponsible.

near··on HPACK: the silent killer (feature) of HTTP/2
This really seems like overkill to me. We've made HTTP/2 that much more complex to implement (a custom compression and dictionary not used anywhere else) to compress headers. And complexity always leads to fun new vulnerabilities. I guarantee at some point we'll see at least a DoS come out of this.

I would add that it also consumes more resources to compress these headers (I know huffman is fast; but it's not as fast as plaintext), but you can probably cache a good portion of it, and then just encode the per-connection values at the end. Although I'd be surprised if Cloudflare has nginx doing that.

Right now, my domain's HTTP header is 192 bytes:

    Content-Type: text/html; charset=utf-8
    Content-Length: 3884
    Connection: keep-alive
    Content-Security-Policy: upgrade-insecure-requests
    X-Content-Type-Options: nosniff
    X-Frame-Options: deny
And more than half of it is just optional security enhancements.

So now I'm going to compress that header so that it's ... what, 100 bytes? Even on my site that's incredibly lean and lacks images, it's around 20-30 KiB per page of content. Modern web pages now average being larger than the original DOOM video game (2301 KiB.)

So we're doing all of this to chase roughly a 0.05% reduction in bandwidth per page? We're worrying about the spot on the carpet while ignoring the elephant in the room.

near··on BearSSL – Smaller SSL/TLS
This thinking is why Heartbleed was such a disaster. Everyone left it to someone else, and the end result was OpenSSL being the only serious choice. Yet even the 'experts' got it wrong -- way wrong.

I'm not advocating everyone and their mother implement their own crypto. But some software diversity is a good thing. These algorithms aren't quite as scary or fickle as the documentation and existing implementations make them seem. Especially if you stick to good software like DJB's stuff.

For instance, using montgomery/edwards curves instead of weierstrass curves eliminates a lot of the difficulty in writing a constant-time implementation of ECC. And the 25519 implementation comes with a fast, constant-time implementation of a prime field type.

Yet even DJB's stuff can be simplified. You can knock off a good 80% of the scary code at a cost of a mere 10% of performance. To Google or Facebook, that may be unacceptable. But to me, that's entirely worth it. Now you have a tiny library that is easy to understand, and easy to audit.

near··on Let 'localhost' be localhost
Nice! I'm very much in favor of this change.

I develop my webserver locally, and it has many subdomains. So I have "www.localhost", "files.localhost", "doc.localhost", etc.

I have to add each subdomain to my /etc/hosts file before I can use it, as you can't have wildcards in that file. And even then, if I type a new one into Chromium, it will try and redirect me to a Google search result, unless I prefix the whole thing, eg "http://doc.localhost/"; once I do that and it connects, then the Omnibar will match the actual localhost entry easily going forward.

This should help anyone in a similar situation of testing their server with subdomains on localhost.

← PreviousPage 2 of 4Next →