Statically typed, high-performance, general-purpose programming language. Panther is an alternative to programming languages like C++, Rust, Zig, and Carbon.
Here's a quick taste of the Panther programming language. All of the following currently compiles (as of v0.0.43.0
). If you want a peek at all currently supported features, maybe look at the change log. Please keep in mind that any syntax may change in the future.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43// importing a file def some_file = @import("directory/file.pthr"); // function declaration (parameter `num` is implicitly `read`) // has the `#runtime` attribute which means it can only run at runtime func set_num = (num: UI8, num_to_change: UI8 mut) #runtime -> Void { num_to_change = copy num; } // templated function // has the `#pub` attribute to make it visible to outside files that import this file // doesn't have the `#runtime` attribute which means it can run at runtime func just_return_num = <{T: Type}> (num: T) #pub -> T { func sub_func = (sub_num: T) -> T { return (move sub_num); } return sub_func(num); } // entry function (notice the name doesn't matter, but it has the attribute `#entry`) func asdf = () #entry -> UI8 { func get_compile_time_value = () -> Bool { return true; } def COMPILE_TIME_VALUE: Bool = get_compile_time_value(); when(COMPILE_TIME_VALUE){ // compile time conditional (doesn't enter a new scope) var foo = just_return_num<{UI8}>(some_file.get_UI8_12()); // variable declaration with type inference }else{ var foo: UI8 = 14; // variable declaration with explicit type } func get_type_id_of_UI8 = () -> TypeID { // intrinsic function call return @getTypeID<{UI8}>(); } var bar: Type(get_type_id_of_UI8()) = uninit; set_num(foo, bar); return (move bar); // should return 12 }
Interested in learning more? Check out the Panther tutorial.