How do i know am writing A Cython or Jython code | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How do i know am writing A Cython or Jython code

Am a Newbie in Programing as a whole and I bumped into an article explaining Cython, Jython (not on Solo Learn), pypy, to be honest I was overwhelmed, don't even know how I got there. I guess an explanation of this would help, cos how is it possible that am learning python but it's actually C ( I read that Cython is very common). So emm how will i know what kind of code am writing when learning python or should I even bother with knowing what kind of code am writing?

13th Jan 2019, 10:23 PM
Philip Andy
Philip Andy - avatar
3 Answers
+ 2
So stick to the Standard Python huh Aiiit, I'd do just that... Thank you for explaining. Hopefully I'll get to the stage of worrying. 😁 Thank You.
14th Jan 2019, 8:07 PM
Philip Andy
Philip Andy - avatar
+ 1
Cython and Jython are basically just extensions to the Python language. Their advantage is that they compile the python programs to C or Java bytecode which typically runs much faster, because python is an interpreted language (meaning more or less that the code is processed line by line) As a beginner I suggest to stick to the standard python and you'll have time to worry about performance when you have mastered the fundamentals ;)
14th Jan 2019, 5:19 AM
Tibor Santa
Tibor Santa - avatar
0
Philip Andy probably in the meantime you have understood them but I'm just writing this for new comers. Python is a language which is basically written in C. Here python actually means CPython; when you run a python code, it firstly converts to C in a virtual machine (VM) and then runs. Jython is also the same but there the role of C is handed over to Java. These are known as implementations of Python. Another common one is Pypy (written in python itself). While using python modules, you'll come through a term, extension module, it means that the module is written in C. Be careful while using them, maximum times one implementation cannot run modules of other implementations. For instance, codes written in C won't work in Jython, usually. And, Cython is a completely different term. Its a programming language which is a hybrid version of C and Python. It has the syntaxes like python and in a pythonic way also has the syntaxes of C. To learn Cython, you need to know python first.
26th Apr 2021, 2:30 PM
Md. Faheem Hossain
Md. Faheem Hossain - avatar