Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/one-language/one

One (onelang) is an open-source system programming language that makes it easy to build reliable, efficient and performant software. (release as soon) 1️⃣ 🕐 🩱
https://github.com/one-language/one

compiler compiler-backend compiler-designs compiler-frontend compiler-optimization compiler-tool compilers-design hacktoberfest language llvm llvm-compiler llvm-frontend one one-lang onelang open-source programming programming-language programming-languages self-hosting

Last synced: 5 days ago
JSON representation

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

Awesome Lists containing this project

README

        



The One Programming Language

# The One Programming Language 💚 💙 🧡 🤍 💖 🖤

[Onelang.org](https://onelang.org) |
[Help wanted](https://github.com/One-Language/One/issues?q=is%3Aissue+is%3Aopen+label%3A%22Help+Wanted%22)

[![Patreon][patreonbadge]][patreonurl]
[![Discord][discordbadge]][discordurl]
[![Facebook][facebookbadge]][facebookurl]
[![Instagram][instagrambadge]][instagramurl]
[![Twitter][twitterurl]][twitterbadge]
[![License][licensebadge]][licenseurl]

[English](README.md)
 
[عربي](docs/README_AR.md)
 
[Español](docs/README_ES.md)
 
[فارسی](docs/README_FA.md)
 
[Filipino](docs/README_FIL.md)
 
[Français](docs/README_FR.md)
 
[Italiano](docs/README_IT.md)
 
[日本語](docs/README_JA.md)
 
[한국어](docs/README_KR.md)
 
[русский](docs/README_RU.md)
 
[Türkçe](docs/README_TR.md)
 
[Українська](docs/README_UK.md)

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

![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)

Table of Contents


  1. Features of One

  2. RoadMap

  3. Code Examples

  4. Getting Started

  5. Get Involved

  6. License

  7. Contributors

![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)

➤ 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)

![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)

➤ RoadMap

Grammar of the `One` language is available [here](grammar.BNF).

- [x] Lexer/Parser (Mostly)
- [x] AST Tree
- [x] 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

![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)

➤ Code Examples

```c
main {
ret 0
}
```

**Convert to C:**

```c
#include
#include
int main(int argc, char *argv[]) {
global_argc = argc;
global_argv = argv;
return (int) 0;
}
```

---

```c
i32 main {
ret 10
}
```

**Convert to C:**

```c
#include
#include
int main(int argc, char *argv[]) {
global_argc = argc;
global_argv = argv;
return (int) 10;
}
```

---

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

**Convert to C:**

```c
#include
#include
#include
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:**

```c
import web
home {
_ "Hi, Welcome"
}
error {
headers.add('HTTP/1.0 404 Not Found')
headers.add('content-type: text/html;charset=utf-8')
_ "

404>

"
}
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:**

```c
error {
headers.add('HTTP/1.0 404 Not Found')
headers.add('content-type: text/html;charset=utf-8')
_ `Error 404

404>

`
}

vs

error {
headers.add('HTTP/1.0 404 Not Found')
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:

```css
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


Name - Main



* {
margin: 0;
padding: 0;
}
header {
width 100%;
height: auto;
}
ul {
color: red;
}
ul li {
display: inline;
padding: 10px;
background: yellow;
}





  • Home

  • About

  • Contact Us



```

![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)

➤ Getting Started

Refer to [this link](https://one-language.github.io/Document/#/) to start learning the language.

#### Supported Environments

- [x] GNU / Linux
- [x] Windows
- [ ] macOS (Not complete)
- [ ] BSD

![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)

➤ 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](https://docs.github.com/en/github/collaborating-with-pull-requests/proposing-changes-to-your-work-with-pull-requests/about-pull-requests).

If you have decided to contribute, please first read the guidelines [here](CONTRIBUTING.md).

You can also help in the development of `One` by making some donations on [:heart: Patreon](https://www.patreon.com/onelanguage).

Thanks to all the contributors!!

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


Created By Max Base @ 2019
![-----------------------------------------------------](https://raw.githubusercontent.com/andreasbm/readme/master/assets/lines/rainbow.png)

➤ 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


The One Contributors

Made with [contrib.rocks](https://contrib.rocks/preview?repo=One-Language%2FOne).

[discordbadge]: https://img.shields.io/discord/834373930692116531?label=Discord&logo=discord&logoColor=white
[facebookbadge]: https://img.shields.io/badge/Facebook-Up-brightgreen
[instagrambadge]: https://img.shields.io/badge/Instagram-Up-brightgreen
[licensebadge]: https://img.shields.io/github/license/One-Language/One
[patreonbadge]: https://img.shields.io/endpoint.svg?url=https%3A%2F%2Fshieldsio-patreon.vercel.app%2Fapi%3Fusername%3Donelanguage%26type%3Dpledges
[twitterbadge]: https://twitter.com/onelangteam
[discordurl]: https://discord.gg/sFCE2HcMCa
[facebookurl]: https://www.facebook.com/onelangteam
[instagramurl]: https://www.instagram.com/one.lang
[licenseurl]: https://github.com/One-Language/One/blob/master/LICENSE
[patreonurl]: https://patreon.com/onelanguage
[twitterurl]: https://img.shields.io/twitter/follow/onelangteam.svg?style=flatl&label=Follow&logo=twitter&logoColor=white&color=1da1f2