<?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: CimpleC</title>
    <description>The latest articles on DEV Community by CimpleC (@cimplec).</description>
    <link>https://dev.to/cimplec</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%2Forganization%2Fprofile_image%2F2951%2F1f39e24b-40f8-441d-9a84-9dd4eaf11695.png</url>
      <title>DEV Community: CimpleC</title>
      <link>https://dev.to/cimplec</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/cimplec"/>
    <language>en</language>
    <item>
      <title>Getting Started with sim-C</title>
      <dc:creator>Aayush Agarwal</dc:creator>
      <pubDate>Tue, 01 Sep 2020 19:25:14 +0000</pubDate>
      <link>https://dev.to/cimplec/getting-started-with-sim-c-4iek</link>
      <guid>https://dev.to/cimplec/getting-started-with-sim-c-4iek</guid>
      <description>&lt;p&gt;We really appreciate the support we received towards sim-C. If you’ve landed here and want to know more about sim-C, do check out our previous post &lt;a href="https://dev.to/cimplec/writing-code-in-c-simplify-your-life-with-sim-c-2dkj"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;In this post, we will see the various methods of installing sim-C and a handful of examples to get you familiarized about this amazing tool. So let’s simplify programming in C with sim-C.&lt;/p&gt;




&lt;h3&gt;
  
  
  &lt;strong&gt;Installing on Mac/Linux/Windows&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Run the following command
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ pip install git+https://github.com/cimplec/sim-c
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;






&lt;p&gt;With sim-C installed on your system, it’s time we get started with it. You can check out the &lt;a href="https://cimplec.github.io/docs/doc.html"&gt;documentation&lt;/a&gt; to get familiarized with the high-level syntax of sim-C.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Steps to run&lt;/strong&gt;
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Open any text editor of your choice.&lt;/li&gt;
&lt;li&gt;Write code using the sim-C high-level syntax.&lt;/li&gt;
&lt;li&gt;Run the file using sim-C compiler.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ simc test.simc
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;The C code file is generated with the same name as the simc file, but with extension .c&lt;/p&gt;




&lt;p&gt;Here are a few examples of sim-C in action.&lt;br&gt;
The code below is written in the syntax of sim-C.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;MAIN
// A single line comment
/*
and this
is a
multi-line comment
*/
for a in 1 to 10 by +1 {
    if (a%2==0){
        print(a)
    }
    else {
        print("Odd")
    }
}
END_MAIN

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;This sim-C code gets converted to —&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
int main() {
// A single line comment
/*
and this
is a
multi-line comment
*/
for(int a=1; i&amp;lt;=10; i++) {
    if (a%2==0){
        printf("%d", a);
    }
    else {
        printf("Odd");
}
return 0;
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Here’s another example:&lt;br&gt;
sim-C code —&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def interest(x, y, z) {
    si = (x*y*z)/100
    return si
}
MAIN
var p= input(“Enter the principal amount: “, “f”)
var r= input(“Enter the rate: “, “f”)
var t= input(“Enter the time period: “, “f”)
var interest_amount = interest(p, r, t)
print(interest_amount)
END_MAIN
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;Equivalent C code —&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;#include &amp;lt;stdio.h&amp;gt;
float interest(float x, float y, float z) {
float si = (x*y*z)/100;
return si;
}
int main(){
float p;
printf("Enter the principal amount: ");
scanf("%f", &amp;amp;p);
float r;
printf("Enter the rate: ");
scanf("%f", &amp;amp;r);
float t;
printf("Enter the time period: ");
scanf("%f", &amp;amp;t);
float interest_amount = interest(p,r,t);
printf(interest_amount);
return 0;
}

&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;



&lt;p&gt;It is evident that sim-C has the capability to increase productivity and reduce development time by reducing the amount of code that needs to be written.&lt;/p&gt;




&lt;p&gt;sim-C is still in continuous development and some amazing changes are on the way!! Do check out the &lt;a href="https://github.com/cimplec/sim-c"&gt;Github repo&lt;/a&gt; and star it to be in touch with the updates taking place. Do let us know if you have any suggestions for us. Looking forward to hearing back from you.&lt;/p&gt;

</description>
      <category>c</category>
      <category>programming</category>
      <category>compiler</category>
      <category>opensource</category>
    </item>
    <item>
      <title>Writing code in C? Simplify your life with sim-C</title>
      <dc:creator>Aayush Agarwal</dc:creator>
      <pubDate>Tue, 01 Sep 2020 19:02:59 +0000</pubDate>
      <link>https://dev.to/cimplec/writing-code-in-c-simplify-your-life-with-sim-c-2dkj</link>
      <guid>https://dev.to/cimplec/writing-code-in-c-simplify-your-life-with-sim-c-2dkj</guid>
      <description>&lt;p&gt;If you are working with C or have ever worked with C, then you know how frustrating it can get writing those long and (sometimes) complicated syntaxes, and how time-consuming it can get to debug a code just because of something as simple as a misplaced semicolon. While we wholeheartedly believe that C is one of the most powerful and impactful languages ever created, it sometimes can be tough for non-programmers. In this article, we will tell you about sim-C, a tool that aims to help you simplify your life.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;sim-C?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;In simple terms, sim-C is a tool that adds a layer of abstraction over the syntax of C, i.e it offers its users to write code in its own syntax and then converts that simple code into C code.&lt;/p&gt;

&lt;p&gt;We know some of you will be concerned about your code slowing down as a result of using sim-C, but we assure you that the runtime of your code will not be affected due to it. This is because sim-C’s job is to convert code written in it’s high-level syntax to the syntax of C, hence only affecting the compilation time.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What do I need to know to use sim-C?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;If you can write a = b + c in any programming language, you probably have more than sufficient knowledge to get started with sim-C. Since sim-C’s ultimate goal is to convert its simple concise code to C code, we recommend that you have a basic knowledge of the C language, but as we mentioned earlier, it is not a necessity by any means.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;What does sim-C have to offer?&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;sim-C offers a very concise and simple syntax to the users. With sim-C you will surely be able to bring down your time of development. But perhaps the salient feature of sim-C is the ability to infer the datatypes of variables, that means you don’t have to worry about declaring integers/floats/doubles/chars etc, you can simply type ‘var name’ leaving the rest to sim-C.&lt;/p&gt;

&lt;p&gt;sim-C is still in development phase (we released v0.1 alpha recently) and we are still adding new features regularly, so even if it is not for you right now, do keep an eye on it.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Final Words&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;While sim-C is far from being complete, we would really appreciate it if you were to &lt;a href="https://cimplec.github.io/docs/"&gt;check it out&lt;/a&gt;. Do let us know if you have any suggestions for us. Looking forward to hearing back from you.&lt;/p&gt;

&lt;p&gt;Do check out our next post, &lt;a href="https://dev.to/cimplec/getting-started-with-sim-c-4iek"&gt;Getting started with sim-C&lt;/a&gt;, to know how to install sim-C and run it.&lt;/p&gt;

&lt;p&gt;sim-C is still in continuous development and some amazing changes are on the way!! Do check out the &lt;a href="https://github.com/cimplec/sim-c"&gt;Github repo&lt;/a&gt; and star it to be in touch with the updates taking place.&lt;/p&gt;

</description>
      <category>c</category>
      <category>programming</category>
      <category>compiler</category>
      <category>opensource</category>
    </item>
  </channel>
</rss>
