>>105653225everything. why did they copy the sepples <>? ::? {}? semicolons?
also this pub and impl keyword shit is disgusting. you just need a real module + signature system and sealable strutcures.
in a real ML this is differentiated and controlled by your choice of ":" or ":>" when defining a structure. fine grained control is handled through functors. as a result, you don't write ten trillion pubs or impls all over your fucking code.
rust has so much baked in noise because of arbitrarily retarded decisions they made for no good reason.
oh sorry no, they made the language like this because they thought c programmers would have a conniption over not having curly braces or whatever.
that's definitely a good reason to add ten trillion keystrokes and god awful visual noise to your already verbose and complicated language.
FUCK they dropped the ball so fucking hard on Rust and it pisses me off.
>how would you do bettersignature PTR =
sig
type 'a ptr
val new : 'a -> 'a ptr
val free : 'a ptr -> unit
val clone : 'a ptr -> 'a ptr
end
and then something like
structure Ptr : PTR =
struct
type 'a ptr = 'a ref
fun new x = ref x
fun free x = destroy_ref x
fun clone x = Ptr.new !x
end
didn't bother pretending this uses affine types or whatever, so clone just does a copy, no boxes just pure pointers, etc.
you can extend it arbitrarily to be affine in your head if you want with shit like:
fun new x = Box.leak(Box.new x)
or whatever