HNHacker News
TopNewBestAskShowJobs

zogrodea

769 karma · joined May 27, 2023

submissionscomments
zogrodea··on Synchronous Core, Asynchronous Shell
I follow the same principle in my code, but doesn't the "functional core, imperative shell" pattern already push the async stuff out of the core?

What would be an example of an async operation that doesn't perform a side-effect (thereby needing a place in the imperative shell rather than the functional core)?

I think pushing async to the shell is really a subset of pushing imperative code to the shell.

zogrodea··on A British clergyman who predicted black holes in 1783
Reading The Sleepwalkers by Arthur Koestler may be interesting for you. Science and cosmology has progressed tremendously because of people like Kepler who have had right conclusions despite incorrect methods.

One relevant excerpt:

“A phrase seems to have been humming in his ear like a tune one cannot get rid of; it crops up in his writings over and again: there is a force in the sun which moves the planet, there is a force in the sun, there is a force in the sun. And since there is a force in the sun, there must exist some beautifully simple relation between the planet’s distance from the sun and its speed. A light shines the brighter the nearer we are to its source, and the same must apply to the force of the sun: the closer the planet to it, the quicker it will move. This is his instinctive conviction, already expressed in the Mysterium Cosmographicum; but now, at last, he has succeeded in proving it.

In fact he has not. He has proved the inverse ratio of speed to distance only for the two extreme points of the orbit; and his extension of this ‘Law’ to the entire orbit was a patently incorrect generalization. Moreover, Kepler knew this, and admitted it at the end of the thirty-second chapter,18 before he became airborne; but immediately afterwards, he conveniently forgot it. This is the first of the critical mistakes which ‘as if by a miracle’ cancelled out, and led Kepler to the discovery of his Second Law. It looks as if his conscious, critical faculties were anaesthetized by the creative impulse, by his impatience to get to grips with the physical forces in the solar system.“

zogrodea··on The saddest "Just Ship It" story ever (2020)
I do mention that in the second paragraph. My understanding is that most [0] games don't get super-substantial updates making the game leaps and bounds better than it was in its initial state, the way continuously-developed software does. Am I wrong?

[0] Games like Minecraft, Stardew Valley, Terraria and online games being a minority.

zogrodea··on The saddest "Just Ship It" story ever (2020)
The author posted a comment here about that, and that this article is about https://benji.so/ . Sounds like HN comments were persuasive in releasing the app that triggered the article.

Comment: https://news.ycombinator.com/item?id=40872817

zogrodea··on The saddest "Just Ship It" story ever (2020)
In my case, I was talking about technical things like data structures and IMGUI/RMGUI, which I don't think anyone feels motivated to trick others about. :)
zogrodea··on The saddest "Just Ship It" story ever (2020)
It reminded me of that quote wrongly attributed to Shigeru Miyamoto (who created Mario and Zelda and other classic games). "A rushed game is bad forever, but a delayed one may eventually be good."

Of course it may not apply to software today (except to the extent first impressions count) because modern software tends to be continuously maintained (and modern games often are too, to a much lesser degree, with post-release patches).

zogrodea··on The saddest "Just Ship It" story ever (2020)
I'm sorry that happened to you. The comments here are generally high quality and I've learned quite a lot from them, but there are things I've learned from experience that go against conventional wisdom here.

Although not as drastic a case as yours, I think it's often worth being critical of what one reads here and keeping one's ideals until actual experience makes one incline one way or the other.

zogrodea··on Show HN: Grief Companion
I thought there were real people who would be there instead of a chat bot. With my assumption/reading being wrong, I'm strongly inclined to agree with you.
zogrodea··on Ladybird Web Browser becomes a non-profit with $1M from GitHub Founder
I think the issue isn't the potential forking, but that the potential fork may become a dominant and closed one.

If one values the web being somewhat open/less monopolistic, an open source web browser would be more appealing.

I have faith in the Ladybird browser project to avoid such a situation though.

zogrodea··on Show HN: Grief Companion
This sounds like a great initiative. One of those projects trying to make the world a better place.
zogrodea··on Microsoft pauses Windows 11 update as it's sending some PCs into infinite reboot
What's your reasoning for them avoiding Win13? It's just too large a number or something to do with Friday the 13th?
zogrodea··on Misconceptions about loops in C
I just use simple tail-recursion in an event loop to help manage state.

let rec eventLoop state = let input = getInput () let newState = update input state drawState state; eventLoop newState

The update function takes an existing state and an input record (key events, etc.), returning a new state (which may have nested records within itself but it is all immutable).

New state is kept by the recursion (passing new state to the same function). The only IO is getting input and drawing, which are inherently side-effecting operations.

I do have nested records, but (at each stage) they get joined into a new parent record. No mutability there.

zogrodea··on Misconceptions about loops in C
I think, because of the mention about controlling mutability/side-effects, "object" in that post means OOP-style objects which mutable state. It's not an issue with immutable objects/structs (or I guess "records" which is the term I'm used to with functional languages).
zogrodea··on Misconceptions about loops in C
You're right. I didn't notice that, but I guess the initialisation would be the caller function's responsibility or there would be a wrapper function with a default initialisation value (maybe with the recursive example nested inside the wrapper).
zogrodea··on Misconceptions about loops in C
I think recursion is easier to read than C-style for-loops because you don't need to memorise syntax.

for (int i = 0; i < 5; i++) {...}

vs

```let rec func_name counter = if counter = 5 then print "blast off!" else func_name (counter + 1)```

I don't really need to memorise the order of operations compared to a for loop (initialise, exit condition, increment) and I don't need to memorise if the exit condition means "execute while this is true" or "break the loop if this is true". That's just me though. I think the syntax for recursion is easier but loops might conceptually be easier to understand.

I think, better than both of those for the general case (and a good introduction) are "fold" functions and "foreach"-style loops, which iterate over every element in a list. I think those are used more often, and the reason you may want to do this is clearer to a student.

zogrodea··on What everyone gets wrong about the 2015 Ashley Madison scandal
I think treating people for what they intended and actually tried to do to do (cheat on their partner), even if they didn't manage to carry out their intent because of external circumstances is fair. I think that's a common opinion? Although I might be wrong.

Many countries punish "attempted murder" (trying to carry out the act but failing, the same way people caught in this scandal attempted but failed at adultery) so it makes sense to me to not strongly distinguish between "tried cheating on their partner but failed" and "tried cheating on their partner and succeeded".

How would you think the conversation about AM would/should be modified, in light of the fact that people were (unknowingly) talking to chatbots instead of real partners? I think I already made my views clear, but I would actually like to hear other opinions since I don't think I understand any view but my own on this. Maybe other people would prefer the conversation is about spambots on social media websites instead of what the people on those sites tried to do?

Edit: nvm. I saw (after I was already done typing) the sibling comments to my current one, and that makes more sense.

zogrodea··on Julian Assange has reached a plea deal with the U.S., allowing him to go free
Am I the only one who feels suspicious about this and would hesitate to trust the persecuters? Maybe that's not a entirely a reasonable reaction (I just woke up about 10 minutes ago) but it's how I feel currently and I'm wondering if anyone else would feel the same.

The U.S. as a national entity certainly isn't above lying, as leaks regarding them have shown.

zogrodea··on Start all of your commands with a comma (2009)
Oh, I thought the user was suggesting using just ",nds" instead of "comma,nds". That makes more sense.
zogrodea··on Start all of your commands with a comma (2009)
I think "comma_nds" ("commands" if you remove the underscore) makes the pun mkre obvious.

I didn't get it at first thought, thinking of the .nds file extension for Nintendo DS ROMs.

zogrodea··on Some fundraisers pay >90% of the funds to themselves
It's a reasonable request. Readers who see the charity to be named named may also donate to them, and seeing such a claim would make readers think twice and perhaps make their donations elsewhere.
zogrodea··on I'm Fucked
I’m sorry to hear about your experiences. It might not be the nicest thing to hear, but I would recommend getting a job in any field that can support you and your family, and looking for a dev job afterwards. I’ve had trouble finding a job too and that’s what I would do if money was tight.
zogrodea··on Creative workers deserve better than a choice as to who rips them off
I think you would enjoy reading this which seems to agree with you somewhat. https://docs.google.com/document/u/0/d/1cCymY7GRLn-PDwh948WC...
zogrodea··on Comparing OCaml and Standard ML (2008)
Some implementations of Standard ML (SML/NJ and MLton being the two I know of) support an extension to the language for vector (immutable array) literals. That would look like:

#[1, 2, 3]

It's still not a feature you can expect all implementations to have, so OCaml is not in a bad position there I think. (Although I prefer SML most of the time.)

zogrodea··on React 19 almost made the internet slower
The last paragraph hits close because I've experienced a similar issue recently. It turns out some component library was responsible for excessive rerenders even when idle (eating up the daily quota of read operations on some database for a small project).

As a stopgap, I just made a completely unstyled alternative to that internal admin dashboard that uses Handlebars HTML templating (no Javascript) on the server. Inclined me towards dependency rejection (which is an approach I was already taking for some side projects).

zogrodea··on React 19 almost made the internet slower
I will in a bit hopefully. It was a few months ago and I don't have Flutter installed on this computer but I'm doing it now.

Edit: I was coding it up now, but my storage is full (having trouble copying text to my clipboard and unable to save files) so I don't think I will be able to deliver on what I intended. Sorry about that.

On the HTML side, I had a code generator (in Javascript) that output `<html> <button /> <15000 more buttons.../> </html>` and wrote it to a file.

On the Flutter side, I used the default Flutter sample app (`flutter create .`) and I just used a similar code generator to put 15000 buttons in a Column widget.

I don't think I'll be able to do much else to help with reproducibility sadly.

If others try the same, I would be interested in if their results are any better than mine (with Chrome/Firefox being faster).

zogrodea··on React 19 almost made the internet slower
Unrelated, but I'm impressed by how fast browsers can be in some cases.

I once created a HTML file with just a start/end HTML tag and 50k (unstyled) button elements in between, curious to see how it performs. I tried the same in Flutter on a release build (using Material widgets so they are styled) and the HTML was much faster.

I was able to tab through (changing focus by holding tab) the buttons in both Chrome and Firefox at a consistent frame rate with no signs of any lag, while FLutter struggled and lagged quite a bit with the same.

Would anyone know why that is? Are web browsers hyper-optimised for static documents (beating a "native" GUI toolkit for static documents)? Is Flutter just comparatively slow compared to Qt, GTK and so on? Does the styling have that much of an impact on performance?

I am aware that updating DOM elements is uniquely slow for browsers but this experiment was a surprise for me and I'm curious for an explanation.

zogrodea··on I learned Haskell in just 15 years
I can't speak for others, but I never really understood the benefits of functional programming when my language pretty much allowed unbounded mutation anywhere. I would say there's a chance for impure languages to impede you in learning what functional programming is about (or at least my experience with F# and OCaml did not really help as much as it otherwise could have I think).

Your mileage might vary, but I've heard advice from others to learn Haskell and "go off the deep-end" because of people citing similar reasons.

zogrodea··on To see is to forget the name of the thing one sees (2009)
"The second kind of occasion on which you must act without rules is when you can refer the situation to a known type, but are not content to do so. You know a rule for dealing with situations of this kind, but you are not content with applying it, because you know that action according to rules always involves a certain misfit between yourself and your situation. If you act according to rules, you are not dealing with the situation in which you stand, you are only dealing with a certain type of situation under which you class it. The type is, admittedly, a useful handle with which to grasp the situation; but all the same, it comes between you and the situation it enables you to grasp. Often enough, that does not matter ; but sometimes it matters very much.

"Thus everybody has certain rules according to which he acts in dealing with his tailor. These rules are, we will grant, soundly based on genuine experience ;and by acting on them a man will deal fairly with his tailor and helps his tailor to deal fairly by him. But so far as he acts according to these rules, he is dealing with his tailor only in his capacity as a tailor, not as John Robinson, aged sixty, with a weak heart and a consumptive daughter, a passion for gardening and an overdraft at the bank. The rules for dealing with tailors no doubt enable you to cope with the tailor in John Robinson, but they prevent you from getting to grips with whatever else there may be in him. Of course, if you know that he has a weak heart, you will manage your dealings with him by modifying the rules for tailor-situations in the light of the rules for situations involving people with weak hearts. But at this rate the modifications soon become so complicated that the rules are no longer of any practical use to you. You have got beyond the stage at which rules can guide action, and you go back to improvising, as best you can, a method of handling the situation in which you find yourself."

--

From the autobiography of R.G. Collingwood. His writings often have the theme of trying to understand particular instances of a thing on its own terms, only generalising into abstractions when seeing some quality in crowds of individual instances. I've rarely regretted that same approach when it comes to abstraction in code/software, but have regretted premature abstraction many times.

zogrodea··on To see is to forget the name of the thing one sees (2009)
I can't say, but with a standardised and agreed-upon definition of a word/phrase, there should be much fewer ambiguities than otherwise. It probably doesn't matter quite as much what that name is as long as everyone knows what it refers to.
zogrodea··on Why not just embed Neovim?
That's quite helpful. Thank you for the information!
← PreviousPage 2 of 13Next →