@typeswitch@gamedev.lgbt avatar

typeswitch

@typeswitch@gamedev.lgbt

they/them ๐Ÿณ๏ธโ€๐ŸŒˆ๐Ÿณ๏ธโ€โšง๏ธ #pluralgang
we make games and compilers sometimes

also: https://tech.lgbt/@typeswitch

This profile is from a federated server and may be incomplete. Browse more on the original instance.

typeswitch, to random
@typeswitch@gamedev.lgbt avatar

you want types because you want the compiler to prevent people from writing bad code.

i want types because i want the compiler to help me write good code.

we are not the same.

typeswitch, to random
@typeswitch@gamedev.lgbt avatar

"dependency injection" has to be the worst way to say "calling a function with some arguments"

typeswitch, to random
@typeswitch@gamedev.lgbt avatar

sleep is a lot like refactoring

which is why i stayed up all night refactoring instead of sleeping

typeswitch, to random
@typeswitch@gamedev.lgbt avatar

Where can I apply for some grant funding for an elaborate PL-based shitpost. I need five years to develop the ultimate C/C++ replacement language. Its killer feature is no optimization, because real programmers don't trust the compiler to write highly optimized machine code.

typeswitch, to random
@typeswitch@gamedev.lgbt avatar

maybe a better way to say "judgmental equality" is "coincidence" ๐Ÿค”

typeswitch, to random
@typeswitch@gamedev.lgbt avatar

jrpg is when there's lots of grass,
the more grass there is the more jrpg it is

whitequark, (edited ) to random
@whitequark@mastodon.social avatar

Can you answer this simple question about the C programming language?

$ cat test.c
<string.h>
<stdio.h>
int main() { printf("%d\n", strlen("\x01c")); }
$ cc test.c && ./a.out

What number does this program print?

typeswitch,
@typeswitch@gamedev.lgbt avatar

@whitequark thanks to this post i was able to find a bug in my mirth to C99 compiler, so, thank you :) https://github.com/mirth-lang/mirth/pull/281

whitequark, to random
@whitequark@mastodon.social avatar

one of my least favorite things in computing are progress bars that straight up lie to you until getting to the very end

just make it a puck that goes back and forth and grows bigger as you actually receive data or something

stop fucking lying to me you piece of shit

typeswitch,
@typeswitch@gamedev.lgbt avatar

@whitequark i bet you also don't like those "close doors" buttons on elevators that do nothing.

they should add a fake "go faster" button to the fake progress bars.

astrid, to random
@astrid@fedi.astrid.tech avatar

apply the disassociative property across these terms

typeswitch,
@typeswitch@gamedev.lgbt avatar

@astrid a demigroup is an object with a dissociative operation

typeswitch, to random
@typeswitch@gamedev.lgbt avatar

WRITING LIKE THIS
๊“คฦŽ๊“•๊“•ฦŽ๊“ญ Hฯฝีˆ๊Ÿฝ OS SI
YOUR EYES DON'T HAVE
๊“•แ–ตฦŽโ…‚ ฦŽH๊“• O๊“• ิ€I๊“˜S O๊“•
AT THE END OF EVERY
๊“˜ฯฝโˆ€๊“ญ โ…NI๊“ค๊“ญ 'ฦŽNIโ…‚
BOUSTROPHEDON.

typeswitch, to random
@typeswitch@gamedev.lgbt avatar

the unlived life is not worth examining

gabrielesvelto, to random
@gabrielesvelto@fosstodon.org avatar

I did not know this

typeswitch,
@typeswitch@gamedev.lgbt avatar

@gabrielesvelto Al-Khwarizmi also gave us the name algebra, after his book: https://en.wikipedia.org/wiki/Al-Jabr

typeswitch, to random
@typeswitch@gamedev.lgbt avatar

is stack allocation (including call frames & locals) just a game of russian roulette ... ?

i can't be the only one who thinks this is weird.

typeswitch,
@typeswitch@gamedev.lgbt avatar

heap allocation: sophisticated algorithms to manage both small and large allocations, virtual memory with page swapping, memory protection, garbage collection & reference counting,

stack allocation: whistles very loudly

typeswitch,
@typeswitch@gamedev.lgbt avatar

my other favorite aspect of the stack is how it interleaves return code addresses with local variables. he he he ... nothing could possibly go wrong ๐Ÿ™ƒ

astrid, to random
@astrid@fedi.astrid.tech avatar

i'm getting better at piano every time i play. this is because that's how learning works

typeswitch,
@typeswitch@gamedev.lgbt avatar

@astrid i love learning on the piano because it's such a physical feeling of improvement.

you play a little bit ... then the next day, you play a little bit more, it's easier, and it sounds better ... then the next day, you play a little bit more, it's easier, and it sounds better ...

whitequark, to random
@whitequark@mastodon.social avatar

is assembly language (for the sake of argument, x86 assembly as understood by an assembler released by intel) typed?

typeswitch,
@typeswitch@gamedev.lgbt avatar

@whitequark At the instruction level, there are a few types for operands, but we could call this syntax. It's not much of a type system if there's no propagation of type information throughout the program.

But the main thing that is untyped with assempler are the input & output states of basic blocks, or the arrangement of control flow, or the ABIs, and so on. This distinguishes assembler from a high-level language like C.

typeswitch, to random
@typeswitch@gamedev.lgbt avatar

variables were a mistake

typeswitch, to random
@typeswitch@gamedev.lgbt avatar

is there ever a good reason to allocate a contiguous buffer in memory that is greater than 4GB ?

asking for a friend

typeswitch,
@typeswitch@gamedev.lgbt avatar

@exa how does this work? does it really allocate 100gb array in memory and change all the values in memory?

typeswitch,
@typeswitch@gamedev.lgbt avatar

@astrid @exa ah i see! i need to re-calibrate my sense of scale, 'cos i still think of 4GB as a lot of memory. it's not the first time i've heard of computers with >100GB memory but it's still so far from anything i've worked with.

typeswitch,
@typeswitch@gamedev.lgbt avatar

@astrid @exa wow, ok. i just searched around and found someone selling a used server with 128gb for around 450 euros. i should see what i can get my hands on. thanks for opening my eyes to this possibility : )

typeswitch, to random
@typeswitch@gamedev.lgbt avatar

mini-announcement: I've decided to publish Yotta.

Yotta is a forth-like language with a very small core. In the beginning, all you can do is:

  • emit machine code,
  • emit machine code that emits machine code,
  • define new words ... that emit machine code

With just those primitives we define an x86-64 assembler, and from there we use that assembler to define most of a forth.

Check it out: https://github.com/typeswitch-dev/yotta/

typeswitch,
@typeswitch@gamedev.lgbt avatar

In Yotta there are only three primitives:

$XX emits the byte XX (in hex)
^XX emits machine code that emits XX
: A defines the word A

From there, the first thing we need to do is define semicolon (;) which emits the RET instruction. Semicolon is used to end word definitions. We use semicolon to end its own definition.

This is the preamble, the first bit of Yotta code that the Yotta interpreter/compiler runs. Besides semicolon, we're also defining line and block comments with \ and ( ).

typeswitch,
@typeswitch@gamedev.lgbt avatar

After the preamble, there is an x86-64 assembler, written in Yotta. The assembler makes it much easier to work with machine code, as you might expect.

However the assembler is a bit quirky, because it uses a syntax that reflects the structure of the machine code. It's neither intel syntax nor at&t syntax, but a secret third thing.

I won't get into the assembler details, but let me show you how it's used to build a forth:

  • All
  • Subscribed
  • Moderated
  • Favorites
  • โ€ข
  • provamag3
  • thenastyranch
  • osvaldo12
  • InstantRegret
  • cubers
  • Youngstown
  • mdbf
  • slotface
  • everett
  • Durango
  • rosin
  • kavyap
  • khanakhh
  • DreamBathrooms
  • megavids
  • magazineikmin
  • tacticalgear
  • cisconetworking
  • ethstaker
  • GTA5RPClips
  • vwfavf
  • Leos
  • ngwrru68w68
  • normalnudes
  • tester
  • modclub
  • anitta
  • JUstTest
  • All magazines