[a / b / c / d / e / f / g / gif / h / hr / k / m / o / p / r / s / t / u / v / vg / vm / vmg / vr / vrpg / vst / w / wg] [i / ic] [r9k / s4s / vip] [cm / hm / lgbt / y] [3 / aco / adv / an / bant / biz / cgl / ck / co / diy / fa / fit / gd / hc / his / int / jp / lit / mlp / mu / n / news / out / po / pol / pw / qst / sci / soc / sp / tg / toy / trv / tv / vp / vt / wsg / wsr / x / xs] [Settings] [Search] [Mobile] [Home]
Board
Settings Mobile Home
/g/ - Technology


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1767441978800088.jpg (55 KB, 650x693)
55 KB
55 KB JPG
Que tu fais, /g/?

Précédent: >>107730163
>>
wheres marie?
>>
I wanna throw whatever work I have done on Zetha, my ANSI C compiler, so far, and start anew.

I made a mistake by focusing on arenas and string pools. D has memory management. Use it.

I want to begin with a new name. Give me a good name. I don't like Zetha.

I've never been the one for 'wasted work fallacy', or whatever that fallacy is called. You can tell by me having close to 300 repos on my Github, most of them unfinished projects. If I feel it's not working, I throw it away.

And I just did that. I threw it away.

But I need a good name to start again. gib gewd name.
>>
>>107756119
My cute brown poor French larper wife
>>
>>107756169
have a French name: Frank
command: frankly hello.c -o hello
do straightforward compilation with minimal optimization. Speak directly and without subtlety to the machine.
>>
>>107756169
>I need a good name for me umpteenth AI slop project.
No you don't.
>>
>>107756169
Zurethra
>>
>>107756322
The compiler is modeled after lcc, which does minimal optimizations, anyways. Just CSE with DAGs.

>>107756391
Nice. I'll choose this one. Sounds kinda like Zoroaster.
>>
Now, Zurethra (name chosen thanks to anon) is just my warm-up compiler. I wanna go through it with:

1. Minimal use of LLMs
2. Without getting distracted away by bullshit like arenas and string pools

I wanna just make an lcc-like compiler in D.

The main compiler I wanna make, Cephyr, is a different story. I have *plans* for this one.

But I feel like, unless I don't make a smaller compiler, I'd be lost.
>>
File: 1767446658113391.jpg (172 KB, 1320x1865)
172 KB
172 KB JPG
Threadly reminder that any attack on programming yourself is jeets trying to shill AI slop.

Do not redeem the AI.
>>
My boss told me he'll pay for the remainder of my college tuition if I enroll back in.

If I go back to college now, I can probably get my PhD at 38.

I don't understand why you folks are so anti-college. The reason you got no job, and jeet has a job, is that jeet has a degree.

I can view this situation at a good distance. Persona A opens a business. Person A considers hiring Person B, and Person C. Person B has no degree, and needs insurance, and loads of other expenses. Person C has a degree, and needs no expenses because he lives in Nepal or some place like that.

Would Person A be insane for choosing Person C over person B?

At least, try to get your degree, since a degree, even from a shitty American college, is better than a degree from the best Nepalese college.
>>
>>107756119
Je t'aime mon petit oignon doux.
>>
>>107756119
TABARNAK
>>
>>107756958
the way i see it a degree is only worth something if you use your time there to network with fellow students, professors, recruiters etc. If you're just gonna spend it neeting in your room doing college work and exams might as well do those things on your own. Your chances of landing a job are about the same since you arent getting referred
>>
>>107756455
>The main compiler I wanna make, Cephyr, is a different story. I have *plans* for this one.
Are you going to make your own language, instead of just another C compiler?
>>
File: 1754287236546975.png (50 KB, 1200x858)
50 KB
50 KB PNG
>>107756119
how do you even pronounce this?
q-tea or cute?
>>
>>107758236
Although personally I say ku-te
>>
>>107758236
'TRA-sh, 'trăsh, /tɹæʃ/
>>
>>107758273
damn it, I was explaining about it to my friend and I was saying q-tea all the time
>>
This protocol defines a cyclical state machine with a specific focus on computational density and precision scaling. The architecture suggests a system that ingests data at standard precision, expands it for complex internal processing, and then compresses it before looping back for refinement.

https://colab.research.google.com/drive/10HngoUgOMg6_lWXGbsQJZkijhWgDfVdg
>>
>>107758407
I'm sure that's fine.
>>
>>107758564
Causes /g/ to have a mental break down.
>>
>>107758749
>not using the old vpmovmskb + tzcnt trick
The only breakdown here is one of never-ending laughter.
>>
>>107758564
If you want *actual* people to use your program, you have to rely on already-established libraries and toolchain.

Dem's the breaks anon. Sorry.

Overreliance on externals, now, is also a mental illness. There are libraries on NPM that check if a number is odd or not. But I shove that to beginners being too stupid.

Here's a library that you'd be stupid to reimplemnt: ncurses.

Also, never roll your own crypto.

My compiler, Zurethra, has zero dependencies. But that's only because it's super-minimal.

My other compiler, Cephyr, has loads of dependencies. Chief amongst them, Goblint-CIL.
>>
how do I filter someone based on their posting style?
>>
>>107758829
Loaded gun to your head, safety off, pull the trigger.
>>
>>107758850
get new material
>>
>>107758801
How many hours have you wasted making your ultra optimized fizzbuzz as portable as possible only for literally no one to use it anyway.
>>
I usually use ublock origin to block posts I don't like.

Like that retard who keeps annoying me with 'le ai le bad' shit.

Sorry, hun, if nobody is hiring you no more because you can write two lines of JS.
>>
>>107758871
>optimized
>portable
I love how the nocoders are constantly telling on themselves.
>>
>>107758877
Just answer the fucking question.
>>
>>107758882
And if not?
>>
>one retarded schizo leaves
>even more retarded pops up
where do these guys spawn from?
>>
>>107758871
Plenty of times. You seen my Github have you not.

I think for an open source program, in this day and age, to become popular, it's mostly about the provenance of your attention-whore-iness.

Like, you gotta have a blog with posts that begin with "X is a hot topic of discussion these days" followed by lazily throwing wrongly-cited papers you haven't read (or have had AI read it for you), followed by a "Hot Take(TM)".

The more you advertise *yourself*, the more your library or program takes off.

Ditto of the program or library is in/for Rust. 70% of which is LLM-generated.

No shade at using LLMs to generate a 'rough' version of your program, I do it myself, but I always end up writing the main matter myself.

But, yeah, if you want your software to take off, make a blog, advertise yourself, and also, create a Discord server for it. That always pays off.

Just be careful, if you make a Discord server, some stupid fucking teenage twats will be attracted to it, 'community seekers', basically. And you get branded as a pedophile.

Speaking of blogs, I think it's time I made myself one. I won't share "Hot Takes(TM)" on it. Just share educational stuff. And my revisionist ideas on Claude Lanzmann's ""The Shoah.
>>
>>107758887
>And if not?
<tumbleweeds>
>>
>>107758829
Sounds like an actual legitimate use case for AI. You'd need to train a model on the style you want to filter.
>>
>>107758871
>wasting hours making your ultra optimized fizzbuzz as portable as possible
Sounds like a good learning experience that teach you knowledge you can use for real projects.
>>
>>107758962
>prefers simplicity
Sounds like a (You) problem.
>>
>>107758988
What server? What code?
>>
>>107759019
I think I'm going to be juuust fine without your imaginary service.
>>
>>107759029
Yeah, like posting about code that doesn't exist, like you have been doing for the last 30 minutes.
>>
>>107759040
The same goes for Linux and Mac, too.
>>
>>107759076
Yet you don't name them. Probably because you don't want to endure another never-ending laughter attack.
>>
>>107759094
Pffffff.
Right, nocoder.
>>
My university's servers ran on neither Linux, nor Windows nor macOS, but some unemployable retard has an opinion on what matters.
>>
File: 1767435286725222.png (185 KB, 437x403)
185 KB
185 KB PNG
>>107756125
>>107757283
Oui oui je suis un faguette
>>
>>107756169
>>107756455
>>107758523
Report this AI trash for automated spam.
>>
>>107759351
Can you even send posts automatically on 4chidori with this new captcha?
>>
>>107759455
I dunno.
>>
As someone who has already done the one page basic programs on notepad++ like, creating a shop, ATM, showing a star on the console panel, creating a registry and other stuff, what should I now do where I have to use multiple pages and have to use OOP using visual studios?
>>
>>107759632
whatever you want
it doesn't have to be OOP
>>
>>107759632
>I don't know what to program! What should I program?
Why does this question keep popping up lately?
Why did you get into programming in the first place?
>>
I've finally taken the snake_case_pill for function names. Still PascalCasing types though.
>>
>>107758901
function on_schizo_exit() {
spawn_schizo(rnum);
}
>>
>>107759632
>creating a registry
Show code.
>>
>>107758928
yeah, for the discord stuff, I just disabled chat for everyone and only wait for them to express themselves via adding reactions on my posts, also vc and stuff disabled
>>
I'm writing an snprintf that doesn't suck.
%s formats take 2 arguments: a char * and size_t length (not an int like %.*s does)
It's actually an iterator, so it can stop in the middle of a format because the output buffer is full, then when it will be called again it will continue where it left off and finish outputting the current format, and again if necessary.
>>
>>107760560
All of these functions always suck.
>>
>>107760560
It will always suck because of parameter code generation - i.e. having to copy raw values from complex structures onto the stack.
>>
>>107760560
i was gonna make a remark about fprintf having a return value
<but then this retarded shit in the man page

how is this even allowed?
we have a typeof() in c23 but this shit isnt fixed?
>>
>>107760587
You mean non-libc format libraries in general?
It does exactly what I wish [sp][n]printf would do so this works for me.
>>107760598
>parameter code generation
>i.e. having to copy raw values from complex structures onto the stack.
I don't understand waht you mean.
The fact calling the format function is a moutful to call because of the struct parameter and initialization? It's intended to be used as an internal library, I'll make wrappers that will handle all this and that you will need to call only once.

>>107760660
I know all this but so what? I'm going repeat myself:
What if it didn't finish, what do you do now? There isn't a good mechanism to handle the case where it didn't finish outputting a format.
It returns an int instead of size_t.
%s takes nul terminated so if you have a length terminated string, like you should have in modern C code, you'd have to append a 0 (if you can) to the string you want to print and you're fucked if you want to printf a section of a string, or it gets messy.
>>
>>107760743
>What if it didn't finish, what do you do now?
yeah, thats what i was saying
its a failure in interfacing. thats exactly the type of things the commitee should be dealing with instead of bloating c with sepples like features

i never dealt with this because i just dont use the printf family of functions outside of debug outputs
its a fucking tank, if i need to output anything i write an adequate function.
also because i deal with strings using a modernized type- compatible with null terminated c-strings, but i also have a size and i pad my strings depending on the type of operations im gonna be using (up to 32 null bytes if i were to go full auto retard with vector extensions)
in other words: modern fucking strings which allow modern hardware to enable all its features
another thing the commitee should be dealing with
>>
>>107760743
>It's intended to be used as an internal library, I'll make wrappers that will handle all this and that you will need to call only once.
That fixes the code size problem, but doesn't get rid of the fact that you have data being copied from struct memory to CPU register back to stack memory, only for it to be copied back from stack memory to CPU register during ASCII conversion (or whatever the fuck you do). Better than nothing, but still fucked.
>>
>>107756119
is zig worth learning? I see some projects that are starting to use it exclusively like tigerbeetle, bun and ghostty
>>
File: tincan.jpg (149 KB, 922x1472)
149 KB
149 KB JPG
>>107756119
>added one time secrets
>made the browser UI more modern for normie appeal
>voice chat is somewhat more stable now between browser and desktop
>added reporting feature and some basic moderation tools in case someone decides to be an asshole and dump bad stuff that could get me in trouble, so I'll start working on user uploaded avatars soon

Been in the works for over 2 years now. Switched from cross-platform TUI, to WPF, now settled on GTK. This side project has become one of my main quests.
>>
>>107760916
it has plenty of good ideas (going all-in on custom allocators, build.zig, explicit imports of files=modules=structs, unconfigurable but easily hinted fmt) and special utility (bundled clang and cross-compilation toolchains) and is only a little retarded (explicit to the point of being a complete pain in the ass, long names to the point of becoming a denial-of-service attack on the reader, compile-time duck-typing). zigguy's objective was that people, even not liking Zig, would still use it, and he's doing a good job of pursuing that goal. Zig's something that you can generally write instead of C, and even where Zig sucks, you'll probably prefer it a lot to C. Other contenders fail to do this in a lot of ways that Zig doesn't.
In particular if you'd rather write mainly in in some more ergonomic language, like Lua or Erlang, writing the fast bits in Zig just makes more sense than writing them in anything else, even Rust.
>>
>>107760813
About the copying on the stack, it's necessary to copy some state since it's an iterator, so it can continue where it left off but it doesn't copy the vararg argument itself. The vararg arguments are passed with a pointer to an array and a length, but the wrappers will use <stdarg.h> so they will need to copy the arguments indeed.

It's not meant to be efficient, but it shouldn't be too slow. There is only one simple function that does everything. It doesn't call other functions for now (except for %f and %m), it doesn't allocate anything, it doesn't use too many variables, it doesn't need to use a mutex either. https://aras-p.info/blog/2022/02/25/Curious-lack-of-sprintf-scaling/

I didn't use mempcy though, I usually do but here it's intended to be used on short strings for mostly logging stuff and since I need to iterate over the format string one character at a time anyway and %s parameters should be small...

>>107760811
>up to 32 null bytes if i were to go full auto retard with vector extensions
impressive level of autism

But yes, string handling beyond trivial shit is such a pain in the ass in general and in particular in non scripting languages, both for parsing and for generating. All the string handling tools suck balls.
If you think about it, a good deal of why the web cuck users so much is because everything is so much of a pain to even parse.
>>
File: 1755376910116192.jpg (176 KB, 1080x1337)
176 KB
176 KB JPG
>using library
>the trannies change the build system from make to cmake
>>
>>107760916
Absolutely if you're writing something close to the metal, it's perfect for that. The further away you get from the metal, the more burdensome it becomes.
>>
>use python3.x
>your python version is too new, we require python3.y
why is python allowed to break compatibility on every update?
>>
>>107762401
Because despite all your rage you're still just a rat in a cage.
>>
File: 5001858.jpg (33 KB, 430x316)
33 KB
33 KB JPG
>>107762401
They are refining Python at each release into the perfect programming language. That's what gives them that right.
>>
>protocol specifies CRC of non-divisible-by-8 number of bytes
>>
File: sunzu.jpg (25 KB, 640x428)
25 KB
25 KB JPG
>>107762565
>clients software uses 12bit crc with custom polynomials
>they just expects you to "work with it" without original source code
>>
>>107762634
>disables bit integrity check
>>
>>107762686
>clients software fails all your messages without any indication or return
>>
>>107762401
>>107762529
I am writing an asyncio-based server program. Every basic feature depends on some barely maintained third-party library with hundreds of open github issues and little to no activity in the past year. At this rate I expect it to constantly rot and require major code-rewriting maintenance every 6 months. There are no alternatives in the standard library. No, I don't want to write a hundred thousand lines of code just to support a few complicated protocols with asyncio.
How do pythoneers cope with this horrendous state of the world? I wonder if it's a good idea to invert the entire codebase and write everything in the pre-asyncio generator coroutine style, yielding "effects" and accepting results from some kind of executor loop. That way all the third party crap is sort of isolated from the "pure" part of the program.
>>
>>107762718
>How do pythoneers cope with this horrendous state of the world?
Most of the them are researchers or students so they do their one shot and forget it forever.
I think people that use python for work are stuck on their old system that they run in some docker container / virtual machine.
>>
>>107762183
>>up to 32 null bytes if i were to go full auto retard with vector extensions
>impressive level of autism
id argue this is just competent design
padding the string with the width of the type youre working with allows you to drop all the code thats gonna deal with avoiding overflowing when you apply your code to the data

it can really slow things down
instead of doing one algo cycle utilizing the whole width of a vector type you will be parsing one byte at a time, REGARDLESS whether you look for null termination or you use a size with the string
if you can run your vector-sized algo on everything its not only faster, but it makes also less code to write

also, people instinctually want to pad to the nearest multiplier of your data width
dont do that on strings.
this way you can start working on your string with the full width of your types, starting at any point, even if you launch your function on the null terminator.
also also once you work with vector types this means youre on x86-64 and you have 32 padding bytes to spare for your hot loop strings
youre most likely working with an overallocated buffer already, anyways
>>
Please retry operation after closing inhibitors and logging out other users.
'systemd-inhibit' can be used to list active inhibitors.
Alternatively, ignore inhibitors and users with 'systemctl poweroff -i'

I hate nu-linux so fucking much
>>
>>107763108
Why do you have inhibitors on your system? I don't know what they are but it looks like they are doing their job, or your system is misconfigured for your needs.
Also is this really the right thread for this?
>>
Is there anything I can do with these?

func u64 set_neighbors(u64 x)    { return x | ((x << 1) | (x >> 1)); }
func u64 keep_gaps(u64 x) { return ~x & ((x << 1) & (x >> 1)); }
func u64 fill_gaps(u64 x) { return x | ((x << 1) & (x >> 1)); }
func u64 remove_loners(u64 x) { return x & ((x << 1) | (x >> 1)); }
func u64 keep_loners(u64 x) { return x & (~(x << 1) & ~(x >> 1)); }
func u64 remove_edges(u64 x) { return x & ((x << 1) & (x >> 1)); }
func u64 keep_edges(u64 x) { return x & (~(x << 1) | ~(x >> 1)); }
func u64 keep_left_edges(u64 x) { return x & ~(x >> 1); }
func u64 keep_right_edges(u64 x) { return x & ~(x << 1); }
func u64 keep_edges_remove_loners(u64 x) { return x & ((x << 1) ^ (x >> 1)); }
func u64 remove_first_run(u64 x) { return x & (x + (x & -x)); }
func u64 remove_run_at(u64 x, u32 n) { return x & (x + (1 << n)); }
func u64 set_run_transitions(u64 x) { return (x << 1) ^ (x >> 1); }
func u64 set_1_transitions(u64 x) { return x & ~(x << 1); }
func u64 set_0_transitions(u64 x) { return ~x & (x << 1); }
func u64 majority3(u64 x) { return (x & (x << 1)) | (x & (x >> 1)) | ((x << 1) & (x >> 1)); }
func u64 equal_neighbors(u64 x) { return ~((x << 1) ^ (x >> 1)); }
func bool is_zeroes_then_ones(u64 x) { return -x == (-x & x); }
func bool is_compact(u64 x) { return (x & x + (x & -x)) == 0; }
>>
>>107762700
>block clients software
>continue doomscrolling
>>
>>107763395
>get fired from your job for not doing your work
>can't afford house or internet
>>
>>107763388
what do you mean
>>
>>107763388
You can fill gaps and remove loners.
>>
>>107763388
also what does -x do when x is u64 (presumably unsigned)
>>
>>107763452
>ruin entire network beyond repair
>fly to non-extradition country
>permanent vacation
>>
>>107763479
~x + 1
>>
>>107763363
>try to close system from command line
>try to close system from the gnome power off button
>redhat / gnome / microsoft wants to keep your system on for eternity
I hate linux so fucking much
>>
>>107763506
does it give you back a signed value? i guess a + b is the same either way but what if it was something like a * -b where b is unsigned, would it be signed or unsigned mult.
>>
>>107763520
u64 a = 3
u64 b = 5
u64 c = a * -b = -15 = 0xfffffffffffffff1
>>
>>107763520
You can use speedcrunch calculator to visualize how the bits change.
>>
>>107763561
that doesn't answer my question, I'm asking if in that language -x is u64 or i64 if x is u64 and if you have a mix of i64 and u64 which ops does it use
>>
>>107763542
so presumably it gives you i64 and does signed multiplication?
>>
>>107763671
C++, u64 stays u64
>>
>>107763716
does it just happen to work out to the same thing? does signed vs unsigned mul only matter if theyre both negative [if interpreting it as signed] or something?
>>
>>107763488
every country is an extradition country if you piss someone off enough
but probably not for failing to put up with BS from an undocumented CRC
>>
>>107763795
>every country is an extradition country if you piss someone off enough
Tell that to Snowden.
>>
Signed and unsigned numbers are same thing under the hood, and use the same arithmetic operations. The is no signed and unsigned multiplication, they are identical. It's just a matter of how you want to interpret the bit patterns of the arguments and the result in the end.
>>
File: cbdc.jpg (113 KB, 1087x610)
113 KB
113 KB JPG
>>107763827
>not a word about kikes
hes a crisis actor and his whole escape to russia is grand cinema
also... pigrel
in things that matter the east and the west are on the same page
picrel is map of digital currency, a project under the atlantic council's oversight
>rasha, china : pilots
yeah, theyre in on the plan and the apparent inimicity is all bread and circus
>>
>>107763921
so why do MUL, IMUL and PMADDUBSW exist
>>
>>107763940
like is it only the highest bit that is affected? or flags
>>
>>107763940
you will never unsee this
youre welcome
>>
>>107763985
W
>>
>>107763994
i thought youll appreciate
it always puts me in a good mood, too
finding positives in the little things, you know
>>
>>107763511
you need it to receive updates goy
>>
>>107763936
No one cares about your schizo narratives.
>>
>>107763936
>yet another reason to immigrate to mongolia
>>
>>107763660
You got told already. Unary negation applied to u64 produces u64.
There's multiple sane models for numeric types, but that's one.
>>
>>107762195
There's nothing wrong with cmake that couldn't be fixed by nuking it from orbit just to be sure.
>>
>>107764088
I didn't until here >>107763716
>>
>>107756119
Basic Context Menu for TempleOS
>>
File: Mount Stupid copy.jpg (159 KB, 1120x630)
159 KB
159 KB JPG
>>107763940
I don't know. My understanding of how thins work may have been overly simplified and I may have spoken out of turn.
>>
>>107764166
I can make it even easier for you: MOVSX vs MOVZX.
>>
>>107763985
kek
>>
>>107756119
dashi dedans
>>
File: c43.jpg (30 KB, 450x450)
30 KB
30 KB JPG
>>107764046
>>
>>107764031
>schizo narratives
>straight from the atlantic council's mouth
thats some very strong cope you got there
>>107764046
i thought about this
mainly bc the country is empty as fuck and its all either steppes or deserts
but then i learned mongolia is china's bitch

i have no idea where tor un to, anon
not even africa is safe. maybe the fukken moon or something
and kessler synrome the earth for gatekeeping purposes
>>
>>107764278
Take your meds.
>>
>>107764286
nah, youre just pants on head retarded
>>
File: 1728574471373651.gif (177 KB, 276x320)
177 KB
177 KB GIF
>>107764315
>>
>>107764331
>t. ostrich
its a retarded survival tactic
insofar it doesnt work
whose team youre on?
brics? or nafo?
>>
>>107764358
The one that locks you up for literally forever if you don't take meds. As in, "life without parole or even pardon" forever.
>>
File: same-same.jpg (22 KB, 321x300)
22 KB
22 KB JPG
>>107764384
>mfw i finished reading your post
>>
>>107764435
Good. Then I cannot steer wrong.
>>
>>107764196
I don't get it. I think I understand those, but what does that have to do with multiplication?
>>
>>107764461
Not "multiplication". Signed vs. unsigned integer promotion.
>>
>>107764444
weird cope
the only way to win at this game is not to play
>>
>>107764482
For you, yes.
For me, I just want you behind bars until they force-feed you meds.
>>
>>107764501
>t angry. mad, even
tough tiddies. im gonna keep fucking up your psyops instead, faggot
not out of a sense of duty
but just because im bored and i find it funneh to dunk on you and your likes
>>
>>107764520
You can also just spend the rest of your life locked inside, completely forgotten forever. That works too.
>>
File: ukaki.png (15 KB, 400x400)
15 KB
15 KB PNG
>>107764579
then why hasnt it yet hapened then?
oh, thats right

youre actually impotent
and im still doing exactly what i want, whenever i want
>>
>>107764637
Same reason you survived school: systems fail.
>>
>>107764654
>school
i went to a freemason school
they tried to break me

big mistake lamao
im an european
the harder you try to bring me down, the harder i fight
you should have covered me in gold and i would have been your most loyal ally
>>
>>107763921
https://www.felixcloutier.com/x86/mul
https://www.felixcloutier.com/x86/imul
the upper word result has a different value wether you use mul or imul
>>
File: 139224994_p0.jpg (586 KB, 768x1280)
586 KB
586 KB JPG
programming is too tedious nowadays.
too much work to implement my imaginations.
too much researching, too much troubleshooting, too much learning datastructures and algorithms, too much dealing with system and language caveats.
it's all too tiresome.
>>
>>107766708
then ack lamao
nothing of value will be lost
>>
>>107766708
language design is the cure
>>
>>107766721
nono
for him the only cure is a rope
>>
>>107766720
I'd rather continue living and find something better

>>107766721
yes and I think making an AI based programming language would be great
something like
>very high level but mathematically precise language that kind of acts like a spec
>AI iteratively generates lower level code
>lower level code compiled/run and checked against the spec
>AI iteratively fixes bugs / generates code
>repeat until spec 100% satisfied
that would be the compilation process
it sounds like a good idea to me
>>
>>107766897
>I'd rather continue living and find something better
then please proceed faster because you didnt write a line of code in your life and your attention-whoring couldnt be more obvious, /a/
>>
>>107766936
I've written tons of code in my life lol. I've just begun to get sick of it in recent years
>>
>>107766958
>didnt think of posting anything
yea, sure, of couuuurse, mh-hm
>>
>>107766897
>yes and I think making an AI based programming language would be great
lol no
>>
>>107766970
ok retard

>>107767008
don't worry, I know it'll work. you can disagree though and I accept that
>>
>>107767018
>still didnt post code
lol
>i know ai will work
>source: trust me
lmao even
go back to /a/, larper
>>
>>107766708
if you think they are tiresome then your mind isn't built for programming
>>
>>107756119
finally around to getting real mmap() support added into my kernel and stressing about how i'm going to handle file-backed pages.
never realized how flexible of a function it is, but it's also a bit of a pain in the ass to implement vm_map entry splitting/merging and wrap my head around all the changes but can now clean up much of my manual task segment setup along with eliminating heap and the "resize heap" syscall entirely, and it will be nice to finally scratch off demand paging from my todo

plus i'll now be able to allocate dma memory from userspace, which will let me continue work on the driver for my emulated gpu architecture (for 3d accel/compute and eventually ray tracing, but opengl backend only for now). exciting stuff
>>
>>107767236
baste. have a you
>>
I'm porting my timer to ncurses because I'm having another "the bloat is in the room with me" episode over SDL.
>>
File: 1757135717007477.png (32 KB, 541x278)
32 KB
32 KB PNG
Added an objdump flags field to godbolt so I can filter it instantly and not have to wait for the entire assembly to run through 300 layers of javascript.
>>
>>107767236
nice. I made a little hobby kernel once and implemented mmap too. useful little function
>>
>>107767236
>>107767798
I might add, I implemented kmap first which is kind of like mmap but for the kernel, and then I implemented userspace mmap using kmap
>>
>>107767864
Do you explicitly zero memory in mmap, but not kmap?
>>
>>107767996
I don't remember. it was a while ago and I deleted the project
>>
>>107767864
32-bit kernel dev sounds like hell, i'm targeting my own 64-bit virtual cpu and don't really intend on ever delving into x86

another one of the nice aspects of that is i got to skip doing much of the code real hw interfaces (usb, pci, nvme, etc) would require in favor of far more simpler ones lol
>>
>>107768050
nice. virtual architectures you design yourself are the best.
I wrote mine on bare x86, booted from real mode -> unreal mode -> 32bit protected mode
I didn't get very far though as you can imagine, and it was fairly troublesome. still fun though
I'd like to go again some day but not on x86. maybe something like you're doing, maybe something slightly different, I don't know
>>
>>107768050
>>107768086
honestly I kind of want to write my own riscv VM and kernel on top of that, I do want something GCC can target. either that or just qemu's riscv or something.
sounds like a lot of fun
>>
File: chrome_02DdcukVRV.gif (187 KB, 1042x676)
187 KB
187 KB GIF
Simple thing, but made it so you can just ctrl+v, and if it's an image or a link it'll automatically fill the submission page for posts on my site.

I've basically just been doing user experience optimizations to my site for the last few days, feels good man.
>>
>>107762634
CRC is easily reversible
https://reveng.sourceforge.io/
>>
File: 1741719537618254.png (46 KB, 601x515)
46 KB
46 KB PNG
just about done with basic language constructs, just in time because I wanted to "finish" this project before it's time to go back to work in 2 days. ended up adding options because I'm going to be the only one using this lang anyways so might as well cater to what I like using
>added real-time syntax highlighting
>added option types
>added "ask", returns the truthiness of an expression
>replaced infix function call operator with a dot, though I'm not convinced by it because it's barely noticeable on the screen
>added collections with iter keyword (defines 3 hidden variables index, key and value inside its body)
>>
>>107768752
>easily
Depending on skill level. Just finding that tool, knowing what to look for or even to be looking for it at all, is not necessarily trivial if you don't happen to get spoonfed the answer from a random anon on a yakutian ice farming forum.

>>107762634
>request original source code
>finaly get source code after a lot of nagging
>it's such a mess it doesn't help you at all and you still have no idea what's going on

>>107766708
>too much work to implement my imaginations.
That's why you don't go into engineering. You go into business so you can hire engineers to implement your vision for you.
Or nowadays I've heard you can just vibe-code it.
>>
>>107766897
>checked against the spec
Writing the spec precisely in enough is called programming.
>code compiled/run and checked against the spec
Aka. Test Driven Development
>>
In Neutralino there is no 'windowMove' event type, I'm trying to save the app position either when the app window has been moved or when app quits (windowClose doesn't work here)
>>
>>107767428
>"the bloat is in the room with me"
Are you sure that's not just you, sitting alone in your room?
>>
No matter what kind of program I write, there is always a large amount of state in it, and it's accessed from everywhere in a "disorganized" way. You know the term "cross-cutting concerns"? The entire program consists of cross-cutting concerns as far as I'm concerned. Clearly it is good for efficiency, because whenever I try to extract parts of the program into their own modules I always find that it introduces redundant branching (as in the extracted procedure does some branching and computes a return value, and then calling procedure has to branch on the returned value again). However, I find it annoying that I am reimplementing common things again and again with slight task-specific variations. Is there any orthodox literature on program structure written by programmers, not by consulting and book salesmen?
>>
>>107769872
>there is always a large amount of state in it, and it's accessed from everywhere in a "disorganized" way
OOP solves this

>Is there any orthodox literature on program structure written by programmers, not by consulting and book salesmen?
don't know any, but if there are, i would not expect them to be good. programmers are quite bad at writing books
"consultants" like Uncle Bob can oversell good points, but if you apply them with some forethought and not blindly and everywhere, they generally work way more often than not
>>
>>107764143

i see you coming again and again with news thing ,i wanted to tell you big respect for what you do.
>>
>>107770012
>OOP solves this
There is no good solution to the problem of Necessary Complexity. OOP is not a good solution. Instead of keeping all the state in one place you get N subsystems all depending on each other in confusing ways. OOP keeps the same Necessary Complexity, but increases Accidental Complexity.
It's better to keep the program as simple and malleable as possible. It will be shorter and more efficient too.
>>
>>107770077
>Instead of keeping all the state in one place you get N subsystems all depending on each other in confusing ways
just design good abstractions and aim for low coupling and high cohesion and it will not be confusing at all

>OOP keeps the same Necessary Complexity, but increases Accidental Complexity.
skill issue, not fault of OOP

>It's better to keep the program as simple and malleable as possible.
that's literally what OOP does

>It will be shorter and more efficient too.
while OOP will need more code overall, for each specific task you will need to go through/work on less of it at a time
performance-wise, unless you write really bad code, the difference will be negligible in practice
>>
>>107770012
>OOP solves this
Lolno
>>
>>107769872
>>107770248
>just design good abstractions and aim for low coupling and high cohesion and it will not be confusing at all
If done right, then it's good.

>skill issue, not fault of OOP
>unless you write really bad code, the difference will be negligible in practice
If done wrong, then it's bad.

>that's literally what OOP does
OOP is literally doing things right.
>>
>>107770318
correct, sir
>>
I have no horse in this race but I notice pro-OOP people are generally low-IQ, seething and zealous, so I automatically assume OOP is bad. Does anyone have any examples of a high IQ OOP programmer?
>>
>107770362
low effort cnile shitpost
>>
>>107770362
High IQ programmers do what works without sticking to dogma. Often a high IQ programmer's codebase is messier and more difficult to maintain because the intelligent progammer has a greater ability to cache more of the solution in their brain as they're building the codebase.
>>
>>107770432
>Often a high IQ programmer's codebase is messier and more difficult to maintain
Gonna press X for doubt here. Does anyone have any examples of a high IQ programmers who write code that is messy and hard to maintain?
>>
>>107770362
>Does anyone have any examples of a high IQ OOP programmer?
No. None of the big or memorable names in programming are associated with OOP. You just get retards like Uncle Bob.
>>
>>107770470
fast_inverse_square_root.png
>>
>>107770362
>>107770518
Rob Pike. Jonathan Blow. Tarn Adams. John Carmack. Kent Beck.
>>
>>107770620
>Carmack
>high IQ
Someone's never looked at the Zone Memory Allocator in DOOM.
>>
>>107770620
Pike and Blow are procedural zealots and Carmack is bullish on FP.
Only OOPist there is Kent.
>>
>>107770362
>I notice pro-OOP people are generally low-IQ, seething and zealous
that's why anti-OOP people constantly make threads about OOP to shit on it, or enter neutral threads about OOP to just shit on it, and never with any specifics. totally not seething
that's why anti-OOP people steer discussions towards worshipping or vilifying representative idols. totally not zealotry
that's why anti-OOP people want to argue about IQ scores through shit-flinging and never show off anything on topic. totally now low-IQ behavior

>>107770608
what's messy about it?
if you were to apply Clean Code™ rules to it, all you'd need to do is to rename the function
>>
>>107770620
>Rob Pike. Jonathan Blow. John Carmack.
None of them care about OOP.

>Tarn Adams.
Literally who?

>Kent Beck.
Low IQ design pattern salesman on par with Uncle Bob.
>>
>>107770695
It's called empathy. They want to prevent others to make the same mistakes as they made.
Of course, an autist like you could never understand.
>>
>>107770695
>that's why anti-OOP people
>that's why anti-OOP people
>that's why anti-OOP people
See what I'm talking about? Stop chanting. What a weird, angry cult, man.
>>
>>107769872
skill issue
I'm sure there is a pattern in your program that you don't see or that you don't know how factor out that can be factored out.
If you were more specific we could help you find it.
>>
>>107770362
>pro-OOP people
retard
>>
>>107770695
>what's messy about it?
If the first time seeing it didn't make you go "WTF?" you might have an IQ of 200. Which kind of illustrates my point.
I wouldn't want to work on an entire codebase written by you.
>>
>>107770648
nta, but you piqued my curiosity-
whats the function name/source file where i can find that?
>>
>>107770713
Patterns can be factored out. Even with the absolute maximum factorization, the program will remain as complex as necessary. Some programs are trivial and factorize significantly. They are trivial enough to be generated by ChatGPT. We are not talking about that kind of program here.
>>
>>107770759
https://doomwiki.org/wiki/Zone_memory
https://gitlab.mn.tu-dresden.de/betriebssystembau/oostubs/-/blob/main/doom/z_zone.h?ref_type=heads
Or just google for PU_CACHE.
>>
>>107770805
thanks, anon
>>
I was taught OOP from the first intro to programming course and throughout my entire education. I was so mindbroken that I was unable to even start thinking about solving any problem without writing a Class stub first. I had to actively unlearn a lot of bad habits that had been ingrained in me.
Then it turned out that a lot of people were becoming disillusioned with OOP because while it tends to make initial design easier, it quickly becomes cumbersome and a hindrance as soon as something need to change.
And in my senior year I had one (1) lecture that said "everything you've learned is wrong" and OOP is terrible for CPU cache trashing, which slows down execution.

Just my $0.02 on the topic of OOP.
>>
>>107770773
>Even with the absolute maximum factorization, the program will remain as complex as necessary.
No, you didn't achieve maximal factorization.
It's true that there is an inherent logical complexity that you can't remove without cutting down features your program, but that doesn't mean that this logic can't be factored out nicely.
Whatever mess you currently have, it remains ""complex"" because you don't know how to factor it, like I said.

There are some easy factorization where you easily take out some code, put it into a procedure and call it. Or make a nice interface around a data structure or subsystem.
But from your post, I'm pretty sure that you have complex control flow with data processing intermingled. It can absolutely be factored out.
>>
>>107770955
>>Even with the absolute maximum factorization, the program will remain as complex as necessary.
>No, you didn't achieve maximal factorization.
"maximum factorization" is calling main
i see what you mean with that though- everything behind an interface
but what youre doing is just repackage, compartimentalize complexity
youre not making it disappear
>>
>>107770620
Jblow loves oop? I always thought he was a brainlet larping as a real dev.
>>
>>107771073
>liking oop means youre a genioos
*looks at webshitters*
errrr
no
>>
>>107770955
>take out some code, put it into a procedure and call it
This kind of factorization does not reduce complexity in any way; it is mere code deduplication. It doesn't solve the so-called problem.
>control flow with data processing intermingled
This expression describes every single computer program. In reality, some systems are more complex than others, and any attempt to factorize them further only leads to unnecessary complexity. Once you realize what the essence of the problem is, you also realize that there is no problem here. There is no need to chase the holy grail, the hard problem of consciousness, the natural law, etc. None of these things are real.
>>
>>107771088
JS is a thing of beauty. Stop pretending you don't love it to look cool in front of your fellow chuds.
>>
This religious discussion is annoying. Either provide empirical evidence supporting your cases or stop.
>>
>>107771148
nah it sucks
nothing compares to the raw industrial beauty of well formatted c code
just look at this thing
it looks like an electronic circuit.
or a large factory
>>
File: reallysuper.png (104 KB, 780x834)
104 KB
104 KB PNG
>>107771214
That's very cool, but that's nothing. Look at this.
>>
>>107771277
it looks perfectly nondescript to me
yeah, its code, sure
but its meh
you dont have masks
you dont define arrays
you dont have regularly shaped control flow

js looks slightly rounded organic, without being organic
and slightly angular without being angular either
its just nondescript. it doesnt have a visual personality

even debug code of a wip written in c is visually distinctive
>>
>>107771277
>2 console print calls blown up into 26 lines of code
So this is true the power of Object-Oriented Programming.
>>
https://web.archive.org/web/20251225091227/http://number-none.com/blow/john_carmack_on_inlined_code.html

Carmack already solved this discussion 20 years ago.
>>
>>107771483
>To sum up:
>If a function is only called from a single place, consider inlining it.
>If a function is called from multiple places, see if it is possible to arrange for the work to be done in a single place, perhaps with flags, and inline that.
>If there are multiple versions of a function, consider making a single function with more, possibly defaulted, parameters.
>If the work is close to purely functional, with few references to global state, try to make it completely functional.
>Try to use const on both parameters and functions when the function really must be used in multiple places.
>Minimize control flow complexity and "area under ifs", favoring consistent execution paths and times over "optimally" avoiding unnecessary work.
>>
>>107770747
going "WTF?" at a solution and judging code as messy are two completely different things
>>
>>107770862
>I was taught OOP from the first intro to programming course and throughout my entire education
the problem isn't OOP - it's teachers who can't program but teach programming
>>
>>107771483
>>107771506
that was boringly basic
and theres a couple things i disagree with
>>
>>107771533
Midwits teaching midwits. I'm including myself in those masses.
>>
>>107763388
looks like a convoluted way of implementing conway's game of life using an array of fixed size (64) bit arrays
is this ai generated? remove_run_at would should use u8 (or u6, if the language supports it) for n instead of u32
>>
>>107771506
>Minimize control flow complexity and "area under ifs", favoring consistent execution paths and times over "optimally" avoiding unnecessary work.
That one is especially important because compilers suck absolute ass at eliminating branches dependent on values that the compiler *already knows at compile time*. I fell for that once, then never again.
>>
>>107770362
based shitflinger
>>
>>107772014
this is exactly the manner of argument levelled at FP for decades incidentally
>I notice functional programmers don't have jobs
>>
>>107771984
>remove_run_at would should use u8 (or u6, if the language supports it) for n instead of u32
nocoder
>>
>>107771095
>it is mere code deduplication.
that's one way to reduce "software complexity", not the logical complexity of a program. Like I've said in the previous post. And like I've said, there is a certain amount of logic complexity you can't remove, but software complexity is not entirely about that alone, it's also about how everything is organized and split up.

The quantity of the total logical complexity of a program (basically the number of conditionals and loops and how much do they interdepend on each other) is independent of how the program is factored out. You're going to misinterpret everything I say if you can't make the distinction.
>It doesn't solve the so-called problem.
Which is? I've invited you to be more precise and specific but you ignore me. I can't help you if I don't understand what your problem is.
>This expression describes every single computer program.
Ok but is complex control flow and complex logic really is or isn't what you can't seem to factorize out more nicely?

There are some complex data structure out there and they do require conditionals everywhere but this doesn't exactly fit into what I'd call complex control flow. You can know in advanced what a complex data structure will look like if you know the value of a handful of the arguments. But there are some programs with complex control flow where many argument all interfere with each other and if the data transoformation done at the end is simple, good luck figuring out what exactly will be done.
>>
>>107772035
I HAVE a job.

Writing Java.
>>
>and if the data transoformation done at the end is simple
*even if
>>
>>107772426
>generics
>functional interfaces
>can encode rank 2 types
Java is functional (just ignore null)
>>
>>107770862
>OOP is an all-or-nothing global property of a program
lmao even
>>
>>107766708
Use Claude Opus. I just structure my software, write the fun lower level details, and then let Claude fill in the gaps for the boring and tedious stuff.
>>
>>107772670
post code or didnt happen
>>
>>107772670
I use Claude Opus Pro ($300 per month) for everything. I don't program my software, I speak softly into the microphone and let the cold machine do the work. I don't even write my own 4chan posts anymore — the web browser agent understands my orders perfectly. I command it: "claude, open the latest cunny thread on a blue board". It complies. I start edging. The world is under my control. Nothing can stop me now.

>>107770862
OOP is not a magic bullet, it won't help you in the general case. You might arrive at a few OOP-esque patterns during the natural process of programming, but don't delude yourself into the mindset of forcing everything through patterns and achieving any improvement from it. An interesting program cannot be decomposed into Martin Fowler patterns without paying major costs. Make sure your program is correct and fast, and the rest does not matter.
>>
File: Screenshot_20260105_1.png (116 KB, 825x923)
116 KB
116 KB PNG
is there a quicker way to do this?
>>
>>107772988
>OOP is not a magic bullet...
Yes, that's what I was getting at. But also that for me at least, the constant indoctrination with OOP became a harmful antipattern in itself.

>Make sure your program is correct and fast, and the rest does not matter.
I do not believe this entirely. A program if worthless if it doesn't work, but I'm sure readability, maintainability and extendability do matter.
>>
>>107773048
what does --ours do?
>>
>>107773048
can you not pass multiple paths
>>107773302
opposite merge strategy to --theirs
>>
>>107773312
>opposite merge strategy to --theirs
th-thanks...
>>
>>107773374
do you want your changes or their changes
>>
>>107773393
I don't even know who they are.
If I'm checking out a file I assumed I'd get the latest state of the file as it live in my currently checked out branch.
I don't think I've ever had cause to checkout a single file, let alone distinguish between ours and theirs.
>>
Today has been a bad mental day, but I forced myself to do a tiny bit of progress. Trivial stuff, but it won't stand in my way to do slightly more involved stuff that comes next.
>>
>>107773312
No i tried * already. git is so fucking annoying istg
>>
>>107773048
>>107774079
Running a command each time for a list of files? Use a shell for loop, or xargs?
>>
>>107769497
yes. is there anything wrong with that?
I didn't necessarily mean I'm sick of programming, I'm sick of current programming.
>AI TDD
that's a good start but not quite what I had in mind. both of those ideas are good though
>>
>>107770620
>John Carmack
he did a 1 hour talk on how much he enjoyed reading SICP and implementing Wolfenstein's engine in Haskell for fun, and said he wished he had created QuakeLisp instead of QuakeC. In fact he's the person who got me into FP with one of his articles on how to adopt core FP principles while writing in a procedural or OOP language.
>>
>>107772988
>don't delude yourself into the mindset of forcing everything through patterns
Never use patterns for the sake of using patterns (except in school when learning a particular pattern, which is a special case). That's dumb.
But patterns are way more general than OOP. They're a way of naming "common shapes of software", and discussing the advantages and disadvantages of them. Your language has patterns too, even if it has no objects at all.
>>
>>107772988
>Nothing can stop me now.
Sounds like it's time for a price rise.
>>
I'm making a tagging sytstem for my app but its kinda complex and hard to keep track of stuff

Say you have an item, which can have multiple tags.

A tag can have:
a primary tag (like the one it resolves to)
and tags it inherits (other tags that gets applied along with this tag)

but here is the complex bit, the above applies to all tags recursively...

So how would I make a system that does this efficently say you have 10000s of tags and with the rules above?

one way I've done it is keeping it simple, basically I just make a function that finds all a single tag inherits and primary then find those ones too recursively but its slow as hell

Making an index that is kept track of is complex and unreliable
>>
>>107774587
architectural fail
you keep only the primary tag
and all the additional information is attached to the information evoked by your primary tag.
problem solved
>>
>>107774700
yes that'll be simple and easy but that is not how it'll work

say you have tag1, tag2, tag3

tag1 primary is tag2, tag2 primary is tag3. I need to apply the rules (find all inherits + their primaries recursively) to each tag in the chain to make the tagging system consistent.
>>
>>107774740
>how not to make that slow
it will be inherently slow given how you treat your data
you could try to improve things by reading all/multiple tags at once into a read only buffer
and run id + data retrieval on each of your tags in parallel
>>
>>107774700
>>107774774
cont
and its not recursive btw
if you shove a recursive into this problem your dum.
its just that you need two tags to form your actual tag (kinda mentally ill to be honest)
is it a school exercice or something?
>>
>>107774774
a user clicks an item, then it needs to display the tags of that item like right now. I cannot use this in parallel because each tag resolution depends on its parents being resolved first

>>107774818
no I'm making an app with a dedicated tagging system of its own and running into this problem
>>
>>107774818
obviously I can make a massive multi tree index of all possibilities but that will be nightmare to maintain, and if something is amiss with a tag, then good luck troubleshooting it...
>>
>>107774849
redesign your system
youre working against the properties of the way you arranged your data
you aint winning that one
>>
>>107772247
>no reply
lol, what a larper
>>
>>107774864
complex != clever
youre implementing a human-like language and then expecting it to be fast
thats not clever
>>
>>107774864
btw
>if something is amiss with a tag, then good luck troubleshooting it...
what i presented you is how supermarkets do it, and warehouses do it
kindof.
a code-bar is a series of numbers
so a portion of the tags is contained within the tag/id number
like if it starts with 0- the product is, idk, a cheese. if its 1, its a household consumable etc
and then the rest of the number links to a database where the rest of the information lives

your solution isnt better in the slightest
>if i have to change some tags attached to an item, then i just change the tag of that item
and then you have to re-label everything you have in stock.
youre also slow
and you didnt solve the problem of havign to keep ones ducks in a row in the slightest because you still have to label your items
it makes more sense from a computational point of view to have an id number which then links to a "facts page" which contains all your labels
>>
>>107775068
as i've explained before because of how the tagging system works its very dynamic with changes to a tag primary or inheriting, so that concept wouldn't apply here

Supermarkets have a simple system so they can do easy lookups and the info will be there.

Right now to help I've kept a reverse index (tag to inherit tags and inherit tag to all tags that inherits from this tag) to make look up for efficent
>>
>>107775222
i told you
your tag system is inherently linear
there is no way to make it fast
>reddispacing
>autism
youre chubak, right?
>>
Do compilers unroll functions?
>>
>>107775222
the inheritance only needs to exist at query time
when you store the data, inheritance doesn't need to be a thing, except for the data you have that records which tag inherits from who
>>
>>107775254
functions get inlined, loops get unrolled
which one do you mean? functions do not get unrolled

depends on the compiler and more importantly the question then becomes when does and where does it happen
>>
>>107775257
what would even be the usecase for something like that?
>>
>>107775302
picture of a dog

tags:
doggo (primary will be dog, inherits of dog is animal, mammal, fur, eyes, nose, mouth and more)
>>
>>107775280
>>
>>107775302
>usecase
I'm talking about the implementation details you morron.
>>
>>107775351
Other anon is right: calling that inlining is much clearer than unrolling. Loops get unrolled.
>>
>>107775351
>I don't understand english.
Ok.
>>
>>107775338
throw the whole inheritance idea through the window
then go downstairs
and start stomping its head until its skull caves in

none of that needs to be built based on inheritance
this is mental illness

group your tags in mutually exclusive groups
these will be your value columns
fill with 0 the columns that dont apply, or if you dont use up all your columns
you will end up with long numbers

sort them like you would regular numbers
now retrieving your tags is just a matter of translating the number, one column at a time
and selecting tags is a matter of going to the adequate offset

oop way of thinking is braindamage
>>
>>107775381
There's no need to be rude.

>>107775376
I get it now. inlining is what I am thinking of.
>>
>>107775356
>doesnt know that the implementation depends on design constraints
you shouldnt call me a moron
you should call me dad
because ill fabricate you a little brother
>>
>>107775406
>and selecting tags is a matter of going to the adequate offset
tfu
selecting the items that share a collection of tags is a matter of going to the adequate offset
>>
>>107775411
Sorry, I'm sick of anons being thick.
>>
>>107775406
I know I can simplify it but doing it that way will make it less "good"

because now what if I have an fish with a mouth, nose, eyes but I'm unable to apply that group because a fish doesn't have fur and isn't an animal or mammal so now you've got duplication. so your database blows up and its not really scalable for the user once they've got like millions of tags to manage
>>
>>107775416
>>doesnt know that the implementation depends on design constraints
no shit, and yet I didn't introduce any new features.
"usecase?" is only relevant when it comes to features
>>
>>107775461
you dont get step 1
and then theres a setp 2-

step 1:
thats the trick of grouping your tags in groups whose members are mutually exclusive
oh, and theres one thing i thought you wuold figure out, you fill the columns starting with the biggest sets, and then you go in the order of "x contains y", or "z exists alongside y"

column 0 is implied, it is the superset of all your items.
theres only one of these, this information is implied

1st column is type of animal. because those are the sets contained directly within our superset
and because types of animal are mutually exclusive
you cannot have a mammal and a fish at the same time
so mammal is 0, fish is 1

2nd column will be whether it has skin or no (thats where the modifiers come into play, ill come back to them later)
3rd column is whether it has eyes. eyes are not a subset of skin, but theyre at the same level, so they can sit in pos.

and so you get
dog, with eyes, skin: 011
dog, with skin, and no eyes: 010
dog without skin and eyes: 001
etc

you sort the elements based on their id, you get:

001
001
001
001
010
010
010
010
011
011
011
011

and then finding the set of tags you need is just a matter of getting to the right offset

(1/2)
>>
>>107775467
the algos capabilities are the feature
and the algo is dependent on the way you'll arrange the data

now shutup, pseud

>>107775461
(2/2)
now step 2: tag conversion, and modifiers

you create translation lists depending on the types you create
we have 0-mammal
1-fish
so for the next column resolution you load a list based on your current value

if its 0 (mammal), then the next culnm shall be resolved as:
0- has no fur
1- has fur

if its 1 (fish)
then the next column will be resolved as:
0- no scales
1- yes scales

whenever you implement a new value, you implement the translation table for its children
>>
>>107775611
>a new value,
a new master type, rather
you can have these at arbitrary positions in your columns
you dont need to have a translation table for ALL your types, because then youre gonna have to build an exponential amount of them
youre only gonna need translation tables for master types, types that modify their children designations

mammal, or fish would be a master type bc thats what would trigger the selection of a translation table
its not the case for skin, or eyes, and so on down the line until you hit something that would require a new translation modifier

but dont ever try to replicate inheritance in a database unless youre strapped for space
its not "good"
in 99.9% of the cases its gonna be retarded
>>
>>107775672
>but dont ever try to replicate inheritance in a database unless youre strapped for space
*actual inheritance at the hardware level
simulate it like i outlined above
>>
>>107775611
>the algos capabilities are the feature
>and the algo is dependent on the way you'll arrange the data
>now shutup, pseud
Ok but you're still avoiding to give me an actual opinion to what I proposed. It's perfectly ok if you don't like it or if it doesn't fit with your project but at least say so, address it directly.
>>
File: angery.jpg (92 KB, 400x482)
92 KB
92 KB JPG
>review some old decimal printing code from a couple years ago
>see that the binary contains a DIV 10
>worry that I fucked up something somewhere
>panic
>look at source
>at no point do I force the compiler to not use MUL + SHR
>decide to read my comments
>"GCC decided to use DIV instead of MUL + SHR if we optimize for certain branches"
>"we leave it here because otherwise the fags will never fix it"
>they never fixed it anyway
>>
>>107775715
i did address it, how did you miss you miss it
>>107775571
>>107775611
>>107775672
>>107775684

and you were retarded for calling me a moron
because, like i said
your usecase defines the project constraints
which in turn dictate the solutions youre gonna be using
discussing imploementation without design constraints is a waste of time and a pseud thing to do

if you have only one item with tags
none of what is discussed above is relevant
you just write the tags in html and call it a day
>>
>>107775571
If I'm readinmg correctly if you have 20k+ tags you will end up with a gorilian tables in your db

because a tag can have unlimited combinations
>>
>>107775750
>i did address it, how did you miss you miss it
no you didn't. I'll post it again:

the inheritance only needs to exist at query time
>>
>>107775779
>>107775571
also if I wanted to have overlapping tags then I'd have another table? mmm
>>
>>107775779
i corrected it slightly later
you create a table only when you encounter a "master type"
a type that creates the need for a different translation table
give that at that point your dataset is ordered
deciding whether you have to change your table type is just a matter of knowing which offset youre at
yeah, its hard to track and update by hand
but youre a programmer, youre gonna write a routine for that
ordered db also helps with speed because you can use "bookmarks" to skip to notable places
which accelerates retrieval, insertion (insertion bc you dont want to reorder your dataset each time youre introducing an item)
>>
>>107775801
nope
bc you deal with your tags one at a time, and the columns are sorted by order of "contains"
so column 0 defines the sets that contain the tags in column 1 etc
so youre guaranteed to bump into a master type before the translation becomes relevant

if col 0 is fish/dog
thats where the master type that modifies the next column- scales/skin sits.
both skin and scales can have the same id, because the translation table will be updated before you resolve that information, when the first tag is resolved.

or you could just use your offset and immediately pull up the adequate translation table for all your tags
>>
>>107775798
thats exactly what i outlined
>>
>>107775245
how do i make it exponential?
>>
>>107775848
it is exponential allright
it is exponentially slow, kek

youre kinda fucking annoying to be honest
no means no.
>>
>>107775831
your scheme assume a tree strcuture from what I understand, but tag inheritance and primary is a graph type so the sort of way you're doing it isn't feasable because you have have circular loops, tag1 inherits tag2 which inherits tag3 which inheirts tag1 how can you express this in your tree structure?
>>
>>107775831
also how would I do something like
mammal > canine > dog
purpose > pet or working
training status
color
size

all in your tree
>>
>>107775844
You know, I was just trying to make a helpful suggestion to a problem you had.
Why would you post here if you reject suggestions with non sequiturs?

Either way you're trolling or retarded. Enjoy being mediocre at writing software. It's ok, it's not for everyone.
>>
>>107775831
also modifications done, like inserting a new sort of tag to one of the tree's, I'd need to now shift everything down over a column. recalculating all items below that
>>
>>107775903
its not a tree its an "array" (could be a linked list too. but logically- its an array)
focus, reread my posts bc youre a light year off from what i said

youre actually turning your tags into a numbers system
and your columns are not exponents, but they express the relation between the sets of elements defined by your tags
ordered by order of "contains" or "sits alongside" from the most significant column to the least significant one
>>
>>107775944
each row is a tree, yes it is
>>
Question for you guys, I always seem to get stuck at the same point. I did some basic C++ in college and some java on my own. I've learned the basics like variables, formulas stuff like that. But idk where to go here. Like how do I move from cmd programs to making things with actual interfaces? I don't even know where to start with it.
>>
>>107775937
im not that guy you seething retard
learn to read a reply chain

>>107775939
again, its not a tree
i feel blessed that i never studied data structures because it seems that all it gives you is "everything is a nail" syndrome

its not a tree its something quite abstract
and quite smart because you encode part of the data positionally, at no memory cost whatsoever
>>
>>107775959
nope. yeah. maybe.
each row is a row
it has the properties of an array
it can be interpreted as a tree, but why?

think of these like the values of an ip address
>>
>>107775979
>I'm just an idiotic troll
Noted.
>>
>>107775979
>you encode part of the data positionally
part of the *information (that contains your tag. namely- the relation between your tags, effectively making, yeah, something of a tree. but a tree which has the properties of an array because you also have access to an offset. 2 offsets actually, the tag in its underlying form being one, and the whole list being an array, the absolute offset being another. pretty powerful stuff when one learns to leverage it. again, information without using memory)
>>
>>107775972
Top-down: use some library, like Dear ImGui, Qt, SDL, or even just Winapi.
Bottom-up: learn about the user/kernel boundary, why you cannot implement this shit yourself, and why you'll rely on at least some external code.
>>
>>107776063
yeye, whatever, fuck off, reddit
lamao
>>
>>107776085
>look at I'm still trolling
Ok troll retard.
>>
>>107775972
ncurses
GUIs are for video games.
>>
>>107776076
>you cannot implement this shit yourself
Why not? Someone had to have done it. Multiple times, from your list of libraries. Why not him?
>>
>>107776095
you wanted to shine
youre dumb, you cant follow
ok, this happens to the best and god witness none of us are amongst them

but dont flame. im not in the mood for your mentally retarded shit
pass the exchange to chat gepetto, ask it to explain things to you
because im not in the mood to spoonfeed you either
>>
>>107776111
>learn about the user/kernel boundary
>>
>>107776123
Nah. If you were smarter than me you wouldn't have replied with non sequiturs.
>>
>>107775406
imagine being so filtered by OOP that you immediately associate any keyword with it and start seething about it
inheriting structures are not an exclusive to OOP, or even to programming

>>107774587
>a primary tag (like the one it resolves to)
>and tags it inherits (other tags that gets applied along with this tag)
this seems ass-backwards. you should assign leaf tags to your entities, not root tags
>>
>>107776322
thast where it comes from in this case, im 99.9% sure of it
why are you seething? are you jelly?
bc im not against oop, i even used it in my c code when at school, and i was overwhelmed by the complexity of what i was writing (a wqolf 3d clone)
that was 300 klocs ago tho...

no, what im against is "everything is a nail" syndrome
which i think is the root cause for trying to shoehorn inheritance into a database
>>
>>107775972
if you already have the basics, start looking for a problem to solve. then research and learn about each bit that's blocking you from solving the problem
eg. if you need to transform some images, look up how to load and transform images
>>
(in this case at least)
>>
>>107776441
>no, what im against is "everything is a nail" syndrome
>which i think is the root cause for trying to shoehorn inheritance into a database
what you're doing is going too hard the other way, ie. "do not use hammers at all because nothing is a nail"

again, inheritance is not even something specific to programming or object orientation - it can be purely a data model shape
like if you want to build an inventory catalog for parts, you would use inheritance to find electronic parts -> passive components -> capacitors > 6.3V 1500uF
or if you want to implement cascading access permissions, again you would use inheritance, ie. domain -> subdomain -> sub-subdomain -> user permissions

it could be a purely procedural program using such a structure. even if it were an object-oriented program, it would not model each single entity as a separate class (that's not how you use OOP)
>>
>>107776560
>again, inheritance is not even something specific to programming or object orientation - it can be purely a data model shape
yeah, i get it. but in this case it comes from an oop-centered training, im sure of it
and then this frame of thinking limited the other anon to substandard solutions. i think its only a marginally useful frame of reference, it lacks granularity
like here: my solution could be reformulated as a form of inheritance but this way of thinking skips all the subtelties of my approach
the fact that my data structure has the traits of a tree and an array, AND an inheritance enabling structure

>what you're doing is going too hard the other way, ie. "do not use hammers at all because nothing is a nail"
no, what im doing is starting with a blank page, and tailoring the solution to the problem, and its associated constraints
>>
>>107776639
it's not a blank page if you start off with assumptions and prejudices
you're immediately dismissing a part of the problem's description because you want to stay way from a certain implementation that badly
that's as far as "tailoring a solution to the problem" as you can get without just outright ignoring the whole problem
>>
>>107776695
>ignoring the problem
by giving a solution to it?
are you the other flaming mental retard again?
i think i already told you to fuck off im not in the mood for your pseud shit
+ youre shitting up /dpt/, and these are hallowed grounds, disrespectful faggot
>>
>>107774587
The whole thread is trolling you with terrible advice. Forget about it. Here is a much better, simpler, efficient solution. Figure out the cardinality of your data. I assume you have more items than primary tags, and more tags than primary tags. These are your two tables:
- (primary tag, item)
- (primary tag, tag)
Store this data in sorted arrays and query with linear search or binary search. That's it.
If you have tremendous amounts of data, then you may want to optimize the data structure a bit. Store each column in a separate contiguous file. Break up the data into logical blocks, say 64k rows per block, and then store a separate index file for each table with offsets to be able to jump into the middle of the file and scan less blocks.
If the data is correctly sorted by cardinality, you can easily compress and decompress these columns on the fly.
>>
>>107779804
>>107779804
>>107779804
>>107779804



[Advertise on 4chan]

Delete Post: [File Only] Style:
[Disable Mobile View / Use Desktop Site]

[Enable Mobile View / Use Mobile Site]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.