Hacker Newsnew | past | comments | ask | show | jobs | submit | boerseth's commentslogin

That's a long list of numbers that seem oddly specific. Apart from learning that f-strings are way faster than the alternatives, and certain other comparisons, I'm not sure what I would use this for day-to-day.

After skimming over all of them, it seems like most "simple" operations take on the order of 20ns. I will leave with that rule of thumb in mind.


If you're interested, fstrings are faster because they directly become bytecode at compile time rather than being a function call at runtime

Thanks for the that bit of info! I was surprised by the speed difference. I have always assumed that most variations of basic string formatting would compile to the same bytecode.

I usually prefer classic %-formatting for readability when the arguments are longer and f-strings when the arguments are shorter. Knowing there is a material performance difference at scale, might shift the balance in favour of f-strings for some situations.


That number isn't very useful either, it really depends on the hardware. Most virtualized server CPUs where e.g. Django will run on in the end are nowhere near the author's M4 Pro.

Last time I benchmarked a VPS it was about the performance of an Ivy Bridge generation laptop.


> Last time I benchmarked a VPS it was about the performance of an Ivy Bridge generation laptop.

I have a number of Intel N95 systems around the house for various things. I've found them to be a pretty accurate analog for small instances VPSes. The N95 are Intel E-cores which are effectively Sandy Bridge/Ivy Bridge cores.

Stuff can fly on my MacBook but than drag on a small VPS instance but validating against an N95 (I already have) is helpful. YMMV.


> Brainf*ck is the antithesis of modern software engineering. There are no comments, no meaningful variable names, and no structure

That's not true. From the little time I've spent trying to read and write some simple programs in BF, I recall good examples being pretty legible.

In fact, because the language only relies on those few characters, anything else you type becomes a comment. Linebreaks, whitespace, alphanumeric characters and so on, they just get ignored by the interpreter.

Have a look at this, as an example: https://brainfuck.org/chessboard.b


I also wonder whether brainfuck (ie turing machine like) coding would be a more efficient interface to LLMs

For those who want to try it, there’s always the https://raku.org module…

  use Polyglot::Brainfuck;
    
    bf hi { 
        ++++++++[>++++[>++>+++>+++>+<<<<-]>
        +>+>->>+[<]<-]>>.>---.+++++++..+++.
        >>.<-.<.+++.------.--------.>>+.>++. 
    }
    
    say hi.decode; # Hello World!
    
    bf plus-two {
        ,++.
    }
    
    say plus-two(buf8.new: 40).head; # 42


To me, that's still unreadable. While the intention of the code may be documented, it's pretty hard to understand if that "+" is really correct, or if that "<" should actually be a ">". I can't even understand if a comment starts or terminates a particular piece of code.

BTW, how come there are dashes in the comment?


The initial long comment starts with the [ command and ends with the ] command so it forms a loop that is executed while the current cell is nonzero. But initially, all tape cells are zero, so the whole loop is in fact skipped.

Readability is a spectrum. The brainfuck code is still somewhat readable compared to for instance this Binary Lambda Calculus program:

00010001100110010100011010000000010110000010010001010111110111101001000110100001110011010000000000101101110011100111111101111000000001111100110111000000101100000110110

or even the lambda term λ(λ1(1((λ11)(λλλ1(λλ1)((λ441((λ11)(λ2(11))))(λλλλ13(2(64)))))(λλλ4(13)))))(λλ1(λλ2)2) it encodes.


First, the parent comment didn't say anything about a spectrum. It just posited "it's legible." But it isn't to me, nor to 99.999% of the people here, I assume. Even those who've dabbled once in BF will probably find it hard, as the comment admits to using tricks.

Second, while readability comes in various degrees (probably more of a high-dimensional value than a linear spectrum, but well), the only thing that's readable about brainfuck is the comment. The code itself is not understandable, unless you really start digging into it and manage to understand the state it is in at every step of the program. Even then I would argue it isn't readable: your vision provides very few clues to the meaning of each step.

The comment serves as a guidance where certain parts start (or end, I can't tell). It explains a few things about the code, but even from the comment I cannot understand what it does. Also, the comment might be entirely wrong. There's only a very hard way to tell.

Your binary lambda example is also unreadable, but at least it doesn't have as much state as the BF program (which, admittedly, is much larger). Breaking it down might require less effort.


> it doesn't have as much state as the BF program

Actually, it has much more, as it's an infinitely large prime number sieve, as shown on top of my webpage https://tromp.github.io/cl/cl.html


> That's not true. From the little time I've spent trying to read and write some simple programs in BF, I recall good examples being pretty legible.

Anything in a reasonably familiar type face and size will continue to be legible, however brainfuck is not easily human parsable.

Greatly reducing its ability to be _read and mentally internalized._ With out that, are you really doing software engineering or are you actually a software maintenance person?

A janitor doesn't need to understand how energy generation works if he has to change the light bulb.


Not sure which way the difference puts the pressure. Does the fuzziness require more prudent policies, or allow us to get away with less?


Modularity and separation of concerns can extend into other domains than software.

For me, it seems so much simpler to keep the two separate. You won't be forced to wash the heating element every time you wash the cup. Can't heat a different cup while the other is in the dishwasher, unless all your cups are self-heating. Normally, the only way for a cup to break is if it shatters, but with an inbuilt heater there's electronics that can break too. And should the cup shatter, now the heater is unusable too, or vice versa.


Exactly!

I have to have a kettle for other purpose (including heating water for other mugs than mine), and no self-heating mug is going to be as efficient as a kettle to heat water.

Furthermore, I also put cold or room temperature liquids in my mug. With a self-heating one, I would be carrying the heating parts for absolutely no reason.

Same goes for a TV. By keeping things separated, I can decide what I do which each device and manage their lifecycle separately. If the device reading video files is included in the TV, I can't plug it to another TV or a projector or even take it with me to use it elsewhere. While I've upgraded three times my video playing device to follow tech evolution, I've kept the same TV to plug them in.


I have a multi-purpose kettle that I can use to boil water, heat the room, cook a small amount of food, or use as a sand battery for when its cold in the desert, where the kettle is designed to operate as long as there is a handful of material to burn.

It is fair to observe a separation methodology, but I also have to say, in some cases multi-purpose devices have their place.

If, say, the self-heating mug involved solar harvesting, I'd put a couple in my kettle bag, for sure.


But like, a coffeemaker is a thing.

You can make coffee with a kettle, but if you are making enough coffee often enough, it does make sense to bundle a second kettle into a dedicated coffeemaker, even if you are reducing the functionality of it by doing so.


It's a thing and it's convenient as a smart TV is convenient for people who don't care much.

But as a "power user" of a TV, I want to compose my own setup.

In the same way, "power users" of coffee don't use a coffeemaker. They use things like French press.

(I use instant coffee myself in my non-heating mug so in this comparison I would be the person not owning a TV and watching everything on their phone?)


> In the same way, "power users" of coffee don't use a coffeemaker. They use things like French press.

As a perpetual intermediate, I find that a pour-over cone is a great balance of convenience and quality.


Arguably the outcome you’d want there is to be able to add your own kettle to the coffee maker, so you can have the best value/option for you if you want it. Want a cheap thing or none? Fine. Want one with remote start and modded temp controls or whatever? Fill your boots. Got a new coffee part but like the existing kettle? Reuse it.

This applies less for some physical items, I know some people are already preparing to explain why it’d be harder to make or dangerous or something but that would miss the point. Computers are incredibly easy to swap out, we already have so many ways of doing that.

Maybe I want a fast computer. None. Maybe I want to upgrade later. Maybe in a year there’s a faster cheaper one. Maybe mine is just fine right now but I need a new screen. Why do I need to bundle the two things together? There’s a simplicity for users unboxing something but there’s not (I think) an enormous blocker to having something interchangeable here.


The microwave in my house is built into the oven.

This provides absolutely zero advantages to the oven or to the microwave. It does cause a lot of stupid, easily foreseeable problems:

- There's only one control panel, and if the oven is currently active, some of the microwave controls get disabled.

- The microwave is awful in various ways -- regardless of whether the oven is active -- which wouldn't ordinarily be a problem, because microwaves are very cheap. But...

- It's impossible to replace the microwave, a $50 device, without simultaneously replacing the oven, a $2000 device.


I don't think that intuition is entirely trustworthy here. The entire space is high-dimensional, true, but the structure of the subspace encompassing linguistically sensible sequences of tokens will necessarily be restricted and have some sort of structure. And within such subspaces there may occur some sort of sink or attractor. Proving that those don't exist in general seems highly nontrivial to me.

An intuitive argument against the claim could be made from the observation that people "jinx" eachother IRL every day, despite reality being vast, if you get what I mean.


I do get what you're saying, and it sounds almost analogous to visualisations of bad PRNGs, e.g. https://www.reddit.com/r/dataisbeautiful/comments/gv4fhr/oc_...


I swear this is how I've gotten good at most of my hobbies. Playing guitar for 20 years has gotten me to a great level for a hobbyist, but not at all because of any virtues like discipline, self control, or routine.

Rather, every day whenever other more important chores or duties loomed, I'd notice one of my guitars laying around, in my couch or my bed or leaning next to my desk. And most times, I'd give in. There's always a new skill, technique, lick, or song that I'm working on, or something I've recently mastered that gives me joy to play.

If anything I think discipline would have hurt my guitar skills over the years.


Man I wish I had a hobby like that instead of video games, lol.

(I'm very much into video games that scratch the same itch as software development does, but with games they give more instant gratification and they present you the next objective in a fairly structured fashion, but often without pressure. I've binged Factorio, now I'm back on Rimworld, where my people just do the tasks they are supposed to and only procrastinate when I allow it and / or when they have a mental breakdown from seeing too many dead bodies)


If I were to choose between bearing the fruits of 20 years of practicing music and equal amount of time spent playing this kind of games, it would certainly be the latter, and I did try both.


I did this for many years, but pretty much just got worse. There's probably a threshold of skill you need to reach on an instrument. I decided that if I pick up guitar again, I'll be sure to do a few months of structured lessons, because I'm tired of noodling around on the same two scales!


This is why "follow you passion" is terrible career advise. If you make your passion your work then it stops being your "passion".

Much better career advise I've heard is: What kind you shit are you much better at suffering than other people around you seem to be?

Because work is work. There's a reason you get paid to do it. Sure it might be something that you are good at and care about, but if you need to work on it 8 hours a day, then you will inevitably start to feel the grind. This is why you get paid and go on vacations.


This is what software development is for me; "just learn coding lol" is terrible career advice because it's simply not for everyone, just like management or marketing isn't for me.

I could do blue collar work, but preferably factory work.


These past couple of years I've gotten into plenty of trouble on multiple occasions, as a result of what I would describe as a cascade of misfortune initiated by a single unfortunate event (for which I will take some responsibility, but nevertheless...).

These "cascades of misfortune" I've run into happen largely because of how we've placed certain institutions at the center of our lives and our society, or perhaps more precisely because of the "convenient" solutions of theirs that we've all been coralled into adopting.

I'm thinking of social media networks, smartphone companies and their app stores, banks and their electronic payments, etc. Everyone's opted in, and we don't realise how much we've given up as a result, with all these "convenient" alternatives, now made mandatory to replace the old and inconvenient solution.

We don't realize, that is, until you're standing at the bank teller in a city away from home, passport in hand but otherwise robbed of phone and wallet, hoping to withdraw some cash to keep you alive while you sort this mess out - only to learn that the bank is no longer able to do that for you. You can't just get your own money. You could withdraw at the ATM, but with a card of course, and that for a fee with a pretty low upper limit. But banks don't serve that purpose anymore. They're now software institutions that we are forced to have a relationship with and operate through in order to make monetary transactions.

Suddenly society has shut down. You can't log into anything without your phone and 2FA, so you're stuck without access to your favorite online services until you get a new SIM card and a fresh device. But even then, there's no riding public transit, because you don't have access to the apps they all operate through. Not that you'd be able to pay in those apps anyway, after cancelling your payment cards. And besides, you don't have anywhere you'd like to go anyway, because, aside from having basically no money to spend on food or events, there's no way to learn what's happening in this city without access to Facebook and all the company pages and events published there.

I forget now all the myriad ways that life grinds to a halt, but I do vividly remember feeling like nothing was possible. And that only because I lost one or two things which should be entirely optional in life! You shouldn't be required as a human, nor even as a member of society, to have a Facebook account, or a smartphone, or even a bank account (that last one is perhaps my most extreme take, but I stand by it).


Out of interest, how does one get out of that scenario?


The bank will probably let you order a new card to their offices instead of your home address, so all you need to do is survive for a week or so. In my case, that was very easy thanks to the friends I was visiting.

As for the meantime: I still did have my bank's ID chip with me as a backup, so I could have used online banking to make a transfer to myself with something like Western Union, and crossed my fingers that my bank wouldn't require verification by phone for this suspicious transfer. That would have gotten me some cash at least within the course of the next day, but my friend helped me out, so it didn't come to that.

Without friends around, though, and one or two more unfortunate circumstances piled on, I really don't know. It's unsettling to realize how little it takes to be forced to sleep in the streets.


I was gonna say. I did it with French some years ago and it worked like a charm.

Later I became obsessed with Argentine tango. Unfortunately, I thought, "comprehensible input" won't work with dancing, especially not a couple's dance. Nevertheless, unable to dance every day due to my local scene being quite small, I instead consumed a boatload of YouTube videos during my spare time. Instructional content, performances, class summaries, and what have you. And I progressed super quickly.

First off, as a leader, it is good to have seen competent dancers with good musicality and how they choose their steps to fit with phrases of songs. That much fits in parallel with input-based language acquisition techniques. But I also think I gained a good amound of intuition about how to move my own body. Not perfect intuition, but more than nothing, which was very much my starting point.


Watching lots of Doom videos on Youtube helped me learn some aspects of the game surprisingly fast. I can't control Doomguy as fast and as precisely as the best Doom youtubers but I can read a situation in the game about as fast and as good as they can and often come up with the plan they eventually follow faster than they do.


I get it! Years ago my obsession was Classic Tetris, and it was common knowledge that watching skilled players at work would improve your own stacking and strategy. A lot of the pros openly admitted to watching their competition while starting out in order to get good


The danger is when solutions that are convenient, but require giving up some sort of freedom, are made mandatory even for those who would like to stay free. I hope this is a lesson we avoid having to learn the hard way.

I have done some backpacking these past two years, and it is worrying how easy it is to get into big trouble if you lose your phone or payment cards.

As an example, my debit card got eaten by an ATM on my way to Argentina, and after my 6 month travel, the backup credit card I had brought was about to expire.

Despite my card working as a means of payment, I was starting to feel the effects of this corner case in every aspect of modern life. I could not use our equivalent of cashapp, I assume because my card was about to expire. I could not ride public transit, or trains, or do things like book a yoga class with my friends, all because all these institutions basically only let you interact with their service through their apps, where I had no way to pay.

I spent some time visiting friends in the capitol on my way home, and tried to sort the situation out with my bank. They thankfully were able to order some new cards to their office, rather than to my home address. But immediately after my talk with them I found that my one remaining card had been cancelled.

Then I tried bringing my passport to withdraw some cash, but the bank teller almost laughed at me, before explaining that you can't just do that anymore. The bank isn't even allowed to let you get your money in cash and leave. You can get bits of it in bills at the ATM for a fee the price of a coffee, but also that requires a card, of course.

Electronic payment solutions are so convenient, for the public and for institutions, for law enforcement and control, that we've forgotten how much we need to give up in order to use them, and now they're being made mandatory as we trudge along into a cashless society.

Now I couldn't even get food or shelter, if not for my friends. I remember half stumbling out of the bank with my passport in my hand, half dizzy with shock and anger. This, along with lots of other small mishaps like losing my phone and encountering trouble, kind of radicalized me on these topics.


It used to be that every time I heard about some problem with training AI systems, I would be struck by how much the challenges line up and parallel the challenges involved in raising human children, and how humans learn more generally.

However, researchers are able to say and find out a lot more about the way LLMs work and learn than they can about human brains. It might be to take the metaphor too far, but I sometimes like to think about how and whether at all these sorts of findings about AIs can apply in any way to us.

This particular case makes me wonder if there is anything to the human instinct to dismiss and ignore people entirely once you learn they're not morally aligned with you on some core issue. In particular we might ignore entertainers and content creators that have views we strongly disagree with, even if they're well reviewed and highly popular, and even if they seem to stay off those sensitive topics in a specific episode/movie/podcast/stand-up-special. We don't want to risk subliminally learning their corrupted values.

Edit: Not to say it is wise to "cancel" and ignore people you don't agree with. Frankly I think it is bad if you value discourse and keeping your mind open to new and differing opinions. Rather, I'm arguing here that it makes sense that this instinct of ours came about at all as we evolved, since it is probably beneficial to stick to your values.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: