Hi we're making a low level programming language with 6 bit words and 4 built in data structures does anyone have any interest at all. We just finished specifying what all 63 used instructions do today. we gon write an interpreter and/or compiler. It's taken us 2 months and tho it's the 4th low level programming language we've designed it's the first to not be an esolang and it's got a lotta capabilities and stuff and it kewl we very proud. It's inspired by Lisp, TI-BASIC (our first programming lang :] ), C, very slightly by 65c816 and other Nintendo devices' assembly langs, and by one of our past esolangs called Birdie which had really fun logic and stuff :>
Anyone wanna hear aboot it?
(it's called Weevil & it took us about two months to finish deciding and designing the 63 instructions we used, and it's designed in particular with arbitrarily large address space in mind so that the 6 bit word size isn't an issue)
4 notes
·
View notes
My gender is a poorly written C program, in which a target 35–60% of the dedicated memory is assigned to femininity, 10–20% to masculinity, and the remaining 20–55% defaults to androgyny.
Its goal is to maintain a state such that femininity is at least the plurality, if not the majority, of the memory space, but occasionally it fails to do that for code reasons? idk I didn't program it and it's not open-source ._.
Observe:
[root@bryn ~ ]$ genderinfo
Bryn's Current Gender Composition
Femm - 40% [WARN] (LOW)
Masc - 15% [ OK ]
Andr - 45% [WARN] (HIGH)
Closest estimation - enby, femme-leaning
[root@bryn ~]$ _
55 notes
·
View notes
you and your friend are watching the mario movie, trying to see who can point out the most nintendo lore
call that a reference counting pointer
69 notes
·
View notes
Rust be like: “yeha you can easily call C functions from Rust” and then tells you unsafe
C++ be like: Yeha you can easily call C++ and C functions it’s trivial and then be like extern "C" and don’t fucking use C++
C be like: Buddy we are the function and then crash you back to login
59 notes
·
View notes
but yes coding anon, you can learn 2 program without being good at math
4 notes
·
View notes
In my previous post, I talked about a MSVC specific feature where one struct definition could be imported into another struct simply by declaring the imported struct in the other struct.
I discovered this behavior on MSVC because I am working on a way that is user-friendly to code in a more object oriented pattern in C.
I was thinking about class inheritance and how you can access directly to all the super class' members in C++ and I thought that maybe if I was to import a struct into another one I'd get a similar result in C. On Visual Studio it compiles just fine, but the moment you build with a other compiler, it just doesn't work; the compiler doesn't find the members imported from another struct.
I think it's a nice feature to have in places where you want to take a more object oriented approch but want to keep the freedom C gives you.
My approch to OOP in C is to split functionality and state. In the header file, the implementation struct is the struct containing the function pointers the user is expected to use, while the object struct is the states and data the object will hold. Exemple of adder.h:
typedef struct Adder {
int a, b;
} Adder;
const struct IAdder {
void(*ctor)(Adder* this, int a, int b);
int(*result)(Adder* this);
} IAdder;
There should be only one implementation struct per "class" as this is the only instance that should contain the function pointers for class Adder. It should not be modified at anytime during runtime, and so the unique instance is const. Exemple of adder.c:
#include "adder.h"
static void ctor(Adder* this, int a, int b) {
this->a = a;
this->b = b;
}
static int result(Adder* this) {
return this->a + this->b;
}
//We define the unique const instance
//of the implementation struct:
extern const struct IAdder IAdder = {
.ctor = ctor,
.result = result
};
And to use our adder class in main.c:
#include "adder.h"
#include <stdio.h>
int main(int argc, char** argv) {
Adder a = {0};
IAdder.ctor(&a, 3, 5);
int result = IAdder.result(&a);
printf("%i", result);
return 0;
}
9 notes
·
View notes
i saw this fast inverse sqrt function somewhere online, and it fascinated me to no end. (the left is the fast inverse, and the right is the `math.h` impl)
`main()` is just some crappy test suite i whipped up for testing purposes
the code in question was made for quake III arena’s gameengine.
here’s a video that explains it pretty well:
i was thinking, how would i achieve the same level of elegance, but in the context of lisp?
my notes (probably not super accurate, but probably still interesting to see how my brain tackled this):
thinking lisp brain here:
i came across this stack-exchange question:
i can treat the array as a sequence of nibbles (four bits), or a “half-byte”, and use the emergent patterns from that with the linear algebra algorithm in this post.
we can predict patterns emerging consistently, cos i can assume a certain degree of rounding into the bitshifted `long`. because of that, each nibble can have its own “name” assigned. in the quake impl, thats the `long i;` and `float y;`
instead of thinking about it as two halves of a byte to bitshift to achieve division, i can process both concurrently with a single array, and potentially gain a teeny bit of precision without sacrificing on speed.
i could treat this as 2x4 array.
each column would be a nibble, and each row would be 2 bits wide. so basically its just two nibbles put next to eachother so the full array would add up to one-byte.
the code is already sorta written for me in a way.
i just need a read-eval loop that runs over everything.
idk if it’s faster, if anything it’ll probably be slower, but it’s so fucky of an idea it might just work.
a crapshoot may be terrible but you can’t be sure of that if ya never attempt.
4 notes
·
View notes
ik she'd never play favourites and stuff but god its like. depressingly clear how much my mum prefers hanging out with my cousin over me. they have outings and regular movie nights and go on walks together and run errands and do chores they do literally everything together. and honestly its not just that like... even when im hanging out with the two of them i know she's more focused on my cousin. like she takes an interest in his interests. she asks him about spanish all the time but doesn't give a shit that i'm learning portuguese. i feel like i bore her whenever i try to speak. i always wanna let him ride shotgun the rare times im out with them because she can hold a conversation with him but not me. and whenever i'm alone with her she just treats me like a receptacle for her dumb fucking rants about facebook drama and then she seems so surprised when i have good advice for her even though i Always have good advice. she treats me like her talk therapist. she never thinks about my needs or my life or my interests. not that i even wanna tell her about it.
and like. for my cousin's birthday she got him a paranormal activity 6-movie blu ray box set because it's their favourite film series to marathon together. like they've rewatched it a bunch of times. they discuss their fan theories and everything. yknow what she got me for my birthday this year? nada. which is PORTUGUESE for nothing. god and they had that spontaneous weekend partying in london together and then a few months later she fucking planned a trip and went to sussex alone even though she knew id been wanting to go to sussex with her for literal years. she kept saying she'd take me then she didn't. what the fuck.
4 notes
·
View notes
Nothing is more devastating than this. The UN World Food Program has officially suspended aid delivery to northern Gaza, citing violence and lack of safety as major reasons the aid trucks aren’t getting through. Israeli officers are liberally shooting at Palestinians who try to approach the trucks in hopes of getting even the smallest morsels of food, despite the fact that Israel has allowed only one crossing for the already woefully low numbers of aid they’re permitting entry. Reportedly this number has fallen from 140 a day in January to just 60 a day this month, and now 16% of all Gazan children under 2 are “acutely malnourished.” Meanwhile, the US vetoes a call for a ceasefire for the third fucking time. It’s so inhumane in its cruelty it’s actually shocking to see it being allowed to go on and on, and on an international level no less.
36K notes
·
View notes
Low-level, Middle-level, and High-level Programming Languages
#NeedToKnow: level of languages
Low-level Programming LanguagesMiddle-level Programming LanguagesHigh-level Programming LanguagesMachine Language: This is the lowest level of programming language, consisting of binary code understood directly by the computer’s hardware. Each instruction directly corresponds to a hardware operation.Assembly Language: Slightly higher level than machine language, assembly language uses mnemonic…
View On WordPress
0 notes