frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Time-Traveling to 1979: Advice for Designing 'C with Classes

https://coderschmoder.com/i-time-traveled-1979-met-bjarne-stroustrup
11•birdculture•1w ago

Comments

kelseyfrog•1w ago
I have no doubt that had this happened nothing would have changed. C++'s legacy is that every positive incremental change is implemented at the last possible moment and in the most frustrating and caveat-laden manner.

The individual merits of language features hold relatively little value compared to the sausage making machine that is the C++ language evolution process.

smallstepforman•4h ago
In 1979, the industry needed ‘C with Classes’. It did not need whatever is required today. Hence the only viable path is the one we’re on. Counter point - who is using Pony (the programming language) today? No one.
jkhdigital•3h ago
7 years ago, my graduate distributed systems professor required everyone to complete his projects in Elixir because it was trending on HN. It was my first functional language and after getting over the initial hump I fell in love with it.

Now, I’m teaching undergraduate courses of my own and, while I do not have the flexibility to change the languages used in my current offerings, if I ever start teaching a systems programming course I will absolutely require the students to use Pony.

throwaway17_17•2h ago
Curious as to why you chose Pony as the language to use for your none used language. Any specific reason or was it just the first one that you thought of that fit the sentence?

I’m not sure if Pony is still being used, but the language was making some headway, at least on the PLT side of things. I know the inclusion of some of their reference capabilities work (and practical implementation of prior research in the area) would be a benefit to greenfield programming language design. I think they missed going the process calculus route, instead choosing actors, but overall I liked the direction.

zvrba•3h ago
What'd I tell to Bjarne:

- In the future, you'll carry in your pocket a computer more powerful than the sum of all computers currently present at the university

- The unchecked flat memory model of C will cause numerous security issues with sometimes grave consequences in the "real world"

- Follow the design of Standard ML (SML) and adapt it to systems programming (yeah, it appeared in 1983, but surely papers have been published before that)

- Do not even think about using unsigned types for sizes and get rid of implicit numeric conversions: if (v.size() - 1 < 0) fails on empty vector in today's C++

- Deterministic resource management is still important and is _the_ feature that C++ gets praised for.

- Lack of standard ABI will cause a lot of headaches and lost time.

- I would tell him about LLVM IR, .NET assemblies, metadata and encourage him to first standardize an intermediate format which the compiler could read and write. That'd ensure seamless interoperability between compilers and even other languages.

- Related to the above point: the header/source split will become a burden.

anthk•58m ago
C++ created disasters on maintenance. The best could happen to C++ it's to be killed for once et all with Go as a systems' language and Rust maybe for the rest.
throwaway17_17•2h ago
I really am curious why the article goes with just implementing Templates early. If the question is going back from today (or even 2013 as the year for Bjarne giving the question to his class) why would someone recommend templates when typed polymorphic datatypes constructors are a more sound method for implementing ‘generics’ (also easier to produce sensible error messages)?

Also, why go with constexpr as a replacement (which is not as expressive unless I have badly misunderstood how they work) for pre-processor macros. There have been type-safe and sound implementations of macros, along with explicitly staged computations, since the early 2000’s, why would that not be more preferable?

I think the article is a fun thought exercise, but i think it attempts to stick too closely to what C++ has become in our timeline and ignored better alternatives that if explained and implemented at the outset would result in a language that retained the performance and abstraction characteristics of C++ as it is today but would place it on sound foundation for further evolution as the language adapts to changes in the industry at large.

mpweiher•2h ago
In 1979 the “standard practice in C of passing a large struct to a function” wasn’t just not standard practice, it didn’t exist!

All you could pass as a parameter to a function were pointers to structs. In fact, with one exception, all parameters to functions were basically a machine word. Either a pointer or a full size int. Exception were doubles (and all floating point args were passed as doubles).

Hmm..maybe two exceptions? Not sure about long.

The treatment of structs as full values that could be assigned and passed to or returned from functions was only introduced in ANSI C, 1989.

And of course the correct recommendation to Bjarne would be: just look at what Brad is doing and copy that.

jibal•1h ago
According to https://www.nokia.com/bell-labs/about/dennis-m-ritchie/chist..., which is authoritative:

> During 1973-1980, the language grew a bit: the type structure gained unsigned, long, union, and enumeration types, and structures became nearly first-class objects (lacking only a notation for literals).

And

> By 1982 it was clear that C needed formal standardization. The best approximation to a standard, the first edition of K&R, no longer described the language in actual use; in particular, it mentioned neither the void or enum types. While it foreshadowed the newer approach to structures, only after it was published did the language support assigning them, passing them to and from functions, and associating the names of members firmly with the structure or union containing them. Although compilers distributed by AT&T incorporated these changes, and most of the purveyors of compilers not based on pcc quickly picked up them up, there remained no complete, authoritative description of the language.

So passing structs entered the language before C89, and possibly was available in some compilers by 1979. I was very active in C during this period and was a member of X3J11 (I happen to be the first person ever to vote to standardize C, due to alphabetical order), but unfortunately I'm not able to pin down the timing from my own memory.

P.S. Page of 121 of K&R C, first edition, says "The essential rules are that the only operations that you can perform on a structure are take its address with c, and access one of its members. This implies that structures may not be assigned to or copied as a unit, and that they cannot be passed to or returned from functions. (These restrictions will be removed in forthcoming versions.)"

So they were already envisioning passing structs to functions in 1978.

throwaway38294•2h ago
It's super weird to say that we need rvalue references. rvalues with their odd semantics are only needed so that they don't break compatibility with the current reference/temporary rules. Instead passing object by move should be built into the language - each class should be moveable by default with proper support in the language
VerifiedReports•58m ago
I can't see this title without recommending the move Time After Time, starring Malcolm McDowell and Mary Steenburgen.

The plot is based on the premise that H.G. Wells actually invents a time machine, and it's used by Jack the Ripper to travel to 1979 San Francisco.

procaryote•35m ago
The best advice is probably "don't", as it usually is to most people setting out to design a programming language, and even more so for people setting out to do a mostly backwards compatible extension to a language that isn't suited for what you want it to do.

The second best advice is probably, do just c with classes. Allow defining your own allocator to make objects of those classes. It's fine if objects built with one allocator can only refer to objects built by the same one.

Don't do templates, just do the minimum needed for a container type to know what type it contains, for compile time type checking. If you want to build a function that works on all numbers regardless if they are floats or complex or whatever, don't, or make it work on those classes and interfaces you just invented. A Float is a Number, as is an Integer. Put all that cleverness you'd waste on templates into making the compiler somewhat OK at turning that into machine types.

Very specifically don't make the most prominent use of operator overloading a hack to repurpose the binary left shift operator to mean `write to stream`. People will see that and do the worst things imaginable, and feel good about themselves for being so clever.

Fabrice Bellard Releases MicroQuickJS

https://github.com/bellard/mquickjs/blob/main/README.md
1073•Aissen•16h ago•413 comments

Some Epstein file redactions are being undone with hacks

https://www.theguardian.com/us-news/2025/dec/23/epstein-unredacted-files-social-media
486•vinni2•13h ago•358 comments

X-ray: a Python library for finding bad redactions in PDF documents

https://github.com/freelawproject/x-ray
414•rendx•12h ago•79 comments

Unifi Travel Router

https://blog.ui.com/article/travel-in-style-unifi-style-unifi-travel-router
252•flurdy•9h ago•222 comments

Texas app store age verification law blocked by federal judge

https://www.macrumors.com/2025/12/23/texas-app-store-law-blocked/
228•danso•11h ago•134 comments

Autonomously navigating the real world: lessons from the PG&E outage

https://waymo.com/blog/2025/12/autonomously-navigating-the-real-world
85•scoofy•7h ago•34 comments

Show HN: Tonbo – an embedded database for serverless and edge runtimes

https://github.com/tonbo-io/tonbo
13•ethegwo•6d ago•2 comments

CEO killed at industrial site by worker operating forklift

https://www.12onyourside.com/2025/12/23/ceo-killed-industrial-site-by-worker-operating-forklift-w...
35•gehwartzen•3h ago•33 comments

Show HN: Turn raw HTML into production-ready images for free

https://html2png.dev
70•alvinunreal•7h ago•33 comments

Nabokov's guide to foreigners learning Russian

https://twitter.com/haravayin_hogh/status/2003299405907247502
95•flaxxen•8h ago•140 comments

Don't Become the Machine

https://armeet.bearblog.dev/becoming-the-machine/
72•armeet•6h ago•33 comments

Could lockfiles just be SBOMs?

https://nesbitt.io/2025/12/23/could-lockfiles-just-be-sboms.html
54•zdw•7h ago•35 comments

Proving Bounds for the Randomized MaxCut Approximation Algorithm in Lean4

https://abhamra.com/blog/randomized-maxcut/
31•todsacerdoti•3d ago•0 comments

Lua 5.5

https://lua.org/versions.html#5.5
294•km•1d ago•100 comments

Custom Cross Compiler with Nix

https://www.hobson.space/posts/nixcross/
19•todsacerdoti•4h ago•0 comments

Perfect Software – Software for an Audience of One

https://outofdesk.netlify.app/blog/perfect-software
148•ggauravr•4d ago•58 comments

Life, Death and Mowing

https://www.cam.ac.uk/stories/lawnmower-poetry
12•timthorn•5d ago•6 comments

What makes you senior

https://terriblesoftware.org/2025/11/25/what-actually-makes-you-senior/
336•mooreds•4d ago•159 comments

HTTP Caching, a Refresher

https://danburzo.ro/http-caching-refresher/
107•danburzo•14h ago•16 comments

Is Northern Virginia still the least reliable AWS region?

https://statusgator.com/blog/aws-least-reliable-region-in-2025/
90•colinbartlett•10h ago•62 comments

Open source USB to GPIB converter (for Test and Measurement instruments)

https://github.com/xyphro/UsbGpib
36•v15w•8h ago•13 comments

Correspondence Between Don Knuth and Peter van Emde Boas on Priority Deques 1977 [pdf]

https://staff.fnwi.uva.nl/p.vanemdeboas/knuthnote.pdf
33•vismit2000•7h ago•2 comments

We replaced H.264 streaming with JPEG screenshots (and it worked better)

https://blog.helix.ml/p/we-mass-deployed-15-year-old-screen
418•quesobob•16h ago•256 comments

Learn Lisp/Fennel Programming Against Neovim

https://github.com/humorless/fennel-fp-neovim
54•veqq•6d ago•5 comments

'Dracula's Chivito': Hubble reveals largest birthplace of planets ever observed

https://phys.org/news/2025-12-chaotic-dracula-chivito-hubble-reveals.html
48•wglb•8h ago•10 comments

Help My c64 caught on fire

https://c0de517e.com/026_c64fire.htm
100•ibobev•14h ago•31 comments

Volvo Centum is Dalton Maag's new typeface for Volvo

https://www.wallpaper.com/design-interiors/corporate-design-branding/volvo-new-font-volvo-centum
87•ohjeez•15h ago•74 comments

Fifty problems with standard web APIs in 2025

https://zerotrickpony.com/articles/browser-bugs/
121•dhruv3006•6d ago•43 comments

Local AI is driving the biggest change in laptops in decades

https://spectrum.ieee.org/ai-models-locally
226•barqawiz•1d ago•223 comments

Terrence Malick's Disciples

https://yalereview.org/article/bilge-ebiri-terrence-malick
88•prismatic•14h ago•21 comments