I’m updating Hexerals for modernity — I wrote it in 2018-2019 to practice React and TypeScript. I’m thinking:
- Make it multiplayer
- Add a tutorial
- Fun features!
And behind the scenes:
You can “play” the old version at hexpansion.io. Updates:
I’m updating Hexerals for modernity — I wrote it in 2018-2019 to practice React and TypeScript. I’m thinking:
And behind the scenes:
You can “play” the old version at hexpansion.io. Updates:
Code for this post: github.com/neolefty/js-collection-benchmarks
Summary: In Chrome, object operations are much faster than immutable Map — just don’t
freeze() them. But in Firefox and Safari, immutable Map still wins. Chrome’s advantage might come from Hidden Classes.
The strengths of immutable.js are:
For example, its board is represented using a Map, matching each location (a Hex) to contents (a Tile) — the hexagon in upper left might be Hex (0, 6), with a Tile whose owner is Red, population 8, and no special terrain.
These are run in your local browser (click the gear to change settings & run again):
What are these benchmarks doing? Something that resembles the internal state transitions in a single turn of Hexerals. See BenchWorkers.ts for actual code.
|1. Copy||2. Modify|
|JS object||copy[x] = y|
In short, Safari and Firefox both really like Immutable.js Map, and Chrome likes object.
For 1000 x 1000 x 0.1, on an M1 laptop, in milliseconds:
Chrome loves object, but everybody does well with immutable.js.
How about some older mobile devices?
|Pixel 4a 5G (2020|
|Samsung A50 (2019)|
So, what’s the best choice? The widest bottleneck is clearly Immutable.js’s Map. The object spread operator (and
object.assign) is too dang slow on Safari, and so is Map on Chrome.
Caveats: The benchmarks run synchronously. Still working on getting web-workers right.
Proposal: Add that browser padlock to long-lived documents.
In an age of undetectable fakes, how do you know what is true? We can at least prove a source, and with a little work — and help from HTTPS — archive that proof for later reference.
Hint: We have never known for sure what is true. All we could do was ask:
With convincing fakes, we’ve lost the second one. That convincing video or news story? It could be from anywhere. We don’t know who to trust, and we’re left with “What makes sense to me?” — and every one of us has biases about what we wish was true.
So can we bring back “Who do I trust?” Can we prove who said what?
Almost. On the web as it is today, you can tell in the moment whether you can trust content. That’s what the padlock in the address bar means. But if the page is changed in the future, or becomes inaccessible, you can’t go back in time and prove it to someone else.
So we need a little extra software: With those same padlocks, we could download and archive a signed copy of a web page. And the signature would come from the website’s own HTTPS credentials, so it’s publicly provable — even if the original page is modified or becomes inaccessible.
One source we know we can’t trust is AI. Even its makers warn of its hallucinations.
For example, this week OpenAI, the makers of ChatGPT, shut down its AI text detector “due to its low rate of accuracy.”
If OpenAI can’t tell the difference between human-written and AI-generated text, then I don’t think anybody can. Images and video can’t be far behind — we have to assume that any media we see — text, audio, image, or video could be entirely synthetic.
This is not a new problem — that’s why we have bibliographies after all. But can you check sources? Can you read that article from Reuters, and double check a quote? What if content gets taken down?
You know what I think would be a great starting point? If you could save the content of a web page, along with its signature. That shouldn’t be too hard actually, since most web pages are already signed.
C2PA is an emerging standard to add cryptographic signatures to files — in other words modern bibliographies. It is backed by Adobe, BBC, Sony, Intel, Microsoft, and others.
It aims to prove authorship of media, end-to-end, from its initial recording to its latest edits, with cryptographic signatures.
Of course, this is important for copyright and ownership — if AI-generated content can’t be copyrighted, then creators need to be able to prove authorship.
And it can help prove authenticity in critical situations:
Of course the Internet is full of warnings — dangers to privacy, fears of censorship and tyranny by those who control C2PA.
And that doesn’t address the loopholes. For example: Can I record a deepfake with a trusted camera? It will be a cat-and-mouse game between the fakers and the provers, and the outcome is not assured.
In the end, I don’t care about the provenance as much as about truth. And I trust certain sources a lot more than other sources.
What if the BBC (or your favorite source) vouched for something? Would it matter if they relied on an AI summary but then fact-checked it? I think that would be fine, because I trust their fact-checking.
It seems impractical to trace the provenance of every part of that article. Especially the text. Maybe a journalist wrote it, or maybe they re-typed it from ChatGPT? But I don’t need to know — just the fact that it’s from the BBC is a reputable starting point for me.
So we share URLs. Simple! And HTTPS makes them cryptographically secure. This one testifies that it is hot this summer, and you can really trust that it comes from the BBC: https://www.bbc.com/news/world-us-canada-66343133. US heatwave: Scorching heat strains US air conditioning capacity.
Sharing URLs is great, but it has two problems:
To solve permanence and remix-ability, we could do the following:
There are still some gaps.
This goes almost without saying. Every major AI provider makes it very clear that they “hallucinate”. And we don’t know how to fix it.
But we can appreciate the work of AI.
Prompt: You have been listening to rock and roll and are really getting into it, rolling your hips as you talk, and speaking in rhyme and meter. You bring everything back to love and heartbreak. In this style, please write a poem about the heartbreak of discovering that your lover is an AI.
A digital currency with built-in universal income, minimal energy requirements, and a bias towards equality.
If you were designing a digital currency that could actually promote justice and equality, would would it look like? Here’s one approach. It is rather different. The main objection is likely to be that, in order to benefit all people equally, it embraces verifiable human identity, and therefore discards anonymity from the start.
The goal of this design is a currency that:
to hashing power
Proof-of-identity can help with all of these desirable traits.
That’s it. That’s the basis of the currency’s operation. It has many implications:
Storage: Immutable or Mutable?
Income / Inflation: Fixed or dynamic? It can be:
Identity: Can be a single external authority or one determined by a democratic process involving all registered participants.
It quickly becomes apparent that this is not just a currency, but has the potential for making decisions democratically. That will have to be a future subject.
Bahiyyih is making a quilt, and she was looking for someone to make a color sketch of her design. She said the word gradient, and had to do it. But I had to do it quickly because I was competing with how long it would take to draw it physically.
Go play with the quilt color doodler. It does just barely enough to play with the colors. And the UI is hilariously terrible. Think of it, rather, as a puzzle. Can you figure out how it’s supposed to work?
It does let you change:
It doesn’t let you change:
There are so many directions it could go next. I’m not used to working this way — make something quick and dirty, and then call it done and move on. It’s probably therapeutic.
Publishing negative results helps everyone learn. Here’s my negative result: Instacart didn’t work out in the end. I had a great time there, but the combination of legacy code, a 3-hour timezone difference, and an on-site team of 200 programmers with just a handful remote meant that I was just not productive enough — even with many weekly video conferences — and they let me go after 6 months, back in March.
I think it was a learning experience for Instacart as much as for me. The FAANG prefer onsite teams, with exceptions for specialists, and now Instacart’s job openings reflect that. But I’m a generalist.
I’ve been doing contract work in agriculture software since April, and it’s been a good match. Hourly discipline has been good for my mental health, and I’m fortunate to have a spouse whose job provides benefits. If it weren’t for that, self-employed life would be much harder! Thank you Bahiyyih & Purdue, and hurry up US with affordable health care for all!
Join the Middle Class. Have a life that’s good enough. This morning I was just sitting at my dining room table, playing Threes, when the concept of the Middle Class poked its elephant head in through a window and explained its radical nature. “I’m not just a pleasant compromise,” elephant-middle-class said, “I’m an essential foundation for a peaceful planet.”
It went on, “Think about it. You keep ranting to anyone who will listen that we need to move on towards post-scarcity thinking. Run on love and planning instead of fear and coping. People are already doing that, and we call them Middle Class.“
This elephant had a point.
I looked at the elephant, excited to talk with it but a little afraid it would grab me with its trunk and practice juggling.
Instead it used its trunk to pull a bundle of grass out of some kind of saddle bag on its back that had a red and yellow diamond pattern. I think it was made of wool.
It rested its head on the windowsill and munched.
“Wait, why are you telling me this?” I asked it, “Don’t you have important things to do? Don’t elephants have to eat, like 20 hours every day to avoid starving?”
It shrugged with its ears while its mouth kept working on the grass. Elephant eating involves a lot of chewing. I drank some coffee and looked down at Threes but wasn’t interested in my game for the moment.
It swallowed, licked its lips, and spoke up again, “Maybe it would help to call it something more than middle class.” Its dark eye blinked slowly. “For example, what is this place you live in?”
“A kitchen.” I looked around. “I mean a house.”
“Yes,” it nodded slowly. “And its spiritual significance? Isn’t it also a sacred environment where neighbors come to celebrate their companionship and have elevated discussions? And where children can develop and flourish as spiritual beings?”
“Yeah, it is — on a good day at least.” I looked around. It helped that the kitchen was in decent shape this morning because (just to brag a little) I did dishes last night.
“And all that is easier if the roof doesn’t leak and it doesn’t freeze indoors in the winter.”
The elephant — again — had a point. I offered it coffee and cantaloupe rinds (they still had some of the orange part on them) that I had gotten out for the guinea pigs. It took some cantaloupe and made quick work of it.
“The middle class is the same.” It lifted its head and ran its trunk along the window frame, then started to amble away.
“Hey,” I called after it. “Happy Declaration of the Báb!” I think it smiled.
In an earnest talk with the Rector of a Parish, ‘Abdu’l-Bahá said: “I find England awake; there is spiritual life here. But your poor are so very poor! This should not be. On the one hand you have wealth, and great luxury; on the other hand men and women are living in the extremities of hunger and want. This great contrast of life is one of the blots on the civilization of this enlightened age.
“You must turn attention more earnestly to the betterment of the conditions of the poor. Do not be satisfied until each one with whom you are concerned is to you as a member of your family. Regard each one either as a father, or as a brother, or as a sister, or as a mother, or as a child. If you can attain to this, your difficulties will vanish, you will know what to do. This is the teaching of Bahá’u’lláh.”‘Abdu’l-Bahá in London, “Education”
“The supreme need of humanity is cooperation and reciprocity,” said ‘Abdu’l-Bahá. “The stronger the ties of fellowship and solidarity amongst men, the greater will be the power of constructiveness and accomplishment in all the planes of human activity.” In the same way that the human being is more than the sum of the individual cells which comprise its body, so too the powers of a unified community far exceed the combined powers of its individual members.Bahai.org, “The Community”
“A new life,” Bahá’u’lláh proclaims, “is, in this age, stirring within all the peoples of the earth; and yet none hath discovered its cause, or perceived its motive.” “O ye children of men,” He thus addresses His generation, “the fundamental purpose animating the Faith of God and His Religion is to safeguard the interests and promote the unity of the human race… This is the straight path, the fixed and immovable foundation. Whatsoever is raised on this foundation, the changes and chances of the world can never impair its strength, nor will the revolution of countless centuries undermine its structure.” “The well-being of mankind,” He declares, “its peace and security are unattainable unless and until its unity is firmly established.” “So powerful is the light of unity,” is His further testimony, “that it can illuminate the whole earth. The one true God, He Who knoweth all things, Himself testifieth to the truth of these words… This goal excelleth every other goal, and this aspiration is the monarch of all aspirations.” “He Who is your Lord, the All-Merciful,” He, moreover, has written, “cherisheth in His heart the desire of beholding the entire human race as one soul and one body. Haste ye to win your share of God’s good grace and mercy in this Day that eclipseth all other created days.”Shoghi Effendi, “The Unfoldment of World Civilization”
“Wait, isn’t the Middle Class founded on unsustainable consumption that is eliminating natural environments and causing catastrophic climate change?” I called after its diminishing form.
It called back over its shoulder, “You’re pretty good engineers — I’m sure you can figure it out if you work together.”
I plan to start working for Instacart, in San Francisco, in a couple of weeks — my first day will be September 10. I’ll still live in West Lafayette — for the first three weeks I plan to fly out Sunday night and come back Thursday overnight. Eventually I’d like to get that down to one week a month. So really it will be mostly remote work. Eventually.
How many people macro-commute? How do you make it sustainable?
Teresa had an assignment to write a horror story recently for Language Arts. I don’t think I ever had that assignment, but it sounded like fun.
On a Spring day it’s easy to get fresh strawberries. Every store has them, overflowing from their swishy doors out into the parking lot in cornucopias of rustic wooden platforms covered in 2 for $3! signs.
But in the late Fall or early Winter? You need is to get there early. And be ready to pay.
My daughters love strawberries. As long as there are strawberries in the refrigerator, there are no fights. Chores and homework get done. Memes are happily shared around the kitchen table.
Wednesday night. The weekend’s berries have been happily consumed, and even if they hadn’t been, they wouldn’t be good anymore.
I set my alarm for 5:30 and go to sleep confident. Beep beep beep. Some people configure their alarms to be music. But no matter how great the song, if it’s an alarm, you’re going to end up hating it. But there’s no love lost on beeps. Like smashing a mosquito, I dismiss my alarm with no hard feelings.
I wake up. My phone says 6:56 am. Oh no!
The peace-creating strawberries rot in my mind and tumble into the kitchen garbage. “Hey, these dishes are dirty. Who washed them?” Verbal sparring begins. I know it will lead to a day or more of hard feelings, followed by a weekend of grousing.
Jump out of bed. Pants. Sweatshirt. No time for underwear. Wallet.
Keys? Where are they? Oh, on the floor. Nope, that’s my bike key. Okay, we’ll go with that. No, I’ll never have time if I try to bike to the store.
7:01. To the store and back by 7:30 or else I’ll miss the breakfast window. Keys, keys. Bathroom? No. Gotta pee. Keys. Okay, where else? Kitchen counter? No. Coat pocket? No, no.
In the garage, still no car keys. In the car? What, it’s locked? Squint through the window. No. Wait, there they are! On the passenger seat! No, that’s the set with the dog keychain. No telling where mine are.
7:04. Still in the garage. Have to bike. 10 minutes there, 10 back, allows 6 minutes for shopping. Possible. Maybe if I pedal fast.
The garage door rises, a mouth of darkness. As soon as it reaches head level, head out into twilight.
Whoa, frost! Augh! Slippery! Foot down! Relief and frustration rush through me.
Blinding light. Whoosh as a car rushes by. I follow it out onto the road.
Pedal madly and look in every direction at once. Merge with traffic. An antelope among lions and elephants.
Red hatchback ahead, dark SUV behind.
Red light. Exhaust fumes. The driver in the next lane gives a sideways glance. Resting face, or incensed?
Green light. An engine races behind me. My legs pump. Don’t look back. I can keep up with this traffic. Shift. Shift. Shift.
Brake light! Skiiiiid. Catch myself against Red Hatchback. Scraaape of bike frame against car
Something hot on my shin.
Inside Red Hatchback, the rearview mirror frames the driver’s alarmed eyes and mouth open in an “Oh”.
I’m still standing. Back up, wave hands to say “never mind I just need strawberries”.
Everyone is turning left into the grocery store lot. Pumpkins. Haybales. 20 cents off gas with card. Pour gas onto the haybales, but that would make it harder to reach the strawberries.
But I’m still in the road, standing over my bike frame in the left turn lane.
Someone ahead in line is being too cautious. There is a chance to cross the other lane.
Go! Jump the line! Pounce on pedals to get in front of a slow truck.
The pedals don’t move! Broken!
No, accidentally in high gear! Bike is moving so slowly. Oncoming truck is slowing down. The opposite curb is coming closer, closer.
Foot down on curb, lift, pull bike out of road.
Whooosh. Angry yelling. My face is red.
Remember the strawberries.
The bike rack is at the far door. I’ll leave my bike propped by this door. No time to lock it.
A huge bin of pumpkins. Orange and useless.
Through the swishy doors. Apples. Pears. Peaches!? Blueberries.
“Oh my gosh, is your leg okay?”
What? It still feels hot, but cold too. Oh, that’s a lot of blood.
“Yeah, it’s fine. Have you seen any strawberries?”
“Oh, honey. I’ve got some bandaids in my purse.”
“I’ll take care of it when I get home. Excuse me, sir, yes? Do you have any strawberries?”
“Well, I’m putting out the fresh stuff now. I think maybe some came in last night, but we don’t have any out yet. Oh, here are some.”
The rejects. Maybe there are some good ones in there, at the bottom.
I take both remaining packs.
7:14. Ahead of schedule.
Self check-out. Please …. place …. your ….
Please …. wait …. for …. an (No, not an attendant) …. attendant
7:17. Where’s my bike? Someone riding it away through the parking lot?
Wrong door. It’s still over there where I left it, behind a cart. Running.
Strawberry cartons in plastic bags, swinging from the handlebars.
Going back is so much harder. Is it uphill? Barely. Push through.
Look behind: A car too close. Ahead: so much distance to cover—I try to catch up, pump hard, but my legs can’t compete with internal combustion. The driver’s stare weighs on my back.
I hop a driveway lip to get off the street, my slow motion too antiquated for the motorized commuters.
Imagine the strawberries on the kitchen table. In time for the day to start. Hands reach in, pluck from the carton, pop them into mouths that are smiling and talking. A team huddle, all hands in for a cheer. Everyone’s making plans for the day. All is possible.
The frost is gone, leaving damp sidewalks. Almost there, but I still have to cross the street. I should have done it at the crosswalk. Maybe I should go back? Or go up to the stop sign? Suddenly sleepy.
Where did all these cars come from? It’s not time for the rush yet, is it? There’s a break. But not on the other side. Have to wait.
Finally back in the garage. Kickstand.
Inside door to the house is still open.
In the kitchen, munching teenagers, phones out, catching up on the instanet.
“I got strawberries.”
Teresa, Bahiyyih, and I are helping Georgia in this season of college application essays. Taking turns with the words. This one is for a local institution:
When I first ate Purdue sandwiches, my brother told me they were made
of real plastic. I never believed he actually was aware of their
plastic ingredients. This new technology has made spacefarming
undoubtedly better. The only way to master spacefarming is with
plastic ingredients for Purdue sandwiches.
A perfect bundle of lacey clouds went frighteningly close to a sunny
hill. But no teeth transformed the clouds today — or ever —
Smoke detectors perform basic Purdue ballet while attached to my
Eddy Redmayn formed the original studio audience of his family’s large
In concussions, favorable lobes.