HackerTrans
TopNewTrendsCommentsPastAskShowJobs

fredrikholm

no profile record

comments

fredrikholm
·mese scorso·discuss
Continuations predate transducers by some ~40 years and are mostly used as a means of control flow, but yes they are very similar.

Transducers are specialized to data transformation pipelines, continuations are a form of control flow from which you can derive a lot of cool things (exceptions, time travel debugging etc).
fredrikholm
·mese scorso·discuss
Once allocators in general click, memory management in C becomes a total breeze.

Combined with typed fat pointers (slices and strings), typed hashmaps and stack-trace-assertions, C in general becomes quite nice. The rest is compiler flags.

Go solves this by being a better language out of the box, but with the Wirthian aspects removed they feel very similar. Perhaps not so surprising.
fredrikholm
·mese scorso·discuss
The famous JAMA cohort study[0] of 120k people showed some 5x difference in all cause mortality and morbidity between sedentary and highly active individuals, showing effectively no upper bound.

The NHANES study[1] is another one that showed huge jumps in slowed aging with proportionally (to calories) increased fiber consumption.

There's a lot of these. I recommend Dr Michael Greger for a lot of them summarized. He's very biased towards whole food plant based diet (a type of vegan diet), but he references and cites every statement he makes and is generally a very good communicator.

There is a YouTube channel called Viva Longevity! that invites research authors and generally presents longevity/health information in a way that is very thorough and sincere.

0. https://jamanetwork.com/journals/jamanetworkopen/fullarticle... 1. https://www.mdpi.com/2072-6643/10/4/400
fredrikholm
·mese scorso·discuss
It's important to factor in lifestyle factors here.

By the time you hit 40, you've accumulated ~20 years of adult-life habits. For a lot of people, that lifestyle is very sedentary, missing most dietary recommendations (insufficient fiber intake, oversufficient saturated fat intake), poor sleep, frequent emotional stress etc.

As a young adult, you've spent most of your life being very active, sleeping ~10 hours a night (as a child), having plenty of downtime and playtime etc. It's why you can party hard, study hard and sleep a little; you're starting fresh.

The good news is that some of these habits are massive levers; biological age can drift decades (worst-to-best).
fredrikholm
·mese scorso·discuss
> very abstract things

A C macro with literals that lacks referential transparency:

  #define MULTIPLY(x, y) x * y
  int result = MULTIPLY(2 + 3, 4); // 14
Not knowing what something means does not make it bad, which is what I'm assuming you meant given how you phrased your sentence.

Having a shared language of patterns and problems that occur in programming is a good thing. Ridiculing such terminology on the basis of "that group of programmers sure are weird" is pointless and counter productive.
fredrikholm
·2 mesi fa·discuss
Agreed, I even find it surprisingly ergonomic. Thinking of data as offsets into memory is unusual coming from almost every other language, but once you grokk it it's actually quite nice.

I love C more than I should.
fredrikholm
·2 mesi fa·discuss
I love that book so much, it helped me grokk the more lambda calculus aspect of FP more than anything.

A few chapters in I belly laughed when it dawned on me that it's going to be recursion until the cows come home. The authors insistence on working through the steps is endearing and comical. Great book to come back to every once in a while.
fredrikholm
·3 mesi fa·discuss
Having to debug the build system to your build system is something else.
fredrikholm
·3 mesi fa·discuss
> When I observe normies they don't seem to care. They'll force and abuse things all the time. I did wonder if it was part of my predisposition towards engineering.

Caring implies doing the right thing, which you can't afford lest you now be bogged down with the burden of doing it correctly, which requires effort.

Some people use dull knives because the thought of maintaining and sharpening them is worse than almost losing a finger every time they need to cut a tomato in half.

I suspect that a lot of people find proactive and sustained effort to be so draining that they'd rather continually have second rate experiences and find peace in that. Then there's people who just generally don't care.

I'm hoping (for my own sanity) that this is a bias on the observer as it's easy to look at someone from the outside and not see the areas where they do care and do the right more times than not. I know I've been unable to live up to my own standards plenty of times throughout the years for factors outside of caring.
fredrikholm
·3 mesi fa·discuss
> You don't need a repl for this workflow and it can be easily implemented in any language. `ls *.MY_LANG | entr -c run.sh` You get feedback whenever you save the file.

As in restarting the entire program and re-running every subsequent query/state changing mechanism that got you there in the first place, being careful not to accidentally run other parts of the program, setting it up to be just so, having to then rewrite parts if you then want to try something somewhere else?

Perhaps I'm misunderstanding you, because that sounds horrible unless you're scripting something small with one path.

The whole point of the REPL is that you evaluate whatever functions you need to get into your desired state and work from there. The ad hoc nature of it is what makes you able to just dig into a part of the code base and get going, even if that project is massive.

> Personally, I find waiting more than 200ms unacceptable and really < 50ms is ideal.

Calling a function on a running program takes microseconds; you're not restarting anything.
fredrikholm
·3 mesi fa·discuss
You evaulate code within your editor against the REPL, seeing the output in the same window you're writing in (perhaps in a different buffer).

The cycle is:

  1. Write production code.
  2. Write some dummy code in the same file (fake data, setup).
  3. Evaluate that dummy code. See what happens.
  4. Modify  code until satisfied.
Your feedback loop is now single digit seconds, without context switching. It's extremely relaxing compared to the alternatives (rerunning tests, launching the program with flags, what have you).
fredrikholm
·3 mesi fa·discuss
If you don't mind me asking, how old are you, and how did this progress? I'm in my mid thirties and am noticing some minor deterioration, but I'm writing it off to loss of sleep due to having small kids.

My curiosity is if this is like you suggest, ingrained patterns, or if there is actual slow down with age. I hear different opinions and am finding it difficult to navigate as I deal with my own, albeit mild, aging.
fredrikholm
·4 mesi fa·discuss
Thank you for great articles and what seems to be a very nice Lisp! I've written so many toy Lisps over the years that I've lost count, always fun to see when they are done more seriously.

A suggestion to the website index, could you add dates to the entries? I find the numbered list confusing as its not entirely clear in what order they are listed.
fredrikholm
·4 mesi fa·discuss
> too many entries, most of which seem tuned to cheating benchmarks

Even for entries that didn't cheat, the code was sometimes unidiomatic in the sense that "real programmers can write Fortran in any language".

This[0] article articulates the issue with by highlighting an ASP.NET implementation that was faster than more 'honest' Java/Go implementations primarily by not using ASP.NET features, skirting some philosophical line of what it means to use something.

For me, the more interesting discussion of whether a language/library is faster/leaner than another exists in actual idiomatic use. In some languages you are actively sweating over individual allocations; in some you're encouraged to allocate collections and immediately throw them away. Being highly concerned with memory and performance in the latter type of language happens, but is seldom the dominant approach in the larger ecosystem.

[0] https://dusted.codes/how-fast-is-really-aspnet-core
fredrikholm
·4 mesi fa·discuss
Learning basic Levantine Arabic has brought me more smiles and free meals than I can count. It's been deeply healing in challenging the negative narratives surrounding these very warm people.
fredrikholm
·5 mesi fa·discuss
If you only had two tilesets, sure. This scales with square of n, so in a real game you're looking at a 4000-8000 long if-else chain.

You're going to spend 100x more time maintaining that disaster than you'd have learning a (to this problem) fundamental algorithm. Shoulders of giants.
fredrikholm
·5 mesi fa·discuss
Tiling sprites is a wonderful example of something that starts off relatively simple and then explodes into all kinds of interesting headaches.

In the beginning, you're looking up a set of UVs in a table indexed by some mask value.

In the end, you're debugging errors where one off by one error cascades into strange realms of indexing the wrong (unloaded) chunk with coordinates rolling over to positions that make no sense, looking up neighbours that look one way yet you end up drawing something completely different.

The suggest solution is an elegant and relatively common approach to what would otherwise be a naive series of nested 40+ if statements consisting of much swearing and sprite editing.
fredrikholm
·5 mesi fa·discuss
Hey stop it with the ad hominems!
fredrikholm
·6 mesi fa·discuss
And with header only libraries (like stb) its even less than that.

I primarily write C nowadays to regain sanity from doing my day job, and the fact that there is zero bit rot and setup/fixing/middling to get things running is in stark contrast to the horrors I have to deal with professionally.
fredrikholm
·6 mesi fa·discuss
> An entry fee that is reimbursed if the bug turns out to matter would stop this, real quick.

I refer to this as the Notion-to-Confluence cost border.

When Notion first came out, it was snappy and easy to use. Creating a page being essentially free of effort, you very quickly had thousands of them, mostly useless.

Confluence, at least in west EU, is offensively slow. The thought of adding a page is sufficiently demoralizing that it's easier to update an existing page and save yourself minutes of request time outs. Consequently, there's some ~20 pages even in large companies.

I'm not saying that sleep(15 * SECOND) is the way to counter, but once something becomes very easy to do at scale, it explodes to the point where the original utility is now lost in a sea of noise.