Code Monkey home page Code Monkey logo

kin's Introduction

Kin Logo

Write computer programs in Kinyarwanda!

Getting Started . Why Kin? . VS Code support . Show us what you did!

GitHub . GitHub last commit . Version . Stars . Issues

Description

Kin is a straightforward programming language created with the purpose of aiding Rwandans to write computer programs in their native language Kinyarwanda.

Why Kin?

  • Goal: Kin's main objective is to make learning programming more accessible by using Kinyarwanda, the native language for Rwandans.
  • Focus: It's a straightforward language, prioritizing easy of use over complex features. This makes it suitable for education purpose.
  • Use Cases: While Kin is great for learning the fundamentals, it's suitability for large-scale software development isn't guaranteed.

What does it look like

  • This is implementation of linear search:

    reka arr = [45, 56, 334, 78, 34, 78, 23, 90]
    
    reka i = 0
    
    reka key = 23
    
    subiramo_niba(i < KIN_URUTONDE.ingano(arr)) {
      niba (arr[i] == key) {
        tangaza_amakuru("Key ", key, " is on ", i + 1, " position")
      }
    
      i = i + 1
    }
    
  • Hello <name> !

    reka name = injiza_amakuru("Enter your name: ")
    tangaza_amakuru("Hello ", name, "!")
    
  • Executing system commands

    sisitemu("sudo shutdown now")
    

Syntax

Though Kin inherited it's syntax and structure from JavaScript, they're completely different when it comes to behavior. Some notable Kin's syntax rules are:

  • Semicolon:
    • A semicolon is required when you declare a variable but you don't assign a value to it.
       reka x; # This will work
      
    • A semicolon is required when a function returns but there's not expression to return.
      porogaramu_ntoya main() {
        tanga; # This will work
      }
      

      In General a semicolon is used to tell Kin that there's an ommited statement.

  • White spaces:
    • Kin ignores white spaces, that's why multiple lines can be written at the same line ... these codes are equivalens
      reka x = 5
      reka x=5
      

Fun fact!

  • Multiple statements can be written on the same line.

    reka name = injiza_amakuru("Enter your name: ") tangaza_amakuru("Hello ", name, "!")
    
  • Nested statements are also supported.

    tangaza_amakuru("Hello ", injiza_amakuru("Enter your name: "), "!")
    

Contributing

We still have a long way to go with Kin, we're calling for your contributions! Contributions are welcomed, refer to Contiributing.md for futher info.

Maintainers

This language is maintained by @pacifiquem.

License

This project is under MIT License.



PACIFIQUE Murangwa - Author

kin's People

Contributors

pacifiquem avatar regisrex avatar renovate[bot] 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar

kin's Issues

Error : `KIN_AMAGAMBO.tandukanya()` method issue

Describe the bug
issue when using the KIN_AMAGAMBO tandukanya method.
i am getting objects array instead of array of strings

To Reproduce
Steps to reproduce the behavior:

  1. make file try.kin
  2. add codes tangaza_amakuru(KIN_AMAGAMBO.tandukanya("hello world", " "))
  3. run kin run ./try.kin
  4. See result ([object Object])

Expected behavior
expected to get a string array.

Screenshots
image

[feature] : recursive functions in Kin

Based on basic behavior, and how Kin manages return-statement, it's not easy to write recursive functions.

we need to optimize this so that it'll be able to interpret recursive functions.

[Docs] : Add a comprehensive contribution guide

Is your feature request related to a problem? Please describe.
It's not that easy to contribute core things to Kin's repo because of a vague contribution guide which doesn't show what needs to be done in a comprehensive way.

Describe the solution you'd like
A clear and concise contribution guide for other developers

[REFACTOR] : folders arrangement for in-built methods

For now, every in-built function is in ./src/runtime/globals.ts file.

This is not good because it's not easy to find what you want to work on or view.

Solution:

We'll add in-built folder in the runtime, each method and it's associated functions will be added to their own file, all in built methods will be imported in ./src/runtime/globals.ts where their will be added to the global environment env for use.

[FEATURE] : Make `Kin` independent from Node.js - Provide independent executables with installers

Is your feature request related to a problem? Please describe.
Most of people who're being introduced to programming doesn't have tools like Node.js installed. Since Kin requires it to be installed, it adds extra layer of complexity.

Describe the solution you'd like
Provide Kin's executables as independent not depending to Node.js, also add installers for linux && windows OS with clear guide to do it.

Migrate codebase from ``C`` to ``C++``

This might sound like a crazy idea but yes, we have to migrate our code base from C to C++.
Here is the reason why:

As the codebase scales our codes are getting more messy, and the solution here to introduce Object Oriented Programming Language which is also a low-level and statically typed to help us organize our codes but also help us to consume the beauty of OOP.

This might be a little bit challenging but it will benefit us in future like:

  • Easy maintainance
  • C++ introducing more utility function ...

It was good that we reached here by using only C.

[Enhancement] : In-built function's validation utility

We repeat our selves too much while we're verifying if the number of parameters and number of arguments for native functions are the same as expected. We need to built a simple validation utility to help us avoid that. it has to be scalable so that in case we need to add further verifications it can be done easily ๐Ÿ‘

``Kin`` usage

Desc

Since our programming language will be interpreted we will need to tell user how he can use it. like list of commands and arguments so that he/she can get started.

Case

We will print usage when a user issues kin,kin help or kin -h commands in his/her terminal.
also when he/she issues unknown command we will print Command *issued-command* not found run *kin help* for usage

[Bug] : number of arguments can be less than number of parameters.

We don't check if number of arguments to functions are equal to number of parameters of that function.

this leads to errors like Error reading file: Cannot read properties of undefined (reading 'type').

How to fix this

  • For native functions:

in globals.ts inside runtime folder, always check if args.length == number of arguments the native function has to receive

  • For user defined functions

must be fixed in expressions.ts check if arguments, are equal to fn.parameters.length

[Feature] : Loop control statements: `break`

file : src/runtime/eval/statements.ts, on eval_loop method.

break : this keyword will stop kin's loop.
continue : this keyword will skip current iteration and go to the next one.

``Kin`` usage

Desc

Since our programming language will be interpreted we will need to tell user how he can use it. like list of commands and arguments so that he/she can get started.

Case

We will print usage when a user issues kin,kin help or kin -h commands in his/her terminal.
also when he/she issues unknown command we will print Command *issued-command* not found run *kin help* for usage

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

This repository currently has no open or pending branches.

Detected dependencies

github-actions
.github/workflows/auto-assign.yml
  • pozil/auto-assign-issue v1
.github/workflows/ci.yml
  • actions/checkout v4
  • actions/setup-node v4
.github/workflows/test-pr.yml
  • actions/checkout v4
  • actions/setup-node v4
npm
package.json
  • chalk ^5.3.0
  • commander ^12.0.0
  • moment ^2.30.1
  • prompt-sync ^4.2.0
  • @types/node ^20.11.9
  • @types/prompt-sync ^4.2.3
  • @typescript-eslint/eslint-plugin ^7.0.0
  • @typescript-eslint/parser ^7.0.0
  • @vitest/coverage-v8 ^1.2.2
  • eslint ^8.56.0
  • eslint-config-prettier ^9.1.0
  • eslint-plugin-prettier ^5.1.3
  • eslint-plugin-vitest ^0.3.20
  • husky ^9.0.10
  • prettier ^3.2.4
  • typescript ^5.3.3
  • vitest ^1.2.2

  • Check this box to trigger a request for Renovate to run again on this repository

[Docs] : Kinyarwanda's documentation.

Is your feature request related to a problem? Please describe.

No, add Kinyarwanda documentation to existing documentation.

Describe the solution you'd like

Since kin target the Rwanda, it would be better if the documentation, including readme are in kinyarwanda. I believe this can make it easier for Rwandan to understand this programming language.

Describe alternatives you've considered

Documentation support multiple languages like Kiswahili or French

Additional context
N/A

Kin Error: Unhandled: undefined

I encountered an error "Unhandled: undefined" while implementing the quick sort algorithm in Kin Lang. Here is the code snippet that produces the error:

reka urutonde_rwi_imibare = [34, 56, 23, 45, 34, 57]

porogaramu_ntoya igabanye(urutonde_rwi_imibare, hasi, hejuru) {
  reka pivot = urutonde_rwi_imibare[hejuru]
  reka i = hasi - 1

  reka j = hasi
  subiramo_niba(j < hejuru) {
    niba(urutonde_rwi_imibare[j] <= pivot) {
      i = i + 1
      reka ububiko_bwagateganyo = urutonde_rwi_imibare[i]
      urutonde_rwi_imibare[i] = urutonde_rwi_imibare[j]
      urutonde_rwi_imibare[j] = ububiko_bwagateganyo
    }
    j = j + 1
  }
  reka ububiko_bwagateganyo = urutonde_rwi_imibare[i + 1]
  urutonde_rwi_imibare[i + 1] = urutonde_rwi_imibare[hejuru]
  urutonde_rwi_imibare[hejuru] = ububiko_bwagateganyo
  garura i + 1
}

porogaramu_ntoya quick_sort(urutonde_rwi_imibare, hasi, hejuru) {
  niba(hasi < hejuru) {
    reka pivot_index = igabanye(urutonde_rwi_imibare, hasi, hejuru)
    quick_sort(urutonde_rwi_imibare, hasi, pivot_index - 1)
    quick_sort(urutonde_rwi_imibare, pivot_index + 1, hejuru)
  }
}

reka hasi = 0
reka hejuru = KIN_URUTONDE.ingano(urutonde_rwi_imibare) - 1
quick_sort(urutonde_rwi_imibare, hasi, hejuru)

reka i = 0
subiramo_niba(i < KIN_URUTONDE.ingano(urutonde_rwi_imibare)) {
  tangaza_amakuru(urutonde_rwi_imibare[i])
  i = i + 1
}

Error Message:
The error occurs on line 2: "Kin Error: Unhandled: undefined".

Context:
I am trying to implement merge sort in Kin Lang. The error seems to be related to the array slicing or loop conditions. Any guidance or fixes would be appreciated.

[Error] : `KIN_AMAGAMBO.ingano()` method.

Describe the bug
issue when using the KIN_AMAGAMBO ingano method getting error (Error reading file: Cannot read properties of undefined (reading 'type'))

To Reproduce
Steps to reproduce the behavior:

  1. make file try.kin
  2. add codes tangaza_amakuru(KIN_AMAGAMBO.ingano("hello"))
  3. run kin run ./try.kin
  4. See error

Expected behavior
could get 5 as result

Screenshots
image

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.