6 ms·
We live in a world were ever PC has at least 2 Gbyte of ram and most CPU's are 64 bits, the section 'Data Representation' begins to explain how 'everything' can
by fjfaase 7y ago
We live in a world were ever PC has at least 2 Gbyte of ram and most CPU's are 64 bits, the section 'Data Representation' begins to explain how 'everything' can be stored in a single 32-bit integer, if we limit integers to 30 bits. What the hack?
- wtfrmyinitials 7y agoKeeping values small is still useful for the sake of CPU cache
- pkaye 7y agoAs Bill Gates was alleged to have said "640k ought to be enough for anybody."
- b212 7y agoHe did not say that, sorry.
- Darkphibre 7y agoBut he did say we wouldn't likely see speeds in excess of 64kbps. I save that article for decades, still have it somewhere in a filing cabinet, even though it's been scrubbed from the internet. He was referencing the limitations of copper POTS, of course. But I still found it funny (if I recall correctly, it was printed side-by-side with his debunking of the 'you only need so much ram' quote).
- hermitdev 7y ago64kbps was a limitation of old analog phone lines, which were pretty noisy and also also operated at a pretty low frequency (they only allowed up to a certain frequency, anything beyond was clipped on old analog lines). In practice, dont know that I saw anything beyond 56k. And you could only get that on a clean line, near a switching station. My self, not sure I ever saw much beyond 48k, maybe occasionally 52k, but dont think I ever saw a dialup connection hit the full 56k. Higher speeds werent possible until moving to digital lines (64k for IDSN, single line, 128k for dual). DSL upped the anty, pushing to 1-3 Mbps in my area. Cable really pushed it when I could get 15 Mbps vs best available DSL in my area at around 3 Mbps. Today, I have around 200 Mbps over cable (gigabit is available), best DSL in the area is still around 25 Mbps. Fiber is not available yet, but AT&T is running fiber, but 2 years in, still not an option and they haven't published pricing/speeds for the area.
- Rerarom 7y agoMy top dial-up speed was 46.6 kbps (not sure if kilobytes or kibibytes)
- jazzyjackson 7y agobut he was alleged to !
- badsectoracula 7y agoYes, RAM is aplenty, lets have every program use it to its fullest :-P
- 0815test 7y agoAlso known as "unused RAM is wasted RAM".
- kevin_thibedeau 7y agoMost CPUs are 8-bit with 32-bit beginning to take over. They usually don't have more than 256K.
- msla 7y agoMost CPUs aren't in self-hosting systems.
- kevin_thibedeau 7y agoYes they are. Embedded applications outnumber top end computers by an order of magnitude.
- msla 7y agoI think you just agreed with me.
- nineteen999 7y agoPerhaps he means that they are not generally self-hosted, in that we generally tend to cross-compile for the embedded hardware, rather than compiling on the embedded hardware.
- msla 7y agoThat's precisely what I meant, and I don't understand how it could be misunderstood if you know what "self-hosting" means in this context.
- yakubin 7y agohttps://cr.yp.to/bib/1995/wirth.pdf https://cr.yp.to/bib/1995/wirth.pdf
- nzentzis 7y agoGenerating 64-bit code would be simpler in many ways, but I decided not to go into it until the basic language features are put in place. The extent of the changes involved in switching to amd64 will help directly show why having an intermediate representation for the generated code would be valuable. Besides, if you're looking for a high-performance Scheme that fully utilizes all available system resources, there are definitely better options available. :)
- fjfaase 7y agoFor your initial design you could also have chosen to use an additional byte to represent the type of the value. As representing the type would only require 2 or 3 bits, some bits will be unused (probably some more, due to alignment requirements), but maybe later on in the development of the compiler, those bits could be used to store some additional information. That would have made your code a lot simpler. As you probably want to combine these valuse together into some structures representing the various language constructs, an additional byte to represent the type of the structure, and thus the type of its elements, would also be needed. Than you could do away with the extra bits representing the type. I just think this is premature optimization and making things unneccessary complex especially for your readers who might want to learn something from it.
- tom_mellior 7y agoThe types of user-defined "structures" are usually identified by a tag inside the structure, not encoded in the pointer as for the few primitive types.
- NikkiA 7y agoYou'd probably be surprised how many GC'ed languages actually avoid the whole tagged/boxed variable thing in pursuit of the performance benefits. ocaml for example is limited to 30bit ints for this reason, the haskell standard only guarantees 30bits from the 'Int' implementation for this reason. As I said further down this thread though, it's a 'speed' thing, not memory storage thing, the common belief is that boxing is slow, because it was slow in java, but in reality boxing is a) a mostly acceptable trade-off that only loses out in extreme cache-limited situations, and b) something that could be optimised away anyway.
- NikkiA 7y agoIt's premature optimisation... Java has conditioned everyone to believe that boxing variables is slow.