5 ms·
I had to chuckle when the OP said "and 151 instructions." The VAX was the poster-child of CISC. Thats like, what, 20% of the instructions ARM has for SIMD a
by rhelz 3y ago
I had to chuckle when the OP said "and 151 instructions." The VAX was the poster-child of CISC. Thats like, what, 20% of the instructions ARM has for SIMD alone?
Recently, I had to learn C++17 through 20. At the same time I was learning x86 assembly, and x86 assembly was far, far easier. Downright simple and straightforward in comparison.
Aren't high-level languages supposed to make our lives easier? Isn't RISC supposed to make CPU's simpler? What happened to our world?
- quietbritishjim 3y agoMore powerful tools are often more complex to learn. A car has more controls than a push bike, and an aeroplane has more still. I'm not saying all the complexity in C++ is justified (!!!) but it's not too much of a surprise that it's more complex to learn than assembler.
- dark-star 3y agoIf you use C++ like an assembler, then it's not complicated. You only use functions, loops, arrays and structs. And GOTOs. Congratulations you now have replicated what an assembler can do, but it has become much easier (you don't have to remember details of the architecture, memory layout, etc.) But C++ puts a lot of syntactical sugar (abstractions) on top that, if you learn and understand them, can help you write even more concise and expressive code. This is where complexity comes in. Higher abstraction brings complexity. Whether that is good or bad depends on your knowledge of the language/concepts.
- deleted 3y ago[deleted]
- joshu 3y agohow many addressing modes are there? in my mind, CISC vs RISC is more about the vast array of addressing modes on CISC vs load/store on RISC, rather than the actual size of the ISA probably worth comparing to early MIPS or SPARC instead of modern ARM with extensions?
- cmrdporcupine 3y agoExactly, it's not about the amount of instructions but of the modes those instructions can take. As I understand it, having primarily load-and-store / register to register instructions and avoiding complicated mode encodings that make various processor hw optimizations much easier, and make compiler writing a lot easier, too. Classic CISC chips were "fun" to write assembly for by hand... and RISC chips are not. But if you're writing a compiler...
- kragen 3y agoi would say the arm is fun to write assembly for by hand, in part because of its deviations from risc principles; i wrote a bit about the details last night in https://news.ycombinator.com/item?id=38899295 https://news.ycombinator.com/item?id=38899295
- cmrdporcupine 3y agoYeah it's true ARM isn't terrible the few times I've played with it. In contrast, I Verilog'd up my own homebuilt system with a RISC-V core, and didn't particularly reading/writing in the RISC-V instruction set.
- kragen 3y agoyeah, risc-v is nicer than 8086 or i386 or even amd64, but it's not as nice as arm. 8086 was surely 'cisc' but it's a pain in the ass
- cmrdporcupine 3y agoyeah my standard for "fun CISC" is the 68000, the first machine I truly wrote assembler for (after handrolling 6502 by POKEing opcodes). It was a pleasure. Though I don't miss big-endian, I can't think like that anymore.
- 3y ago
- deaddodo 3y ago> Recently, I had to learn C++17 through 20. At the same time I was learning x86 assembly, and x86 assembly was far, far easier. Downright simple and straightforward in comparison. Somewhere along the lines of the development of high-level languages, "tedious and semi-unmanageable" got replaced with "difficult". Assembler isn't difficult, nor is it meant to be; any emulator or embedded developer could tell you this. Assembler just has few tools to ease development/code structuring and gets very flat and overwhelming in large code-bases; these are the problems C/C++, Pascal, Algol, etc were designed to solve.
- LeFantome 3y agoWe are probably agreeing but Pascal at least was explicitly designed to allow and to teach “structured” programming. In some ways, it is designed to limit your options. Their is no denying though that it makes code easier to read and also makes intent much clearer. This in turn makes not just creating but of course maintaining and extending large code based much easier. In terms of complexity, it depends on how you measure. In assembler, it does not take long to learn how to compare and jump. That gives you the power of while, do/while, for, if/then, and of course “goto” ( which your “more advanced” language may lack ). I would argue though that it is easier to understand the syntax of if / else than the equivalent assembler. Again, if not easier to write, it is at least more obvious when reading ( for less experienced eyes ).
- deaddodo 3y agoWell, we're not disagreeing. Your first paragraph is basically just a summation of my point while the second paragraph reiterates it. Assembler is not necessarily difficult, it's tedious; which includes parsing and keeping it in mind. Most modern assemblers offer some sort of Macro system to even help with some of the aforementioned niggles.
- RagnarD 3y agoIndividual assembly instructions are basically trivial to grasp (the actual syntax is probably the hardest part.) The challenge is synthesizing larger, useful programs from the little tidbits of data manipulation. It's a great exercise in bottom-up hierarchical integration. As deaddodo notes, this is why higher level languages were developed, to raise conscious focus away from having to use such tiny primitives.
- crq-yml 3y agoModern computing is a line of middlemen, each one in turn saying "let me help you with that" in a patronizing tone. At the end of the line you are handed an iPad and told what you are allowed to consume.
- tux3 3y agoBut then, every so often, people do the whole trip in reverse starting from sandboxed Javascript on a locked down phone or console and putting together an exploit chain all the way down to kernel-mode assembly shellcode We add layers upon layers of abstraction, but the layers below are never really obsolete, it's always very useful to understand them!
- cduzz 3y agoOr you're running code compiled by the trusted compiler that generates some intermediate bytecode to run on your Boroughs or IBM System 38 and you're locked out of writing to the "True" underlying hardware by "the man" on some locked down mainframe.
- LeFantome 3y agoNot just “modern” computing. Your point has been true since the beginning. That said, the line of middlemen is indeed longer than ever.
- spennant 3y ago+1 Insightful
- mr_toad 3y ago> Aren't high-level languages supposed to make our lives easier? Assembly code is easy to learn and easy to code simple programs, but it’s a whole toolbox full of foot-guns and it’s easy to make a buggy unmaintainable mess.
- bitwize 3y agoRISC architecture has already changed everything. Or did you miss when Apple Silicon basically lapped everybody in performance per watt, while having raw performance numbers comparable to, if not exceeding, x86 hardware? Sometimes, it really is the case that a great new technology doesn't exist until Apple invents it.
- cmrdporcupine 3y agoIt's crazy, in another terminal I have an SSH session open to an RK3588 ARM SoC SBC sitting on the desk behind me. On it I am running benchmarks of my application -- which contains a custom virtual machine for a language interpreter and a custom database engine. On throughput -- compared to my Ryzen 7 Thinkpad, it's getting 1/2 the performance on the DB engine side of things and 1/3rd for the VM. (This is on a single core, I don't have a good bench for multicore performance yet.) The thing is... the laptop cost ~$3000, and is clocked way higher. The SBC cost ~$200. It's warm to the touch, but not hot. The little DC powerbrick it came with is totally fine, and there's no fan, just a heat sync. I could stick a dozen of these in a 19" enclosure, and with the right programming have an absolutely awesome amount of computer for the price and power use. I just wish I could get an ARM workstation-class machine that wasn't a Mac.
- drpixie 3y ago> with the right programming :( That's the bit we still don't have right. Apart from a few special cases, we really struggle to use a small number of threads, or a GPU, without enormous amounts of effort - let alone distributed processors. I'm sure part of the problem is we depend on high levels of backwards compatibility with systems assuming mono-processing ... but I'd like to think there is a way. Now if someone came up with a really usable and general model for software across distributed processors...
- inkyoto 3y agoIt was not the number of instructions in the VAX ISA, it was their complexity and the multiple indirection level addressing modes. Some of the instructions are truly mind-boggling even by today's complexity standards, e.g. queue operations (four! – INSQHI, INSQTI, REMQHI and REMQTI), polynominal evaluation (POLYx), index computation, CRC calculation via an optionally supplied polynominal table (CRC), a comprehensive set of character operations, operations on packed numbers and others. The VAX-11 instruction comes with examples in a high-level programming language (COBOL, FORTRAN or PL/1) and how that translates into the VAX-11 instructions, e.g.: COBOL: 01 A-ARRAY. 02 A PIC X(10) OCCURS 15 TIMES. 01 B PIC X(10). MOVE A(I) TO B. VAX-11 assembly: INDEX I, #1, #15, #10, #0, R0 MOVC3 #10, A-10[R0], B Or, the bitwise use of INDEX: PL/1: DCL A(-3:10) BIT (5); A(I) = 1; VAX-11 assembly: INDEX I, #-3, #10, #5, #3, R0 INSV #1, R0, #5, A ; Assumes A is byte aligned
- 1vuio0pswjnm7 3y ago"Downright straightforward and simple." Many HN comments, as well as other online sources, suggest software developers generally do not like "simple". The majority find comfort in complexity.
- fasterik 3y agoI don't understand this particular criticism of C++, and I generally think there are a lot of legitimate criticisms of C++. Yes, the language spec has become complicated. But you don't have to use every single feature in the language. As the slogan goes, if you don't use it, you don't pay for it. I find that the style I like best is what John Carmack calls "C flavored C++". To me this means plain structs and functions, references instead of pointers when appropriate, and conservative use of: templates, constexpr, operator overloading, strings, vectors, threads, and synchronization primitives. This subset of the language is relatively easy to learn and pleasant to use. Still, I will have no problem jumping ship to one of the newer C++ replacement languages when one that I like becomes mature enough.
- creer 3y agoYears ago, when I considered C++ (and discarded it), it seemed that it was hard to write C++ without understanding most of the features. Let's not argue about THAT. But is there now an accepted small subset that can stand alone as a first layer of study and usage? Giving a real understanding of that subset and being able to write in that subset? Any text describes this? This idea of layers in learning a language seems fundamental to me - (Perl 5 was - still is - amazing for that. Perl 6 / Raku is great but it lost that.)
- guenthert 3y ago> But you don't have to use every single feature in the language With a large language like C++ it is indeed quite common that teams agree (or are agreed upon) a subset to use, yes. > As the slogan goes, if you don't use it, you don't pay for it. That's not quite true though. You don't get to chose which feature has been used by the people who wrote the code you're told to fix. > I find that the style I like best is what John Carmack calls "C flavored C++". And this is a matter of personal preference. I would have embraced a strict, statically type-safe, OO language with focus on code-reuse, maintainability and performance, not based on C (I do like C for what it is, but it clashes badly with the other goals).
- fasterik 3y ago>You don't get to chose which feature has been used by the people who wrote the code you're told to fix. True, but that's more of a sociological problem than a technical problem. It's a question of how projects and teams enforce programming styles. I do see the advantages of a language like Go where it's been designed with a minimal set of features to restrict the range of crazy things you can do. But if your project has certain constraints, like not using GC, then Go is a non-starter. The big advantage of C++ is that it's suitable for making literally any kind of software, from embedded to web applications.
- p_l 3y agoEach VAX instruction, even before going into crazy space with POLY and other complex ones, has tons and tons of addressing modes, modifiers, etc. To the point that the largest possible VAX instruction is longer than VAX memory page, at IIRC 522 bytes to 512 byte page size.