Your post could be (uncharitably) paraphrased as: "once you have written correct C++ code, the drawbacks of C++ are not relevant". That is true, and the same is true of C. But it's not really a counterargument to Rust. It doesn't much help those us who have to deliver that correct code in the first place.
Does there exist any platform which has multithreading but not atomics? Such a platform would be quite impractical as you can't really implement locks or any other threading primitive without atomics.
> Does there exist any platform which has multithreading but not atomics?
Yes. Also, almost every platform I know that supports multi threading and atomics doesn’t support atomics between /all/ possible masters. Consider a microcontroller with, say, two Arm cores (multithreaded, atomic-supporting) and a DMA engine.
Certainly such systems can pretty readily exist. You merely need atomic reads/writes in order to implement locks.
You can't create userspace locks which is a bummer, but the OS has the capability of enforcing locks. That's basically how early locking worked.
The main thing needed to make a correct lock is interrupt protection. Something every OS has.
To go fast, you need atomic operations. It especially becomes important if you are dealing with multiple cores. However, for a single core system atomics aren't needed for the OS to create locks.
> You merely need atomic reads/writes in order to implement locks.
Nit: while it's possible to implement one with just atomic reads and writes, it's generally not trivial/efficient/ergonomic to do so without an atomic composite read-write operation, like a compare-and-swap.
I wrote "multithreaded" but I really meant "multicore". If two cores are contending for a lock I don't see how irq protection help. As long as there is only one core, I agree.
The boring answer is that standard atomics didn't exist until C++11, so any compiler older than that didn't support them. I think most platforms (certainly the popular desktop/server platforms) had ways to accomplish the same thing, but that was up to the vendor, and it might not've been well documented or stable. Infamously, `volatile` used to be (ab)used for this a lot before we had proper standards. (I think it still has some atomic-ish properties in MSVC?)
> A bit disappointed that it doesn't work on Firefox.
I swear the entire ~3% marketshare of FF users (myself included) are lurking in this thread lol. You are all giving me an excuse to increase the priority of cross-browser support
Using Firefox implies, to me, a willingness to customize the browser experience, which would probably heavily overlap with your target demographic. Since the extension manifest version update disabled some essential browser extensions, Chrome has become much less useful
Relicensing isn't necessary. If you violate the GPL with respect to a work you automatically lose your license to that work.
It's enough if one or two main contributors assert their copyrights. Their contributions are so tangled with everything else after years of development that it can't meaningfully be separated away.
How much useful combat skills can be taught in only a week? It seems like an extremely low estimate on the training needed to play a useful role in the military.
>Ukraine's paratroopers were ordered to withdraw from the city, leaving the city's defense to a few thousand local volunteers armed with rifles, limited anti-tank weapons and no armed vehicles or heavy weaponry.
I'm not sure that speaks to the quality of training considering the state of Russian forces, tanks driving alone, crews abandoning equipment, and so on.
Every combat soldier requires like 10 support soldiers doing things like logistics. Millions of people during WW2 did nothing but drive trucks.
A lot of military burst capacity is about freeing up soldiers who went through all the training and basic and specialization, but are stuck driving that truck.
The guys and gals who fire bullets are just the sharp point of the spear and all that.
It's also why Russia ballooned their "National Guard" forces even though they cannot be deployed outside Russia; They free up soldiers who can.
One of the most important things for a government in an actual "Oh shit real war" situation that requires significant mobilization is a simple census of "Who has the capability to do what menial job?"
Light infantry on domestic terrain doesn't need anything like those sorts of ratios. Chechen militia in the first Chechen war defeated the Russians well enough to win independence without any sort of logistics ratio like that on the military side, as did the YPG light infantry that defeated ISIS and held off the Syrian military well enough that they basically truced or better.
Higher ratios might be needed to project power to outside borders, but for defense within the territory they can be combat effective against many possible forces with small ratios of military side logistics.
That's not how it works in any NATO military. Truck drivers and other logistics troops generally never went through any sort of advanced combat training. They can be retrained for another MOS with sufficient time but not quickly enough for any sort of crisis. And in volunteer forces, the troops driving trucks are generally doing that because they specifically enlisted to do that job.
What a silly question. I don't need to provide you any evidence. Just walk down to your local recruiting office and ask. If you tell them that you want to enlist but will only do so if they guarantee a truck driver MOS on your contact then they'll absolutely take you unless they've already hit their limit for that fiscal year.
HN is so weird sometimes. Like half the users seem to be aggressively ignorant of stuff that's common knowledge in the real world outside the tech industry. Or they expect to be spoon fed information that they could figure out themselves with a little research.
>If you tell them that you want to enlist but will only do so if they guarantee a truck driver MOS on your contact then they'll absolutely take you unless they've already hit their limit for that fiscal year.
(I think this is right, I've heard conflicting info about what recruiters can promise you)
If they are official military, then the truck driver HAS been through Basic and knows the absolute minimum of combat.
You don't have to trust me, this is literally what tons of women did during WW2 in most countries (except germany, who used slavery). Betty White and Bea Arthur both signed up for service as literal truck drivers. In fact, they both worked as truck drivers in different services set up to recruit women to replace men in non-combat roles to free them up for other service. Bea Arthur even went through some form of "Boot camp".
The UK used women heavily, especially in things like running the logistics of the air war. WRNS even did activities like fly transport planes and shuttle fighter aircraft around.
>In December 1941, Parliament passed the National Service Act, which called up unmarried women between 20 and 30 years old to join one of the auxiliary services.... by 1943 about nine out of ten women were taking an active part in the war effort.
The US uses a lot of civilian contractors for logistics, and that is the same idea. However, if the US ever deals with real, serious industrialized warfare again, I would bet on those civilian contractors being consumed by the military.
The US Women's Army Corps alone had 80k women serving, so not exactly millions, but it was a significant effort.
So not only is it the norm for a serious war to often push leadership to free up people doing non-combat duties by replacing them with people "not fit" for combat, it literally went to the extent that in WW2 we pretended to ignore sexism to make it happen and literal women were put in harms way and other "not technically front line combat but in danger of taking fire" roles.
> Like half the users seem to be aggressively ignorant of stuff that's common knowledge in the real world outside the tech industry.
Seriously agree though. That's not a slight, or a "take that", it's a real problem for HN. Tons of people here think they are smarter than average for choosing to browse orange reddit.
Get it in writing and check the fine print. A recruiter might lie but an enlistment contract is exactly that: a legally enforceable agreement. If the contract guarantees a particular MOS and the recruit doesn't get it for whatever reason then they have the option to take a discharge instead of being reclassed.
Even without a written guarantee, in volunteer forces the senior officers will generally get rid of new recruits who decide they don't want to be there instead of forcing them into a different job. Especially for the combat jobs where even training can be deadly. Better to give them discharge papers and GTFO rather than wasting money training someone who's going to be a poor performer with constant morale and discipline problems.
(Of course if there's ever another world war and conscription is reinstated then the rules will go out the window. But that's not what we're discussing here.)
First time enlistees are absolutely not given the option of whatever job they want ex ante unless they ask/push. Many/most are not negotiating up front. Maybe truck driver was a bad example but there are many jobs that either require many people to fill them so recruiters push or significant screening so they are unrealistic posts for most.
Recruiters are known to have quotas and push hard. You think your average US Army Recruit manages this morass well?
Even weirder that HN expects the average joe to “get it in writing and check the fine print.” A good number of recruits are not US citizens and may not speak english super well. Some 35k+ active duty and 5k+ added a year for the research inclined.
You knowing the answer does not make a question silly.
It's not obvious to me that the Army won't do whatever it wants with you once you've taken the shilling. I was interested so asked Gemini, so subject to the usual LLM caveats, here's the reply:
"It is possible to join the U.S. Army and be guaranteed a position as a truck driver, provided you meet all the qualifications.
This guarantee is part of the enlistment contract. The specific job you're asking about is known as MOS 88M, or Motor Transport Operator.
[...]
What "Guaranteed" Means
When you have 88M in your contract, the Army guarantees you a slot at the Advanced Individual Training (AIT) for that job.
You will first complete Basic Combat Training (BCT), which is about 10 weeks.
After graduating from BCT, you will go to 88M AIT, which is approximately 7 weeks long, located at Fort Leonard Wood, Missouri.
During AIT, you will be trained to operate and maintain the Army's fleet of vehicles, including Humvees, light/medium/heavy trucks, and tractor-trailers.
The guarantee is for the training. You must successfully pass both BCT and 88M AIT to officially become a Motor Transport Operator."
i don't think they're really expecting people to serve a useful role in the military. it's a "supplemental reserve", meaning a level below ordinary reservists.
it sounds like basically if the country was ever in a situation dire enough that they were calling on ordinary citizens to help with defense, an ordinary citizen with a week's training would be better than one with no training.
or more cynically: it's a way to make a whole bunch of voters feel like they're involved in the military, to make military spending more palatable to voters.
Maybe I wouldn't be very useful in combat but maybe I can peel potatoes or mop the floors in case of an invasion. I am thinking it frees up someone who is "combat ready" from kitchen or janitor duty. It helps, right?
In that case, how does the week's training help at all?
Maybe it's helpful just for you to understand the way the military is organised: if you are conscripted you should report to this base, you'll sleep here, your commanding officer will be someone from this branch of the armed forces, you'll be in a group of X people sharing Y shifts, etc.
Everyone in the military should be trained with weapons. If it comes down to it, even the guy who mops the floors is going to need to pick up a rifle if the situation is dire enough. It helps if he held one before at least.
I mean.... enough to make shots on target at about 300-400 yards with a sling, and enough to make shots on target at about 50 yards while standing up.
I do competitive bullseye rifle, and I've done some basic marksmanship coaching. That's about what I'd expect for maybe 6-12 hours of total training on a rifle for someone with zero prior experience with guns.
The basics of rifles is very, very simple. In competition world we just get overly focused on stuff that doesn't matter - our benchmark is like 10/10 shots at 400 yards in an 8" circle. For someone getting basic instructions, 5/10 shots at 400 yards in a 16" circle is probably fine, and that is an order of magnitude easier to teach.
It took me like 3 hours from zero experience to get to that, and another 300+ hours to get to competitively decent at prone (I might be good now but I'm not particularly skilled so it took me a lot of practice). And we're not going to talk about standing because in the competition world what we do is so far removed from reality that it's not worth talking about in this context lol. Someone with run&gun experience can talk about that, I don't know anything about that.
Agree totally, which is why I just said "make hits at 300-400 yards", because I strongly suspect they won't cover anything beyond basic marksmanship in a total of a week.
If we're nitpicking, I'm talking about lying in the dirt in a big empty field, not sitting at a bench.
Ok, it does not though. I have taught people with no experience and it takes <10 hours to get to making hits at 300-400 yards. Basic maintenance takes even less time to teach
That isn't really what happens. The unit would just surrender. That's how it went down in WWII early in the pacific campaign. Western nations don't go down to the last man.
Don't count other nations the way you do the US, and don't compare the behaviour of troops defending some piece of jungle on the other side of the planet with those defending their homes.
I mean being given the prospect of the possibility of being treated fairly as a prisoner vs committing suicide I think many would end up being a prisoner. There is no rampant idealism in Canada like say Imperial Japan that would make someone resist their own inherent pragmatism.
In the Battle of Kapyong, Korea [0], Canadian forces refused to retreat from their position, delaying advancing Chinese forces long enough to cause them to regroup. The Canadian forces were encircled, and several times called down artillery on their own positions to clear the assaulting Chinese troops.
The fighting helped blunt the PVA Spring Offensive and the actions of the 2 PPCLI and 3 RAR at Kapyong were critical in preventing a breakthrough against the UN central front, the encirclement of US forces in Korea, which were at that point in general retreat, and ultimately, the capture of Seoul.
This may be true but we want any adversary to think that we will! We at least ought to be all able and willing to do so. I hope our generals and military command know better but I want them to have multiple options and I want any adversary to have to think twice before breaching our shores.
The top brass in Canada would benefit to know who among the civil service has circuitry and dexterous control skills. And if it were me, I’d like a high-res scan of each person with the intent of precomputing who could convince ICE software of an already-established American’s identity.
It's not even that. It's literally the equivalent of an assessment center. The military is basically looking for promising recruits ahead of time. It's not about having a week's worth of training. It's about knowing who did well or not.
One week a year might add up after a while. At least you might be able to reduce the time spent in training should an urgent (but not immediate) need arise. Maybe a few years of this and you can manage basic training in six weeks instead of the usual nine. It should help build training capacity. It would likely help a bit with human resource management should the need arise: having notes on who can handle a rifle, who can handle a truck, and who can handle a drone, etc might help match people with training for what's needed.
A week is gonna be mostly "here's how to function in our organization, this is our trade specific vocabulary, here's a rifle and how you use it"
You use your D-grade troops like that for behind the lines security. You use them to check papers at checkpoints, round up dissidents, keep people from taking pot shots at your supply lines, etc, etc, the kind of stuff you don't need expensive professional infantry[1] or even beat cops[2] for.
[1] Who's expensive infantry skills are unessary overkill
[2] Who can play checkpoint thug at the right level, but who have a bunch of needless expensive training put into them regarding laws, evidince, how to conduct a traffic stop, etc, etc, that is unnecessary.
That D rating isn’t for physically unacceptable. It’s for complete incompetence or at least just punching the time clock. A lifetime of working for a bureaucracy that doesn’t care for you isn’t going to bring out the best anywhere else, either. Especially not if that’s a one week a year mandatory service. (I didn’t read tfa.)
shooting a rifle is "easy" to learn. That's why long guns are used. Hold+brace, point, aim reticle/scope, squeeze.
handguns are harder, since you can't brace the stock against your shoulder, but need to learn how to brace with your wrists and arms.
anti-tank weapons a bit harder still, since you need to maneuver properly and have multiple shooters at the same target. Also, I laugh/smirk everytime I see a movie where someone uses a LAW indoors or in an enclosed space/with someone standing behind.
(I'm ignoring grenades; suffice to say it's not as easy to pull the pin with your teeth as you think)
I think the hard part isn't the shooting, but the tactical movement side; L shape ambush or fire formation when under fire, or presence of mind to seek to leapfrog or flank, ability to communicate under pressure instead of just hunkering down or screaming your head off. It gets complicated very fast since there are vastly different tactics used in forest/vegetation versus urban warfare, and choosing the wrong tactic will get you shot fast (think chess openings; choose the wrong one and unless you are an expert - which you will not be with 1 week of training, you will get mated fast).
Even having up-to-date contact info, age, health records available for a population you know is physically able to serve is a big first step. Lot of logistics, most western countries don't want a draft that pulls randos off the street and shoves them in a van.
>How much useful combat skills can be taught in only a week?
You'd be surprised how even a small amount of training can make you deadly with a rifle. Combine that with actually having thrown a grenade, been given training in laying of mines etc.
Also, a huge chunk of "the military" is logistics -- the measure of a soldier is not always whether they can snipe someone from afar.
Useful for what role? It’s not obvious if someone has near significant or near zero training when they are acting as a stationary guard at a checkpoint etc. Which enables trained troops to preform more useful roles.
They are significantly less likely to do the correct thing if attacked, but a war isn’t going to just be over in 24 hours either so they can be trained up on the job.
Cooks and similar supporting roles are often preformed by civilians without firearm training. Preforming background checks on people beforehand makes sense, but there’s little point in firearms training if they aren’t expected to carry a weapon.
It is relative, depends on the "type of warfare" being fought, and the countries/economies involved.
In a high-tech modern warfare, the countries with a fighting force that has higher academic education, higher tech literacy are relatively quick to mobilize and become effective militarily.
How much useful combat skills a forced draft will get you? In both it’s none, but the idea is to have a ready cannon fodders that can be utilized while keeping few core employees plus automation/AI to keep the government running if SHTF.
Vendorise systemd and compile only the journal parts, if they are portable and can be isolated from the rest. Otherwise just shell out to journalctl.