News for hackers. Stuff that matters.
Re:Six programming languages I’d like to see by hwayne on Wednesday July 13, 2022 @11:38AM (#32084185)
Forgetting about SPARK was a big whoops for me.

(Lots of formal verification languages are based on contracts, like SPARK, Frama-C, and Dafny. I'm interested in uses for contracts that aren't just formal verification, though!)

Re:Six programming languages I’d like to see by thesuperbigfrog on Wednesday July 13, 2022 @12:18PM (#32084777)
>> I'm interested in uses for contracts that aren't just formal verification, though!

Ada 2012 design-by-contract features aren't just for formal verification, they can be used in a general purpose way similar to Eiffel:

https://learn.adacore.com/courses/intro-to-ada/chapters/cont...

Can you elaborate a bit more about the wanted features for a language with semantic relations?

Re:Six programming languages I’d like to see by hwayne on Wednesday July 13, 2022 @02:49PM (#32087111)
An example off the top of my head would be writing a serializer/deserializer pair and explicitly saying they are inverses of each other, as opposed to having to implicitly say that in a round-trip property test. Another idea would be being able to say that two data representations are isomorphic under a given transformation, so I can define a function for one transformation and call it on the other. I don't know how useful this would be in practice, but it seems interesting to me!
Re:Six programming languages I’d like to see by thesuperbigfrog on Wednesday July 13, 2022 @03:15PM (#32087493)
>> writing a serializer/deserializer pair and explicitly saying they are inverses of each other, as opposed to having to implicitly say that in a round-trip property test.

That capability would be very useful. There are many cases where I have had to define serialization and deserialization functions for numerous objects and had to create so much "boilerplate" unit test code like you describe. It made me wish I was using a Lisp with built-in reader and printer functions.

>> being able to say that two data representations are isomorphic under a given transformation, so I can define a function for one transformation and call it on the other.

This strikes me as very Haskell-ish, but could be quite useful to ensure certain properties or invariants.

Re:Six programming languages I’d like to see by nextstepguy on Thursday July 14, 2022 @02:35AM (#32092730)
I use fuzzing for this. In fact that's the main case I use it for.