Тёмный

PyScript - Run Python in the Browser! THE END of JavaScript??? 

Patrick Loeber
Подписаться 273 тыс.
Просмотров 368 тыс.
50% 1

PyScript is a framework that allows users to create Python applications in the browser using HTML. In this video we have a look at it and I show you how it works:
Resources:
- Website: pyscript.net/
- Blog: engineering.an...
- GitHub: github.com/pys...
- WASM in 100 seconds: • Web Assembly (WASM) in...
Get my Free NumPy Handbook:
www.python-eng...
✅ Write cleaner code with Sourcery, instant refactoring suggestions in VS Code & PyCharm: sourcery.ai/?u... *
⭐ Join Our Discord : / discord
📓 ML Notebooks available on Patreon:
/ patrickloeber
If you enjoyed this video, please subscribe to the channel:
▶️ : / @patloeber
~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~
🖥️ Website: www.python-eng...
🐦 Twitter - / patloeber
✉️ Newsletter - www.python-eng...
📸 Instagram - / patloeber
🦾 Discord: / discord
▶️ Subscribe: / @patloeber
~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~
🅿 Patreon - / patrickloeber
#Python
----------------------------------------------------------------------------------------------------------
* This is an affiliate link. By clicking on it you will not have any additional costs, instead you will support me and my project. Thank you so much for the support! 🙏

Опубликовано:

 

28 сен 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 795   
@dydufjfbfnddhbxnddj83
@dydufjfbfnddhbxnddj83 2 года назад
i cant believe this, neither can i imagine the complexity of the code in the pyscript's CSS and JS files. These guys are real legends!
@ryanchowdhary965
@ryanchowdhary965 2 года назад
It's like saying Javascript will end tomorrow.
@edmondmovsisyan2224
@edmondmovsisyan2224 2 года назад
@@ryanchowdhary965 Definitely won't. JS was built from the ground up for browsers + the speed of JS is unmatched.
@soushi8885
@soushi8885 2 года назад
@@weakspirit_ I think WASM is build in complementarity with JS, not with the idea to replace it. For example, you can do most of your front end app in JS and use WASM (with Rust for example) only for critical parts.
@hasnaindev
@hasnaindev 2 года назад
I mean yeah but no. Any higher level language that you see is usually written in a medium or lower level language. PyScript is written in JS, nothing really surprising but imagine this, PyScript runs on JS, JS runs on V8, V8 is written in C++ and lets you do stuff. This is just an additional and unnecessary step. I really hope PyScript doesn't really become a thing. Right now, it's going to be slower even more than JS. For browsers to natively support this would take years if not a decade. Would've been better if the compiler was written in Web Assembly. Not sure how big or small the bundle size would be with Web Assembly though.
@vectoralphaSec
@vectoralphaSec 2 года назад
The fact that its made by the Anaconda team puts me at ease that its here to stay and will only improve with time. Pretty awesome, the future of web dev is changing so fast.
@adnaanmansuri6151
@adnaanmansuri6151 2 года назад
gonna i
@p13i
@p13i 2 года назад
LOL same feeling
@kingleo429
@kingleo429 2 года назад
Long live the king
@kingleo429
@kingleo429 2 года назад
Long live the king
@jakubkoj1
@jakubkoj1 2 года назад
Its a cool project, but there is no way this is the future of web dev.
@miletadulovic577
@miletadulovic577 2 года назад
Guys, before talking about how it can replace JS please check PyScript-s performance. Python by itself is kinda slow, and this makes it even slower. For example, it tasks about 1s to print current datetime. Also, why would data scientist need library for web? No, I don't think it will replace JS any time sooner, if ever. Also, I don't want to think about XSS attacks and similar stuff.
@AtomicCodeX
@AtomicCodeX 2 года назад
You said what I didn't feel like commenting
@dmsalomon
@dmsalomon 2 года назад
This is just a proof of concept. If the browsers decide to support if properly the performance will be better. Will it replace JS? Obviously not, but it could be very useful in certain applications, i.e. data science on the web. And WASM seems to be the future, but that is also still a long way away
@epochshot589
@epochshot589 2 года назад
@Bakunawa python is leagues faster in compilation speed then js, main because hoe the language is structured.
@nethsarasandeepaelvitigala135
@nethsarasandeepaelvitigala135 2 года назад
@@CanKorkmazim that dude is butthurt lol, he's sappming everywhere saying js is slow
@IvanRandomDude
@IvanRandomDude 2 года назад
WASM has been around for years and there are even Rust, C#, Kotlin etc. front end frameworks... and they did shit to JS. So short answer is no
@randyt700
@randyt700 2 года назад
i find your lack of faith disturbing.
@tommycard4569
@tommycard4569 2 года назад
@@randyt700 he's right tho... If someone is simply interested in "writing python", you can just use code mods to transform the python syntax to js. python has already been accessible to wasm for a while now, you don't see it often cuz it simply doesn't make sense for most things (especially at scale)...
@admniyeokuyorsun...3044
@admniyeokuyorsun...3044 2 года назад
Developers: we want webassembly and faster page loads to eliminate the need of desktop development Also developers: lets add even a slower scripting language in another py2js interpretion layer and also don't allow the code to be minified for production since python relies on indentation. Also developers: we hate javascript but it pays the bills Personally: typescript, sass, nextjs and mongodb atlas or cockroachdb cloud for the win
@Hopp3rTx
@Hopp3rTx 2 года назад
scrolled down for this, 10/10
@7sete777
@7sete777 2 года назад
Tho I'm a JS developer, that is sooo cool. It'l not replace JS, but i think it will bring more ingenious Python programs (not focused on speed) to run on the web. I didn't think of the minifying/identation issue, tho replacing identation with \t might do the trick
@hasnaindev
@hasnaindev 2 года назад
"... and also don't allow the code to be minified for production since python relies on indentation." Damn!
@swaggitypigfig8413
@swaggitypigfig8413 2 года назад
Not the end of JavaScript for sure, but a cool project nonetheless.
@swaggitypigfig8413
@swaggitypigfig8413 2 года назад
@@scott_itall8638 Same here, but I don’t believe that it would ever be as performant as JS. Decades of work has gone into making JavaScript run as fast as possible on modern web browsers. That amount of work is not something that can be outperformed even in a whole decade, in my estimation.
@JS-ys2uk
@JS-ys2uk 2 года назад
@@swaggitypigfig8413 but I runs on webassembly, right? Have you ever seen the speed of a Blazor application?
@nonamepetko
@nonamepetko 2 года назад
@@JS-ys2uk from what I have seen it gets parsed from python to JavaScript from JavaScript to wasm this takes a whole 3 minutes to generate the code for print("Hello world") it may be fast when compiled but the compilation will take an eternity with anything with more than 1000 lines of code and you need to wait till all the shit compiles so it doesn't have something JIT at least yet....
@redymotion9991
@redymotion9991 2 года назад
@@scott_itall8638 javascript > python idc
@mohamedtrfnx6632
@mohamedtrfnx6632 2 года назад
@@nonamepetko no it gets compiled directly to wasm
@antoniopena1183
@antoniopena1183 2 года назад
Incredible. It's one of the best news I have had in these last two months. And it's also backed by a big and professional team, like Anaconda's one! Hope this video is watched by more ;)
@benjaminscherrey1124
@benjaminscherrey1124 2 года назад
That's really great. Anaconda team keeps innovating!
@dragonsage6909
@dragonsage6909 2 года назад
Very cool, thanks for bringing this to my attention.. Digging in. Ty
@Mesyv
@Mesyv 2 года назад
This is just javascript which converts Python to js...
@sheikhakbar2067
@sheikhakbar2067 2 года назад
Okay, I am for that ...... I don't want to learn javascript!
@mohamedtrfnx6632
@mohamedtrfnx6632 2 года назад
No its not its python compiled to wasm
@Mesyv
@Mesyv 2 года назад
@@mohamedtrfnx6632 please explain more
@ZadkielDower
@ZadkielDower 2 года назад
wow! What's next? Quantum computing in the browser... I see it in the future. this is very nice
@DevlogBill
@DevlogBill 2 года назад
Now all we need is Golang to develop web site capabilities as well. Sorry recently tried out GO and I kind of like the language. Only thing is, is Golang ever going to become popular, I hope so.... But Golang is so new. I know this isn't about Golang but Python, but Golang is similar to Python from the little experience I had with it, and it is also a very powerful language to learn, it is a low lever language and simple to write with.
@antonzizic3483
@antonzizic3483 2 года назад
wouaouw !! what crazy stuff is going to append within 2 years with this new tool ? python in the browser is a milestone for web developpers. It's a bit like if a second javascript was born but with an insanely large community already in place
@AxiomTutor
@AxiomTutor Год назад
This looks incredible!
@kwlt7061
@kwlt7061 Год назад
I'm interested in your demonstration codes. But I don't know how to get the exact code you typed in the video clip here. Please let me know if you have extra moments. I like your works.
@darkDRAGONmind117
@darkDRAGONmind117 2 года назад
wait ... what ? how freaking cool is this. So lets build something. just yesterday I get made because I want to make a dashboard in Excel. this is now the better solution :).
@MdAlAmin-xj1km
@MdAlAmin-xj1km 4 месяца назад
I use wordpress custom html block to add calculator any other thing that I built using html, css and js code. Now can we use pyton code also in wordpress?
@jorge1869
@jorge1869 2 года назад
Excellent video. I have a question, how will new packages be installed in pyscrit with pip?
@mjj2u2
@mjj2u2 2 года назад
Great video. Pleas consider making a follow-up with forms.
@DenisovichDev
@DenisovichDev 2 года назад
A word on your clickbait title. If writing a script in something other than pure JavaScript that first gets compiled into pre ES6 JS anyway means "the death of JavaScript" then JS died way back in the jQuery days in 2010s. There is no doubt that this framework is really great and the anaconda team deserve an applause, but I really can't help but feel disgusted by clickbaits like this
@Idle826
@Idle826 2 года назад
I have a question dear friends! Is there a way to create a downloadable file with pyscript? I would like to be able to do this because it would simplify what I am doing. Thanks!
@JS-ys2uk
@JS-ys2uk 2 года назад
I don't know much about this stuff. Does this mean I can manipulate the DOM with python?
@AtomicCodeX
@AtomicCodeX 2 года назад
Nope lol
@Misscrazy3957
@Misscrazy3957 2 года назад
Wow Sir, you made it simple for me, Thanks, thanks, thanks 🙏. This is super 😎.
@133sjassson8
@133sjassson8 2 года назад
Does it uses Client-side or Server side CPU power? Is it possible to save server computation resource with this ?
@cedricleblanc
@cedricleblanc Год назад
I have a multi files script to run and I need to import pygame. Can I do it with this method ? In fact, I'm trying to make a chess game on my wordpress website, and I don't want to pay €40/month to use their python plugins
@mangelozzi
@mangelozzi 2 года назад
The CDN pyscript javascript files is 1.2MB. A pity browser can't just bundle in python support in addition to javascript, e.g.
@ericchhun8116
@ericchhun8116 Год назад
Can someone help me with this? Um... when I use pyscript with html and then run the program, it doesn't show the output, It just shows the python code. Like it will just display print ("hello world") instead of "hello world". If someone can help me fix this that would be great. I'm on windows.
@ultrasalted
@ultrasalted 2 года назад
Nothing can replace core javascript
@PythonicAccountant
@PythonicAccountant 2 года назад
Holy crap!!! Amazing!!!!
@noyo62110
@noyo62110 9 месяцев назад
Great ! Thank you !!!
@fraidoonhu9284
@fraidoonhu9284 2 года назад
Long live JavaScript!!! No one can beat JavaScript. Everyone is jealous of JavaScript because it's the only language used in frontend. Whatever you do whatever language you use at the end it needs to be transpiled to JavaScript JavaScript you are the king. Whatever comes will need to kneel in front of you.
@kecoakgaming
@kecoakgaming 2 года назад
Yea but annoying to use
@l5248
@l5248 2 года назад
Yeah, but I don't really see that as a positive. Javascript is lackluster at best and so are its built-in APIs... if it was actually good then we wouldn't be using a gazillion libraries like React and languages like TS. Transpiling and minifying just adds extra overhead and bloat. But yeah, this Python library won't solve any of that, so I agree with you to a certain level lol.
@LuminousWhispers11
@LuminousWhispers11 2 года назад
Do not confuse annoyance for jealousy. The only reason why it is the only language that works in the web browser is because someone was already using it in their web browser. You could legitimately put almost any language in its place. I would like it though if TypeScript became supported by or the standard for browsers though.
@camdenmiller7127
@camdenmiller7127 2 года назад
Its not a great language by any means, its just what you use. I just couldn’t live without things like threejs so im stuck w JS
@DrunkenUFOPilot
@DrunkenUFOPilot 2 года назад
Death of Javascript? Not if pyscript runs so slow. But then, this is just the beginning. For Javascript to be replaced by anything sane would make me happy! I'll be watching this project.
@bufkinsmith7650
@bufkinsmith7650 2 года назад
Why wouldn’t I just write my code in Python and then compile to WASM if I wanted this? Isn’t there going to be a significant difference in performance if it’s just straight Python?
@sammyay-man2754
@sammyay-man2754 9 месяцев назад
Didn't work for me. Can you help me?
@RubixCubed3
@RubixCubed3 2 года назад
I dont think js is ever going away. There is just too much dependency on it. But the fact that this is even possible is very exciting. It will be interesting to see how this evolves. I see full stack Python webapps in the future.
@neociber24
@neociber24 2 года назад
Is just like C, you can't het rip of C
@NoName-kt3ny
@NoName-kt3ny 2 года назад
@@neociber24 Yes, you can not, there are still a lot of things are coded in C.
@apuji7555
@apuji7555 2 года назад
@@avid459 nope, web assembly isn't even meant to replace js, its means to work in performance-required places, and really only there.
@sparshgoyal231
@sparshgoyal231 2 года назад
I see Full-stack developers with no dependecies on Java or JS
@rand0mtv660
@rand0mtv660 2 года назад
@@avid459 People have been saying WASM will replace JS for years now. It won't happen for many years (if ever), even with expanded capabilities of WASM (DOM and IO).
@StarOnCheek
@StarOnCheek 2 года назад
instead of they should have ideally used but i do see how that was not possible assuming that the py-script tag is probably a web component
@PeterWang99
@PeterWang99 2 года назад
This would be many more characters to type, for beginners/novices. And we have many other web components, e.g. , , etc.
@rafagd
@rafagd 2 года назад
Well, is probably the most compliant way. Novices will be copying it anyway, number of characters is irrelevant.
@StarOnCheek
@StarOnCheek 2 года назад
@@rafagd true, I have not written raw html in a long time that I forgot about those. Can I edit my comment?
@unique-317
@unique-317 2 года назад
is how brython does it, also idk why people so excited about py-script, brython brings python to the browser and has existed for years
@deaddoctor
@deaddoctor 2 года назад
@Quezako I don't think it will ever be natively supported by browsers because Javascript and the huge economy of tools around it were developed over years and people tend to always just the most convenient way. Also, it's the professionals who change the industry and they already know how to use Javascript very well. At least that's my guess, but who knows?
@Ricardoromero4444
@Ricardoromero4444 2 года назад
"The end of javascript" Is always coming according to everyone... but It's not going away anytime soon
@duckmasterflex
@duckmasterflex 2 года назад
Javascript will always be faster and leaner
@AndrewTSq
@AndrewTSq 2 года назад
@@duckmasterflex yeah, and python also eats alot of memory for me
@pliniojr95
@pliniojr95 2 года назад
I just started to learn JS to use it in front end. Imagine the frustration of learning a language and seeing it be replaced by another one within a short span of time.😂
@AmandeepSingh-cv5qz
@AmandeepSingh-cv5qz 2 года назад
@@pliniojr95 same here
@Ricardoromero4444
@Ricardoromero4444 2 года назад
@@pliniojr95 Don't worry man Js won't be replaced by anything anytime soon. Maybe in another 15 years... but by then we will all be coding in natural language or some weird visual interface
@diegorocha2186
@diegorocha2186 2 года назад
They should invest more time in improving wasm so you can use wherever kind of language you're confortable with. Imagine if you could easily manipulate the DOM through wasm, this will really change web development!
@PutlerXLO
@PutlerXLO 2 года назад
Just imagine that you have been able to manipulate the DOM with normal JS for 25 years :D
@blendergaming1579
@blendergaming1579 2 года назад
It's just what we need! To know vanilla javascript, typescript, html, css, scss, styled components, react, next, angular, sql, document dbs, rest, graphql, linux, docker, cloud providers, python or bash, and other programming languages! How about something that simplifies web development instead of adding complexity and more skills employers want to add to their 100 item lists for developer and cloud jobs?
@mstalcup
@mstalcup 2 года назад
@@PutlerXLO Thank you!
@brymstoner
@brymstoner 2 года назад
imagine if you could just reverse proxy any language to a web page; oh wait, you already can.
@realalphabet
@realalphabet Год назад
It is already possible to retrieve a DOM node in Web Assembly from a JavaScript function. And native functions if you want, as long as there is a bridge to convert between data types. Allowing WebAssembly to execute native functions on its own would represent a technical security challenge. Not to mention the fact that it would be work for nothing. Because yes, the native functions would also have to be modified to support the WebAssembly equivalent, since these functions expect handles of JavaScript variables.
@simonmafanye.3537
@simonmafanye.3537 2 года назад
Wish we could have a dedicated Python Frontend Framework..... Can't wait to experience that.
@SkyyySi
@SkyyySi 2 года назад
React.py, Vue.py, AngularPy, ... Oh no
@ryanchowdhary965
@ryanchowdhary965 2 года назад
@@SkyyySi *everyone liked that*
@codingcrashkurse6429
@codingcrashkurse6429 2 года назад
@@SkyyySi Well we will see how this works out. React etc. are quite advanced technologies with virtual dom usage and had a large community growing over years backed up by large corporations. I don´t see python killing JS in the browser so quickly. But I see some nice opportunities for libraries or frameworks for maybe smaller projects and small corporations with no frontend and backend teams. Everybody knows the title is clickbait a bit ;-)
@lutfiikbalmajid3128
@lutfiikbalmajid3128 2 года назад
@@SkyyySi oh no, i must be ready replace to react.py
@RikThePixel
@RikThePixel 2 года назад
0.0 Did I hear someone say Reacthon
@Ma1ne2
@Ma1ne2 2 года назад
This is a really cool project, but honestly the only reason I can see for using it is bringing awesome python libs like matplotlib, pandas, sympy etc. to the browser. For the rest I see no reason or need to use it, the javascript ecosystem is huge and powerful. Why would any frontend developer switch to the python apis if he or she is comfortable in the js apis? Only thing is that this makes the web more accessible for python developers and lowers the threshold to get started with frontend development for them. That's a good thing for sure, but it won't change the industry imo.
@zacharyelliott7161
@zacharyelliott7161 2 года назад
I don't think many professionals will but as someone almost competent at python and not good with php or js this is great.
@heroe1486
@heroe1486 2 года назад
For the same reasons tons of devs are using node on the backend while there isn't really any reason one would want his backend in JavaScript, they just want to only use one language for both be and fe. Well tons of people are still actually using python on the backend and switch to JS for the fe, if a framework like React with python was good enough I could see myself trying it. These days you actually write tons of logic in the front end so wanting python is natural and goes beyond the inability of some for writing js.
@Ma1ne2
@Ma1ne2 2 года назад
@@heroe1486 The only difference being that JavaScript is tightly integrated and standardised in the browser. The APIs developed over years, as well as the frameworks and libraries around it. It will take Python years or decades to catch up with this. It is based on a compilation to WebAssembly which is fast and great but also these binding have to develop over time and improve to reach the level of flexibility JavaScript offers today. I am just saying there is a lot of work to do and no real upside for any current web developer to switch. As I wrote in my first comment, that is not the case for new python developers coming to the frontend, which is great. But for them it will be a long way to establish the kind of ecosystem JavaScript has today.
@barodrinksbeer7484
@barodrinksbeer7484 2 года назад
I sort of agree. However, I would rather use R and Python together if I'm using data manipulation and visualization packages. R also already has a good foundation for HTML presentation through markdown.
@themathforyou
@themathforyou 2 года назад
There is another reason if python game developers wants to import their games to the online web.
@ivanbgp
@ivanbgp 2 года назад
"It will take a few moments" ... I see we get the full python experience in the browser 😅
@lbb2rfarangkiinok
@lbb2rfarangkiinok 2 года назад
Muhahahahaha
@krtirtho
@krtirtho 2 года назад
Congratulations, now I can execute my DOM code more slowly🙂
@nethsarasandeepaelvitigala135
@nethsarasandeepaelvitigala135 2 года назад
@Marcus - you know Python is far slower than JS right? tell me you're joking
@khgytd
@khgytd 2 года назад
@@nethsarasandeepaelvitigala135 That actually depends, you can code modules using C python API that will increase speed close to compiled languages speed. Althought, i don't know if this is impacted, since this have a JS framework on the middle.
@tomaslachmann171
@tomaslachmann171 2 года назад
So basically you write python, that's translated into javascript. Sure thing, that this is future, because js is already so fast to easily compile code and we need one extra step.
@ieatthighs
@ieatthighs 2 года назад
this is just stupid, it's basically a client side transpiller which is a horrible idea
@coffe7190
@coffe7190 2 года назад
@@ieatthighs you know what is horrible? js, what a shit programming language
@theaninova
@theaninova 2 года назад
I mean... I get it, for use cases where you really need specific Python packages... But not without some SERIOUS performance issues. This comes from just the Hello World Example 1. 290 kb of CSS and 300 kb of JS dependencies 2. 7 *MB* for the Python interpreter 3. 1.2 *MB* for dependencies Just for a Hello World example. Unless this gets built into browsers natively, you're absolutely gonna KILL your site's performance. Almost 9MB you can't get rid of is an INSANE amount of data, and on top you're running a Python interpreter in webassembly. Use sparingly when you have no alternatives left.
@xpkareem
@xpkareem 2 года назад
I guess I'd like to see more focus on just making python compile to webassembly really well.
@gggiiia147
@gggiiia147 2 года назад
end of javascript? of course not ahah
@DanhWasHere
@DanhWasHere 2 года назад
Interesting find but the clickbait title is leading to a lot of dumb comments about Python replacing JS -it’s clear that this is a Python to JS compiler so JS will always be used as the end result. Just importing a bunch of Python files in the index.html file will get really hard to maintain and code-split which led to JS web frameworks and libraries being adopted and now widely used. So definitively JS is not being replaced by PScript and JS web development positions will not magically be replaced with Python. I know you understand it, it’s just for the annoying people always thinking there is some war of dominance for which language to rule them all. Best thing as usual to learn both JS and Python, and decide which one is best suited for your case. PScript will be super useful for Python data scientists wanting to create a website that is not just a hosted Jupiter notebook, and lots of other applications that will be exciting to see!
@underling-macha-greentea
@underling-macha-greentea 2 года назад
I believe it compiles to wasm/binary and not js, but correct me if I’m wrong. But you are right that WASM will not kill js, more and more web assembly projects come with functionality to fluidly use both together at the same time. This gives you the best of both worlds as you can leverage native js engines in the browser and wasm languages for complicated data science or physics engines (rust).
@astronemir
@astronemir 2 года назад
It doesn’t compile to js! It complies to HTML! Then Webpack takes care of the rest.
@PeterWang99
@PeterWang99 2 года назад
This is NOT a Python-to-JS compiler. This is *actual CPython*, but compiled to WebAssembly.
@irustv7674
@irustv7674 2 года назад
in not long future python kill js and react
@mansurhamidoff1853
@mansurhamidoff1853 2 года назад
@@irustv7674 It sounds very funny 🤣🤣🤣🤣🤣 Only one who have no idea what is web ui development and javascript can talk such nonsense... Even php which has so many alternatives is not dead yet... JS has no alternative in web front end development. This is great tool... It's really great tool without any joke, but it will be useful for lazy python developers who don't want to strain their asses to learn js
@realalphabet
@realalphabet Год назад
"The end of Javascript". For educational purposes, if you remove the V8 runtime from your browser your script will no longer work. The video is intuitive despite the title, don't do this. It has already been demonstrated many times by many contributors of Python, Chromium and Mozilla that Python is not suitable for the Web. Anyway, people are used to using JS which is undoubtedly the language of the Web and will never be replaced simply because it would break more than 3/4 of the current Web. Also, the V8 JIT compiler performs better than the Python one, I base this on my own tests as a JIT compiler developer. And it is optimized for the web to reduce the memory footprint, unlike Python which was not designed with this in mind. If you want to use Python on the Web only because you miss Tensorflow and Keras, either follow the documentation and install them locally, or wait a few months until the GPU Web API and other machine learning APIs are available on Chrome. This will be much more efficient than using a port of the Python runtime in WebAssembly. At least 10 times more.
@Netrole
@Netrole 2 года назад
It is a nice idea and might be awesome for the hard core python fans. But my concern is that this sacrifices the user experience in exchange for dev experience, which is certainly the wrong way around. After all, each user has to download the python interpreter, and the code will run a lot slower than javascript, since python is not optimized by the browser. Additionally a lot of pythons performance comes from super fast packages like numpy that are written in C, however these are slowed down significantly through webassembly. Because under the hood webassembly uses the same VM code as javascript, so WebAssembly performance == JavaScript performance.
@benjaminscherrey1124
@benjaminscherrey1124 2 года назад
I think the point is that you can be a "full stack" web dev and need only code in Python. That's pretty amazing. No one is suggesting that all python apps should now run in a browser.
@I_Lemaire
@I_Lemaire 2 года назад
@@benjaminscherrey1124 No. You still need JS
@mohamedtrfnx6632
@mohamedtrfnx6632 2 года назад
no not every user has to download the python interpreter what are you on about and wtf do you mean by WebAssembly performance == JavaScript performance LOL
@Netrole
@Netrole 2 года назад
@Marcus - Yes and no, WASM has some performance benefits, but peak performance is the same as peak performance for JS. WASM is more consistent and it is easier to maintain peak performance, while javascript can have performance bailouts where it drops back to being interpreted which is a significant slowdown. WASM also has the performance benefit of compiler optimizations. Overall what i wanted to say though is, that WASM is significantly slower than the C implementations used in regular Python. And that a well written javascript implementation is just as fast. Actually a well written javascript implementation might be faster because it has access to the javascript "standard library" like Array.sort() which execute highly optimized assembler code in most browsers
@naveenkumar-sd5uo
@naveenkumar-sd5uo 2 года назад
Created using javascript and still talking about killing javascript! Get out! People spent their most life learning javascript and related frameworks and just starting their career and then guys like you come and say kill javascript and learn python! That means I have more burden to lift when applying for a job!
@alexandrecostadosim6847
@alexandrecostadosim6847 2 года назад
When I think about python front end, components as objects comes to mind. PyScript reminds me Kivy in some ways, a great project that is always "experimental"
@sadkebab
@sadkebab 2 года назад
The fact that we can run in the browser python through WASM is cool for trivial stuff but I don't know... There are already so many issues and concerns about bundle sizes and performance in all JavaScript frameworks that I can't imagine how messy it can get with PyScript if people will start to use it for general-purpose Web Development.
@hououinkyouma5372
@hououinkyouma5372 2 года назад
They won't. Not yet anyway. This will give AI/ML guys something new to tinker with, but I definitely don't see it being professionally used in web dev anytime soon. Especially given how you have to download an entire CPython interpretor for WASM on every single page refresh :/
@theregionale
@theregionale 2 года назад
@Hrishikesh Malviy not on web
@theregionale
@theregionale 2 года назад
@Hrishikesh Malviy both JavaScript and python are interpreted languages
@ehabaleid1093
@ehabaleid1093 2 года назад
Wow, very excited on what this becomes in a few years. Lot's of potential for big data visualizations.
@barodrinksbeer7484
@barodrinksbeer7484 2 года назад
I took a look at it, its super interesting. However, right now it seems to much of a mixture of things, I still was using JS when I tried integrating a simple target practice game. I can see useful reasons to have Python integrated into HTML. However, I don't see this doing better then JavaScript.
@hououinkyouma5372
@hououinkyouma5372 2 года назад
Naturally. This is a prime example of "doing it because you can". Besides, downloading a huge CPython interpretor on every page refresh is just not following any of the web dev practices. I suppose this will give AI/ML guys some new things to tinker with, but it'll definitely not be used for web dev. Not yet anyway.
@kibe2134
@kibe2134 2 года назад
As someone who works with both JavaScript and Python, I can assure you that even though this is a nice proof of concept, no front-end developer in their right mind would ever touch something like this. The JavaScript ecosystem is just so much more mature than Python's that it's basically impossible to catch up at this point. Think about the different between NPM and PIP. One is a proper packages manager, the other doesn't even handle requirement files decently. Other example would be, say, the import systems in both languages; JavaScript's is concise, efficient and easy to understand, meanwhile, Python's is a mess. I understand that a lot of people will always try to use anything for the web but JavaScript in the same way that americans will measure with anything but the metric system, but at some point they will have to understand that it is, and will continue to be for the foreseeable future, the best language to build interfaces. Period. It's the language's purpose, and it's why people will use it everywhere. Web? JavaScript. Mobile? JavaScript with React Native or Cordova or Ionic. Desktop? JavaScript with Electron or Tauri or (who remembers?) NW.JS. I mean, if we're really being honest, the reason augmented reality is not mainstream os probably because there's no JavaScript frameworks for it. Don't get me wrong, I love Python, and as of now, it's my main source of income, but it's simply not meant to compete with JavaScript in the the things JavaScript is good at. TLDR; if I ever see a job offer from a company that has this in it's stack, I'll know to stay away from it, for they're clearly out of their minds.
@FilipCordas
@FilipCordas 2 года назад
Even if this Python in the browser is years old you can make a case for this not as a UI thing but as running backed stuff in your app. Things seam to be going the web components way that means a lot of UI frameworks will be usable for Python in the browser. Don't get me wrong Python is the worst language out there to use for anything so the issue not being a good way to do things has never been a problem for Python dev's. This should just work in Electron and Cordova and tauri... since it's just WebAssembly. And mixing JS and Python is already done in notebooks since most of the charts are just wrappers for JS plotting libraries.
@FriedMonkey362
@FriedMonkey362 2 года назад
The reason you probably get no bi1ches is because there is no JavaScript for it
@danielstill5625
@danielstill5625 2 года назад
What about just viewing this as a more flexible version of Jupyter notebooks? That was my impression when trying to today. The customisability HTML and CSS provides will enable a great UI for the output of python code.
@yukcoding4155
@yukcoding4155 2 года назад
As data analyst starter with web development background this is the wonderful world just run your whole projects in html without need to js
@happywednesday6741
@happywednesday6741 2 года назад
Cool rant. It will take a year or two to catch up if its adopted at python like scale. Not arguing if it's better, just arguing you underestimating just how popular python is.
@robbietorkelsonn8509
@robbietorkelsonn8509 2 года назад
I think most of the people aren't understanding the true impact something like this would make possible: "In other words, PyScript allows you to use Python, with or without JavaScript, to build interactive websites that don’t necessarily have to communicate with a server. " In other words, you could have a photo sharing website, with nothing on the web server. Which means you don't need to login to flickr or instagram to do photo sharing, because there is no backend and the sharing could be done peer to peer (like torrents). Which also means you just need a directory on a server that just serves files, without any further intelligence. This has been an idea for a long time now.
@G-33k
@G-33k 2 года назад
This is very exciting, Thank you for informing us about it, now as pythonistas we must contribute and build a community about pyscript :D
@mostafahana1713
@mostafahana1713 2 года назад
Python interpreted with js .. I can imagine the execution time !!
@dbenn8742
@dbenn8742 2 года назад
Great, because Skulpt was so successful. Its a JS script hence 'interoperability with JS.' Python to Emscripten compiler. It needs JS, how would it replace it? Go home python, youre drunk.
@jasusyb2734
@jasusyb2734 2 года назад
Firstly, Python sucks without curly braces. Secondly, I didn't see any major advantages for Python to work in browser than JavaScript.
@luc7106
@luc7106 2 года назад
python will never replace javascript.
@kalpanatimsina0515
@kalpanatimsina0515 2 года назад
Next thing in life, (future) you will see people working in it and getting unbelievable good. Thus, it will become a meta (just predictions).
@robertoportfolio1378
@robertoportfolio1378 2 года назад
My guy no one users javascript these days all you see is react react . 90% of the front end developers are scared of javascript I don't know why very hard to find a full stack development tutorial using pure javascript
@prodigyprogrammer3187
@prodigyprogrammer3187 2 года назад
This is a really interesting project
@ajinkyax
@ajinkyax 2 года назад
A language you can't even write in Notepad where a wrong space can wreak havoc on your code, and for someone who have not heard of Typescipt or Dart, it is yes definitely Python is great
@k.chriscaldwell4141
@k.chriscaldwell4141 2 года назад
Absolutely great video! Thanks. Thanks to the PyScript team, and associated, as well. This will be big down the road. And what an easy implementation.
@StellarWeb008
@StellarWeb008 2 года назад
Noobs use python. Coders love JavaScript.
@cantedit9285
@cantedit9285 2 года назад
ratio
@90AMAA
@90AMAA 2 года назад
if there is any apocalyptic for javascript any soon, i think would come by dart not pyscript
@madhankumar2051
@madhankumar2051 2 года назад
I can see this getting big , but def not replacing Java script
@amrendrakumar9018
@amrendrakumar9018 2 года назад
All code showing in page source...can you tell me something about it..
@heyyvishal1
@heyyvishal1 2 года назад
Meanwhile JavaScript developers be like.. "Let them come" 😌
@movieidiots5542
@movieidiots5542 2 года назад
This is game changing. If i had this 3 years ago, my clients project would have been finished in 1 month instead of 6.
@hannad
@hannad 2 года назад
All the computation it does in runtime to transpile and run python is ridiculous. No production app will ever use it
@movieidiots5542
@movieidiots5542 2 года назад
@@hannad Its a good point. I tested the pyscript library implementation. Its not that fast. it was good enough to send a message to the queue and process them. Nothing time sensitive was there.. We had to switch to webhook implementation to support python library to handle messages to devices. So adding extra server to handle the messeging queue was the effort which added our development time.
@AbinashAdhikari
@AbinashAdhikari 2 года назад
yeah it will be 10 times slower,
@hannad
@hannad 2 года назад
It’s a good project. But instead of runtime if there was a build step in between. Or server side rendering which runs python and outputs html and js that would still be a good option
@jowniemand2514
@jowniemand2514 2 года назад
I sure hope NOT. JS has its challenges, but it was born in the browser and has its natural habitat there. One of the most obvious reasons that Pyscript will have a tough time upending JS, is that Python is NOT a free-format language, whereas JS is a free-format language. You can type an arrow function in JS in one line. Try and do that in python! This also means that mini-fication is a challenge which the Python ecosystem is not going to make possible. What will happen is that these will co-exist as cousins in the web browser. Server-side the issue is not the same. I am not a Python developer, but the little I know is that it is good, but not angelic enough to replace JS. Lastly, years ago it was possible to use other scripting languages, not just Javascript in the browser in the script tag by specifying a different language name in the script tag. In the old days there were VBScript & JS, but also others (I cannot remember as this was more than 20 years ago), but I tested it and it worked for more than 2 languages. So JS has eliminated its main rival VBScript in a fight that has been going on for a few decades now.
@paulthomann5544
@paulthomann5544 2 года назад
uhm... arrow functions came in ES6, aka ES2015, if i'm not mistaken. lambda has been part of python since 1994. Just saying :) console.log(materials.map(material => material.length)); would be something like print(map(lambda m: m.length, materials)) I like JS arrow functions better though, because their body can be an entire block of code and doesn't need to evaluate to a value. The minification argument is valid - no getting around whitespace in python. Anyway, i doubt there are more python than JS developers. If that were the case, we'd long have native python support in browsers.
@anandsuralkar2947
@anandsuralkar2947 2 года назад
@@paulthomann5544 there are more python developers than js , and we still wont and cant have native python browser support bcz infra structure is already too mature we would need to start the whole internet structure from scrap
@MrTrollland
@MrTrollland 2 года назад
tf_are_u_on_about = lambda a, b: a + b tf_are_u_on_about(1, 2)
@lutfiikbalmajid3128
@lutfiikbalmajid3128 2 года назад
Since web only know html, js, and css. I am pretty sure, py script is compiled to JavaScript at all
@deaddoctor
@deaddoctor 2 года назад
it is
@gayming195
@gayming195 2 года назад
I love Python, but Python is not good for complicated applications. It's complexity when it comes to anything beyond simple synchronous scripting is a major stumbling block. I'm not saying Python is a bad language. It is really freaking great for research and scripting. And it's really freaking easy to learn, but it is not an adequate replacement for C, C++, C#, Java or JavaScript. Consider that even though Python is largely used to program machine learning, the actual core of machine learning libraries that do all the complex work are never actually built in Python themselves. It would be silly to build it in Python, it's simply too complex and too slow. It's much easier and more performant to build it in another language and then add a Python interface. Now consider a Python interpreter built in another interpreted high level language like JavaScript. This makes Python even less efficient and therefore even less desirable for an application like web development. If it's not already slow enough you are also losing the best part of JavaScript, the thing that makes it even usable at all for web development, asynchosity! Everything in JavaScript is event driven, Everything in Python is synchronous. This makes Python excellent at executing simple commands for research and hardware control, but an absolutely terrible choice for web development where nearly everything is event driven. TL;DR Python is a great choice for research and a poor choice for web development
@kensyjolicoeur
@kensyjolicoeur 2 года назад
Plz stop saying the end of JavaScript.
@pihie
@pihie 2 года назад
Soooo…… 0:12 0:37 0:43 1:06 1:19 1:37 1:45 1:50 1:52 1:55 2:03 2:11 2:20 2:38 2:49 2:56 3:00 3:10 3:13 3:21 3:27 3:41 3:51 3:52 3:54 3:59 4:11 4:24
@anonymousking5929
@anonymousking5929 2 года назад
This inst end of JS because pyscript is made with js.
@nodirbeksharipov458
@nodirbeksharipov458 2 года назад
ahh yes, much needed confusion for the front end, like we never had any
@erielmejias7160
@erielmejias7160 2 года назад
That's like PHP, it is going to be a MESS! xD
@yuli2042
@yuli2042 2 года назад
I'm a python developer. I really hope the python community can instead focus on those actual important issues such as adding a null-chaining operator or a a functioning type system.
@codingcrashkurse6429
@codingcrashkurse6429 2 года назад
Well, Anaconda is the behind this project and they are heavily in Data Science world and this projects suits perfectly. a type System is something also would also really like, but this actually has to be driven by "money" like TS for JavaScript. I am even not sure if that´s even a thing discussed.
@paulthomann5544
@paulthomann5544 2 года назад
Hehe, nothing stopping you (as a member of the python community) from working on those.
@yuli2042
@yuli2042 2 года назад
@@paulthomann5544 There is. PEP 505 has not been accepted.
@badass6300
@badass6300 2 года назад
You can also run C# in the browser thanks to Blazor and I'm pretty sure Java had an alternative as well.
@kafuialordo1193
@kafuialordo1193 2 года назад
Cool tool to build a more resilient Python focused application with, but NOT ending JavaScript in anyway.
@nickfla1
@nickfla1 2 года назад
Interesting but still skeptical. I wonder what performances could be achieved on real life application. Hope the web doen't take the wrong route once again
@nickfla1
@nickfla1 2 года назад
​@@codingcrashkurse6429 Had already looked at the code, pyodide is the actual engine behind pyscript. It's a wasm porting of CPython, performance might be quite ok but I can't see any benefits other then using _some_ of the Python ecosystem directly on the frontend. My biggest concern is that people start building applications with these libraries and create an even more bloated web
@nickfla1
@nickfla1 2 года назад
Also we should really give the credits to pyodide's team! pyscript it's really just a component-based wrapper, useful but not the "ground breaking" technology here
@d.sherman8563
@d.sherman8563 2 года назад
@@codingcrashkurse6429 This is not true, the python is compiled to web assembly and executed as that.
@exukvera
@exukvera 2 года назад
Call me back when you talk about events. A python code run by the press of buttons will surely help us ditch all those horrible JS scripts.
@archyt88
@archyt88 2 года назад
This is very cool, but what about security? If anyone can create shell inside your html like in jupyter, they probably also can get access to database by this methods. Hm..
@patloeber
@patloeber 2 года назад
very good question! It's in a very early stage so this is for sure one important thing the developers have to work out!
@awdawd8979
@awdawd8979 2 года назад
Because it's built in JS/WebAssembly, even if you could get a shell, it's all client-side, so I wouldn't worry about getting access to databases and the like.
@puffin_000
@puffin_000 2 года назад
@@awdawd8979 This is even worse :D. Hackers can implement their malicious script in python code and run it on the client (something like xss, but the target is client instead of the server), this is an really BIG issue that needs to be working on more, also pyscript is not big enough to be used in a real project. Its really really new and in early stage but its still exiting.
@michaelbitzer7295
@michaelbitzer7295 2 года назад
@@puffin_000 why is it a problem if someone writes something in python instead of js? Pyscript CANT do more than js because it is a mix of js/wasm running in the browsers sandbox.
@puffin_000
@puffin_000 2 года назад
@@michaelbitzer7295 Because problem is compiler, the python code is translate into javascript code and if somebody don't know how to write js they can't detect vulnerability.
@thecutedreamkostasp.4449
@thecutedreamkostasp.4449 2 года назад
The end of js? Best try of joke i have seen last 20 years
@mobilelegendbachaoibaba7875
@mobilelegendbachaoibaba7875 2 года назад
Can you show video of an OpenCV example of it?
@sepking73
@sepking73 2 года назад
So PyScript is JS? Then how can JS go away?
@THETRUTHZ
@THETRUTHZ Год назад
My question is... what can py do for me that java can't?
@Rwaket
@Rwaket 2 года назад
"...so for this we need NodeJS..." - lol))
@snopz
@snopz Год назад
Can we install python libraries on it? ?
@davies8183
@davies8183 2 года назад
The last time I did a python project, I had to implement most of my logic in C to make the performance bearable to users. I think python should just stick to data science. Wasm is here, I get it but with languages like GO, Rust, and C# on the web, it doesn't stand a chance for any serious web apps.
@davies8183
@davies8183 2 года назад
@Marcus - Don't be fooled by the hype. Most companies are using C++, C#, Go and Rust to run most of their core apps. We don't pick tools because they're easy. We pick the tools that get the job done and offer the best experience to the user.
@apuji7555
@apuji7555 2 года назад
@Marcus - but its slower
@adamajinugroho830
@adamajinugroho830 2 года назад
Imo i dont think python is good for other than scientific and ML stuffs
@deaddoctor
@deaddoctor 2 года назад
@@matthewwisdom426 but not for ui and ux
@l5248
@l5248 2 года назад
Sounds cool in theory, but python with it's significant whitespace being used in webpages would increase the bloat of the already bloated web. I imagine this would be good for small projects, but not large-scale web apps.
@mattgarelli1371
@mattgarelli1371 2 года назад
Couldn't you still transpile using semicolons?
@Hearrok
@Hearrok 2 года назад
Ehmm.. this is not running python in the browser... this is just converting python syntax to javascript. Big difference, you will not get the performance advantage of python, in fact the opposite, it will require loads of extra processing. Sure you can now run python libraries, but that's pretty much it.
@lone-warrior-13
@lone-warrior-13 2 года назад
it compiles to js in order to run, right?
@avinashsuresh5221
@avinashsuresh5221 2 года назад
Every language starts by writing a compiler in another language, and then a compiler is created in that same language so that it no longer depends on another language. Pyscript may be written in Javascript, but in the future they sure are going to write the compiler in Python. And who knows, if browsers start supporting python there would be no need to use pyscript.js in the HTML. Currently the compiler is written in JS only because browsers understand JS, not Python. A DOM in Python would be interesting...
@skejeton
@skejeton 2 года назад
Finally, a new way to make the pages slower
@the-real-i9
@the-real-i9 Год назад
😁 Really???... See all Python gangs getting excited. You really don't know much about the web, do you? You'll still have to write JS if you wanna build serious Web Apps. Pyscript just takes care of Logic. Tell me, how would you work with WebAPIs? The W3C has its implementation fully in JavaScript and that's what actually powers web applications, to be more precise, that's how the web communicates with the hardware.
Далее
Se las dejo ahí.
00:10
Просмотров 2,2 млн
25 nooby Python habits you need to ditch
9:12
Просмотров 1,8 млн
Make A Python Website As Fast As Possible!
22:21
Просмотров 691 тыс.
11 Tips And Tricks To Write Better Python Code
11:00
Просмотров 614 тыс.
JavaScript Pro Tips - Code This, NOT That
12:37
Просмотров 2,5 млн
PyScript is Python in Your Browser
15:09
Просмотров 24 тыс.
Se las dejo ahí.
00:10
Просмотров 2,2 млн