DEV Community

Cover image for PyScript vs JavaScript
Kristiyan Velkov
Kristiyan Velkov

Posted on • Updated on

PyScript vs JavaScript

Hello, folks.

Please don't treat this article's as divine truth. It's my personal view.

JS

If you have more than two years of experience developing front-end applications, you undoubtedly already know about some of the unsuccessful attempts to replace strange, ugly JavaScript. Although attempts have been made to replace or avoid using JavaScript, JS is still in use.A tough opponent!

JavaScript is everywhere on the web. It is the most used programming language, with 97.7% of all websites using JavaScript as a client-side programming language.

PyScript

The use of Python has greatly increased in recent years. It has many uses, including its most well-known use in artificial intelligence as well as data science, robotics, and scripting.

And this year, during the PyCon 2022 conference, Anaconda announced a framework named PyScript that allows you to use Python on the web using standard HTML.

Failed to attempt to replace JavaScipt

  • Java - J2CL
    J2CL is a powerful, simple and lightweight transpiler from Java to Closure style JavaScript.

  • C# - Blazor
    Use the power of .NET and C# to build full stack web apps without writing a line of JavaScript.

  • Python - PyScript
    PyScript that allows you to use Python on the web using standard HTML.

And many more ...

Conclusions:

  • JavaScript will be not replaced, so don't spend some time on some compilers which execute JS bullshit.

  • Stick to JS - 97.7% of web is using it.

  • JavaScript is not perfect, but nothing will replace it.

  • Versatility: JavaScript is a versatile programming language that can be used for both front-end and back-end development. It is the de facto language for web development and is supported by all major browsers.

  • Large and Active Community

  • Extensive Ecosystem: JavaScript has a vast ecosystem of frameworks, libraries, and tools that can greatly streamline development. Popular front-end frameworks like React, Angular, and Vue.js.

  • Demand and Job Opportunities: JavaScript is in high demand in the job market due to its widespread usage.

  • Future Compatibility: JavaScript continues to evolve and adapt to new technologies and trends.


Image description

linkedin


Image description

If you like my work and want to support me to work hard, please donate via:

Revolut website payment or use the QR code above.

Thanks a bunch for supporting me! It means a LOT 😍


Top comments (11)

Collapse
 
odalet profile image
odalet

I think typescript, if not a contender for web supremacy has still established a place for itself on the web landscape. But maybe you include it in the javascript ecosystem. It'd make sense as ts is (a superset of) js.
As for other languages that rise thanks to wasm, I agree they are not a threat to js for now, and maybe not ever. I still think they have a place in specific domains (3d, performance demanding applications, porting of non web code ..) and will mix more and more with js code. Anyway, the larger the choice the better the apps we'll make.

Collapse
 
kristiyan_velkov profile image
Kristiyan Velkov

@odalet thank you for your comment.

Yes, I included TypeScipt in JS ecosystem.

While programming languages continue to evolve rapidly, it is important to recognize that JavaScript was created for specific reasons and has become deeply entrenched in web development. Its ubiquity, vast ecosystem, and widespread support make it challenging to replace entirely. JavaScript (and TypeScript) remain the primary languages for front-end and full-stack web development, and they continue to evolve to address new challenges and requirements.

Collapse
 
odalet profile image
odalet

Right, js is to web dev what c is to os dev: the glue code and universal interface one should know about even if they don't use them directly

Collapse
 
adrian_smith_6ab10e51b4dc profile image
Adrian Smith

Thank you for the opinion notice in the beginning, however I must respectfully disagree with you. Yes, HTML, CSS, and JS are the “native” languages of the web, however as shown with languages like Rust (which have already begun to replace languages like C and C++) newer and faster languages are evolving for a variety of uses. At some point, a newer, faster, and more advanced language will release that will inevitably replace JS.

Will this happen now, or heck, even soon? No (most likely). As you have said, JS is still a huge prominent building block of the web, one that would need to be more slowly replaced throughout the web. With this being said, it must also be mentioned that JS can never be fully “replaced” in the sense that it will always be and have usage, even if said usage is in old, deprecated websites.

I used an example of Rust earlier. In the case of Rust, it’s mainly intended to be able to more or less replace C and C++, two of the most widely used languages. Keep in mind these languages power a ton of operating systems, such as Windows, Linux, macOS, iOS, and more as they are both very low-level and fast languages. With that being said, a complete replacement of these languages is nearly impossible and simply won’t happen. However, the generalization and practices of using Rust over C and C++ will eventually happen (assuming a better language than Rust isn’t created before Rust can reach this point).

The same general thing can be expected with JS, and many other languages. It’s simply inevitable, and developers must either choose to fall behind or adapt to newer practices.

All of this being said, as new Python adaptations like Mojo have been announced and are in-development (Mojo specifically is, from what I remember, faster than C and C++) Python may actually just end up being the language to replace JS in the future. The thing about Python is how versatile and adaptable it is to nearly anything, and that just may be the thing to keep it alive longer than most other languages, and even replace some of those other languages.

Thank you for this post though!

Collapse
 
kristiyan_velkov profile image
Kristiyan Velkov

Hello, @adrian_smith_6ab10e51b4dc.

Thank you for sharing your respectful disagreement with my opinion. I appreciate your perspective and the points you raised.

You mentioned that newer and faster languages, such as Rust, are emerging and may eventually replace languages like C and C++. While it is true that languages evolve and new ones may gain popularity, it is important to consider the vast ecosystem and the widespread adoption of existing languages like JavaScript. As you mentioned, replacing JavaScript entirely would be a slow process due to its prominent role in the web. Even if a newer language emerges, JavaScript will likely continue to have its usage, even in older or deprecated websites.

You drew a parallel with Rust and its potential to replace C and C++. It is indeed challenging to completely replace widely used languages like C and C++, given their deep integration into operating systems and other systems. However, the adoption of alternative languages like Rust over time is plausible, assuming they offer superior features and advantages.

Regarding Python, you mentioned upcoming adaptations like Mojo that are claimed to be faster than C and C++. Python's versatility and adaptability have contributed to its popularity, and it may indeed find more applications in the future. However, it is important to note that Python and JavaScript serve different purposes. While Python is a general-purpose language known for its readability and ease of use, JavaScript's strength lies in its ability to interact with web browsers and provide dynamic functionality on the web. It is possible that Python could gain more prominence in certain areas, but it's unlikely to fully replace JavaScript in its specific domain.

Collapse
 
kristiyan_velkov profile image
Kristiyan Velkov

I'm glad you agree! @t0nyba11

It's important to respect individual experiences and preferences when it comes to programming languages. Both Python and JavaScript have their own strengths and can be effective tools for different scenarios. Choosing the right language ultimately depends on the specific requirements and goals of the project at hand.

Collapse
 
cjsmocjsmo profile image
Charlie J Smotherman • Edited

I prefer to use Javascript in the place where it was originally designed to run (the browser). Javascript was not designed to be run on the server but yet some very clever people have managed to frankenstien it into doing so. I'm not a big fan of javascript everywhere and I find it interesting that the creator of JSON , Douglas Crockford, thinks we should be using something else.

I personally think that javascript, and javascript frameworks will go away in favor of what I call full stack frameworks that take one code base and compiles it into all the major targets such as desktop (linux, mac, windows), mobile (android, iphone), and web. A few examples are Flutter and Tauri (at the time of writing Tauri can create desktop apps, mobile is still being worked on).

Wasm is coming on strong, and this is strictly my opinion, but in the end when the dust settles there will be no dominant language, everything will compile to wasm, so it can run anywhere ;)

My favorite new stack is HTML, CSS and Rust

Happy Coding

Collapse
 
shifi profile image
Shifa Ur Rehman

As one of the greatest Principals at Hogwarts, Dolores Umbridge once said "Progress for the sake of progress must be discouraged" :p

All jokes aside, you must draw a line between fine earning and fine learning. Sure some languages are absolutely no brainer in terms of earnings and future stability in that sense, but us developers, the true computer scientists at heart, we like to linger in the domain of fine learning. And that's what it is, pyscript, it's an avenue to the future. Maybe not implemented as a direct alternative to javascript, but in some other shape or form. Sure it'll take a long time to reach there, but oh would it be a joy to be a part of that journey. Just like the older devs got older with javascript.

So i implore you guys, these blogs are a gateway to the unknown for the most of us. Don't hijack that sense of adventureship by neglecting that fine line between earning and learning as you may end up making someone scrap his/her idea of writing a blog post titled "write a server in plain css". For example.

Some comments may only be visible to logged-in visitors. Sign in to view all comments. Some comments have been hidden by the post's author - find out more