News for hackers. Stuff that matters.
Re:Not Growing a Language by mrmr1993 on Saturday April 03, 2021 @03:29PM (#26683966)
Where possible, I prefer making the syntax opt-in, and explicitly so. For example, stealing OCaml's syntax:

let check_exp (g : Elliptic_curve_pt.t) (x : int) (y : int) = let xy = x * y in let open Elliptic_curve_pt.Num_syntax in (g ^ x) ^ y = g ^ xy

This lets you avoid making hard decisions about what can be added/multiplied/etc. at the language level -- can a list of numbers representing the coefficients of a polynomial be added? -- without jumping to the extreme of allowing anything implicitly. This also lets the typechecker catch more of your mistakes by having stricter types, and means you know exactly where to go to find out what the syntax is encoding.

Re:Not Growing a Language by a-nikolaev on Saturday April 03, 2021 @10:20PM (#26686412)
I think, you could also write

    Elliptic_curve_pt.Num_syntax.( (g ^ x) ^ y = g ^ xy )
instead of let open Elliptic_curve_pt.Num_syntax in ...