Hacker News new | past | comments | ask | show | jobs | submit | jurmous's comments login

Victoria Balva: she

Thank you. I did not read closely enough to get the gender correct, my mistake.

I am more enthusiastic with Kotlin also compiling to wasm with Jetpack compose and now working in all major browsers. It provides a full modern UI framework and also compiles to mobile and desktop. Code is also usable on server and if using the JVM fully interoperable with Java.


Try calling Kotlin co-routines from Java, fully interoperable is it not.

Additionally I really dislike the anti-Java discourse in Kotlin circles, as if Kotlin was able to stand on its own, without the Java ecosystem, or Google's making it Java replacement on Android.


I didn’t get a sense of anti-java-ism from the parent poster. While I enjoy Kotlin more than Java I see the benefits of both, and from most folks I’ve spoken to about the two they seem fairly level-headed about the situation.

I think that for all language discussion online that there is a very small percentage of people that get over-inundated by the emotional feeling of “investing their time” into a language and wanting to not feel like they made a mistake or that their time was a waste.

I wish f# got the same treatment Kotlin did tooling wise, because if I were to compare the “interoperability” of the two with the incumbent on their respective VMs, my experience has shown that developing with Kotlin incurs much less friction on a day-to-day basis.

I have no doubt that part of that friction is due to the radically differing foundations that f# vs c# were built on, which as a positive for f# gives it some very cool features that Kotlin won’t have, but it leads one to ponder the RoI of diverging from the primary language.

I do agree with you that googles choice to adopt Kotlin for android rather than invest further into modernizing the jvm capabilities to allow for Java to be able to keep up better was definitely a boost to Kotlin, I assume they made that choice in a calculated manner. I also wonder if Kotlin would be seeing as much server side use at places like Google, was, Airbnb, etc if not for that move on googles part.


FWIW interoperability of F# with C# has improved substantially.

For example, compared to GP comment on coroutines - starting with version 6, F# natively supports writing asynchronous code with task CEs that are based on the same Task<T> type as async methods in C#. Asynchronous sequences (IAsyncEnumerable<T>) can be consumed with first-party FSharp.Control.TaskSeq package and work both ways too (ironically, it's what prompted me to look into F# in more detail, noticing how much terser working with them was compared to C#).

F# mainly lacks the kind of push Kotlin gets by being first-class on Android. But at the same time F# has excellent tooling support with Ionide and FSAC which can be consumed from VS Code, Neovim/Emacs and anything else that works with LSP, and there are two separate commerical offerings with first-class support - Rider and Visual Studio. It is also shipped out of box with .NET SDK including F# interactive for scripting which I find very productive.

If I were to employ it in my team for a task F# is particularly well-suited for, it would be a low-risk change that would not require other contributors to take any extra steps to work with it - it slots right into the same solutions and most F#-declared types can be consumed as is from C#. The adaptation effort required for experienced developers should be minimal too.


F# interop support has gotten way better. I have several f# services (suave, giraffe) in prod and agree that things have been only trending positive. I write rider fsharp most days, which is a pretty good experience compared to the old days of the mono fsgen tooling taking up 100% of cpu on macOS for no reason.

However, there are still some huge gaps that Kotlin doesn’t experience. Source-generation based tooling created a divide between c#/f# libraries (see ef.core.fsharp), mixed solutions have problems with aot, he’ll I spent 2 hours trying to get z3 to work with f# for an old advent of code problem before just writing it in typescript.

F# would be the language I would default to for 99% of things if the friction wasn’t ever present. I just somehow hit it on every project I use it on


Great projects <3

I agree, source-generation is particularly unfortunate. I don't think it's a deal-breaker per se however - most of the time a small bindings project in C# is more than enough - I just accept it as a matter of life and get on with it, luckily it has not been particularly troublesome. Perhaps it's a bigger issue for people who would like to keep their projects C#-free (which is unfortunate, because C# is an awesome and productive language too).

The bigger issues for me personally is support for low-level primitives. Because F# has full HM type inference and of course gets to enjoy the same performance of struct generics as C# does - it is tempting to write HPC code for which C# can't infer the full generic signature the way F# and Rust can.

Unfortunately, however, in this specific area F# is outmatched because it has surprisingly less flexible pattern matching - list and array patterns in F# are bound to lists and arrays and you can't as easily match opaque objects, abstract classes or interfaces to a specific type with specific state inside, something that C# lets you do easily, where you can match, deconstruct, inline slice and unbox on any type that simply has the necessary "shape" without being bound to specific core types or interface implementations. You can work around most limitations with active patterns, but there is nothing that you can do that would give you `span is [var x, ..var rest]`.

Continuing the last point - C# has really pushed forward in making span-based and general performance-oriented code simple and idiomatic. In F#, the use of ref structs is much more restricted (please do not hold it against the team that works on it - it's a complex piece of functionality, just look at https://em-tg.github.io/csborrow/ as a start). As a result, F# is an extremely powerful and productive language that sits in an awkward spot where it is frustratingly close to being "the OCamlish Rust for .NET" thanks to its incredible type system, but at the same time if you do care about maximum performance with heavy data manipulation - you will be better served by C# still simply because it would take a lot of effort to make these specific areas in F# work just as well.

Important - these issues are _luxury_. Java ecosystem simply does not provide any alternatives due to limitations of the type system offered by JVM. So while indeed things could have been better, they do not have a proper alternative in Kotlin/Clojure/Scala at all, disqualifying them from certain performance domains completely.

On AOT - as long as you avoid printfn in F# and use string interpolation with Console.WriteLine and such you should be getting no AOT warnings. With library code it can be tricky, but it's usually caused by the abuse of un-analyzable reflection. You can always ping authors to perhaps take a look at it or use something better if available :) I'm enjoying AOC with F# and FSharpPacker too, but sadly don't have time to continue.


Agreed on c# having better low-level primitives available. I know Java has some long-term projects in flight (Valhalla and friends), but dotnet has all of that available today.

I’m curious in what industry you’re utilizing those features. I imagine you must be using mostly your own code since much of nuget contains things that don’t take performance as a first priority. I imagine it would be similar to the trading companies using Java where they toss out most of the standard library and most things on maven and create their own faster versions (which is also not dissimilar to gamedevs tossing out STL and making their own low-allocation libraries).


> I’m curious in what industry you’re utilizing those features.

Performance engineering for CDN systems!

> I imagine you must be using mostly your own code since much of nuget contains things that don’t take performance as a first priority.

This was my assumption too. While "much of nuget" trend continues to hold, there are actually quite a few performance-oritned libraries nowadays.

Bindings and binging generators (that are near-zero-cost), managed allocator implementations, high-performance parsers and serializers (which completely wipe the floor with alternatives written in flimsy languages like Go), higher-level APIs for graphics libraries (DX12, Vulkan, ...), high-performance primitive libraries, game engines, and more.

You are correct to point out that performance-sensitive code tends to avoid standard library containers and certain APIs, but CoreLib itself has been exposing quite a few APIs (like ArrayPool) and tends to practically always offer Span<T>-based method overloads so the data can reside in any memory if it needs so (stackalloc, array pool, unmanaged, or anything in between).

Sure, if you have a hot path you will probably avoid using List<T> and StringBuilder in favor of something less allocation-heavy, but it's generally the Unity land that is subjected to pain of fighting with every allocation rather than .NET itself.


While true the type system is a problem on the JVM world, that is taken care by the plethora of choice of implementations, some do include extensions.

Also while .NET is great and I favour it over Java when having the option, it is a guest on mobile OSes constrained by platforms FFI API surface, or subpar APIs (Catalyst on macOS), and Meadow isn't at the same level as PTC, Aicas, microEJ and many other embedded implementations.


I didn't target the parent poster, rather the community in general.


TeaVM supports Kotlin as well. The difference with Kotlin/Wasm is that with Kotlin/Wasm you are limited only to Kotlin and can't use any code written in Java.


Just like Option+Space for ChatGPT app on macOS. Seems to become the default AI shortcut


I have built a React Native app in the past. Nowadays I would go for Kotlin Multiplatform. It is already the primary language on Android and now it is possible to create native binaries on iOS. With Compose multiplatform it also has the ability to also share UI code with a declarative syntax on multiple platforms.

I think React Native was the go to place in the past but it has been surpassed now.


For me it is because I don’t wear lenses and learned to move the phone a bit further away during the scan to make it eorl in bed. It works every time


MacOS does not allow kernel extensions anymore so these kinds of crashes cannot happen. The falcon client on Mac hooks into another layer


MacOS does not allow kernel extensions anymore luckily


This is why we need to accelerate renewables and energy storage.


If we ever make large enough batteries to satisfy our on-demand energy whims, then I'm 100% with you.

I just have doubt that we will get there soon with battery tech, and nuclear seems like a rational dropin solution until then.


It already takes longer to build new nuclear starting now than build enough renewable + batteries + transmission starting now. So good news! We don't have to "get there soon", we are there already! We have everything we need except the political will to take resources away from fossil fuels and invest them towards a clean energy future.

Nuclear will continue to be built and it should but it is not the thing we need to focus heavily on.


Japan's mean time to build nuclear is under 5 years, I believe.


And how long from proposal to breaking ground? And how many can we build at the same time? Can we find enough sites or extend existing ones enough? What problems will we have with water shortages for cooling? And so on.

We are, thankfully, going to continue to build nuclear all over the world, perhaps most importantly in places like China where they may convert thermal coal plants to nuclear, but it's going to be a relatively small part of the energy mix overall and is not going to solve the doubt that the poster had and my original response was aimed at. Renewables + batteries + transmission, and I should add efficiency improvements, can do it now, at scale, and faster than we can imagine.

https://archive.is/s9dQh


We need all of the above. Including reducing overall energy use. We cannot afford to leave any option on the table.


There are no rich countries that are also energy poor. You cannot reduce energy use without reducing quality of life.


The United States, Canada, France, Germany, Japan and the United Kingdom have all reduced their per-capita energy usage since the peak (earliest peak usage was UK in 1973, latest was Canada in 2007), and I think we can argue that quality-of-life (by at least some metrics) has increased since then.

https://ourworldindata.org/grapher/per-capita-energy-use?tab...


And where do they stand worldwide? Still higher than all the third world countries eh?


Not really.

Let's use the UNCTAD definition of developing countries - there are a number of countries which exceed Canada's per-capita energy usage (the highest of those I mention above) - Qatar, UAE, Trinidad and Tobago and Kuwait.

But those are all small countries, the highest per-capita energy usage by a larger nation is Turkmenistan (exceeding all of the European countries mentioned in the parent - UK, France, Germany - and Japan).

But that's not really the point. Doubtless there is a correlation between energy usage and standard of living. But it's not a 1:1, and there are some huge benefits to be gained - e.g. the US (77,028 kWh / person / year) has triple the usage per capital of the UK (28,501 kWh / person / year). Even in Europe, France and Germany could reduce their usage by a quarter to bring it to the UK level.


Where are you getting your data?

For instance, I’m showing about 2.6 MWh/ye per capita for Turkmenistan [https://data.worldbank.org/indicator/EG.USE.ELEC.KH.PC?locat...], below the world median of 3.1MWh/yr.

Also, those high usage small countries (including Trinidad and Turkmenistan) are huge oil producing countries where energy is subsidized to an absurd degree to ‘buy’ population compliance. That energy is coming straight from burning hydrocarbons.

They still are way below the big developed countries, near as I can tell. Sorting by ‘most recent value’, the list is pretty much either ‘huge petrokingdom’, or ‘highly developed nation’ until Estonia/Slovenia/Netherlands at 6.something MWh/yr.

The data does seem to be old though!

I am impressed by Spain’s low usage, but they culturally also minimize things like HVAC - since they were ‘civilized’ long before AC was a thing. They still are about 2x the median.


I’m using „our world in data“ - the link in my first post.

A difference may be that my figures are not just electricity, but „primary energy“, defined as:

„Primary energy includes energy that the end user needs, in the form of electricity, transport and heating, plus inefficiencies and energy that is lost when raw resources are transformed into a usable form.”


Ah, that makes sense - it’s doing the ‘tons of oil energy equivalent’, which those countries are petrostates/petrokingdoms which typically have things like free (or nearly so) gasoline, natural gas, electricity, etc. as part of the gov’t popularity equation.

Which those states need to do that typically because they don’t really care about any actual quality of life improvements, or developing any other parts of the economy.

Because why bother, when you can do those other things more easily, it makes folks dependent on the gov’t, and it avoids things like people being more educated and independent and asking tough questions about those in power.

So I guess I should amend my comment - ‘except for countries where the gov’t is incentivizing free unlimited petro energy due to gov’t policy, quality of life still roughly tracks energy consumption and availability’.

Though then we’d need to argue about what quality of life really means - most Spaniards would top most Americans in physical and mental health in my experience, for example. But Americans definitely have more stuff.


This slightly mad take seems very popular with people who at the very same time seem to hate cheap solar and wind energy and love expensive (and/or nonexistent) nuclear and fossil fuels.

It's a really weird subculture that's grown out of climate denial.

Energy efficiency is a thing. The lowest hanging fruit is EVs and heat pumps that provide 4x more travel or heat than using fossil fuels directly. They're so much more efficient that you could burn the fossils in power plants to generate electricity and still come out ahead. That would be silly though since wind and solar are the cheapest available electricity.

And of course you can power these with nuclear, which would be relevant if they weren't just pretending to like nuclear and really just stalling progress for fossil fuel interests.


> ho at the very same time seem to hate cheap solar and wind energy and love expensive (and/or nonexistent) nuclear and fossil fuels.

Now this is a mad take

> Energy efficiency is a thing.

Yes, it is. There's a limit to how efficient you can go though

> The lowest hanging fruit is EVs and heat pumps

What do you think will happen to the power grid when everyone switches to EVs?

> That would be silly though since wind and solar are the cheapest available electricity.

They are also intermittent sources of electricity.

> if they weren't just pretending to like nuclear and really just stalling progress for fossil fuel interests.

Another mad take.

All in all you never addressed my post


> What do you think will happen to the power grid when everyone switches to EVs?

Well the people who run grids keep suggesting that it'll help them make better use of their grid assets and so reduce the average cost of a kWh of electricity to consumers. It is after all a giant fleet of smart batteries.

But you, the person who thinks more energy use is better for society, are apparently making an exception for electricity use, which if it goes up will cause some unspecified calamity?

That doesn't seem very consistent? Well, I suppose it's consistently pro-fossil fuels.


> Well the people who run grids keep suggesting that it'll help them make better use of their grid assets

Do they? Or are they also concerned about the increasing strain on grid infra, especially due to the fact that so many energy sources are now intermittent?

> which if it goes up will cause some unspecified calamity?

It's not an unspecified calamity. Failure modes for grids are known.

> Well, I suppose it's consistently pro-fossil fuels.

Funny how you accuse others of making mad takes while keeping doing one mad take after another


> Yes, it is. There's a limit to how efficient you can go though

This is why reducing energy use needs to be in addition to everything else: solar, nuclear, wind, batteries, the works. Some of the R&D won't work out as planned; some solutions will only work in specific situations. That's okay, as long as we don't have all our eggs in one basket.


We have the battery tech, it's called a hydroelectric dam.


Isn't the point of using renewables so we don't destroy the environment?


Have you made a comparative analysis of how much a dam vs lithium mines destroy the environment?


The orders of magnitude needed for storage are not competitive with nuclear in any reasonable scenario.

Nuclear exists and is proven technology. Battery storage at the capacity and price scale required are not. That remains true even if you want absolutely to believe we can't build nuclear reactors faster than in 10 years, and we almost certainly can by starting mass producing them again.


> However, the company warned in Tuesday’s report that the “termination” of some clean energy projects during 2023 had pushed down the amount of renewables it had access to.


Here in Utrecht the Netherlands they are trying to greenify the city to reduce heat stress during the hot months. They try to plant as much trees and plants as possible, they try not to mow grass often and let it grow, they encourage homes to remove tiled gardens and add green, they have programs to turn roofs into green roofs.

I like it, the city feels nicer to life in.

https://healthyurbanliving.utrecht.nl/fileadmin/_processed_/...

https://healthyurbanliving.utrecht.nl/our-vision-for-utrecht...

https://aiph.org/floraculture/news/utrecht-is-crowned-the-ne...


Same in Zurich, where the city tries to establish a “Schwammstadt”. But the tree growth is actually negative, because on private properties people are chopping down their trees to build lucrative housing.


If you look at bellevue i personally think it's disgusting, that loveless massive sechseleutenplatz, lot's of cars always using the horn, what a waste of that iconic place constricted between traemli and a always busy street, tbh even Delhi is less stressful, let alone Vienna.

EDIT: Do you mean Schwanstadt right? That lovely smell of birdshit in the sommer plus the massive stink of piss and puke after (and up to 10 days) streetparade is the pure soul of Zurich ;)


No, he means "schwammstadt" (sponge city), the concept idea that you need to create the capacity to soak up excess rainfall and store it like a sponge instead of relying on drainage entirely.

https://en.wikipedia.org/wiki/Sponge_city


Which isn't a bad idea generally, but for cities like Zurich (and its sister city Geneva which is the same also in this regard) there isn't much need - it sits at the end of a massive lake, most of the city center isn't much higher than lake itself.

Effect of the lake subsides somewhat with distance form it, but it definitely creates its own micro-climate thats always colder and more humid than further away from it. To have more high trees that prevent all that tarmac, concrete and stone from heating up during day is definitely a plus, but these cities are not some scorched Phoenix, AZ equivalent.


Berlin, one of the leading cities in Germany on those concepts is located on two rivers, plenty of canals and between a few lakes. Hamburg is another very active place and it's close to the seaside, with a huge river and plenty of water in the city. A lot of concepts refer back to city planning that Kopenhagen started after a massive rainfall event in 2011 - a city which is fairly flat, has a large river front and plenty of canals.

Still, there's need to evaluate such city planning concepts because the lakes and rivers do not solve all of the problems associated with heavy rainfalls and drought cycles. They do nothing to handle the runoff if you get massive rainfalls in a short period of time because the water management gets overwhelmed. Also, city trees do not benefit substantially from the high ground water level and still suffer in drought.

So while not all of the concepts ideas may be applicable to Berlin, Hamburg, Kopenhagen, Zurich or Geneva, concepts like green roofs, local water storage etc. are still required to respond to the incread frequency of high rainfall events and increasing summer temperatures.


I'm so old I can still remember when Sechseleuten Square was green grass, now replaced with searing heat assemblers of stone....so even the city is working against that sponge thing, but yeah it sounds good from a politician's mouth.


It's a relatively novel concept, though the problems of replacing open surfaces with stone slabs and asphalt could have been obvious decades ago :(


Ah, but you see, stone slabs and asphalt cost nothing to maintain. /s

(...Even this is, of course, untrue, but it seems true when you're only paying attention to the next year or so.)


Just 17 milion swiss franks made out of "Valser Quarzit" and a "fountain" that needs constant maintenance because it has to be drinking quality instead of lake-water, just look at that sh*t:

https://aquatransform.ch/projects/sechselaeutenplatz-opernha...

EDIT: But please don't waste energy otherwise (your politician)


Zürich needs Lärmblitzer against pointless revving and honking.


Or a bridge/tunnel before bellvue, and make the whole bellvue+niederdoerfli up to hauptbahnhof carfree...just imagine that! But yeah you are right with those Lärmblitzer too.


I live at the boundary between city and forests and in summer the temperature drop is really 'incredible'. The amount of energy wasted by urban areas is as much so. But at the same time it's nice because we can restore more trees for shade easily


I live in foothills of a lower range of hills (European Jura), and it has numerous effects. The air is normally blowing down the mountains towards us in the evening (katabatic wind), so it doesn't matter how hot the day was, evenings are pleasantly cool and night gets colder than expected. This wind also cools hot surfaces pretty effectively.

Even just entering a dense natural forest during the day, one can sense drop in temperature around 3-4C during summer, and increase in humidity during dry periods.


Lived in French Jura for 5 years. It is so beautiful. And I am not the only one to have noticed. The Last Man or Frankenstein have also the Jura mountains as landscape.

I miss that place... (except its prices)


> katabatic wind

I've noticed this while doing evening walk, I didn't know it was a named phenomenon.


Paragliders like me (or similar sports) have to be very familiar with meteorology and wind, its the most important but largely invisible force that can literally make you or break you.

I love that overreach expected by a passion like that, meteorology is fascinating to engineer in me and its effects are very much visible every day and affect us all.


Since I've been bike commuting I've become more in touch with climate. For the simple need of avoiding rain. You start to pay attention to wind, direction, clouds .. it's strange cause you have to think more but it's also funny because you're sharper and smarter in a way. And that's just noob / surface level :)


Portland, OR, has similar green roof code mandates, as well as tree replacement laws as well... although there is pressure from "developer-friendly" electeds to suspend these mandates. Boo for being short-sighted.


I live there as well, and while I'm sure it could be worse, it's nothing compared to Johannesburg. I would like to see much more green throughout the city. Hopefully they will keep up the trend.


Well they are still in transition. My street is next. They will plant quite a bit more trees and plant areas. Looking forward to them :)


Sounds nice but it seems to be all at the cost of personal freedom of movement. That's a shame.


that made me want to live there lol


The Netherlands already banned smartphones from schools since January 1st 2024

https://www.iamexpat.nl/education/education-news/netherlands...


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

Search: