log☇︎
120200+ entries in 0.042s
asciilifeform: (whole thing worth reading.)
asciilifeform: ons subsystem he designed beams back "hello world" after an almost-aborted launch, a navigation jet which misfired, and the solar panels sustained some damage by space debris. normally, it's unnecessary to have confirmations of basic operations, but it makes perfect sense under C.'
asciilifeform: 'it's appropriate to make a machine print "hello world" to verify that everything works after all the mind-boggling nonsense has interfered with the real purpose of a computer, and you never know which part of booting up will fail due to a minor bug. the delight in a C programmer's eyes when his machine thus booted typed "hello world" back at him would probably parallel that of a Common Lisp programmer when the satellite communicati
asciilifeform: http://www.xach.com/naggum/articles/3141310154691952@naggum.no.html << ?
asciilifeform: there does not exist such a thing as 'a c program', even the schoolbook 'hello world' relies on a megatonne of os crapola simply to load and produce human-readable out.
asciilifeform: arguably more different than nintendo vs x86.
asciilifeform: even gcc-to-bare-mips is quite different animal from gcc-to-x86-linux
asciilifeform: nintendo and supernintendo, etc.
asciilifeform: there are gcc programmers, gcc-and-microshit programmers, etc.
asciilifeform: or ever was.
asciilifeform: nobody is a c programmer.
asciilifeform: (some new, or removed, 'optimization' that gives exploitable overflow in this or that.)
asciilifeform: otherwise one day you discover 'surprise', gcc6 or whatever won't build trb, or worse, builds-with-boojum
asciilifeform: for so long as you are still using traditional trb, you are stuck with some variant of this.
asciilifeform: as of rotor.
asciilifeform: ben_vulpes: iirc we already had frozen gcc
asciilifeform: (or on pogo. or,or.)
asciilifeform: so, if we said 'this here x86-64 asm is canonical bignumatron', it will be quite useless to phf with his armhf box, or whatnot.
asciilifeform: but C remains popular not merely because 'c compiler is the first thing to be ported to any new iron' but also because it is 'lowest common denominator.'
asciilifeform: e.g., anything pertaining to bignums - as hopefully is abundantly clear from the example.
asciilifeform: as per the immediately previous thread, some operations are actually SIMPLER, conceptually, to express in x86 asm than in c !
asciilifeform: now also, the effect of 'babelization' is instructively pertinent.
asciilifeform: but in all cases the idiocy is cumulative.
asciilifeform: now ~how much retardation to create himself~ is often within his control, and sometimes he can manage a 0
asciilifeform: thing is, 'right way to do things' is not in practice available to engineer, who always and ~without exception labours inside a cage made of his predecessors' retardation.
asciilifeform: and syphilis
asciilifeform: possibly also with only turnip.
asciilifeform: c ) get on a boat and MAYBE come back 20 yrs later.
asciilifeform: then menu is a) turnip b) dirt.
asciilifeform: well if all you got is turnip.
asciilifeform: quite unlike c.
asciilifeform: (where the operands can be of any size you like)
asciilifeform: well no, that was 'compiler' for sane-people addition
asciilifeform: which is how the disease perpetuates itself.
asciilifeform: to our grief, it is very very easy to write a (sad, inefficient, but working) c compiler.
asciilifeform: point earlier was, the 'c is THE close-to-the-metal language' is a half-truth
asciilifeform: aha.
asciilifeform: does it still stink? NEED MOAR SPRAY
asciilifeform: hygiene-via-parfumery.
asciilifeform: as for the 'kink high' aspect, the rubes are approaching the retardation in much the same way medieval folk approached the plague
asciilifeform: among other caltrops.
asciilifeform: all of this retardation is because c semantics are very much inhospitable to working on variably-sized, non-register-sized operands
asciilifeform: (and plenty of 'special' cpu instrs, which operate on large fixnums, e.g., 128-bit xmm regs)
asciilifeform: massive bags of hand-asm inline.
asciilifeform: mircea_popescu knows very well what they do
asciilifeform: but underneath the emperor's robe, there is same bare arse as everyone else has.
asciilifeform: fashion aha.
asciilifeform: 'fixed memory' is what you get when you buy ram. no other kind is sold.
asciilifeform: it is used in every box you can presently buy. pretenses to the contrary.
asciilifeform: (the reverse is not true, of course)
asciilifeform: so to continue the tale, NONE of these ops (add-with-carry, shift-with-carry, etc) map to any conceivable c code !
asciilifeform: (all cpu you might ever encounter, at any rate.)
asciilifeform: and works similarly on all cpu.
asciilifeform: nono, this is quite elementary.
asciilifeform: http://x86.renejeschke.de/html/file_module_x86_id_4.html << aha.
asciilifeform: try it yourself.
asciilifeform: you get a carry bit set to 1, and [edi] is 0x557799ba .
asciilifeform: the contents of edi+4 is unaffected by the first instruction, mircea_popescu .
asciilifeform: mircea_popescu want me to work it out pedantically ?
asciilifeform: nope.
asciilifeform: it adds the overflow bit (which can physically be 1 or 0, think about it) to the next add.
asciilifeform: mircea_popescu: that's what add-with-carry is for
asciilifeform: jc overflow
asciilifeform: rcl dword [num+8], 1
asciilifeform: rcl dword [num+4], 1
asciilifeform: shl dword [num], 1
asciilifeform: we also have things like shift-with-carry,
asciilifeform: because we have this great thing called 'adc', add-with-carry.
asciilifeform: ( we are on a 32-bit box in this example ) and we add 0x12345678AABBCCDD , a 64-bit int, to another 64-bit int, to get a 128-bit result.
asciilifeform: adc dword [edi+8], 0
asciilifeform: adc dword [edi+4], 0x1234567
asciilifeform: add dword [edi], 0xAABBCCDD
asciilifeform: so,
asciilifeform: 64-bit, rather
asciilifeform: say [edi] points to one
asciilifeform: let's say i'd like to add two 128-bit ints together.
asciilifeform: i will give example here, to nail in the point: ☟︎
asciilifeform: and has not existed since... 1982 or so.
asciilifeform: the arch it ~was~ 'fancy macroasm' for no longer exists
asciilifeform: c is fundamentally braindamaged in 1,001 ways, even in light of its nominal purpose as 'fancy macroassembler'
asciilifeform: (which are 64bits)
asciilifeform: well let's say that we redefined int as 64b. then the headache would simply be 'why does c not give us the 128-bit mul result that pentium happily disgorges when we mul rax, rbx'
asciilifeform: ^ this is a personal hatred of asciilifeform's, when dealing with bignumatrons
asciilifeform: from comments, '...there are many processor features that are not directly available in C even though they are available in a wide variety of processors (the overflow flag is a prime example). A similar situation that comes to my mind now is that 32bit*32bit multiplication results in a 32-bit integer in C even though most processors yield a 64-bit result...'
asciilifeform: 'make a copy' and put it WHERE ??
asciilifeform: aaaaaahahaha
asciilifeform: d 32-bit even though pointers became 64-bit. The problem now is that transformations that assumed integers and pointers to be the same size don't work anymore, because now their point of overflow is different.'
asciilifeform: e.g., 'Pointer arithmetic. In the good old times, an int and a pointer used to have the same size. People happily used ints as array indices. Array indexing is just pointer arithmetic, and in some architectures (like x86), you can often perform the pointer arithmetic plus load in a single instruction. Then came 64-bit architectures. For reasons I don't really get (compatibility?), on x86-64 and other 64-bit architectures ints remaine
asciilifeform: even if the peanut gallery has shat all over it.
asciilifeform: the issue in subj link is quite real though.
asciilifeform is out of telepathic-psychoanalytic pills, is ill-equipped to answer the q of what 'c programmer's concept of identity' may be.
asciilifeform incidentally currently cpp's for money, and has much that could be said on the subj, but naggum already said it
asciilifeform: at least the cpp folk are - typically - aware that their retarded horror has broad swath of vendor-specific behaviours and miscellaneous strange.
asciilifeform: as opposed to 'in unix' or 'in winblows'
asciilifeform: you'd be surprised, there are folks who are convinced that they've been 'programming in c' for 30+ yrs.
asciilifeform: ( also of interest, to certain folks, by same: http://inf.ufrgs.br/~vbuaraujo/blog/?entry=20160528-lisp-without-cons-cells )
asciilifeform: in other lulz, http://inf.ufrgs.br/~vbuaraujo/blog/?entry=20160519-c-identity-crisis
asciilifeform: (colonel 'mad jack' churchill)
asciilifeform: 'In my opinion, sir, any officer who goes into action without his sword is improperly dressed.'
asciilifeform: quite ambiguous pic.