As I retire, my goal now is to release 40+ years of source code

dingdong33

Why didn’t he use more memory safe rust?

snvzz

Not using a standard license but rather a bespoke one is a major legal roadblock.

The presence of use restrictions does also disqualify it from being Open Source (OSI trademark) or Free Software (GNU/FSF).

If a standard license was adopted instead, such as MIT (permissive and I believe well-aligned with the intent of the author), then any concern would go away.

eliben

This code is enjoyable to look at - it's clean, well-documented, and clearly a work of love. I like all the small utilities that help the author accomplish a bunch of goals.

I wonder if the code manages be so clean because it's only aimed at a single compiler and a single platform. Multi-platform C code tends to be messy with preprocessor goo.

m3kw9

I like how he puts his email as a captcha https://dunfield.themindfactory.com/contact.htm

And slyly tells you the “password” to get past his spam filter

ofey404

Thank you! You show me a living history of computer programming.

tqwhite

At 70, I do not think anyone has anything to learn from my 40+ years of code. I envy Mr Mindfactory's confidence.

paulryanrogers

Thanks for your humility. Still, please consider sharing what you can -- even if only with customers of your software. We all have so much to learn.

(I do regret giving too much of my time to free projects, yet have found a satisfying balance by including source with purchases of software I sell.)

sakesun

Respect. I'll follow when my time come.

keepamovin

This is wonderful. Thank you. Very moving that you choose to share this!!! Thanks for making a positive impact on the world.

anArbitraryOne

Great LLM training data

aquarin

Some links unfortunately are broken.

kmoser

Not ready to retire, but I did something like that a few years ago with the previous generation of code I wrote: https://www.kmoser.com/sourcecode/

golem14

Worth reading the Author's recollections of his almost dying in 2019:

https://dunfield.themindfactory.com/2019.htm

m3kw9

Grim af but that looks like a happy ending

winrid

> "Hug his children. Sleep in his own bed. Eat his meals. and Work a little with his hands." in her words "They shot everything she said down"

Anyone know why doctors do this? They did the same thing with my father when he wasn't getting better (leukemia with pneumonia) and they couldn't get him off the breathing tube. They were very adamant he'd be disabled for life.

zulban

It's tough. A vast majority of the time the doctors are right about recovery, and the family is wrong, and optimistic to a delusional degree. It's hard work telling family how bad things really are.

Still, if something happens to me or loved ones I hope I get doctors who can distinguish between zero and one in a thousand.

kingds

doctors are all completely insane and should never be trusted. the process of getting into and through medical school has a selection bias towards type-a sociopaths. and whoever makes it through that wringer and gets board certified has to be constantly on guard for malpractice lawsuits. half sarcastic but mostly i do believe this lol

hnthrowaway0315

Strangely reminds me of "The Shadow out of the time" by the reverent HPL.

haolez

That was intense. It made me think about my father in law, who had a heart attack in 2015 that compromised 90% of his heart. His exams are so ugly that one of his physicians refused to threat him, probably worrying that he might die any minute during the appointment.

He is still alive today, he has a normal life and he even manages to go for a run in the beach every saturday. His exams haven't improved, he is always out of breath, but he just refuses to die. It's like what the physician said in the link above: "You look a lot better than what's in the paper".

yndoendo

Any one catch the out of memory comment?

# we require more vespene gas; unix consensus; kNtErrorOutofmemory;

potwinkle

Very cool to see such a long history, were the different projects you worked on related to what was going on at your job at the time?

asdefghyk

THere are reasons not to host on GitHub . There are workarounds to hosting on GitHub Google words why not put software on git hub Finds https://sanctum.geek.nz/why-not-github.html OR https://www.wired.com/2015/06/problem-putting-worlds-code-gi...

accrual

I downloaded RINGSW.ZIP to check it out.

> This file is NOT included in the demo version of this product.

> For more information, please contact Dunfield Development Systems

I admire the effort, but if you're not going to make the source freely available, what's the point? What is somebody going to do 100 years from now when they get your .zip off archive.org and you're long gone?

legends2k

> what's the point? What is somebody going to do 100 years from now when they get your .zip off archive.org and you're long gone?

The author seems quite aware of this. He calls it out specifically: it's for learning and curiosity purposes.

accrual

Surely, but the author also says:

> my goal now is to release 40+ years of source code

And there was no code in the .zip. Shrug.

jcmoscon

You have the same name as the billionaire guy. Are you him? :)

bilekas

Quick question because I can't actually find any info on it, but what license are these released with ?

vitiral

It's in COPY.txt, although it's homespun.

If you're the author, please please release into the public domain (CC0) if your purpose is educational. That makes it so anyone can learn from it and build on it without any fear of infringement.

fallat

Did you seriously even look at the webpage? https://dunfield.themindfactory.com/dnld/sc/COPY.TXT It's right at the top man.

bilekas

So honestly I didn't read the "COPY.TXT" .. I wouldn't expect a license to sit there, and I didn't consider that a license personally, I was expecting a defined license.

fallat

What did you think "COPY.TXT" meant, in all honesty?

bilekas

> What did you think "COPY.TXT" meant, in all honesty?

so I'm most focused on this one : SYNC Synchronize two directry trees

While I was lost in the folder sync tools, Copy.txt really just stood out as a readme honestly.

Edit: Readme of the implementation. Like all the rest.

teh_klev

If you're alluding to COPY.TXT meaning COPYRIGHT.TXT and therefore it would/should contain a license then I hate to disappoint you. Copyrights and Licenses are different things. So maybe put a dampener on your expressions of incredulity, it's not a great way to engage here.

BenjiWiebe

Afaik there's s really common convention of a file named COPYING with instructions on when you can/cannot copy the code, i.e. the license.

nick238

Though because that license says "for any reasonable purpose" it's something that's vague when it comes to "is this FOSS" as it's vaguely Crockford-like ("this software shall be used for Good, not for Evil").

The [OSI requires](https://opensource.org/osd/):

> 6. No Discrimination Against Fields of Endeavor > The license must not restrict anyone from making use of the program in a specific field of endeavor. For example, it may not restrict the program from being used in a business, or from being used for genetic research.

[GNU/FSF](https://www.gnu.org/philosophy/free-sw.html) have as "Freedom 0":

> The freedom to run the program as you wish, for any purpose

Pannoniae

It's just a homemade licence, IMO don't need to be pedantic about it.

If you think you are being reasonable, use it, if you think you are not, don't :)

dboreham

Legally, "reasonsable" just means "for a reason" (that someone can describe). Ianal but, one told me this long ago.

ai-epiphany

thanks for the tokens

varjag

I regret not archiving my early code for good so much. First non trivial program (a snake game). First utility in assembly. First device driver (for a Centronics printer). That perpetual calendar in Pascal for a uni assignment, written with enormous hangover within an hour and still my only program written entirely bug-free to the date. All seemed trivial and not worthy of preservation then but in the end I have no code surviving from before late 1990s.

Take good care of your code kids!

gpcz

I have a lot of my old code, but I never want to look at it because it's super-cringe.

varjag

Mine did vary quite a bit within that period, from BASIC in middle school to some funky selective availability GPS handling prod code. But it's beside the point: I'd love it as memento, no expectation really that said game of snake would end up on Steam.

magicalhippo

I lost the first 5-6 years of code thanks to an IBM Deathstar[1] when I was 20.

Got really depressed by it at the time, as it included most of the projects I worked on at the time. After that I got super paranoid about having backups.

I do enjoy going back and looking at the code I still have though. Being self-taught it's mostly not terribly great, but I do have fond memories of finally cracking a certain nut or figuring out some neat trick.

[1]: https://en.wikipedia.org/wiki/Deskstar

legends2k

This is a problem only we'd to face. Kids these days use Git in some hosting hub or the other that it's a rarity that their code gets lots. Of course if these "free" services go down... it matters. Self-hosting has its uses.

nestorD

It is this exact realization, while looking for some of my old code, that first got me started using git and github.

valyagolev

yeah when GitHub is sold to PE 15 years from now, and we get emails like "you have 2 days to backup all your repos", i hope I won't feel too lazy

bilekas

This is brilliant.. It's so interesting too because over the years I've built up a few "Bibles" that I always need on hand when working in a particular language or even just automation, I've learnt some very good organising processes (from HN to be honest), I never thought to 'release' them as they feel quite personal and specific for my mental process.

Looking through some of these though, I think I'm inspired. Super cool idea, I would donate to the retirement project financially to say thanks if possible.

dotancohen

I have quite a few of these bibles too. I'd love to swap some files if you're interested, I'm sure there is much to learn from yours. My Gmail username is the same as my HN username if you are interested.

absoluteunit1

I’m curious, what do you mean by “Bibles” exactly ?

And what are the organizing processes you learned; I’m always eager to learn productivity tips/software from others

JaDogg

Very nice. Hope you enjoy your retirement.

----

One last bugfix before retirement (this is a joke):

I wanted to look at micro-cad it generates a 404.

URL: https://dunfield.themindfactory.com/dnld/sc/MICROCAD.ZIP Expected: I can download the .zip file.

adastra22

Also ran into the same 404. There's not many original CAD programs out there. I'd love to see this one.

razster

Another link from DDS is Dave's Old Computers http://dunfield.classiccmp.org/ , a nice treasure of old pc reviews and images, (Left, right, front and back). This is amazing as I've been working on making 3D assets for a project of mine.

jhallenworld

I think his most impactful utility is ImageDisk: used to archive floppy disks from many different types of computers using IBM PCs.

Much of the old software found on bitsavers.org (and archive.org) was recovered using this utility.

ceva

why not somewhere on git? :(?

TMWNN

Vernor Vinge's A Deepness in the Sky depicts a human society thousands of years in the future, in which pretty much all software has already been written; it's just a matter of finding it. So programmer-archaeologists search archives and run code on emulators in emulators in emulators as far back as needed. <https://garethrees.org/2013/06/12/archaeology/>

You've made a contribution to the hoard that someone will benefit from, whether tomorrow or in 5,000 years.

egometry

The part about the modern (read: far future) calendar being commonly thought to be based on mankind's first moon landing but ACTUALLY being based on the Unix Epoch is a favorite amoungst engineers I know that love Vinge

myth_drannon

I like to download images of old programming CD's from archive.org, like Programmers Heaven[1] for example. All small and interesing programs/tutorials to look at.

[1] https://archive.org/details/Programmers_Heaven_InfoMagic_Mar...

thecyborganizer

From STYLE.TXT:

  - True=7 -

  Having lots of very low-level code and hardware experience, I developed a bit
  of tendancy to "minimize what can go wrong at low levels" - C treats 0==FALSE
  and !0==TRUE - most people use 0/1 ... but thats only 1 bit "difference".  I
  sometimes use 7=TRUE as thats 3 bits with no more chars to type (and of course
  foolish as such a 1 bit hardware error would "trash" pretty much any system -
  but I do tend to be a creature of habit :)
I have never heard of this convention before! Was "random bitflips messing with your conditionals" a common problem back in the day?
benj111

Slightly off topic, but why did 1 become the truthy value and not -1?

Logical nots would then work.

And youre still an inc/Dec away from the opposite.

never_inline

That depends on

a) Two's complement representation

and

b) Wraparound on arithmetic, which is still UB in low-level languages.

kqr

Even if it was, are you really going to think of every conditional as a tri-state boolean?

Or will you assume that one of the branches is safe to execute during failure?

Or will you count the number of bits in each conditional and assume more ones than zeroes is a true, with no error correction? Will you log that a bit has flipped or otherwise alert the operator? Will you consider that as evidence that an int has changed value too?

Will you store ints with three bits per bits also?

Error detecting codes have their place, but it takes more than just saying that true is 7.

rendaw

This doesn't make any sense even if the system isn't trashed.

If 7 == true and anything other than 7 == false, then one bitflip will still change the meaning. If 7 == true and 0 == false, then you could have code that does `if (mybool == 7) { ... }` and later `if (mybool == 0) { ... }` and end up with a situation where code path invariants are broken (i.e. mybool is neither true nor false.

If you use `>= 7` to mean true and `< 7` to mean false, while a 0 false value won't randomly become true if one of 3 bits randomly flips, a `7` true value will become false if any of those bits flip. And if any of the other bits flip, 0 will become > 7.

fabbari

In C any value != 0 is considered true. Nothing special about 7, he could have used any other number, but 7 is a single character, so he used that.

kortilla

It’s a problem even now if you have software security checks dealing with adversarial actors with hardware access.

LastTrain

No, and the author basically admitted it was silly. My counter would be that it makes the intent less clear. I loved reading through his style doc though and I love that he just threw all this stuff out there. Something in his collection is bound to scratch somebody’s itch.

AnimalMuppet

To the degree that you were worried about such things, this wasn't a real answer. Yes, it saves you if you have a boolean variable... maybe?

  if (var == TRUE)
    ; // It was 7
  else if (var == FALSE)
    ; // it was zero
  else
    ??? what do I do here?
And you need to solve that "what do I do here" for every single conditional on a boolean, and have the extra lines of code to handle it and not crash.

But, you know, what if it was a variable that you used in a switch statement instead? Or just "if (i > 17)"? Bit flips can affect your logic all over the place, not just when it's a boolean variable.

And then, if a bit flip can affect a boolean, it can also affect a pointer. Or the return address on the stack (or the link to the previous stack frame).

Or it can flip a bit in the code.

So this is, at best, a very very partial solution, and it's non-trivial to implement. So this was very much not standard practice or a "convention".

dahart

Why do you think you need the “else: ??? What do I do here?” case?

Until you added the 2nd test and the 2nd else case, there is no scenario under which both paths of an if/else would fail to execute due to a bit flip of the test variable, because with ‘if (boolean_condition) {} else {}’ there is only 1 conditional test. A bit flip could have caused the wrong branch to execute, but it could not have skipped both branches. A bit flip could change the jump instruction to something else, but in that case your imagined else case still wouldn’t help.

> this is, at best, a very very partial solution

FWIW, the author said this, and fairly succinctly, saying this TRUE=7 thing is “of course foolish as such a 1 bit hardware error would "trash" pretty much any system”. He was only having a bit of fun that cost nothing, and nowhere suggested this is a solution to cosmic rays or other data errors.

russdill

I've been on a team trying to argue that exact thing. If you aren't going to handle the case where the var is neither true nor false, at least by explicitly documenting the fail-safe case, you're just cargo culting. You get a lot of that type of thing in MISRA and automotive codebases.

Any team that realizes that the compiler may choose to optimize out a shit-ton of such code gets an extra gold star.

AndreiBB

Here is how I do it:

#define FALSE 0

#define TRUE (!FALSE)

ASSERT( TRUE != FALSE );

and let the compiler worry about which bits to use for TRUE

LordShredda

if var is neither this nor that then it's not a boolean

layer8

No, this is more a case of “this could conceivably happen, so why not guard against it where it’s easy to do”. Though personally I would have used -1.

adrianmsmith

The BBC micro and Archimedes used -1 as true in BASIC.

It meant that you didn't need the distinction of "logical operators" (like && in C) and "bitwise operators" (like & in C). You could just use bitwise operators, e.g. the bitwise NOT operator would convert 0 (all bits clear) was -1 (all bits set) so there was no need for "logical operators".

I always felt that was more elegant than C (but of course required a two's compliment machine, which BBC/Archimedes was, but C didn't require).

layer8

This is only sound if you have a boolean type that guarantees that the bits are either all zero or all one. Once a mix of bit values is possible, you have to define whether it mean true or false, and then you can’t use the bitwise operators anymore.

scottlamb

> I have never heard of this convention before! Was "random bitflips messing with your conditionals" a common problem back in the day?

Due to RAM/CPU failures? I don't think so (though I have seen it, fwiw). With weird serial protocols that don't have proper checksums/digests, running over sketchy wiring? Yeah, and that might be part of "very low-level code and hardware experience".

egometry

Still is. And there's little to be done about it.

Unless you can stop cosmic rays.

Luckily it doesn't happen THAT often. I forget the exact metric but I recall various Google Engineers saying that something like one out of a million test run failures is a random bitflip?

eichin

Cosmic rays were a theory in 70's era hardware for failures that ended up being proven to be particles emitted by the ceramic packaging itself. (Modern bitflips are have more to do with component sizes several orders of magnitude smaller.) (edit: not saying that cosmic rays aren't a problem now, just that they only became a problem as chip element sizes shrunk, and they're probably not the only source.)

Also, you can definitely stop cosmic rays, that was part of how they eliminated them as the source.

buildbot

I swear there was a google paper about using a DC as a really bad particle detector, but I can’t find :/

Supermancho

> Also, you can definitely stop cosmic rays

As I understand it, bit flipping in RAM is mitigated by error correction, via auxilliary and redundant bits.

https://en.wikipedia.org/wiki/Dynamic_random-access_memory#R...

dboreham

No. Random bitflips (aka hardware that doesn't work) are a relatively new thing. Bit flips due to buggy software was a thing though. This is why most database engines checksum the payload data even in memory. I've also seen network packets corrupted because a bridge (former name for switch) trashed data in flight, then reconstructed its CRC for the corrupt data on the onward leg.

justin66

> Random bitflips (aka hardware that doesn't work) are a relatively new thing.

Bits flipping due to hardware that didn’t work well was what caused Xerox PARC to implement an error correcting memory for MAXC, fifty years ago.

https://gunkies.org/wiki/Maxc

> Bit flips due to buggy software was a thing though.

No kidding.

euroderf

Cosmic rays ?

dragonwriter

> Random bitflips (aka hardware that doesn't work) are a relatively new thing.

I thought they (from cosmic rays, etc.) were always a thing, but so rare that you needed a very large system (in scope or time or both) to have a substantial chance of encountering one (outside of noisy comm channels, which use error correction protocols for exactly that reason.)

heisenbit

There are lot‘s of thing that can go wrong beyond cosmic rays. Like timing on the bus or signals from close wires. Digital is an abstraction of an analog and chaotic reality.

defrost

Some event (unknown) triggered multiple spikes in the "tell me three times" redundant three ADIRU units of Qantas Flight 72 causing a WTF unscheduled sudden and dramatic pitch down

https://en.wikipedia.org/wiki/Qantas_Flight_72#Conclusion

Cosmic rays were suspected but unconfirmed (kind of hard to confirm after the fact).

"All the aircaft in the world" for sixty years is kind of a large system given that currently there are on the order of one million people in the air at any moment.

indymike

Bitflips aren’t a new thing. I’ve been rarely but painfully bit by them since at least 1986. This. Excludes serial and modem communications where it was a way of life.

anonymousiam

SEE/SEU are not a relatively new thing. However, the frequency of events is inversely proportional to the feature size, which has been decreasing over time.

https://en.wikipedia.org/wiki/Single-event_upset

https://en.wikipedia.org/wiki/Die_shrink

ziddoap

>Random bitflips (aka hardware that doesn't work) are a relatively new thing

This implies that old hardware always worked, which I strongly doubt (what year did hardware go from always working to not?).

ChrisSD

1993

bernds74

I beg to differ. Early 90s there were some Amiga memory expansions that would constantly flip bits. I'm pretty sure it contributed to the sentiment that the system wasn't the most stable, although I'm pretty sure one or two of my friends with PCs saw similar issues on their machines. Maybe Microsoft Word wasn't to blame for all the crashes?

Of course, trying to work around it in software is utterly futile.

dvaletin

What you mean by relatively new? I observed bitflips a couple decades ago, causing machine to panic.

jareklupinski

tangential to 'how can a bit be wrong', when trying to see if a serial data line is working, i write 0xA5 ( 1010 0101 ) to send an alternating bitstream with a twist so i can test the greatest number of things i think can be wrong at once

UweSchmidt

How would a HNer who's not familiar in those nether regions of computing, but wants to feel the excitement of sending a bitstream over a (possibly faulty!) serial data line, get started? Two Arduinos and a cable maybe?

olalonde

I would suggest to search for "Arduino starter kit" or "embedded starter kit" on Amazon. They come with lots of components and usually with some project guides.

Muromec

Esp32 is the cool arduino.

turndown

The way that really clarified things for me was buying a 3d printer(an Ender 3 for me) and a Raspberry Pi. Setting it up and flashing a new OS to it should basically teach you the rudimentary workings of the hardware->software interface.

robocat

Personally I would recommend finding fun or useful projects where you have an outcome you really desire. Start simple - one sensor like a bath overflow warner (arduino is good or maybe raspberry pi).

Learning hardware just for the sake of it is tough to keep motivated and perhaps you would never use the skills you learn? Hardware adds a tougher level to debugging - but software experience gives you a fantastic start - a logical mind and rational drilling down.

If you can fix your car you have the skills to start on electronics!

A lot of skilled people grew up through the hardware generations e.g. I began learning basic electronics because on an Apple ][ everything was simpler and we were all at the same stage. My first job was writing low level serial driver code and regularly dealing with serial devices (e.g. on PC). Our modern context is just not the same. The internet is hard to learn from. It is difficult to write good articles to help - the experienced like me just know a huge variety of implicitly learned knowledge.

I suggest you concentrate on a useful or fun outcome - I believe it's good life practice (and good engineering) to stay focused on the outcome and not get too side-tracked by explicitly trying to learn. We implicitly learn just by doing!

benj111

>If you can fix your car you have the skills to start on electronics!

I'd like to think that this is a comment on the ease of fixing cars, rather than a comment about how fixing cars is basically embedded hardware/software dev....

jareklupinski

yup that's what I was building :)

i was sending pixel data out from an Arduino (ESP32 really but using Arduino IDE) to a bunch of shift registers that seemed to be 74x595 (but couldnt know for sure) to resurrect an LED display for a local art project, and reading the data coming back out from the last register let me know I was at least getting back what I was putting in, which helped me troubleshoot a few wire length and speed/stability issues

to get started with electronics and hardware in general, I wrote a short tutorial: https://news.ycombinator.com/item?id=35116705

UweSchmidt

That tutorial of yours is a lot more than I expected to get out of my question, such a cool first project! Thanks!

genter

Except that if you have the bit endian wrong, 0xA5 is the same forward and backward.

ahoka

Endianness is byte order.

jareklupinski

that's true! 0xAA 0x55 would work to differentiate that case?

theblazehen

0xAA 0x55 is actually used as the last two bytes in the MBR just for this purpose

genter

I like to have several sequential ones. Easier to see on the oscilloscope. (I spent last night getting a microcontroller to talk to a SPI device, so I'm still licking my wounds.)

MadnessASAP

Yes, AA and 55 are common test patterns for a variety of hardware.

Haven't seen A5 in the wild but I suppose it could be useful as a initial "Let's setup a connection" where endianness is unknown. Assuming the next thing that is exchanged is an endian negotiation.

wrs

I’ve been involved with systems where 0xffff… was canonical “true”, but not something as specific as 7! If you’re going to turn on more bits, why not all of them? Though I think this was because the NOT instruction was used for logical inversion, so the bit flip theory doesn’t apply.

layer8

The OP still wanted to only type a single character.

cpeterso

For example, the value of Visual Basic's "True" keyword is -1. This seems silly from the perspective of a C programmer, but -1 (0xffffffff) is "more true" than 1 because every bit is true, not just the LSB. :)

https://learn.microsoft.com/en-us/dotnet/visual-basic/langua...

marssaxman

In the long-ago world where integers were commonly used as arrays of bit flags, it made perfect sense that True = Not False.

bilekas

Even in VB there is a grain of rationale .. I never even considered before WHY it was -1.. I always just thought it was VB doing VB, but now I have gained +1 respect for Vb..

Edit: "Gained" no "Earned"

outside1234

Please put it on Github - nobody will ever find this otherwise

38

It's on the front page, so your comment seems pretty tone deaf.

outside1234

For today -- and tomorrow everyone forgets about it.

38

it being on GitHub does not keep it in peoples memory. so this argument is not sound.

if it was on GitHub, and it made it to the HN front page, "tomorrow everyone forgets about it" would still apply.

nihiven

This is really cool. It seems very 'pure' in comparison to what my code history will look like. In 2040, a lot of my code will show how I used a bunch of libraries and frameworks that nobody uses 'these days'. This doesn't seem good or bad, just a reflection of the times.

myth_drannon

all these `pip install` and `npm install` will be useless

myself248

They already are, if your internet connection has a hiccup or worse.

They already are, if something has been hijacked and is now malicious.

They already are, if you need to install something offline somewhere.

They already are.

touisteur

Even before... Trying to compile archived versions of the python 2.7 runtime on recent Linux distributions is an exercise in frustration. Thank god for the gentle souls that keep putting out lightly updated compilable 2.7 python runtimes, your efforts haven't gone unnoticed.

xyst

not sure if node has its own vendor process now

But languages like go and rust have had the ability to “vendor dependencies” for awhile now.

Don’t need an active internet connection. Just need to have the toolchain.

josephg

Node predates npm. All node does is look for dependencies in the nearest node_modules directory. (And all npm does is download dependencies into that folder). So you can simply archive / check in your node_modules directory if you want to. I think there’s tools to help out and make sure the dependency versions are all pinned. (npm shrink-wrap and friends)

swatcoder

And unless you put in the effort to archive those dependencies yourself, nobody may be able to truly read or build your code anyway.

Today’s trendy development practices are shockingly ephemeral and fragile. Very little of today’s projects would survive one decade left fallow, let alone four.

soulofmischief

Checking dependencies into VCS should be more common as with yarn PnP and such.

dotancohen

  > Very little of today’s projects would survive one decade left fallow, let alone four.
I hate to break it to you. 2040 is less than half as distant as you think it is.
soulofmischief

I want off this ride.

fallat

> Today’s trendy development practices are shockingly ephemeral and fragile

My fellow human, you have just nailed what is wrong with today's software.

kqr

Or stated a tautology. The trendy is almost by definition ephemeral and fragile. Otherwise we'd call it timeless!

xyst

> And unless you put in the effort to archive those dependencies yourself

go makes this extremely easy to do

https://go.dev/ref/mod#go-mod-vendor

rust tool chain also includes a vendor dependency process

https://doc.rust-lang.org/cargo/commands/cargo-vendor.html

bbkane

Do you use this and check in vendored code? I don't, maybe I should

josephg

Reading this thread makes me think about archiving my code too. I have backups of my project folders going back to the 90s when I started programming. But I often delete node_modules and other build artifacts before archiving because that stuff takes up so much space.

But maybe it’s worth going through and actively and explicitly downloading all those dependencies too. Who knows when npm will get hacked again, or old package versions will get yanked. Disk space is cheap. I’ve written a lot of code over the years. It would be nice to know it all still runs.

bluGill

A few years back my office threw away a PC running Windows XP with no service packs. It was left in a closet for many years just in case we had to fix a bug in some safety critical code.

A few years ago we tried to rebuild some safety critical code from sometime back and were unable to because the certificates had expired and so the machine that can build the source code refused to connect to our version control system.

capitol_

This is why I really like Debians policy of being self-contained, that everything in Debian is built from sources that are in the Debian system.

It takes a lot more effort to package stuff, since you can't just download your dependencies from the internet. But you also create something that isn't as ephemeral.

trealira

Since you mention it, I recall that it's the same thing in OpenBSD: their policy is "base builds base."

VirusNewbie

Put it on github! You might actually get people to fork it and continue working on it.

myself248

That implies that it needs people to continue working on it.

Is there no such thing as "done" anymore?

screamingninja

> That implies that it needs people to continue working on it.

It does not.

> Is there no such thing as "done" anymore?

Is there no such thing as "building upon it" anymore?

jandrewrogers

I love this. It has crossed my mind more than once to do something similar at some point in the future.

This is a bit like receiving an inheritance from your grandparents. There will be true gems and novelties mixed in with a lot of knick knacks and rubbish. But the totality of that tells a story of real people living rich and interesting lives that only a handful of highlights would not do justice to.

coldcode

I wish I had saved something from my 40 years of programming, but I alwayds left everything behind when I moved to a new job. I did manage to keep my commercial memory allocator from the late 90's (single threaded, only supported Metrowerks CodeWarrior and the old MacOS), it was the fastest allocator on the Mac, and bug-free, but became obsolete with MacOS X. Not sure anyone would care today. I lost my source code to Trapeze as I mentioned yesterday ( https://en.wikipedia.org/wiki/Trapeze_(spreadsheet_program) ). I guess I never throught about saving most of my work for a day when no one cared if I shared it.

albertzeyer

Why only when you are retired? Why not just right now?

micromacrofoot

depending on how organized you are... this can take a lot of time

chatmasta

I can definitely relate to this feeling of "when $this is all over, I'll open source a bunch of it, but it's too much work to factor it out now," where $this is more often a company or project than a career. Sadly, it almost never happens. It just goes to show the importance of open sourcing what you can, as you can (in other words, "now or never"). But it's a lot more work to do that than people imagine, even when they say "well just release it in the least polished form possible." You've still gotta deal with adding a new boundary to your codebase, which not only requires additional effort but also increases complexity of the wider project and makes it impossible to refactor without first refactoring a cascade of miniprojects you've created within it.

josephg

I often think of source code like moulding clay. While you’re actively working in a codebase, the clay is moist and malleable. Making changes is easy, because the context of what it does, and how it’s organised is fresh in your mind.

But if you move on to another project and let time pass, the clay dries out and becomes brittle. When you open the project up again, it takes time to “wet the clay” - and remember all that context that you’ve forgotten. It’s easy to add bugs, or reimplement methods that already exist somewhere else under a different name. But over time, you work water into the clay and it becomes malleable again.

I agree with your comment. Refactoring software to split out libraries that you can opensource is a lot of work. More work than people realise. But if you think refactoring is a lot of work when the clay is wet, it’ll be many times harder if you let the clay dry first. Refactoring as you work is always the best way, because it’s often the only way to get it done.

pbhjpbhj

elvis70 are you Dave Dunfield (the source author)?

[It might be more a ShowHN if you are?]

I'm interested if all of the code is self-written? If you wrote any of it under contract and so had special terms to allow you to eventually release it? Which piece of code there that you are most proud of and/or gonna most useful?

elvis70

I'm not Dave, but here's a thread on Vogons in which he announced his project, you could possibly contact him from there: https://www.vogons.org/viewtopic.php?f=7&t=97034

xeckr

Good idea. I should keep better track of all the stuff I've written...

LastTrain

This is great - add them to github!

megous

Or maybe don't feed the machine...

screamingninja

> Or maybe don't feed the machine...

Curious as to why you consider that a bad thing.

pgeorgi

There's also codeberg.org for git-shaped artifacts, or archive.org for everything else.

LastTrain

I do love personal websites - but the proper place for sharing code, where it can be forked and shared, is GitHub or a place like it. Plus, author has already licensed their code in a way to allow it anyway.

fallat

> the proper place for sharing code [...] is GitHub

Man how far people are brainwashed.

LastTrain

OK. Straighten me out. Explain the difference between sharing my 20 year old code on a personal sever with a license that says “do what you like” and posting my code on GitHub/GitLab/SourceForge etc.

rijoja

Personally I've become sceptical towards github since Microsoft took over it, and it's surprising to me that the open source community is so happy to use it in light of Microsoft's history of trying to fight open source.

Of course there would be a lot of reasons to use github, which I'll refrain from attempting to list since I'm not really an expert of that particular subject, but those benefits has to be weighed against handing over the control of such vast amounts of data to a huge corporation which I'd think its safe to say, primarily would be interested in profit and survival, rather than the wellbeing of the open source community. One might for instance consider the possibly of the data being used to train an AI, which in itself isn't necessary a bad thing, but that still raises some questions. Apart from that relying on github's, might lead to vendor lock in, and it might also mean that the processes that gets used to develop projects falls under control of a in a best case scenario selfish actor and in a worst case scenario a hostile one.

Perhaps you are familiar with the "embrace, extend and extinguish" strategy that Microsoft has been accused of employing? Things like these doesn't really inspire trust in the company's intention towards free software. Due to the size of the company, they are also capable of influencing the industry at large through various means, for instance via expensive advertisement campaigns, and to selling their solution to existing clients. So for instance they could create software such as VS Code and Teams, which would argubly be more or less copies of existing software, using their sizable pool of developers and then use it's huge marketing machinery to take over the market.

Even tough the open source community seems to be flourishing at the moment, there would be threats looming on the horizon. For instance the question of how to relate to service providers who can profit off of open source code, without really having to share back since the code is running solely on their own servers, another one being that open source code gets used to build closed solutions with the help of AI.

Personally I appreciate projects, that distribute code in the old-fashioned ways, which has proven to be successful in countless cases, and I would like to ask open source creators to consider the alternatives, and how they would fit in with the goals of the project. A lot of times I bet github still would be a good fit, but at the same time I'm sure that there are good ideas that could be implemented outside of those parameters.

dboreham

People can poke around in it more easily. E.g. I wanted to look at the 6808 OS code but it's a zip file and I'm using a phone, so...

Not saying it needed to be on github only, but unzipping into a set of repos there in addition to posting the zips would be helpful.

I suppose anyone could do that, but then the provenance is not preserved.

fallat

That's not the problem. The problem is saying "the proper way to share code is with GitHub". There is no single proper way to share code, least using a commercial platform(s).

outside1234

If it is not on Github it is never going to feed anything

flykespice

There is also the lesser known repo.or.cz

quickthrower2

A http server is all you need

TedDoesntTalk

… which dies with the author, or a couple years later when his domain expires.

quickthrower2

You believe that Github is some kind of heritage organisation? Incentives are aligned now, kind of, except they train an AI that they sell to other people on your code. I use Github but do it with open eyes.

sesm

GitHub has Arctic Code Vault program.

quickthrower2

Just looked it up. That is impressive. Probably could do with some Antarctic geo redundancy ;-).

EVa5I7bHFq9mnYK

Add $1000 to your Namecheap accounts, turn autorenew ON, you are good for couple decades ...

soulofmischief

So we'll trust Namecheap for a couple decades but not a Microsoft-backed purpose-built website?

Diederich

What is the actual downside to hosting it personally and hosting it on github or something like it?

legends2k

Downside is GitHub or any of the commercial git-hosting sites might use your code in ways you didn't intend e.g. machine learning, training neural nets, etc. Alternatively they might go out of business and go down after hinting you to save a local copy. These are countered by self-hosting your repo in your own (home/cloud) server.

Downside of self-hosting is time, money and effort. You've to spend for energy and hardware and your time and effort to keep them shipshape. Chances of it surviving beyond you are slim.

Both has downsides; just pick one depending on what kind of person you're. If you only want to write code vs that and also know how to maintain it. The latter is necessary skill if you ask me, instead of being just a code monkey.

LastTrain

Well I was called "brainwashed" for suggesting it without any explanation so good luck getting a coherent answer ;-)

cellularmitosis

The question of "how long would a non-famous repository stay alive on github" is actually an interesting thought experiment.

simonw

GitHub's track record on this so far is fantastic. Repos that were created 15 years ago and didn't see another commit since their creation are still there today.

pgeorgi

By this metric, folks should go for sourceforge: https://sourceforge.net/p/gnome-napster/code/ has last seen activity 23 years ago, while https://sourceforge.net/p/primal/code/ci/master/tree/ saw changes this year.

soulofmischief

> Last Update: 2013-02-19

Am I missing something? Where did you get 23 years from?

a1o

They are living four decades from now in 2040.

jart

I'm taking a look through DOSUTIL.ZIP and I love all these simple elegant C programs. A lot of these programs somehow only manage to have 1-2 standard c #include lines. How often do you see that? I also love how, out of 20,000 lines of C code, there only exists 24 #if statements. This is how C programming was meant to be. Reading codebases like this is one of the things I drew inspiration from when I started working on Cosmopolitan Libc.

kelsey9876543

Justine, you are one of less than 5 programmers that make me feel envy. Hope to have a coffee or a whiskey with you some day if we ever cross paths. Enjoy your day, you are an inspiration and goals. Both mental goals and presentation goals, which is essentially unheard of.

throwaway892238

OTOH, here is a hash table in C implemented entirely as macros. It's super cool: https://troydhanson.github.io/uthash/

marcus0x62

Meanwhile, over here in the Rust mines, I wrote a simple program that is little more than an http listener with a single route.

Cargo pulled in something like 105 dependencies to build it.

Although, as an apples to apples comparison, it does only have 2 use statements.

mianos

And, the meme, for every comment in C or C++ on HN, there is one "but Rust".

ccozan

we should turn it into a law or somthing...

marcus0x62

While we’re making laws, we could add one where, if someone posts something even slightly critical of Rust, the first couple of responses will be from Rust apologists either: a) pointing out how wrong the criticism is, b) how the criticism is mis-directed and shouldn’t be aimed at Rust, or c) how the criticism is really a beneficial and well-thought-out feature, but under absolutely no circumstances admitting that there might be anything wrong with Rust.

rezonant

This doesn't really surprise me, doing an HTTP service correctly is not actually trivial

tubthumper8

In case you want to create a simple http listener without dependencies (besides the standard library), the official Rust Book has a tutorial for just that: https://doc.rust-lang.org/book/ch20-01-single-threaded.html

marcus0x62

I’m aware, but thank you.

lrvick

This is a culture problem, not a language problem.

Here is a http health check in 19 lines using only the rust standard library.

https://dpaste.org/f895z

rezonant

Sure, if you are putting in a health check and nothing else, that's fine. When you need to parse headers, negotiate content types, validate maximum lengths on requests, properly log the source of the request (it's not just the connecting IP if there's a load balancer in front of it), parsing request bodies, dealing with range requests, authentication, cookies, providing a good middleware mechanism...

The list goes on. While I'm not a Rust developer, there's probably hundreds of libraries because the problem is structured into a lot of small parts, and frameworks are expected to be able to satisfy the functionality you expect without needing to bypass it.

lrvick

As a security engineer it is still usually cheaper to write specific functions I need for highly limited scope applications than pull in libraries I have to review, and review every update to, forever.

marcus0x62

There’s a lot of distance between “reinvent the wheel by implementing all your network functionality using nothing more than sockets” and “download 100 libraries to serve a file over http”.

There’s a happy medium to be had.

I’d also disagree this is not at all a language problem - I think it’s both, in that the language has moved an awful lot of core functionality into the crate ecosystem, where there are a bewildering array of options for almost any need. The resulting explosion in the dependency graph is an entirely foreseeable consequence — partially of that language design decision and partially due to the “npm culture” (for lack of a better description.)

kqr

Slighly off topic, but... how is npm culture different from CPAN culture? I have a feeling there is a difference but I'm too unfamiliar with both ecosystems to point it out.

marcus0x62

Speaking as someone who used Perl pretty extensively back in its heyday I’d say the difference is CPAN modules were much more likely to be self-contained, or contain a handful of external dependencies, and those dependencies were almost always self-contained.

cdchn

If your build targets are 1 then that saves you a lot of #if macros.

lovasoa

You are replying to someone who builds C programs for 6 OS and 2 architectures without an #if ;)

cdchn

Then you can appreciate how many #if macros it would save if you just targeted 1. ;)

ramilefu

Sounds like it wouldn’t save them a single #if, if they are already at 0…

themerone

It doesn't count if all your platform code is abstracted away by libraries.

yjftsjthsd-h

In fairness, my understanding is that APE manages that by making the differences invisible to the application. I'm not sure whether that makes it more or less applicable. (More impressive, obviously, but not simpler)

bigbillheck

I took a quick look at cosmopolitan.h: https://justine.lol/cosmopolitan/cosmopolitan.h and counted 886 occurrences of "#if" (including #if and #ifdef)

jart

cosmopolitan.h is a concatenated rollup of hundreds of header files, shipped as part of the "amalgamation" variant of our release, and those sub-headers had #ifndef _FOO_H guards at the top and bottom. The rest of the #ifs are required by standards so we don't clobber the user's control of their namespace, e.g. `#ifndef _GNU_SOURCE`. What you won't see is the annoying stuff that checks for CPU, OSes, endianness, etc.

DiggyJohnson

Love a great “do you know who you’re dealing with” HN moment.

Justine’s APE [0] project is one of the few things to induce in me true, nostalgic, nerdful glee in the last few years.

[0] https://justine.lol/ape.html

f1shy

Wow… some think Java is portable… this is so nice!

johnnyanmac

Ahh geez. I see stuff like this going on in the background and I wonder what I'm even doing in my life, pushing pencils in comparison to actually, truly solving problems.I'd love to tackle more stuff like this, but I feel trapped chasing what I need to pay the bills (said pencil pushing).

At the same time, companies seem so quick to layoff that I question how I even grow to the point where I'd be trusted with such problems. Do I really just need to do a 2nd full time duty in the open source community to get that growth?

sadhorse

If you are not living the life you want then you are a failure. Face the reality of your situation. While others do what they want you do what you are "supposed" to do, and you know how this feels. Good luck.

sgu999

> If you are not living the life you want then you are a failure.

What a rude and profoundly dumb statement. Are all the ones who bust their arses out of necessity failures or do they simply want to endure pain? Caring for a handicapped child, parent, being trapped in a poor country, etc.

I'd be curious to know where most of you around here who put desires above all else are coming from.

sadhorse

I don't understand where you are coming from. I've met cab drivers in the third world that are successful, because they live the life they want. I've met investment bankers in the first world that are failures, they are rich but can't do what they want because "N reasons", trapped as you put.

A parent that cares for a disabled child is only a failure as long as he does not want to do it but has to. In this case he is not only a failure but a horrible person.

I volunteer to care for old people 1h per month and I do not consider this a burden or entrapping or nothing like that. In fact I've met my first wife like this.

arcanemachiner

This sounds rather stoic. But people do not all have the same philosophy of life.

Your definition of what constitutes a "failure" doesn't have to be the same as someone else, and that's OK.

sadhorse

I agree with that, and I am comfortable with the prospect of others not putting themselves first, therefore opening up the possibility of them putting my interests first.

nvarsj

The perpetual inner turmoil for talented engineers :). I accepted a while ago that there's more to life than coding and career, so I don't do much outside of work - 40-50 hours a week of engineering is enough for me. But I try to focus on getting the best job possible that fits what I like to do.

Obviously spending 20+ hours a week on interesting OSS is going to get you more interesting roles over time, and generally OSS stuff is way more fun because you can pick what interests you. But you have to decide if it's worth the cost - do you really want to spend 60 hours+ a week just doing coding / engineering? Maybe you do, but in that case you'd probably be doing it already.

wahnfrieden

Go indie on the side then full time

johnnyanmac

I've definitely thought about it and I imagine it's my end game. But I'm hesitant if I'm truly ready and have the right skills for that. Would that self growth be better than contributing to something larger first (perhaps building more connections on the way)?

NetOpWibby

At some point, you’re just gonna have to go for it. Jump in and see what happens.

wahnfrieden

Contributing to OS I’m not sure what that’s a path to exactly

johnnyanmac

There's Many intentions behind it. In rough order of importance;

- working on a medium-large repo size exercises more skills than just jumping into anything alone. Growth is my biggest factor for the next few years.

- OS introduces me to a community of passionate devs. Who can be anything from mentors to expand my horizons, to friends to future contacts.

- I'd choose to contribute to tools I would probably use for my own projects. So I can dig into repos early and know it intimately for the time I'd need to branch for my own project

- potential clout in certain communities can open other doors.

- Resume material is never bad if everything else falls through

It's not my end game but I think it'll help in many ways. And Personally I always had a certain respect for the OS community and want to give back, and hopefully pay if forward. .

wahnfrieden

Good luck. Most OS contribution is thankless and leads nowhere so be careful with your time and timidity

I contribute to repos I use in my projects, but I’d never start with them before actually finding a use for them

reactordev

any skills you lack you can hire for. Do it!

digging

Ok but sidenote, that Greek-letter titling is emotionally upsetting, even if the title is SR-accessible (κύδος for that though).

violiner

Yeah I read it as "Astmally pdrtable echesmtable". People shouldn't do this.

IggleSniggle

"Astmally pdrtable echesmtale" is a very aesthetically pleasing name for what this, though. You just made me like it more...

kr0bat
jamiek88

holy shit!

> In the above one-liner, we've basically reconfigured the stock compiler on Linux so it outputs binaries that'll run on MacOS, Windows, FreeBSD, OpenBSD, and NetBSD too. They also boot from the BIOS. Please note this is intended for people who don't care about desktop GUIs, and just want stdio and sockets without devops toil

they also boot from the BIOS.... does this mean that I can achieve my dream of booting straight into a BBC BASIC emulator on bare metal(ish)?

arendtio

You might want to take a look at the current no. 2 of the HN best list:

https://news.ycombinator.com/item?id=38101613

rezonant

Also for the casually dressed

echelon

I love all of the domain experts and accomplished people hanging out with the rest of us on HN. :)

duskwuff

> A lot of these programs somehow only manage to have 1-2 standard c #include lines

Older C compilers will let you get away with a lot of sins which a modern C compiler will (correctly) call you out for.

flykespice

Hmm implicit int conversion

trealira

I haven't looked that deeply, but I don't see many sins in this source code, either, except for the K&R style, weird formatting and doing too much in one line, like this line in the file CAT.C:

  if(*(Ptr = argv[i]) == '-') {

Older C compilers did let you get away with more, like using integers as pointers, and dereferencing pointers as though they were struct pointers when they aren't. But I don't see that in this code.
duskwuff

The "sin" I was referring to was calling undeclared functions -- which is how there are so few #include directives in much of this code. Most of the files I looked at include <stdio.h> (probably required for variadic arguments on printf-type functions) and <file.h> (for the FILE type), and call other functions blindly.

queuebert

Wait til you see old Fortran codes.

trealira

That does make sense. My bad, I should have looked closer and noticed the implicitly defined functions.

It's not even a good idea to do that on modern computers, because implicitly declared functions do type promotions from float to double and char/short to int, and on the System V ABI, it has to pass in the number of floating point arguments there are in register eax.

jart

It's not a good idea to do that in production code. FTFY. If you're writing research, experimental, or one-off programs then it can be a real productivity boon. I say do it for fun. You have a right to enjoy yourself and it'll still come out 10x more readable than Perl at the end of the day, let's be real.

rezonant

> it'll still come out 10x more readable than Perl at the end of the day, let's be real.

A low bar, really :-P

jart

We can still get away with those sins today if you change C's implicit type from int to long. I modified chibicc to do just that it was a 1 LOC patch. Suddenly I didn't need prototypes anymore and everything just worked without #include lines.

eVeechu7

A little bit of advice like that is a tremendous blessing to those of us who just need to touch C occasionally.

duskwuff

> Suddenly I didn't need prototypes anymore

Under some very old C standards, maybe. But C99 requires that you at least declare a function before calling it.

jart

> C99 requires that you at least declare a function before calling it

Where is that written? Please quote the standard. My reading of ISO/IEC 9899:TC3 is that Foreword says (paraphrasing) "hey, we removed implicit int and implicit prototypes from the standard". So they simply stopped specifying it, but as far as I can tell, the standard says nothing about forbidding them. From my point of view, that means compilers are free to still implement implicit types as a compiler extension to the language, and everyone does, because that extension is needed in order to support the older c89 standard. It would only impact people who want to be able to claim their codebase is c99 standard compliant, because you can't do that if you depend on compiler extensions.

kevin_thibedeau

Prototypes are required in C23 as part of the expungement of K&R syntax. This also brings harmonization with C++ where an empty parameter list is implicitly void.

reactordev

The fact that I'm calling a function, it must exist, otherwise the compiler will throw an error ("undefined reference to function"). So forward declarations is just needless typing.

duskwuff

> The fact that I'm calling a function, it must exist

That's not necessarily true. It's possible that the symbol is a function pointer; calling a function pointer requires slightly different code generation. Compare the generated code between:

  void fn(void);
  void call_fn(void) { fn(); }
and

  void (*fn_ptr)(void);
  void call_fn_ptr(void) { fn_ptr(); }
In practice, it's probably a function, and that's what the compiler assumes if there's no declaration to go off of. But we all know what happens when you make assumptions.
reactordev

Making no assumption on safety, just stating that forward declarations are superfluous.

fsckboy

no they are not. but >The fact that I'm calling a function, it must exist, otherwise the compiler will throw an error ("undefined reference to function")

you mean the linker will throw an error. The linker is trying to link together the "references" be they forward or backward, that the compiler has created, and the compiler needs to have generated the right references, round peg round hole, square peg square hole.

You don't want your linker throwing errors, it doesn't have the context the compiler does; and you don't want to turn the linker into ChatGPT that can converse with you about your source code, just use the C version of forward references which are not particularly forward, they just say "I don't know where this is defined, it's just not defined here, but we know it's a square peg"

For example, there are architectures where space is tight (embedded for example) and nearby things can be called more efficiently than far away things, so the compiler needs to generate as many near calls as it can, falling back to far away when it has to. It doesn't know in advance how far away things are going to be, but it might uncover plenty of near things as it goes. Square pegs, round pegs.

when you recompile your project code, the library code, is not necessarily around. When other people recompile their library code, your project code isn't around. What's the size of what's being put on the stack? Still gotta get the square/round pegs right.

billfruit

But why does it have to be that way though, can't the compiler scan the rest of the code/files and see if a defenition/declaration is present somewhere?

There is no such requirement of a declaration before first call in Java for example?

Gibbon1

What I understand is the preprocessor causes issues where you could do that maybe 99.9% of the time, especially with well written code. But it'd fail that 0.1% of the time.

You do have analyses like ctags. In theory the compiler could use ctags to find definitions in source code. My experience is ctags can get confused. It's possible in a set of files to have multiple implementations of a function and ctags can't tell which one is used. And I see cases where it can't find definitions.

Personally I'd be happy if the compiler tried to find a missing definition using ctags and issued a warning.

I have wondered if adding funct, public, private keywords to the language might allow the compiler to reliably find function and stuct definitions in source files.

rezonant

It's because the C compiler was designed to be single pass, so as to be speedy and require less memory on the systems of it's time.

billfruit

Is that a requirement that is relevant presently? I would say not so much. Do modern C compilers also make only a single pass?

hulitu

Yes. Gcc throws errors like hell with c files which have the definitions after functions.

dheera

I suppose you could just create a ".d" file standard that doesn't have that requirement but processes into a ".c" file that has the necessary prototypes. You could probably also auto-insert all the #if'n'def nonsense automatically and skip it in the ".d" files.

Kind of like how the JavaScript dudes all use this ".ts" stuff now for convenience that processes into ".js"

foodevl

The Arduino build system does this (preprocesses your source code to pull out prototypes and put them at the top). To make things easier for beginners.