6 ms·
assembly is not the ultimate in speed, that's a myth. for many problems there are often high level approaches that offer orders of magnitude of speed up which a
by boltzmann-brain 4y ago
assembly is not the ultimate in speed, that's a myth. for many problems there are often high level approaches that offer orders of magnitude of speed up which are simply not expressible in assembly code due to the complexity of the assembly that would be needed to express them making it infeasible to program these approaches in assembly.
- P5fRxh5kUvp2th 4y agoanything expressible above assembly is expressible in assembly, both at the macro and micro level, only assembly can hyper-optimize the use-case in a way that a generalized compiler often can't. There is no myth here, it's a simple statement of fact. The Zig compiler does things C compilers can't. C developers can get access to those same techniques by bypassing C compilers to express them directly in assembly. This is not arguable, it simply is.
- boltzmann-brain 4y ago> anything expressible above assembly is expressible in assembly parser for unicode, go. I'll wait over here.
- P5fRxh5kUvp2th 4y agoIf I grab a C library that does this, compile it, and hand you the resulting assembly, will your mind explode?
- boltzmann-brain 4y agothat's not written in assembly, just compiled to assembly.
- P5fRxh5kUvp2th 4y agoWhen you start trying to argue semantics, you've given up the point.
- boltzmann-brain 4y agoJust restating my argument to you, so you can better understand it.
- pjmlp 4y agoYou are aware that 30 years ago we used to write business applications in pure Assembly, right?
- boltzmann-brain 4y agowe did? I was a programmer 30 years ago, and what was being widely used was cobol, qbasic, pascal, even ada, meanwhile assembly was already at this point relegated to optimization (in non-business applications) or nothing (in business applications, where structured programming was a line manager's mantra, just like OOP was later, then FP, and so on)
- pjmlp 4y agoFor example, Lotus 1-2-3.
- boltzmann-brain 4y agoLotus 1-2-3 was a legacy code base already 30 years ago. Which was one of the contributing reasons to why it eventually died.
- pjmlp 4y agoI can provide examples, PC Tools for one. I didn't wrote that every developer out there was writing 100% of business applications in Assembly, and I guess I don't need to explain the difference between ∃ x and ∀ x.
- rep_lodsb 4y ago>cobol, qbasic, pascal, even ada Except for QBasic, all of them compile to machine code and have features that can't be represented in idiomatic C, but are often trivial to implement on the underlying hardware.
- boltzmann-brain 4y ago
- rep_lodsb 4y agoIf you mean "parsing UTF-8 into codepoints", it isn't that complex, and the most optimized libraries already use SIMD intrinsics which are basically assembly instructions.
- ArtixFox 4y ago
- flohofwoe 4y agoYou can express stuff in assembly that's simply not possible in a high level language like C (or Zig for that matter). An obvious thing is defining your own calling convention with hardwired 'register semantics', and then changing that calling convention at will. Or you can use status flags as additional function return values, manipulate the stack, jump into the middle of an instruction, write self-modifying code etc etc (disclaimer: some of this stuff might actually not be possible on modern CPUs though).
- boltzmann-brain 4y agoyes, of course, but there are ways to reason about programs that are not expressible in assembly, so a purely assembly program is not able to reason about itself in this way in order to optimize itself in the same way as a higher level program can. both domains can do things the other can't. and, again, the more complex a concept is, the more difficult it is to implement in assembly, due to the sheer volume of code. you can't argue with that.
- P5fRxh5kUvp2th 4y agoThis is called moving the goalpost. You started talking about speed, now you're talking about "expressiveness", which is a wholly different thing. Stay on topic.
- boltzmann-brain 4y agono, that's exactly what I was talking about in the first reply, i just reiterated it, because your reply wasn't taking any of that into account.
- P5fRxh5kUvp2th 4y agoThen you went for a strawman because the discussion was about performance, not expressiveness.
- 4y ago