JavaScript vs Python for ML, DL, and NLP based Software Development

Hi There,
How is JavaScript for developing softwares related to machine learning models, deep learning models, natural language processing systems, automatic speech recognition etc?

Best Regards,
Karamjot Kaur.

Never heard JS mentioned in that context - so I highly doubt it’s any good.
Python has extremly powerful libraries for all kinds of stuff for ML and co, resulting in most tutorials also using Python.

1 Like

As mentioned, this is not a common use case for JavaScript, but there are libraries for JavaScript like TensorFlow.js which are used to develop ML models, and work with related data.

Hope this helps

2 Likes

You can write anything in JavaScript, as it is turing complete.

That said, ML is very resource-hungry and JavaScript is not known for its performance.
People use python mostly because a lot ML libraries are already written in it, and it is relatively easy to learn. Big part is also ability to program on lower-level and optimise performance.

Jeremy Howard from fast.ai said, that python is still too slow, and ML will probably drift to languages like julia because of possible performance gains, but that will happen over the years.

2 Likes

Thanks a lot for everyone’s attention and guidance. I appreciated it. One more question, please. If I wanna develop a complete software system based on machine learning then I think the front-end development with JavaScript and back-end with Python will be the best choice. Please provide me the feedback if I understood correctly or not? or python is fine for both?

If you want to use web browser, there is not much choice for front-end.
HTML, CSS, JS, maybe some WebAssembly.
If you want to write standalone application, you can write front-end however you like (some languages are more geared to this than others).
Front-end is for presentation. It is what your user will see and interact with.

Back-end is for your logic, server, connections, ML model and all of that.
You can write all of that in one language, or in many different languages.
Example: SQL for data access and storage, php for connecting this data with your front-end and some shell/python scripts for monitoring purposes.
Also python for ML model.

There is no single “best choice”, but there is “right tool for the job”.

You can try to write everything in Javascript too, but that might not be the best tool for some of the jobs.

1 Like

Does it mean if I use C# (with HTML5, CSS3 and little bit JavaScript) for front-end with Visual Studio and SQL for back-end with SQL Server and Python with Scikit-learn/TensorFlow (using Anaconda) for ML models then it will work perfectly?

This is subjective.

There is no reason you cannot mix technologies. It is just, how much time do you want to spend developing this from scratch?
What you are describing it on the more complex-side of anything I have worked with, but my understanding is you would not be mixing these technologies so much as you would just be using them separately, and sharing data.

That is, the code related to training/updating your ML model is in no way connected to the code running your application’s server, which (could be) in no way is connected to your application’s frontend.

If what you want is a web app, the overwhelming recommendation is HTML, CSS, and JS - for the client-side code.
If what you want is a native desktop application, then you have to look at which architecture you are targeting, if any (Swift for iOS, C# for Windows, nothing specific comes to mind for Linux, or you can make use of the tools designed to bridge this gap between all of them (e.g. React Native, Flutter, Rust))

As I have not built anything similar, I will not recommend one over the other, but if you already know some tools, then there is likely a way to more easily integrate what you are doing with their associated ecosystem.

Hope this helps

2 Likes

So what is the better way to develop such software?

Use Python.
It contains several powerful libraries and writing them yourself is impossible - because those libraries themself are developed by several teams of people and large communities.

Just because you can do it with JS as well, doesn’t mean there is any good reason to do so.

1 Like

Does it mean the Python software development tools like Flask, Django, Tkinter are actually designed to develop such kind of softwares?

No, it just means that the Python community offers a lot of useful libraries.
The IDEs generally are designed to support developing - they are usually NOT tailormade for one specific use or even just one language.
Especially with project which benefit from the combination of different languages (like pretty much anything on the internet combining JS, PHP, SQL and more), limiting an IDE to one language or problem doesn’t really make sense.

For ML you might even want to use different IDEs - like Jupyter for data-exploration and cleaning. Then switch to something else for the actual ML.

1 Like

Thanks a lot. It’s very helpful.

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.