Giter VIP home page Giter VIP logo

sim-c's People

Contributors

aayush-99 avatar agnibhasinha avatar bruhbs avatar chasmiccoder avatar darshit-sopho avatar devlokcodes avatar dhairyaj avatar frankhart2018 avatar gursimranheer avatar himanshisinghal09 avatar jigyasudhingra avatar kamal4126 avatar kunal1197 avatar laddhashreya2000 avatar martianmellow12 avatar math-o5 avatar nanoy42 avatar pranshuldobriyal avatar prit108 avatar priyanshu-official avatar puranjaymohan avatar rahulhambarde300 avatar roysti10 avatar saptashrungi avatar shaheer-rossoneri14 avatar shobhit10058 avatar siddharthaml avatar vnksnkr avatar vsawal avatar yjdoc2 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

sim-c's Issues

[FEATURE] Bitwise operators

Is your feature request related to a problem? Please describe.
Add support for bitwise operators in simC.

Describe the solution you'd like
Check implementation of other operators.

Note: Discuss the bitwise operators and their syntax with a maintainer before implementing.

[FEATURE] Write simC code for question 5

Question

Check for armstrong number.

Where to put the code?

In simc-codes directory

What to name the file?

q5.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 15

Question

Perimeter of a rectangle.

Where to put the code?

In simc-codes directory

What to name the file?

q15.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 27

Question

Sum of factorial of digits of a number.

Where to put the code?

In simc-codes directory

What to name the file?

q27.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 35

Question

Finding the roots of a quadratic equation using Sridharacharya's formula.

Where to put the code?

In simc-codes directory

What to name the file?

q35.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

This is not exactly dynamically typed.

You are saying that the language is dynamically typed, it's not. That's because you cannot change the type of a variable during runtime, I guess it wouldn't work. In fact, this language has type deduction, but It's still statically typed.

[FEATURE] Report bugs

Report any bug you encounter while using SimC

Format of Bug Submission
The format can be found in the file bugs/format.txt.
Separate files should be made for different bugs. The extension of all the bug-reports should be .txt

Write simC code for question 2[FEATURE]

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Note: You only start working on the feature if a maintainer approves that request in discussion.
Question

Sum of two numbers.

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 18

Question

Check if number is palindrome.

Where to put the code?

In simc-codes directory

What to name the file?

q18.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Allow C code to be written inside simC

Is your feature request related to a problem? Please describe.
Allowing user to write C code inside simC, this will be just copied and pasted into compiled C code without checking for syntax or compiling.

Describe the solution you'd like
Add two tokens BEGIN_C and END_C between which C code will be written, this should be directly pasted into appropriate location in compiled C code by simC compiler.

simC Code Example

MAIN
    var i = 0
    print(i)
    
    BEGIN_C
        int c = 10;
        int* ptr = &c;
        printf("%d\n", *ptr);
    END_C
END_MAIN

[FEATURE] Explicit typecasting

Is your feature request related to a problem? Please describe.
Explicit casting of types from by the user.

Describe the solution you'd like
Syntax will be similar to that of python (e.g. int(3.14159)). After successful type casting the type for the corresponding value should be updated in symbol table.

simC Code Example

MAIN
    var i = 3.14159
    var int_i = int(i)
    print(int_i)
END_MAIN

[FEATURE] Write simC code for question 6

Question

First 10 fibonacci series.

Where to put the code?

In simc-codes directory

What to name the file?

q6.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 34

Question

Define two string variables and concatenate their values and print the value.

Where to put the code?

In simc-codes directory

What to name the file?

q34.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 24

Question

Least of three numbers.

Where to put the code?

In simc-codes directory

What to name the file?

q24.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 32

Question

Compute the value of following series till nth term.

WhatsApp_Image_2020-03-07_at_23 25 57

Where to put the code?

In simc-codes directory

What to name the file?

q32.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 20

Question

Convert decimal number to binary number.

Where to put the code?

In simc-codes directory

What to name the file?

q20.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task.

[FEATURE] Implement sizeof

Is your feature request related to a problem? Please describe.
Implement sizeof operator to return the size of a variable.

Describe the solution you'd like
Whenever sizeof is called the type of the variable should be extracted from symbol table and based on this type return the size. Files to be changes for adding this are lexical_analyzer, parser, and compiler.

Note:- The size should not be static for every machine (e.g. size of an int variable should not return 4 for every machine), the result should be machine dependant and should be computed accordingly.

simC Code Example

MAIN
    var i = 3.14159
    var size = sizeof(i)
    print(size)
END_MAIN

[FEATURE] Write simC code for question 17

Question

Multiplication of digits of a number.

Where to put the code?

In simc-codes directory

What to name the file?

q17.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[BUG REPORT] Scope of variable

Describe the bug
Fails to take scope into account. Final value dicates the initial data type of the var even if they are contradictory in nature.

To Reproduce
simC code:-

var i = "asb"
MAIN
  var i = 10
  var j = 10
  print(i)
END_MAIN

C Code:-

#include <stdio.h>
int i = "asb";

int main() {
	int i = 10;
	int j = 10;
	printf("%d", i);

	return 0;
}

Expected behavior
C Code:-

#include <stdio.h>
char* i = "asb";

int main() {
	int i = 10;
	int j = 10;
	printf("%d", i);

	return 0;
}

[FEATURE] Write simC code for question 14

Question

Perimeter of a square.

Where to put the code?

In simc-codes directory

What to name the file?

q14.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[BUG REPORT] Cannot infer type of parameter in function

Describe the bug
Cannot infer type of parameter inside function body. The type inference here should be done after calling but is being done in the definition itself.

To Reproduce
simC code:-

fun sum(a, b) {
  var c = a+b
  return c
}

MAIN
var d = sum(1,2)
END_MAIN

C Code:-
Not generated, throws error.

Expected behavior
C Code:-

int sum(int a, int b) {
  int c = a+b;
  return c;
}

int main() {
  int d = sum(1,2)

  return 0;
}

[FEATURE] Write simC code for question 33

Question

Compute the value of following series till nth term.

WhatsApp_Image_2020-03-07_at_23 25 57-2

Where to put the code?

In simc-codes directory

What to name the file?

q33.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Add README in different languages.

REAMDE goes inside readme-lang folder. The naming convention used is README-(language name).md where (language name) is the name of language in which README is being translated.

Note: Discuss with a maintainer in this thread before starting to translate the README.

[FEATURE] Default parameters in functions

Is your feature request related to a problem? Please describe.
Add support for default parameters in functions in simC.

Describe the solution you'd like
Syntax will be similar to that of C.

simC Code Example

fun sum(a, b=2) {
    return a + b;
}

MAIN
    var result_1 = sum(1)
    print(result_1)
    
    result_1 = sum(1, 3)
    print(result_1)
END_MAIN

[FEATURE] Write simC code for question 19

Question

Convert binary number to decimal number.

Where to put the code?

In simc-codes directory

What to name the file?

q19.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 7

Question

Print left lower triangle.

Where to put the code?

In simc-codes directory

What to name the file?

q7.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 8

Question

Print right lower triangle.

Where to put the code?

In simc-codes directory

What to name the file?

q8.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 11

Question

Print diamond shape.

Where to put the code?

In simc-codes directory

What to name the file?

q11.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Implement typeof

Is your feature request related to a problem? Please describe.
Implement typeof operator in simC.

Describe the solution you'd like
Simply return the type of variable from symbol table. When typeof is called on a variable.

simC Code

MAIN
    var i = 3.14159
    typeof(i)
END_MAIN

[FEATURE] Write simC code for question 13

Question

Sum of digits of number.

Where to put the code?

In simc-codes directory

What to name the file?

q13.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[BUG REPORT] Does not allow single line block statements without { }

Describe the bug
Error when braces not included after if or any other block statement, when it should take only the immediate line into account.

To Reproduce
simC code:-

MAIN
  var i = 0
  if(i % 2 == 0)
    print("Even")
  else
    print("Odd")
END_MAIN

C Code:-
Not generated, throws error.

Expected behavior
C Code:-

int main() {
    int i = 0;
    if(i % 2 == 0)
        print("Even")
    else
        print("Odd")

    return 0;
}

[FEATURE] Write simC code for question 25

Question

Print reverse of a number.

Where to put the code?

In simc-codes directory

What to name the file?

q25.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 1

Question

Define a string variable and print it.

Where to put the code?

In simc-codes directory

What to name the file?

q1.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 12

Question

Print inverted triangle.

Where to put the code?

In simc-codes directory

What to name the file?

q12.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[BUG REPORT] No parantheses check

Describe the bug
No check for parenthesis pairs and missing parenthesis towards the end

To Reproduce
simC code:-

MAIN
var i = 1 +(((2)))
END_MAIN

C Code:-

int main() {
	int i = 1 + (((2);

	return 0;
}

Expected behavior
C Code:-

int main() {
	int i = 1 + (((2)));

	return 0;
}

[FEATURE] Write simC code for question 30

Question

Compute the following series till nth term.

WhatsApp_Image_2020-03-07_at_23 25 56

Where to put the code?

In simc-codes directory

What to name the file?

q30.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 28

Question

Permutation computation nPx.

Where to put the code?

In simc-codes directory

What to name the file?

q28.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 9

Question

Print left upper triangle.

Where to put the code?

In simc-codes directory

What to name the file?

q9.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 10

Question

Print right upper triangle.

Where to put the code?

In simc-codes directory

What to name the file?

q10.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Dynamic memory allocation

Is your feature request related to a problem? Please describe.
Dynamic memory allocation in simC.

Describe the solution you'd like
Open ended, come up with an intuitive syntax.

Note: Discuss syntax with a maintainer before implementing.

[FEATURE] Write simC code for question 22

Question

Maximum and minimum digits of a number.

Where to put the code?

In simc-codes directory

What to name the file?

q22.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 16

Question

Display the sum of even and odd digits of a number.

Where to put the code?

In simc-codes directory

What to name the file?

q16.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 29

Question

Combination computation nCx.

Where to put the code?

In simc-codes directory

What to name the file?

q29.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 4

Question

Check even or odd.

Where to put the code?

In simc-codes directory

What to name the file?

q4.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 31

Question

Check whether a year is leap or not.

Where to put the code?

In simc-codes directory

What to name the file?

q31.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

Write simC code for question 1[FEATURE]

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Note: You only start working on the feature if a maintainer approves that request in discussion.
Question

Define a string variable and print it.

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 3

Question

Check if number is prime or not.

Where to put the code?

In simc-codes directory

What to name the file?

q3.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 2

Question

Sum of two numbers.

Where to put the code?

In simc-codes directory

What to name the file?

q2.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 23

Question

Greatest of three numbers.

Where to put the code?

In simc-codes directory

What to name the file?

q23.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

[FEATURE] Write simC code for question 26

Question

Factorial without recursion.

Where to put the code?

In simc-codes directory

What to name the file?

q26.simc

Note: You can only start doing a question if it has been assigned to you by a maintainer. Once assigned to someone this questions will not be reassigned, it can only be reassigned if the person does not complete his/her task."

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.