As someone who spends a lot of time looking at ASTs it feels slightly naive to write off type keys completely. They are particularly useful in TS because it uses flow analysis to isolate the correct interface pattern from a union of types. Although I will generally encourage using conditional flow to direct to variant specific functions instead of mixing types in the function body.
I would heartily support the refractors given in the examples if they reached me in an MR. But chances are that a type key is introduced in 1 location, and then acted on in 6 different locations with a large temporal distance. Without the type key you are likely to need some way to infer the type, which may be error prone and hard to maintain.
On a micro scale a common example is where you have to pass over a list of statements to declare the functions, and a second time to define them. So that they can be self referential. Preferably without N scale memory allocations caused by things such as filtering the list.
My first thought was ASTs and union narrowing too! Probably because that’s been an area of focus for me lately too. Of course there’s other ways to represent a discriminated union, but type keys are particularly useful and usable for AST tools which are designed to be extensible (unified, estree come to mind).
One significant downside, which I think would better support the article’s point, is that type keys make composition (or inheritance if that’s your thing) more awkward. To represent an intersection type, you need either a nested structure (more flexible) or implicit relationships between types (please do not).
Not all smart motorways have the hard shoulder thing, the ones that do have semi frequent "stopping bays". However, stopping in one without contacting the support staff(there are intercoms) or a good reason is an offence.
They all feature per lane adjustable speed limits, as well as linked speed cameras at frequent intervals. This is supposed to help ease congestion by adjusting flow in certain areas.
In practice random signs are often left on the wrong setting, so you get a speed reduction to 40mph for 250m. Or a lane is closed for 6 miles with no reason.
I've no doubt that in the scenario where there is congestion that it greatly aids safety, as approaching traffic can be slowed before they reach the affected area
My least favourite thing is when they apply a patently absurd speed limit, I've seen 20mph signs on the M25 when traffic is moving freely. You are then faced with the dilemma between setting those speed cameras off or risking a lorry driver playing candy crush on his mobile phone running into the back of you.
WebAssembly only provides very minimal capabilities, anything more complicated than basic arithmetic and linear memory access require the features to be built. malloc, closures, arrays, error throwing, GC etc. all must be implemented. Some language features like console logs and visual output physically aren't possible, and must call out to the host ( normally JS ). Requiring the compiler to emit 2 languages.
In comparison JS has analogues to many common language features, making it easy to transpile to. There are other advantages to JS as well, but probably not worth listing.
Codepen uses a system that measures loop duration, and it's a giant pain. Having done some pens that do ray tracing and image transforms which can have long running loops. Given the variable execution time of JS it can be quite random. It just exits the loop without warning, causing weird failures in your code.
2 theoretical solutions ( with significant overhead ) are:
Run the code in a VM ( maybe quick.js compiled to WASM would work ) that suspends code execution periodically if it exceeds a certain duration. This has the advantage that long running code in general won't block rendering, not just loops.
Transform the AST to use async generator that yields once per loop. This would allow the loop to be suspended and resumed. But it would require a lot of modification to the AST, making effectively the entire call tree async.
I've done this and it works surprisingly well. I made a timesliced js scripting system this way.. it looked imperative with tight loops but it was all asynchronous. It felt like a threaded app.
Interestingly quite similar to my own progression. I think working in modern typed languages ( Rust, Swift, Typescript ) is what primarily changed my viewpoint in a way that C and Java just couldn't.
In the last year I've transitioned from full time JS development to full time TS development and have been pleasantly surprised how easy the transition was for my personal projects. Previously I had been quite adamantly against TypeScript; seeing the type system as an unnecessary level of complexity given I already structured my code in quite strict ways. In most it helped me find 1 or 2 small errors, but it certainly helps reduce the amount of time I spend verifying the behaviour of code. It definitely has its flaws, but most of them are linked to its compatibility with JS and I don't think they can be resolved unfortunately.
The largest issue with concrete is that we misuse it. As a building material it has great thermal mass ( aiding temperature stability ) and longevity. But all too often buildings are poorly designed for renovation, and hence end up being torn down after a couple of decades. A small fraction of the useful lifetime of the structure. Any building using concrete for a structure should be aiming to last at least 100 years.
For those who didn't read the article: the chemistry of Portland cement works against it. Production requires heating the calcium carbonate to a high temperature to extract carbon dioxide from it. Which obviously produces large amounts of CO2 proportional to concrete production. However, concrete also absorbs carbon dioxide from the air over its lifetime. So the measured emissions aren't the entire story.
Perhaps in future we will consider this an excellent source of carbon dioxide for the production of various hydrocarbons. I've heard of several efforts to create octane using carbon dioxide from the air, but you need a large amount of energy to extract a useful amount of CO2. Well this would be a good source of high concentration CO2. Perhaps not for octane ( we should really be moving away from combustion engines ) but perhaps plastics and other products that are currently derived from crude oil.
> Any building using concrete for a structure should be aiming to last at least 100 years.
I don't know which country you have in mind but in Europe the construction industry by law is obligated to design concrete structures for residential buildings that ensures a useful life of at least 50 years, and by definition that means that the building structure shall not require maintenance for at least 50 years.
Moreover, concrete as a widespread structural material is relatively new, and city centers are still packed with contrete buildings that were built when the technology started popping up.
In fact, in general a building with concrete structure is only demolished when it's not possible to retrofit or renovate it effectively, due to unrelated reasons such as increasing occupation density that would not be cost-effective by reinforcing the concrete structure.
My point is that concrete structures are not demolished with enough frequency to be of any concern. The main reason is that concrete structures are simply too expensive to be demolished, moreso in urban centers. Thus your concern simply isn't relevant in the real world because economics already impose the same restrictions that are expressed in your environmental concerns.
Maybe in Europe, but in the United States if you want to tear down a building and build another one, there is about a 99% chance you can do that and get the paperwork for it without too many hurdles other than NIMBYs.
That's an entirely unrelated issue, and fits the case of urban renewal projects whose preexisting building is not able to accommodate new functional requirements, at least in a cost-effective way.
The only factor that the use of concrete plays in this scenario is that concrete structures are expensive and time-consuming to demolish. If the investment makes financial sense then the choice of building material doesn't make any difference.
>carbon-cured concrete: in carbon curing, concrete is cured with gaseous carbon dioxide, from the plastic phase forward. The curing of concrete with pressurized carbon dioxide generates not only the ordinary reaction products of cement but also carbonate-based reaction products. Consequently, the process binds carbon dioxide, and it is even possible to make the final product carbon negative if ordinary cement is replaced with alternative binders with a low carbon footprint.
Do we want 100 year old buildings? I don't think we can predict the needs of building even 20 years into the future. City layout could change drastically. Monumental buildings should last a long time, but not every structure.
The alternative is to build from wood whenever possible, and capture extra cabon in building material. This increases market need for wood and therefore forestation.
> Do we want 100 year old buildings? I don't think we can predict the needs of building even 20 years into the future.
My parents live in a house that was originally built in the 1890s. It first had a fire place and wood stove for eating/cooking (surmised via chimneys), then it had gas lighting (some pipe are still in the walls), then it knob-and-tube lighting, then modern electrical lighting and cooking.
Walls were replaced, insulation added, etc. Lots of internal changes.
But the foundations and external brick is original (AFAICT).
Buildings are just boxes for people which keep the cold/heat/moisture at a comfortable level. As long as the "bones" of the buildings are good seismically, the "skin" has proper environmental control, then you can shuffle the inside around without too many issues.
Design/build things with minimal internal load-bearing walls and things can be shuffled fairly easily. Perhaps also use trusses instead of rafters as well for easier running of piping/wire.
> Buildings are just boxes for people which keep the cold/heat/moisture at a comfortable level.
So true. With the knowledge we have now about building materials you could create a very versatile, rigid, energy efficient base structure that lasts > 100 years, and adapt/update the internals to the current needs. You could even change the room layout completely.
I live in Europe and I can't understand why houses in the US are built with wood and drywall. It surely must be cheaper to use bricks/concrete and then renovate it fully every 20 years, or am I wrong here?
You are not wrong. However, houses could still be built from wood like the 500 year old houses and churches made with actual timbers. Timber framed houses would use a lot less wood in the long run due to less waste and greater longevity (especially when coupled with bricks and concrete).
Milling large trees down to 2x4s and coupling it to drywall to build homes that don't last is a travesty.
What are you counting as a house that hasn’t lasted? 50 years? 100?
The house I am in was built in the 1940’s by the state as an employment and housing scheme for returned servicemen post WW2. It’s wood framed and has a fair few years of life left if cared for.
The bulk of NZ houses are wooden, and have been for its entire history. They are also cold and are often damp, though these problems can be solved with decent building practices.
Concrete and brick are not that desirable in an earthquake prone country.
And yes, milling big old trees is bad. They are now made of treated pine, which comes with its own environmental concerns.
I think that Europeans just are biased against wood frame houses. I've heard this argument over and but a wood frame house can easily last 100+ years with maintenance and owners who care about what happens to it.
There's a lot of great youtubers out there who document their work in construction. It seems like a subset of contractors/architects/builders are interested in doing "experimental" things and improving the world's understanding of how to build buildings.
I'm really interested in finding more videos like this because his videos go past "Home Depot said this is energy efficient", he instead tests these concepts and apparently works with different colleges that research these ideas.
Properly maintained wood houses are good for 100 years. My house is 70 years old. It required insulation and electrical upgrades, mostly diy, but is otherwise fine. Also, the wood is a carbon sink, vs masonry being a carbon source.
> I live in Europe and I can't understand why houses in the US are built with wood and drywall. It surely must be cheaper to use bricks/concrete and then renovate it fully every 20 years, or am I wrong here?
I would think that renovations are much easier to do, regardless of the time interval between them, with wood and drywall. Drywall can be torn apart with by someone with just their hands; wood may need some cutting, but once in shorter pieces, can often just be yanked. Even a large house can probably be gutted/internally-exposed in a day or two.
With any kind of masonry you have to swing a sledge hammer with a lot of force or bring in jack hammers. Once set, concrete will resist a lot of force against it, which is why it's generally used for slabs and foundations.
It also depends on what you mean by renovate: often changes are in internal layout, so if one uses good design techniques for the shell:
Why would you remove concrete and masonry every 20 years? I don't have much experience with wooden houses, so I don't know if it's the case there.
But in brick houses renovation often means fixing what's broken and adding modern technologies such as insulation. Moving or adding walls can easily become quite a large scale project.
I think he means changing the room layout. In Europe, usually all the walls are 'set in stone'. Using a combination of masonry/concrete for the outer shell and timber/drywall for the internal walls would eliminate this problem though.
Wood is cheaper in North America than it is over there. Also it has some advantages, like being easy and cheap to work with, safer in areas with seismic activity, and it’s renewable.
Wood structures have no issues lasting 100+ years as long as they’re protected from water and termite damage.
On the east coast I’ve lived in plenty of wood houses that were built in the mid 1900s and just renovated every few decades. My last rental was even originally built in 1910. Well built wood frames can last for a long time.
Yeah if you can keep it dry (take care of roof and siding) and keep termites away they can last a long time. Especially older homes that have sturdier frames (when a 2x4 was really 2x4) built with old growth wood which tends to have tighter grain and therefore more strength.
London especially suffers from lots of shoddy conversions.
However, buildings built today to today's modern standards (with a little foresight) could easily be fine 100 years in the future. I'm not talking about fragile glass showpieces, but simple properly insulated homes built from durable materials.
My biggest issue with old homes is the layouts tend to be weird for today’s uses. Where I live many of the homes have a lot of small rooms and and narrow doorways instead of larger ones, for instance.
This of course goes back to conserving heat. But it makes house hunting difficult when trying to find a house with a layout you like.
The house where I grew up was made before Portland came to our zone, so it was made of lime mortar and rocks, some of them as big as a mellon, I found out when I tried to drill the walls to put a basketball basket.
It was demolished in the eighties, but not because it was in bad shape. I met the bulldozer operator years later and he recalled how he had a hard time with it.
I'm sure it would have been fine today, when it would be 100 y.o. or close. And I'm sure there's no other place where I'd rather live. It was cool in the summer, easy to warm in the winter, no mold, little noise from the outside.
I don't want a new house. Why? Because I refuse to live in a house with no natural ventilation. Most modern houses need air condition or at least ventilation systems, because they need to be so energy efficient, that there is no other way to get fresh air in. The fact that a house needs to be pressure tested seems insane.
Sure you can leave the windows open, but that defeats the purpose. Modern home needs to be ventilated three times a day, that means opening all the windows in the morning, when you get home in the afternoon and before going to bed. How many people will remember to do that?
The air in a modern home is often so dry that my nose start running the minute I enter. I don't want to live in that sort of climate.
Depending on the country, I think people should aim for home built from the late 1940 to mid 1970. Most likely additional isolation and new windows have been added over the years, making them reasonably energy efficient.
> The fact that a house needs to be pressure tested seems insane.
What's the alternative, building intentionally leaky houses? Better to be able to control the leaks to your benefit, aka active ventilation.
> Sure you can leave the windows open, but that defeats the purpose.
Actually the purpose of wind-ows is to let the wind in - no pun, that's the actually etymology of the word,
(also in Spanish: ventana originally meant "for venting").
Even in an old air-leaky house if you don't open your windows, the ventilation is happening through your walls, using them as an air filter which they were not designed to be, and in the process pulling moisture through them, which can cause all kid of bad stuff to grow in them. You shouldn't rely on such passive depressurization for ventilation, as it depends totally on pressure differences between indoors and outdoors.
> Most modern houses need air condition or at least ventilation systems, because they need to be so energy efficient, that there is no other way to get fresh air in.
There absolutely are ways to get fresh air in and dirty air out, including the following:
- Exhaust ventilation systems (i.e. whole home extractor fans)
- Balanced ventilation systems
- Energy/Heat Recovery Ventilation systems.
The poorly ventilated houses you are referring to were built between the 80s and 90s - yes they have ventilation issues. I know this because I own such a house and have fixed the ventilation issues with solutions from the list above.
Today in most areas, some form of mechanical ventilation is required by code on new construction, and has been for 15 or so years.
> The air in a modern home is often so dry that my nose start running the minute I enter. I don't want to live in that sort of climate.
In cold climates, the ability to safely humidify a house depends mainly on having good enough insulation and air sealing that the indoor humidity doesn’t condense on cold surfaces and rot the building. This is especially relevant near windows.
So if you want decent indoor humidity when it’s genuinely cold out, you want double- or triple-paned windows with insulated edges, proper air sealing near the windows, and possibly even an energy recovery ventilator.
(Or you can live in an old house, spend stupid amounts of money to heat it all the way to 63 degrees for a few hours a day, be cold and dry, and wonder what the heck anyone was thinking when they designed their single-pipe steam heating system.)
P.S. It is supposedly possible to properly design a single pipe steam heating system that achieves a comfortable temperature in more than one room. If so, I have never seen such a thing.
> It is supposedly possibly to properly design a single pipe steam heating system that achieves a comfortable temperature in more than one room.
If you are interested in learning more about this "possibility", particularly if you have a steam system that you hate, you'd probably enjoy Dan Holohan's books. His basic thesis is that when designed and installed, they worked well, but the knowledge necessary to keep them functional has been lost over the years. Here's a New Yorker profile of him: https://www.newyorker.com/magazine/2016/01/04/steamed-the-jo...
> Sure you can leave the windows open, but that defeats the purpose. Modern home needs to be ventilated three times a day, that means opening all the windows in the morning, when you get home in the afternoon and before going to bed. How many people will remember to do that?
I don't really understand your objection. in a leaky old style building without an effective moisture/thermal barrier, you don't get to choose whether ventilation is happening; it always is. with modern sealing, you can open the windows if you prefer fresh air, or you can enjoy much more efficient AC/heat if you don't. why couldn't you live in a modern home and just leave the windows open? it's easy to get a good draft going in any multifloor building with windows.
I’m looking to buy a place in Berlin, and from the search results it feels like half of the apartment buildings are from 1880-1910. I’m renting in a very old (not sure exactly how old) building, and it is… fine. It has been renovated, it is warm, it has double glazing. The only thing wrong with it is the walls are too thin for modern sound systems, but even that is less of a problem here than (for example) my university accommodation in Aberystwyth, because Germans care a lot about quiet time. The only reason I’m skipping anything pre-1950 is that I want to own it for at least 30 years.
I think we do, if we design them properly in the first place. For example, in 11 years the empire state building will be 100 years old, and its still an very useful and beautiful building. I think as long as you design a building to use something like conduits, you can update the wiring, plumbing, hvac, elevators, etc over time and it can continue to be useful for centuries.
The house I grew up in in rural UK was built in about 1910. My university accommodation was built in the 1880s. The first place I lived in when I moved to London was Victoria, as is where I'm living now. The newest place I've lived for longer than a few months was a flat-share in a 1960s block. For huge amounts of people, >100 year old housing is the norm.
My house is at least 200 year old and have been inhabited by 4-5 families. Although I must admit that it is thermally very bad, its perfectly livable.
Now the thing is that I like old houses.
So, just pay a nice marketing team to make sure people love old houses (after all, we have marketing team that can sell poison such as cigarettes or carbon dioxide).
Or, as you said, just build with something easier to handle such as wood (provided you recycle it, else it'll go back to biomass, releasing its CO2 again)
I don't think we want 100yr old buildings (except for history like a famous temple etc.). Certainly in my country old buildings are not designed in any environmentally conscious way. They aren't energy saving. They aren't in any way designed to be naturally cooler in the summer or hotter in the winter. They aren't designed for the changing needs of society which went from walking and horses 100 years ago whatever it is today. Why would I think a building made today is going to be a good building for the needs of people 100yrs from now?
Many old buildings where designed to be cool in the summer and warm in the winter. Often those features have been removed as historically airflow kept things cool where today you want to maintain AC.
It’s something of a design failure of modern buildings where walking outside when it’s 80f is pleasant but inside you need AC at those temperatures.
While not quite the same the V8 team has a blog that discusses various improvements they are making. Such as the Orinoco GC project. Which typically contains some details on the implementation.
It's a fairly fascinating window into the inner workings, and quite detailed.
This seems particularly unhelpful for bug reporting systems. Being able to see a specific bug is only happening on Chromium 78 for Linux can save a lot of time and frustration. In theory the user can fill in the details on a bug report themselves, but it's hard enough to persuade them to copy paste the crash message we generate for them at the moment.
There should be better ways to identify the browser than the user agent. The user agent is a legacy artifact, have you seen how many "compatibility" parts are in there? Like why does the chrome user agent say "Mozilla" in iy?
There's not really a good server side way to do it unfortunately. All the current alternatives to my knowledge require js.
It depends on your application but the only real alternative is to use a js analytics library to collect the statistics. The good news is that they're more accurate, can give you more information, and there's plenty of self hosted options like Matomo.
But it is yet another thing the client as to load, and adblockers will likely skew your metrics.
Some companies in the UK offer health insurance for private healthcare. The main advantage of private being you can get appointments much faster. I'm not really sure what the relative pricing is for private healthcare in the UK vs the states, so it might be the insurance costs reflect that.
I would heartily support the refractors given in the examples if they reached me in an MR. But chances are that a type key is introduced in 1 location, and then acted on in 6 different locations with a large temporal distance. Without the type key you are likely to need some way to infer the type, which may be error prone and hard to maintain.
On a micro scale a common example is where you have to pass over a list of statements to declare the functions, and a second time to define them. So that they can be self referential. Preferably without N scale memory allocations caused by things such as filtering the list.