r/Compilers • • 17h ago

Haze Programming Language

https://www.haze-lang.cc/
0 Upvotes

43 comments sorted by

View all comments

Show parent comment

1

u/Top_Marionberry_4413 11h ago

SMT solvers sound good but in practice if the compiler cant prove your program is correct, it doesnt compile, or it just allows everything, which makes them impractical, and the DX just ends up being terrible, with the contracts being an obstacle instead of an assistance.

The runtime checking thing means that the compiler forces you to use Result[T, E] if it cant prove something, which is much better than not compiling at all, and means that the program doesnt abort at runtime because of something that couldnt be proven at compile time. Hope that helps.

2

u/Aaron1924 11h ago

I mean it's a valid design choice to make runtime assertions a built-in language feature; D, Ada and Eiffel do something very similar, and some modern languages (e.g. Zig) have built-in unit testing. It's just that none of these language claim that "all contracts are checked at compile time".

-1

u/Top_Marionberry_4413 11h ago edited 11h ago

well this one does, isn't that great? :) they are all checked, the unchecked ones become Result types that need to be unwrapped. so even they are checked.

hey whoever downvoted fuck off im trying to have a conversation here. jeez, reddit cucks, am i right aaron?