bhai-lang icon indicating copy to clipboard operation
bhai-lang copied to clipboard

Make It an ACTUAL programming language.

Open electrolyte-orb opened this issue 2 years ago • 14 comments

Description

To make it a serious programming language, we'll need to add atleast barebones for a lang.

  1. Static types bhai ye hai a = 0 to bhai ye shabd hai a = "strings"
  2. Runtime features dekh $PATH for getting current PATH.
  3. Add more data types.
Type Syntax
String shabd
Number ginti
Array dhara
Object Could be determined by the class
  1. Object oriented features like class(for very least) and inheritance(for mainstream langs)

Domain

Bhai Lang

Type of Contribution

Enhancement

Code of Conduct

electrolyte-orb avatar Mar 15 '22 15:03 electrolyte-orb

mai ispe contribute karu bhai??

thecodacus avatar Mar 17 '22 07:03 thecodacus

mai ispe contribute karu bhai??

If you are sure in every way(like optimization, size, complexity) then just go ahead 😋

electrolyte-orb avatar Mar 17 '22 07:03 electrolyte-orb

added a PR for Funda, it will introduce functional programming

you can check it in preview build https://6234ac37ec8e100008f579b5--bhailang-preview.netlify.app/#playground

thecodacus avatar Mar 18 '22 16:03 thecodacus

added a PR for Funda, it will introduce functional programming

you can check it in preview build https://6234ac37ec8e100008f579b5--bhailang-preview.netlify.app/#playground

bhai you are awesome!

Lekin homepage me bhi toh funda daal do.

electrolyte-orb avatar Mar 18 '22 16:03 electrolyte-orb

Should I close this issue now?

Edit: although less than 10% of my issue is resolved.

electrolyte-orb avatar Mar 19 '22 03:03 electrolyte-orb

I am working on adding class

thecodacus avatar Mar 19 '22 04:03 thecodacus

How does this look?? these features are built on top of the changes in the last PR, I can add a PR once the last PR is accepted

image

thecodacus avatar Mar 20 '22 16:03 thecodacus

You are just awesome!

electrolyte-orb avatar Mar 20 '22 16:03 electrolyte-orb

How does this look?? these features are built on top of the changes in the last PR, I can add a PR once the last PR is accepted

image

Hey wait. 😐 Where is new keyword implementation?

What you have implemented is just same as getting output of a function. I think just refactor and everything will be just fine.🥲

samajh le bhai janwar {
}

samajh le bhai kutiya jo ki ek janwar hai {
// Same
}

Bhai ye hai Alice = bana kutiya()

kutiya.bhouk()

I'm using bana as new but you can use a better keyword

electrolyte-orb avatar Mar 20 '22 16:03 electrolyte-orb

new is not necessary for this (take python for example), by default it creates a new object, and it's different than a function, functions will not have methods of it's own or it's own data members,

see the example below:

image

thecodacus avatar Mar 20 '22 19:03 thecodacus

new is not necessary for this (take python for example), by default it creates a new object, and it's different than a function, functions will not have methods of it's own or it's own data members,

see the example below:

image

I've only worked with JS/TS and C#. Both of them use new so I thought same for bhailang. But python's implementation is also good.

electrolyte-orb avatar Mar 21 '22 01:03 electrolyte-orb

naya keyword can be used

PositiveUser avatar Mar 22 '22 15:03 PositiveUser

No need for unintended naya if @thecodacus has already implemented it(python like syntax).

electrolyte-orb avatar Mar 22 '22 15:03 electrolyte-orb

#257 Added a pr for class feature

thecodacus avatar Mar 27 '22 16:03 thecodacus