News for hackers. Stuff that matters.
Re:Designing a Pure Python Web Framework by etskinner on Friday March 22, 2024 @03:45PM (#39794105)
Can you call it pure python if it compiles to React? Seems like the abstraction just makes it harder to debug
Re:Designing a Pure Python Web Framework by jph00 on Friday March 22, 2024 @03:57PM (#39794203)
All programming is abstractions, unless you're using machine code. Abstractions don't necessarily make debugging harder -- done the right way, they can make it easier.

(Yes, you can call it "pure python" if it compiles to something else, because every programming language compiles to something else.)

Re:Designing a Pure Python Web Framework by Terretta on Friday March 22, 2024 @05:16PM (#39794947)

    10100010 00000000
    10111101 00010011 00001000
    10011101 00000000 00000100
    11101000
    11100000 00101100
    11010000 11110101
    01100000
    01010010 01100101 01100001 01101100 
    00100000 01110000 01110010 01101111 
    01100111 01110010 01100001 01101101 
    01101101 01100101 01110010 01110011 
    00100000 01100011 01101111 01100100 
    01100101 00100000 01101001 01110100 
    00100000 01101001 01101110 00100000 
    01100010 01101001 01101110 01100001 
    01110010 01111001 00000000
Re:Designing a Pure Python Web Framework by dgfitz on Friday March 22, 2024 @06:15PM (#39795427)
“ �����,��`Real programmers code it in binary”
Re:Designing a Pure Python Web Framework by Retr0id on Friday March 22, 2024 @06:55PM (#39795704)
machine code is very much still an abstraction
Re:Designing a Pure Python Web Framework by paulddraper on Friday March 22, 2024 @07:01PM (#39795746)
> Yes, you can call it "pure python" if it compiles to something else

There is an idea that "pure python" means python + python runtime.

For example, pg8000 is a "pure python PostgreSQL driver", but psycopg is not.

Even though both of them only require Python code from their users.

Re:Designing a Pure Python Web Framework by picklelo on Friday March 22, 2024 @03:57PM (#39794200)
We need to compile down to React/HTML in the end as it's the only way to render a webpage. By "pure Python" we meant from the developer's perspective they won't have to touch React or Javascript.

We only use React for the UI layer and to send events. Since all the state/logic is kept in Python you won't see Javascript errors during runtime, and debugging can mostly be done in Python land.

Re:Designing a Pure Python Web Framework by kissgyorgy on Friday March 22, 2024 @06:32PM (#39795546)
Wow, you literally got everything wrong in this comment.

- There are a thousand ways to render HTML, you don't need React at all. Even for interactive pages (see recent alternatives like HTMX, or decade old solutions...)

- If it is converted to JS/React it's obviously not "pure" Python. Sorry, but that's just silly to say that.

- You will definitely see JavaScript errors during runtime, it's inevitable. Maybe not with simple toy projects, but with serious projects, it will happen and will make life miserable.

Re:Designing a Pure Python Web Framework by harkinian on Friday March 22, 2024 @06:45PM (#39795634)
I think they meant that rendering can only be done with JS/HTML, and if you want to use React stuff, React also has to be involved. No need to be rude and assume the worst.

Third point seems true though, I would definitely expect to see JS errors should any React libs have issues on their own.

Re:Designing a Pure Python Web Framework by pbronez on Saturday March 23, 2024 @08:57AM (#39799607)
Would you consider it “pure Python” if it targeted a WASM runtime for the browser side component?
Re:Designing a Pure Python Web Framework by eharvey71 on Thursday April 04, 2024 @09:49AM (#39930389)
Sounds RIGHT to me. You need a modern front-end framework like React.js if you want to avoid state / component hierarchy nightmares that you find by doing the same with vanilla JS. Also, the statement of working with pure Python resonates well from the dev perspective. Makes sense to me!