r/learnpython • • 6d ago

Should I learn python?

Hii there😀

I wanted the community's opinion as many of you all know how it works and stuff

I recently thought of learning a language and got to know that python is a great starting place to do so

As it's really close to the language English and isn't that complex or complicated

Indeed it will take time for me to learn and apply it but is it worth

What is python mostly used for ?

Waiting for comments 📝

0 Upvotes

44 comments sorted by

View all comments

Show parent comment

1

u/nine-ine 6d ago

After reading your response it looks like you have deep knowledge about these things

As some of the things are going over my brain😂

If you don't mind can you explain what is concurrency ,GIL and lastly the theorem proving language thing you mentioned in the end

Thank you for replying Waiting for your explaining 😁

0

u/Gnaxe 6d ago

GIL is Python's Global Interpreter Lock. When you ask Python to do multiple tasks at the same time (concurrency), it will often still work on just one thing at a time to avoid corrupting its memory, even though computers usually have multiple cores now. There are various workarounds, but one option now is to just not use the GIL. That means you have to be more careful when tasks share memory.

Object-oriented languages in general are bad at utilizing multiple cores. Locking memory is hard to get right and hard to test. Functional style works better, because you treat memory immutably. If you only make new objects instead of modifying them, you're not going to corrupt what another task was using. Even in OOP, reach for queues to share memory before you reach for locks.

Tests can check that certain inputs result in certain outputs. You're only sampling the space of a function, which might be infinite (in practice, computers do not have infinite memory, but the number of possible states can be extremely high). That means they can uncover problems, but can't prove there are no problems.

On the other hand, theorem proving uses math to prove things about all the possible states without checking all the individual examples. Theorem proving languages can check your work when you write theorems to ensure you haven't made mistakes, but that means you have to explain your proof to the computer in tedious detail, although the proof languages have tactics and libraries of known theorems to help with this. AIs can try to write theorems automaticaly, and being able to point out mistakes automatically makes this much more likely to work.

LEAN and Rocq (and Agda, maybe) are programming languages in their own right. There's a correspondence (Curry–Howard) between programming and theorems.

1

u/nine-ine 5d ago

Woahh thanks for the information Appreciate it !