Skip to content

Latest commit

 

History

History
438 lines (280 loc) · 15 KB

README-EN.MD

File metadata and controls

438 lines (280 loc) · 15 KB

Logo

Stars Issues BUPT License Test

NO LONGER MAINTAINED

The conic section is absotulely much funner than the toy language.

So I decided to abandon this toy.

Download and play.

I won't add any new features further.

This repository is pretty suitable for compiler newbies, so notice your code quality when submitting PRs.

That's all.

Note: Community PRs and issues are still acceptable.

Translation note: This translation will not be updated further by @ZeroAurora and @SherkeyXD. Very bad translation! Hate from BUPT.

Overview

English 中文 Русский

Next-Generation Cyber Programming Language from Litang.

Through the independently R&D of HeLang in Litang, we can create a new industrial ecology, power the brand new track, dig through the inner logic of programming languages, and finnally insert new grammar genes into the language development.

WATCH THE GREAT VIDEO! https://www.bilibili.com/video/BV1XW4y1h79A/

Star History Chart

Re-creation

Very good works! Love from Cyber Spaces!

Description

Nowadays in the 21st century, Helang, Jvav and C-- have become the three irreplaceable programming languages.

Saint He. (2202). A Brief Hestory of Cyber Programming Languages. Litang Computer Science and Technology Press.

Next generation cyber programming language, born in the E-SMOKER town, Cyber Litang.

This program was written by a self-typing 5G keyboard on AirDesk with AirPods in 108 cyber minutes.

It's so cool! What a just fit with my imagination for a better future. Science with delight.

PS: It took about 1! + 5! + 5! + 5! = 361 BUPTs (Basic Unit of Plain Time) to develop this language.

PS 2: BUPT also refers to Beijing University of Posts and Telecommunications in the cyber world. (Disclaimer: This project is just a satire of a particular person. No malice to the outstanding university!)

Usage

Use Without Installation

  1. Pull the source code:

    > git clone https://github.com/kifuan/helang.git
  2. Install third-party libraries:

    > pip install -r requirements.txt
    # if need GUI
    > pip install -r requirements-gui.txt
  3. Modify The Great Script helang/great.he, then run helang.py in a great way:

    > python helang.py great
  4. You can also launch helang.py in shell mode, to communicate with Saint He in HeLang in Cyber Spaces.

    > python helang.py shell

    Now, there's no need to append semicolons to the line end: we will do that for you. (Of course, you can choose to use semicolons to show your loyalty to Saint He)

    Type .help to get the runtime help. Yeah, a copy-paste from node's REPL Keywords.

  5. Saint He is generous. He forgives those who forgets to add startup arguments. So the following command is also valid:

    > python helang.py
  6. Develop with LTCode

    > python helang.py editor

    WIP. New features are planned. Only running code in current window is supported, and crashes may occur when frequently doing print.

Install Locally

  1. Pull the source code:

    > git clone https://github.com/kifuan/helang.git
  2. Install:

    > pip install .
  3. Run

    > helang shell

PS:

  • If you are from Planet Antimony, there is no need to use the stupid technology from sol3 aborigines. You can use 1.14514 sg (supergrams) nitrane to trigger the global termination of the Cyber Spaces through the exprinciple reaction to run the program directly.
  • When you're using Non-Apple devices to run, it will raise a warning. It seems like you're using a non-Apple device, which is not cool! If you want to disable this warning, please use Apple devices.

Attention: This is a very dangerous action with a chance of failing. If there is chickenium-niobium-titanium-magnesium nearby when you fail, it will be catalyzed and produce CH2N8. This action should be strictly regulated by exprinciple commitee.

Basic Grammar

Saint He noted that every type is u8. What does that mean? Reverse it so we get 8u (Ba You). Does Saint He use Tieba?

Besides, u8 is similar to v8 in shape. So follow Ace Ta↑ffy↓ nya, follow Ace Taffy thank you nya.

As you can see, we use |, the bitwise or, to replace the traditional array. Why are you still using traditional arrays nowadays?

u8 a = 1 | 2 | 3;

Saint He also noted that whichKey - 1, so the index starts at 1.

u8 a = 1 | 2 | 3;
print a[1];
// 1

But when you operate against a u8 variable, you can use index 0 to assign a value to all elements in the array.

u8 a = 1 | 2 | 3;
a[0] = 10;
print a;
// 10 | 10 | 10

To catch on with the latest technology, multi-index operations are also supported. No more for loops!

u8 a = 1 | 2 | 3;
a[1 | 2] = 0;
print a;
// 0 | 0 | 3

Also, we provide a way to initialize an array with a fixed length. Unfortunately, it's traditional. For example, the following code can initialize an array with 5 elements.

u8 a = [5];
print a;
// 0 | 0 | 0 | 0 | 0

In the end, we can combine all the grammar above to write the following code.

u8 forceCon = [68];

forceCon[1 | 2 | 6 | 7 | 11 | 52 | 57 | 58 | 65] = 10;

print forceCon;

Such fine code can't be understood by humans on earth. As a cyber intelligent life form, we could only show you the basics.

It's so cool. too long didn't write.

Hello, Litang.

Some programmers consider Helang as a piece of shit because it can't print Hello, Litang. .

But Saint He focuses on the development of MCUs. How can he take strings into account?

Well, after consultation, he agreed our request and allowed us to print Hello, Litang. in the language.

sprint 72 | 101 | 108 | 108 | 111 | 44 | 32 | 76 | 105 | 116 | 97 | 110 | 103 | 46;
// Hello, Litang.

To strictly optimize the performance, We use UTF-8 decimals instead of characters.

By decreasing readability, we gain exponential performance increase. Credits to the real god in the cyber world.

Print Logo

You may think it too easy to print only Hello, Litang. . After all, it doesn't meet with the science geek's imagination for a better future.

Actually, you can print HeLang's logo by:

> python helang.py logo

By looking at the source helang/logo.he, you will find the code is mostly numbers. In Cyber Spaces, complex images can be displayed with simple numbers. Isn't that cool?

Besides, you can also print HeLang Logo in HeLang code:

logo large;

Smaller and Medium? No problem.

logo tiny;

logo medium;

In this circumstance, every computation happens in Helang. In Cyber Spaces, complex images can be displayed with simple computations. COOL.

Increment

We noticed that increment (++) also appeared in the code by Saint He.

So, we allow this operation too.

u8 a = 1 | 2 | 3;
a++;
print a;
// 2 | 3 | 4

Addition and Subtraction

Saint He said whichKey - 1, so now we provide subtraction too.

u8 whichKey = 1 | 2 | 6 | 7;
print whichKey - 1;
// 0 | 1 | 5 | 6

Examples of operations between u8 variables:

u8 a = 1;
u8 b = 1 | 2 | 3;
u8 c = 2 | 4 | 6;
u8 d = 5 | 9;

print a + b;
// 2 | 3 | 4
print b + c;
// 3 | 6 | 9
print b - c;
// -1 | -2 | -3
print b + d;
// helang.exceptions.CyberArithmeticException: illegal operation: 1 | 2 | 3 + 5 | 9
print a - b;
// helang.exceptions.CyberArithmeticException: illegal operation: 1 - 1 | 2 | 3

It's so easy for you to figure out which statements are legal, even if you're a Cyber Spaces newbie!

Multiplication

Unlike addition and subtraction, multiplication can be done between any two u8s. u8s will be treated as vectors. Isn't it high-tech?

u8 a = 1 | 2;
u8 b = 3 | 4 | 5;
u8 c = 3 | 6 | 9;

print a * b;
// 1*3 + 2*4 + 0*5 = 9
print b * c;
// 3*3 + 4*6 + 5*9 = 68

Note: we use dot product ( $\vec{a}\cdot\vec{b}$ ), not out product.

Declarations and Assignments of Variables

In early versions, we only support variable initializations and don't support mutation and declarations. Because Saint He loves immutable.

After consulting, we can now support them!

// Now we support declarations before assignments. The code below is legal:
u8 a;
a = 1 | 2;

// In early versions only the following code worked, but it still works now.
u8 b = 3 | 4;

Warning! If a variable isn't declared or initialized, assigning it will raise CyberNameException.

c = 1 | 2 | 3;
// helang.exceptions.CyberNameException: c is not defined.

As a high-tech language, we need to be strict and precise.

Check If You Are in Cyber Spaces

To meet with Saint He, you need to be in Cyber Spaces. Use the command below to check if you're in position:

cyberspaces;
// Getting your location...
// Your location is UNITED STATES.
// Congratulations! You are in the Cyber Spaces!

Because Saint He lives in a cyber wonderland, he may be unable to see IPv6 clearly, so you may get the error Failed to resolve IP.

5G Speedtest

It's very simple, and all you need is to start a new line and type:

test5g;

Or an other mode:

test5g app;

Then you can start a 5G speedtest from this line.

Summary

  1. Follow Ace Taffy nya, follow Ace Taffy thank you nya.

  2. Follow NyaRu thank you nya, nya.

  3. Follow Xingtong, liuliu plums give out!

  4. Follow Diana, satisfy your craving for good food every dinner.

  5. Follow Ava, it's never too late to follow her!

  6. Follow Eileen, follow Eileen ga, follow Eileen thank you ga!

  7. Follow Bella, follow Bella mur, Follow Bella thank you mur!

  8. Report Rarity thank you nya, we can't let a Japanese eat Chinese rice nya.

  9. Follow AdhesionTek, violently kill Saint He nya🥰

  10. Follow HiiroVTuber, it's not a pink cat with 425KG nya!

  11. Follow GOGO! Follow GOGO woof, follow GOGO thank you woof!

  12. Follow KizunaAI_CN! Super cute Super AI violently kills Cyber Tenzin!

  13. Follow Mana, thank you nya.

  14. Follow Luo Tianyi, a more human-alike VSinger than Cyber Tenzin!

  15. Follow Tenzin Tsundue, why are you still following Cyber Tenzin nowadays? You'd better pay attention to the Traditional Tenzin!

  16. Follow Minato Aqua and Rinco! Stupid-overflowing ocean maid (shit onion) and a cute singer who likes Minase Inori. Looking forward to wood mouth spinning nie. Also, please support the galgame that Minato Aqua stars in!

  17. Follow Genshin Impact, playing Genshin Impact is much better than watching Cyber Tenzin!

  18. Follow Tang Jiuxia, thank you my father!

  19. Follow Kino, guard the most abstract princess in the world!

  20. Follow Katya, thank you yee!

  21. Follow Hiru, she can't understand all of these but her serration-shaped tooth are so cuuuuuuuuuteeeeeeeee I LOOOOVVEEEEEE HEEEERRRRRR AAAAAAAAAAAAAAA!

  22. Follow Azusa, you are so generous, thank you very much!

23, Follow Ke Jie, why are you still playing traditional Go nowadays?

  1. Follow EOE.MINUO. MUA! Minuo!

  2. Follow OTTO,The three-year-old king has no fear!

Addition

It's 2:00 a.m. now, I cured my mental internal friction.

Apple and AirPods are trademarks of Apple Inc., registered in the U.S. and other countries and regions.