4,901 karma · joined Sep 13, 2020 (6y ago) · 1,641 submissions
comment 3y ago · link · parent
(Often, when one application crashes, a couple others follow not long after.)
comment 3y ago · link · parent
Another thing is that local static variables often compile to fairly horrific long code with branches. Better just move it to a wider scope or a longer-lived struct/class member somewhere.
comment 3y ago · link · parent
I enable captions sometimes for single words, which I failed to hear right, although usually in those instances captions show something completely nonsensical.
comment 3y ago · link · parent
comment 3y ago · link · parent
comment 3y ago · link · parent
And now the thing is: with transparent signature ascriptions, functors are monomorphised in SML, instead of everything being hidden behind signatures (as is in the case of Rust with traits when you use dyn), which has semantic consequences. E.g. a struct returned by a functor may contain a type. You can't perform proper type-checking without monomorphising, because you don't know what the exact type is. E.g. in the following program, the final line couldn't be type-checked without monomorphisation:
signature ITERABLE = sig
type ElemT
type SrcT
val new_iter: SrcT -> unit -> ElemT option
end
signature LIST_ELEM_TYPE = sig
type T
end
functor ListIterFun (ListElemType: LIST_ELEM_TYPE): ITERABLE = struct
type ElemT = ListElemType.T
type SrcT = ElemT list
fun new_iter l = let val lr = ref l
in
fn () => case !lr of
nil => NONE
| (x::xs) => (lr := xs; SOME x)
end
end
structure IntElemType: LIST_ELEM_TYPE = struct
type T = int
end
structure IntListIter = ListIterFun(IntElemType)
val next = IntListIter.new_iter [1, 2, 3, 4, 5]
If I change the signature ascription on ListIterFun to an opaque ascription (:> ITERABLE), the final line won't type-check, because it's not obvious from the signature, that ElemT is int. So transparent signature ascriptions require monomorphisation (Rust traits without dyn), and opaque signature ascriptions free the compiler from having to do monomorphisation (Rust traits with dyn*).There was a lot of discussion of this issue when Go was settling on a design for its generics, under the phrase "reified generics".
comment 3y ago · link · parent
To me it doesn't sound that the pig was cut into pieces. It reads to me that everything was left in place.
comment 3y ago · link · parent
I would however welcome static reflection with open arms. In Rust in particular, I’d prefer it if derive was implemented using static reflection, rather than proc macros.
comment 3y ago · link · parent
comment 3y ago · link · parent
> With proprietary software, there is always some entity, the developer or “owner” of the program, that controls the program—and through it, exercises power over its users. A nonfree program is a yoke, an instrument of unjust power.
[2]:
> To release a nonfree program is always ethically tainted
I've read enough of passages like these from GNU in the past to say that your quote is not a mischaracterisation.
[1]: <https://www.gnu.org/philosophy/free-software-even-more-impor...>