<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Ayush Basak</title>
    <description>The latest articles on DEV Community by Ayush Basak (@ayushbasak).</description>
    <link>https://dev.to/ayushbasak</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F503446%2F1f9d6616-2604-4823-ac32-4090a5f865d0.png</url>
      <title>DEV Community: Ayush Basak</title>
      <link>https://dev.to/ayushbasak</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ayushbasak"/>
    <language>en</language>
    <item>
      <title>Is Python compiled or interpreted?</title>
      <dc:creator>Ayush Basak</dc:creator>
      <pubDate>Wed, 11 Nov 2020 06:37:43 +0000</pubDate>
      <link>https://dev.to/ayushbasak/is-python-compiled-or-interpreted-33gc</link>
      <guid>https://dev.to/ayushbasak/is-python-compiled-or-interpreted-33gc</guid>
      <description>&lt;p&gt;It looks like an easy question to answer, obviously interpreted, because Python code is run line by line at runtime. But it's wrong.&lt;/p&gt;

&lt;p&gt;If your are a newbie to programming and have been using a language to code, it might have been obvious to you that some languages are interpreted, some are compiled to machine code, and some are both compiled and interpreted.&lt;/p&gt;

&lt;p&gt;For example, when we use the CLI to run&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;&lt;code&gt;python3 -c "print('Hello World')"&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;p&gt;, we see that the code was executed at runtime and hence we assume that all python code is supposed to be interpreted.&lt;br&gt;
Similarly, when we write a C code, we need to compile it to an executable and then run it, and hence we assume that all C code must be compiled.&lt;/p&gt;

&lt;p&gt;But the language itself is not either interpreted or compiled. It is not a property of the language. When we see a C code or python code it is nothing but a blot of ink on paper or some random text on a text editor. It is nothing but an idea of concepts in air. Computers cannot understand these text based ideas that humans can, it needs machine code to execute a program.&lt;/p&gt;

&lt;p&gt;Hence we need some form of implementation of the language that does the hard work for us. Therefore there exists a &lt;strong&gt;Compiler&lt;/strong&gt; or an &lt;strong&gt;Interpreter&lt;/strong&gt;. It is the compiler's or interpreters job to convert the raw text based code written in any language to machine readable code for execution.&lt;/p&gt;

&lt;p&gt;Coming back to the question,&lt;br&gt;
&lt;strong&gt;Is python compiled or interpreted?&lt;/strong&gt;.&lt;br&gt;
Depends. Since most of us use python by the &lt;code&gt;python3&lt;/code&gt; or &lt;code&gt;py&lt;/code&gt; command, we are actually using the implementation called &lt;em&gt;&lt;a href="https://en.wikipedia.org/wiki/CPython"&gt;CPython&lt;/a&gt;&lt;/em&gt; written in C. It compiles &lt;code&gt;.py&lt;/code&gt; files to &lt;code&gt;.pyc&lt;/code&gt; files. &lt;code&gt;.pyc&lt;/code&gt; files contain byte codes. The &lt;em&gt;CPython&lt;/em&gt; implementation also interprets those byte codes.&lt;br&gt;
 There are various other implementations for python such as &lt;em&gt;&lt;a href="https://www.jython.org/"&gt;Jython&lt;/a&gt;&lt;/em&gt; (written in Java) or &lt;em&gt;&lt;a href="https://www.pypy.org/"&gt;PyPy&lt;/a&gt;&lt;/em&gt; (written in RPython). These are just-in-time compilers for python.&lt;/p&gt;

&lt;p&gt;Similarly there exists interpreters for languages such as C.&lt;/p&gt;

&lt;h3&gt;
  
  
  Conclusion:
&lt;/h3&gt;

&lt;p&gt;It is not the property of a programming language to be either compiled or interpreted but the implementation of the language in use instead.&lt;/p&gt;

&lt;h3&gt;
  
  
  References:
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://stackoverflow.com/questions/6889747/is-python-interpreted-or-compiled-or-both"&gt;StackOverflow: Is python interpreted, compiled or both?&lt;/a&gt;&lt;br&gt;
&lt;a href="https://softwareengineering.stackexchange.com/questions/24558/is-python-interpreted-or-compiled"&gt;StackExchange: Is Python interpreted or compiled?&lt;/a&gt;&lt;br&gt;
&lt;a href="https://stackoverflow.com/questions/1644619/cpython-is-bytecode-interpreter?rq=1"&gt;StackOverflow: CPython is bytecode interpreter?&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  PS:
&lt;/h4&gt;

&lt;p&gt;Do correct me if I make a mistake in this article. 😊&lt;/p&gt;

</description>
      <category>python</category>
      <category>cpython</category>
      <category>compiler</category>
      <category>interpreter</category>
    </item>
    <item>
      <title>my first flask app for everyone to share something</title>
      <dc:creator>Ayush Basak</dc:creator>
      <pubDate>Sun, 01 Nov 2020 04:13:04 +0000</pubDate>
      <link>https://dev.to/ayushbasak/my-first-flask-app-for-everyone-to-share-something-14oi</link>
      <guid>https://dev.to/ayushbasak/my-first-flask-app-for-everyone-to-share-something-14oi</guid>
      <description>&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--2ZktfsIS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/egz9n78ifzzkwg5xtp37.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--2ZktfsIS--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/egz9n78ifzzkwg5xtp37.png" alt="Alt Text"&gt;&lt;/a&gt;&lt;br&gt;
&lt;a href="https://tellmeeverythingflask.herokuapp.com"&gt;Visit here!&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/ayushbasak/tell-me-everything"&gt;Github&lt;/a&gt;&lt;br&gt;
I created this flask app &lt;strong&gt;tell-me-everything&lt;/strong&gt;&lt;br&gt;
for people to share something (literally any text you want) with everyone on  &lt;em&gt;THE WALL&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;It is a very simple app designed with CSS. Please do give it a visit! 😊&lt;/p&gt;

&lt;p&gt;PS: &lt;br&gt;
I was 6 hours into the project and deployed it happily to Heroku, excited to share it with my friends when I realized Heroku restarts its free dynos frequently so SQLite was not the best database to work with (smh 🤷‍♂️). I am thinking about moving to PostgreSQL but I'm very lazy. 😜.&lt;/p&gt;

</description>
      <category>flask</category>
      <category>css</category>
    </item>
  </channel>
</rss>
