• 14 Posts
  • 1.22K Comments
Joined 2 years ago
cake
Cake day: June 15th, 2023

help-circle

  • Map (Int, Int) Int. Kind of a bad example because tuples have special-case infix syntax, the general case would be Map Int (Either Int Bool). Follows the same exact syntax as function application just that types (by enforced convention) start upper case. Modulo technical wibbles to ensure that type inference is possible you can consider type constructors to be functions from types to types.

    …function application syntax is a story in itself in Haskell because foo a b c gets desugared to (((foo a) b) c): There’s only one-argument functions. If you want to have more arguments, accept an argument and return a function that accepts yet another argument. Then hide all that under syntactic sugar so that it looks innocent. And, of course, optimise it away when compiling. Thus you can write stuff like map (+5) xs in Haskell while other languages need the equivalent of map (\x -> x + 5) xs (imagine the \ is a lambda symbol).


  • barsoap@lemm.eetoProgrammer Humor@programming.devWhy make it complicated?
    link
    fedilink
    arrow-up
    28
    arrow-down
    1
    ·
    edit-2
    21 days ago

    The actual reason why let … in syntax tends to not use C-style “type var” like syntax is because it’s derived from the syntax type theory uses, and type theorists know about parameterised types. Generics, in C++ parlance, excuse my Haskell:

    let foo :: Map Int String = mempty

    We have an empty map, and it maps integers to Strings. We call it foo. Compare:

    Map Int String foo = mempty

    If nothing else, that’s just awkward to read and while it may be grammatically unambiguous (a token is a name if it sits directly in front of =) parser error messages are going to suck. Map<Int,String> is also awkward but alas that’s what we’re stuck with in Rust because they reasoned that it would be cruel to put folks coming from C++ on angle bracket withdrawal. Also Rust has ML ancestry don’t get me started on their type syntax.



  • barsoap@lemm.eetoScience Memes@mander.xyzOrder of magnitude is a hell of a drug
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    1
    ·
    edit-2
    23 days ago

    “Modern” is a bit misleading, x87 had fldpi. The whole x87 part of the standard has been deprecated with x86_64 in favour of the whole sse series of instructions and those don’t come with pi. You instead load a constant from program memory, just like any other.

    As processors (as of yet) still support those legacy modes they will also contain the constant somewhere in probably microcode storage, calculating it on the fly makes literally no sense at all: It’s (for x87) 80 bits of data, much shorter than any imaginable program, smaller than any circuitry able to compute it so you’d be spending time to save no space which is pointless.

    ARM, RISC-V etc. come from the RISC tradition so they wouldn’t be caught dead including such an instruction. Both have zero registers though as zero is an absurdly useful constant, simplifying things drastically, both on the hardware front as well as within the instruction set (move is add zero to source, save to destination, clear is add zero and zero, save to destination)


    Now, that’s finite constants. In particular, it’s about floating point arithmetic, which is a wonder of maths and a deep rat’s nest of numerology, but has finite precision, it’s not true real arithmetic. Real real arithmetic is undecidable, in particular comparison and expansion to decimal form are undecidable. Printing infinite strings of digits is usually not what we want to do, and limiting precision of comparisons is… not ideal, but better than having limited precision at every operation: You can decide once you’re comparing how accurate you want things to be and don’t have to worry while writing down your formula (btw Herbie exists, and that’s why packages like this exist. In that case pi is not a constant but a formula, which can be expanded as needed. Quite slow compared to floating point hardware but when you need it you need it and even if you don’t it’s still useful as a sanity check, gives you an idea of how far off the floating point results are without having to call in a favour with a mathematician.



  • barsoap@lemm.eetoScience Memes@mander.xyzStrawberries are nuts 🍓
    link
    fedilink
    English
    arrow-up
    3
    arrow-down
    1
    ·
    edit-2
    26 days ago

    Like, the periodic tables mapping isn’t arbitrary or alternate.

    Neither the biology nor culinary mappings are arbitrary, they have their rhyme and reason. Also biology would be the alternate one? Because the culinary definitions were definitely first.

    Did you know that there’s quite extreme disagreements on what metals are? Chemists will tell you one thing and not be particularly unified in their response around the topic of semimetals, while astrophysicists have a very simple definition of metals: Anything that has more protons than helium.

    Who is right? This has nothing to do with metaphysics (I’ve read a bit down the thread) as in “what is beyond physics, god, and stuff”, but how we interpret our (scientific) observations. Neither definition of metals is more correct than the other, they’re both maps drawn by scientists caring about vastly different things. Neither side says that the other is wrong – they just don’t care for it.

    Back to the periodic table itself: Defining elements by protons has quite some predictive power but at the same time it’s a vast oversimplification of what actually goes on, ask any quantum chemist. It is rooted in quite hard science, but that doesn’t make it ground reality. Actual reality is something we can’t observe because to observe anything we first have to project it into our minds. All perception is modelling: Ask any neuroscientist. Or, for that matter, Plato.


  • Isn’t the rejection of post-modernism like a very Jordan-Peterson–like thing to do?

    Peterson is kinda the embodiment of post-modernism, that is, he does all his ideology building by questioning everything else into oblivion.

    Of course, not knowing what he’s talking about is also something very Jordan-Peterson-like so that all tracks.




  • barsoap@lemm.eetoScience Memes@mander.xyzStrawberries are nuts 🍓
    link
    fedilink
    English
    arrow-up
    16
    arrow-down
    1
    ·
    edit-2
    26 days ago

    Like at the end of the day it’s just humans developing a system to make sense of nature

    The core of the matter is that we have multiple, mutually incompatible schemes sharing in part the same terminology. Biology is not cooking, both fields care about vastly different things thus the categorisation scheme is different, that’s the end of it. Culinarily, tomatoes have too much umami to be fruit. Botanically peppermint is an aromatic, I recommend you not put any into your soffritto.


    EDIT:

    Tomato is also dominated by oxalic acid, not malic, citric, (typical fruit acids) or acetic (fermented/overripe). Oxalic acid is in parsley, chives, spinach, beans, lettuce, that kind of stuff. “It’s sour” isn’t sufficient to describe a taste profile, our tongues may not tell them apart but our noses definitely do.

    I think it should be possible to break the culinary categorisation down to chemistry. That doesn’t tell you anything about the “why” but it’s definitely not random and definitely not all in our heads.





  • If that’s a steelman then it’s definitely at forging temperature (which jet fuel btw can achieve easily), collapsing under its own weight.

    Try this: Is it consistent to believe that evolution is the means by which God created, and continues to create, creatures? Does “well evolution just happens” have more, less, or equally much of an argument for itself? Note: Blindly assuming naturalism instead of God’s will doesn’t count because neither of those are falsifiable.

    Thing is: There’s more than one way to connect the data points into an overall theory. Those theories try to explain the data points by starting from made-up axioms, and naturalism is just as much made-up as the Spaghetti monster. Unless you want to posit some kind of Platonism?


  • Psi research is a fascinating field, responsible for lots of improvements in study design, metastudy statistics and criteria, whatnot.

    Like, it is hard to control your experiment so that you don’t accidentally measure side channels as telepathy or whatnot. Or subjects having hit rates because they have the same cognitive bias as experimenters selecting cards “at random”. The list is endless.

    Sceptic: “Your study has these and these flaws”. Psi researcher: “We’re using state of the art experimental design, accepted in every other field, and are open to suggestions”. Sceptic “…damnit”. I guess at least half of Psi researchers are consciously trolling for the heck of it, the bulk of the rest is dabblers, full-on crackpots are actually a rarity. Crackpots don’t tend to have the wherewithal to get their stuff into a form that’s even remotely publishable.