/dpt/ - Daily Programming Thread
Anonymous 01/18/25(Sat)13:01:51 | 320 comments | 44 images | 🔒 Locked
1717774844497624
What are you working on, /g/?

Previous: >>103889974
Anonymous 01/18/25(Sat)13:05:15 No.103945082
First for
Nobody cares schizo kys
Anonymous 01/18/25(Sat)13:06:03 No.103945099
primer_malloc_3
>implying I need your permission to post anything
You sound so dumb that killing you off would improve the national average IQ by 30.
Anonymous 01/18/25(Sat)13:15:25 No.103945188
>>103945099
you should try getting a job and doing something useful to somebody instead of masturbating for free
Anonymous 01/18/25(Sat)13:17:04 No.103945206
I do both.
Anonymous 01/18/25(Sat)13:18:53 No.103945228
Anonymous 01/18/25(Sat)13:21:37 No.103945258
>>103945238
And you care ... why?
Anonymous 01/18/25(Sat)13:23:11 No.103945275
1717372094167233
>>103945238
>you will never be a MIT undergrad in the 80s
Anonymous 01/18/25(Sat)13:25:09 No.103945309
>>103945275
And thank fuck for that. That's where X11 came from.
Anonymous 01/18/25(Sat)13:28:24 No.103945355
>>103945309
X11 is not that bad
Anonymous 01/18/25(Sat)13:30:34 No.103945384
>>103945355
Yes it is.
>t. wrote my own X11 library a couple years ago
Anonymous 01/18/25(Sat)13:30:53 No.103945388
941bf8b3ae387dcebd9a418dd09f9d44
updated the extractor of my desktop youtube client
it caches some tokens so it makes less network requests than yt-dlp
Anonymous 01/18/25(Sat)13:32:25 No.103945412
>>103945384
No it's not
>t. wrote my own fully featured X11 window manager a couple years ago
Anonymous 01/18/25(Sat)13:33:34 No.103945427
>>103945412
Yes it is.
>t. don't care about your autism that makes you write shitty code without being disgusted by it
Anonymous 01/18/25(Sat)13:36:20 No.103945476
How do I get into programming?
Anonymous 01/18/25(Sat)13:36:35 No.103945481
>>103945275
in J this is just
expt =: 1:`{{y*expt y-1}}@.*
Anonymous 01/18/25(Sat)13:38:09 No.103945495
>>103945427
>ad hominem
x11 is pretty shit thougheverbeit
Anonymous 01/18/25(Sat)13:40:16 No.103945522
>>103945495
Sorry, but if you're not disgusted by the code that X11 forces you to write, then there's something fundamentally wrong with your brain, simple as.
Anonymous 01/18/25(Sat)13:47:25 No.103945598
>>103945522
i feel disgusted by most GUI code so i just don't think it's fair to single out X here. at least making a WM is easy
Anonymous 01/18/25(Sat)13:49:20 No.103945616
>>103945598
>i just don't think it's fair to single out X here
From my perspective X is a fundamental part of software infrastructure. Fucking it up is like fucking up file system code to me.
Anonymous 01/18/25(Sat)13:53:12 No.103945662
>>103945099
Peak midwittery.
If you wanna get optimal software, how about getting rid of the retarded kernel <-> user mode seperation and virtual memory alltogether.
Anonymous 01/18/25(Sat)13:53:45 No.103945666
>>103945616
>X is a fundamental part of software infrastructure
What do you think of Wayland then?
Anonymous 01/18/25(Sat)14:00:33 No.103945734
>>103945666
The same thing I think about audio servers: why the fuck do we need to communicate with a piece of software through the kernel that ends up offloading everything back to the kernel again? As long as Wayland operates in userspace it's about as much a stillbirth as pulseaudio or pipewire are.

And yes, that also means that I prefer ALSA.
Anonymous 01/18/25(Sat)14:06:22 No.103945787
c583e699f442096eabc2dbddc7696849
>>103945734
x11 is still userspace
you shouldn't be using a window server at all, just use fbdev or drm directly
Anonymous 01/18/25(Sat)14:07:58 No.103945802
>>103945662
That's easy: just run everything in Ring 0.
Anonymous 01/18/25(Sat)14:09:12 No.103945820
>>103945787
>x11 is still userspace
Yeah, and I already said it was garbage. So what do you want from me?
Anonymous 01/18/25(Sat)14:16:22 No.103945888
>>103945820
it can't be "a fundamental part of software infrastructure"
everything other than the kernel interface is unneeded, and that includes libasound/user space alsa
Anonymous 01/18/25(Sat)14:17:42 No.103945905
>>103945888
Sure it can. Why don't you ask some normies if they'd be willing to use a system via CLI - if you can stand being laughed out of the room, that is?
Anonymous 01/18/25(Sat)14:29:08 No.103946041
>>103945476
Press F12. Your browser displays developer's tools. Type Javascript into the console.
> 1 + 1
> title = (s) => s[0].toUpperCase() + s.slice(1)
> 'fucka you'.split(' ').map(title)
Anonymous 01/18/25(Sat)14:31:22 No.103946067
>>103945476
bash your head against a rock
Anonymous 01/18/25(Sat)14:32:16 No.103946076
>>103945905
>normies if they'd be willing to use a system via CLI
yes, chatgpt is a cli
Anonymous 01/18/25(Sat)14:38:00 No.103946138
>>103946067
How many times? What kind of rock? What size?
Anonymous 01/18/25(Sat)14:41:33 No.103946182
>>103945905
>Hello Steve, would you use your computer via CLI?
>what's a CLI
>Ok, would you use your system via a black box that outputs small white letters only?
>what's a system
Anonymous 01/18/25(Sat)14:42:12 No.103946186
>>103946138
idk something about a tool in a toolbelt or a hammer and a nail
Anonymous 01/18/25(Sat)14:53:25 No.103946323
>>103946076
>>Can you close my browser, ChatGPT?
>No.
Anonymous 01/18/25(Sat)15:02:36 No.103946426
Listen to my design for a new programming language:
https://taoistchina.bandcamp.com/track/elysian-a-scheme-to-python-bridge-language
Anonymous 01/18/25(Sat)15:04:55 No.103946442
>>103946426
>cookies
no
Anonymous 01/18/25(Sat)15:23:26 No.103946587
>>103946426
>scheme to python
imagine the performance
1 minute to tilt the MIT robot
Anonymous 01/18/25(Sat)15:33:27 No.103946663
6c23001c-0515-488f-b257-49388c791b64
>>103946587
YOU THINK THIS IS A MOTHERFUCKING GAME?
Anonymous 01/18/25(Sat)15:57:08 No.103946897
51EyaJeebHL._AC_SL1500_
I want to buy this but I heard you need some knowledge with algorithms, architecture and data structures because this is not a beginner's book. Is that true?
Anonymous 01/18/25(Sat)15:58:42 No.103946916
1735135923797006
>>103945388
When I saw the volume of traffic with yt-dlp --verbose I got demoralized so that must've taken a lot of patience anon
Anonymous 01/18/25(Sat)16:01:11 No.103946949
>>103946897
It's not a retard proof book but you don't need a CS education to read it.
It's meant for programmers.
Anonymous 01/18/25(Sat)16:19:37 No.103947136
>>103946949
can i be considered a programmer if i only know python and javascript?
Anonymous 01/18/25(Sat)16:21:18 No.103947152
>>103947136
Yes, the book expects you to understand what assignment, variables, for, while, i++, and brackets are. All the basic bitch programming constructs.
Anonymous 01/18/25(Sat)17:21:26 No.103947700
in sepples (yes i know), is it possible to write a class definition that ensures the first four or so bytes of a class are a sort of class-ID int? for example, if a method receives a voidptr to a class that is known to contain an ID, it can cast it as a 32-bit int to check what kind of class it is?
Anonymous 01/18/25(Sat)17:29:02 No.103947793
>>103946897
outdated
Anonymous 01/18/25(Sat)17:31:32 No.103947821
>>103947700
struct {
int32_t id;
base* data;
};
Anonymous 01/18/25(Sat)17:33:36 No.103947839
>>103947821
yea, i was hoping to avoid that solution because i thought it would be too verbose but its not actually that bad now that im looking at it.
thanks fren <3
Anonymous 01/18/25(Sat)17:36:04 No.103947867
>>103947839
>fren
kys
Anonymous 01/18/25(Sat)17:41:21 No.103947919
>>103947867
just for that, im doing it like this instead
int *ptr;
MyClass *myClass;
ptr = (int *)malloc(sizeof(MyClass) + 4);
*ptr = CLASS_ID;
myClass = (MyClass *)(ptr + 4);
Anonymous 01/18/25(Sat)17:43:28 No.103947941
>>103947700
Isn't that singular inheritance? Which is equivalent to >>103947821
Anonymous 01/18/25(Sat)17:44:59 No.103947963
>>103947941
>Isn't that singular inheritance?
is the memory layout of an child class guaranteed?
Anonymous 01/18/25(Sat)17:48:51 No.103948010
>>103947963
I don't know, I'm skeptical of saying any layout is guaranteed with sepples unforunately
Anonymous 01/18/25(Sat)17:53:37 No.103948062
>>103948010
same, which is why im more partial to my cursed malloc-pointer-arithmetic combo solution.
on that note, i believe when malloc is called, the size of the allocated memory is stored in some number of bytes beneath the memory itself. as long as i make sure not to call free() before backing the pointer up 4 bytes, do you know if thats going to cause any issues?
Anonymous 01/18/25(Sat)18:18:34 No.103948337
>>103948062
>do you know if thats going to cause any issues?
I can't think of any (like across page boundaries or anything), bu this seems like a good question for our resident malloc schizophrenic. Hopefully he'll see it
Anonymous 01/18/25(Sat)18:19:20 No.103948344
>>103948337
i dont frequent /dpt/, im excited to meet him.
Anonymous 01/18/25(Sat)18:19:22 No.103948345
>>103948062
Depends on the implementation, but malloc usually scans its free memory for matching blocks, and does so by reading block information that you've likely tampered with. And Sepples is such a clusterfuck that sneezing and peeing can trigger an allocation.
Anonymous 01/18/25(Sat)18:40:14 No.103948534
i found a really cool easing algorithm a few months ago but forgot its name, it was something like femboy easing or catboy easing or something like that, anyone know what i'm talking about?
Anonymous 01/18/25(Sat)19:14:34 No.103948886
>>103948534
found it https://mastodon.social/@acegikmo/111931613710775864
Anonymous 01/18/25(Sat)20:12:09 No.103949410
Why are linear types so underrated, bros?
Anonymous 01/18/25(Sat)20:31:35 No.103949583
>>103946426
https://hylang.org/

https://github.com/basilisp-lang/basilisp?tab=readme-ov-file
Anonymous 01/18/25(Sat)20:48:06 No.103949778
>>103949410
Pain in the ass to implement.
Infects signatures.
Can't have exceptions.
Still have to manually call free.
RAII with extra steps.
Anonymous 01/18/25(Sat)21:06:01 No.103949944
>>103949583
>>103946587
Listen to my remarks on compilation and execution:
https://taoistchina.bandcamp.com/track/the-gears-of-program-execution
Listen to my clarification of data types:
https://taoistchina.bandcamp.com/track/the-inoperable-variant-type
Note: object type can be tested using the "is a" operator as follows
OBJECT is a TYPE

this expression evaluates to a boolean value.
Anonymous 01/18/25(Sat)21:21:49 No.103950088
>>103949944
Can't you do something useful, like explaining to the dumb masses why Intel's fuckups caused video games to be relegated to the DOS real-mode domain for so long?
Anonymous 01/18/25(Sat)21:22:34 No.103950100
>arena/stack allocator for fixed size objects with known lifetime, 64KB blocks
>arena/stack allocator for growing objects with short lifetime or if not expected to grow a lot
>use a 2nd temporary stack allocator if data structure A of unknown size is required to produce data structure B where B outlives A
>binned allocator for the other growing objects <= 8192, 4KB blocks for each bin, no coalescing, (first-fit) LIFO
>mmap/munmap for allocations > 8192
>mark/sweep precise GC for data structures whose elements have an unknown lifetime, first-first LIFO for fixed size objects, binned allocator for growing object, mmap/munmap for big objects
>have basic data structures (strings, dynamic arrays, hash tables) use one (or two) pointer to an alloctor struct (void pointer, alloc, realloc, free function pointers), use specific allocators with static function calls otherwise
>pass allocator/arena for output data structure and for scratch
is this the ultimate allocation scheme?
Anonymous 01/18/25(Sat)21:40:33 No.103950270
>>103950088
I want you to see the usefulness of eliminating the ambiguity that polymorphism breeds. When you eliminate runtime dispatch on type, you also eliminate ambiguity in method invocation; in other words, you know exactly what routine will be invoked because you know the type of every variable. This decreases programmer mental load. By adding an inoperable / opaque variant type, generic container objects (such as a list) can store any object, but items can only be operated upon once stored to a variable with declared type equal to the object's type. This is made possible by adding a redundant Python style type + reference count header for the data for each object stored in core memory (although this is not redundant type information when the object is stored to a variable of variant type).
Anonymous 01/18/25(Sat)21:42:55 No.103950291
>>103950270
What does any of that have to do with execution speed?
Anonymous 01/18/25(Sat)21:48:45 No.103950332
>>103949944
You can have program introspection when compiling to C, see any CL implementation.
C is not strongly typed.
Python stores the type of every object which is why it can generate type errors.
Dynamic languages HAVE to store the types because they need to know the size and structure of things to do operations, where static languages can do type erasure.
"The Inoperable Variant Type" is just Java's Object and needing to cast them after doing instanceof. Even Javascript got it.
Anonymous 01/18/25(Sat)22:07:49 No.103950486
So you don't know how and why Intel fucked it up. Good to know.
Anonymous 01/18/25(Sat)22:21:47 No.103950612
Anonymous 01/18/25(Sat)22:28:48 No.103950667
>>103950332
in both Java and C++, you can write
object.method()

and, in general, the programmer who reads you code will not be able to determine which method is invoked (because both languages support object type polymorphism)
I'm describing a programming language where there is no ambiguity as to which method is invoked in the mind of the programmer who reads the source code.
It enforces a discipline that reduces program complexity and mental load when reading source code.
Anonymous 01/18/25(Sat)22:28:53 No.103950668
>>103950612
Wrong. The problems began much, much earlier.
Anonymous 01/18/25(Sat)22:53:38 No.103950881
>>103950291
- compiling to C generates faster code than virtual machine bytecode execution because time spent on opcode dispatch is eliminated
- eliminating dynamic dispatch / object type polymorphism means the identity of the method or routine invoked is known at compile time, so if the code is compiled to C, then invocations can be compiled to invocations, eliminating time spent on dynamic dispatch, and furthermore, the C compiler can apply extra optimizations when the identity of invoked routine is known at compile time
Anonymous 01/18/25(Sat)22:53:54 No.103950882
>>103950667
Ok, so you're ditching inheritance then. Problem solved.
Anonymous 01/18/25(Sat)23:01:31 No.103950948
1710805070857640
Is there anything better than Clean Code?
Anonymous 01/18/25(Sat)23:07:38 No.103950998
>>103950881
You forgot to mention branch prediction. If the targets to calls or jumps are known beforehand the CPU can prefetch instructions.
Anonymous 01/18/25(Sat)23:07:57 No.103951002
Anonymous 01/18/25(Sat)23:10:35 No.103951022
>>103950948
>pic
now THATS what i call trannycore
Anonymous 01/18/25(Sat)23:12:15 No.103951036
>>103950882
Yes. The idea is to borrow Python's package and module system, but eliminate the object model, so the class is just a leaf node in the code organizational tree. In other words, a class is really a file associated with a variable's declared type, and aside from looking up method identity by type (which can be computed at compile time) it provides no extra capability or functionality, so a class is just a namespace.
Anonymous 01/18/25(Sat)23:14:53 No.103951062
>>103951022
Is it? I'm definitely not a tranny.
Anonymous 01/18/25(Sat)23:15:54 No.103951079
>>103951002
That's a good point. Thanks.
Anonymous 01/18/25(Sat)23:18:08 No.103951106
>>103951062
yea. the pastel colors, cute and girlish pseudo-chibi, lolita fashion. its like textbook tranny.
but thats okay anon, i like cute things too, its just good to be aware of these things.
Anonymous 01/18/25(Sat)23:19:24 No.103951125
1718925346925166
>>103951106
Is this better?
Anonymous 01/18/25(Sat)23:21:37 No.103951144
>>103951125
dont get me in trouble by replying to me with porn, this isnt even my usual board.
Anonymous 01/18/25(Sat)23:25:36 No.103951182
how do i make files that aren't really files on disk but an interface to a program? And can you do that on windows or only on linux
Anonymous 01/18/25(Sat)23:27:52 No.103951193
rings_blue
>>103951106
>pastel colors
I always thought it was some sort of weird appropriation of the only colors tritanopes (falsely thought to be the only colorblindness that affects biologic women) can perceive.
Anonymous 01/18/25(Sat)23:28:33 No.103951195
why wont lazyvim work on openbsd tell me now. something with fzf. DAMMIT. FUCK.
Anonymous 01/18/25(Sat)23:29:33 No.103951205
>>103951182
You may want to learn about NT namespaces:
https://learn.microsoft.com/en-us/windows/win32/fileio/naming-a-file#namespaces
https://learn.microsoft.com/en-us/windows/win32/api/winternl/nf-winternl-ntcreatefile
Anonymous 01/18/25(Sat)23:30:31 No.103951215
file
>>103951193
>trannies appropriating female colorblindness
Anonymous 01/18/25(Sat)23:30:53 No.103951219
>>103951205
Are you the resident NT expert?
Anonymous 01/18/25(Sat)23:31:53 No.103951230
>>103951219
I wouldn't call myself an expert, but I do know a thing or two about NT.
Anonymous 01/18/25(Sat)23:31:54 No.103951231
>>103951144
Do you like them damp and humid?
Anonymous 01/18/25(Sat)23:36:41 No.103951276
02
>>103951215
It's a strange coincidence alright. Most males suffer from red/green colorblindnesses because the gen responsible for faulty receptor sensitivity is encoded on the X chromosome. Biological females have two of them, so if their X chromosome is junk they usually have a second one with the correct sensitivities (even though it's possible to have two junk X chromosomes as well, and these women are red/green colorblind as well). Biological males only have one X chromosome and are thus fucked.
Anonymous 01/18/25(Sat)23:48:05 No.103951366
file
>>103951276
i always though the reason for colorblindness mostly being found in males was because of a mutation in the Y chromosome, i wasnt aware it was actually a fucked X chromosome and females could just use a back-up gene. interesting.
>It's a strange coincidence alright.
quite.
Anonymous 01/19/25(Sun)00:22:29 No.103951623
1724262157444038
ahhhh i love dunning krugering myself into thinking i can build an idea i had then at every step of the way it's infinitely harder than i expected and just feeling like a total retard
Anonymous 01/19/25(Sun)00:24:38 No.103951643
>>103951623
>I could rewrite this project, it's going to take me one day with the source code, maybe a weekend
>said three weeks ago
MANY such cases
Anonymous 01/19/25(Sun)01:07:02 No.103951962
>>103951623
That's just how you improve. Keep at it and you'll get it eventually.
Anonymous 01/19/25(Sun)02:18:32 No.103952495
Trying to think of a cool project to put on my github to do with AI that doesn't seem like the super basic undergrad stuff
Anonymous 01/19/25(Sun)02:23:48 No.103952534
>>103945044
Programming chads. If you're making a parser in language where you manage memory how would you store the state of the ast? In the functional language's I normally use I don't have to worry about the values disappearing underneath me but I understand anything I made in a stack frame will be dropped if not returned and stored somewhere. At the moment I'm just whacking everything into a dynamic array which in turn is held inside a struct and then freeing that memory when I'm done with it. Is this acceptable or is it a dogshit way of doing things?
Anonymous 01/19/25(Sun)02:32:42 No.103952572
>>103950948
clean code is bad for performance though if you religiously follow the principles, just don't write the same things several times and make your code readable.
Anonymous 01/19/25(Sun)02:35:31 No.103952584
>>103950948
Simple code. Correct code. Small code. Fast code. Terse code. Literally anything that isn't "clean" code.
Anonymous 01/19/25(Sun)02:56:34 No.103952682
Screenshot 2025-01-19 105616
ok to do this when profiling?
Anonymous 01/19/25(Sun)03:20:18 No.103952814
>>103952534
In a struct containing a pointer to the original string and its length, the current position pointer, the pointer pointing to the byte just after the end of the input string (for fast bounds checking). The struct also contains a pointer to an arena/stack allocator where you put you ast. Each function returns NULL or a pointer to the parsed ast.
Anonymous 01/19/25(Sun)03:25:06 No.103952831
going back to C after fucking around with zig/odin
there's no point to them
Anonymous 01/19/25(Sun)03:33:39 No.103952880
>>103952814
ty bossman
Anonymous 01/19/25(Sun)03:47:56 No.103952962
>>103951106
>its like textbook tranny
that's horrible, why would anyone allow trannies to ruin something so cute and appropriate it? (like with the rainbow)
Anonymous 01/19/25(Sun)04:31:37 No.103953234
>>103952584
>Simple code.
clean code enhances this
>Correct code.
clean code enhances this
>Small code.
clean code enhances this
>Fast code.
hurts correctness, also clean code does not oppose this
>Terse code.
hurts readability

>>103952572
>if you religiously follow the principles
you're not meant to
>just don't write the same things several times and make your code readable
yes, that's the gist of clean code

>clean code is bad for performance
for the intended kind of codebase of the book, the performance losses would be insignificant with how many layers of abstraction and reflection you already have in your typical enterprise software
Anonymous 01/19/25(Sun)04:45:15 No.103953318
AHHHH
It's upsetting that Bjarne puts the opening brace on a new line.
Anonymous 01/19/25(Sun)04:49:11 No.103953340
1720375111998376
>>103953318
nothing phases me anymore after seeing gnu's weird ass formatting
Anonymous 01/19/25(Sun)04:49:14 No.103953341
>>103953318
too much clutter, you can't read the function name with a glance
void some_function() {
double d = 2.2;
int i = 7;
d = d+1;
Anonymous 01/19/25(Sun)06:13:05 No.103953828
>>103949778
>Can't have exceptions.
Par
Anonymous 01/19/25(Sun)08:38:17 No.103954736
>>103952572
Really? Thanks.
Anonymous 01/19/25(Sun)08:39:26 No.103954743
iou_ring is only useful for parallelizable workloads, isn't it? You can't tell the kernel to open a file, read some data into a given buffer, and then close the file again, right?
Anonymous 01/19/25(Sun)09:35:28 No.103955167
>>103954743
io_uring could be used here, but why not just use a read on a file opened with O_NONBLOCK? The read can be non-blocking, but you have to explicitly open and close the file synchronously, there is no way to do that via io_uring.
Anonymous 01/19/25(Sun)09:39:47 No.103955205
Does anybody here use Kotlin in production, outside of Android apps? I find Kotlin to be a really pleasant language, but I don't see a lot of people using it outside of Android. I'm kind of torn between Kotlin and C#. I just want a capable statically typed language based on JVM/CLR which isn't propped up by a big corpo...
Anonymous 01/19/25(Sun)09:47:54 No.103955266
>>103945044
I haven't seen that thread image in 10 years
Anonymous 01/19/25(Sun)09:50:09 No.103955279
>>103955167
>why not just use a read on a file opened with O_NONBLOCK
Because that introduces mode switches.
>those are not expensive
They are if you do it to 10,000 files. The ideal would be that the kernel opens those 10,000 files, reads whichever files are ready first, and closes them without dropping to userspace once. In the time that one read and one close are finished two more files may have been opened already, so the kernel reads and closes these, during which four more files become ready.
Anonymous 01/19/25(Sun)10:00:24 No.103955373
>>103955279
I'm not sure if you can have 10000 file descriptors for one process in the first place. I really cannot find any way to open a file without mode switches, because it just doesn't make sense. You could solve this with a pool of threads or processes which deal with opening and closing the files
Anonymous 01/19/25(Sun)10:05:58 No.103955431
>>103955373
>I'm not sure if you can have 10000 file descriptors for one process in the first place
You can raise the limits: https://stackoverflow.com/questions/3734932/max-open-files-for-working-process
And considering how stupidly parallel NVMes are you want to raise it on modern hardware too. The preexisting limits are likely only there for people who run Linux on literal toasters.

>You could solve this with a pool of threads or processes
Sure, turn simple mode switches into expensive context switches. That sounds like a good idea.
Anonymous 01/19/25(Sun)10:50:02 No.103955867
>>103955431
>turn simple mode switches into expensive context switches
Feel free to prove me wrong with concrete numbers, but I would guess that opening a file takes 10x as much time as a context switch.
Anonymous 01/19/25(Sun)10:54:24 No.103955895
I'm watching the cherno's C++ tutorial and at some point he refers to what's in the main function as client side and what's outside of it as being the API. Did I get that right? Is what's in main what would be part of the client because it's "the executing block"? My understanding of client-server is from a networking perspective where it's about communication, which is also why referring to part of it as API was confusing
Anonymous 01/19/25(Sun)11:02:46 No.103955953
>>103955895
it's just jargon, and just a lens to view code through. Communication happens with any function call: there are arguments into the function, and a return. With mutating state and repeated calls you can have continuous communication. You can also model communication across a network with function calls, and people have with RPCs and network objects. "API" also is a word that fits a particular library's exposed symbols and a microservice's handled HTTP endpoints, and isn't that dissimilar from the JS world's obsession with frameworks.
Don't take any of this stuff as that important. It's jargon. Focus on what really happens.
Anonymous 01/19/25(Sun)11:13:56 No.103956047
>>103955895
When you are a library author you publish code bundles without a main function. You are a provider and the downloading user is a customer.
It's the exact meaning behind client-server.
Networking didn't invent client-server, the concept comes from retail where you have the restaurant server serving food to you, the client.
Anonymous 01/19/25(Sun)11:18:24 No.103956089
working on a script to automate much of my video editing routines in a bit

one of the things i need it to do is automatically cut out parts of a video with a specific sound to a file preferably with a option to add a offset to start/end pos. there may be other sounds mixed in too so some sort of tolerance variable would probably need to be implemented.

is there an existing (cli or source code available) solution for this i'm unaware of or should i go with writing it myself? i'm not a good programmer, so anything i write is going to be dogshit and take forever to get even functional.

if there isn't a existing solution i intend to convert the video to bitmap sequence and convert that into a array with md5 hash and avg greyscale color, the audio to raw 44khz binary, then matching the audio to a array with the target audio and doing a check to see how similar it is and apply a threshold (say 90%) to determine whether or not it matches. after that i'll then add the start/end frames' md5/avg and the audio to another array for reconstruction.
Anonymous 01/19/25(Sun)11:19:28 No.103956098
>>103955867
10K - 1M cycles for full context switch (all over the place because the real costs of a context switch comes from cache invalidations), 44K - 1M cycles for opening files (with a heavy bias towards the <100K mark). Naturally that doesn't include potential locking costs, like when two different threads are attempting to talk to the I/O controller at the same time.
Anonymous 01/19/25(Sun)11:31:09 No.103956202
>>103956089
nevermind just found one that should work with a bit of effort, jumpcutter
Anonymous 01/19/25(Sun)11:34:41 No.103956243
taocp
>>103955266
It was last posted 2024-06-07, it just has a different hash (rhuLvpBWUbGSfv3-h_W5iA) after being optimized
Anonymous 01/19/25(Sun)11:34:52 No.103956246
>>103956202
nevermind that nevermind, turns out its not gonna work either
Anonymous 01/19/25(Sun)11:48:27 No.103956373
1731635539187898
>>103956089
You're basically scanning for a matching waveform +/- some epsilon. I think pcm audio is represented as a sequence of integers, so finding a match could be as simple as 2 for loops. For an exact match you could literally use strnstr or memmem
Anonymous 01/19/25(Sun)12:51:39 No.103957040
>>103951036
Here are some key facts about the Elysian semi-dynamic programming language
- static / declared variable type plus variant type named
var
- built-in container types: list, dict, tuple, set, frozenset
- items in a container have variant type
- objects stored in variant variables are inoperable (like Java's Object)
and must be stored to variable with declared type equalto the object's type
- no class inheritance, dynamic dispatch, or method overriding means the
identity of each routine or method invoked is known at compile time (it is
a function of variable's declared type and method name)
- borrows Python's package, module, and class code organization system
- no nested scopes: the valid scopes are local variable, global variable,
global constant (for routines and classes), and built-in constants
(for container types and primitive routines)
- it is possible to test the type of an object stored in a variant
variable with the "is a" operator, yielding a boolean value, spelled
OBJECT is a TYPE

- object type is checked when it is stored to a varible with specific
(non-variant) type from a variant variable, and if the types don't match,
then a TypeError error aborts the process
- call stack backtrace is printed when an error aborts the process
- no raising or catching exceptions, no "try" blocks, an error means
abort / sudden process death
- three run modes:
-- execute AST's directly
-- compile to VM bytecodes
-- compile to C
Anonymous 01/19/25(Sun)13:29:15 No.103957531
>>103955205
>I just want a capable statically typed language based on JVM/CLR which isn't propped up by a big corpo...
Kotlin is JetBrains corposhit though? also I haven't seen Kotlin in production except for Anddroid, maybe try Scala I've seen that around in prod. Otherwise you have Clojure and F# but I haven't seen them in prod either.
Anonymous 01/19/25(Sun)14:53:19 No.103958539
JSON is proof that god isn't real and humans aren't intelligent.
Anonymous 01/19/25(Sun)14:55:29 No.103958563
170
>>103953341
>void
>some_function()
>{
> double d = 2.2;
> int i = 7;
> d = d+1;
the only correct way
Anonymous 01/19/25(Sun)15:05:07 No.103958687
>>103953340
Haskell style
void f()
{ double d = 2.2
; int i = 7
; d = d + i
; i = d * i
; } // dumb C
Anonymous 01/19/25(Sun)16:02:41 No.103959311
>>103957531
>Kotlin is JetBrains corposhit
Exactly my point, but at least it's not *as* closely tied to their IDE and build tools as C# is. I like Clojure's ecosystem but I just don't like writing Lisp that much. Scala might be the best option
Anonymous 01/19/25(Sun)16:16:34 No.103959481
>>103959311
How is kotlin less tied to the mother corpo IDE than C#? At least C# has an lsp that works in vim/emacs/vscode and so on with a good dev sdk.
Unlike kotlin, where the lsp experience is horrible everywhere except intellij and android studio and you're basically stuck with the gradle nightmare.
Anonymous 01/19/25(Sun)17:10:45 No.103960074
>>103956098
>44K - 1M cycles for opening files (with a heavy bias towards the <100K mark)
Is that for an SSD with the filesystem metadata cached, or for an HDD effectively after a cold start? Which filesystem?
(Those numbers DO NOT APPLY on Windows in the common situation where AV software is configured. Customer data says "kiss your performance goodbye" in that situation.)
Anonymous 01/19/25(Sun)18:40:25 No.103960999
>>103958687
ok that's pretty weird but desu the space between function name and parens bothers me more
Anonymous 01/19/25(Sun)18:43:31 No.103961022
>>103959481
The OmniSharp LSP didn't work well at all for me in Emacs. Also the only build tool for C# that IDEs actually support is MSBuild. At least with Kotlin you can choose between Gradle and Maven, and they are obviously relevant outside of Kotlin as well
Anonymous 01/19/25(Sun)18:55:06 No.103961125
lol
>>103958687
>be MLtard
>use terminators as separators
>use separators as introducers
Anonymous 01/19/25(Sun)20:28:08 No.103961964
Is there any book/guide on how to create a modern programming language? No toy stuff. Fault tolerant parsing, LSP from the start, writing a formatter, dealing with package management, and so on.
Anonymous 01/19/25(Sun)20:32:35 No.103961993
>>103953340
Fun fact: Emacs formats C-like languages like this by default.
Anonymous 01/19/25(Sun)20:32:41 No.103961995
>>103961964
The one I see around is: https://craftinginterpreters.com/
>LSP from the start
>dealing with package management
Yeah, good luck with that, 5 decades of programming and nobody figured out packages without dependency hell or statically linking 50 gb.
Anonymous 01/19/25(Sun)20:37:14 No.103962039
ywnbaw
Anonymous 01/19/25(Sun)20:56:45 No.103962250
>>103961964
Big yikes.
>Fault tolerant parsing,
Extremely retarded idea unless you mean a syntax with the less amount of ambiguity possible.
>LSP from the start, writing a formatter, dealing with package management,
None of those are about the language itself and all of those are tooling cope used to make deprecated languages like Java and C++ less shitty.
Anonymous 01/19/25(Sun)21:18:56 No.103962443
Who really thinks haskell makes you a better programmer?
Anonymous 01/19/25(Sun)21:20:17 No.103962456
>>103961964
>Fault tolerant parsing

>I'll design an entirely new language instead of learning how to type properly
Anonymous 01/19/25(Sun)21:28:28 No.103962529
>>103961995
>nobody figured out packages
a couple of points
- package managers are only found in open source software such as Python, linux, and FreeBSD
- Scheme does not have a package manager (because nobody cares about the ecosystem)
I recently installed PySDL2 and had to install the SDL2 library. As it happened, I tried to import sdl2 in python before installing SDL2 and was given a helpful error message, something like "SDL2 library not found." I installed it, and it worked fine. So, in effect, I was my own hand cranked package manager, and it worked fine because of the utter triviality of the package dependency tree.
I think this is one of those cases where a "greedy, capitalistic, control freak" attitude towards code (just copy code from other projects into your project as long as you think it won't bloat the user's machine) would've served open source better than giving J. Random Hacker the ability to change a library implementation, thereby breaking countless dependencies.
Anonymous 01/19/25(Sun)21:32:37 No.103962561
>>103962529
^dependencies^users
Anonymous 01/19/25(Sun)21:34:37 No.103962580
>>103962250
>>103962456
Post your language
Anonymous 01/19/25(Sun)21:37:46 No.103962603
Anonymous 01/19/25(Sun)21:41:04 No.103962624
I am working on nothing. I am bored, restless, and feeling depressed about where my life is going and I have no idea what to do. I just want a fun hobby project that doesn't feel utterly useless.
Anonymous 01/19/25(Sun)21:45:08 No.103962658
Anonymous 01/19/25(Sun)21:57:23 No.103962762
>>103961964
Just work from something that already exists. It's gonna be easier if you use already existing technologies. By this I am mostly referring to LLVM, but you can also compile to something else like JVM.

The only language which I have found has a package manager which works decently is .NET with NuGet, but it is a very basic package manager. Package management will be difficult as long as you want to be able to call and depend on native libraries, which practically every language does. This is what makes package managers a mess, because you will always be tied to OS-specific details and CPU architectures if you want to run native code.
Anonymous 01/19/25(Sun)22:01:31 No.103962794
Anonymous 01/19/25(Sun)22:05:43 No.103962837
>>103962624
>project that doesn't feel utterly useless.
you don't have the hacker spirit then
you need to be making useless shit
Anonymous 01/19/25(Sun)22:09:16 No.103962876
Anonymous 01/19/25(Sun)22:24:22 No.103963018
>>103962529
>package managers are only found in open source software
Package managers are found anywhere where code is meant be distributed. So everywhere.
>Scheme does not have a package manager
Scheme is so fragmented each implementation has its own package manager. Racket has Planet and Chicken has Eggs.
>I recently installed PySDL2 and had to install the SDL2 library. As it happened, I tried to import sdl2 in python before installing SDL2 and was given a helpful error message, something like "SDL2 library not found." I installed it, and it worked fine.
See, the problem here is different. Because calling SDL2 from Python means that you need the SDL2 library which is not Python and no amount of package managing can solve that other than having all libs for all platforms distributed along the bindings for those specific libs. And the bindings can still bit rot if SDL3 comes and nobody updates them and now you're in change of maintaining a cmake project to build SDL2 (and not the latest SDL2 but the one the bindings bind).
The real solution is having a port of SDL2 that does the syscalls like C would but you're just increasing the maintenance burden to keep up with the C version. So don't count on it.

But yes, "a little copying is better than a little dependency" (Rob Pike). No need to import left pad, just copy it.
Anonymous 01/19/25(Sun)22:49:04 No.103963207
Use the scanner in superior java like durgasoft saar, bro; if you have multiple classes with methods that need to take input, just pass it as an object, bro. Its ez. Nooo don't close Scanner because it'll permanently close the System.in. Ack ack ack. Do not redeem the input stream bloody bich besterd.

C# fixes this.
Anonymous 01/19/25(Sun)23:48:18 No.103963639
file
-Wall -Wextra -Wpedantic -Werror
Anonymous 01/19/25(Sun)23:52:17 No.103963671
file
>>103963639
-Wall -Werror -fno-strict-aliasing -march=native -pipe -0g -ggdb -fno-omit-frame-pointer -fsanitize=address,undefined -D_LIBCPP_HARDENING_MODE=_LIBCPP_HARDENING_MODE_EXTENSIVE
Anonymous 01/20/25(Mon)00:36:15 No.103963985
I wanna try dicking around with making my own firefox extension using yt-dlp as the backend to download shit. I was able to follow the basics and made a few example extensions just fine, but I can't figure out how to start an executable or receive data returned by it

I found this https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Native_messaging
but get lost in the app manifest part. do I just put that file alongside the exe?
Anonymous 01/20/25(Mon)00:37:45 No.103963996
>>103963671
>no -Ofast
Pansy.
Anonymous 01/20/25(Mon)00:43:52 No.103964041
>>103963996
I need my crashes to be debuggable, unfortunately C/C++ aren't Rust so when you have millions of LoC in a codebase you need ways to reproduce look at stack traces.
Anonymous 01/20/25(Mon)00:50:38 No.103964084
>>103962580
Your idea of making a modern language seem to be Java++, you wouldn't get. Also this >>103962794.
Anonymous 01/20/25(Mon)01:01:21 No.103964154
Screenshot 2025-01-20 090041
WHAT'S GOING ON
Anonymous 01/20/25(Mon)01:18:04 No.103964278
>>103964154
Have you tried turning it off and on again?
>captcha: RNGAY
Anonymous 01/20/25(Mon)04:00:13 No.103965382
Is it even possible to write a wrapper around io_uring in C++? I can't figure it out.
Anonymous 01/20/25(Mon)04:02:08 No.103965405
>>103964154
nvm fixed it
you wouldn't believe how
Anonymous 01/20/25(Mon)04:55:36 No.103965684
>>103965382
Stop trying to jam a square peg into a chastity cage shaped whole.
io_uring is not going to work with any class-based wrapper, unless you completely neuter its capabilities and advantages, or have it be hopelessly broken under the hood.
Anonymous 01/20/25(Mon)04:56:06 No.103965688
Anonymous 01/20/25(Mon)05:24:52 No.103965879
I'm in a c++ course right now and they're always using wcout instead of cout to account for 32 bit systems. How common is this in general? We do not use microcontrollers at all so i'm a bit confused as to why they want us to get used to doing this
Anonymous 01/20/25(Mon)05:26:12 No.103965894
>>103965879
Wide strings are an absolute clusterfuck, and you should ideally spent as much effort as possible to avoid them.
You absolutely don't need to use them because of 32-bit.
Anonymous 01/20/25(Mon)05:28:18 No.103965909
>>103965894
I'm pretty sure we lose points on the exam if we don't use wide strings. whelp
Anonymous 01/20/25(Mon)05:34:05 No.103965959
>>103965909
Just use them, but just know that they absolutely failed in their original design goals, but that shit in littered all over the Windows APIs if you're using those directly for whatever reason.
More sensible modern software uses UTF-8 or UTF-32 explicitly.
Anonymous 01/20/25(Mon)05:35:10 No.103965962
>>103965959
>littered all over the Windows APIs

ah maybe that's why we're using them. It's a C++ and windows SDK course
Anonymous 01/20/25(Mon)05:37:15 No.103965987
>>103945099
How would you make use of both std::pmr::polymorphic_allocator and mmap? It's an interesting idea, can you show us, malloc-kun?
Anonymous 01/20/25(Mon)07:39:41 No.103966850
>>103963671
> -fno-strict-aliasing
Learn the fucking language.
Anonymous 01/20/25(Mon)07:41:50 No.103966875
>>103963671
>*LIBCPP*
Is there anything less gigachad you could have added to that?
Anonymous 01/20/25(Mon)07:58:17 No.103967005
N
C++ is better than C.
C# is a better Java.
Rust is gay. Zig is gayer.
Anonymous 01/20/25(Mon)08:01:15 No.103967040
You can't spell trust without rust.
Anonymous 01/20/25(Mon)08:16:45 No.103967186
You can't spell frustration without rust.
Anonymous 01/20/25(Mon)08:36:40 No.103967337
>>103967186
You can write CMakeLists.txt without rust, wdym?
Anonymous 01/20/25(Mon)08:40:02 No.103967373
>>103967337
>not using xmake
you can only blame yourself
Anonymous 01/20/25(Mon)09:31:37 No.103967822
compilers_are_garbage_cpp_printf
>>103965987
What makes you think I'm the best authority on C++ questions? I'm the guy who's advocating for Stroustrup's timely and brutal demise to salvage whatever crumbs of reputation are left of the language. Furthermore there are already tutorials on polymorphic allocators out there: https://www.cppstories.com/2020/06/pmr-hacking.html/

>>103967005
>C++ is better than C.
A-huh.
Anonymous 01/20/25(Mon)10:18:33 No.103968286
1735344715176274
>>103962250
Ambiguity bad, but permissiveness good
Anonymous 01/20/25(Mon)11:01:19 No.103968714
>>103967337
Bros how the fuck do you learn CMake? I'm not even sure if it's worth putting more effort in, but every other language I've been able to get the hang of after just using it for a bit on a hobby, but not CMake
Anonymous 01/20/25(Mon)11:08:05 No.103968768
>>103968714
Cmake is absolute trash. Don't use it if you don't have to.
Anonymous 01/20/25(Mon)11:52:52 No.103969190
I just want to make a simple 3D program that displays models and plays animations but I'm too lazy to figure out how all that stuff works in glTF.
Anonymous 01/20/25(Mon)11:56:09 No.103969218
>>103969190
just ask an AI to write the code for you, then just glue it together and verify it works
Anonymous 01/20/25(Mon)12:18:13 No.103969450
>>103969218
>paying for AI slop
Good one.
Anonymous 01/20/25(Mon)12:46:37 No.103969748
>>103968714
>>103968768
CMake is a necessary evil if you want to program C/C++. There simply is no better alternative build tool that has widespread adoption.

I recommend giving https://cliutils.gitlab.io/modern-cmake/README.html a read.
Anonymous 01/20/25(Mon)12:51:22 No.103969796
>>103969450
>>paying
Anonymous 01/20/25(Mon)12:53:40 No.103969828
Anonymous 01/20/25(Mon)13:18:25 No.103970095
hi
Anonymous 01/20/25(Mon)13:26:46 No.103970175
>>103969796
>AI is so bad they're handing some of it out for free now
Anonymous 01/20/25(Mon)13:36:44 No.103970289
>>103969748
>necessary
Sounds like a skill issue. Real programmers use GNU Make.
Anonymous 01/20/25(Mon)14:12:21 No.103970644
popups
I finally finished the my lib's engine rewrite. All that's left is the implementation of a few more widgets and a bit of doc and the next release will be ready to go
Anonymous 01/20/25(Mon)14:13:00 No.103970653
so i have a pretty huge database in SQLite which has a certain column in which every cell is a file. Im pretty sure that file is zipped also. Is it somehow possible to turn each that file into an actual text string, which each that file actually is after unzipping it?
Anonymous 01/20/25(Mon)14:14:26 No.103970662
>>103968714
You can just use Meson, CMake is too advanced for a lot of projects, but it's what the community has mostly settled on. xmake is slowly getting better too
Anonymous 01/20/25(Mon)14:47:06 No.103970944
>>103970289
Tell me you've never worked on a large cross-platform codebase without telling me.
Anonymous 01/20/25(Mon)14:47:21 No.103970946
>>103966850
no-strict-aliasing is necessary for high performance.
Anonymous 01/20/25(Mon)14:51:19 No.103970967
>>103966850
Get the standards committee boot out of your mouth
Anonymous 01/20/25(Mon)14:57:38 No.103971025
>>103970662
there are like 40 new C++ build systems and most of them are terrible, which is the most C++ thing ever
Anonymous 01/20/25(Mon)15:30:04 No.103971286
>>103970944
Tell me your large cross-platform codebase is a piece of garbage with untold manhours of technical debt in it without telling me.
Anonymous 01/20/25(Mon)16:39:37 No.103972010
>>103968286
exactly, well said
I've been thinking about a syntax where parentheses in function calls would be optional. Wether it would be a good thing to dinsingui
func(a,b,c)[0]
from
func (a,b,c)[0]
. The 1st case is a function call taking 3 arguments, the 2nd case is function taking 1 argument.
It can be a regular operation when you deal with complex data structures and it's annoying to have to type func((a,b,c)[0]). The bad thing is that removing or adding the whitespace changes the AST, but you're typically very conscious about whitespace at a place like that and in most cases the static type system would catch that error.
Anonymous 01/20/25(Mon)16:51:14 No.103972126
85cae98a3f407ccb
I've had only "1 more issue" to fix for the last several days and every time I go to fix it I find 2 more problems.
Today is the same thing but I think it's the last thing to fix for real this time.
I'm so ready to be done with this library.
Help 01/20/25(Mon)17:09:53 No.103972307
Bon c'est malsain disons le tout de suite.
Mais j'ai besoin d'aide
En gros j'étais en contact avec une meuf et genre le feeling passait grave
Bien carrément bon pote même un peu plus
Sauf
qu'un jour sont compte insta c'est désactivé...
Et sa fait 5 Mois quelle n'est plus connecté sur la play...
Moi j avait ma vie a faire et je n'y est pas fait attention aujourd'hui je remarque ces détails et sa me perturbe genre c'est brusque carrément brusque...
Je sais que la communauté 4chan est capable de retrouver quelqu'un,
si se n'est de savoir ce qui a pus lui arrivé.
Je m'en remets a vous
S'ils vous plaît y aurait t'il une personne avec de telles compétences ici?
Je souhaite juste pouvoir la contacter
Ou au pire savoir ce qu'il c est passé...
Anonymous 01/20/25(Mon)17:11:45 No.103972328
>>103972307
Les requêtes sont interdites dans cette zone.
Anonymous 01/20/25(Mon)17:12:28 No.103972332
Made an async echo server using io_uring. It was fun.
Anonymous 01/20/25(Mon)17:21:46 No.103972421
ching
>>103972307
Sure, frog.
Anonymous 01/20/25(Mon)17:35:31 No.103972534
>>103970946
What is `restrict`?
Anonymous 01/20/25(Mon)18:16:41 No.103972942
>>103963018
The biggest problems come from things like concealed dependencies, where code depends on a package without knowing that it does so. This sounds dumb (it is dumb) but the deeper your dependency hierarchy, the more it ends up biting you in the ass.
Anonymous 01/20/25(Mon)18:18:41 No.103972957
>>103972307
t'as essayé d'aller niquer ta grosse daronne ?
Anonymous 01/20/25(Mon)18:20:13 No.103972973
>>103961964
>Fault tolerant parsing
I remember seeing research on that back in the 1990s, and using an obscure research language which had such a parser. It was horrible to use; computers tend to "correct" your code in ways that programmers never want.
Anonymous 01/20/25(Mon)18:21:50 No.103972994
>>103964041
>I need my crashes to be debuggable
Pansy.

Also, I find that -Os is usually faster than -Ofast
Anonymous 01/20/25(Mon)19:10:53 No.103973439
>>103971025
Meson is relatively established though, it's used by GTK/Glib/GNOME
Anonymous 01/20/25(Mon)19:19:24 No.103973489
>>103973439
Gnome doing anything would normally be a good indicator that you SHOLDN'T do it, but yeah, it's actually an extremely common build system in a bunch of Linux stuff.
You even have things like Mesa using it.
Anonymous 01/20/25(Mon)19:25:30 No.103973524
>>103973489
>Gnome doing anything would normally be a good indicator that you SHOLDN'T do it
Eh, as much as I hate some of their UI/UX decisions, they were the first to create something resembling a real desktop ecosystem. The only thing that really annoys me as a dev is that they do not care about C++/gtkmm support at all
Anonymous 01/20/25(Mon)19:30:12 No.103973547
>>103973524
gnome devs were always kind of annoying but 2.x was an alright desktop. in hindsight it's funny as fuck how the 3.0 release was so widely reviled that de icaza bailed linux entirely.
Anonymous 01/20/25(Mon)19:45:41 No.103973640
>>103973547
Good riddance.
Anonymous 01/20/25(Mon)20:24:16 No.103973988
e
>>103973524
usecase for gnome++?
Anonymous 01/20/25(Mon)22:18:04 No.103975041
I just remembered Swift exists. Is it any good for concurrent programming, or should I stick with Go? From what I can see, it only has a bog-standard cooperative scheduler.
Anonymous 01/20/25(Mon)22:27:35 No.103975122
>>103975041
How about actual programming for a change?
Anonymous 01/20/25(Mon)22:41:06 No.103975250
>>103968714
Just use a minimal set of it's features: given a list of files to be compiled, create a cmake project that compiles them into a binary.
If you can do that, then you have 90% of what cmake is good for (allowing easy cross-platform builds), and the rest is just more specific options you may or may not need, and hooking up dependencies between projects
The vast majority of cmakelists.txt that you see in the wild are overcomplicated garbage
Anonymous 01/20/25(Mon)22:42:51 No.103975264
>>103975122
I'm doing that also. Single-threaded frontend and concurrent backend. Different languages since Go has a lot of pitfalls.
Anonymous 01/20/25(Mon)22:45:52 No.103975297
when people say they write C-style C++ what is actually meant by this? and what C++ features are they even after?
Anonymous 01/20/25(Mon)22:49:42 No.103975331
>>103975297
probably means different things to everyone, but for me it's basically C with templates (kept very far away from any interfaces). Primarily for containers, but also useful for other stuff.
Anonymous 01/20/25(Mon)23:01:15 No.103975426
>>103975297
namespaces
vector
uhh
Anonymous 01/20/25(Mon)23:14:52 No.103975564
1723550180851118
I have an idea that is specific to an industry, and one that could benefit multiple parties from service providers, suppliers, manufactures and real estate...zero idea how to pull it off but something similar exists in another industry so I know it can work.

>t. no coder
Anonymous 01/21/25(Tue)00:08:21 No.103976090
Screenshot 2025-01-21 080414
when a process starts on macos what's on its stack?
if I skip 576 bytes I get the argument count but what are those bytes? is then number constant?
Anonymous 01/21/25(Tue)02:02:01 No.103977059
>>103976090
If I recall correctly, on Linux, environment variables passed by the kernel into the program exist on the stack, right next to the arguments.
Since macos is unix-like too, it would support the
int main(int argc, char *argv[], char *envp[])
form of main, and maybe does something similar.

>>103977053
Fixing code tags.
Anonymous 01/21/25(Tue)02:48:05 No.103977403
>>103976090
in chunks of 8 bytes you've got:
argc = 3
argv[0] = pointer to string
argv[1] same
argv[2] same
0
envp[0] = pointer to string like "PATH=/usr/bin...\0"
envp[1] same
...
0
Anonymous 01/21/25(Tue)03:08:50 No.103977582
why is gtk so unpopular? do people really just hate the object oriented c THAT much?
Anonymous 01/21/25(Tue)03:21:11 No.103977674
>>103977582
Yes, Glib is an actual abomination.
Anonymous 01/21/25(Tue)03:35:42 No.103977819
>>103977582
I know many embedded linux systems that use glib but getting gtk to work with hardware acceleration on embedded systems is ass.
Most systems that need display just use QT.
Anonymous 01/21/25(Tue)05:08:55 No.103978397
89e
I spent all morning doing micro benchmarks again
Anonymous 01/21/25(Tue)05:12:15 No.103978418
2
>primitive values are stored in the stack
>objects and other pass by reference, mutable values are stored in the heap
if i define an object inside a function and return another function, but never call it, will that object just live in heap limbo forever¿?¿?

also are teh call stack and stack the same shit? chat gpt said no but then proceded to literally explain them the same
Anonymous 01/21/25(Tue)05:14:22 No.103978430
>>103978418
>if i define an object inside a function and return another function, but never call it, will that object just live in heap limbo forever¿?¿?
This is why haskell generates garbage 1gb/s.
Anonymous 01/21/25(Tue)05:27:07 No.103978533
>>103978418
actually i just tried something, since objects are pass by reference, if i create and object, then take it as a parameter for a function, log it, return another function that also logs it but doesn't take it as parameter, call the first function and save it in a variable, null the object and then call the returned function, i assumed the value would be null but it still gives me the correct value, why is that?

let obj = { a: 1 }

function func1(obj) {
console.log(obj)
return function() {
console.log(obj)
}
}

const result1 = func1(obj)
// { a: 1 }

obj = null

result1()
// { a: 1 } , was expecting null



why is this
Anonymous 01/21/25(Tue)05:35:07 No.103978577
>>103978533
I don't know what language you're talking about but intuitively I would expect anonymous functions to capture their local environment's bindings. obj is this case would be local because it's the argument of the function (shadowing the global variable with the same name)
Anonymous 01/21/25(Tue)05:42:46 No.103978615
>>103978418
>also are the call stack and [the] stack the same shit?
Yes, in natively compiled languages. If the language is executed on a stack-based VM such Java on the JVM and most scripting languages, there will be a second stack which is used to evaluate expressions. That's the stack that is refered to in "stack-based VM". It can be called the expression stack and one or two other terms that I don't recall.
Anonymous 01/21/25(Tue)06:40:13 No.103978944
how can i extract a zip file with python, the thing is, it has b before the actual string, so its a binary. and i can't extract a binary
Anonymous 01/21/25(Tue)06:43:51 No.103978962
>>103978944
the file starts with b'PK\ so its a zip file, but its in binary mode
i tried converting it to utf, windows, ascii and others to no avail
Anonymous 01/21/25(Tue)07:08:44 No.103979095
>>103978944
a zip file is a binary file and contains compress data
>>103978962
>i tried converting it to utf, windows, ascii and others to no avail
it needs to be decompressed with a zip compression/decompression library and the decompression algorithm has nothing to do with character set conversion
Anonymous 01/21/25(Tue)07:18:44 No.103979131
1731522367348581
Is there really no alternative to VS that has as many features (minus the botnet)?
Extensive debugging, being able to inspect the ASM instructions behind the code, etc.

VS Code is dogshit so idk why people keep bringing it up
Anonymous 01/21/25(Tue)08:13:39 No.103979531
I don't know much about programming/language design theory. Is there a name for programatically defining "function signatures"?
Like for example a sorting function might want a (bool f(int a, int b)) function, so you could write something like comparator = bool (int, int), and now all you have to do is define your sorting function as sort(comparator c, bla, bla), it's something concretely defined, it makes it so you don't have to define a random function with a comment that reads "this should be used as an argument to the sorting function", just declare it as a comparator and that meaning is implied (and enforced).
I think there's something like this in Java called "functional interfaces", but it feels like a hack meant to work around OOP, you have to declare an interface with a single method and then the callers need to implement that method(?), it looks like more of a convention than a proper language feature.
I'm wondering if any other languages implement this type of idea in a more sophisticated and elegant way.
Anonymous 01/21/25(Tue)08:21:30 No.103979591
>>103979531
C++ allows this with std::function. Rust also has Fn/FnOnce/FnMut. I don't know if there's a formal name for it in theory.

When you write a lambda in C++, each lambda has its own unique type which is not directly accessible. However, a corresponding std::function can be implicitly constructed from the lambda (in most cases). If you look at functions like std::sort, they take a template parameter for the comparator function, so they can take a lambda which has the necessary function signature or a std::function.

C++20 also added something called std::invocable, which is a concept/trait which defines things which behave like std::function, but may not fulfill other requirements like being copyable.
Anonymous 01/21/25(Tue)08:24:24 No.103979611
>>103945044
An RPG Maker MV/MZ parser in Haskell.
Anonymous 01/21/25(Tue)08:25:29 No.103979622
>>103979531
I think what you're looking for is type polymorphism. It's one of the main features of all ML languages (Standard ML, OCaml, Haskell). What you do it define polymorphic variable that have type variables in their function signatures. You can define all sorts of functions operating on lists like that, functions that operate on a list of type A where A is a type variable that can be instantiated to any other type. When you'll use that function it will be on a specific type (list of int, list of strings, list of list of floats, etc..) and the compiler will generate the appropriate specialized code for it.

The sort function would have a type like: sort(function (A, A) -> bool, list of A) where A can be any type.

There is something called row polymorphism but that's something else.
Anonymous 01/21/25(Tue)08:26:13 No.103979627
>>103979131
Emacs + GDB? Any other IDE which offers a debugger, like CLion, is just a GUI wrapper around GDB or LLDB. You can do all the same things with the GDB command line. If you're on Windows, there's also WinDbg which is pretty much the same as the VS debugger.
Anonymous 01/21/25(Tue)08:26:40 No.103979634
>>103979622
>What you do it define polymorphic variable
*What you do is define polymorphic functions
Anonymous 01/21/25(Tue)08:29:05 No.103979650
>>103979622
>sort(function (A, A) -> bool, list of A)
sort(function (A, A) -> int, list of A) -> list of A

the comparator function would return -1 , 0 or 1
Anonymous 01/21/25(Tue)08:32:52 No.103979686
stallman pepperjuggle
>>103979627
I've never used it so idk if it has the features I'm thinking of. I was planning to get used to neovim with extensions but that's just me talking out of my ass since I've never used it for real either.

Basically I want a debugger and the ability to look up a line's ASM equivalent (bonus if I can check both the regular ASM and the one that's actually used after compiler optimization)
Anonymous 01/21/25(Tue)08:33:51 No.103979692
>>103979531
Yes but you're not going to have much luck in Java or other mainstream languages. What you're describing is Haskell. It's much more than that in fact. In Haskell you know what functions have side effects or not just by the return type for example.
Anonymous 01/21/25(Tue)08:37:37 No.103979732
>>103979531
what you're asking for is conventional OOP but for some reason you're trying your hardest to make it not OOP

in Java you literally have a Comparator interface, you can write an implementation to it and supply it to the sort function
Functional interfaces are something you would use with the Stream API, not "regular" Java code
Anonymous 01/21/25(Tue)08:39:27 No.103979751
>>103979732
You need an hierarchy in Java for Comparable. It seems he wants something more generic. That's why he's calling it an hack.
Anonymous 01/21/25(Tue)08:42:47 No.103979784
>>103979686
>look up a line's ASM equivalent (bonus if I can check both the regular ASM and the one that's actually used after compiler optimization)
That's a lot to ask for. Even in VS, you can jump to the start of the ASM for a source line, but it doesn't generally show you where that line ends. And when you turn on optimizations, the debug symbols that are generated are not very useful, you can figure out where a function starts and ends but not much more than that.

Godbolt can be very powerful, because it only generates the assembly and works based on that, but when you have a fully compiled executable, you have to rely on DWARF or PDBs for the debug information and it will never be perfect.
Anonymous 01/21/25(Tue)08:49:45 No.103979850
>>103979751
Comparator and Comparable are different interfaces
>You need an hierarchy in Java for Comparable
no, you don't. Comparable is an interface, not a class. it doesn't create any hierarchy, all it does is ensure the class that implements it has a compareTo() method
Anonymous 01/21/25(Tue)08:54:52 No.103979888
>>103979531
Just look for first class functions.
Anonymous 01/21/25(Tue)08:55:03 No.103979889
>>103979732
Maybe, it just looks very clunky to me. I don't use Java fwiw I just came across the term before, hence my question mark when describing how it works.
Let's say I want 20 different ways to compare things, am I supposed to declare 20 different classes that each implement the function?
Compare that to C: I could simply define 20 individual functions side by side and pass the function pointer of the one I want to use. The problem I have with the C way is that there's no safety or enforceability, how can someone else know the function in question is really meant to be used as a comparator?
Anonymous 01/21/25(Tue)09:10:11 No.103980020
>>103979784
Maybe I should clarify I'm not exactly talking from experience. I've been watching Cherno's C++ series and he does the things I described a lot (e.g. select a line and find the ASM instructions behind it, both before and after optimization)

It sucks because I'm on linux and not willing to change to winblows so even if I was ok with the botnet VS isn't an option. I've decided I'll try to learn to debug with gdb but VS does have some powerful tools.
Anonymous 01/21/25(Tue)09:11:59 No.103980035
>>103979889
>am I supposed to declare 20 different classes that each implement the function?
yes, though with that many comparisons I suspect you could probably reduce that number in practice, eg. declare a comparator with parameters and reuse it for different scenarios

>Compare that to C: I could simply define 20 individual functions side by side and pass the function pointer of the one I want to use.
that is hardly a simplification, to be honest
>The problem I have with the C way is that there's no safety or enforceability, how can someone else know the function in question is really meant to be used as a comparator?
being wrapped in an interface gives exactly this context and enforceability so I don't see what you're so opposed to, can only guess it's this "OOP bad" mentality burn-in
Anonymous 01/21/25(Tue)09:20:40 No.103980096
>>103980020
I would just try using GDB with whatever editor you like. It probably has some kind of integration. Then, for more advanced features, you can learn the GDB command line.

If you really wanna see the assembly, you can compile a single source file with `gcc -S` and get an assembly file
Anonymous 01/21/25(Tue)09:41:32 No.103980253
>>103979850
I don't know by memory which one is which but it doesn't matter, you didn't get the point. Regardless of which one is the interface, in Java you are always tied to hierarchies. You can only do object.compare(...), but not compare(object), the opposite. That means you can never derive, generalize, or anything more abstract. You are tied to the hierarchy system, for better or worse.
Anonymous 01/21/25(Tue)09:55:06 No.103980373
>>103979850
Since you come from Java you might be wondering what's the problem with hierarchies in concrete? Several problems. For the Comparable you have to implement compareTo all the time, and you only get a number that tells what happened. For Comparator, it's a builder, with wrappers, that tell what to compare, dynamically. None of that is necessary if you don't have hierarchies. You can simply pass smaller functions that tell how to compare, or compare the whole thing naturally just by deriving Ord. That's possible because Haskell has currying, which is obvious design if you don't have OOP. If you do it would never work. Scala does have it too but it's very limited.
Anonymous 01/21/25(Tue)09:58:13 No.103980404
>>103979686
>the ability to look up a line's ASM equivalent (bonus if I can check both the regular ASM and the one that's actually used after compiler optimization)
this doesn't make sense, there would need to be 2 compilations, one with optimizatins turned on and turned off. optimizing compilers don't compile to native code and then modify the natively compiled code to produce an optimized version
Anonymous 01/21/25(Tue)10:46:42 No.103980859
>>103980253
>it doesn't matter that i don't know how your stuff works, you're wrong anyway
arguments of functards, everyone

>Regardless of which one is the interface
both are
>You can only do object.compare(...), but not compare(object), the opposite
implementing Comparable enables object.compareTo(anotherObject)
implementing Comparator enables comparator.compare(object1, object2)
or are you arguing the concept of syntax is a "hierarchy" and is somehow bad?

>Comparator, it's a builder, with wrappers, that tell what to compare, dynamically
that's not how a Comparator works in Java
Anonymous 01/21/25(Tue)10:50:07 No.103980907
which wagie backend language should i learn
Anonymous 01/21/25(Tue)11:01:29 No.103981053
>>103980404
What he did in the videos was inspect the line in debug mode then switch to release mode, at which point VS optimized it.
Anonymous 01/21/25(Tue)11:09:21 No.103981123
>>103981053
so this was effectively 2 different compilations, that's nice
who and what videos are you ttalking about?
Anonymous 01/21/25(Tue)11:38:42 No.103981400
>>103981123
The Cherno's C++ series
Anonymous 01/21/25(Tue)11:42:32 No.103981435
file
>list comprehensions
what a great way to kill readability
Anonymous 01/21/25(Tue)12:06:46 No.103981674
>>103980907
Python, Node, Java, C#
Anonymous 01/21/25(Tue)12:09:38 No.103981714
>>103981435
but lambda is scary and confusing
Anonymous 01/21/25(Tue)12:16:21 No.103981780
>>103981714
I hate those too.
every little thing to reduce line count instead of understanding.
Anonymous 01/21/25(Tue)12:18:32 No.103981796
>>103981780
oh i was joking about the python guys irrational hatred of lambda that made him develop the horrible list dsl not actually disparaging lambda
Anonymous 01/21/25(Tue)12:24:15 No.103981861
I am working on localization. I would expect:

// wide character
char8_t cat[4] = u8"猫";

// is equal to
char8_t ctm[4] = u8"\xE8\x8c\xAB"; // hexadecimal

// but my question is here:
char8_t utf[] = u8"\u00E7\u008C\u00AB"; // size calculated at compile-time


The problem is it resolves to

char8_t utf[8] =  {195, 167, 194, 140, 194, 171, 0};
.

I would expect it to resolve to

char8_t utf[4] = {231,  140,  171,  000};


And I would also expect it to be equal to the first two statements.

What is going wrong?
Anonymous 01/21/25(Tue)12:34:07 No.103981971
>>103981861
\u notates a codepoint, not a binary value. \u00E7 is thus converted into UTF-8, whose encoding for \u00E7 is 0xC3 0xA7.
https://www.cogsci.ed.ac.uk/~richard/utf-8.cgi?input=00E7&mode=hex
Anonymous 01/21/25(Tue)12:34:52 No.103981982
>>103981861
works on my machine
char cat[4] = u8"猫";
char ctm[4] = u8"\xE8\x8c\xAB"; // hexadecimal
char utf[] = u8"\u732B";

int main(int argc, char *argv[])
{
printf("%d %d %d\n", sizeof(cat), sizeof(ctm), sizeof(utf));
return 0;
}

./a.out 
4 4 4

Anonymous 01/21/25(Tue)12:37:30 No.103982011
>>103981982
>let's completely change the input parameter
>"see, guise, it works!!1!"
/dpt/ is dead.
Anonymous 01/21/25(Tue)12:41:14 No.103982049
>>103981861
This fag was being retarded on purpose
>>103982011
but this is the most retarded gorilla monkey on internet
Anonymous 01/21/25(Tue)12:42:43 No.103982064
>>103982049
>"on purpose"
Sure thing, kiddo.
Anonymous 01/21/25(Tue)13:00:15 No.103982237
>>103981971
If i'm going to be working with codepoints instead of the conventional ascii characters (0-255) which format do you recommend? i was thinking hexadecimal

char8_t hex[4] { 0xE7, 0x8C, 0xAB, 0x00 };
Anonymous 01/21/25(Tue)13:21:40 No.103982434
>>103982237
There are no conventional ASCII characters in the 128-255 range. Windows codepage 1252 just so happens to use the same characters for the 128-255 range that Unicode codepoints do, but if codepages were conventional there wouldn't be a need for them in the first place. And because you can't tell how long a codepoint is in raw codepoint format people use UTF encodings instead.

So the question is: do you actually want Unicode, or do you want Windows codepage 1252?
Anonymous 01/21/25(Tue)13:23:26 No.103982454
>>103960999
void f
( int x
, double y )
{ if (x > 3)
{ y = 2.0
; }
...

Really the only issue is trailing terminators.
It does a very nice job of putting the nesting level into the code though, like editor lines.
>>103979531
Functional interfaces in Java are actually good, and you have the terseness of a lambda, but I don't know what you actually want. In an OOP language without functional interfaces but with lambdas you could still have a static function that converts a "regular" function to a comparator. In something like Haskell you could either wrap the whole function type in a new opaque type you have to explicitly cast to/from (has uses related to Haskell type classes), or maybe what you want is just a type synonym. E.g. I can write
type Comparator a = a -> a -> Ordering
myComp :: Comparator Bool
myComp True True = EQ
myComp False False = EQ
myComp True False = GT
myComp False True = LT

A lot of OO languages don't have this though because the function can't get its own single type annotation and has to have return type and argument type annotations instead
Anonymous 01/21/25(Tue)13:30:09 No.103982536
>>103982434
i want to support multiple languages in my application. i am going to target utf8 to keep the size in memory smaller. at the most fundamental level which format am i using?
Anonymous 01/21/25(Tue)13:51:07 No.103982792
1724722737481229
https://developer.nvidia.com/nsight-perf-sdk
Where do I start learning where the shit on this page even means.
I want to get a better understanding of GPU programming but the debugging tools seem geared towards people who already know what they're doing.
The HTML report the Nsight SDK generates might as well be in Chinese.
Anonymous 01/21/25(Tue)14:03:58 No.103982915
>>103982536
>i want to support multiple languages in my application
It's not that simple. Applications are not tied to a specific character format; interfaces are, and depending on the interface you have to use different formats. Talking to the kernel on Windows means you have to use UTF-16 and wide characters:
const wchar_t*str1 = L"ÄäÖöÜüẞß"; /*Will use UTF-16 encoding on Windows, UTF-32 on Linux.*/
const wchar_t*str2 = L"\u00C4\u00E4\u00D6\u00F6\u00DC\u00FC\u1E9E\u00DF"; /*Will also use UTF-16 encoding on Windows and UTF-32 on Linux.*/


For non-kernel related stuff (communication, sockets, webpages, etc) or if you're on Linux you can use simple char* strings:
const char*str1 = "ÄäÖöÜüẞß"; /*Will use UTF-8 on Linux or default codepage on Windows; may result in mojibake.*/
const char*str2 = "\u00C4\u00E4\u00D6\u00F6\u00DC\u00FC\u001E9E\u00DF";
Anonymous 01/21/25(Tue)14:05:21 No.103982927
i'm sympathetic to the modern bloat haters but trying to do localization just with string literals is insane. just use a library
Anonymous 01/21/25(Tue)14:29:12 No.103983172
nvidia_is_incompetent_too
>>103982927
You should work at nVidia. They seem very challenged by character encodings, too.
Anonymous 01/21/25(Tue)15:05:25 No.103983552
>>103980859
Ok I see that you don't want to learn anything, you just want to be right. No point in continuing.
Anonymous 01/21/25(Tue)15:06:28 No.103983571
>>103981435
I math that makes sense but I personally prefer map and filter.
Anonymous 01/21/25(Tue)15:07:25 No.103983587
WINDOWS
>Want to use the equivalent UNIX 'time' command on Windows
>See this
Incredible, Microshaft. Thank you.
Anonymous 01/21/25(Tue)15:07:54 No.103983593
>>103983552
And the best thing is that is now right.
Anonymous 01/21/25(Tue)15:09:22 No.103983616
>>103983593
What the fuck does that even mean?
Anonymous 01/21/25(Tue)15:11:14 No.103983634
>>103981435
Any idiot can defend bad language design, but only Pytards are retarded enough to complain that their language has useful features.
Anonymous 01/21/25(Tue)15:12:41 No.103983649
>>103983587
Microsoft tried to be a better shell script than bash and ended up with that nonsensical programming language that isn't as powerful as python or short as unix she'll script. The only advantage of PowerShell is that it's not CMD.
Anonymous 01/21/25(Tue)15:12:44 No.103983650
>>103982915
my target is linux so i'm not concerned about Windows.

>>103982927
it's still very early days but unicode has created a library which i plan to use which has types such as
uci::UnicodeString
and
uci::StringPiece
which i hope will eventually provide some clarity into the situation.

the uci:: namespace seems to provide a full localization solution including time/calendars/etc which is configured with a
std::locale
object which i'm hoping isn't a disaster.
Anonymous 01/21/25(Tue)15:16:37 No.103983695
>>103981435
List comprehensions in concept are fine, but python had to be all cute and be "it's just like English!", and all of the important terms are scattered all over places.
Anonymous 01/21/25(Tue)15:22:04 No.103983747
>>103983649
They tried to make a better scripting language without actually understanding the appeal of scripting languages, so they ended up with a language that combines the inane verbosity and OO obsession of C# with the legacy ugliness of *sh like its shitty predicates. They had no reason to ape Bourne shell brain damage but they did it anyway.
That said, it's still much nicer to do Windows syadmin with than the old menu mazes.
Anonymous 01/21/25(Tue)15:22:09 No.103983748
>>103983650
>my target is linux so i'm not concerned about Windows
In that case just use characters directly. It's all going to end up being UTF-8.
Anonymous 01/21/25(Tue)15:23:15 No.103983764
>>103983649
>>103983747
neither of these anons but fuck shells
This sort of thing ought to be strongly typed like a Haskell repl
Anonymous 01/21/25(Tue)15:24:58 No.103983781
bash is pretty weird too. finally reading the manual and realizing there are no strings, "echo" hello world is the same
Anonymous 01/21/25(Tue)15:26:49 No.103983803
Name a single shell script that correctly escapes its arguments without being written by the developers of the distro
Anonymous 01/21/25(Tue)15:27:15 No.103983806
>>103983764
I can't decipher what you're trying to say in the first line.

It could be strongly typed but shells are supposed to be very short and simple, not super complex like PowerShell. Something like a repl could maybe work but it would have to be very carefully designed because the goal is to do simple things quickly.
Anonymous 01/21/25(Tue)15:28:58 No.103983825
>>103983748
it's not that easy. i've run in to too many character encoding issues recently and now i can't rest until i understand it.

>recently tried to create a wide character csv parser which i will eventually come back to
Anonymous 01/21/25(Tue)15:29:54 No.103983834
>>103983806
Haskell is great for this. The advantage of strong typing is that it makes it hard to do something wrong. Shells have way too much loose stringy bullshit in. I want it to be difficult to escape things incorrectly when combining different shell scripts and features together.
Anonymous 01/21/25(Tue)15:30:05 No.103983836
>>103983825
UTF-8 != wide character. And it's hard to judge what exactly you screwed up without code.
Anonymous 01/21/25(Tue)15:30:23 No.103983839
>>103983825
I was working with csv today to find duplicate lines. Most projects out there are convert what we do in a spreadsheet to a web application, and that ends up with CSVs.
Anonymous 01/21/25(Tue)15:31:47 No.103983856
>>103983825
Unicode is not a sequence of characters
Anonymous 01/21/25(Tue)15:31:55 No.103983860
>>103983834
It would be too verbose for a shell I think. I don't see it working that well with standards libraries. And the errors would bleed the eyes of those who don't know Haskell.
Anonymous 01/21/25(Tue)15:32:52 No.103983871
>>103983860
Haskell is far from verbose
>bleed the eyes of those who don't know Haskell
as opposed to everyone writing scripts that don't work because "a != b" is too hard to understand
Anonymous 01/21/25(Tue)15:32:59 No.103983876
>>103983834
that's retarded. the point of shells are loose stringy bullshit because you use them for one off tasks. anything where you need structured data you should write a script in an actual language of your choice
Anonymous 01/21/25(Tue)15:34:03 No.103983885
>>103983876
You don't though, you write scripts you re-use, then those scripts live on forever until someone else needs to use it and realises it doesn't work because your path has a space in or some string contains a backslash
Anonymous 01/21/25(Tue)15:36:43 No.103983907
>>103983836
i know i was working with
wchar_t
then

>>103983839
what i needed it for was to map a numeric value to a monotype font glyph. instead of having '32' in a cell, it could be represented by a space. this would then be loaded into a std::array

>>103983856
i know that. c++ makes it complicated as everything is stored as a numeric value. often represented as char8_t char16_t or char32_t
Anonymous 01/21/25(Tue)15:38:37 No.103983926
>>103983885
Rule of thumb: if a shell script goes beyond 100 lines, consider rewriting it. I only make exceptions in cases where not using a shell script is more pain than it's worth (i.e. rofi modes).
Anonymous 01/21/25(Tue)15:41:11 No.103983950
>>103983885
I mean I know it happens but it's just retards being retards which you can't prevent no matter what you do. I had a hard enough time getting my sysadmin friend to learn how to use a python library to parse his cvs file instead of just using cut in bash. I can't imagine trying to get him to use a strongly typed language
Anonymous 01/21/25(Tue)16:11:57 No.103984283
New thread:
>>103984278
Anonymous 01/21/25(Tue)18:22:43 No.103985990
>>103983552
you're not teaching anyone anything with those kind of posts if that was your intent at all
Anonymous 01/21/25(Tue)19:42:06 No.103986854
>>103981400
his videos are useless, he talks and talks without communicating any knowledge. that's how I felt about his game engine and opengl playlists