Better HN
topnewbestaskshowjobs
Log inSign up

Gibbon1

8,350 karma · joined Jan 8, 2015 (11y ago) · 7,539 submissions

Submissions

comment 13h ago · link · parent

One of the exciting things about AI coding is converting legacy C++ code to safe modern languages.

comment 1d ago · link · parent

I ran into a guy in SF holding a cardboard sign that said retire at 30, ask me how $5. I gave him $5 and he handed me the sign and walked off.

comment 3d ago · link · parent

About 25 years ago I saw a small remote parcel of land for sale. Nearest power to the property was something like two miles. I think running power would have been $25k which is as much as the property was selling for. Ran the numbers and solar would have been cheaper.

I think about a heat map of where solar is cheaper. 2 years ago it would have been small splotches live that property. But over time as solar got cheaper the splotches got bigger and bigger. And now we're in the place where some places solar is cheaper than grid connection fees.

comment 3d ago · link · parent

A point I make is there is a lot of people pushing misplaced thrift. When you run the numbers the cost of a 100 acres of economically unimportant land is a small percentage of the cost of the solar panels to put on them. At the same time install costs are the lowest.

Big picture solar on houses, commercial buildings, parking lots is more expensive than just dropping solar on a 100 acres of flat dry scrubland.

comment 4d ago · link · parent

How dare you pass a struct by value to a function. Heresy!

comment 4d ago · link · parent

There are very few reasons to start a greenfield project in C++ at this point.

comment 4d ago · link · parent

This stuff is bleeding into the small embedded stuff I work on. And I can tell what they are trying to do.

The development path they are setting up is the unit you're debugging has a crypto units with a secret key that can be programmed once and isn't accessible. The bootloader uses that crypto engine to validate the firmware.

Right now you're the one that can set it if you want. But in the future the company you work for, the OS vendor, or the manufacturer will set the key and flash the bootloader.

When that happens you'll need a connection to their servers to sign the firmware you are developing. And when they terminate your access you won't be able to flash new firmware.

comment 4d ago · link · parent

What's obnoxious is the WG14 standard committee could have at any time in the last 40 years provided a standard slice and buffer type that would go a long way to discourage trash API's like this one.

I swear it's de rigueur in C that if an operation requires 5 parameters to insure the operation is error free than the function shall only take 4 parameters.

Rewriting the function with idiot mode disabled

int EVP_EncodeUpdate(EVP_ENCODE_CTX ctx, buffer_t out, const slice_t in);

comment 1w ago · link · parent

Harris Ranch -> Cowschwitz

comment 1w ago · link · parent

My hunch is because it's easy to build a pascal interpreter it's easy to extend that as a code generator.

comment 1w ago · link · parent

If you want another rabbit hole to go down, look at Cherries. But citrus is definitely weirder.

comment 1w ago · link · parent

Old geek who was one of my nominal bosses when I first started had monitor he wrote that could do break points and single stepping on a Z80.

comment 1w ago · link · parent

Everything was okay until Hamas started another war.

comment 1w ago · link · parent

I've been using an arena allocator with embedded C code for a while.

That C doesn't support an arena allocator as part of the standard library points you to everything that's wrong with C. The standards working group.

Also the Intel 0x86 and 32bit architectures caused a lot of issues with C because the paltry number of registers.

comment 1w ago · link · parent

The parent thinks that only the government implements price controls.

"People of the same trade seldom meet together, even for merriment and diversion, but the conversation ends in a conspiracy against the public, or in some contrivance to raise prices."

comment 1w ago · link · parent

Certainly, Mercury, Venus, Earth, Mars, and Ceres are rocky planets. And Pluto, Eris, Makemake, Haumea etc are icy planets. But the idea that there are gassy planets is just silly.

comment 1w ago · link · parent

I just remember that's guys essay explaining why you throw poor people in prison, fine middle class people and wealthy people you don't need to do anything to.

It'd violate site rules to describe fully what I think of that.

comment 1w ago · link · parent

Maybe we haven't gone far enough. We should refer to Uranus and Neptune as Trans Saturn Objects.

comment 2w ago · link · parent

You can search and find that an acre of corn produces around 500 gallons of ethanol. And note ethanol has a 1/3 less energy than gasoline so the mpg is a third.

So 30mpg * .66 * 500gal/year equals 10,000 miles/year

Also on the internet 1 megawatt of solar requires 5-8 acres. Call it 6.67, so 150,000 watts/acre.

150kw * 2000 hours sun/year is 300,000 kwh

Electric car goes 3.5 miles/kwh

So 300,000kwh * 3.5 miles/kwh is 1,050,000 miles.

comment 2w ago · link · parent

What's interesting to me in the last ten years we've seen a shift to silicon carbide and gallium nitride power components.

Those are key components in the shift to renewable power. Inverters for solar, motors, battery chargers, even inverter based power transformers.

comment 2w ago · link · parent

My opinion is states like California should enact policies to encourage work place charging. Because that's when the energy mix has the highest amount of solar.

comment 2w ago · link · parent

Very conservatively solar produces 30-50 times are much energy per acre as corn ethanol. I think if you consider just the ethanol to mix with gas vs charging an electric car with solar it's a 100 times more.

Something around 2500W of solar can provide enough energy to drive an EV 12,000 miles a year.

When it comes to zoning. The state should require offices to install chargers for employees cars when the solar share of electricity generation is highest.

comment 2w ago · link · parent

Interrupts trash high end cores throughput and they have high latency and non deterministic execution times. Smaller cores like an Cortex-M series handle interrupts quickly and deterministically. And they are very power efficient.

That was a gut feel of mine 30 years ago. And it wasn't as bad then.

Newer gut feel but I remember a processor designer saying the same thing a few years ago. Modern systems the processor very often is doing basically jack all nothing 95% of the time. They aren't very power efficient in that mode. Where Cortex-M processors are.

A soft poke. An Arm Cortex-M4 is as powerful as an 486 of yore that was what people were running windows 3.1 on and playing DOOM.

comment 2w ago · link · parent

Things I read recently makes me think that default target for stuff like that is a manky compiler that's half a step above macro assembler. AKA it's much faster if your compiler is dumb as rocks and usually not with actual compilers.

comment 2w ago · link · parent

I remember mucking with returning multiple values as anonymous structs. It was tantalizing close but no banana.

I think with C23 you got half a banana now. Still can't do it because C23 didn't adopt proposals to allow returns of untagged/anonymous structs.

If you could then you could write

  auto rtn = Foo();
  if(rtn.err) 
    printf("err=%i", rtn.err);
  else
    printf("Foo=%i\n", rtn.foo);

comment 2w ago · link · parent

I write firmware where the program has to run for years unattended.

You are right, C with manual memory management, no lifetime management, lack of phat pointers and a culture of leet has problems with deranged maddening bugs that other languages don't have.

But this bug first shows how inband signaling is bad news usually. But worse it's a failure to adhere to the spec properly. If you implement a library and you don't adhere to the spec you're going to bone someone.

Perhaps even worse is obviously the spec doesn't come with any standard testing framework. That was also the root of Apples infamous goto bug.

comment 3w ago · link · parent

The real estate industry (gag) says that because the whole goal is to turn housing into standard product that they can sell with the least work possible.

That's why you see houses for sale where they repainted everything grey, ripped out the mature landscaping and put down plastic and dyed wood chips.

comment 3w ago · link · parent

Carbon taxes are your typical neoliberal economic non solution. Incoherent policy designed to create as much political blowback against the do gooders as possible.

comment 3w ago · link · parent

Processors I mostly write firmware for have little cache at all.

I think cache friendly code also tends to be reason about friendly and debugger friendly. None of that is remotely premature optimization.

comment 3w ago · link · parent

Cost of recent nuclear power in the UK comes in at $130/mwh at best. Where wind and solar are coming in at $50-80/MWh.

So for the same rate of investment you can decarbonize 2-3 times faster. And that doesn't figure the long lead times for nuclear vs solar, wind and batteries.

12345
252