Skip to main content

Two Hot Climate Tech Startups Just Raised $1 Billion+ in IPOs

2 weeks 4 days ago
Public stock exchanges "appear to be warming to climate tech startups," reports TechCrunch. "Or at least some of them." This week, nuclear startup X-energy went public, raising $1 billion in an upsized share offering that appears to have delivered a windfall for its investors, including Amazon [and Google]. Retail investors apparently can't get enough, with the stock popping 25% in its first hour of trading. Also this week, geothermal startup Fervo said it filed for an initial public offering. The size of the Fervo IPO has yet to be disclosed, but private investors have valued the company at around $3 billion, according to PitchBook. The move to go public aligns with what investors told TechCrunch at the end of last year. After years of tepid attitudes toward climate tech companies, they expected public markets to start welcoming energy-related startups. Nearly every investor that weighed in on the question said the startups with the best chances of going public specialize in either nuclear fission or enhanced geothermal. Fervo, specifically, was mentioned several times. Thank data centers for that. The AI craze has taken a trend of rising demand for electricity and made it sexy and salable.

Read more of this story at Slashdot.

EditorDavid

CodeSOD: The JSON Template

2 weeks 4 days ago

We rip on PHP a lot, but I am willing to admit that the language and ecosystem have evolved over the years. What started as an ugly templating language is now just an ugly regular language.

But what happens when you still really want to do things with templates? Allison has inherited a Python-based, WSGI application which rejects any sort of formal routing or basic web development best practices. Their way of routing requests is simply long chains of "if condition then invokeA elif otherCondition then invokeB". Sometimes, those conditions will directly set the MIME type on the HTTP response.

They do use a templating library called Mako for generating their responses. They use it for their HTML responses, obviously. They also use it for their JSON responses, generating code like this:

{ "success": true, "items": { %for item in items_available.keys(): "${item}": ${items_available[item]}${',' if not loop.last else ''} %endfor } }

The %for and matching %endfor mark the Python code off, which generates JSON via string-munging, complete with the check to make sure we're not on the last iteration of the loop.

Like so much bad code, this offers a degree of fractal wrongness. Instead of iterating over the keys and fetching the items inside the loop, you could iterate for key,value in items_available.items()- and according to the Mako docs, that for is just a regular Python for loop. That we're just outputting the contents of the dictionary is itself potentially a problem- sure, if we know the types of the dictionary, we'll know that whatever it is can be output in the body of a JSON document, but do we really think this code is using type annotations? I don't. And for a RESTful web service, I'm always going to feel weird about using a success field when ideally the HTTP status code could convey most of that information (and yes, I know there are reasons to still put status in the body, I just hate it).

Of course, the real issue is just: Python's built in JSON serialization is actually pretty advanced. And performant! You don't need any of this, you could just do something like:

return json.dumps({"success": true, "items": items_available})

No templates. No formatting. No worries about how the data gets represented. Well, still worries, because JSON serialier will throw exceptions if it doesn't know what to do with a type. But then at least you get that exception on the server side and aren't sending the client a malformed document.

In any case, this is a good demonstration that you can write bad PHP in any language.

[Advertisement] Keep all your packages and Docker containers in one place, scan for vulnerabilities, and control who can access different feeds. ProGet installs in minutes and has a powerful free version with a lot of great features that you can upgrade when ready.Learn more.
Remy Porter