GearLang – A Systems Programming Language For Flexibility, Control, and Interoperability

Systems programming can be difficult and verbose. Just take a single function from my current project:

virtual auto iterate_parsers(
std::span<std::shared_ptr<token::Base>>& list,
std::vector<std::function<Node*(std::we…


This content originally appeared on DEV Community and was authored by kwphil

Systems programming can be difficult and verbose. Just take a single function from my current project:

virtual auto iterate_parsers(
    std::span<std::shared_ptr<token::Base>>& list,
    std::vector<std::function<Node*(std::weak_ptr<Node>)>>& types,
    std::weak_ptr<Node>& parent
) -> std::optional<std::shared_ptr<Node>> const;

I know it's a lot, right?

What if we wanted something cleaner, but more importantly, something faster and less error prone? Well, I introduce you to GearLang, a proposed programming language with the benefits of Zig's comptime, Rust's enums, C++'s classes, and the full use of C/C++ ecosystems!

Clean Syntax

GearLang prioritizes minimal syntax to increase visibility, where we need it most!

fn main {
  greet "bob";
  exit 0;
}

fn greet name:string => f"Hello, {name}!";

Comptime calculations and checks

One of the big things about Zig is the comptime, but I feel like we can do a little more with it. Introducing Comptime checks! A way to assert valid code each time the program runs!

fn main {
  let num1, num2 = 4, 6;

  comptime assert num1 > num2; // "Comptime Test Error! Tried num1 (4) > num2 (6)"

  exit 0;
}

Integrated Tests

However, lots of tests can make the build process take waaaaaaay too long. To fix that, I propose seperate integrated test functions, to ensure that everything is according to plan.

fn main {
  let num1, num2 = 4, 6;

  test my_test num1, num2;
}

test my_test num1:i32, num2:i32 {
  assert num1 < num2;
}

Interoperability

What's the point of implementing a new language if it takes too long and is too hard to implement it into your program? I suggest interoperability between C/C++ of course, and maybe soon, Rust!

!include {
  C::printf,
  C++::std::{
    allocator,
    vector<T, A=allocator>
  },
  Rust::std::{
    Result<T,E>
  },
}

Conclusion

With all of these added together, it is a really big ask for one person to make this language. If you see the same potential as I do, I could really appreciate any help I could get! You can view the GitHub repo here


This content originally appeared on DEV Community and was authored by kwphil


Print Share Comment Cite Upload Translate Updates
APA

kwphil | Sciencx (2025-03-01T00:12:05+00:00) GearLang – A Systems Programming Language For Flexibility, Control, and Interoperability. Retrieved from https://www.scien.cx/2025/03/01/gearlang-a-systems-programming-language-for-flexibility-control-and-interoperability/

MLA
" » GearLang – A Systems Programming Language For Flexibility, Control, and Interoperability." kwphil | Sciencx - Saturday March 1, 2025, https://www.scien.cx/2025/03/01/gearlang-a-systems-programming-language-for-flexibility-control-and-interoperability/
HARVARD
kwphil | Sciencx Saturday March 1, 2025 » GearLang – A Systems Programming Language For Flexibility, Control, and Interoperability., viewed ,<https://www.scien.cx/2025/03/01/gearlang-a-systems-programming-language-for-flexibility-control-and-interoperability/>
VANCOUVER
kwphil | Sciencx - » GearLang – A Systems Programming Language For Flexibility, Control, and Interoperability. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2025/03/01/gearlang-a-systems-programming-language-for-flexibility-control-and-interoperability/
CHICAGO
" » GearLang – A Systems Programming Language For Flexibility, Control, and Interoperability." kwphil | Sciencx - Accessed . https://www.scien.cx/2025/03/01/gearlang-a-systems-programming-language-for-flexibility-control-and-interoperability/
IEEE
" » GearLang – A Systems Programming Language For Flexibility, Control, and Interoperability." kwphil | Sciencx [Online]. Available: https://www.scien.cx/2025/03/01/gearlang-a-systems-programming-language-for-flexibility-control-and-interoperability/. [Accessed: ]
rf:citation
» GearLang – A Systems Programming Language For Flexibility, Control, and Interoperability | kwphil | Sciencx | https://www.scien.cx/2025/03/01/gearlang-a-systems-programming-language-for-flexibility-control-and-interoperability/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.