I am making a programming language more secure than Rust

Sorry if this is the wrong section, feel free to remove it if it is.. but I wanted to share this here because, I know yall would be the ones to understand the importance of memory safety..

This language, is called HolyLang, currently I am working on the bootstrap phase of it.

It is written in pure Rust, with 0 dependecies. Handmade simple recursive-down parser and developed paranoidly with defensive coding techinques.

Additionally, for the parser and semantics layers, I have over 100% unit test coverage, not just lines covered, but also regions, functions and branches covered! Extremely time consuming, but worth it.

README:

HolyLang is more secure than Rust, but not as performant as Rust. The purpose of HolyLang is divine security, not speed.

  • HolyLang has readable syntax, and semantics. That is a security feature in its own because readable code = auditable code = maintainable code = probably secure code.

  • HolyLang has no borrow checker, and yet is still more secure than Rust. programs can be easily reasoned about due to the simple binary safey model of “move, or copy”.

  • HolyLang arithmetic is always checked, including bitwise. Floating point arithmetic is also always checked.

  • HolyLang has no warnings, only errors. Unreachable code? Error. Unused variable? Error. Etc.

  • HolyLang forces documentation for functions, structs, and constants.

  • HolyLang has no type inference, everything must be explicilty stated.

  • HolyLang does not allow overshadowing at all. Making codebases look cleaner, and reducing likelyhood of logic bugs.

  • HolyLang lock and unlock statements allow you to declare “zones” where variables behave as constants, dynamically.

  • HolyLang’s bootstrap compiler transpiles down to pure Rust for a mathematical guarantee of safety: "If Rust is safe, then HolyLang must also be at least as safe as Rust".

.. and a lot more! This is just the bootstrap compiler, the actual compiler will have even more security features, such as static stack analyzes that guarantee (at compile-time!) a program cannot overflow the stack, allowing for even stricter security than Rust, and even other formally verified languages like Ada SPARK, whom have no stack overflow protection.

Bootstrappable builds as per…?


I am personally more excited about Fil-C, a memory safe implementation of the C and C++ programming languages, to avoid the issues of Too Much Source Code and Too Much Source Code. Seems like a more efficient use of time to me to fix all security issues in C(++) than inventing more and more programming languages and rewriting decades old stable, battle tested C(++). But my opinion won’t have any sway on the Open Source ecosystem.


[1] [Feature] Split Fil-C and pizlonated library source code to enable packaging in existing Linux distributions · Issue #185 · pizlonator/fil-c · GitHub

1 Like

This is interesting and I will look deeper into it. However, you need to know that rust compiler.. is not truly a compiler. rust doesn’t compile, its llvm that does. rust is just parser and semantics, LLVM is one doing heavily lifting.

But yes, it could totally have a backdoor or something, but we can argue about everything in this manner. tcb has to be placed somewhere. ugh

Well, I heard of this language, but it appears to use a non-trivial runtime.. which means, even Rust is probably better than it. It’s not a bad language, but it’s n ot exactly a rust subsutite, nor even a holylang subsutite.. you can write kernels / firmware in rust/holylang (soon), can you do it with fil-c? because the way it looks a runtime is needed for it..

Some thoughts from glancing at it:

Reference documentation available/planned?

Thought given to FFI and linking with third-party libraries? (One big downside of Rust is that they still haven’t figured out how to get dynamic linking between Rust libraries written.)

Looks very similar to Go (a.k.a. Golang). Is it meant to be a memory-safe Go “clone” of sorts? Looks neat.

1 Like

Absolutely

Yes, FFI-like feature is in works, allowing you to export / import functions written in other languages.

Syntax very similar to Go, but also similar to Python, I use keywords like “elif” and “range”.

But semantics are completely different from Go, Go allows type inference, holylang doesn’t. Go allows errors to be not handled, holylang won’t., etc etc.

Btw, Holylang’s “best feature” will be implemented as soon as the bootstrap compiler is complete.

Static stack analysis, with no input from programmer, that guarantees 100% no stack overflow is possible, at compile time!.

Allowing you to write safe kernels/firmware!