Recursion is natural and easy to understand when the argument of the function is a recursive data structure, and the cases are patterns on the constructors. These are natural and useful cases, much better than the alternative. Starting with misguided examples like factorial is demotivating.
You're not wrong, but I think there's still something missing in terms of how to get from there to a place where people can see how (and more importantly, how to recognize _when_) to apply the concepts towards what they work on after they've learned the basics. In my first semester in college, I took a course that was half in OCaml and half in Java. During the first half, we used recursion extensively, modeled everything via closures rather than objects, and generally learned to think about things functionally. Then when we transitioned to Java, where we didn't apply any of that and instead used objects and for loops and imperative logic. That was the last class required for CS majors that used functional programming; after that, all of the requirements were either Java, C, or didn't use any programming language (but maybe used pseudocode, like our algorithms course). I personally took a number of other functional language courses as electives, like one where we learned Haskell, one about the theory of programming languages that used Coq, and a compilers course that used OCaml again, and while I wasn't the only one, it certainly wasn't a majority who went out of their way to take courses like this.
The first time I tried to implement something recursively in C++ at my job after college, my more senior teammates were concerned about whether we could safely assume that all of the different compilers would correctly optimize the tail recursion to avoid blowing up the stack, and they preferred rewriting the logic to be iterative rather than spend time trying to figure that out. This was something I was vaguely aware of as a real-world issue, but it hadn't occurred to my naive junior engineer mind that I couldn't just assume that prestigious "professional" compilers like GCC and Clang and MSVC wouldn't take care of this for me when I never had to worry about it in OCaml. After all, everyone in the world seemed to writing code in C++ with one of these compilers, and the OCaml toolchain didn't exactly have a glowing reputation in my mind when the only place I had heard of using the language didn't even use the default standard library!
I'm not saying that I think this is necessarily a good way to teach recursion generally, but I definitely think there's room for resources like this that help bridge the gap between understanding how recursion works in the best possible environment for it and showing how it works (warts and all) for specific real-world ecosystems.
Even if the Moore's law is not dead, single-thread performance and clock frequency have plateaued 10 years ago. This is the key factor. Because of heating even if you squeeze more transistors onto a chip you need to reduce the clock, so even if you may get higher computational throughput the latency will go down. And this is another argument for chiplets or any other alternative computational architectures.
It's amazing how often this is parroted. Anyone with a passing familiarity with the numbers knows this is actually not true at all.
Better caching, branch prediction, plus vast amounts of SRAM. There's been a slow & steady increase in the vast variety of single threaded workloads grouped together by "instructions per clock."
Both at the peak of the voltage frequency curve for workstations & overclocking, the apex of the optimization curve for data centre, and especially at the bare minimum for mobile devices with idle workloads.
Yes, it's a small fraction of the old days. It's still double in 10 years.
And as anyone who's migrated from an Intel Mac to Apple Silicon knows, "merely doubling" is a LOT.
Sorry, doubling in 10 years vs doubling in 18 months effectively is plateauing! Especially since it isn't really a consistent 10% growth per year, but a decelerating growth over that decade. Furthermore, much of the purported single thread performance is taken from a small set of benchmark tests, and so chip makers just optimize them for those tests. Generic single thread performance has undoubtedly not doubled in that 10 years.
In any field of any kind except probably silicon, 100% growth in a decade would be marvelous. I don't think anyone could call it a plateau.
> Furthermore, much of the purported single thread performance is taken from a small set of benchmark tests, and so chip makers just optimize them for those tests
"Single thread" is a notoriously difficult benchmark to quantify. Instruction queue depth, floating vs integer, branching vs linear, there are so many variables.
Passmark is fine. Workload simulation is state of the art.
Have clock speeds really plateaued? Sure it’s not “double every 18 months”, but in mid 2018 I bought an Intel 8700K that turbo’d to 4.7GHz and could (with liquid metal, dark magic and luck) overclock to exactly 5GHz. I remember people saying progress was slowing down, that we might not make it to 6GHz.
4.5 years later and Intel is bragging that their upcoming topline CPU will run 6GHz stock. I suppose one could call this a plateau compared to the good old days of the 80s and 90s, but it’s definitely still progress.
In late 2000, Intel promised that Pentium 4s will hit 10GHz by 2005 – on a presumed 130W power budget –, after the last 5 years saw clock speeds increase from 150MHz to 1.4GHz for the P6 architecture (at a stable 30-40W power budget), and other vendors saw similar increases.
Over 20 years later, we're barely scratching the 6GHz barrier with an opportunistic turbo mode that isn't guaranteed to kick in, if your cooling isn't up to the task of dissipating a record-breaking 250W of peak power consumption.
Part of why that happens is Intel selling chips closer to the red line. You need cooling similar to what used to be exclusive to overclocking just to keep the stock CPU cool.
Yep. We're apparently finding out that it's mostly a waste of electricity to get an extra 5% performance due to how far outside the efficiency sweet spot chips are being pushed.
Not just Intel either. AMD has joined the game as of Zen 4, and NVIDIA's been playing it with their GPUs forever as well.
Zen 4 desktop CPUs appear to have (as expected) virtually unchanged single core performance, and maybe 5% reduced multi-core performance, on CPU-bound workloads by reducing the power limit to cut total power consumption -- by over a 100W reduction in the case of the new 7950X! Granted, Intel's been doing that forever -- reign in Alder Lake and its power consumption also comes way down, again for barely a performance hit in CPU-bound multi-core tasks.
-----
Enthusiast grade CPUs and GPUs are basically sold in the equivalent of a TV's retail "demo mode" now -- where a TV has max brightness, contrast and saturation that you'd NEVER use, but is intended to just grab a customer's attention as they walk by. Being pushed so far outside of their efficiency sweet spot just to get that extra 5% to "win benchmarks", when outside of specific use cases (and even if you actually need that 5%!) you're just consuming 50-100% more electricity for utterly marginal gains.
What a waste of resources! All so children (or people who still act like them) can feel better about a purchase as they argue on the internet over nothing worth arguing about.
If you truly wanted to maximize performance per watt, you'd pick a very different design more reminiscent of GPU's. But then single-thread and low-multi-thread performance would really suck. So it will always be a carefully tuned tradeoff.
Nope. Not even. Again, as the grandparent post stated, everything is being sold with the default configuration being redlined.
You absolutely can reign it back in to sanity, and get better performance per watt over the previous gen, and still be noticeably faster over the previous gen.
-- -----
With AMD, apparently we're going to see BIOS updates from board manufacturers to make doing that simple. Set it to a lower power limit in a few keystrokes, still have something blazing fast (faster than previous gen), but use 145W instead of 250W. Or go even lower, still be a bit faster than previous gen while using around 88W on a 7950X instead of the 118W a 5950X did.
Intel -- who has been redlining their CPUs for years now -- even noted Raptor Lake's efficiency at lower power levels. Again, cut power consumption by 40-50%, for only a tiny performance hit. They actually made entire slides for their recent presentation highlighting this!
NVIDIA no different, and has been for years. Ampere stock voltages were well outside their sweet spot. Undervolt, cut power consumption by 20-25% and have performance UNCHANGED.
-- -----
Sure, there's more efficient stuff. Take last generation's 8-core Ryzen 7 PRO 5750GE. About 80% of the performance of an Intel Core i5-12600K, but only uses 38W flat out instead of 145W.
You don't even really need to rein it back, modern processors will throttle back automatically depending on how effective the cooling is. Anyway, the issue with manual undervolting is that it may adversely impact reliability if you ended up with a slightly substandard chip, that will still work fine at stock settings. That's why it can't just be a default.
>You don't even really need to rein it back, modern processors will throttle back automatically depending on how effective the cooling is
This isn't about thermals. This is about power consumption.
I'm not suggesting reigning in a CPU's power limits because it's "too hot".
I'm suggesting getting 95% of the performance for 59% of the power consumption. Because it's not worth spending 72% more on electricity for 5% increased performance. Again, even the manufacturers themselves know this and are admitting it. Look at this slide from Intel: https://cdn.arstechnica.net/wp-content/uploads/2022/09/13th-... Purported identical performance of previous gen at 25% of the power consumption. They KNOW the default configuration setting (which you can change in a few keystrokes) is total garbage in terms of power efficiency.
-----
I guarantee you server CPUs aren't going to be configured to be this idiotic out of the box. Because in the datacenter, perf/W matters and drives purchasing decisions.
Pentium 4 HT 3.8F, November 2004, 3.8GHz, 115W TDP
Core i9-13900KF, October 2022, 3.0GHz, 125W TDP
Of course, the latter does give you 8 performance cores and 16 efficiency cores so performance-per-watt has clearly improved; and it has 'turbo boost'. But in terms of sustained single-core performance? It's clear Intel's attention has been elsewhere. Such as on the laptop market, where power efficiency is king.
I'm curious if single threaded* games/applications that were CPU limited when the P4 originally came out run better on the 13900k with the same code.
That was my impression from games at the time, that they were coded with an expectation that clock speeds would keep going up in the future. But they didn't and the games probably run just as bad now as they did before.
And even in the Pentium 4 days, AMD CPUs managed similar performance as a Pentium 4 while running at lower clock speeds (which was a problem with some games that tried to auto-tune their performance-settings purely based on Pentium 4 clock speeds, even if you had an AMD CPU – thankfully at least in the Maxis/EA case, those settings were easily hackable, though, and could be easily adjusted to better match non-Pentium 4 CPUs, too).
the frequency plateau always been a power consumption/leakage thing, and power draw for recent intel cpus only reinforces that. it's probably too early to tell if 6ghz is a new normal
and fwiw ive had a 5ghz+ overclock on every cpu ive bought in the last ten years with a corsair 240mm aio, going back to the 3570k
I really hope there are breakthroughs that allow us to use other, trickier, semiconductors like GaN for chips, IIUC their efficiency could allow us to hit much higher frequencies for the same heat output. That said, I doubt we'd see 3nm processes for something like that.
IPC is still improving, so single thread performance is still increasing, even if clock speeds are not (at least not at the same as before). And new instructions (AVX ect) also help, especially if you can optimize and recompile your code.
It's at least enough that we have to take it into account:
We run our workloads across multiple Intel cpu generations and to be able to optimize utilization we have a "speedup factor" which is currently up to 1.7 for the latest generation we've tuned it for. And the base 1.0 performance is from Ivy Bridge, launched 2013.
"The consumption of electricity in everyday life was limited (it was forbidden to use a refrigerator during the winter, and the use of a vacuum cleaner was banned all year round), hot water was supplied to apartments twice a week,"
Maybe you were living in a big city like Bucharest, Timisoara ...
I was there before 1989 and grew in the small town in a house. Not a village, but a small town.
We had electricity only a couple of hours per day.
I don't know of any specific rule against refrigerator but it was not useful to buy one as you cannot connect it to anything.
The main source of light during winter was the fire and some kind of liquid gas (I don't know exacly what was that) that we used with a gas lamp.
The same goes for kitchen: most of the cooking was done using the stove or using some gas tanks that were limited - I think one per family per month or I am not sure. But the gas tank was a precious possession there.
The same was true for bread or any other food that was produced by the state. There were rations of how much we can buy.
HN is an English-only site, so here we are. I'd love to see a Romanian HN, but given the general level of discourse I've seen in most Romanian communities online (and in most communities online period), I'm not holding my breath.
Of course it is false but the regime was definitely monitoring private power consumption (I'm also from Romania).
My dad told me relatively recently how sometime during a winter from the late '80s a lady from the power company showed up at our apartment's door and told my father that we should lower our energy consumption, i.e. not use an electrical heater to, well, heat the house. That would have course meant having a freezing house, which wasn't ideal for kid me, so my dad, logically, called that lady some names and invited her inside the apartment to share the bed with all of us (because of the cold I was sleeping as a kid between my parents during the winter, we couldn't physically heat two rooms at the same time). Interesting times.
Bonus points for us, kids, booing and swearing out loud when the power was being cut off in the evening, and cheering when it was being restored, like true "freedom" fighters against the regime (I'm talking about the summer months when we were all outside to play well into the evening/dark hours).
It's false because they weren't explicitly "prohibiting" refrigerator and vacuum cleaner use per se (as the article says), no need to do that, just cutting the power off completely was enough to do the trick.
But, yeah, on a more general level whoever was designing any electrical-related stuff had to have that in mind (the power cuts and the reduced power consumption asked from us, that is).
This discussion also reminded me that, as a kid, I was really in awe in how the (analogue) telephone network was still working even when the power went out, it seemed like magic. There was an article posted yesterday here on HN about how we're expecting rolling black-outs in our mobile phone network over parts of Europe, goes to show that in some ways the system back then that we had in Romania was a lot more resilient in face of power-cuts compared to what we have now available over most of Europe.
Same. Pretty sure we vacuumed regularly and never unplugged the refrigerator.
If you were in a state heated apartment building after 1980, the heating was limited to non existent though. And there may have been a hot water schedule. More like twice per day not twice per week though.
In Bulgaria, there were only two periods (1984-85 and 1990-91) during which electrical supply was interrupted on a planned basis. Rumour has it that the regime was starved for hard currency (US dollars) and was exporting everything it could. As a small kid, I remember spending 2-3 hours in the evening, relying on candles for light. In the rest of the time, electricity was cheap and abundant because the country had an economic profile based on heavy and light industry. Energy efficiency was something unheard of – appliances were power-hungry and inefficient, flats in residence blocks were badly insulated, but heating their home was never an issue for most people.
There were periods when electricity was rationed, usually with rolling blackouts. I've also never heard of a ban on refrigerators at any particular time of year, nor a ban on vacuum cleaners. Problems with hot water were common, but I've also not heard of any particular schedule. Food scarcity was a much bigger problem for that period though, especially in major cities (people would queue for hours for a chance at meat or eggs, for example).
Well, there is no need to put a ban on refrigerators or vacuum cleaners if you could not safely assume that there will be electricity in general.
Also for other people reading this, please note that all stores in most of the country (with exception of capital city and a couple others) were controlled by the state. Leaving the country was forbidden in general.
So if they wanted people not to use refrigerators on large scale or vacuum cleaners they could just decide to not sell them. It was that simple to restrict something like electronics.
Just add more: again in most of the country there were very few cars running as there was a limited supply of petrol/gas for cars. You could have a fixed amount of gas.
They even decided at one point that on Sunday to restrict circulation of cars the following way: one Sunday cars that have an odd number are allowed, the other Sunday cars that have an even number were allowed.
While the state could have prevented people from using refrigerators or vacuum cleaners in various ways (as you say, banning or limiting sales, but also making it illegal and relying on the near-ubiquitous network of infromants to tell on neighbours who vacuumed or used too much electricity), the point is that they didn't. Refrigerators were a common household item in Romanian cities at least, and so were vacuum cleaners. They were produced by Romanian factories and sold very much legally. While electrical blackouts were a problem, they were not prolonged enough to prevent the usefullness of a refrigerator (they commonly happened during the night, and a closed refrigerator can typically isolate well enough to preserve its temperature for 6-8h).
Yes, and you also had to register to the waiting list to be able to buy one (refrigerator, TV, car...). Or you needed to know somebody who knew somebody who was able to get one for you faster, for an appropriate material reward.
The hot water was "scheduled" - usually twice a day. I don't remember that well as I was quite young at the time, but I think I was meant to be on for a couple of hours in the morning and another couple of hours in the evening. In reality however, the hot water was never more than lukewarm at best and the schedule itself was very flexible: I remember whole weeks without hot water.
This was same in Czechoslovakia, I recall my parents standing queue in freezing cold during winter for 2-3 hours so that their sick son could have some mandarines or lemon juice in the tea.
The beauty of communist central planning, nothing really worked unless you were in communist party.
This is all normal in the Philippines. Electricity isn't limited, but many households only need to run phone chargers and a light for each room. Most people have fans, but you can get by without if you have an open design and some shade. I'm not sure I have ever seen anyone use a vacuum here (not many people have carpeting.) You might be surprised at how well you can get by without a fridge. Buy your meat and veggies fresh. Cook only the food people will eat (no leftovers.) Buy ice and other cold things from a community store. I'm assuming the hot water thing is for bathing during the winter, this isn't an issue in the Philippines.
I wasn't there but my parents were and I also haven't heard of any of this. With most "life under communism" stories I'm sure it's a broad generalization that might've applied in a few localities but varied widely
> 3. While the size of any one conference has to be fixed, tech has made it infinitely easier to create new conferences and journals with other focus areas. They may not start with the prestige of a larger journal, but if the papers published start to have an impact, it can catalyze an entire subfield of work.
Does it though? The largest conferences I go to as a CS academic have hundreds of people. There are academic areas where 10x people participate. The size limitation is a self-imposed excuse to keep acceptance low. I have been PC chair of two conferences and my attempts to expand the conference numbers were shot down by the steering committee precisely for this reason, not because we couldn't find a larger room.
> For example, in Sri Lanka, there is no way for someone to accept payments or send money through PayPal or Stripe. However, people will be able to send money through the blockchain and bypass these restrictions if more people begin to trust crypto.
If Sri Lanka blocks PayPal and Stripe are you sure they will not block commercial entities from converting between rupees and crypto-assets? Individual and small scale operators might still do it, flying under the radar, but that is not a scalable proposition.
Imagine cryptocurrencies are banned in your country.
The exchange of goods and services you describe might work between individuals. However businesses are much more visible. OK, you run a business accepting cryptocurrency payments for your goods. How will you explain it to the tax office? What if someone tips the police you accept it and they try to purchase something? OK, so only the small businesses will do it. They're numerous enough the police can't catch everyone. How will they transact with the bigger companies that can't accept illegal payments? Purchase utilities, tools etc. OK, somehow you make enough money with legal payments to pay your bills and keep the cryptocurrencies only as profit. Now try buying a car or a house with illegal currency.
Everything has a workaround, but if the state outright bans cryptocurrencies, the market will be severely crippled.
> Everything has a workaround, but if the state outright bans cryptocurrencies, the market will be severely crippled.
Like how they effectively enforced their prohibition on drugs and people working for cash-in-hand to avoid income tax and reductions in government benefits. Right.
I don't know about how it is where you live, but where I live it's a lot easier to buy something that is legal than something that is illegal and most people pay most of their taxes.
Now that marijuana, for example, is largely being legalized through the U.S., illegal sales of marijuana have completely vaporized.
Very few will opt to use crypto if a government has deemed it illegal if there is a legal alternative.
I guess there is value in crypto if your government and civil society is completely collapsing, but those blockchains are being sustained entirely by first world gamblers hoping to make a buck on cryptos prices increasing.
Once they realize that crypto has been reduced to (as its backers are now insisting) a currency for failed states, they won’t gamble in crypto and they won’t fund the enormous amounts of energy needed to keep a blockchain running.
Maybe a non profit can run a blockchain that people in failed states can depend on. But then the question arises, why would that non profit use an expensive technology like the blockchain as opposed to simply using a Postgres DB. Something which all the biggest crypto exchanges already do to provide immediate transactions because the blockchain isn’t fast enough.
Which brings us to the point that the only reason anyone is using the blockchain is because it’s been successfully marketed to lay people as this magical inflation defying, freedom providing magic money tree that only goes up in value, when in reality it’s at best a pretty terrible database with some niche uses.
To be fair, crypto has some value for illicit transactions and money laundering.
It's not obvious to me whether this value is greater than the mining costs or not. I think the value is in fact smaller and therefore the valuation is just a bubble.
Plus of course they mostly run their drug operations using USD, so if your definition of "uncensorable money" is that people are able to do something to a limited extent illegally if they can obfuscate their relationship with the publicly visible part of the transaction and avoid asset seizure, we had it before blockchains were invented...
I paid people with crypto (a client paid me in crypto so I thought why not) for work and goods; these were people who were told by believers this will be a currency like you suggest. After (in 2018) they asked me if they could get money instead if they gave that crypto back to me. As long as people cannot actually buy flower and yeast with crypto from the wholesale supplier, it is kind of doomed.
There's a blog post I read once which title was something like "How I accidentally started a bank" about a dev who added a chatbot in his work's internal chat (I don't think Slack was a thing yet back then) that tracked what each colleague owed to each other for lunch, coffee, etc. The bot expanded to track monetary value, and in the end he realized he made a bank, where each colleague had their balance, and transactions can be made.
In theory a group of people (expandable to a society, depending on trust) could just use such an app (or even just a WhatsApp chat) to do their business transactions, e.g. in China people probably just keep a balance in their WeChat accounts, and the money just moves between WeChat accounts.
Effectively blocking entities from converting currencies in person is much harder than banning inter-country trade.
My dear home country made it illegal to trade foreign currency except at government exchanges, which trade only one way and at an exchange rate 50% worse than the real one. This just made illegal exchange shops pop up everywhere, and the biggest difference is that it's now dangerous and inconvenient to change money.
Crypto is one of the few ways I can wire money back to my family and friends.
People bringing cases like Sri Lanka honestly never cared about it and issues people there have. It's just hypothetical usecase they use to their advantage. Solution to this is right there - its political, its development, its financial aid.
Just imagine how could Sri Lanka farmers run their bitcoin nodes and wallets and pay the fees for transactions... idea is frankly insane. The reasons people are "unbanked" is because when you have 0 money you don't need a bank huh.