[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 / qa] [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: intel.jpg (410 KB, 1166x1588)
410 KB
410 KB JPG
What are you working on, /g/?

previous thread:
>>103126415
>>
File: 1681093436975179.png (240 KB, 471x468)
240 KB
240 KB PNG
>the last barrier to 32-bit programming
>"have a DOS extender"
>>
Porting my efficient Linux-only C game code to JavaScript so Windows users can run it without being inconvenienced by things like running one make command to build it in under 5 minutes and instead can enjoy rich, beautifully modern Electron app that just works.
>>
>>103145587
>tfw you will never again remove shrink wrap from a giant software box
modernity sucks
>>
File: t.png (427 KB, 547x471)
427 KB
427 KB PNG
haskell
>>
>>103145746
No one needs 1 GB of garbage per second.
>>
>>103145746
This is antisideffectic please delete
>>
File: gc.jpg (89 KB, 1100x1500)
89 KB
89 KB JPG
>>103145768
just clean it
>>
File: no.jpg (73 KB, 400x484)
73 KB
73 KB JPG
>>103145778
>wastes countless cycles on garbage
>wants me to waste more countless cycles on cleaning it up
>>
>>103145795
I hate to admit that languages which use GC are still more useful than my government.
>>
>>103145795
a small price to pay for salvation
>>
>>103145814
At least you're honest about the fact it's about religion, not engineering for you.
>>
>>103145795
keep on fizzbuzzin' brother
>>
>>103145909
Why, you need help?
>>
File: haskell_uh_no.png (608 KB, 1893x806)
608 KB
608 KB PNG
Keep on with your endless type bikeshedding.
>>
>>103145951
and autists wonder why mpv went to shit
>>
File: me-when-sideeffects.png (198 KB, 538x201)
198 KB
198 KB PNG
>>103145951
yes
>>
>>103145980
works on my machine
>>
>>103145951
based wm4, as usual
>>
How do you respond without sounding mad?
>>
>>103146350
He's right though
>>
There's an incomplete short game I want to rip one or two assets from; https://3uphoria.gitlab.io/land-of-nod/
You play it in the browser. When I tried to go to the guy's gitlab, nothing was there, and I can't figure out how to download from browser as I'm and retard. Does anyone know how to save a browser game?
Sorry in advance if this isn't the thread for it.
>>
>>103145624
>"have a DOS extender"
This was a big deal back then. Dealing with 16-bit's nonsense of near/far/huge pointers was a pain in the ass. Flat 32-bit addressing was amazing.
>>
File: tfw.jpg (48 KB, 735x652)
48 KB
48 KB JPG
/home/me/web/sub1/snoot.html

>from snoot to index.html

/home/me/web/index.html --> works on browser
../index.html ------------> works on server
/index.html --------------> works on server

how can I make it work for both, can I ?
>>
File: 2024-11-10_16-40.png (45 KB, 592x350)
45 KB
45 KB PNG
>>
>>103146481
S for Spit
E for Excellent
>>
>>103146481
>C# instead of Holy C
>>
File: tierlist.png (97 KB, 1140x542)
97 KB
97 KB PNG
>>
>>103146481
missed opportunity to rank them in the "C" category
>>
File: spj_oop.png (843 KB, 1187x1143)
843 KB
843 KB PNG
>>103145746
>Haskell but with OOP dot notation and real structs and methods
just imagine
>>
>>103146567
>best programming languages in the world
>still mid
>>
>>103146587
I don't think you don't understand the joke here anon
>>
File: GQ17FVcXEAATx81.jpg (61 KB, 558x878)
61 KB
61 KB JPG
>>103146583
>comic sans
The unironic love for comic sans is spreading
>>
>>103146593
I think you don't*
fuck.
>>
https://www.youtube.com/watch?v=lUa8uu5kJ3Q
where is zig?
>>
File: 263.png (114 KB, 475x475)
114 KB
114 KB PNG
>>103146632
>
>>
>>103145587
Writing a 6502 ASM in SML for learning reasons. Then I'll write a C++ and include it to my 6502 simulator.
>>
File: 2024-11-10_17-00.png (15 KB, 738x96)
15 KB
15 KB PNG
>>
>>103145746
>>
I'm bored. What side project should I try doing first:
>retro 2D topdown 8-bit RPG (i.e DQ1-4, Pokemon RBY/GSC, etc) engine
>retro 3D (i.e daggerfall, morrowind, etc) RPG engine
>bare metal virtual pet game (i.e Tamagotchi/Digimon, but as a bare metal boot program for some random architecture, idk which)
>hobby x86 OS implementing the bare necessities of a graphical operating system circa 199X
I'm giving myself a time limit of 1-2 months for any of these.
>>
>>103146583
Scala?
>>
>>103146350
He's right though? The only reason you'd ever make a direct syscall on Windows is as an experiment, or if you were trying to do something sneaky.
>>
>>103147095
the system dll makes allocations
>>
vm now handles globals
const foo = "hello "
const bar = "world!"
var test = 99.9
println(foo + bar)
println(test + 0.1)
test = 42.2
println(test)
>>
>>103146583
python kinda sucks for this, I'm so lazy most of the time when typing a list comprehension I type (foo for foo in X) then go back and do foo.bar to get IDE help.
Still I used to like 30 different map filter reduces chained together but it's annoying to debug
>>
>>103145587
>...Kit. And...
Did whatever troglodyte who wrote this never study grammar? It is their job to communicate and they cannot even use language correctly. Retard.
>>
>>103147756
imagine getting mad at grammar from a magazine ad from the 80s
>>
>>103147767
fuck, early 90s*
looked like 80s computer ads to me, in my defense
>>
>>103146350
You don't, he's right in principle. Windows applications shouldn't make direct syscalls. The Win32 API is stable, however making a direct syscall may succeed in one version of Windows, but fail in a previous or future version. The Win32 API is guaranteed to be stable. If an API call was added in Windows 95, you can write a program using it in Windows 95 and it will run in Windows 11, and vice versa.

There are performance gains to be had sometimes by using syscalls (NtCreateFile for example can be a lot faster than CreateFile in certain circumstances), but in the main the benefits outweigh the potential cost
>>
>>103147460
Which function are you specifically referring to? Most basic "syscall" like WinAPI functions do not allocate memory afaik.
>>103147841
NtCreateFile isn't even as low level as what that post is talking about. NtCreateFile isn't a "syscall" it's a function in ntdll (one of the "system dlls" that post is referring to). The "syscall" function would be ZwCreateFile. What the original post is saying, is that you do not directly set a syscall number and trap into the OS like you might do on linux.
>>
>>103147914
You can't call ZwCreateFile from usermode, NtCreateFile is as low level as you can get in usermode (Actually you can call Zw but it will simply point to Nt)
>>
>>103145637
Why not provide a binary?
>>
>>103146871
>I'm giving myself a time limit of 1-2 months for any of these
I admire your optimism.
>>
>>103146623
It was a joke built on your joke.
Too many layers of autism I guess.
>>
>>103146350
That's easy:
>why would I listen to anybody who's never bothered to check how much time programs spend on useless abstractions?
>>
>>103147937
You can call the kernel side function directly without going through ntdll, by setting rax to 0x55 and executing the syscall instruction. See https://j00ru.vexillium.org/syscalls/nt/64/. This is what the original post is saying - doing that is pretty much pointlessly low level and only really done by malware, and he's right. There's really no good reason to do this other than as a experiment to verify how the OS works, or if you want to be sneaky and avoid calling into the system dll for whatever reason. This is in contrast with linux, where the kernel interface itself is considered to be stable, so you may indeed have a reason to be making syscalls directly instead of going through glibc or whatever. On Windows, calling ntdll functions directly is basically the equivalent to making direct syscalls on linux, and it's something a reasonable program (not only malware) might have reason to do. But it IS possible to go lower level and call the kernel processing directly just like on linux.
>>
File: XXCreateFile.png (16 KB, 1320x120)
16 KB
16 KB PNG
>>103147914
Fascinating.
Complete and utter hogwash, but still fascinating.
>captcha: NGR JS
>>
>>103146583
-XOverloadedRecordDot came out three years ago .
>>
>>103148206
I'm not sure what that image is supposed to convey? What I meant is that there's a difference between calling the ntdll function known as "NtCreateFile", vs. trapping directly into the kernel. Whether the kernel side code should itself be called "NtCreateFile" or "ZwCreateFile" is kind of irrelevant.
>>
File deleted.
>>103148248
>I'm not sure what that image is supposed to convey?
That there is no difference between NtCreateFile and ZwCreateFile except the ordinal by which they're exported. *They map to the same address in userspace*.
In kernelspace there's a difference between them in the sense that Nt* functions check handles for their validity and Zw* functions don't (by examining the so-called "previous state"), and that's about it.

>there's a difference between calling the ntdll function known as "NtCreateFile", vs. trapping directly into the kernel
The only difference between the stub in ntdll.dll and trapping directly into the kernel is that the stub also checks if this is a 32-bit process, and executes a software interrupt instead of a syscall if so. Other than that there's no difference.
>>
File: nt_zw.png (14 KB, 980x150)
14 KB
14 KB PNG
>>103148282
Fuck, forgot to include the software interrupt. Here's a better picrel.
>>
>>103148206
NTA, but what program are you using for this?
>>
File: x64dbg.png (510 B, 176x120)
510 B
510 B PNG
>>103148320
>>
>>103148345
thanks
>>
>>103148282
>That there is no difference between NtCreateFile and ZwCreateFile except the ordinal by which they're exported. *They map to the same address in userspace*.
Fair enough. I do not know of a better way to differentiate between "the ntdll stub code in user space" and "the code in kernel space that actually creates the file".

>Other than that there's no difference.
Okay, which is why there's no good reason to use syscall directly instead of calling ntdll, which is what the original image I was replying to is saying, and is why I said "he's right though". We are in agreement Anon.
>>
>>103148399
>Okay, which is why there's no good reason to use syscall directly instead of calling ntdll
True, but not because it's a malware thing. The x64 calling convention on Windows places the first four parameters into RCX, RDX, R8, and R9, and any more parameters are placed onto the stack (correct me if I'm wrong, but on Linux I think it's six registers, but no stack spilling). Calling into the stubs places the return address after the shadow store and the parameters, which the kernel has to and is aware of. If you syscalled directly into the kernel your stack would be off by 8 bytes, and your call would more than likely fail miserably.
>>
>>103148453
You would presumably do the same or similar a thing as ntdll does, if you were a malware developer looking to make a syscall without using ntdll. To be honest I'm not sure why you would even need to avoid ntdll, I could guess that maybe there's anti virus software that works by hooking some calls there so you might want to avoid that, but I'd guess most anti virus software would also have a kernel component that could hook the kernel side as well. So idk if making syscalls directly is actually really a thing malware frequently does. I still agree with the guy that there's typically no reason to do it in a normal program, and I think he just gave malware as an example of a not-normal program that might want to do something in a weird or obfuscated way.
>>
>>103148453
You can align the stack if you want. That's trivial to do.
The bigger issue is Windows changes its syscall numbers between versions so your program will only work on a specific build of Windows.
>>
>>103148499
>You can align the stack if you want. That's trivial to do.
Not from a non-assembly-language, it's not. Which is probably one of the reasons MSVC doesn't allow for inline assembly in x64 targets anymore.
>>
>>103148530
GCC and clang don't have this problem.
>>
>>103148547
Sure, but that's no longer Microsoft's responsibility then.
>>
Can any of you Windows experts answer my question here?
>>103112640
>>103121871
>>
>>103148035
If it's so easy then why don't you build it yourself?
>>
>>103148552
microsoft has no responsibilities, just like brown people it has its own unique retarded overcomplicated way to do less wirk in more lines of code
>>
>>103146705
Fellow 6502 brother, I'm rewriting my assembler from Python to C++ with more features.
>>
I wrote two separate programs that directly interact. Now I see there is a lot of code duplication between the two. Not sure which resources to move to a shared library. Disaster.jpg.
>>
>>103146583
dot notation is already in Haskell.
I don't use it often though, I don't mind doing "field record"
>>
>>103146606
Every slideshow ever made by SPJ is in comic sans.
It's a sneaky shitpost he's done for decades now.
>>
>>103146583
dot autocompletion is mainly a coping mechanism for a problem caused by OOP in
the first place.
https://youtube.com/watch?v=aSEQfqNYNAc

>overload short function names
Clojure does this via protocols, interfaces and multimethods, which can be extended via libraries.
For shits and giggles I extended ClojureScript's number type so that when you "execute" it, it calls an RPN calculation function I wrote. So you can write something like this:
(4 5 2 + *)

and it'll return 40.
>>
>>103150064
>40
I mean 28
>>
is the only difference between WinMain and wWinMain the encoding of the command line arguments? or does it do other magic shit?
>>
>>103150064
>>103150077
I now believe that lisptrannies aren't retarded.
>>
>>103146871
>>hobby x86 OS implementing the bare necessities of a graphical operating system circa 199X
if you use an existing kernel this seems doable (windowing system, desktop and shell), otherwise i just lol
>>
>>103146871
>retro 3D (i.e daggerfall, morrowind, etc) RPG engine
I actually worked on something like that recently. Procedural generated world with towns you traveled to by walking to them. Was a lot of fun, would totally recommend. Though the actual game part ended up not getting done because I was more interested in just making the world than making a game.
>>
>>103149811
>code duplication
as in you fucking brainlessly pasted your shit around? Or are you worried about disk space and want to make a shared object? i dont get it.
>>
>>103146871
check out some existing project like Haiku, pick something it needs, and implement it
>>
I hate securityfags so fucking much
>>
>>103150335
not a security issue
>>
>>103150362
yes, but the securityfag is still insufferable
>>
>>103150373
the retarded nigger who wrote undocumented buggy code is who's insufferable, you should kill yourself before you create something like that too
>>
>>103148578
What the fuck, in testing this I replaced the ucrtbase.dll in system32 of the test machine, yet Windows still loads the old dll (even though I renamed it). How does it even know it's the same file...?
>>
File: 1610203684464.gif (11 KB, 300x300)
11 KB
11 KB GIF
>>103139772
Well, that's fucked.
After >>103144147 I looked into what was more expensive on my machine. Turns out that unaligned WORD PTR writes are not very expensive, same as moving shit into DH (no partial register stalls - yes, I'm still compiling with -march=native -mtune=native). But guess what *was* very expensive.

That's right, MOVZX.

I attempted to use this monster to have GCC avoid issuing a MOVZX instruction:
typedef union
{
unsigned short u16;
struct{unsigned char low;unsigned char high;}u8;
}split;
void foo(random_data*restrict rd,unsigned char p)
{
split pp;
pp.u8.low = p;
pp.u8.high = ' ';
*(unsigned short*)rd->out = pp.u16;
rd->out += 2;
}

, but that failed miserably, so I brought out the big guns:
void foo(random_data*restrict rd,unsigned char p)
{
asm
(
"mov $0x20,%%dh\n\t"
"mov %%dx,%0\n\t"
:"=m"(*rd->out)
);
rd->out += 2;
}

mov rax,QWORD PTR [rcx]
add QWORD PTR [rcx],0x2
mov dh,0x20
mov WORD PTR [rax],dx
ret

Thoughts?
>>
>>103150534
>foo
I think you aren't interested in solving real problems.
>>
>>103150546
And I think I don't need thoughts from you.
Funny world, innit.
>>
>>103150555
common among midwits
>>
File: 1722746509479054.png (3 KB, 1349x23)
3 KB
3 KB PNG
and this isn't even its final form...
>>
>>103150534
Huh, it's even smart enough to do this:
void foo(random_data*restrict rd,char p)
{
asm
(
"mov $0x20,%h0\n\t"
"mov %w0,%1\n\t"
:"+r"(p)
,"=m"(*rd->out)
);
rd->out += 2;
}

Shame that the compiler insists on avoiding partial register stalls.
>>
File: 1719783541266993.jpg (123 KB, 537x536)
123 KB
123 KB JPG
>>103150633
I always get a squiggly line in VS telling me to make WinMain static but if I do that then my program doesn't even compile. Also warnings for not explicitly using the SAL annotations? They should probably ditch those at this point since standard attributes are/will cover the same semantics and be redundant.
>>
>>103150638
shame that you insist on being a nocoder who is trying to optimize 8 byte write on a 64 bit machine that can write data at 50GiB/s
>>
>>103150633
Bjarne says to use anonymous parameters if you don't use them
>>
>>103150660
>unable to see the bigger picture
Common amongst incompetent distractors like you.
>>
>>103150534
why is MOVZX expensive?
>>
File: 1726888894917557.png (57 KB, 658x593)
57 KB
57 KB PNG
>>103150728
it's not?
>>
>>103150722
Yes, you nocoders are unable to see the bigger picture.
Your irrelevant 8 bytes at a time code will never be 50GiB/s try using 64 bit registers at the minimum next time.
>>
File: 1610201439552.png (569 KB, 993x765)
569 KB
569 KB PNG
>>103150728
I don't know *why* it's expensive. What I know is that with this line:
movzx %bl,%ebx

my unaligned writes take 533785c / 131072 = 4c per iteration, and without it they take 291690c / 131072 = 2c per iteration. That tells me that partial register stalls are *not* the problem.
>>
>>103150752
>try using 64 bit registers
Those take 356615c. I'm not interested in garbage suggestions from someone incompetent like you.
>>
>>103150795
>muh latency
not as high as one in your brain, try not being a poor corelet
>>
>>103150806
I'll try once you post relevant code of your own, thus finally ridding yourself of the nocodeshitter stench.
>>
>>103150812
Okay, state the problem you're trying to solve (the one that has nothing to do with your microbenchmarks).
>>
>>103150833
>he doesn't know
Read the thread, don't waste our time.
>>
>>103150849
concession accepted, nocoder, I hope you will have fun tinkertrannying with your imaginary single byte registers
>>
File: ClipboardImage.png (89 KB, 728x721)
89 KB
89 KB PNG
Why yes, I do use Microsoft Excel to write code for me.
>>
>>103149542
>>103145637
this attitude is why you will have no users
your game isn't good enough to make people switch to linux
that's just the cold hard truth
>>
>>103150746
>they're exactly the same
kek wannabe h4x0r retard who can't even write a working benchmark btfo
>>
>he believes Intel lies
This is why people call you incompetent and fling turds at you.
>>
>>103150876
I don't want you to switch to linux, I want you to be upset that your life choices made you unable to consoom brainlessly.
>>
>>103150897
>I want you to be upset
No one is going to get upset because they can't play your shitty game
Your game needs to be really good for that to happen
>>
Good thing we have tons of sensible comsoom providers that no one needs you.
>>
>>103150907
You're already upset at a hypothetical. I already have what I want. I don't even need to make a game at this point.
>>
>>103150867
>L"NONE"
Why? There's VPUNPCKLBW and VPUNPCKHBW if you need to write them somewhere.
>>
I have a question about NPUs in general.
M2 Ultra in the $4,000 Mac Studio has 32 neural cores and does about 32 trillion peak ops/sec.
M4 in the $600 Mac mini has 16 neural cores and does 38 trillion peak ops/sec.
How is that even possible? They're barely a year apart in release.
>>
>>103150974
this is an ARM assembler not an x86 assembler. I only put the 16-bit thumb instructions in this table because I've only done about half of the 32-bit ones and their encodings.
and yeah, i changed the ARM mnemonics to match the x86 ones because I'm lazy and don't want to remember that EOR means the same thing as XOR in x86 or that ASR means SAR
>>
>>103151010
>it's not a x64 cross-assembler for ARM platforms
>>
>>103150633
MS really needs to just write a proper win64 API and remove all the deprecated shit from the 16/32-bit days.
>>
>>103151061
since it needs full rewrite anyway, I hope they can get POSIX certified like Apple OS.
>>
>unless you're on arch, your stable compiler version doesn't support C23 and you must include stdbool.h just to have booleans in your C code
humiliation ritual.
>>
>>103151061
>>103151078
mindless updooters
>they should change it because it's... LE OLD!
nothing stops you from writing a few macros to hide any "old" stuff like reserved parameters or weirdly named functions
>>103150633
just forget about that bullshit SAL annotations. I find they don't help much and just result in the enshittification of your code.
I do however use IN and OUT (not _In_ and _Out_ because it's ugly) on all my function parameters, because otherwise, pointer parameters can be confusing at first glance (does this function write to that pointer or just read from it?)
>>103151104
typedef unsigned char BOOLEAN;
#define TRUE 1
#define FALSE 0

simple as
you don't NEEEED more
>>
>>103151159
>just reinvent everything yourself every time
humiliation ritual
>>
I love how you can pick out the distractor every single time. He never changes his script and never posts code.
>>
>>103150660
>that can write data at 50GiB/s
this is not true. String instructions (fastest shit around) go 10GB (base 10) per second on my processor.
>>
>>103151256
good job, your shitty code is as slow as my old laptop's memory
>>
>>103151233
>>
Hello /g/entoomen. I seek your wisdom concerning books for a beginner programmer.

My end game: AI and/or robotics (from industrial to whatever) from a design standpoint (management or prototyper etc)

My experience: Currently studying Electrical Engineering Technology in College (hands on engineer I guess? Between an industrial electrician and full blown engineering). I've taken a few new robotics courses working with Ardunios. Gonna get PLC exp soon.

I'm decent at math, but something I'm working on to improve, slowly working through Spivak's Calculus. I have some previous experience coding, I find I have a good head for programming, comes relatively easy to me and I'm anal about organization and neatness in code. I like to get creative with solutions.

I have a few books in mind I also want to pick up:
Code Complete 2nd ED
Head First Design Patterns Into Design Patters: Elements of OOP
Algorithms Unlocked Into Introduction to Algorithms (Thomas H. Cormen)
Code: The Hidden Language of Computer Hardware and Software
Structure and Interpretation of Computer Programs
Refactoring: Improving the Design of Existing Code

Took these books from the highest rated/most recommended lists, are they memes? Worth my time?

I'm looking to start learning C, Python, Java and get into R, Lisp, C++ later on. I guess I'm asking you guys what are some solid books, in your opinion, that I can get to start learning the first 3 languages. THANK YOU IN ADVANCE.
>>
>>103151159
>BOOLEAN kmx_bool = FALSE;
nocoder.
typedef uint8_t bool_t;
>>
File: chud_detransing_hydra.png (453 KB, 1488x928)
453 KB
453 KB PNG
>>103151271
>literally go as fast as the processor can go
>"your code is shit"
kek
this tranny is so retarded.
>>
>>103151314
>bool_t
you're the nocoder, repeating same babyduck mistake
>>
>>103151326
>processor only can go as fast as DDR3 1333Mhz laptop memory from early 2010s
I'm sorry that you got scammed, but that's not my problem.
>>
File: komeji_suicide.jpg (195 KB, 850x1197)
195 KB
195 KB JPG
>blablabla i cut my dick off and need attention :(
>>
>>103151159
>they should change it because it's... LE OLD!
they should change it because it's full of legacy baggage, you read through the documentation and half the functions have *superseded by* notes, deprecated parameters being thrown around all over the place, bizarre types that don't make sense outside of the 16 bit era, all kinds of shit polluting the documentation and the namespaces. hell, just having clean headers would solve a lot of that

maybe they'll get around to it when they reimplement win32 as a c++ module because they're totally going to do that eventually... right?
>>
>>103151336
no laptop ever goes faster than what i said, because no laptop ever does pcie. You are a retard tranny who doesnt know where bottlenecks happen.
>>
>>103151307
>C, Python, Java and get into R, Lisp, C++
You'll be garbage in every single one of them. You should focus on C first and *really* get to know how things work and what code generates what instructions. And that will take years.
>>
>>103151349
bottlenecks happen in memory accesses, and 10GB/s is DDR3 RAM at 1333Mhz, way to out yourself as a poor favela monkey.
>>
>>103151341
>when they reimplement win32 as a c++ module
usecase?
>>
>>103151356
yes and the processor is connected to memory via magic, thank you for making nobody doubt you are a transsexual retard.
>>
>>103151373
Again, way to out yourself as a poor favela monkey...
>>
File: need_attention.png (110 KB, 849x402)
110 KB
110 KB PNG
>>103151338
I'm going to steal that one.
>>
File: 1704920686208391.jpg (32 KB, 372x372)
32 KB
32 KB JPG
>>103151362
>usecase
Imagine this: you're a C++ programmer writing Windows programs in the preferred language of Windows programmers.
>>
File: ntcreatefile.png (23 KB, 1038x724)
23 KB
23 KB PNG
>>103151381
>implying Windows programmers know what they're doing
>>103148170
>>
>>103150980
NPUs aren't even a real thing, neither are neural cores, it's a nonsense term apple invented that doesn't have an actual definition
it's probably just a processor based on an large vector ARM GPU without graphics but who knows
given the cores went down by 1/2 and the speed went up but not by much they probably widened the SIMD lanes per core while reducing the overall core count
make them individually better at bulk processing so you need less of them
>>
>>103151388
C26 bussin
>>
>>103151355
https://www.youtube.com/watch?v=qXAVQTNrBEk
>>
>>103151401
It's gonna be a shitfest.
>>
File: 1730675437607191.png (3 KB, 389x106)
3 KB
3 KB PNG
bros... they've been playing us for fools
>>
File: 1623442250049.jpg (86 KB, 900x472)
86 KB
86 KB JPG
>>103151404
>overcoming perfectionism
>jewish face
>>
>>103151404
at least he didn't drag out the video to full 10 minutes and rambled due to being retarded as opposed to being intentionally obtuse
>>
>perfectionism
uhhh, if you wrote perfect code then you'd be out of a job as soon as it's done

write broken code that only you understand for job security
>>
File: part_of_the_problem.png (397 KB, 828x683)
397 KB
397 KB PNG
>>103151502
We have been doing that for a couple decades now. Doesn't work.
>>
File: 1706557709487027.jpg (13 KB, 142x250)
13 KB
13 KB JPG
>>103151406
that's what we in the industry call a zero-cost abstraction
>>
>>103151536
what did that "abstraction" enable?
>>
File: 1717272429409489.png (195 KB, 640x513)
195 KB
195 KB PNG
>>103151541
racism
>>
>>103151541
Not having to write * if you want the value.
>>
>need to run code at 60hz
>hardware can't just do it natively
humiliation ritual
>>
Let's say I want to make a "64KB demo". How do I ensure the code is under 64KB and the memory model only goes up to 64KB? Should I make it bare metal?
>>
>>103151548
... and what does that enable? confusion?
>>
>>103151406
So does that mean there's no way to pass a variable by reference without going through a pointer?
>>
>>103146871
...I still can't decide which of these 4 to do. Man, I'm too autistic/adhd for my own good.
>>
>>103151582
stop tinkertrannying with templeOS before you brick your machine
>>
>>103151589
globals
>>
>>103151406
Yeah, no shit Sherlock. Anyone who's RE'd C++ code for years already knows that references are just thinly disguised pointers
>>
>>103151589
https://i.4cdn.org/g/1731267831706634.jpg

>>103151593
yeah you are le cool autist who will write a 100k line operating system with no bugs, supporting more hardware than freebsd and faster than linux in 2 weeks, resting on sundays and sabbaths.
>>
>>103151606
I don't intend to make a serious practically-usable OS if I make an OS, just a random side project to practice coding.
>>
Idea: Make the virtual pet and the "hobby x86 OS" the same project
Or at least, a bare metal """OS""" that just has a digimon/tamagotchi in it
>>
>>103151589
any other method of trying to accomplish directly accessing variables in other stack frames would be slower than just using a pointer
>>
>>103151626
i'll make the logo
>>
>>103151626
i will make the (micro)kernel.
>>
>>103150264
No I am essentially wasting time writing the same shit over and over because of some shared elements. The first program calls the second program, it would have been nice if I could have shared the constants, which I could do now quite easily, but the rest I'd have to make an itinerary and do really big refactorings. It is relatively unfortunate.
>>
>>103151582
Lie and deceive people by linking to hundreds of megabytes of dependencies dynamically, resulting in a very small binary that still needs megabytes of memory to run.
>>
File: 1730365127707886.png (12 KB, 610x601)
12 KB
12 KB PNG
what did carmack mean by this
>>
File: foocked.png (28 KB, 1000x714)
28 KB
28 KB PNG
#include <stdint.h>
typedef struct{uint32_t a;uint32_t b;int done;}my_struct;
static my_struct array[] =
{
{1,2,0},{3,4,0},
{5,6,0},{7,8,0}
};
#define ARRAY_SIZE(arr) ((sizeof(arr) / sizeof((arr)[0])))
uint64_t foo(void)
{
uint64_t ret = 0;
for(size_t i = 0;i < ARRAY_SIZE(array);i++)
ret += array[i].a * 2 + array[i].b;
return ret;
}

Optimized to:
mov eax,0x34
ret


Let's change the loop:
for(size_t i = 0;i < ARRAY_SIZE(array);i++)
{
array[i].done = 1; /*NEW*/
ret += array[i].a * 2 + array[i].b;
}

Optimized to picrel.
>>
>>103151804
Zeroing out the stack? Sounds like a waste of CPU cycles, especially in a video game. Debugging maybe?
>>
>>103151838
maybe he hallucinated that his kernel doesn't already provide zero pages?
>>
-fno-strict-aliasing makes my code 64 bytes smaller and 5 times slower
what gives?
>>
File: foocked_the_second.png (32 KB, 1006x881)
32 KB
32 KB PNG
>>103151805
Wait, it gets even better:
uint64_t foo(void)
{
/*Only reading*/
uint64_t ret = 0;
for(size_t i = 0;i < ARRAY_SIZE(array);i++)
ret += array[i].a * 2 + array[i].b;
return ret;
}

void bar(void)
{
/*Only writing*/
for(size_t i = 0;i < ARRAY_SIZE(array);i++)
array[i].done = 1;
}
>>
>>103151879
Strict aliasing lets compiler assume a lot of things and optimize code, it can't do that if you break those assumptions.
>>
>>103151879
Did you consider reading the disassembly?
>>
>>103151932
>why does compiler output different assembly?
>read assembly
assemblytards...
>>
>>103151950
>>103151338
>>
>be retarded
>post troonhou
yup, it's /g/
>>
>cuts dick off
>needs attention by slinging shit
Yup, it's the nocodeshitter
>>
>>103146705
>>103149753
what 6502 hardware are you programming for?
>>
AllocConsole();
FILE* fp;
freopen_s(&fp, "CONOUT$", "w", stdout);
std::cout << "the n-word\n";

is that really how you attach a console to your GUI app? seems convoluted
>>
>>103152189
Why do you need a console at all? Why can't your users just launch it from one if they need this output?
>>
>>103152201
? seemed like a good way to enter commands at runtime while debugging
>>
>>103152234
>Debugging
so launch it from console and the console will be preallocated for your program with no extra code, you can even disable console output in release, users don't know how to read logs anyway
>>
>>103152243
I mean, I'd like to also simultaneously use the vs debugger for doing the actual debugging
>>
>>103152268
if vs debugger can't attach itself to a running process then I'm not sure what to say
>>
$ gcc -std=gnu23
gcc: error: unrecognized command-line option '-std=gnu23'; did you mean '-std=gnu2x'?

Humiliation ritual.
>>
>>103152282
idk seems like it'd be easier to just have some conditional debug code that allocates a console anon, I'm just not sure if what I posted is the normal way of accomplishing that or just google slop
>>
I want total python death for christmas please
>>
>>103152305
It's probably what you have to do if vs can't run it in vs terminal and debug it at the same time
>>
>>103151887
Alright, I'm running out of ideas on how to tell the compiler what is immutable and what is not:

typedef struct
{
const unsigned a;
const unsigned b;
}immutable;
typedef struct
{
int done;
}mutable;

typedef struct
{
const immutable immu;
mutable mu;
}my_struct;


As long as bar exists the compiler assumes my_struct is modifiable as a whole
>>
>>103152297
>error: user did not donate to starving ugandan children
>>
File: 87240-consoles.png (22 KB, 547x891)
22 KB
22 KB PNG
>>103152201
that's not how the windows terminal works.
if you make a /subsystem:console application it will always give you a console, if you make a /subsystem:windows application, it will disable the console even if you launch the application from a console.
If you want to support a console without it on by default, the best alternative is to add a program argument parser so that entering "game.exe -console" would manually allocate a console, in that case you probably want to use AttachConsole(ATTACH_PARENT_PROCESS); instead of making a brand new console so that the terminal that entered the arguments would gain the output (but you probably want another option like -newconsole to create a new console just in case there is a situation you need that, like a config file that does not have a parent console).
>>103152189
Personally I think it's better to just use /subsystem:console and just disable it on release. If console commands are common, try to draw your own console into your GUI application and just use the terminal as a backup or something.
The problem with entering commands into the console is that it's also a place that people will often dump diagnostic logs, so it's quiet troublesome to type something into the console when something is printed at the same time, maybe this justifies having 2 consoles, one for printf logs, one for entering commands.
If you just want a low overhead UI for a semi-headless server (a server that is not running on a headless server?), you might consider using a gui like QT to print the log in a formal UI, that's what quake does I think (you see it when the game is initializing). The problem is that you will be searching for a QT example that has a log that scrolls down when new messages arrive, but also what's the point of the scroll bar if it is always scrolling to the bottom when a new message is printed (this is a problem with most terminals I think), that's tricky, and getting color working and stuff working is annoying too.
>>
>>103150064
I don't think using maps over objects is a particularly good idea.
When I refactor python code, every time there's a dict with all fields known, I replace it with a data class. Much better to access fields via a static name than this sting-ly typed bullshit. Better for static analysis too.
What you should do is keep the dataclasses light. Their only responsibility should be holding data. If you need some object logic, put it in an object that contains the dataclass. That way you avoid the "weird little DSL" effect he talks about.
>>
>>103145587
Is it too late to learn programming at 26 to learn a decent living if i'm europoor? I spent my life with computers
>>
>>103153302
sure, just dont visit /dpt/, you dont have enough mental illness to post here.
fo to /twg/, maybe webdev general too.
>>
>>103153441
Thank you I will, I've had enough of working with people I just want a job where I'm alone
>>
>>103153465
nah you are going to work with people, the reason why everyone in /dpt/ is mentally ill is because they work alone and make no money from the work. I assumed you wanted a job.
>>
>>103150064
>a hashtable is a map
I hate this stupid map terminology
>>
File: 1725514386601667.jpg (32 KB, 500x500)
32 KB
32 KB JPG
Using C#, is it possible for a simple console application to achieve a tickrate of 60 per sec, when Thread.Sleep(long millisec) seemingly won't sleep for any less than about 15 milliseconds?

namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
DateTime LastTime = DateTime.Now;
DateTime CurrentTime;
while (true)
{
CurrentTime = DateTime.Now;
TimeSpan span = CurrentTime.Subtract(LastTime);

Thread.Sleep(1);

Console.WriteLine(span.TotalMilliseconds);
LastTime = CurrentTime;
}
}
}
}
>>
come collect your schizo back please

>>103153665
>>103153761
>>103153937
>>103153877
>>
File: 1711028680847.png (25 KB, 627x340)
25 KB
25 KB PNG
>>
>>103154050
White/gray means that all channels are the same color. Maybe don't set everything the same color?

>>103153993
Not my problem.
>>
>>103145951
lmaooooo
>>
>>103153852
You could use Thread.Yield with a timer, but that will eat up cpu when there's nothing else to do. Games usually achieve 60 fps by waiting on vsync. Why do you care about being exactly 60 fps if you're not rendering stuff to the screen? Just do sleep 1 or sleep 16 or whatever and let the OS sleep your program for however long a timeslice is and don't worry if it's not exactly the time you specified.
>>
File: 1704008523429.png (14 KB, 732x170)
14 KB
14 KB PNG
>>103154190
>>
File: 1727487497886.png (5 KB, 426x114)
5 KB
5 KB PNG
>>103154549
>>
>me being shit at communication is somehow other people's fault
Can you stay with GPT? Like, forever?
>>
File: file.jpg (53 KB, 1200x514)
53 KB
53 KB JPG
>>103145587
>Babby's Intro to Python class
>FizzBuzz took me 40 minutes to figure out
I'm glad I wasn't planning on programming as a profession.
>>
File: 1728661865652147.png (228 KB, 1848x2018)
228 KB
228 KB PNG
>>103155398
At least you managed to figure it out, didn't you?

Didn't you?
>>
>>103153843
A hash table is an implementation of the abstract data type called a map
>>
>>103155428
>One week into programming
>Already better at algorithms than front-end JS developers
holy shit lmao
>>
>>103153843
I dislike the name map too, because it clashes with the name of the higher-order function. I prefer table, dictionary or associative array.

But not all maps are hashtables. Among other things, what Clojure calls a record is essentially what >>103152705 is talking about, i.e. an object/struct that holds static data in a fixed number of named fields that can be accessed quickly. Then there are arraymaps a.k.a. arraylists that work by checking every item for equality with the given key instead of by computing a hash. It's the same abstract idea of an associative datastructure, but with different implementations.
>>
why the fuck are you people contributing to the increase of technology instead of trying to reverse it and but the kibosh on industrial society
explain to me
>>
>>103155898
>someone used a sword to kill my brother
>ban all swords
>>
>>103155898
No one's going to shoot up Congress again, so we had to get creative.
>>
>>103146481
C# has nothing to do with C
C# is just Java
C# will never be a C lang
>>
File: 1709008488656.png (12 KB, 714x196)
12 KB
12 KB PNG
>>
>>103152649
Yep. Using the console on Windows is basically just intended for legacy DOS based programs.
If you need an extra window for inputting text commands you should forget all about the console and just create an extra dialog that has 2 edit controls (one single-line edit for your command and one multi-line for your output). Much easier and doesn't look janky.
Any Windows program that opens random dos boxes just seems janky to me and screams that it was written by a Linux user that is hard-wired to think in terms of consoles and terminal windows.
>>
File: 1722746844564213.jpg (459 KB, 828x882)
459 KB
459 KB JPG
>>103154254
Mostly curiosity, and wanting to simulate a few ideas with simple visuals in the console window.
>>
File: 1508354319964.jpg (43 KB, 493x449)
43 KB
43 KB JPG
i'm writing a program which, given a string, will return the name of the service and what team owns it. the problem is the names of some components are called different things. e.g. we have a service called "event simulator", but some people just call it "simulator" or even "simulation".

i'm thinking of just including a range of hardcoded synonyms which all map to the same service info, but is there a better way of doing this? only other way i could think of is using some vector embeddings to find the similarity, but that seems way too heavy.
>>
>>103146350
am i not writing malware?
>>
>>103156656
those people better fucking learn to code.
>>
File: c64.jpg (1.12 MB, 2000x1634)
1.12 MB
1.12 MB JPG
>>103151987
The assembler has macros for C64 because that's what I know, but it could conceivably have features for other platforms too.
>>
Are all branches evil, or only the conditional ones?
>>
jump != branch.
>>
>>103157364
Jumps are based, branches are cringe
>>
Going to try to cross post this while I'm struggling with the fucking /fwt/ thread.

I'm having an issue with Git. I copied my project over to my laptop using a thumbdrive. My project files are fine, but the git repositories I took with them are not. Every action I can think of to take with the git repository results in a
>fatal: Invalid path 'C:/Users/[desktop username]': No such file or directory
How can I fix this? (No, config core.protectNTFS false did not work, it ALSO resulted in the same error.)
>>
>>103157446
>>103157455
Wrong: https://stackoverflow.com/questions/67432021/why-do-unconditional-jumps-take-up-btb-space
>the CPU wants to fetch the next instruction at an earlier time when it does not yet have the opcode, so the BTB effectively serves as a cache not only for the jump destination, but for the fact that there is a jump instruction at this location

All jumps are evil, even the unconditional ones. That's why loop unrolling exists.
>>
>>103157478
loops are conditional jumps though retard
>>
>>103157470
There's likely an absolute path in the git metadata, you can try grepping through all the shit in the .git folder to find that path and fix it to point to wherever it should be pointing now. But if the project is on git, why not just re-download it on the new PC? Isn't that the whole point?
>>
>>103157470
install linux
>>
>>103157547
>loops are conditional jumps though retard
do_something_that_sets_flags
jae outside_loop
do_something_else_that_needs_to_be_done
jmp do_something
>>
text = "Hello123 World! This_is a-test."
words = ["".join([char for char in word if char.isalpha()]) for word in text.split()]
words = [word for word in words if word]


chatgpt is truly a comedian sometimes
>>
>>103157554
>metadata
God damn it. Alright, guess I'll check it out. It's retarded that git automatically generates fucking absolute path metadata though.
>if the project is on git, why not just re-download it?
Because it's a local git repository, not on Github or Gitlab.

>>103157566
So far, I've had exactly 2/49 successful attempts with Linux. I'm done with it. It's not my style.
>>
>>103157579
>missing that the jnb on the second line is a conditional
>>
>>103157842
No, that's the point. I want to save on a cmp.
>>
>>103146434
what was it like having to purchase programming tools for upwards of ~$1500 in modern day bucks

Seriously, how the fuck did anyone learn anything when they had to drop a car's worth of bread down to even make a fucking program?
>>
Thanks anon to who managed to find the issue. I'm going to have to come up with a brand new script to adapt to that. Fucking Git...

>>103157884
Well, for starters, if you could afford a computer, you could generally afford to spare some cash for the dev tools too. Secondly, if you couldn't, basically every computer came with some form of assembler, so as long as you had access to the opcodes, could manually make programs. That's why assembly was so popular.
>>
>>103157884
You could get a compiler from Borland for a lot less than that. It was still a cost, and way more of a barrier than the "just download it for free" system we have today, mostly thanks to GNU. Major compilers started offering free versions after ports of gcc, gas, nasm, etc. and Wine-derived Win32 headers started appearing as free downloads.
>>
>>103157956
The more I'm learning about compilers the more I'm convinced they were a mistake:
>>103151805
>>103151887
>>
>>103146481
>>103146525
ftfy
>>
>>103155941
>C# is just Java
No, but it's in much the same sort of space. A little bit stronger in games, a bit less strong in enterprise; both are due to what libraries/frameworks are available for each.
>>
>>103157992
>rust above C++
hoo boy
>>
>>103157818
>It's retarded that git automatically generates fucking absolute path metadata though.
It's probably due to exactly how the repository was created; if an absolute path was used then, that's in the metadata.
>>
>>103158015
so sorry the sloplang will not be considered a robust tool. Wasn't good enough to cut it for the Kernal, only good enough to cut it for winblows.
>>
>>103158069
>C++
>sloplang
bruh
>>
>>103158069
>will not be considered a robust tool
But it already has by millions of people?
>>
>>103158033
I just looked it up, it turns out that config's worktree will ALWAYS normalize into an absolute path, which is where the error is coming from. Infuriating does not cut it.
>>
>>103145587

I am trying to solve Leetcode 3023

https://leetcode.com/problems/find-pattern-in-infinite-stream-i/description/

Basically I'm trying to do prefix search. My algorithm works if I have random access to the stream data directly, but in this case, leetcode doesn't give me anything of the sort. Instead I have to depend on `.Next()`, which yields an element from the stream.

This is my code. Anyone help?

package main

import "fmt"

type InfiniteStreamer interface {
Next() int
}

type InfiniteStream struct {
data []int
i int
}

func (is *InfiniteStream) Next() int {
val := -1
if is.i < len(is.data) {
val = is.data[is.i]
}
is.i = is.i + 1
return val
}

func _lps(pat []int, M int, lps []int) {
len := 0
lps[0] = 0
i := 1

for i < M {
if pat[i] == pat[len] {
len++
lps[i] = len
i++
} else {
if len != 0 {
len = lps[len-1]
} else {
lps[i] = 0
i++
}
}
}
}

func findPattern(stream InfiniteStream, pat []int) int {
M := len(pat)
lps := make([]int, M)
_lps(pat, M, lps)

i, j := 0, 0

for {
current := stream.Next()
if current == -1 {
return 0
}
if pat[j] == current {
i++
j++
}
if j == M {
return i - j
} else if pat[j] != stream.data[i] {
if j != 0 {
j = lps[j-1]
} else {
i++
}
}
}
}

func main() {
is := InfiniteStream{[]int{1, 0, 1, 1, 0, 1}, 0}
fmt.Println(findPattern(is, []int{1, 1, 0, 1}))
}


It correctly answers 2, however again, in the LC environment, I don't get access to .data...
>>
>>103158149
I haven't looked at the problem, but there is a strings.HasPrefix() in the standard library.
>>
>>103158149
post the whole question, faggit
>>
>>103158168

I'm trying to implement the KMP algorithm because it yields ints representing bits
>>
>>103158183

I didn't know it was paywalled

https://pastebin.com/spzf7KxD
>>
>>103158221
firstMatch :: Eq a => [a] -> [a] -> Maybe Int
firstMatch needle haystack = findIndex (and . zipWith (==) needle) (tails haystack)

I think the challenge is to process the needle somehow to do it faster.
>>
>>103158149
>>103158221
The constraint says that the start index is in the first 105 bits, and the max pattern length is 100, so you only need 205 bits in the worst case. Just call next() 205 times and store the results in an array, which you can randomly access.
>>
>>103158081
>>Sloplang
>>sloplang
>bruh
bruh
>>
>>103158443
>Maybe

I hate the Maybe abstraction

https://youtu.be/YR5WdGrpoug
>>
>>103158536
>more Rich Hickey porn
>>
>>103158536
dumb complaints
>>
>>103158661

you are a dumb complaint
>>
>>103146583
this is, indeed, the best part about OO
>>
https://github.com/hyperlight-dev/hyperlight/
MS put out a library for letting an application run code in a virtual machine at the function level
apparently works on linux and windows, mostly rust but the VM side of the codebase appears to have a C API
>>
>>103158536
I like Clojure and I use Maybe all the time in malli

it's not like Rich has actually come up with something better
>>
>>103158949

>Micro$hit

IIINTO THE TRASH IT GOES
>>
File: gigabyte_stack.png (21 KB, 1094x104)
21 KB
21 KB PNG
>download a helpful rust program
>it uses recursion
>to cope with stack overflows, it uses GIGABYTE stacks
>instantly crashes from running out of memory
Recursion should be banned and never taught in schools. There is always a better way to solve your problem.
>>
Exhibit A. If you feel tempted to use gigabyte stacks, maybe you should consider if there's a simpler way to solve your problem.
>b-b-but then I won't be able to use recursion
That's the point.
>>
>>103158536
I wonder what the generalization of the following is:
class Neg a where neg :: a -> Int
instance Neg (Maybe a) => Neg a where neg = neg . Just
class Pos a where pos :: Int -> a
instance Pos a => Pos (Maybe a) where pos = Just . pos

As in there's a function
hickey :: _ => f -> g
that inserts the missing Just so you don't have to write a class for every use, but
doublehickey = hickey . hickey 
creates an intermediate value whose type probably has to be settled using -XIncoherentInstances.
>>
>>103159046
Or perhaps emulate recursion via while loop
// from
fn fac(x: usize) -> usize {
if x <= 1 { 1 }
else { x * fac(x - 1) }
}

// to
fn fac(x: usize) -> usize {
let mut acc: usize = 1;
while x > 1 {
acc *= x;
x -= 1;
}
acc
}
>>
>>103158970
don't exactly see a market full of alternatives
with how comprehensive qemu is i'm surprised it didn't already have something like this
>>
>>103159124
Indeed, using loops are exactly what you should do. And if you absolutely need a stack, then allocate one separately from the call stack so you don't run into overflow issues.
>>
>me when I program (new at this) :3
int* p
>what I see when looking at other people's code :(
template< class Y >
const shared_ptr( const shared_ptr<Y>& r, element_type* ptr ) __p;
>>
>>103158949

>rust

IIINTO THE TRASH IT GOES
>>
>>103159064

> doublehickey

You... you... DOUBLE HICKEY!
>>
>>103158536
>break API
>woooooooooah why the functions don't just figure out that a ~ Just a and automatically swap
You solve it with a replace all macro and 5 minutes.
Using maps, now try figuring out which ones became null pointers before deploying to prod.
>>
>>103159304

>Java programmer be like "Ah, yes, the request to create a user is a request to create a user because I named it CreateUserRequest"
>>
I HEKKIN LOVE C
void get_listings_SMALLDATABASE(char_t* listmap, uint64_t fsz, STRING2D_T* taglist, listing_draft_t* RETURN_LISTINGS){
for (uint64_t base = 0; base != -1; base = strpos(listmap,"\nPostID=",base,fsz)){

char* listing_tags = substr_stringdelims(listmap,"TagList=","\nPostingTime=",base,fsz);
if (listing_fits_tags(listing_tags,taglist) == FALSE){
memfree(listing_tags,strlen(listing_tags));
continue;
}

char* post_time_unix_sec = substr_stringdelims(bigstr,"PostingTime=","\nLISTINGEND",base,fsz);
listing_draft_t newdraft ={
.post_time_unix_sec = strtoll(post_time_unix_sec,NULLPTR,0),
.binary_id = substr_stringdelims(listmap,"","\nTitle=",base,fsz);
};

new_draft_overtakes(&newdraft,RETURN_LISTINGS);

memfree(listing_tags,1+strlen(listing_tags));
memfree(post_time_unix_sec,1+strlen(post_time_unix_sec));
memfree(binary_id,1+strlen(binary_id));
}
print_listing_ids(RETURN_LISTINGS);
}
>>
>>103159165
>the powerful safe expressive language of the future
>just allocate your own stack and simulate function calls with a loop
really now
>>
>>103159257
It do be like that
>>
>>103160543
Programming?
>>
>>103160571
I hope it fries your entire hardware.
Hopefully that will stop you from posting irrelevant questions in wrong generals.
>>
>>103160549
I'm retarded
>>103160605
stop being so tsundere
>>
>>103160608
>I'm retarded
>but it's your fault
Are you a woman by any chance?
>>
>>103160616
I can be if you pay enough
>>
>>103160623
Close enough.
>>
>>103160616
projection.
>>
>>103160788
Burn it in your case.
>>
>>103146434
hello fellow oldfag
>>
>>103151307
Petzold's code is absolutely fantastic.
Everyone learns from CLRS so you might want to do something else to differentiate yourself.
>>
>>103146350
call ntdll.dll+15F7A2
>>
>>103148578
https://learn.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order
>>
>>103160884
Yeah, I tried everything there and nothing works.
Adding a .exe.local file worked on some other guy's Win10 PC for some reason, but only after he rebooted (?), and it doesn't work on our Win11 test machine. I came across this page:
https://learn.microsoft.com/en-us/cpp/windows/universal-crt-deployment?view=msvc-170
which states:
>On Windows 10 and Windows 11, the Universal CRT in the system directory is always used, even if an application includes an application-local copy of the Universal CRT.
So I'm thinking M$ has stupidly removed the ability to load it from somewhere other than System32 from Win10 onwards. I don't know why it worked on the one machine, maybe there's some dev setting enabled in the registry or something like that. Anyhow it's useless unless I can make it load the local copy of the dll on all users' machines, without forcing them to mess with system32 or the registry or any other bullshit like that since these are just normie users. Oh well, I guess using a different libm is the only choice...
>>
>>103158536
Not a problem in Python.
Static type cucks in shambles.
>>
>>103161189
What a good thing Python isn't a complete and unmitigated clusterfuck in other areas.

Oh, wait, it totally is.
>>
File: 1712426255745971.png (525 KB, 675x507)
525 KB
525 KB PNG
>>103145746
I love Haskell so much, too bad I suck at it.
>>
>>103157884
>what was it like having to purchase programming tools for upwards of ~$1500 in modern day bucks
piracy existed

>>103157940
>, basically every computer came with some form of assembler,
no, they didn't. you'd be lucky if you got a machine language monitor. you usually got nothing.
>so as long as you had access to the opcodes, could manually make programs. That's why assembly was so popular.
people needed big expensive books for the CPU opcodes. are you just going to guess them? back in the 1970s and early 80s when assemblers were expensive, people did just that. they'd write in opcodes using a machine language monitor (if they were poor fags) or whatever. after that? hell no. assemblers became much cheaper and easier to find. also: typing in opcodes is just called machine language. you use an assembler to code assembly (they still cost money btw - and depending on the CPU they could be quite expensive).

>>103161222
>Oh, wait, it totally is.
works on my machine, nocoder.
>>
>>103158536
Ok this is why nobody takes foonctional programmers seriously.
>OBVIOUSLY the right option is to use maps for everything
>and then slap some specs on top of it to constrain values
Oh right, so you're gonna need a fucking hashmap data structure, a hash function, extra space to avoid collisions, and all the other bells and whistles that come with it, along with an orthogonal type checker, instead of just creating a struct with named fields that will just compile to indices lookup?
>muh the compiler will fix it
>muh performance doesn't matter
>muh computer science isn't about computers
Then leave the computers alone.
All that because of the "changing API will break callers" problem. Which is not even a real problem. If I change my return type from an optional to a concrete, I don't WANT the callers to compile. Otherwise they'll just stay as they are, with their now useless option-checking code laying there as never-taken branches, adding bloat for no value.
Concretes not being acceptable as optionals is the language working as intended.
>>
>>103161405
>adding bloat for no value.
they just don't care, which is unfortunate.
>>
>>103161349
>works on my machine
Since when is that a criteria? Real programmers talk performance, and since you don't you're not.
>>
>>103161526
works on my machine, nocoder.
>>
>>103161563
Answer the fucking question, nocoder.
>>
>>103158536
that whole talk is pretty dumb and Hickey never coming out with the mythical Spec2 where he was supposed to "solve" this non-issue had a terrible chilling effect on the Clojure ecosystem for years.
Tool makers didn't want to go all in on supporting Spec1 or Malli "when Spec2 is right around the corner."
That's half a decade worth of work on static analyzers, completion frameworks, editors, debuggers and so on down the drain.

>>103159124
that's basically what Clojure's recur does:
https://clojuredocs.org/clojure.core/recur
If a recursive operation cannot be optimized this way, it simply won't compile.

>>103161405
>this is why nobody takes foonctional programmers seriously
Maybe types are a foonctional concept in the first place

>instead of just creating a struct with named fields that will just compile to indices lookup?
Clojure does this via records, which can be used by most of the same functions as maps:
https://clojuredocs.org/clojure.core/defrecord
you are confusing the abstract concept of a map (associative data structure) with the concrete implementation of hashtables

>I don't WANT the callers to compile. Otherwise they'll just stay as they are, with their now useless option-checking code laying there as never-taken branches, adding bloat for no value
I half-agree. I want there to be compiler warnings so I can take care of the dead code when I have time, and ideally I want the compiler to be smart enough to eliminate the dead code automatically.
Failure to compile may mean that I incur downtime and have to do a bunch of refactoring in an emergency session just so my website can run again after I updated some library.
>>
>>103161476
>>103161405
In Hickey's defense, he works for a bank. You know, the kind of organization where they prefer to take the performance hit from running COBOL in a virtual machine rather than refactoring code that has been working for half a century.

also, NEW THREAD:
>>103161905
>>103161905
>>103161905
>>
File: file.png (151 KB, 640x610)
151 KB
151 KB PNG
>>103161526
>Real programmers talk performance
>>
>>103163033
t. not a real programmer
>>
>>103163051
t. makes $60k/yr despite working in a competitive industry
>>
>>103163081
>he thinks he's working in a competitive industry
I guess it is if you're not a real programmer.
>>
>>103163093
keep crying
>>
>>103163101
Over what? That I make bank over incompetent programmers like you being incompetent?



[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.