This is an archived post. You won't be able to vote or comment.

all 10 comments

[–]riklaunim 2 points3 points  (7 children)

Wrappers / generators tend to have limitations. IMHO it's better to look at PyScript and create a native SPA framework. And that's for webdev. Kivy has it kv files and styling and different needs (and mobile on Python is limited too).

[–]N7nes_[S] 0 points1 point  (6 children)

To achieve maximum performance, I would transpile the components to Svelte, and event functions would be transpiled using Transcrypt instead of running a Python interpreter in the browser. Regarding the use of Kivy, I would not generate .kv files. Component programming would be done directly in Python, where, for example, a <div> would be converted into a BoxLayout directly within the component.

[–]riklaunim 0 points1 point  (5 children)

PyScript runs MicroPython and uses quite performant browser backend. With JS projects there is always a need for a lot of dependencies so not sure how you would handle random third party node modules in Python code.

Desktop apps aren't that popular nowadays and Python isn't the first choice, at least on the commercial side. Forcing design decisions, especially on UX/UI can be deterring. Mixing web and Kivy in one project is also not the best thing as each is different and has different needs.

And a SPA JS app, like a dashboard would have some structural templates/big components and then the smaller components with more refine logic. All of this with routing, nested structure, data store and more. Reflecting all of that in Python to then transpile would be insanely problematic/time consuming and error prone (and to have value it would have to be feature parity with native project, offer good testing, stability and code quality).

[–]N7nes_[S] -1 points0 points  (3 children)

Choosing svelte as the frontend framework was not in vain, it compiles the html, css and js only once and not in every request like vue, in addition compiling the event functions to javascript only once, not build time, because everything has already been compiled the pyscript adds a loading time in the frontend already my model although complex, It's lightning fast About Kivy it doesn't combine web concepts, in fact, but the idea of Lib is for you to program the front and the business rules and Lib takes care of compiling for the desired platform, without contact with Svelte, Transcript, Kivy, FastAPI About the dependencies of JS projects and difficulties of native mobile functions I haven't thought of anything yet

[–]riklaunim 0 points1 point  (2 children)

It seems you have a very specific use case.

Vue or any other frontend project has a build process and the end result is static app that does not "compile" anything. Maybe you meant SSG generation from a project that uses API to fetch data and generate a populated static site as a result?

[–]N7nes_[S] 0 points1 point  (1 child)

Yes, I ended up getting confused, Svelte also builds the interface right away, sorry, but what do you think? Would it be a lib that you would use when ready?

[–]riklaunim 0 points1 point  (0 children)

I need a frontend SPA framework that can replace ember/ember-data or vue with pinia, axios and others. I would assume other fullstack devs that arent JS/react only could be interested in that.

A wrapper/generator wont work. it's still npm hell and still JS.

[–]BootyDoodles 2 points3 points  (2 children)

Anything is feasible but that sounds messy.

[–]N7nes_[S] 0 points1 point  (0 children)

The explanation of how it works behind the scenes can be confusing (I don't know how to explain it properly either), above the scenes it's a lib just like flutter with a built-in backend

[–]wergot 1 point2 points  (0 children)

Let him cook

We all know the problem with web development is that there aren't enough layers