Hacker Newsnew | past | comments | ask | show | jobs | submit | II2II's commentslogin

There are many reasons why C is not a low level language. Take the example: while `asm()` blocks are a common extension to C compilers, anything within the block is (a) compiler dependent and (b) architecture dependent. To choose an extreme counter example: you may as well claim that versions of BASIC with the POKE keyword are low level languages simply because you can POKE machine code directly into memory.

Yet one of the more interesting reasons, in my mind, is that C adds a tonne of abstractions. The roster of data types is one of those abstractions. Processors have a very weak notion of data types, and memory has absolutely no notion of memory types at all. For example: casting a `float` to an `int` has a very specific definition in C, and that definition involves altering the pattern of bits. While you can create a float and force the C compiler to regard that memory location as an int (via casting pointers), it isn't how the language is meant to be used (outside of rare cases).

If I recall correctly, some of the direct predecessors of C were typeless, which is closer to how the CPU and RAM treat data.


That's fair. C is very old and used for almost all hardware so I think while you can make the argument that "only clang and gcc extensions asm blocks available like that, and intrinsics are only available through vendor-specific headers" and be right, by that same logic literally nothing except binary machine code for hardware without any kind of microcode can be low-level, and even then it's probably always hardware dependent (because if it's not fully bijective to the actual hardware it's implemented on top of, the semantics leak).

Practically speaking, we have a word for the kind of "abstractionless" model you're describing: machine code. I mean, even assembler is a bunch of abstractions about 'registers' and 'instructions' that are really just specific portions of the hardware or opcodes!

So we either descend endlessly into pedantry arguing that cosmic rays and electron tunnelling represent inexcusable deviations from the overly abstracted semantics that hardware vendors expose in their products or maybe we draw the line somewhere else.

You may not agree with mine, that "practical and simple interop with machine-level language impls across a high-level language interface is sufficiently close to the hardware as to be low level" but there has to be a limit somewhere between that and "technically the hardware's operating temperature is part of its logical semantics because if it exceeds a certain value for long enough it starts to degrade and yield incorrect results or terminate execution". I think eventually it just becomes unproductive nerd sniping, personally


> Practically speaking, we have a word for the kind of "abstractionless" model you're describing: machine code. I mean, even assembler is a bunch of abstractions about 'registers' and 'instructions' that are really just specific portions of the hardware or opcodes!

I understand what you are getting to here, and agree that we are getting into the domain of semantics. Yet it could be argued that (for the most part) there is a 1:1 mapping between assembly and the assembly processes is (mostly) reversible. Personally, this is where I would draw the line.

> So we either descend endlessly into pedantry arguing that cosmic rays and ...

I think I see where you're going, though I don't agree with the particular example. If you're saying that machine language is an abstraction in itself, that those sequences of 1's and 0's are a construct of electrical engineers to describe electrical pulses that control transistors in a chip, then I fully agree with you. And if you say that those electrical pulses and transistors are themselves abstractions of physical processes, then I fully agree with you. But I wouldn't really describe it as nerd sniping. These involve different disciplines that are examining the machine at fundamentally different levels.


> you may as well claim that versions of BASIC with the POKE keyword are low level languages simply because you can POKE machine code directly into memory.

The contemporary Basic dialects of that time I could argue were low level languages. They were really thin. Like bcpl.


> Processors have a very weak notion of data types

This is absolutely not true, unless you mean to say that processors should somehow support composite (aka C struct) data types as an instruction primitive. Processor operations have to be strongly typed, by definition. For example, these are the data types supported by operations in the modern x86 instruction set (ignoring vector extensions):

- signed and unsigned integers of 8, 16, 32 and 64 bits

- floating-point decimals of 32, 64 and 80 bits (and 128 via sse)

- nul-terminated byte strings

> For example: casting a `float` to an `int` has a very specific definition in C, and that definition involves altering the pattern of bits

I don't understand this example. Casting a float to an int also has a very specific definition in IEEE-754 and is pretty much universally implemented as a hardware instruction. It has been in the x86 family since its inception: https://www.felixcloutier.com/x86/fisttp


> Processor operations have to be strongly typed, by definition.

Individual instructions assume the data they operate on is of a particular type, but it doesn't differentiate data types in memory. Here's an example where I forced the C compiler to treat the bit pattern of two floats as integers, then add those values as integers. The result is, of course, absolutely meaningless.

  float dx = 1.0;
  float dy = 1.0;
  int *pix = &dx;
  int *piy = &dy;
  int isum = *pix + *piy;
  float *pdsum = &isum;
  printf("%d\n", isum);
  printf("%f\n", *pdsum);
That's just how processors work, right? Apparently it doesn't have to be that way. From my understanding of the iAPX 432, attempts were made to encode object types in hardware.

Processor instructions are not _strongly typed_. They take bit patterns as input and output new bit patterns.

The bits are untyped, the choice of operation decides how the bits are interpreted. Nothing enforces the type of that result, you can always interpret it as something else. It may not be meaningful. Or it may be, like a fast inverse square root.

Strong typing means that each value has an intrinsic type, and there is no reinterpreting it. What CPUs do is not that, or rather the only types are "_n_-bits" (_n_ a power of 2).


I wholly agree, processors are strongly typed, even if there are holes like using integer instructions on floating-point values in XMM regs, very insightful comment:)

btw a bit of nitpick: to be fair basically no one uses x87 anymore, it's https://www.felixcloutier.com/x86/cvttss2si and friends but yes :)


For "strongly typed" I would expect some type checking.

True for IEE754 floating point operations, which are constrained to valid bit patterns. An operation on an invalid pattern - can happen with uninitialised memory - throws an exception.

Otherwise, no.


What do you mean by invalid patterns? Signalling NaNs? I wouldn't really call those invalid, but also that's only about one in a thousand bit patterns. If it kicks in less than 1% of the time it's not really "type checking".

This is still not type checking, it accepts whenever the bit pattern is a valid for floating point even when it originally was used as another type.

EDIT: Just to be clear, the parent's post was originally made in relation to an article/thread called: "LG smart TVs caught logging audio with screen off and snooping on local devices". My response was written at the same time.

> So the video doesn't seem to support the claim in the article that "LG smart TVs continuously [...] log microphone audio while appearing to be turned off".

While it is a bit unclear as to whether the logging and transmitting of audio is happening[1], without hacking the device, they were also quite clear that they made it extremely difficult (if not impossible) to MITM certain encrypted communications on their consumer devices. Combining that with claims they make about advertising makes LG's actions highly suspect.

While the video is quite clear that they are not saying LG is doing this (for legal reasons), the set out to prove the capabilities are there and the privacy related configuration options are very weak. For example: the microphone switch only controls one of the onboard microphones. Even if it physically cut off all of the microphones, there are other vectors that could only be software controlled (such as voice enabled remote controls).

Either way, whether it is LG or a third party, the capability to log and transmit audio can certainly be exploited.

Perhaps it is time we start considering whether we should do something just because it can be done. That is to say: do we really need to control a television by voice, or have other features that require a microphone, just because adding a microphone is cheap and there is enough compute to process the data?

[1] I got the impression they were claiming that the audio was recorded and stored on device. They simply could not prove it was sent to LG.


As far as I can tell, all the recording, storing and transmitting of audio from the microphone happens after 34 minutes in, after the point where they start hacking the TV and telling it themselves to do these things.

LG's advertising features appear (from what they discover before 34 minutes in and from the clips of the LG execs boasting about their ad platform) to be concerned only with what's played on the TV (and networks, devices, ..., but not microphone audio).

If I'm wrong about this, I would appreciate a timestamp for where in the video they show LG actually storing and transmitting audio recorded from the microphone.


It's a shame that the only critical evaluation of the OP is buried this far down the page, under all the "this is basically the Stasi" fluff. I wish there was something richer than up/down voting to indicate posts that contribute to the debate.

> I find that they're often the only thing that will be truthful about a company's intentions.

Really? Many years ago, I had to physically sign a license with Microsoft to obtain some software. The license was not consistent with the license included with the software. Both licenses effectively said they were the real license and that any other agreement you made with Microsoft was not valid.

I don't think there was any nefarious intent. It was likely to avoid a situation where Microsoft employees offered terms that were not approved of by the company. Still, it goes to show that it can be awfully difficult to judge the intent of a company.


I guess neither is valid then, you got the software for free.

Why would anyone put themselves through that if they didn't have to? There is the tale of Allen hand coding the bootloader in machine code, but that was because he was on the plane to give a demo. Otherwise, all of the tales I've heard of the development of BASIC involved a mainframe. Hand coded assembly was certainly conceivable, given that terminals weren't exactly everywhere back in the day, but even a basic assembler does more than the straight translation of instructions into opcodes.

> i hate being jaded because you can see where things are headed every time on repeat, but i also hate the term "power user" carries a lot of pc gamer energy and i simply could never assess that i know more then the next guy for certain.

It could be a generational thing, but I've always associated "power user" with the DOS/Windows crowd and it isn't so much about knowing more as, well, treating a computer like a computer. That is to say that the person who uses scripting in Excel is as much of a power user as the gamer who tweaks power profiles or overclocks their processor. On the flip side, someone who uses the basics of Excel or the gamer who buys the fastest GPU is a consumer of products, rather than a power user.

Funny thing is, I never hear that term being used on the macOS or *ix side of the fence -- even though there are certainly people who who would qualify.

As for the AI thing: AI is something that nobody wants but "everybody" expects. I don't blame them for pursuing it, even if it's a type of integration that I really don't want.


When people talk about how much better off kids were in the past, I remember stories from my father (who went to school in the 1960's). They involved drugs, knives, and bombs. I had it pretty good in the 1980's.

One man's drugs, knives, and bombs are another mans skateboards and Amiga 500s

Sounds like you had a pretty lame childhood to me, and in the 30 years since it's only become worse.

Much like panda bears in captivity, it is unusually difficult to give a human being a life that resembles what it evolved for, which mostly involves convincing other humans to back off the safetyism a little.

What dignity can be found in the life of the modern child?


There is a bit of a difference between making a explosives and planting a bomb in another student's locker. The former involves taking risks and may have some utility. The latter only results in others living in fear.

Call that lame if you will. I'd rather think of it as being civil.


I felt the same way as an adult exploring Africa for three years. One guy even said I was a lion that grew up in captivity, so not completely wild.

“People in developed countries don’t know how to really live, they just die slowly”

Note that guy lived in the US for a decade, and his adult kids still do.


I've only ever felt alive when I left back to Peru. You're quite literally forced to always live in the moment, rather than plan for the future, or even ruminate in the past.

Something about the environment, maybe the increased Microbiota due to food, higher freshness and Non-GMO food, being forced to talk with family. Its not as though as screens aren't present, but they don't feel so overwhelming back there.

Despite Lima having pretty bad places (hence the joke of Perukistan), Peru overall has one of the lowest suicide rates in the world, with underreporting being unlikely, since their neighbors with similar culture have less infrastructure yet report much more.


> The most dangerous part of this addiction is that it doesn't feel like addiction.

I've started framing addiction as something that we feel compelled to do even when we know it has a detrimental effect on more important aspects of our life. In that respect, yes, it does feel like an addiction.

> Unlike alcohol or drugs, this is knowledge addiction - afterall, we learned about a bunch of things in those 4 hours, didn't we?

Did we learn anything? If we aren't using that knowledge, even in casual conversation, chances are that retention is very low. I'm not even talking about useful learning here, since it is pleasurable to learn something for its own sake. I'm talking about the stickiness.

Another way to think of it is: are we even interested in learning? I have downloaded the entire Wikipedia to my computer, along with Project Gutenberg, as well as various technical documentation. (Kiwix is wonderful.) On top of that I have enough books (digital and physical) to last a lifetime. I have a multitude of resources that I can tap into without touching the Internet, and accessing it is all very low resistance (e.g. I don't have to get off my ass to go to the library). So why do I even have home Internet access? Communicating with people certainly doesn't require a high speed connection.


For the purposes of apocalyptic fiction, I wonder what the overlap is between people who have an offline copy of Wikipedia and people who have only casual security or no password. I can imagine a survivor hunting around for it for a very long time.

It's more like, is it better to be the person who:

- sees a waterfall in every river, even when one is not there?

- sees the waterfall, and is resigned about their fate?

- sees the waterfall, then struggles for survival no matter how hopeless the situation seems to be?

- is completely ignorant of the waterfall?


"sees the waterfall, then struggles for survival no matter how hopeless the situation seems to be?"

You could consider that a variant of the voter's dilemma.


> One thing people go through as they age is an elevation of cynicism and general misanthropy. After decades of being disappointed when naive idealism and speculative optimism fail, one can just get down on it all.

It's even sadder when one realizes the world was always that way. The author more-or-less says as much, though they seem to suggest it is amplified. I'm not entirely sure the part about it being more amplified today true. Most of the ills mentioned existed when I was a youth, it simply took different forms and (of course) was spread by means other than the Internet. There never was a chance to get ahead because the cards were always stacked against us.

Apologies for the cynicism.


Was it a mistake?

It is easy to say that IBM had monopolistic tendencies, because they did. On the other hand, the 5100 sounds like a vertically integrated design and it ended up being extremely expensive. The Datamaster strayed away from IBM components, but was still based upon IBM software. One can blame it's failure on the IBM PC being released a month later, but in a way that would prove the point. The Datamaster had such a big head start that the IBM PC borrowed elements of it's design, while the proprietary software of the Datamaster held back its release date.

Undoubtedly, IBM wanted more control over the PC. Avoiding a completely proprietary design was probably a calculated bet, an intentional course of action rather than a mistake. It just happens to be a bet they lost.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: