Giter Site home page Giter Site logo

anoniscoding / yorlang Goto Github PK

View Code? Open in Web Editor NEW
445.0 34.0 67.0 2.82 MB

A programming language with yoruba language construct

Home Page: https://anoniscoding.github.io/yorlang/

License: MIT License

JavaScript 96.16% HTML 3.54% Dockerfile 0.04% Shell 0.26%
yoruba programming language esoteric-language javascript esoteric

yorlang's People

Contributors

adexot avatar anoniscoding avatar ddamox avatar lekky71 avatar mykeels avatar skyusuf15 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yorlang's Issues

Add support for negative number literal

Is your feature request related to a problem? Please describe.
I tried to run this code:

sọpé ọjọ(
    aago(),
    -3
);

which is supposed to subtract 3 days from the current date, and it fails because it does not recognise -3, but it works if 0 - 3 is used instead.

Describe the solution you'd like
Negative number literals should be recognisable.

Add a TODO list

First and foremost!. I have been looking forward to this kinda project and I'm super excited someone has started it. Cooooooooooool. Now, I feel and want to contribute but idk what's needed to be added and so. Do add a TODO list, that'll help guide contributors.

Error in tàbí ṣé conditionals

Describe the bug

I tried writing the following function:

ise muIseju(iseju) {
    ṣé (iseju > 30) {
        pada BEFOREPOINTER + muNọmbaWa(60 - iseju);
    }
    tàbí ṣé (iseju < 30) {
        pada AFTERPOINTER + muNọmbaWa(iseju);
    }
    tàbí {
        pada aabo;
    }
}

There's already an imported constants.yl file with a function definition for muNọmbaWa, and variable declarations for BEFOREPOINTER, AFTERPOINTER and aabo.

To Reproduce
Steps to reproduce the behavior:

  1. When I supply 22 as an argument, I get undefined as its return value, but 32 as an argument returns Ku iseju Mejidinlogbon which is fine.

  2. If I flip the logic, and specify < before >, then 22 works and 32 does not.

  3. If I rewrite as nested if-else statements, then it works well.

    ṣé (iseju < 30) {
        pada AFTERPOINTER + muNọmbaWa(iseju);
    }
    tàbí {
        ṣé (iseju > 30) {
            pada BEFOREPOINTER + muNọmbaWa(60 - iseju);
        }
        tàbí {
            pada aabo;
        }
    }

Expected behavior
ṣé and tàbí ṣé should work.

Counter Loop variables passed to Functions do not change.

Describe the bug
When a loop's counter variable is passed to a function, the first value passed becomes the value for all subsequent passes.

To Reproduce
Run the following code:

ise output (i) {
    sọpé i;
}

fún (jeki i = 1; i <= 3; jeki i = i + 1;) {
    output(i);
}

prints out

1
1
1

Expected behavior
The actual values get passed to the function, so it prints out

1
2
3

Naming Review (Suggestion)

Hi Anu, nice project you have here, I'm glad you did this and I am happy for your innovative ideas.

Below are some of the things I want to suggest as regards the naming, especially the condition block name.

e.g.

ṣé should be used for do() while should be used for if(), tàbí tí for elseif() and else for tabí;

e.g

jẹ́kí orúkọ = "tunde";
jẹ́kí orúkọ = "sunmi";

tí ( orúkọ == "dammy" ){
    sọpé "oruko okunrin ni";
} tàbí tí ( orúkọ == "sunmi" ) {
    sọpé "oruko okunrin ni";
} tàbí {
    sọpé "oruko okunrin ati oruko obinrin ni";
}


Thanks in advance

Helper: Random Number Generation

Is your feature request related to a problem? Please describe.
I can't find a way to generate random numbers

Describe the solution you'd like
A helper function that takes in 2 parameters representing the lower and upper limit of a generated random number.

I'm not sure what such a function would be called, but google translate suggests yipo. Are there better alternatives?

jẹ́kí should not be use with increments

Since jẹ́kí is use for creating variables it makes no sense using it to increment for example fún ( jẹ́kí i = 0 ; i < 5 ; jẹ́kí i = i + 1 ;) {}, jẹ́kí i = i + 1 should be i = i + 1 since variable i as been created, no point creating it again and I don’t see any reason why we should use a keyword to assign values to variables

Error messages ought to be in Yoruba

This is a cool project and would be fun to see it grow, and maybe the language might one day be rewritten with itself.

But I think error messages should be printed in Yoruba, or maybe run program with a flag that specifies which language results, warnings and error messages should be displayed in.

Remove intonation symbols

One of the major challenges I just faced while trying to use yorlang is the fact that I had to change the keyboard language, every time I have to write the code, and besides, most Yoruba people these days don't even understand those signs, let along code in it. I see potential in this project, but I feel we can do away with the symbols, hopefully convincing enough.

Add more String helpers

More string helpers
Only toUpperCase and toLowerCase functions are available

Contribution
I can add more and send a PR

Add TravisCI to the project

Adding TravisCI to the project makes it easier for contributions to the project repo. All test are run immediately there is a PR to this repo.

Naming Review (Suggestion)

Hi Anu, nice project you have here, I'm glad you did this and I am happy for your innovative ideas.

Below are some of the things I want to suggest as regards the naming, especially the condition block name.

e.g.

ṣé should be used for do() while should be used for if(), tàbí tí for elseif() and else for tabí;

e.g

jẹ́kí orúkọ = "tunde";
jẹ́kí orúkọ = "sunmi";

tí ( orúkọ == "dammy" ){
    sọpé "oruko okunrin ni";
} tàbí tí ( orúkọ == "sunmi" ) {
    sọpé "oruko okunrin ni";
} tàbí {
    sọpé "oruko okunrin ati oruko obinrin ni";
}


Thanks in advance

Assigning variables

From the docs, the assigning of variables goes thus:

ti abd = "abd"

But, ti in Yoruba actually means if that's If I'm not mistaking and let ( which I assume you translated to ti ) should be jẹki instead. Lmk know your thoughts. I was thinking of fixing and sending a PR but it's wise to discuss it first.

Contributing

Please provide a list of steps for others to modify an add to the yorlang core.

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.