Source | Luo Qiqi / OSC Open Source Community (ID: oschina2013)
Previous Valuable Notes Compilation
-
Burning the Midnight Oil: Linux Quick Reference Guide.pdf
-
My Browser Bookmarks Revealed
-
Data Structures and Algorithms Problem-Solving Notes.pdf Download
-
LeetCode Algorithm Problem-Solving C/C++ Version Answers pdf Download
-
LeetCode Algorithm Problem-Solving Java Version Answers pdf Download
-
Job Application Resume Template Collection (Word Format) Download
-
Java Core Knowledge Summary.pdf Download
-
C/C++ Common Interview Questions (with Answers) Download
-
Design Patterns Study Notes.pdf Download
-
Java Backend Development Learning Path + Knowledge Summary
-
Frontend Development Learning Path + Knowledge Summary
-
Big Data Development Learning Path + Knowledge Summary
-
C/C++ (Backend) Learning Path + Knowledge Summary
-
Embedded Development Learning Path + Knowledge Summary
Recently, developer Drew DeVault announced a new system programming language called Hare (野兔)
The development of Hare has taken nearly two and a half years. It utilizes a static type system, manual memory management, and minimal runtime, making it well-suited for writing operating systems, system tools, compilers, and other low-level high-performance tasks.
According to Drew DeVault, Hare is similar to C, and almost all programs written in C can also be written in Hare, but Hare is simpler than C.
Hello World in Hare
use fmt;
export fn main() void = {
const greetings = [
"你好,世界!",
"¡Hola Mundo!",
"Γειά σου Κόσμε!",
"Привет, мир!",
"こんにちは世界!",
];
for (let i = 0z; i < len(greetings); i += 1) {
fmt::println(greetings[i])!;
};
};
Hare calculates its own SHA-256 hash:
use crypto::sha256;
use encoding::hex;
use fmt;
use hash;
use io;
use os;
export fn main() void = {
const hash = sha256::sha256();
const file = os::open("main.ha")!;
defer io::close(file);
io::copy(&hash, file)!;
let sum: [sha256::SIZE]u8 = [0...];
hash::sum(&hash, sum);
hex::encode(os::stdout, sum)!;
fmt::println()!;
};
Hare is based on the qbe compiler backend, providing good performance with a small footprint.
Current Status of Hare
Currently, there are many programs based on the Hare programming language, such as:
- Himitsu: A key management and password storage tool. It stores keys as key/value pairs and allows for additional information such as usernames, hosts, and protocols.
- Helios: A microkernel for x86_64 systems.
- box: A simple CLI encryption tool.
- btqd: A BitTorrent daemon.
- hare-libui: A simple GUI binding for libui.
OpenGL bindings for Hare are in progress and are currently available for several small games, such as Tetris:
A simple ray tracer written in Hare:
The Hare standard library includes the following standard components, supporting many use cases without any dependencies.
- Cryptographic suite
- Network support
- Comprehensive date/time operations
- I/O and filesystem abstractions
- Unix primitives such as poll, fnmatch, and glob
- POSIX extended regular expressions
- Hare parser and type checker
This standard library frees Hare from the legacy issues of POSIX and libc, and Hare programs do not link with libc by default.
Future of Hare
Currently, Hare is under conservative development, with the primary task of the standard library being the completion of cryptographic implementations, with the primary goal of supporting TLS (Transport Layer Security) 1.2 and TLS 1.3.
Once version 1.0 is reached, Hare will finalize the language specification, freeze language design, and only make backward-compatible changes to the standard library.
Additionally, Hare currently supports only three architectures: x86_64, aarch64, and riscv64, with plans to gradually add support for 32-bit platforms and other architectures in the future.
In terms of operating systems, Hare currently only supports Linux and FreeBSD, with plans for more ports in the future.
We do not intend to support non-free platforms, but since the language is standardized, third-party implementations or forks can easily be developed to support Windows or macOS if needed.
More information about Hare’s plans can currently be found on the roadmap:https://harelang.org/roadmap
What do you all think about this programming language?
Previous Valuable Notes Compilation
-
Burning the Midnight Oil: Linux Quick Reference Guide.pdf
-
My Browser Bookmarks Revealed
-
Data Structures and Algorithms Problem-Solving Notes.pdf Download
-
LeetCode Algorithm Problem-Solving C/C++ Version Answers pdf Download
-
LeetCode Algorithm Problem-Solving Java Version Answers pdf Download
-
Job Application Resume Template Collection (Word Format) Download
-
Java Core Knowledge Summary.pdf Download
-
C/C++ Common Interview Questions (with Answers) Download
-
Design Patterns Study Notes.pdf Download
-
Java Backend Development Learning Path + Knowledge Summary
-
Frontend Development Learning Path + Knowledge Summary
-
Big Data Development Learning Path + Knowledge Summary
-
C/C++ (Backend) Learning Path + Knowledge Summary
-
Embedded Development Learning Path + Knowledge Summary