• 0 Posts
  • 12 Comments
Joined 2 years ago
cake
Cake day: August 3rd, 2023

help-circle

  • The basic problem is that identifiers can be either types or variables, and without a keyword letting you know what kind of statement you’re dealing with, there’s no way of knowing without a complete identifier table. For example, what does this mean:

    foo * bar;
    

    If foo is a type, that is a pointer declaration. But if it’s a variable, that’s a multiplication expression. Here’s another simple one:

    foo(bar);
    

    Depending on how foo is defined, that could be a function call or a declaration of a variable bar of type foo, with some meaningless parentheses thrown in.

    When you mix things together it gets even more crazy. Check this example from this article:

    foo(*bar)();
    
    

    Is bar a pointer to a function returning foo, or is foo a function that takes a bar and returns a function pointer?

    let and fn keywords solve a lot of these ambiguity problems because they let the parser know what kind of statement it’s looking at, so it can know whether identifiers in certain positions refer to types or variables. That makes parsing easier to write and helps give nicer error messages.





  • https://greglewisinfo.com/2020/04/18/the-b-17-saved-by-a-miracle/

    The ultimate source appears to be a guy’s memoirs:

    I came across this story in Elmer Bendiner’s marvellous 1980 memoir, The Fall of the Fortresses, while researching the lives of USAAF crews flying out of England during WW2.

    I’m still very sceptical. This guy is not even the primary source actually:

    Bohn said the shells had been sent to the armorers to be defused but had then been rushed away by an intelligence officer.

    Bohn had tracked down the officer and had hounded him until eventually he had told Bohn the full story – before swearing him to secrecy.

    Now, sabotage like this undoubtedly happened, although the scale is impossible to verify. However I think this specific story has just way too flimsy a chain of evidence to put any faith in. Good story though.




  • The thing is, I always thought that you steer politicians through your vote

    To some extent, yes. However the amount of steering you can do this way is rather limited, since a vote only indicates a preference of one candidate over the other.

    For example, if you decide to vote Republican out of protest, Democrats might conclude that you like republican policies, and to win your vote back, they need to move even further right. If you decide to stay home and not vote, you don’t really give any information to democrats what they actually need to do. They may decide that you are an unlikely voter in any case, and focus towards those folks most likely to turn out (that’s generally older white conservative folks).

    One option is to vote for some leftist third party. This sends a pretty clear message about what policies you like. The problem is that, apart from the messaging, your vote is almost certainly wasted. You are in effect helping your enemy win in the short term.

    The other option is to engage politically outside of just voting. Most people have been convinced by establishment politicians that your only influence is your vote. This is not true. Protests, activism, grassroots movements, local politics are all effective ways to steer your preferred party in your preferred direction. This does require substantially more effort.


  • is-number is a project by John Schlinkert. John has a background in sales and marketing before he became an open source programmer and started creating these types of single function packages. So far he has about 1400 projects. Not all of them are this small, though many are.

    He builds a lot of very basic functionality packages. Get the first n values from an array. Sort an array. Set a non-enumerable property on an object. Split a string. Get the length of the longest item in an array. Check if a path ends with some string. It goes on and on.

    If you browse through it’s not uncommon to find packages that do nothing but call another package of his. For example, is-valid-path provides a function to check if a windows path contains any invalid characters. The only thing it does is import and call another package, is-invalid-path, and inverses its output.

    He has a package called alphabet that only exports an array with all the letters of the alphabet. There’s a package that provides a list of phrases that could mean “yes.” He has a package (ansi-wrap) to wrap text in ANSI color escape codes, then he has separate packages to wrap text in every color name (ansi-red, ansi-cyan, etc).

    To me, 1400 projects is just an insane number, and it’s only possible because they are all so trivial. To me, it very much looks like the work of someone who cares a lot about pumping up his numbers and looking impressive. However the JavaScript world also extolled the virtues of these types of micro packages at some point so what do I know.