[HN Gopher] The Power C Compiler
___________________________________________________________________
The Power C Compiler
Author : pseale
Score : 85 points
Date : 2022-06-04 15:27 UTC (7 hours ago)
(HTM) web link (www.mixsoftware.com)
(TXT) w3m dump (www.mixsoftware.com)
| avgcorrection wrote:
| That looks like the Go logo. Did the Go creators reuse one of the
| C logos? (Yes yes, Unix lineage)
| pjmlp wrote:
| Nope, first they started with Gopher that was based on Glenda.
|
| https://9p.io/plan9/glenda.html
|
| Then because it wasn't deemed professional enough, a marketing
| campaign was created for the current logo.
|
| https://go.dev/blog/go-brand
| mseepgood wrote:
| The Gopher is the mascot, not the logo, always has been. The
| original Go logo was this:
| https://go.dev/blog/gopher/logo.png
| pjmlp wrote:
| > The circular shape of the letters hints at the eyes of
| the Go gopher, creating a familiar shape and allowing the
| mark and the mascot to pair well together.
| bluedino wrote:
| I'd love to see the VHS tapes with lessons that teach you C
| UltraViolence wrote:
| I cringe when I look at this. Everything was sooooo primitive
| back then! We've become spoiled with programming languages like
| Rust, C# and Python, almost all of which are free to use.
|
| Except for the fact that I was 30 odd years younger and had a
| beautiful girlfriend, I don't long back for those times.
| rwmj wrote:
| The first C compiler I used! I found a bug where if you allocated
| arrays larger than 64K (using far pointers of course) accesses
| would wrap around at 64K. I guess they didn't implement far
| pointers correctly. Anyway I sent them a bug report with a
| reproducer as a typed letter -- from the UK to the US --
| including an international reply coupon[1], and they were kind
| enough to send me an update to the newer version on a 5.25"
| floppy. It fixed the problem.
|
| [1] https://en.wikipedia.org/wiki/International_reply_coupon
| fweimer wrote:
| Maybe the compiler didn't implement the HUGE memory model, only
| the LARGE memory model?
| https://devblogs.microsoft.com/oldnewthing/20200728-00/?p=10...
| has an overview that appears to match what I remember from
| those times.
| reitzensteinm wrote:
| Glad they fixed your issue, but I wonder if they also had a
| stack of "closed: wontfix" postcards.
| mid-kid wrote:
| That sounds to me like the far pointer was used to set the
| segment number, and the pointer offset isn't added back to the
| segment number as that'd be slow. Sounds like a sensible
| implementation to me though of course it's unexpected
| dekhn wrote:
| I may very well have used this in college some 30 years ago on a
| 286 DOS machine.
|
| IIRC I managed to blow the stack with a recursive function 6
| calls deep. Shortly after, I got a 486 and installed Linux (gcc
| worked much better)
| DeathArrow wrote:
| I think I used Microsoft, Borland and Wacom compilers under
| DOS/Windows 3.x.
| judojava wrote:
| The goodness was actually the book. The writing was simple and
| clear, the examples were self-contained and practical. It was a
| perfect textbook. Many years ago I gave my tattered copy to a
| second-cousin when he was about 15 and it totally changed his
| life; he became a coder and never looked back.
| zxcvbn4038 wrote:
| This was the compiler I learned to code on - $20 was great for a
| student budget. If you click through the pages you can also find
| their database toolchest which is a great introduction to btrees
| and managing storage.
| wyldfire wrote:
| > binary coded decimal floating point routines and financial
| functions for calculating the time value of money, depreciation,
| etc
|
| Wow what was the utility of BCD for these applications? My only
| experience with BCD is with RTCs. I always assumed that the RTCs
| had been designed for driving a simple display like 7-segment
| lcd. But doing floating point in BCD? I guess the 8087 wasn't
| common yet but maybe soft float using twos complement wasn't
| common either?
| lelanthran wrote:
| > Wow what was the utility of BCD for these applications?
|
| In financial spaces I used BCD extensively. Especially on
| embedded. IIRC, most of the older banking messages used BCD as
| well (card acquirer -> card issuer messages).
| racingmars wrote:
| Financial calculations need to be done with fixed-point, not
| floating-point, arithmetic. Floating-point can't store the
| exact value of most fractional numbers, and especially over
| many transactions for many customers the floating-point errors
| will accumulate.
|
| You need basic addition and subtraction to always be exact
| (e.g. $15.27 + $91.31 needs to come out as $106.58, not
| $106.5799999999999999999998), and for operations that may have
| remainders beyond your desired number of digit precision, you
| need deterministic rounding or other rules to handle it.
|
| If you're ever writing _any_ code that handles money, DO NOT
| use just naively use float and double types in your code!
| astrange wrote:
| "Financial functions for calculating the time value of money,
| depreciation etc" isn't "handling money" and is perfectly
| fine to do in floating point. Essentially everyone out there
| does it in Excel or Python.
| a1369209993 wrote:
| Actually it's worse than that; they're talking about
| _decimal_ floating point, which _appears_ to work in obvious
| tests - $15.270 + $91.310 is $106.58. But (assuming 5
| mantissa digits for example, but it works with any number),
| you can do the following: balance 91.31
| [+291310] +1000.00 [+410000] temporary credit
| balance 1091.30 [+410913] ULP lost -1000.00
| [-410000] temporary credit deducted balance 91.30
| [+291300] successfully stole 1 cent repeat on each
| account/transaction/etc
|
| Real examples are obviously less blatant than this, but you
| get the idea.
|
| Decimal floating point should never be supported for anything
| in any capacity, and use of any floating point in financial
| software should be considered material proof of either gross
| incompentence or negligence, or intent to commit fraud.
| grishka wrote:
| Why would you ever want monetary amounts as fractions or any
| kind? Why would you want to separate dollars from cents? Just
| represent them in cents or other smallest units ($15.27 would
| be 1527), and only make the distinction between dollars and
| cents for human-readable output. Problem solved. I don't
| understand what BCD would solve here vs plain binary
| integers.
| lelanthran wrote:
| When currencies are represented as integers you have
| trouble doing transactions in multiple currencies.
|
| Floating point is out of the question, so division,
| multiplication, etc was more accurate in BCD than in
| integers when different currencies were involved.
| dragonwriter wrote:
| > Why would you ever want monetary amounts as fractions or
| any kind?
|
| If you can exchange arbitrary currency (and other
| commodity) in specified whole units with no other
| restrictions, then if you need to track prices, the prices
| need to be tracked as arbitrary rational numbers.
|
| BCD is, of course, inadequate for that, but it's the most
| general reason for why monetary amounts may need fractions,
| IMO.
|
| BCD does mean that when the requirements change from "we
| need to track to the cent" to "we need to track to the
| mil", you change one constant as to the minimum allowed
| precision, and no other code or existing data. Whereas "use
| integer multiples of the minimum unit" makes that messier.
| Also, if you have different minimum units in different
| parts of an enterprise, using BCD makes sharing between
| them easier.
| hyperman1 wrote:
| Soft float was only available if your application was compiled
| with it, and dog slow in any case.
|
| Fixed point was still common: Take an int and pretend the first
| X bits are after the point. You have to choose X wisely, so you
| have enough bits available both before and after the dot. This
| at a time when 16 bits was the common int size.
| whartung wrote:
| I bought and used their Database Toolkit back in the day. Far
| more than adequate for the job at hand. I've looked, and it's
| actually hard to find just a simple B+Tree library out on the
| internets today.
| cowmix wrote:
| The little ISP I started back in '93 used the Mix DB for our
| accounting system. We wrote a Perl lib for it (that was turned
| it into a client/server type architecture.) It was GREAT.
| pseale wrote:
| This is like opening a time capsule and examining all the little
| details. Almost more interesting than the barebones, locked-in-
| time product page for a paid C compiler, is the locked-in-time
| cgi-bin-powered shopping cart page at http://www.safepay.net/cgi-
| bin/shop/cart.cgi?db=products.dat... (note it's an http link).
|
| There's a whole host of old-school relics here--it is truly a
| blast from the past: paying separately for a debugger, paying for
| specific libraries, videos available on DVD.
|
| It's really hard to express how deeply internet access has
| changed the landscape of ... well, everything, but in this
| particular case, the programming ecosystem. gcc probably existed
| back when I bought this compiler, and probably so did Borland's
| excellent pre-internet-era IDE, but I didn't know that. And so I
| bought this one.
| NotCamelCase wrote:
| Having to pay for a _compiler_ sounds a little funny through
| the lens of 2022; I wonder if the majority of people buying
| these software /packages at the time found the idea strange,
| too.
| cat_plus_plus wrote:
| You get what you pay for, for example an actual printed book
| explaining the product in detail. What will one get with an
| $0.99 mobile app today?
| hyperman1 wrote:
| I bought it at the time, somewhere in the 1990's. No internet
| and no cell phones at that time. Buying a box with floppies
| or cd was normal, even for an OS or basic tooling. Open
| source was out of reach, I didn't even know about the
| existence of the concept.
|
| It came with a thick book, the reference manual for all C
| functions. That book alone was worth paying for.
|
| Mix C was not that great, it miscompiled stuff on a regular
| base. I debugged a problem for a day before finding out the
| compiler sometimes flat out ignored basic constructions like
| i++
|
| One day I found out about djgpp, and even it cost me as much
| as Mix C in phone costs, I never looked back. Quality was so
| much better. Still used that reference book a long time,
| though.
| readingnews wrote:
| I owned it also, and agree, the book was worth twice the
| asking price, must have kept that book for 10 years at
| least.
| msbarnett wrote:
| > I wonder if the majority of people buying these
| software/packages at the time found the idea strange, too.
|
| Not at all. Pretty much all software at the time was
| commercial or, at most, shareware. Pre-web, selling binaries
| to people to run on their computers was just how one made
| money as a software developer.
|
| That professional tools in particular were fairly expensive
| software packages (CodeWarrior, a few years later, was
| several hundred dollars. Power C was dirt cheap at $20)
| seemed completely normal. A carpenter isn't handed a full
| workshop worth of saws and chisels gratis, after all. If I
| wanted to be paid to make software, just as obviously the
| professionals who made the compiler did, too.
|
| (it's really difficult to convey how _incredibly good_ all of
| the documentation and examples that came with some of these
| products were, too. Think C (back when symantec sold
| compilers and wasn't a fourth-rate antivirus vendor) came
| with thousands of pages of physical manuals teaching you
| everything from the fundamentals of programming to
| exhaustively documenting their libraries, with wall charts of
| class hierarchies etc. Pre-internet this stuff was worth it's
| weight in gold)
| Turing_Machine wrote:
| Not at all. At the time, only people at universities and
| major tech companies had access to the net and what little
| free software existed.
|
| The Borland and Microsoft compilers costs hundreds. Power C
| was a godsend to impoverished students, and as noted by
| others, the book alone was worth the price they were charging
| for the whole package. It was just outstanding.
|
| While I did have access to the net, it was only over a 1200
| bps dialup modem. Downloading something like gcc over that
| took...a while. The alternative was to bring a stack of
| floppy disks to school, and laboriously split anything big
| into chunks that would fit on a floppy.
|
| I still remember when a friend of mine who worked for the
| university computer labs took the trouble of downloading all
| the floppies (> 20, IIRC) that let you work your way up to
| having a running version of this weird Finnish thing called
| "Linux" (the term "distro" didn't exist then). I got him to
| make me a set, and never looked back.
|
| Even if you did have gcc, at that time it didn't support a
| lot of the stuff you needed to make professional-level MS-DOS
| software -- none of the graphics functions to build what
| passed for a decent UI at the time, no memory models (which
| sucked, big-time, but you needed to use and understand them),
| etc.
|
| I still count Power C to be among the wisest purchases I ever
| made, along with a copy of K&R 1st edition. Between those
| two, you were golden.
|
| This concludes this edition of crochety grandfather talking
| about "In my day". :-)
| znpy wrote:
| A while ago I watched a video on YouTube about a guy reviving
| an old rs6000 workstation from ibm, running aix, with the
| ultimate goal of running doom.
|
| When it talks about compilers, the c/c++ compiler suite was
| price at like 4 k$... although supposed/allegedly (that is,
| according to ibm marketing) it won over 4x over gcc (in the
| performance of the generated code i guess).
| icedchai wrote:
| This was very common. I remember asking my parents to buy me
| a C compiler for Christmas, back in the early 90's. (Lattice
| C on the Amiga. It later became SAS/C!)
|
| I think it was at least half a dozen floppies. It also came
| with a huge set of documentation.
| blippage wrote:
| Around the mid 90's I bought the Dice C compiler for the
| Amiga. I think it came with a book(?) I was really happy
| with the price. It was on a special markdown price. I
| counted it as one of the best purchases I ever made. I was
| doing a PhD in Applied Mathematics at the time, nearly all
| in Fortran. But I was interested in C. It turned out that
| me learning C was a great decision as it led to me being a
| professional programmer.
|
| I think the Amiga collapse not too long after I bought the
| compiler. Maybe the declining sales of the Amiga is what
| the authors decide to sell the compiler relatively cheaply.
| Matt Dillon wrote the compiler, and subsequently went on to
| create DragonFly BSD.
| icedchai wrote:
| Yes, I remember Dice! I believe there was also a free
| version, with limited features?
|
| I still look upon my "Amiga years" fondly. I moved to
| Linux in late 1994...
| prirun wrote:
| Paying for compilers was very normal. In the early 80's I
| paid for the Realia COBOL compiler for MSDOS and paid for a
| screen library, ScreenIO, that generated full-screen (80
| chars x 25 lines) applications. I had already written a film
| scheduling app for a client on a minicomputer and they were
| getting charged for time on the mini. Buying the PC and
| paying me $5K + annual maintenance was going to be cheaper
| than paying for minicomputer access.
|
| I had to buy a dev PC: a PC-AT 286 with a toggle switch on
| the back that allowed it to run a 6MHz or 8MHz; a 60MB Priam
| hard drive - one of the fastest available; and I think it had
| 2MB of RAM, though of course you could only use 640K with the
| rest usable as a RAM disk or disk cache. I think it was
| around $2500. For reference, IBM's PC-AT system at the time
| (1984) was $4K-6K with a 20MB drive:
|
| https://en.wikipedia.org/wiki/IBM_Personal_Computer/AT
|
| The Realia compiler was something like $1200 and the screen
| library was around $450 I think. They're apparently still
| selling ScreenIO, though now for Windows:
|
| http://www.screenio.com/purchase.htm
|
| Computer Associates bought the Realia company, abandoned the
| product, and focused on porting mainframe COBOL applications
| to the PC.
|
| I didn't make much on the initial deal, but charged $500/year
| for maintenance and they ran the thing for over 15 years. My
| main goal was to get a fast PC: I had been reading Byte and
| PC Magazine for a few months and this was a way to get one
| without me plunking down a lot of cash.
|
| I think it's kinda cool that a small company like Realia (out
| of Chicago) could create something like this and have a
| functioning company for many years with paid employees. Yeah,
| open source is great in some areas, but in some ways it is
| not so great. A few geniuses could not have a sustainable
| compiler business these days, no matter how great the
| software.
| lelanthran wrote:
| > Having to pay for a compiler sounds a little funny through
| the lens of 2022; I wonder if the majority of people buying
| these software/packages at the time found the idea strange,
| too.
|
| Nope. I have, right here on my desk somewhere[1], the CDROM
| for the Watcom C/C++ compiler that came with an IDE and the
| watcom assembler wasm. IIRC correctly, the IDE had a Vi mode
| and it came with a make that was much better than the nmake
| from Microsoft.
|
| I remember buying it for a relatively large sum back in 1996
| or so. I did not think it strange to pay money for a C and
| C++ compiler + assembler that allowed me to produce Windowed
| applications, device drivers and netware modules, that came
| with an IDE (with Vi-compatible bindings), as well as make.
|
| There was tons and tons of documentation as well (Windows
| help files), more than I'd ever seen before in my life. It
| had enough documentation on that disk to take you from "Never
| used C++ before" to "expert C++ developer". It assumed that
| google and stackoverlflow did not exist, and so it answered
| any question you could possibly have had.
|
| It also had samples for all the major things, so you could
| easily start a device driver project (for example) just by
| copying the samples.
|
| Honestly, it seemed like great value for money to someone who
| had no internet.
| jng wrote:
| I was around in that era and having to pay for assemblers,
| compilers, etc... didn't sound strange at all. What was also
| a reality was the difficulty of actually _getting_ them if
| you were far away from the US (Spain in my case). The world
| was way bigger back then in so many ways.
| cmrdporcupine wrote:
| It was just the way things were back then. Compilers were
| _expensive_ too. In the late 80s I saved up my allowance
| money for months to buy a Modula-2 compiler for my Atari ST.
| I still remember reading the manual on my way home from the
| city, floppies in hand.
|
| In the 80s there was a vibrant shareware & public domain
| scene, but 'open source' wasn't nearly what it is today, and
| shareware & PD things were mostly utilities, etc. That really
| took off in the early 90s with the advent of Linux, the
| Internet, FTP sites. Some of the GNU stuff existed in the
| late 80s but was mainly only of use to academics until Linux
| came on the scene.
|
| The upside of the way things were is that lots of people
| seemed to make somewhat reasonable livings as individual
| businesses selling software they'd made. People who would be
| sinking their time into open source projects now were often
| sinking their time into software that they sold by mail order
| or through user groups, etc.
| Gibbon1 wrote:
| The other thing I remember about 80's compilers is a lot of
| the vendors wanted to drink your milkshake too. They had
| licensing fees for every unit you shipped. Basically
| meaning they wanted a cut of your gross revenue.
| rwmj wrote:
| To be fair, this particular compiler was relatively cheap.
| The number PS30 springs to mind (which included the book),
| but I'm not sure if that was the price or just my faulty
| memory. The internet wasn't a thing for home users in 1989.
|
| Only a couple of years later I had access to the internet
| and was downloading DJGPP. Fun fact is I now work with DJ.
| marcodiego wrote:
| > Fun fact is I now work with DJ.
|
| Would you mind to tell us what you do? I can only imagine
| legacy or a mix of legacy and highly specialized niches
| using DJGPP nowadays.
| rwmj wrote:
| DJ is a well-known compiler developer at Red Hat who is
| also working on Arm and RISC-V support
| (https://www.delorie.com/users/dj/). I work at Red Hat on
| Arm & RISC-V (amongst a few other things).
| marcodiego wrote:
| Ah... right... you work with DJ, the person!
|
| I thought you used DJGPP on your work.
| UltraViolence wrote:
| Maybe not for the compiler, but you pay though your nose for
| almost everything else!
|
| Look at how Microsoft is pushing everyone to the Cloud,
| including desktops. All their developer products are wholly
| focused on pushing your workloads to Azure.
| mikewarot wrote:
| Turbo Pascal was a bargain at $49 when it was introduced, and
| remained a bargain as the delay loops were removed from the
| compiler (according to rumor), and features were added.
| Delphi at $200 was still a good deal... then the price shot
| through the roof.
|
| Oh, and it had a REALLY good manual and online help.
| macintux wrote:
| Just yesterday I commented to a clerk at a used bookstore
| that hers was probably the only one in the U.S. with 3
| Turbo Pascal books.
| badsectoracula wrote:
| > Delphi at $200 was still a good deal... then the price
| shot through the roof.
|
| The cheapest non-upgrade version of Delphi was at $100 (you
| can find it on archive.org) and was that until Delphi 5 or
| so i think. Later they made that version to be for personal
| use only and (i think) upped the price for the next bracket
| and after that they made the personal version free - but
| only of Delphi 7. After that everything went crazy
| expensive, until Turbo Delphi, which IIRC had two versions,
| one free that allowed commercial use but didn't allow
| installing custom components and a "cheap" (compared to the
| other versions) $500 version that allowed it, but it was
| based on the most unstable version of Delphi ever and
| CodeGear killed it anyway. In recent times they have the
| "Starter"/"Community" free edition but the license requires
| that you only have something like $5k / year income,
| otherwise you must buy at least the next bracket that is
| around $1700 or so.
|
| Funny how when the entire programming tools industry was
| going towards more accessible tools,
| Borland/CodeGear/Embarcadero went the complete opposite
| direction.
| asveikau wrote:
| I don't think so. What I remember is that compilers and other
| developer tools were expensive and that was normal. Real
| "professional" tools but also beginner stuff like Visual
| Basic. Though as a teenager I remember pirating them.
|
| Free software and open source did a lot to change that. GCC
| for example. Linux becoming popular also helped. Then as
| interpreted languages became popular, with perl, python,
| etc., all free and under permissive licenses. Java was free
| for personal use then with commercial licenses IIRC? Even
| Microsoft started having "express" editions or compiler-only
| without IDE. I'd say by the 2000s decade compilers were no
| longer a cash cow.
| krylon wrote:
| I remember reading a blog post years ago (don't remember
| where or by whom, unfortunately) that claimed the compiler
| market was also eroded from the other end - many small-ish
| companies building compilers were acqui-hired by large
| companies trying to improve the performance of their RDBMS,
| so the compilers those companies produced often ended up as
| roadkill, or if lucky, were open-sourced (think
| OpenWatcom).
|
| But maybe it just turned out the real money is in the tools
| - you can get all of Microsoft's compilers for free, but
| they still charge you big $$$ for Visual Studio, and lots
| of developers apparently are happy to pay that price. Intel
| still charge big bucks for their compiler, but I have no
| idea how widely used it actually is or what Intel's
| thinking is.
| asveikau wrote:
| I seem to recall that the free compilers from MS have (or
| used to have) limitations in the license about commercial
| use. If you use it for a popular product they may want
| money from you.
| MontyCarloHall wrote:
| This raises a host of other questions. Does Mix Software still
| exist? Their product catalog does not appear to be updated in
| the last ~20 years (owing to a Y2K compliance statement
| prominent on the front page), so unless they have a side
| business not listed on their website, it seems unlikely they're
| still in business. Surely nobody's still buying their compilers
| or training materials on VHS.
|
| If they're gone, who's still paying the bill for hosting, and
| why? Just for fun to preserve a time capsule? Did they prepay
| for hosting for 30 years, and the site will disappear one day?
| reidrac wrote:
| Discovering DJGPP (DJ's GNU Programming Platform) on a CD from
| a computer magazine literally changed my life.
|
| I can't remember the year, but I had a Pentium 100MHz at home
| (with CD, which back then was optional).
|
| You are absolutely right. There were tools, but knowing about
| them was a different story!
| LVB wrote:
| I remember learning C from this when I was a teen. The advice at
| the time was buy the package, throw away the compiler and use
| Turbo C, and then learn from the Power C book which was the best
| resource available.
| pjmlp wrote:
| Never heard of it.
|
| Back in the late 80's Portugal it was either Borland or Microsoft
| for MS-DOS, eventually we also became aware of Watcom, Metaware
| and Symantec.
| crazyideaman wrote:
| I just ran across my 3.5" disks for this along with some of the
| support tools! Finding this book in the mall bookstore and seeing
| the ad in the back was a revelation for me. Best $20 I ever
| spent.
|
| I wanted to learn how to make .exe files but at the time had no
| resources or contacts on how to even start. This book and
| compiler was what launched my entire career.
|
| It allowed you to do inline assembly as well which was a lot of
| fun on an old DOS machine. I'm pretty sure my brother and I hit
| every possible way to lock up the computer or have it
| spontaneously reboot since we didn't really understand memory
| management. Lots of fun trying to make video games and putting
| the vga card into Mode13 or ModeX as well. Good times.
___________________________________________________________________
(page generated 2022-06-04 23:00 UTC)