Live data from Hacker News

React, but in Python

github.com

111–120 of 179 posts

Re: React, but in Python

#111

I created something like this inside a tech giant once. It never saw the light of day with regard to usership. It's good to see someone doing the same in the open source world. A brief summary of what I did: * Python-powered apps, like this * React was used to handle lifecycle. Basically, I avoided writing any kind of lifecycle management because I just wanted to do exactly what React would do. This was achieved via…

Oh, I had a case where I had built an ML based recommendation app, and utilized Flask for serving the results on my localhost. Would have loved to use React but my lack of sufficient JavaScript knowledge prevented me from doing so. Your tool seemed to have perfectly catered to my needs!

Re: React, but in Python

#112
post #88
post #83

Earlier quoted context omitted.

TS is a joke tsc is the only compiler I've had to step through with a debugger multiple times. No DS/ML researcher wants to deal with VM args just to use more than 1GB of memory. That alone would cause so much frustration. Not to mention unpredictable generational GC. Or the crazy crap people do with the type system (what you call better other people call a mess). At least Python has some semblance of runtime type sa…

> TS is a joke I'll discuss facts > tsc is the only compiler I've had to step through with a debugger multiple times. 99.9% of Typescript developers never ever had to do that. Sounds like a "you" problem > No DS/ML researcher wants to deal with VM args just to use more than 1GB of memory. That alone would cause so much frustration. You're talking about NodeJS, which is just one of the many JS engines. It's also 200%…

> I'll discuss facts

> the insanity of

welp, so much for that.

Re: React, but in Python

#113
post #109

might just use pyxl4, by dropbox or Guido himself. https://github.com/pyxl4/pyxl4 example: # coding: pyxl from some_module import x_user_badge user = User.get(some_user_id) content = Any arbitrary content... print {content}

This is what's missing from the reactive-python project IMO.

A huge draw for React is that it _extends_ the JavaScript Syntax. If you still had to compose your React components with a bunch of nested `React.createElement('Component')` calls (instead of ``) it wouldn't be nearly as useful.

Re: React, but in Python

#114

Earlier quoted context omitted.

My experience of doing maths in JavaScript was terrible. Fairly simple things like [1,2] Is that fixed by Typescript, or does it inherit all those kinds of weird JavaScript behavior?

I don’t get the example - how is it obvious what should be the result of comparison of 2 lists ?

In Python, when comparing lists using the less than (The first element of each list is compared, and if they are not equal, the comparison result is determined based on the comparison of the first unequal elements.

In this case, [1, 2] and [10, 2] both have different first elements (1 and 10). Since 1 is less than 10, the comparison result is True.

The second element of both lists (2) does not affect the comparison result because the first element is already sufficient to determine the outcome.

[1, 2] < [10, 2] evaluates to True.

Re: React, but in Python

#115

I created something like this inside a tech giant once. It never saw the light of day with regard to usership. It's good to see someone doing the same in the open source world. A brief summary of what I did: * Python-powered apps, like this * React was used to handle lifecycle. Basically, I avoided writing any kind of lifecycle management because I just wanted to do exactly what React would do. This was achieved via…

Oh, I had a case where I had built an ML based recommendation app, and utilized Flask for serving the results on my localhost. Would have loved to use React but my lack of sufficient JavaScript knowledge prevented me from doing so. Your tool seemed to have perfectly catered to my needs!

Dash could probably get close enough as well. It's a bit limited compared to React but provides quite a lot of interactivity. (Plus, the server is stateless which is nice.)

Re: React, but in Python

#116
post #88
post #83

Earlier quoted context omitted.

TS is a joke tsc is the only compiler I've had to step through with a debugger multiple times. No DS/ML researcher wants to deal with VM args just to use more than 1GB of memory. That alone would cause so much frustration. Not to mention unpredictable generational GC. Or the crazy crap people do with the type system (what you call better other people call a mess). At least Python has some semblance of runtime type sa…

> TS is a joke I'll discuss facts > tsc is the only compiler I've had to step through with a debugger multiple times. 99.9% of Typescript developers never ever had to do that. Sounds like a "you" problem > No DS/ML researcher wants to deal with VM args just to use more than 1GB of memory. That alone would cause so much frustration. You're talking about NodeJS, which is just one of the many JS engines. It's also 200%…

>Also: GIL.

javascript is terminally single threaded, with the only solution being either multiprocessing and message passing, or cooperative multitasking style promises/async. This is not a situtation where javascript pulls ahead, as hard as python seems to try to fall behind.

Re: React, but in Python

#117

Earlier quoted context omitted.

I don’t get the example - how is it obvious what should be the result of comparison of 2 lists ?

In Python, when comparing lists using the less than ( The first element of each list is compared, and if they are not equal, the comparison result is determined based on the comparison of the first unequal elements. In this case, [1, 2] and [10, 2] both have different first elements (1 and 10). Since 1 is less than 10, the comparison result is True. The second element of both lists (2) does not affect the comparison…

What's the use case for this?

Re: React, but in Python

#118
I love this project. Having used Streamlit and Plotly Dash a lot, I find this project imposes fewer constraints. That said, it didn't support my target browser so I wrote my own and in the process (re)discovered fine grained reactive (e.g. solidjs) as an improvement over the VDOM. Anyway, the outcome was a similar approach but supporting the Kindle's browser. https://github.com/esensible/silkflow

Re: React, but in Python

#119

Earlier quoted context omitted.

Firefox's Devtools uses React and it doesn't use JSX. Example: https://github.com/mozilla/gecko-dev/blob/aec3a901e6f6b3041b... Their reasoning: https://firefox-source-docs.mozilla.org/devtools/frontend/re...

That page is very out of date. They did later adopt a build step and switch to using JSX in much of the FF DevTools codebase. As an example, here's the Editor main component (same "latest" commit you pointed to): https://github.com/mozilla/gecko-dev/blob/aec3a901e6f6b3041b... The codebase is a mish-mash of very old-style React+Redux code, with newer files and usages. (I know this because I work at Replay.io, which st…

You're right, I totally missed they have tsconfig which include jsx preprocessor now. Too bad the devtools contributor documentation is not updated anymore, mozilla devs are probably stretched too thin to update obscure docs these days.

Re: React, but in Python

#120
post #71

Controversial, but I think that rather than trying to make Web stuff (e.g. React) work in Python, a more fruitful direction would be to make ML stuff (e.g. PyTorch, OpenCV) work in Typescript. Javascript/Typescript is way faster than Python, is ubiquitous and can run pretty much everywhere, has many engine implementations, has an incredibly wide ecosystem, has a type system (Typescript) that blows any Python type sys…

My experience of doing maths in JavaScript was terrible. Fairly simple things like [1,2] Is that fixed by Typescript, or does it inherit all those kinds of weird JavaScript behavior?

> Fairly simple things like [1,2] What other languages, besides Python, does this builtin list comparison work in? What's the result when the comparison is `[1, 2] < ["10", "2"]`?
Post reply on HN