Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🩱 THE One syntax: Idea, Improve 1️⃣ #172

Open
BaseMax opened this issue Jun 14, 2021 · 8 comments
Open

🩱 THE One syntax: Idea, Improve 1️⃣ #172

BaseMax opened this issue Jun 14, 2021 · 8 comments
Assignees
Labels
Good First Issue Good for newcomers hacktoberfest Help Wanted Extra attention is needed Sample Code Example code for better learning and how to function a process. tests

Comments

@BaseMax
Copy link
Member

BaseMax commented Jun 14, 2021

Hi there;
Welcome here. please share what you think and all of your idea.

@BaseMax
Copy link
Member Author

BaseMax commented Jun 14, 2021

// not required - default: package main

fn test {
    _ 1
    _ 2, 4, 6, 8
    _ 5+8
    _ (2 + 15 * ( 25 - 13 ) / 1 - 4) + 10 / 2
}

fn main {
    _ 1
    _ 110
    _ 123
}

@BaseMax
Copy link
Member Author

BaseMax commented Jun 14, 2021

i32 main {
   ret 10
}

@BaseMax
Copy link
Member Author

BaseMax commented Jun 14, 2021

test {

}
main {
   test()
}

@jbampton jbampton added Good First Issue Good for newcomers Help Wanted Extra attention is needed Sample Code Example code for better learning and how to function a process. tests labels Jun 14, 2021
@BaseMax
Copy link
Member Author

BaseMax commented Jun 14, 2021

type struct my {
  i32 a
  i32 b
}

main {
   my a
   a.a = 10
   a.b = 20
}

@BaseMax
Copy link
Member Author

BaseMax commented Jun 14, 2021

type enum my {
  MY_A
  MY_B
  MY_C
}

main {
   my a = MY_A
   _ a
}

@BaseMax
Copy link
Member Author

BaseMax commented Jun 14, 2021

type Point {
   i64 x
   i64 y
}

Point Point+(Point left, Point right) {
   Point p
   p.x = left.x + right.x
   p.y = left.y + right.y
   ret p
}

i32 main {
   Point p
   p.x = 50
   p.y = 80

   p = p+p

   __ p.x
   __ p.y

   return 1 // 1 = okay, default
}

@BaseMax
Copy link
Member Author

BaseMax commented Jun 15, 2021

a image from Amir (Go Language):

photo_2021-06-15_19-30-28

@BaseMax
Copy link
Member Author

BaseMax commented Jun 15, 2021

a image from Amir (Dart language):

photo_2021-06-15_19-31-02

@jbampton jbampton changed the title THE One syntax: Idea, Improve 🩱 THE One syntax: Idea, Improve 1️⃣ Jul 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Good First Issue Good for newcomers hacktoberfest Help Wanted Extra attention is needed Sample Code Example code for better learning and how to function a process. tests
Projects
None yet
Development

No branches or pull requests

2 participants