Programming languages without garbage collection send us down a long path of design decisions that lead to slow compile times and fragile runtime performance cliffs.
-
-
Or we can create a very clunky wrapper like array_of_anything that is used wherever generic types are required, which manually casts and converts values among types dynamically each time it’s accessed. Java generics did this and they were awful.
Prikaži ovu nit -
But if we have garbage collection, we can store our large data structures once with whatever type is required, then dynamically create wrappers that reinterpret it as any subtype that’s required. We pay the cost of GC and indirect control flow for accessors but that’s all.
Prikaži ovu nit -
Unfortunately, most languages missed this opportunity. The C family including C# and Java are overly imperative and lost variance due to wrongly-scoped mutability. And functional languages have generally chosen type systems lacking subtypes, covariance, and contravariance.
Prikaži ovu nit
Kraj razgovora
Novi razgovor -
-
-
you can theoretically eschew redundant work spent on extra instantiations (which i imagine where a lion's share of the cost lies)
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
having written a similar system, i don't think the cost _has_ to be significant. it matters what kind of cost profile you'd like to have. if you want near instant recompilation of arguably large codebases on demand, then yes, the less you do at compile time, the better.
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
-
-
IMO GC in itself is fine and an elegant solution to aliasing problems like this. The problem is that almost all mainstream GC language have one giant heap, with all the problems that brings, and also that they focus too much on memory, forgetting the management of other resources
Hvala. Twitter će to iskoristiti za poboljšanje vaše vremenske crte. PoništiPoništi
-
Čini se da učitavanje traje već neko vrijeme.
Twitter je možda preopterećen ili ima kratkotrajnih poteškoća u radu. Pokušajte ponovno ili potražite dodatne informacije u odjeljku Status Twittera.