I am writing a Python AI book right now and I am using version 3.11. Since I am a patient person, I prefer conda to avoid dependency issues, so: conda create --name py3.11 python=3.11 -c conda-forge
Being a Lisp developer (for 40 years), I am finally developing some love for Python after years of having to use it at work for deep learning.
For me the better performance/lower resource improvements in 3.11 (looking forward to 3.12) is a big issue because I compare to Common Lisp performance, which can be very good.
Off topic, but my new found love for Python comes from realizing that many programming tasks can be done so much faster in Python.
The difference in speed is still huge, for example
sbcl
(time (loop for i from 1 below (expt 10 8) by 2 when
(zerop (rem i 3) count t))
this takes 0.131 seconds
versus python
import time
def gato():
start = time.time()
s = sum(1 if i % 3 == 0 else 0 for i in range(1,10\**8,2))
end = time.time()
print(s)
print(end-start)
gato()
takes 2.26 seconds, that is 20 times the sbcl version (I am using python 3.10.6)
You are right, since the post say that the performance of 3.11 can be 2x that of 3.10, the implication is that python 3.11 is ten times slower on loop related code than sbcl.
Anyway, a 2x improvement is a great feast for python 3.11, congratulations to the team.
it's a very small thing, but the booleans in python can be added like integers, with True being 1 an False being 0. So your comprehension could have been:
As someone that knows Python since version 1.6, that is what kind of always has irritated me.
Sure the language isn't Lisp, but it comes close enough, only to be let down by lack of performance focus, and PyPy never got the spotlight it deserves.
So I kept using Python only for sysadmin stuff when targeting UNIX like workflows.
Finally, it is looking like I can eventually some day reach out for Python in tasks where performace matters.
> Off topic, but my new found love for Python comes from realizing that many programming tasks can be done so much faster in Python.
There's a "freedom of expression" that python has that other languages such as Java/Go lacks. C++ can have similar expressive power by overloading operators, then this was of course eschewed by Java and Go. Go and Java provide a framework for writing code their way. Python doesn't insist you use OOP methodologies, if you don't want (e.g.)
I built a data conversion system in python using the ">>" operator to simplify translation of data.
For large data structures this becomes tedious with if/elif/else statements and null checking for a small piece of data. Particularly if you're going to translate one large data structure to another.
I think you got downvoted for the operator overloading but as long as it's used with intention you're fine. Python itself abuses bitwise or for types, everyone's darling SQLAlchemy overloads all the comparators to make filter expressions. Testing libs also overload comparisons to make matchers.
As an experienced Python dev... Python's "convenience" and "soeed of iteration" completely falls apart when you have more than half a dozen people working on the same codebase of varying development experience. You spend so much time digging yourself out of abuses of internal APIs.
Microservices is the answer. You limit the Python code to completely separate 3k line programs that talk over an message queue. If a junior screws up a service just bin it and rewrite it.
Ruby is definitely great and I would have totally agreed a couple years ago, but Elixir has blown my mind. It feels so much like LISP sometimes I wonder, especially with the full macro system where you can operate directly on the AST :-D
Given the recent news on Nx and Livebook, Elixir may be a first-class language for ML very soon.
On a related note, Elixir feels a bit like a functional love child of ruby and python.
I wonder is there is something similar to the expert system powerloom in python. I hope you get some inspiration from ARIMA (Norvig Book with python code). Also using ontologies with triples in python should be slow for inference.
Unrelated, but I'm wishing to learn lisp myself. I started with Cloture since I have experience with the Java ecosystem. What resources do you recommend for learning Lisp?
Being a Lisp developer (for 40 years), I am finally developing some love for Python after years of having to use it at work for deep learning.
For me the better performance/lower resource improvements in 3.11 (looking forward to 3.12) is a big issue because I compare to Common Lisp performance, which can be very good.
Off topic, but my new found love for Python comes from realizing that many programming tasks can be done so much faster in Python.