I have written a number of bootloaders that have to fit in 8K of RAM. There is absolutely no way I could write them in anything other than C and a minimal amount of assembly
And yet people have been writing bootloaders in Forth for smaller constraints than that for decades.
Hardware registers can be defined by volatile bitfields so a simple pointer can be used to access them.
Unless, of course, you have multiple registers with ordering constraints between them (e.g. write some data into one register, toggle a flag in another), because the volatile keyword in C does not give any guarantees of ordering between accesses to different volatile objects and the compiler is completely free to reorder the write to the flag before the write to the data.
Things like interrupt handlers are fairly trivial to code in C.
As long as someone else is writing the assembly code that preserves state for the interrupted context, prevents the interrupt handler from being interrupted, and so on, and then calls into the C code. And with those constraints, pretty much any compiled language is equivalent.
One can do interesting things using the linker with C code that are not really possible with most other languages. For example, I can easily link my code to execute at a particular address and generate a binary without any elf headers or any other cruft and there are interesting things that can be done with linker scripts
That's pretty much true for any compiled language.
There is no unexpected overhead due to the language. There is no background garbage collection that can run at some inopportune time. There's no extra code to do bounds or pointer checking to slow down the code or even get in the way.
The flip side of this is that you either do the bounds checking yourself (and often get it wrong, leading to security vulnerabilities) and end up passing it through a compiler that isn't designed to aggressively elide bounds checks that it can prove are not needed.
Generally it is pretty easy to move between different versions of the toolchain. C generally doesn't change much.
I can't tell from the Internet. Did you actually say that with a straight face? Even moving between different versions of the same C toolchain can cause C programs that depend on undefined or implementation-defined behaviour (i.e. basically all C programs - including yours given that several of the things that you listed in another post in this thread as really nice features of C are undefined behaviour, such as casting from a long to a pointer) are now optimised into something that doesn't do what the programmer intended.
The template function is marked as externally visible, so the inliner will only inline it if there's a very large chance that after inlining the cost of the inlined version will be less than the cost of a call (when optimising for size, not speed - the heuristic is a bit different in the latter case). In this case, you'll get smaller code if you inline it everywhere and the linker will then throw away the definition entirely.
128KB is only a problem for C++ if you want exceptions and RTTI (which you probably don't in an embedded system). Embedded also has the massive advantage of being closed-world. This means that you can turn on LTO, which helps with code size a lot (or, if your toolchain doesn't support LTO, do it the old-fashioned way and #include everything into a single file for compilation). Multiple template instances tends not to be a problem because even a fairly primitive linker will throw them away, the bigger problem with C++ is that you can end up with versions of a template being instantiated for different types, yet with the same code (e.g. an int and a float instantiation for a vector - there's no reason for them to be different because the vector doesn't perform arithmetic on the types and only cares about the sizes). Modern optimisers are getting pretty good at spotting that these are identical code and combining them into a single implementation, but they could do better.
This is a big part of the reason that Google has started looking for experience working on compilers for general programming jobs. It's pretty hard to get that experience without understanding how fundamental language concepts are implemented, even if it's just a one-month internship.
Samsung has released a JavaScript implementation for devices with under 64KB of RAM and 200KB of ROM. There's also a version of Python that targets the BBC Bit. The idea that you can't run high-level languages on these systems is laughable when you consider that a Cortex M0 is more powerful than the Xerox Alto, which was able to run an entire multitasking GUI written in a high-level language (Smalltalk) in well under 1MB of RAM.
There's a button in the 'compose email' window to turn it on, and there's online help for how to import a signing cert. Keychain will create a cert for you and a CSR, but it's then up to you to have it signed. The most important part of the grandparent's point is nothing to do with Apple though. Thunderbird also supports S/MIME out of the box, as does Outlook. The author of TFA decided to try two third-party add-ons for encrypting his mail, instead of the industry standard one that's built into the mail client that he was using. He then discovered that it was hard and acted surprised.
In some cases, people aren't willing to pay the real cost. If it costs $20k in up-front investment per customer (laying fibre to every house can easily cost that, mobile phone masts can be cheaper) and will need that to be upgraded every 20 years, then you need to charge over $100/month to make up the up-front cost and the interest on the loan, before you factor in any running costs.
In other cases, it's because companies have finite resources. If you have $100K to invest in infrastructure improvements, do you do it in a place that covers 1,000 people and lets you charge them $30/month more, or in a place that covers 500,000 people and lets you charge them $10/month more? Companies spend money in order to earn more money.
The main problems with public surveillance are data mining and data retention. Having a camera that someone is watching isn't that much worse than having someone watching, but when you can keep all of that footage indefinitely and when you can start running correlations between recordings from different cameras then you start to have something qualitatively different. It's not feasible to have police officers follow everyone around and record exactly where they go and who they talk to, but if you can process all of the camera footage from body cameras and fixed cameras then it's suddenly feasible.
Is it the taking capital out of America or taking knowledge and experience out of America that you think helps the bits that are not the capitalist exploitation machine?
It was designed for much different use than it's being used for today
Java, originally Green, was part of the 7* project at Sun. 7* was a portable, hand-held computer and Green was created as the language for programming it - particularly for programming the GUI applications. That doesn't sound to me too far away from Android's use of Java to me...
I'd be quite surprised if this is really the case. Fixing bugs is inherently harder than not introducing them in the first place, because in the latter case you're having to pay more attention to the code that you're writing and in the former you have to hunt for an issue over the entire codebase. The only time that rushing will save money in the long run is if there's a big advantage in being first to market, even if it's with a substandard product.
I don't entirely agree. There are multiple steps to finding a bug. Creating a reduced test case that reproduces it is often the most difficult bit, but once you have that and have turned it into a test, fixing the bug can be a good way of learning about an unfamiliar codebase.
So if someone stands in the International terminal of an Airport having just landed and shoots other passengers, then he won't be arrested for murder and tried in the USA?
No. Incognito modes prevent your browser from storing your browsing history (in persistent storage, assuming no bugs). They do not prevent other sites from recording it. If you're not actively blocking them, any page that contains a Twitter or Facebook button notifies these companies that you've visited the page. The same applies most advertising networks.
So if you try and take a train from Liverpool (West Coast) at 8am to Folkestone (East Coast, through London) at 3pm, they figure "oh, you are going through London at peak hours, we better charge you".
This, at least, makes sense. Often this isn't what happens though, and a ticket that goes via London is half the price of one that just does the through-London part. Of course, if you buy the cheaper ticket and then try to use it for only half of the trip, they'll object...
Even toasters, a simple machine, have advanced. Used to be that they used a thermometer to trigger the pop-up. This would burn your toast if you only had one slice.
Only in the cheaper ones. The more expensive models used a mechanical (clockwork) timer. That said, the cheap ones that used a thermometer (actually, typically a thermocouple, so they'd give different results depending on the ambient temperature) work just fine and you can work around the problem that you describe by adjusting the brownness slider depending on the amount of bread you're toasting. You should only need to upgrade it if you value the convenience of the newer models more than the cost of buying a replacement.
The same is true of more complex electronics. My first Android phone was an HTC Desire. It's now almost 7 years old, but it's perfectly adequate for what my mother wants from a mobile phone (it makes calls, with CSipSimple installed it can make cheap international calls via WiFi, it can sync with a calendar and it can record shopping lists) and a load of other things that she has no use for. Unfortunately, the latest version of Android that runs on it has an old SSL implementation and so it won't work with most HTTPS servers (it also has an obsolete list of root certs, but that's fixable, though nontrivial as Android has completely changed how it stores the root certs file recently, so you can't just copy the new one over the old). This means that the web browser can't connect to any HTTPS sites and F-Droid can't download apps because the TLS connection fails. The hardware is fine, but the device is now basically useless as a result of attention deficit disorder from the manufacturer. Apple supports their devices for longer, but when they stop you're completely out of luck because they lock the bootloader and so you can't install a third-party OS (unless there's a sufficiently major security vulnerability that you can exploit).
They've stopped doing free delivery for tickets ordered online and they've removed discounts for advanced purchase. The result of the latter is that there's no point booking the ticket in advance, so they no longer have any idea how many people are planning on taking any given train (not they they did much with that information anyway). The outcome of the former is that if you buy your ticket online, you have to collect it from a machine, whereas if you buy it on the day then you can collect it from a human or a machine. If you want a shorter queue, don't buy your ticket in advance - in the worst case, the machine queue is shorter and you're no worse off.
The fees are weird. It's sometimes cheaper to buy a ticket that goes one stop further than you need (often a lot cheaper) and just get off early. You're allowed to break your trip with most ticket classes, so this is only ever a problem for returns (where if you don't start at the correct point, they can complain).
The rolling stock is often completely inappropriate to task. For example, the trains to Stansted Airport have a tiny luggage rack at the end of each carriage. Apparently they think that most people going to the airport won't have any checked luggage. If they'd ever been on one of the trains, they'd know this is entirely wrong.
I guess there's a reason that 70% of the British public are in favour of nationalising the railways.
Not too long ago Apple defied an order to unlock a known terrorists' phone
No they didn't. They cooperated with this request, but the law enforcement operatives failed to follow the instructions and locked it further. They refused a request for a blanket mechanism to unlock all iPhones.
There were quite a few arrests after the London riots a few years ago because idiot rioters decided to take photographs of themselves committing crimes and post them online. While I'd love for there to be some 'don't use Facebook' moral to this story, in reality the moral is that if you're going to commit crimes it's a really bad idea to post evidence of your guilt in a public forum.
I was very happy with the first Seagate disk I owned. It lasted for longer than it was a useful size - for all I know, it still works, though there isn't much need for 40MB hard disks these days.
all of the test subjects in this study were British, while a similar study conducted in the US showed a 12% decrease in mortality among vegetarians.
Not sure if it's related, but meat bought in the USA is far more likely to be pumped full of antibiotics than in the UK. There are other differences in the kinds of meat in different price brackets, so 'eating meat' probably means something quite different on each side of the pond.
So, somehow, British people who eat less meat are more likely to die for unusual reasons.
Being bludgeoned to death for excessive smugness is the leading cause of death among vegans.
No, the point of the OO model is that you should decompose a problem into smaller problems and the only thing that is sufficiently expressive to be able to represent the parts of the problem is a simple model of a general-purpose computer, which communicates with other simple models of general-purpose computers by message passing. Everything else is a later addition.
I have written a number of bootloaders that have to fit in 8K of RAM. There is absolutely no way I could write them in anything other than C and a minimal amount of assembly
And yet people have been writing bootloaders in Forth for smaller constraints than that for decades.
Hardware registers can be defined by volatile bitfields so a simple pointer can be used to access them.
Unless, of course, you have multiple registers with ordering constraints between them (e.g. write some data into one register, toggle a flag in another), because the volatile keyword in C does not give any guarantees of ordering between accesses to different volatile objects and the compiler is completely free to reorder the write to the flag before the write to the data.
Things like interrupt handlers are fairly trivial to code in C.
As long as someone else is writing the assembly code that preserves state for the interrupted context, prevents the interrupt handler from being interrupted, and so on, and then calls into the C code. And with those constraints, pretty much any compiled language is equivalent.
One can do interesting things using the linker with C code that are not really possible with most other languages. For example, I can easily link my code to execute at a particular address and generate a binary without any elf headers or any other cruft and there are interesting things that can be done with linker scripts
That's pretty much true for any compiled language.
There is no unexpected overhead due to the language. There is no background garbage collection that can run at some inopportune time. There's no extra code to do bounds or pointer checking to slow down the code or even get in the way.
The flip side of this is that you either do the bounds checking yourself (and often get it wrong, leading to security vulnerabilities) and end up passing it through a compiler that isn't designed to aggressively elide bounds checks that it can prove are not needed.
Generally it is pretty easy to move between different versions of the toolchain. C generally doesn't change much.
I can't tell from the Internet. Did you actually say that with a straight face? Even moving between different versions of the same C toolchain can cause C programs that depend on undefined or implementation-defined behaviour (i.e. basically all C programs - including yours given that several of the things that you listed in another post in this thread as really nice features of C are undefined behaviour, such as casting from a long to a pointer) are now optimised into something that doesn't do what the programmer intended.
The template function is marked as externally visible, so the inliner will only inline it if there's a very large chance that after inlining the cost of the inlined version will be less than the cost of a call (when optimising for size, not speed - the heuristic is a bit different in the latter case). In this case, you'll get smaller code if you inline it everywhere and the linker will then throw away the definition entirely.
128KB is only a problem for C++ if you want exceptions and RTTI (which you probably don't in an embedded system). Embedded also has the massive advantage of being closed-world. This means that you can turn on LTO, which helps with code size a lot (or, if your toolchain doesn't support LTO, do it the old-fashioned way and #include everything into a single file for compilation). Multiple template instances tends not to be a problem because even a fairly primitive linker will throw them away, the bigger problem with C++ is that you can end up with versions of a template being instantiated for different types, yet with the same code (e.g. an int and a float instantiation for a vector - there's no reason for them to be different because the vector doesn't perform arithmetic on the types and only cares about the sizes). Modern optimisers are getting pretty good at spotting that these are identical code and combining them into a single implementation, but they could do better.
This is a big part of the reason that Google has started looking for experience working on compilers for general programming jobs. It's pretty hard to get that experience without understanding how fundamental language concepts are implemented, even if it's just a one-month internship.
Samsung has released a JavaScript implementation for devices with under 64KB of RAM and 200KB of ROM. There's also a version of Python that targets the BBC Bit. The idea that you can't run high-level languages on these systems is laughable when you consider that a Cortex M0 is more powerful than the Xerox Alto, which was able to run an entire multitasking GUI written in a high-level language (Smalltalk) in well under 1MB of RAM.
There's a button in the 'compose email' window to turn it on, and there's online help for how to import a signing cert. Keychain will create a cert for you and a CSR, but it's then up to you to have it signed. The most important part of the grandparent's point is nothing to do with Apple though. Thunderbird also supports S/MIME out of the box, as does Outlook. The author of TFA decided to try two third-party add-ons for encrypting his mail, instead of the industry standard one that's built into the mail client that he was using. He then discovered that it was hard and acted surprised.
In some cases, people aren't willing to pay the real cost. If it costs $20k in up-front investment per customer (laying fibre to every house can easily cost that, mobile phone masts can be cheaper) and will need that to be upgraded every 20 years, then you need to charge over $100/month to make up the up-front cost and the interest on the loan, before you factor in any running costs.
In other cases, it's because companies have finite resources. If you have $100K to invest in infrastructure improvements, do you do it in a place that covers 1,000 people and lets you charge them $30/month more, or in a place that covers 500,000 people and lets you charge them $10/month more? Companies spend money in order to earn more money.
The main problems with public surveillance are data mining and data retention. Having a camera that someone is watching isn't that much worse than having someone watching, but when you can keep all of that footage indefinitely and when you can start running correlations between recordings from different cameras then you start to have something qualitatively different. It's not feasible to have police officers follow everyone around and record exactly where they go and who they talk to, but if you can process all of the camera footage from body cameras and fixed cameras then it's suddenly feasible.
Is it the taking capital out of America or taking knowledge and experience out of America that you think helps the bits that are not the capitalist exploitation machine?
It was designed for much different use than it's being used for today
Java, originally Green, was part of the 7* project at Sun. 7* was a portable, hand-held computer and Green was created as the language for programming it - particularly for programming the GUI applications. That doesn't sound to me too far away from Android's use of Java to me...
It looks like you're quoting something there, but without attribution it's hard to see what. What does your source say about Nixon's pardon?
I'd be quite surprised if this is really the case. Fixing bugs is inherently harder than not introducing them in the first place, because in the latter case you're having to pay more attention to the code that you're writing and in the former you have to hunt for an issue over the entire codebase. The only time that rushing will save money in the long run is if there's a big advantage in being first to market, even if it's with a substandard product.
I don't entirely agree. There are multiple steps to finding a bug. Creating a reduced test case that reproduces it is often the most difficult bit, but once you have that and have turned it into a test, fixing the bug can be a good way of learning about an unfamiliar codebase.
So if someone stands in the International terminal of an Airport having just landed and shoots other passengers, then he won't be arrested for murder and tried in the USA?
No. Incognito modes prevent your browser from storing your browsing history (in persistent storage, assuming no bugs). They do not prevent other sites from recording it. If you're not actively blocking them, any page that contains a Twitter or Facebook button notifies these companies that you've visited the page. The same applies most advertising networks.
So if you try and take a train from Liverpool (West Coast) at 8am to Folkestone (East Coast, through London) at 3pm, they figure "oh, you are going through London at peak hours, we better charge you".
This, at least, makes sense. Often this isn't what happens though, and a ticket that goes via London is half the price of one that just does the through-London part. Of course, if you buy the cheaper ticket and then try to use it for only half of the trip, they'll object...
What dissent? There is no dissent. The government is unifying the people. Theresa May said so, so it must be true!
Even toasters, a simple machine, have advanced. Used to be that they used a thermometer to trigger the pop-up. This would burn your toast if you only had one slice.
Only in the cheaper ones. The more expensive models used a mechanical (clockwork) timer. That said, the cheap ones that used a thermometer (actually, typically a thermocouple, so they'd give different results depending on the ambient temperature) work just fine and you can work around the problem that you describe by adjusting the brownness slider depending on the amount of bread you're toasting. You should only need to upgrade it if you value the convenience of the newer models more than the cost of buying a replacement.
The same is true of more complex electronics. My first Android phone was an HTC Desire. It's now almost 7 years old, but it's perfectly adequate for what my mother wants from a mobile phone (it makes calls, with CSipSimple installed it can make cheap international calls via WiFi, it can sync with a calendar and it can record shopping lists) and a load of other things that she has no use for. Unfortunately, the latest version of Android that runs on it has an old SSL implementation and so it won't work with most HTTPS servers (it also has an obsolete list of root certs, but that's fixable, though nontrivial as Android has completely changed how it stores the root certs file recently, so you can't just copy the new one over the old). This means that the web browser can't connect to any HTTPS sites and F-Droid can't download apps because the TLS connection fails. The hardware is fine, but the device is now basically useless as a result of attention deficit disorder from the manufacturer. Apple supports their devices for longer, but when they stop you're completely out of luck because they lock the bootloader and so you can't install a third-party OS (unless there's a sufficiently major security vulnerability that you can exploit).
They've stopped doing free delivery for tickets ordered online and they've removed discounts for advanced purchase. The result of the latter is that there's no point booking the ticket in advance, so they no longer have any idea how many people are planning on taking any given train (not they they did much with that information anyway). The outcome of the former is that if you buy your ticket online, you have to collect it from a machine, whereas if you buy it on the day then you can collect it from a human or a machine. If you want a shorter queue, don't buy your ticket in advance - in the worst case, the machine queue is shorter and you're no worse off.
The fees are weird. It's sometimes cheaper to buy a ticket that goes one stop further than you need (often a lot cheaper) and just get off early. You're allowed to break your trip with most ticket classes, so this is only ever a problem for returns (where if you don't start at the correct point, they can complain).
The rolling stock is often completely inappropriate to task. For example, the trains to Stansted Airport have a tiny luggage rack at the end of each carriage. Apparently they think that most people going to the airport won't have any checked luggage. If they'd ever been on one of the trains, they'd know this is entirely wrong.
I guess there's a reason that 70% of the British public are in favour of nationalising the railways.
Not too long ago Apple defied an order to unlock a known terrorists' phone
No they didn't. They cooperated with this request, but the law enforcement operatives failed to follow the instructions and locked it further. They refused a request for a blanket mechanism to unlock all iPhones.
There were quite a few arrests after the London riots a few years ago because idiot rioters decided to take photographs of themselves committing crimes and post them online. While I'd love for there to be some 'don't use Facebook' moral to this story, in reality the moral is that if you're going to commit crimes it's a really bad idea to post evidence of your guilt in a public forum.
I was very happy with the first Seagate disk I owned. It lasted for longer than it was a useful size - for all I know, it still works, though there isn't much need for 40MB hard disks these days.
all of the test subjects in this study were British, while a similar study conducted in the US showed a 12% decrease in mortality among vegetarians.
Not sure if it's related, but meat bought in the USA is far more likely to be pumped full of antibiotics than in the UK. There are other differences in the kinds of meat in different price brackets, so 'eating meat' probably means something quite different on each side of the pond.
So, somehow, British people who eat less meat are more likely to die for unusual reasons.
Being bludgeoned to death for excessive smugness is the leading cause of death among vegans.
No, the point of the OO model is that you should decompose a problem into smaller problems and the only thing that is sufficiently expressive to be able to represent the parts of the problem is a simple model of a general-purpose computer, which communicates with other simple models of general-purpose computers by message passing. Everything else is a later addition.