Pinned toot

I want to be able to tell my friends why is better than the birdsite, so I wrote a thing: "Mastodon Is Better than Twitter: Elevator Pitch"
codesections.com/blog/mastodon

I want this to be as persuasive as possible to outsiders, so I'd appreciate as much feedback as possible from Mastodon users

question to those of you who've followed webdev for a while:

Where did the association between and the phrase "UI is a function of state" come from? It's something I've heard a lot (and that shows up in a lot of blog posts, etc.). I'd kind of thought of it as React's tagline, in fact.

But, to my surprise, that claim doesn't seem to show up in the official docs. Do you know when it started to be associated with React? Was it once listed in the docs and then removed?

I might should slightly walk back ^^^ I do think that many of the practices of "modern" web-dev are ignorant re-inventions of previous solutions (we all need more history!), this one seems to have been an *intentional* re-implementation (much better!):

> In React, this is solved by Context. It is essentially like dynamic scoping for components. It’s like a wormhole that lets you put something on the top, and have every child at the bottom be able to read it

overreacted.io/react-as-a-ui-r

Show thread

A few weeks ago, I asked:

> Many programming languages have syntax that means "everything from this token until the end of the line is a comment" (e.g., // in C-family, ; in Lisp family, # in shell family)
>
> Do any have syntax for "everything from this token until the end of the line is a string"?
>
> Why isn't that a common thing to have? It strikes me as something that'd be *super* handy

I just learned that has pretty much *exactly* the syntax I wanted! ziglang.org/documentation/mast

Show thread

It recently occurred to me, relatively unprompted, that many of the state management patterns in "modern" "react-ish" webdev are just re-implementations of dynamic scope – with the same advantages and disadvantages dynamic scope has had for the past ~60 years that it's been in use.

(Of course, after noticing this, I checked, and pointing out how not-new this pattern is… is itself not at all new: spin.atomicobject.com/2020/04/ We sure do love reinventing wheels!)

There's a very deep satisfaction in using a tool that I built. it's got all the parts I think are important, and none of the other stuff. I'd like to make more tools like this. the next step will be figuring out the simplest way to deploy these!

Show thread

Spoiliers for a ~decade old conference talk 

I just watched Gary Bernhardt's 2012 talk, A Whole New World, which has the gimmick of him pretending to have written a text editor and terminal emulator – and then revealing the trick to make the point of how surprising it'd be if he'd actually done so, because no one goes that deep.

From here in 2021, though, I was thinking "oh, _another_ terminal?" Like kitty/hyper/alacritty/zutty…

Does that reflect a large sea change since 2012, or a coincidence?

I'm working with some code where a function takes a `date` parameter, and if no date is provided, calls Date.today _in the default argument constructor_.

The functional programmer in me finds that absolutely horrifying.

I'm not sure why calling an impure function in the argument constructor bothers me so much more than calling it in the body of the function would – but it sure does!

In every programming language I've ever heard of, program control flows left→right and then top→bottom. That is, this psudo code:

{ print "1" } { print "a" }
{ print "2" } { print "b" }
{ print "3" } { print "c" }

would print 1a2b3c

Are there any languages (even eso-langs/DSLs) that invert that order, so that the above would print 123abc?

It occurs to me that a left-to-right control flow would be a good fit for a lot of "pipeline" type data work, and I'm curious if anyone has tried it

For those of you with functional-programming sympathies, what are your thoughts on environmental variables? Do you think they make an otherwise pure function impure?

I'm torn. On the one hand, if a fn is a pure mapping from input => output, it seems pure regardless of how it reads the input. `FOO=1 cmd --bar=2` seems identical `cmd --foo=1 --bar=2`

On the other hand, referential transparency *usually* means being able to reason about a fn from the callsite. And env. vars lose that.

Hmm…

Many programming languages have syntax that means "everything from this token until the end of the line is a comment" (e.g., // in C-family, ; in Lisp family, # in shell family)

Do any have syntax for "everything from this token until the end of the line is a string"?

Why isn't that a common thing to have? It strikes me as something that'd be *super* handy

The joke in this image is both obvious and old, but I still laughed audibly when I unexpectedly came across a presentation slide that described a compiler with the following:

Static site people - has anyone tried Zola? What did you like or dislike about it?

Gonna be setting up email alerts on my self-hosting machine this weekend. Any suggestions?

This is the sort of programming ethos to which I aspire:

> I was watching TV, and there was a commercial which proclaimed, "It's time to do what you want!" I replied to the TV, "It's time to write a JSON parser in 6502 assembly language?" Somehow I don't think that's what they had in mind, but the TV is right, I should do what I want.
>
> So, here is my JSON parser.

github.com/ppelleti/json65

This may seem strange, but I'm wondering if anyone in the fediverse has any experience running Veracrypt containers on 3.5 inch floppy disks? If so, what was your experience?

@codesections Did you know that C compilers are still only required to support up to 4095 characters on a line of source code? If you have a line of code in your C program that's longer than that, the standard doesn't guarantee it has to be compiled correctly :)

TIL: many compilers allowed identifiers of any length, but only examined the first 8 characters to determine what the identifier pointed at.

So `foobarbaz` and `foobarbazqux` are both valid, but refer to the **same** variable!

What I _didn't_ learn was why anyone thought this was a good idea. I assume it was for performance reasons, since Free Pascal doesn't do it anymore (wiki.freepascal.org/Identifier) and 8 makes me guess it has something to do with memory representation.

Anyone know?

Anyone have recommendations for writing Python in Neovim? Plug-ins, etc. Is Python-mode the go-to plug-in? Is PEp8 good to use?

I *really* like the Redis protocol, RESP. I don't even use Redis itself all that often, but I've implemented RESP (or subsets of it) multiple times – it's just a great format for programmatic communication

redis.io/topics/protocol

Show older
Fosstodon

Fosstodon is an English speaking Mastodon instance that is open to anyone who is interested in technology; particularly free & open source software.