HNHacker News
TopNewBestAskShowJobs

tbirdz

1,965 karma · joined September 29, 2012

submissionscomments
tbirdz··on Show HN: Retro Patents – Tech patents turned into art
As far as I am aware Patent Documents are public domain, and not subject to copyright, so if someone wanted a printed patent poster they could grab the document and take it to any large format printer and have it printed there cheaper than it would cost to order from retropatents.com, and they could do this for any patent they were interested in, not just the limited selection available at your store.

Does Retro Patents add anything unique? Or in other words, why should I order from Retro Patents instead of doing what I mentioned in the first paragraph?

tbirdz··on Ask HN: Is Hackernews still using the file system as database?
The algolia api has more bulk operations, so you can get more than one response per api request. Also if you look around, there are some datasets where people have downloaded all the HN API json responses, and have made them available, so you could use those for local development and testing.

As far as ethics go, it's probably better to use the API than scraping. Sure you're making more requests, but I think the firebase servers and cdn have far more ability to handle a lot of requests than the HN server does. If having that many requests would put firebase out in any significant way, then I'm sure they would put a query load limit on the HN api.

tbirdz··on GCC optimized code gives strange floating point results
In practice, I don't think IEEE 754 floating point is deterministic, especially not across multiple ISAs, multiple vendors of the same ISA (Intel, AMD), different generations of the same vendor's cpus, different compilers and different math libraries, even just C's libm.

So just a warning to everyone out there: unless you are very, very careful your floating point code will not be deterministic. If you thought you can just use floats and expect it to "just work" the same, then you're out of luck.

Here's a couple of articles which go into more detail about problems with floating point determinism:

http://gafferongames.com/networking-for-game-programmers/flo...

https://randomascii.wordpress.com/2013/07/16/floating-point-...

tbirdz··on GCC optimized code gives strange floating point results
There's always fixed point integers[0]. They're less flexible than floats, but at least the amount of precision available is much more clear and uniform, and all the rounding is pretty explicit.

https://en.wikipedia.org/wiki/Fixed-point_arithmetic

https://en.wikipedia.org/wiki/Q_%28number_format%29

tbirdz··on The power of role models
I would be interested in hearing what exploits in particular that the person did inspired you to take them on as a role model. To me a role model would not just be someone who does good work, but someone who you would aspire to emulate. There would have to be something special about what they did and perhaps more importantly how and why they did it that inspired you to want to be like them.

So to take your list of people for example, someone like John Carmack. What I was looking for was what specific exploits were you talking about and why they were so inspirational to you. Maybe it was his work creating the Doom and Quake games, or his bootstrap work building id software from scratch, or his contributions to free software by releasing his engines under gpl, or his quakeworld talks, or his work with rocketry, or his new work with VR, or his general overall attitude about life, programming and everything.

I mean there had to be something special about him for you to want to be like him, and that seems like something that would be worth telling a little story about.

tbirdz··on The power of role models
That's very interesting. I had always thought of role model as referring to a specific individual, I haven't encountered the idea of collective role models forming "cognitively available success cases" before.
tbirdz··on The power of role models
I tried very hard to make sure my comment did not come across as dismissive, evidently I failed. Just to reemphasize, I am not in any way trying to deny these women's responses.

I have just seen this concept of a role model bandied about before, and that is something that I have never experienced in my own life in computing. In the article, Rob mentions how in the field of astronomy, the women he has talked to consider role models to be important. But he never mentions any people he would consider role models to himself in computing.

So I was just curious if anyone else here had any role models in computing (man or woman), and if so would they mind sharing a little anecdote about that experience. I've often heard talk of the importance of role models, and I felt like I was kind of "missing out" for not having one. So I thought, how about I start a little side discussion on the role that role models in computing had had on others lives and careers on here.

I am NOT trying to imply any of these things: "Women shouldn't need role models because I didn't have one" "Role models are unimportant" "Women should accept men as role models" "Women are liars"

or any other such derogatory statements.

tbirdz··on The power of role models
>Rob is right that role models are important.

I've heard this thought expressed a lot, but I have to ask a genuine question: Does anyone here really have any role models that were influential to their interest in the field?

I'm a man, so maybe it is different for women. But I never really had any role models in programming that I looked up to/wanted to emulate. Personally, I was always interested in computers, software, technology for its own sake, and never really paid too much attention to the people behind the scenes. I don't recall any particular person who I saw in programming and thought "I want to be like them", or thought of as a role model.

I suppose this could have happened on a subconscious level, when I was unaware of it. But at least on a conscious level I can't point out any particular individual who I viewed as a role model and inspired me to continue in the field.

Is there anyone else who never had a role-model type relationship with someone? And for those who have experienced it, would you mind sharing a story about a significant role model in programming from your life?

tbirdz··on The importance of upvoting
I think there is something like a 1% rule for elections.

small group runs for office

larger group helps run the campaign (volunteers, etc)

larger group donates

larger group votes

even larger group doesn't vote at all

As the amount of effort to participate decreases, the amount of people involved rises.

tbirdz··on Encrypted email is still a pain
Decentralization is good to help protect the user against abuses from the central service provider.

It also encourages competition, since the user can switch to a different service, and not be penalized by network effects preventing them from communicating with other people.

I use MX records in my domain so that I can switch to any mail provider I want, and people will still be able to contact me with the same address.

How is this possible in a centralized system? If I switch from WhatsApp to Signal, I lose all my contacts. If I want to keep communicating with them, then I have to convince them to switch to a different app, or just never stop using whatsapp. The network effects dynamic here makes it very difficult to switch from one centralized encrypted chat provider to another. If you try to leave, you lose all your contacts.

The other thing I dislike is that they all seem to require a valid phone number. This puts you at the mercy of the phone company. If you change your phone number, then you have to get all your contacts to change their contact info for you. This is a huge step back, compared to email with own domain and MX records!

The other thing I dislike about these centralized encrypted chat providers is the lack of client choice. 1 company can only support so many platforms, fair enough. But that will likely mean I'll never see the company develop a Linux desktop client, or a terminal based client for their network. And because of centralization, no-one else will be allowed to develop one either. In contrast, there are many different tools I can use for sending and receiving email on the Linux desktop, cli based backup tools, etc.

And as far as the spam problem goes, I'm not sure how Signal/WhatsApp are better in this regard? If you have to give your signal address to out for people to communicate with you, or to do business with a company, then I don't see why companies can't just spam you. Signal can centrally filter all messages you receive to make sure they don't have spam in them and block spammers messages from going through (but this is no different than what many mail providers also do). You can block individual contacts, but that doesn't help if there are a very large number of different accounts sending spam. You can whitelist your contacts, but then noone you don't know that wants to talk to you can contact you.

It also doesn't stop known contacts from sending spam to you either because

- They are forwarding spam messages to you, like chain letters.

- They got a virus or some malware which sends spam to all their contacts

- It's a "legit" company you need to receive communication with, but sends spam mixed with vital communication: marketing lists you get auto-opted into (imagine if all the "give us your email to read the article" pop overs got replaced with "add us on signal to read the article"), amazon sale ads, facebook constantly trying to entice you to go back on the site, etc.

If signal replaced email, I don't see how it could remain spam free.

tbirdz··on Why are people from the future not time traveling to our period? (2012)
I'm sure there are many historians who would jump at the chance to go back in time and observe ancient bronze casting first-hand.

In fact, it seems like almost every period of human history has at least 1 historian who has devoted their life to studying it. So I think there would be at least some people in the future who would be interested in our present time period.

tbirdz··on You Can Change Your Personality
Does anyone have any resources on how to break out of this "isolation cycle" if one is currently already in it?
tbirdz··on Neocities: Free, modern Geocities reboot
Kyle, thanks so much for all your hard work setting up Neocities! I think it's a wonderful thing you are doing.

Also, since we're talking about neocities, here, does anyone have any cool neocities sites they know of and want to share? Just post a reply to this comment, so folks who want to have other neocities discussions can easily collapse all the links at once.

tbirdz··on Female shark learns to reproduce without males after years alone
>In humans, even a small loss in genetic variability such as cousin mating 1.5% is bad enough that we have laws against it in nearly every society.

I thought this sounded suspicious, so I looked it up, and it's not true. Cousin marriage is legal in all of Europe, Australia and New Zealand, South America, Canada, Mexico, the Middle East, Russia, and India.

In The USA, cousin marriage is allowed in 17 states. But 40 out of the 50 states allow cousin sexual relations and cohabitations.

The only places in the world that cousin marriage is illegal is in China, Korea, Japan and some states in the US.

Whatever you think of cousin mating, it's just not true that "we have laws against it in nearly every society." In fact, just the opposite, it is allowed in nearly every society.

tbirdz··on An Incremental Approach to Compiler Construction (2006) [pdf]
Not true. Chez Scheme has been released as free open source software: https://github.com/cisco/ChezScheme
tbirdz··on Yes, You Have Been Writing SPSC Queues Wrong
I know the author doesn't intend this code to be "production ready", but I just wanted to point a problem that may not be completely obvious, if you are trying to use this structure for multithreaded communication.

The structure declares the read and write indices like so:

    std::atomic<IndexT> read_idx;
    std::atomic<IndexT> write_idx;
These two variables are going to be stored next to each other in memory. If IndexT is say a 32-bit int, then the read_idx and write_idx will be 4 bytes each. A cache line is 64 bytes on intel, so these two variables are going to end up on the same cache line.

The problem with this, is that cache coherence protocols work on the granularity of lines, not bytes. So when one core writes to anywhere on the line (for example the producer to write_idx), then the other core (say the consumer core) has to invalidate its cache entry for that line, and get the new value off the bus, or maybe even hit memory.

Regardless of the specifics, the point is the consumer and producer cores can no longer independently write to their respective variables. Whenever they write to their variable, it will cause some cache coherence operations to be done to update the line that variable is in, in the other core.

This is false sharing, since the producer and consumer don't actually need to access the others variable. The cores are just forced to share access to the variables because the variables are on the same cache line.

This can really have a big impact for multithreaded workloads, and bring down the overall thread throughput.

One solution is to add some padding between the variables. Something like:

    std::atomic<IndexT> read_idx;
    unsigned char pad[64];
    std::atomic<IndexT> write_idx;
will do. That will put the variables on different cache lines. And you might want to pad out some other variables to different cache lines as well.
tbirdz··on I've been writing ring buffers wrong all these years
I don't think this is true. I tried the sample out, and gcc, clang, and intel's compiler all generate a cmov for the code instead of a branch with -O2. I don't think all these compilers would have used a cmov instead of a branch if the cmov was more expensive than a branch in this case.

https://godbolt.org/g/nyFLwp

tbirdz··on I've been writing ring buffers wrong all these years
I've been using this knot for 8 years, and it hasn't come untied on me once! I'd highly recommend it.
tbirdz··on I've been writing ring buffers wrong all these years
That's only true if your compiler actually outputs a modulus instruction when it sees you doing N % pow2. It really should optimize that into N & (pow2-1) for you, so whether you write the & or the % it will end up running the cheap & version.
tbirdz··on I've been writing ring buffers wrong all these years
>iterating backward through memory is horrific for cache performance

This isn't true for Intel chips since Netburst Pentium 4. The hardware prefetchers can handle predicting iterating through an array forwards, backwards, and even strided accesses [0]. The arrays takes up the same number of cache lines in both cases, so going forwards or backwards are still going to have the same number of cache misses.

0: https://software.intel.com/en-us/articles/optimizing-applica...

tbirdz··on I've been writing ring buffers wrong all these years
You could also do a predicated conditional move instead. Just do the subtraction every time, and use something like cmov to only do the write if you need to.

I don't know if it would end up being faster, though.

tbirdz··on Register-based VMs have a higher performance than stack-based VMs
I know of at least 2 commercial implementations: VFX Forth by mpe[0] and SwiftForth by Forth Inc[1]. Both companies are still in business, selling their tools for hundreds to thousands of dollars, so there is obviously some people using them. I think they have a partial customer listing somewhere on their site. Oh, and there's also gforth of course.

Then again, part of the charm of forth is how easily it is to bootstrap your own forth on your own system. There could be countless homegrown forths out there, in addition to these commercial offerings.

I haven't used forth for anything in production, myself. I just think it's a really interesting language. It's a great "what if" question. What if everything built on C had been built on Forth instead? What if all the work in improving the C language, tooling, operating systems, libraries, hardware etc had been spent improving Forth and stacks instead? It's fun to ponder.

If you want to read more about forth, check out Thinking Forth[2]. It's really got some great insights about programming and software design in general, not just applicable to forth programming in particular.

Starting Forth[3] is also good more of a beginner's introduction to forth. And Moore's own Problem Oriented Language is a good book talking about what his intentions were when he created forth[4].

For more reading: This page has a lot of good forth links too [5] Chuck Moore's color forth blog[6] This site has lots of interviews with Chuck Moore on it and other forth opinion pieces[7] Forth Interest Group site[8]

There's also a new forth standard that's being worked on[9]. Seems pretty active, too.

[0] http://www.mpeforth.com/software/pc-systems/vfx-forth-for-wi...

[1] https://www.forth.com/swiftforth/

[2] http://thinking-forth.sourceforge.net/

[3] https://www.forth.com/starting-forth/0-starting-forth/

[4] http://www.forth.org/POL.pdf

[5] http://www.complang.tuwien.ac.at/projects/forth.html

[6] https://web.archive.org/web/20160305013837/http://www.colorf...

[7] http://www.ultratechnology.com/

[8] http://www.forth.org/

[9] https://forth-standard.org/

tbirdz··on Register-based VMs have a higher performance than stack-based VMs
Moving Forth is pretty good: http://www.bradrodriguez.com/papers/moving1.htm

There are 8 parts to the series, you can look at all of them and other Forth writings by the author on his website: http://www.bradrodriguez.com/papers/

tbirdz··on A glance into web tech-based text editors’ text management
It's a label you can jump to. I guess FARTF stands for the function name: FcAppendRgchToFn. Then the number is used to differentiate each label.
tbirdz··on A glance into web tech-based text editors’ text management
If you are interested in this kind of stuff, Craig Finseth's The Craft of Text Editing is a great read: https://www.finseth.com/craft/
tbirdz··on New Warship’s Big Guns Have No Bullets
Or James R. Kirk, depending on the episode: http://i.stack.imgur.com/KLPqJ.jpg
tbirdz··on Every Version of Voxel Quest
Cool! I'll definitely have to try it out when I get some free time. And hey, there's nothing wrong with reinventing the wheel when you're just trying to have some fun!
tbirdz··on Every Version of Voxel Quest
Very interesting. Do you have resources you could recommend about working with/programming with voxels? Or how using voxels differs from using polygons in practice?
tbirdz··on Ask HN: What are examples of open source projects with excellent tests?
SQLite has a lot of tests. You can read about their testing strategy here: https://www.sqlite.org/testing.html
tbirdz··on Nice People Really Do Have More Fun
Interesting idea, but I think you are missing out on the category of happiness that is not related to other people. You can be happy just from your own internal thoughts, actions, accomplishments, without involving other people. I don't even know if the idea of addition and subtraction really apply to internally sourced happiness -- would you just be adding/subtracting from yourself?
← PreviousPage 3 of 16Next →