GithubHelp home page GithubHelp logo

eltociear / one Goto Github PK

View Code? Open in Web Editor NEW

This project forked from one-language/one

0.0 2.0 0.0 2.29 MB

One (onelang) is an open-source system programming language that makes it easy to build reliable, efficient and performant software. (release as soon) 1️⃣ πŸ• 🩱

Home Page: https://onelang.org

License: GNU General Public License v3.0

Makefile 0.16% C 93.48% JavaScript 3.44% CMake 0.67% HTML 1.80% Dockerfile 0.27% Shell 0.18%

one's Introduction

The One Programming Language

The One Programming Language πŸ’š πŸ’™ 🧑 🀍 πŸ’– πŸ–€

Onelang.org | Help wanted

Welcome to One!
It is an open source, self-hosted, bootstrapping system programming language which makes it easy to build reliable and efficient software. It is being developed by Max, John and other open-source contributors.

Compiler for the One Language will be released in a few months

-----------------------------------------------------

Table of Contents

  1. Features of One
  2. RoadMap
  3. Code Examples
  4. Getting Started
  5. Get Involved
  6. License

-----------------------------------------------------

➀ Features of One

  • Simplicity
  • Compiler
  • Ability to create output file (x86_64, i386)
  • System Programming Language
  • Intermediate level
  • Network and API programming
  • Supports Web Programming (in the future)
    • Automatic generation of corresponding code for both CSS and HTML. So you won't have to learn more than One language to develop a website
    • Uses variables in CSS, so that we can obtain the colors or sizes from the database
    • Auto minify the page results
  • Performance and high speed
  • Supports inline Assembly code (in the future)
  • Does not require specific libraries and tools on the user system in normal mode (in the future)
  • Does not require external runtime libraries in normal mode (in the future)
  • Does not require external compilers to do the compilation (in the future)

-----------------------------------------------------

➀ RoadMap

Grammar of the One language is available here.

  • Lexer/Parser (Mostly)
  • AST Tree
  • VM
  • Code Generator (get inspired from LLVM-C)
  • Develop a runtime library and add features
  • Design web framework for the language
  • Rewrite compiler in the One language

-----------------------------------------------------

➀ Code Examples

main {
   ret 0
}

Convert to C:

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
   global_argc = argc;
   global_argv = argv;
   return (int) 0;
}

i32 main {
   ret 10
}

Convert to C:

#include <stdio.h>
#include <stdlib.h>
int main(int argc, char *argv[]) {
   global_argc = argc;
   global_argv = argv;
   return (int) 10;
}

main {
   string in = "Hello, World!"
   __ in
   return in.length
}

Convert to C:

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(int argc, char *argv[]) {
   global_argc = argc;
   global_argv = argv;
   char *in = "Hello, World!";
   printf("%s\n", in);
   return (int) strlen(in);
}

Another draft:

import web
home {
    _ "Hi, Welcome"
}
error {
    headers.add('HTTP-Type: 404')
    headers.add('Content-Type: text/html;charset=utf-8')
    _ "<h1>404></h1>"
}
main {
    if system.args.length === 2 {
        port = system.args[1]
    } else  {
        port=8080;
    }
    web.route.add("/", home)
    web.route.add("*", error)
    web.listen(port)
    return 0
}

Another draft:

error {
    headers.add('HTTP-Type: 404')
    headers.add('Content-Type: text/html;charset=utf-8')
    _ `<!doctype html><html><head>title>Error 404</title><meta charset="utf-8"></head><body><h1>404></h1></body></html>`
}

vs

error {
    headers.add('HTTP-Type: 404')
    headers.add('Content-Type: text/html;charset=utf-8')
    page {
        title: 'Error 404'
        label {
            type: 'h1'
            _ "Not found!"
        }
    }
}

Old CLI Development

main:
   // __ "Hello, World!"
   _ "Hello,"
   io.write(' ')
   io.write("World")
   __ '!'
end
@start
customName:
   _ "Hello, World!\n"
end
@start
void app:
   __ "Hello, World!"
end
@start
int customName:
   _ "Hello, World!\n"
   return 0
end

Old GUI Development: (Web, Software)

This architecture is being designed only for websites and native software. In the future, it will also be available for mobile apps (native).
Mobile structures are not yet complete and require more attention and thought.

Example to demonstrate working of the language:

title "Name - Main"
description "Descriptions"
/*
Keyword tag not used in the software, only on the web.
*/
keyword "keywords"
style {
  * {
    margin 0
    padding 0
  }
  header {
    width "100%"
    height "auto"
  }
  list {
    color "red"
  }
  list item {
    display "inline"
    padding "10px"
    background "yellow"
  }
}
header {
  list {
    item {
      _ "Home"
    }
    item {
      _ "About"
    }
    item {
      _ "Contact Us"
    }
  }
}

Convert to CSS/HTML/JS base:

<html>
  <head>
    <title>Name - Main</title>
    <meta name="description" content="Descriptions" />
    <meta name="keyword" content="keywords" />
    <style>
      * {
        margin: 0;
        padding: 0;
      }
      header {
        width 100%;
        height: auto;
      }
      ul {
        color: red;
      }
      ul li {
        display: inline;
        padding: 10px;
        background: yellow;
      }
    </style>
  </head>
  <body>
    <header>
      <ul>
        <li>Home</li>
        <li>About</li>
        <li>Contact Us</li>
      </ul>
    </header>
  </body>
</html>

-----------------------------------------------------

➀ Getting Started

Refer to this link to start learning the language.

Supported Environments

  • GNU / Linux
  • Windows
  • macOS (Not complete)
  • BSD

-----------------------------------------------------

➀ Get Involved

We welcome all kinds of contributions, including bug reports, feature requests, documentation improvements etc. To ask a question or open a discussion, create an issue or join the One Discord Server.

If you are not familiar with how to make a pull request on GitHub then please read this guide.

If you have decided to contribute, please first read the guidelines here.
You can also help in the development of One by making some donations on ❀️ Patreon.

Thanks to all the contributors!!

If you would like to contribute in the development of this project, you can mail us at: [email protected]


Created By Max Base @ 2019 -----------------------------------------------------

➀ License

One is released under the GNU General Public License v3.0. Please refer to the terms in the LICENSE file included in the repository.

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Max Base

πŸ’» πŸ› πŸ’Ό πŸ–‹ πŸ“– πŸ’‘ πŸ€” πŸš‡ 🚧 πŸ§‘β€πŸ« πŸ“† πŸ’¬ πŸ‘€ ⚠️

John Bampton

πŸ“† πŸ’Ό πŸ’» πŸ“– πŸ“‹ πŸ’΅ πŸ” πŸ€” πŸš‡ 🚧 πŸ§‘β€πŸ« πŸ‘€ ⚠️ βœ… πŸ“’

basalumutgazi

πŸ“– 🌍 πŸ“† πŸ§‘β€πŸ«

Nikita Sharma

πŸ“–

Aaron Meese

πŸ“–

Akshay Kapoor

πŸ“–

All Contributors

πŸ“–

Dependabot

🚧 πŸ›‘οΈ

Kotbi Abderrahmane

πŸ’» πŸ“–

Jas

🎨

Mujahid Al-Majali

πŸ“– πŸ“†

Anderson GarcΓ­a

🌍

Ray Arayilakath

πŸ“–

Ikko Ashimine

πŸ“–

murat aka

πŸ’»

Amir

🌍

Ubersetzerin

🌍

mafedeocampo

🌍

Mohit Saxena

πŸ“– πŸ’»

Pedram Lotfi

πŸ“–

Arthur Correnson

🌍

Michael Brown

πŸ’»

Ahmed.

πŸ“–

parsa mahmoudy

πŸ“–

Restyled Commits

πŸ’»

Karim Khasan

🌍

Hasidul Islam

πŸ‘€

DanyB0

🌍

This project follows the all-contributors specification. Contributions of any kind welcome! 🩱 πŸ• 1️⃣ πŸ”‚

one's People

Contributors

jbampton avatar abdorah avatar dependabot[bot] avatar allcontributors[bot] avatar pedramcvx1 avatar basalumutgazi avatar amir-shiati avatar programcodes avatar n4i9kita avatar restyled-commits avatar danyb0 avatar jassab avatar majalian avatar xahmd avatar mikey-b avatar murataka avatar ajmeese7 avatar the-ak avatar acorrenson avatar johnbampton avatar eltociear avatar kkkkkk58 avatar parsa011 avatar restyled-io[bot] avatar

Watchers

James Cloos avatar  avatar

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.