Hacker Newsnew | past | comments | ask | show | jobs | submit | vmsp's commentslogin

True. Google was even thinking of switching TensorFlow from Python to Swift.

https://github.com/tensorflow/swift


That’s really because Chris Lattner was at Google Brain at the time. Don’t think it ever took off in meaningful ways

I was enthusiastic about early TensorFlow in Swift efforts, sorry when the effort ended. My interest then flowed into early Mojo development for a while.

I wrote an eBook on Swift several ago but rarely update that book anymore. Count me as one of the many developers who for a while thought Swift would take over the world. At least Swift is a fun language to use, and now with LLM coding tools writing macOS/iOS/iPadOS apps is fairly easy.


funnily enough, I talked recently to someone working on the swift compiler (not an Apple employee) to make Swift functions differentiable. So its not all dead yet

Yeah, it seems something is still happening, they keep posting updates every now and then: https://forums.swift.org/t/differentiable-swift-feb-2026-upd...

As a Portuguese I have a more nuanced view of these type of takes.

We invested _heavily_ and prematurely in renewable energies -- see my comment from a couple of years ago [0]. Since then, our energy prices were high for a while and now they're not much lower than the EU's average because all that investment needs to be amortized [1]. Two years ago, we ran a whole month on renewables [2]. Despite this, our increase in energy prices since the Iran war started has been dramatic and the price of everything has been going up significantly. I can't help but think about the ROI on all those renewables if they can't help make our lives easier at a time like this. I'd much rather we go nuclear.

[0]: https://news.ycombinator.com/item?id=37719568

[1]: https://eco.sapo.pt/2026/03/11/precos-da-eletricidade-e-gas-...

[2]: https://www.portugalglobal.pt/en/news/2024/april/renewable-e...


Portugal needs battery storage.

It’s the best bang for buck. Australia, one of the world leaders in grid connected battery storage and it’s a reason prices keep falling there. https://www.theguardian.com/australia-news/2026/mar/19/power...

Can you imagine prices falling during an energy crisis, high inflation and datacenter build outs? Well it’s happening and pretty drastically in Australia.


Portuguese here. Of course we are still exposed to higher prices. Most of our car and truck fleet still runs on fossil. Notwithstanding all of the effort we made with renewable energy and barring the odd month where it reaches almost 100%, my typical invoice says that it is still just barely over 50% of the energy mix, so the other half will drive prices up. Moreover, we've had a ton of political pressure against building more dams, which would not only help increase our renewable mix, but would also help control the floods and prepare us for the droughts. Ironically, the pressure against dams has come from the left, which I've always felt to be lunacy. Finally, too many families still haven't transitioned from gas to electricity for water and home heating and, AFAIK, industry still relies a lot on gas for industrial energy (maybe, to your point, because electricity is still too expensive).

Having that said, I half agree with you concerning nuclear. I don't think we should have bet on nuclear as an alternative to renewable energy. In the long run, renewable energy will be more sustainable. For one, nuclear fuel is a limited resource, so we'll eventually run out of it. (Yes, kicking the can down the road sometimes is actually the best solution, but still). For another, since Portugal isn't uranium rich, we'd be trading one set of external dependencies for another. However, I am completely against the ideologically driven anti-nuclear political attitude that have and the fact that we've downright refused to accept any kind of nuclear energy projects whatsoever, regardless of whether those projects would be competing with renewable energy projects for investment. In fact I think that nuclear is the perfect companion to renewable energy, not a competitor. The more renewable energy we have, the less uranium we'd be importing, thus shrinking external dependency. Yet, at the same time, nuclear power plants would be a cheap, carbon-zero, solution to renewable energy's greatest problem, intermittency.

Just one final point. Unlike, for instance, Germany, with a large amount of territory with very low seismic risk, we would need to be very careful with where we'd build the plants. It would be complete recklessness to build a nuclear plant in Lisbon, for instance.


Does that comparison make sense? You're comparing investments into the national grid with energy prices set by international trade. Power is imported and exported all the time, and the lack of affordable fossil fuels abroad will put pressure on cheaper local prices.

I don't think going nuclear would've made a difference here. Someone is making a lot of money selling power locally for prices that only make sense in an international context. Whether that's done by wind farm operators or nuclear plants, the result will still be the same.


I was going to say that this is an unfortunate side-effect of how electricity is being priced in the market but I learned today that Iberian is not participating in the nordpool. Nordpool has this weird pricing model that pays every generator the price of the most expensive one that supplies the last watt of demand.

Regardless and despite this nordpool weirdness; with some rooftop & batteries I haven't been paying a cent for electricity outside of January so I don't need to care about prices in the market much at all.

I make a point to have my direct energy use be electric (e.g. for driving) so the recent jump in the pricing of molecules affects me relatively little. Unfortunately I don't have much say in indirect energy use (as used for food production) but I believe that people are rational and will figure they can do what I did sooner or later.


This is a completely normal way to price energy. It's called marginal pricing; price is set by the most expensive energy required to fill demand.

The idea is that on some schedule (e.g. each hour) you use the cheapest forms of energy you can to meet demand, but the final price is set by the most expensive one you had to use. This means that the cheaper forms of energy (i.e. renewables) make more money (which increase their profitability and can be reinvested). Obviously though we need better storage if we rely on renewables or we are almost always going to have to use fossil fuels at some point.

Whether there are better models, I will leave to people who know more than I do, but it is certainly a very common way to do this.


> Whether there are better models, I will leave to people who know more than I do, but it is certainly a very common way to do this.

It is fundamentally how the grid works. You can bring it down to a singular household or company level to see the raw incentives:

Why should a household or company with solar and storage buy expensive grid based electricity when their own installation delivers? They don't.

Why should this household or company not for example charge their battery on their battery when the price is low and sell/use it when the prices are higher?

Why should this household's or company's neighbors buy expensive grid electricity rather than the surplus of renewables and storage? They don't.

With the distributed electricity generation renewables enable monopolized grids no longer function. Because consumers have a choice and can vote with their wallet.


All energy markets that’s not monopolized or regulated run on marginal pricing.

It’s a fundamental fact of commodity trading.

Saudi Arabia produces oil at $12 per barrel. They sell it at the global marginal cost.


Nuclear is significantly more expensive on average. It is in no way an either/or question, you could have both. With 35% of energy being renewables, the country is still very much reliant on global energy markets, and it should indeed be a wake up call. If it was 100% reliant on qatari gas, the situation would be significantly more dire.

From your older comment:

> Our CO2 emissions are like 0.15% of the total and our per-capita emissions are already lower than for ex. Germany. We basically have no industry. If we could wave a magic wand and completely stop our CO2 emissions it wouldn't move the needle on global warming at all.

Well, it would move the needle by 0.15%. Portugal has 0.11% of the global population by the way.


Portugal is at the cheap end of EU prices. Of the ones lower several are just directly setting the price low by government fiat or subsidy.

Countries that have genuinely lower prices either built nuclear 40 years ago, or have great access to hydro they built 40 years ago or a bit of both.

Wanting to build nuclear now for cheap prices doesn't make any sense. It has the same high up front investment shape as renewables, except higher costs.


I know you dont to hear this, but theres just a hump to get over with this. Same with any investment. Youll be laughing 50 years down the line. Consider this a tree you might not get to sit under but will give shade to future generations

Probably a wise investment?

Why Portugal and Spain Dodge Europe’s Energy Price Shock: https://oilprice.com/Energy/Energy-General/Why-Portugal-and-...


Going nuclear in an earthquake zone is nuts.

> I'd much rather we go nuclear.

I think/hope you mean "I'd rather we adopt/use nuclear energy."


I don't think anyone was at risk of misunderstanding their intent...

Some of the people at 1600 Pennsylvania Avenue might willfully misunderstand.

I don't see any harm in either. Europe understands the need for developing self defence.

Not directly related to the post but what does OpenUI do? I'm finding it interesting but hard to understand. Is it an intermediate layer that makes LLMs generate better UI?

Its the library that bridges the gap between LLMs and live UI. Best example would be to imagine you want to build interactive charts within your AI agent (like Claude)

The most obvious approach would be to let LLMs generate code and render it but that introduces problems like safety, UI consistency and speed. OpenUI solves those problems and provides a safe, consistent and token optimized runtime for the LLMs to render live UI


Is it kinda similar to the new GenUI SDK for Flutter in that sense?

https://docs.flutter.dev/ai/genui


Haven't looked in depth but yes it feels like they are solving the same problem.

This is an alternative to json-render by Vercel or A2UI by Google which I'm guessing the flutter implementation is based on


Is doing stuff like constant folding pre-execution really worth it? I mean, won't the engine itself (V8, JSC, MozJS) be doing it anyway? I know that Google's Closure Compiler — probably still the most advanced JS optimized — also does it but I can't help but think it's probably pointless.


Stuff like constant folding won't take place until you hit an optimizing compiler tier. For the interpreter and baseline/template-compiler tiers, there's just not enough time to do that sort of dataflow optimization. So yes, it would help at least somewhat, esp. if you don't think the code is likely to tier up much for whatever reason (no one part is all that hot, or perhaps it's too polymorphic).


I'm guessing this is a fork of Facebook's abandoned library? https://github.com/facebookincubator/CG-SQL


From the repo: "Meta continues to make periodic ad hoc contributions to this fork and merge corrections back to their private repo. The maintainer thanks Meta for this continued informal cooperation."


https://0x1.pt/

I like to keep it simple.


Snapchat also maintains Djinni, used to generate type-safe bindings for C++ code. With Valdi, it seems like they chose to go another route.

https://github.com/Snapchat/djinni


I hear this and it makes sense but when I actually go about implementing it, it quickly falls apart.

Most apps are UI, remote requests and maybe some storage. What do you put in the common core? Android does HTTP requests one way. iOS does them another way. You go for the lowest common denominator an implement a third way, using libcurl or something?

Or do you just put business logic in the common core? Is there really that much business logic that doesn't issue requests or access a database?


Excellent Points, this is where the answer is "it depends".

> What do you put in the common core? Android does HTTP requests one way. iOS does them another way. You go for the lowest common denominator an implement a third way, using libcurl or something?

If it's really functionality that cannot reasonable be shared don't share it.

It's probably more work to maintain bindings to a single API client in the core and fiddle with all the details of not using the native HTTP client implementations that it is to implement the API client twice.

Writing the API client twice is boring, but that's a good thing.

> Or do you just put business logic in the common core? Is there really that much business logic that doesn't issue requests or access a database?

The shared core is optional. You might have the need for it, then it's a good solution.

For an app like snapchat you'd probably share the video effects and have that in your core library.


That's perfectly reasonable but, at that point, the argument becomes: build 95% natively and maybe there's a 5% "core" that warrants extracting into a common lib. Technically? That's excellent architecture. In terms of saving development time — which is where stuff like React Native comes in? Not so much.


There's an accompanying blog post at https://zserge.com/posts/fenster/

This author has some pretty cool stuff, like a tiny alternative to Firebase https://zserge.com/posts/pennybase/


There is at least two bugs in the blog post, here:

Next simple task would be to fill the complete framebuffer with a solid colour:

    memset(f->buf, rgb, f->width*f->height*sizeoof(uint32_t));
The first is the obvious typo around `sizeof`, which I didn't even see at first (edit: this).

The second is that code will only work for 8-bit colors, i.e. only the 8 (technically CHAR_BIT, "a byte") least-significant bits of `rgb` will be used. This is a quirk of the `memset()` standard C function, which has the prototype:

    void *memset(void s[.n], int c, size_t n);
but then the man page [1] says:

The memset() function fills the first n bytes of the memory area pointed to by s with the constant byte c.

[1]: https://man7.org/linux/man-pages/man3/memset.3.html


It will fill the screen with any of 256 shades of grey, for which r == g == b.


Neato! It's nice to find zserge around. He built upon the idea of my static site generator Zas [0] to create his own zs [1][2] a few years ago. I think he's still using it :)

[0]: https://github.com/darccio/zas

[1]: https://github.com/zserge/zs

[2]: https://zserge.com/posts/new-site-generator2/


No. This is a trend. HN is a tech and startups website so it will show trends. At one point it was VR, eventually it was Web 3.0. Right now it's LLMs but this too will pass and something else will come along.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: