Python became the third most popular technology by Stack Overflow Global Developers Survey 2021. Clojure was honored as the highest-paid and the most "joyful" programming language some years earlier.
Both languages enable programmers to build increasingly sophisticated systems. Both facilitate the creation of flexible software that's required for rapidly evolving domains. Finally, both Python and Clojure are blessed with a:
- powerful toolbox
- simplicity
- development speed
- concise and clear code
- a strong culture of sharing best practices
- ever-evolving community
What is common between Clojure and Python? What Lisp features did Python acquire in the context of Data Science? If Lisp is so great, why do we keep needing new approaches? Today I want to share some thoughts regarding the topic.
Development speed, elegant syntax, Code-as-Data paradigm, access to large existing ecosystems (Java, JS, .NET)... It's all about Clojure. Let's talk a little about how all this was implemented and what preceded it.
Common Lisp and Scheme implementations were very large and complex and were handled by multiple teams. In turn, <medium>it took Rich Hickey about 2 years to create Clojure<medium>. How is this possible? What are the reasons? What problems have been solved?
- cross-platform portability
- system API support (it's completely different for Unix, Linux, and Windows)
- performance optimization (JIT compilation), a particularly difficult task because of requiring optimization for a specific machine/processor architecture besides the OS optimization
- organizing multiple libraries
Rich Hickey, judging by his interviews, loves to think and more than act. I think this <medium>strong propensity to analyze, explore and systemize<medium> was a reason why he didn't follow the path of building a system from scratch. Instead of this, he preferred <medium>to combine a bundle of ready-made solutions<medium> and add a thin layer of appropriate wrapper for industrial programmers on top (Python went the same way).
So, in a sense, Clojure was designed as a sort of good glue between various ready-made components. But as with every Lisp-family programming language, it is also good for implementing some things from scratch.
I'll <medium>consider Python through the prism of data science<medium> because Python for web and Python for DS are two huge differences in kinds of approaches, frameworks, and tools.
During the general push toward DS, Python was much more popular than Lisp. And it's interesting that <medium>Python for DS acquired Lisp's features<medium>, including interactive REPL-driven development. As an example 一 Google Colab, an interactive Python IDE that allows debugging a piece of code (step through it line by line) and visualizing the results.
Here are some of my findings on <medium>Python's pros and cons in terms of data science<medium>. Some points may be indicated both as Python's strengths and weaknesses.
Although Сlojure is less popular than Python it's no less promising. Data science was an early selling point of Clojure. Already 10 years ago developers explored and used Clojure concepts, which are great for mathematical calculations. According to the Clojure Survey 2011 42% of interviewed persons were using Clojure for 'math and data analysis' that is a really stunning number as for the pre-'the hype around neural nets' times.
Clojure offers intelligent solutions that are really well-suited for data analytics. <medium>Extreme development speed, metaprogramming, macros, DSL, map/filter/reduce<medium> – all those Clojure benefits are worth trying.
But, the questions of convergence and tooling are still on the agenda.
It's a good tendency. Conclusions 'hammered out on the anvil of discussion, dissent, and debate' lead to wise solutions, aged like fine wine, which in turn lead to improving the language ecosystem.
How to keep with the times and provide a better total experience with Clojureand Python tools? Freshcode welcomes you to talk about it! Please, fill out the form on our website or contact our representative on Linkedin.
{{about-barmin-green="/material/static-element"}}