lapisnev

Don't squeeze me, I fart

Things that make you go 🤌. Weird computer stuff. Artist and general creative type. Occasionally funny. Gentoo on main. I play rhythm games!

Inkscape Monofur font Cohost PLUS!

You can post SVG files like photos on this website! Spread the word!


lexyeevee
@lexyeevee

thinking about how static typing and dark mode are both things whose most vocal proponents speak of as if they are objectively superior and everyone knows this, and if you don't provide them then it is because you are being deliberately and personally antagonistic for some reason, and everyone who doesn't use them is obviously only doing so due to some kind of accident or elaborate mistake


You must log in to comment.

in reply to @lexyeevee's post:

to be fair, with static typing there are some objective benefits (mostly stuff like better IDE intellisense & catching type errors earlier), but dark mode is literally just a color lol

in my experience the discourse tends to overhype the benefits and pretend the drawbacks don't even exist

and people do cite "light mode hurts my eyes" which is, in some sense, objective i guess

Static typing definitely can be helpful, but I reckon moreso in larger complex applications, or perhaps in libraries (where it serves as documentation). For smaller things and especially scripts it just gets in the way. It definitely helps though if the language has good type inference so you don't need to specify it when it's obvious.

no, ahead of time compilation definitely also helps improve efficiency, but dynamically typed systems - even in compiled languages - incur a lot of overhead on basic operations due to needing to make type checks before doing anything. many compiled languages have dyns (like rust) but having every single variable be dyn type is generally not the best for performance or correctness

you may be confusing static typing with not having an (almost exclusively) dynamic runtime

python's typing module, typescript, gdscript's types, whathaveyou, all still run on a completely dynamic runtime (for zero performance gain) but also have the additional energy cost of verifying the types as a separate step

on the other hand, pypy with no type information at all is generally an order of magnitude faster than cpython with full type annotations. same language, no static types, faster.

dynamic runtimes generally don't make type checks at all; they perform dynamic dispatch

not to harp on this too much but part of the reason the discourse is exhausting is that people say stuff like "static typing is fast" when what they actually mean is "c++ is fast", and then static typing gets credit for all properties of c++ the speaker likes. as if static typing were objectively superior and everyone knows it

even when you annotate types in python the underlying types are still dyns

dynamic dispatch still incurs significant overhead - much less than an explicit type check but it's still noticeable. at least in rust, the standard library specifically prefers static dispatch for performance reasons

i think dynamically typed systems have real advantages over statically typed ones! if they were objectively superior and everyone knew it nobody would be using dynamically typed systems. there are patterns and cases where a dynamically typed system is far easier to reason about and it often plays better between libraries.

the type system is a property of the language as written, not how it compiles or executes. you could write a c implementation where everything did dynamic dispatch under the hood as well (and in fact i think one might exist), and it would still be c, and it would still be statically typed

sure, but static typing gives you the ability to do static dispatch. if static typing enables static dispatch and static dispatch improves performance, i think it's fair to say "static typing improves performance"

it's worth noting that for programs that are written once and executed once, like on the shell, or in an sql query, this is patently untrue

as the noted performance and efficiency of c++ builds will outright overwhelm any efficiency gains in running the final code

this might sound like a trite point but if you think about it for a moment, there are countless disposable programs being written and run every day, and i can only imagine the energy cost if each and every one of them had to go through cmake

the way i phrase it is "static typing is a tradeoff, you get better refactoring tools in return for an upfront cost"

then i mumble "a cost of less expressive code" because god help me the people who harp on about static typing will get mad at me when i can point to row polymorphism, or threesomes with blame, or even just sage's hybrid type system to point out that your bog standard hindley milner is an appreciable subset of code amenable to deterministic static verification through abstract interpretation, rather than a "subset that just doesn't include type errors"

i don't say "it catches errors earlier" because there's type systems that handle dynamic typing (success typing) and also you catch errors in a dynamic language by just running the program, rather than abstractly evaluating the program

personally, the type errors that end up being caught late in a program's development are almost always implicit casts permitted by the type system

the irony is? i've hung around with haskell types like wadler and spj and mcbride and they don't seem to mind that i'm a dynamic type weenie

it's always the "i learned computer science and let me tell you how right i am about the tools i barely understand" types

static typing is a tradeoff

100% agree. the thing that i really like about static typing is that the compiler can (at least try to) verify that i did not write shit because i tend to do that.

its the same reason why i like rusts borrow checker: i can juggle with references and types without having the effort of thinking about it, and a good statically typed language1 with good type inference really makes it worth it because you only have to manually specify types in a few cases. but it can be annoying having to do that manually!

but once you're used to it, its not that bad to use, and just provides me more value than the work i put into it, so i do that tradeoff

but i think the same goes for dynamic typing: if you're really used to it im sure you can get as efficient as with static typing or even faster2. i dont prefer it because i am a dumbass and like coding at 5am but completely understandable if you're a more dynamic person


  1. (not you java, fuck you)

  2. except for javascript. oh god oh fuck. "the type errors that end up being caught late in a program's development are almost always implicit casts permitted by the type system" and null/undefined/nil/void/whatever ruins a dynamically typed language imo

i have complex feelings about null coming from database land

the trick with dynamic typed languages is "just write the goddam for loop", instead of y'know, leaning on type dispatch. if you try to write haskell in python you're gonna have a bad time

but this is mostly an orthogonal discussion, which is the adt vs oo debate in terms of structuring code and data

i would like the borrow checker but i've used languages with garbage collection, and i cannot use the borrow checker without feeling i'm solving a puzzle whos only benefit is appeasing a c++ programmer

let's not get into the whole "refcounting is a 10-15% performance penalty on code" and "every rust data structure has their own homebrew arena allocator around vec" thing though

the thing that bothers me the most about most dark modes is that they're fucking greys

no amoled friendly actual fucking black, like, it's just the same fucking backlight on most screens, sure it helps i guess but does it. does it.

i like three options:

  • light mode (white, or whatever light colour they've gone with)
  • dark mode (grey, dark blue/purple, maybe with still some white in the UI)
  • lights out (black, minimal or no greys)

this type of thing makes me furious beyond reason because I know at least three people who absolutely cannot do dark mode for accessibility reasons like "can trigger ocular migraines that partially obscure their vision," and unless they switch to it before showing anyone anything on their screen there's a 50-60% chance they have to sit through the 60,458th haha let's do a pointless fake fight for giggles song and dance over how only soulless monsters use light mode. and if they don't think that's fucking hilarious it makes it impossible to move on because it's unbelievable that anyone would take objectively correct light mode hatred personally!

basically I think anyone who runs with the "I shall now declare war" goofing over harmless shit like pineapple on pizza or gif pronunciation or whatever* to the point where they actually make it a goal to needle or frustrate people into complying and can't let it go probably needs to grow up

*Trusting folks to resist the urge to respond to this with "okay but pineapple on pizza/wrong gif pronunciation is a war crime in real life! 😆" The warlock who cursed you with the unbearable compulsion to do this holds no power here. You're free.

i don't like cheese on pizza so pineapple is the most lukewarm ass thing to me

and i've never cared how anyone pronounces gif but for some reason people do love to get up my ass about how i pronounce it so i'm totally on board here

I continue to believe that adding a 'dark mode' is the coward's way of avoiding adding theming (though I'm fine with themes being broadly grouped into light/dark)

I like dark mode because I am a creature of the night, and I want to delve deeper into the abyss.

Also

I'd only ever make fun of someone for using light mode as like a bit. A tee hee and move on. An ironic joke with someone I know well. And actually I'm not even sure I'd do that, tbh. I might not even notice. Are there actually people who unironically hate light mode to the point of pestering others about it? Weird