Rewrite the HA core in a compiled language

Python is good for integrations, but a compiled language is more suitable for the kernel, such as Kotlin or C

Thanks for playing, maybe next time! :rofl:

5 Likes

You seem to be under the impression that Home Assistant Core is running as an interpreted program. It is not. It is complied before release.

Not strictly true. See below.

From which version it begin compiled core?

Is it compiled or just put in a container as a binary release?

Compiling in the request context is about generating machine level code and just executing it at runtime.

Python source is compiled to bytecode (.pyc files) and then interpreted from that. Compilation is done either ahead of time (to speed up initial loading) or on the fly. Python is not compiled to machine code directly. Some implementations may then JIT compile the bytecode to platform specific MC on execution, similar to what the JVM does.

At least that’s how I understand it. I really don’t use Python much myself.

And let’s all appreciate the fact that this time, the OP did not ask for the inclusion of AI in a completely weird and inappropriate way into the process. There’s some progress to be seen here.

I liked the AI idea, can we do it? :slight_smile:

In fact, it’s great that there is jit, yes, here artificial intelligence could help, for example, Android has a baseline profiler that allows you to speed up the application startup time. You can run such a profiler on the most frequent screens, then symbols for such screens can be collected and thus it will help jit work. Machine learning can determine the most common tasks in the home assistant and help jit using such symbols.

Lol you have read his FRs before :wink:

Kotlin is a programming language for Android (i.e. mobile) development. Hardly suitable for server development.

C is more suitable towards driver, OS and compiler development (i.e. lower levels). Very few large-scale systems are built in C nowadays.

I get the point, but I need to cancel those two specific mentions.

Also, Python has had tremendous speedups over the past few releases. One needs to weigh up the scale of the project, maintainability, the ability to contribute and more. Integrations run directly on the core, so at this stage one cannot have the core in another language.

I would say given the system’s age and maturity it will probably be a massive waste of time and kill the community.

So, OP, burden of proof is on you: tell us where things are slow specifically. Nobody has time to rewrite things just for fun.

3 Likes

I read the FR again.

@nick2525 wants to rewrite the kernel in C? Talk to Linus Torvalds, suggest it to him, see what he says :slight_smile:

1 Like

Reminds of the other request submitted

This user’s entire post history is nothing but (mostly ill-informed) feature requests. Interesting reading if you like science fiction.

5 Likes

They’re entertaining ! :grin:

I am waiting Kotlin Multiplatform | Kotlin Documentation to support Python, and already written many letters to support Python, but they don’t want. It will be nice when backed, web, iOS and Android will be written in one language. It will allow no support feature mobile OS, if they will appear.

Please speak English.

1 Like

I’m sorry, but now I have an idea. This forum needs to have feature to translate into real English with the help of artificial intelligence. Also allow to choose a different character to express emotions in English.

That would be a feature request for the Discourse forum software, not Home Assistant.

https://blog.jetbrains.com/kotlin/2023/11/kotlin-multiplatform-stable/ Kotlin multiplatform now stable!!!

You really want this :slight_smile: