HN user

ianandrich

47 karma
Posts1
Comments49
View on HN

Python's Deal library provides contracts and a small portable formal proofs area of the codebase.

Additionally, Deal integrates with CrossHair which does concolic execution of the tests and functions annotated with contracts. It's integrated with Z3, and most of the Python primitives are covered.

It just works surprisingly well for incrementally building up provable code properties.

I just read your Coinductive guide to inductive transformer heads paper.

My mind is blown.

Is the Hopf Algebra based ML framework you are working on on your github? I took a glance, but you have 1500 repositories and it wasn't on the first few of them.

It might be possible to implement function purity with a decorator. (Kind of like declaring something “safe” in Rust).

Two parts to this. 1: Does it mutate variables. 2. Does the code have side effects.

1: def no_mut(func): @functools.wraps def new_func(args, *kwargs): new_args = tuple(copy.deepcopy(arg) for arg in args) new_kwargs = {k, copy.deepcopy(v) for k, v in *kwargs return func(new_args, *new_kwargs) return new_func

For the second point, gevent seemed to have a trick to identify side effecting code.