/dpt/ - Daily Programming Thread
Anonymous 01/21/25(Tue)16:11:30 | 114 comments | 27 images
he'll yeah
What are you work on, /g/?

Prev: >>103945044
Anonymous 01/21/25(Tue)16:31:53 No.103984529
Swift is the best programming language ever made
Anonymous 01/21/25(Tue)16:33:53 No.103984554
>>103984529
If you don't care about performance, sure.
Anonymous 01/21/25(Tue)16:39:23 No.103984628
>>103984278
Wow very relevant image that will surely only attract relevant posts!
Anonymous 01/21/25(Tue)16:48:07 No.103984755
>>103984529
>using apple vendor locked language
Anonymous 01/21/25(Tue)16:59:11 No.103984879
1690586089986291
>>103984628
Sure, let's talk about how the industry deserved worse.
Anonymous 01/21/25(Tue)17:24:08 No.103985228
Are dependent types worth it?
Anonymous 01/21/25(Tue)17:26:48 No.103985273
>>103985228
sort of
Higher-rank types, GADTs, existential types and type families are, and having dependent types covers all of them
Anonymous 01/21/25(Tue)17:52:31 No.103985635
cutegirlwithcat
I want to connect to pages and read their dom trees every other minute, preferably in my java program. How do I go about doing this? I've tried htmlunit, but whenever I attempt to connect, even with javascript turned off and mimicking a chrome browser, I get a 403 error, which I think means that cloudflare is interfering. I've gotten a header once, but that's it.
Anonymous 01/21/25(Tue)17:54:02 No.103985655
Obviously Obsolete Programming
Anonymous 01/21/25(Tue)17:55:42 No.103985671
Anonymous 01/21/25(Tue)18:14:49 No.103985900
>>103984879
We deserved a better image from OP
Anonymous 01/21/25(Tue)18:52:07 No.103986315
>>103985900
You deserve to have your offspring raped to death in front of your eyes, and I deserve watching your mind break. Just because we deserve shit doesn't mean we get it.
Anonymous 01/21/25(Tue)18:53:56 No.103986335
>>103985635
>preferably in my java program
Rewrite it in C
Anonymous 01/21/25(Tue)19:25:34 No.103986682
1710143076785352
One of these days I want to write a new shell that completely breaks the dumbass "terminal emulator from 1980s" concept. Terminals could be so much more useful if it was just a file manager that'll let you write commands on. Just imagine writing something like "ffmpeg -i ./somefile" and as you're writing "./somefile" it shows a filtered list of files on a second view with thumbnails and everything. And then you type -vf and get the man page for filters for ffmpeg
it's gonna be called "Xinate" for "Xinate is not a terminal emulator"
Still thinking of what to replace X with though
Anonymous 01/21/25(Tue)19:35:14 No.103986776
Anonymous 01/21/25(Tue)19:45:41 No.103986899
>>103984529
>>103985655
Programmatically Enlightened Rural Language
Anonymous 01/21/25(Tue)20:07:08 No.103987149
>>103983834
https://www.shellcheck.net/
Anonymous 01/21/25(Tue)20:09:26 No.103987171
>>103986682
midnight commander
Anonymous 01/21/25(Tue)20:15:51 No.103987234
>>103987149
https://www.haskell.org
Anonymous 01/21/25(Tue)20:45:02 No.103987565
m
ay caramba, jásquel
Anonymous 01/21/25(Tue)20:52:30 No.103987633
>>103986682
terminals, terminal emulators (not to be confused with virtual consoles, which also emulate terminals), shells, and file managers are all very different things and your idea to combine these into one bloated abstraction suggests you've never researched why these systems were designed the way they were (what problems they aim to solve) nor experimented with different systems that solve those problems in different ways (like BASIC, Plan 9 rc, CP/M).
you could already implement what you're describing with actual "dumbass terminals from the 1980s"
https://en.wikipedia.org/wiki/Sixel
https://github.com/ranger/ranger/wiki/Image-Previews
if you have more fundamental problems with the technology you must stop thinking superstructurally and identify them
>that which is falling should also be pushed!
Anonymous 01/21/25(Tue)20:58:28 No.103987701
based or retarded?
using sqlite in memory database for memory management in my programming language
Anonymous 01/21/25(Tue)21:21:16 No.103987923
>>103987701
>Not using Microsoft Access for his allocations
Get good, scrub.
Anonymous 01/21/25(Tue)22:03:42 No.103988340
test
>>103984278
>What are you work on, /g/?
Implementing my widgets (5/8-9 done) now that the GUI engine is fully operational. And I started to write some docs to accompany the release should should arrive soon
Anonymous 01/21/25(Tue)22:17:55 No.103988454
>>103988340
>the release should should arrive soon
*the 0.2 release that should be ready soon.
Anonymous 01/21/25(Tue)22:54:08 No.103988799
>>103984278
I successfully logged in my router with a Python script, should I make an alternative external UI at this point? My original idea was just to read the public IP to update my DDNS without relying on an external service.
Now I can do that, but if I make a webpage I will even be able to access the router from a reverse proxy behind a VPN
Anonymous 01/21/25(Tue)23:21:15 No.103989071
>>103988973
Did you actually even read the post you're replying to?
Anonymous 01/22/25(Wed)00:47:19 No.103989739
>>103987633
Yeah shut the fuck up. When I'm opening up a tty these days 99% of the time it's to do some very basic operation on a files on my machine. Editing hosts. FFmpeg compress. Etc. I'm not thinking about how in the 80s, people needed to telnet into mainframes and they needed to figure out a way for multiple users to share a machine, and that terminals were very good for what they were designed for. Doesn't matter to me
There exists no reason why I can't click folders in a file manager, have that call
cd folder
inside a terminal in the same window, and then write my ffmpeg command. Or double click a text/plain to open it in neovim in the terminal

>sixel and ranger
Ranger is obviously a step in the right direction. But it suffers so greatly by being forced to stay in the terminal. I use it semi regularly, I knew you can display pictures in the terminal. It's just not enough
You want to know bloat? Having a billion keyboard shortcuts is bloat
Anonymous 01/22/25(Wed)01:00:48 No.103989828
>>103989739
I share the sentiment. Terminals suck and shells suck even worse. We need something new
Anonymous 01/22/25(Wed)02:01:05 No.103990274
Screenshot 2025-01-22 095021
>>103980794
this sent me down a rabbit hole
my signal handler doesn't work with -static but I'm not sure why
see picrel, what exactly does that instruction do and how can it fail?
Anonymous 01/22/25(Wed)02:27:45 No.103990442
>>103990274
FS and GS are used to store Thread-local storage information in Linux. %fs:(%rcx) is attempting to load that information into EAX and failing miserably at it for whatever reason.
Anonymous 01/22/25(Wed)02:31:34 No.103990457
>>103990442
Oh, wait, it's AT&T order - the code is attempting to *store* something (a 32-bit word) in that TLS data and failing miserably at it.
Anonymous 01/22/25(Wed)02:37:43 No.103990489
Screenshot 2025-01-22 103415
>>103990457
yeah I think you're right
it's probably trying to write EINTR into thread local errno and failing somehow
works fine with my own syscall()
Anonymous 01/22/25(Wed)02:42:26 No.103990521
>>103990489
Wait a second ... you're using _start (no glibc startup code that would likely set up errno probably, like main would) and then *use* errno regardless? Yeah, I think I found your problem.
Anonymous 01/22/25(Wed)02:45:00 No.103990546
>>103990521
>set up errno
didn't know it needed to be set up lol
thanks
Anonymous 01/22/25(Wed)02:48:03 No.103990569
>>103990546
Well, yeah. Mode switches are slow, so your TLS needs to be set up in userspace, which is usually done by the default glibc startup code.
Anonymous 01/22/25(Wed)03:37:37 No.103990930
>>103978533
You're only deleting the reference, that variable is just a pointer to the object somewhere in memory, the closure creates its own pointer too during the execution context
Anonymous 01/22/25(Wed)03:46:47 No.103990998
>>103988340
are you doing proper utf8 rendering?
Anonymous 01/22/25(Wed)04:39:12 No.103991391
1731947437633726
>>103985635
>INFO: statusCode=[403] contentType=[text/html] in the console
Pretty sure this refers to a http status code, and that I'm being denied access. Tried it on ten different sites, and it keeps showing up. I'm guessing that everything's protected by cloudflare now and that htmlunit is worthless.
Anonymous 01/22/25(Wed)04:40:35 No.103991399
status code
>>103991391
Pic's related.
Anonymous 01/22/25(Wed)06:27:17 No.103992066
neko onahole
>>103991391
>>103991399
>>103985635
>you can do it with the url and urlconnection classes
Soka. Can't interact with the sites and click on buttons, but I can read them at least.
Anonymous 01/22/25(Wed)06:33:04 No.103992114
>>103989739
You are a remarkably stupid person. Good luck with your project, I look forward to seeing exactly 0 updates in the thread.
Anonymous 01/22/25(Wed)07:24:50 No.103992568
Retard here and I have a retarded question. When I create an enum say something like:
enum foo { 
bar,
bas,
bateman
}

when I create an instance of that enum am I creating a unique instance of that enum or am I just creating a pointer to whatever it is in memory?
Anonymous 01/22/25(Wed)07:36:02 No.103992682
>>103992568
In C there is never memory associated with an enum definition. If you defined an "enum foo qaz = bateman;" then the integral object qaz of type enum foo will be reserved, but the type enum foo is not in memory, it just informs the compiler on the correct usage of objects declared to be of its type.
https://en.cppreference.com/w/c/language/enum
If you're using C++ then you're on your own but click this instead
https://en.cppreference.com/w/cpp/language/enum
Anonymous 01/22/25(Wed)07:54:40 No.103992834
>>103992682
ty for the info
Anonymous 01/22/25(Wed)08:00:57 No.103992902
>>103992568
An enum is just an integer, as in, an actual value, not "some storage in memory".
You can write
int x = bar;
and it's perfectly valid, and it's just like you wrote
int x = 0;
.

Ignoring the surprisingly complicated rules about what type of integer an enum definition turns into (and the C23 version that fixes it), writing int x; and
enum foo x;
are very similar too. Just think of it as you making an int, but with some extra type information thrown on.
Anonymous 01/22/25(Wed)08:01:30 No.103992907
>>103992902
I guess int x; is too short and 4chan strips the code tags.
Anonymous 01/22/25(Wed)08:59:24 No.103993568
Is it true that you should learn C first instead of C++ to understand memory management?
Anonymous 01/22/25(Wed)09:14:32 No.103993702
>>103993568
Of course
https://www.evanmiller.org/you-cant-dig-upwards.html
Anonymous 01/22/25(Wed)09:14:59 No.103993708
dosboxs_memory_nonsense
>>103993568
On one hand not really: it's not like garbage allocation functions don't exist in C either.

On the other hand absolutely: I have seen so many C++ projects in which it was abundantly clear the people behind the code had no idea what they were doing I couldn't even make fun of them properly because there just isn't enough hours in a day, and I'm willing to bet real money that there's a direct correlation between language used and general competency.
Anonymous 01/22/25(Wed)09:34:44 No.103993899
reactive-shadows
>>103990998
Currently only single-codepoint UTF-8 characters are supported.
But I do plan to support Unicode Plane-0 multi-codepoint graphemes soon, it's just not a priority because I personally don't use any languages or input methods that require it.
Anonymous 01/22/25(Wed)10:12:30 No.103994307
>>103993899
looks neat
>shadows
how are you going to handle blur/glow effects? shaders?
Anonymous 01/22/25(Wed)10:49:39 No.103994760
Why do so few languages offer cancellable futures?

Both C++20 and .NET have a stop source/token pattern which becomes really annoying to work with when you have a deep hierarchy of functions, and you have to pass the cancellation token at every level. This seems to be a problem across many languages, we have lots of powerful concurrency features, but very few languages and frameworks think about cancellation. Cancellation is not really necessary for a multi-threaded server, but it is absolutely necessary for a user application.
Anonymous 01/22/25(Wed)11:11:56 No.103995005
>>103992114
>one of these days
I have 2 other projects that take priority (one of which actually makes me money) + a full time job
When I retire as a millionaire at 35, maybe then I can rewrite all of the shitty code in the world
Anonymous 01/22/25(Wed)11:13:27 No.103995026
>>103994760
Because runtimes are not designed for sudden cancelations; they have userspace resources (like TLS) that need to be properly freed before the thread is dismantled in the kernel as well.
Anonymous 01/22/25(Wed)11:14:40 No.103995041
>>103995005
Since when is your job at McDonalds a "project"? Those are usually conducted only once.
Anonymous 01/22/25(Wed)11:41:27 No.103995349
transparency
>>103994307
Current shadows are just dumb solid RGBA boxes. I've added them only to do that demo. Moreover, any complex shapes that cannot be drawn with X11 primitives are CPU rendered, so blur effects will probably shit up the perfs. So I'll keep the shadows simple until I switch to a fully GPU-accelerated backend (probably Vulkan when I add a native Wayland backend).
Anonymous 01/22/25(Wed)11:46:25 No.103995412
>>103995349
It's actually pretty fucking amazing how much bullshit programmers and users alike had to accept just because frame buffer access was denied and we now had to rely on shitty abstractions from even shittier kernels. Thanks, Intel.
Anonymous 01/22/25(Wed)11:51:43 No.103995481
>>103985273
Can someone explain to me what are existential types
Anonymous 01/22/25(Wed)12:14:24 No.103995698
screencap-240206-142548-26
>>103995349
shadows can be 9 slice cached and cpu blur can be fast if you use a fast algorithm
i only use integer addition and bit shift for my blur
Anonymous 01/22/25(Wed)12:23:17 No.103995771
file
>>103995349
you can probably render shadows multiple times with decreasing opacity and increasing offset to mimic a low quality box blur
also this >>103995698
if you can render gradients it's easy, can you do gradients?
it's fun seeing how fancy you can get with limitations you have, I keep referring to Sunvox as my favorite non native GUI app that runs on literally anything, and it has a CPU fallback, it has all the fancy graphs, blurs, and glows, for multiple widgets at once.
you can probably have a dedicated thread for the GUI rendering too.
Anonymous 01/22/25(Wed)12:52:23 No.103996066
Did anyone do boot.dev's backend course? I'm wondering if it's worth it, in general I think books are a better learning tool. Idk what exactly they teach but from the list on their homepage it seems very generic.
>Python, SQL, Go, Git, Docker, bash, Kubernetes, DSA, http servers in Go
I don't need to pay a subscription to earn any of that, a book about each + docs and practice is much better than watching tutorials.
Anonymous 01/22/25(Wed)12:58:38 No.103996143
cgui-multi-threading
>>103995698
Looks nice.
Got a repo so that I could check out your blur algo?

>>103995771
>you can probably render shadows multiple times with decreasing opacity and increasing offset to mimic a low quality box blur
I may try that, thanks for the suggestion.
>you can probably have a dedicated thread for the GUI rendering too.
My lib provides a mutex that can be interacted with through the API, with the only limitation is that cgui_init(), cgui_run() and cgui_reset() should be on the same thread. Btw, in that graph, "GUI update" means state changes, drawing calls only happen inside cgui_run().
Anonymous 01/22/25(Wed)13:04:45 No.103996219
>>103996143
>cgui_init(), cgui_run() and cgui_reset() should be on the same thread
The 90s have called, they want their GDI and OpenGL back.
Anonymous 01/22/25(Wed)13:21:00 No.103996424
So what exactly is OOP? classes? inheritance? abstract classes?
Anonymous 01/22/25(Wed)13:24:50 No.103996479
>>103995481
Basically type erasure. Like <?> in Java. E.g. in Haskell
data SomeList = forall a. MkSomeList [a]

This creates a type that contains a list with some specific element type. Every element within each list has the same type, but the element type can differ between instances of SomeList. E.g. MkSomeList [1, 2], MkSomeList [True], MkSomeList [1.0, 3.2] all contain different list types (int, bool, float) but are overall the same type (SomeList). This can be used for example to implement OOP style data hiding
data Counter = forall internal_state . MkCounter 
{ state :: internal_state
, get :: internal_state -> Int
, inc :: internal_state -> internal_state }
myCounter, myCounter2 :: Counter
myCounter = MkCounter { state = 0, get = \st -> st, inc = \st -> st + 1 }
myCounter2 = MkCounter { state = "", get = length, inc = ('a':) }
Anonymous 01/22/25(Wed)13:32:09 No.103996577
>boss asks me to assist with a project
>project run by pajeet
>project is django app
>first thing I see is that every function body is wrapped in try: ... except Exception as e:
Wonderful.
Anonymous 01/22/25(Wed)13:33:25 No.103996591
I genuinely don't care for TikTok. But I don't know how apps like this work once they're taken off the Play Store and the App store. As in, how long would it take for an app to become an in a state where it's unusable and crashes? I wish the app would just cease to exist personally but I'm actually just curious how the nature of things like this play out and how long does it normally take for an app to become shit when it's not properly updated. I would also assume the lack of being able to grow by new downloads will also hurt it.
Anonymous 01/22/25(Wed)13:34:43 No.103996603
im learning lua but i have no idea what to even code as a first project

halp me saars
Anonymous 01/22/25(Wed)13:34:44 No.103996604
dd18776566320f5bf642cd2af717ca7c
>>103996143
no repo for now but the idea is that box blur can be done fast by keeping a history of sliding window so that for each new pixel, the sum of pixels can be calculated by adding the new pixel and subtracting the earliest pixel in history
this way box blur can be done with the same speed regardless of the blur radius
division is avoided when calculating the average by making sure that the history length is 2^n so that division is replaced by a bit shift
blur is done separately for row/col so it can be easily parallelized, and by doing box blur 2 times you get high quality blur
Anonymous 01/22/25(Wed)13:38:48 No.103996652
>>103996577
>You have two options, boss:
>1. send the streetshitter back to where he belongs and redo everything from scratch.
>2. you fire me and I work on shit that actually advances human development.
Anonymous 01/22/25(Wed)13:41:25 No.103996685
>>103996603
neovim config
Anonymous 01/22/25(Wed)14:01:52 No.103996986
>>103995026
You can generate an exception in the thread. This is even possible with the .NET token, it will generate a cancellation exception when the source is cancelled, so all the thread's resources will be properly cleaned up. It seems like Java does this too.

Also, of course it would make no sense to just terminate the thread while the CPU is running. With the stop token pattern, you generally only check the token in a conditional loop or you pass the token to an I/O action. The thread cannot be stopped immediately if it's not blocked.

My ideal implementation would basically do the same thing as the token/source pattern, just that the token would be hidden away from the user and would be automatically passed to other async functions awaited in the async task. And the token would be checked only when you try to perform an I/O action, rather than forcefully terminating the thread. Cancellation should not be an instant non-blocking action.
Anonymous 01/22/25(Wed)14:08:29 No.103997079
>>103996603
what are you interested in? You should always, 100% of the time, do something related to a personal interest that you have some knowledge of. It's easier to stretch Lua to meet that than to stretch your interest to meet Lua.
>>103995481
learn Mercury if you want to actually appreciate existential types or unique types
learn ATS if you want to actually appreciate dependent types
>>103996424
all of that and more. It's not a single simple idea, it's a bunch of stuff welded together, and that's both why it got so popular (some of that stuff is really really good) and why it's fallen off (the good parts got rediscovered)
Anonymous 01/22/25(Wed)14:21:53 No.103997250
c++26
starting to see c++26 on cppreference
Anonymous 01/22/25(Wed)14:26:00 No.103997300
>>103996424
it's a ploy by the military to get you thinking abstractly
Anonymous 01/22/25(Wed)14:35:14 No.103997423
>>103997250
it really is over c++
Anonymous 01/22/25(Wed)15:05:40 No.103997798
>>103996603
look up how to debug lua first, and how to freeze tables, so you don't have a silent bug because you made a typo somewhere

a chat server is nice as a project
Anonymous 01/22/25(Wed)15:52:42 No.103998447
>>103996424
the gist of it is that it's an imperative paradigm where you couple related state and behavior

as an example, take implementing a list:
in a purely procedural program, you would define some kind of model (eg. an array, or a structure for a linked list) and then, separately, functions that take an instance of that structure as a parameter and exert actions (ie. add, get, etc.). then you would call the function with the model usually as a parameter, eg.
add(&list, element);

in an OOP program, you would define both the model and behavior in one context, eg. a class. then you would call behavior directly from the instance's context, eg.
list.add(element);


then you can apply a bunch of other principles to it like encapsulation or inheritance
Anonymous 01/22/25(Wed)16:03:20 No.103998576
>>103997423
cope tranny
Anonymous 01/22/25(Wed)16:20:23 No.103998781
>>103997423
But C++ is just C but better. How can it possibly be over?
Anonymous 01/22/25(Wed)16:33:55 No.103998962
file
>>103998781
C++ is a fucking amalgamation hooked to a live support
Just put the damn thing out of its misery and make C++++ instead
Why is everybody in love with technical debt? at a certain complexity it's bound to have issues and bugs by default, just start again with a smaller subset and go from there
Anonymous 01/22/25(Wed)16:48:48 No.103999153
I wonder what's the point of all these languages when we have virtual machines anyway, LLVM, QBE, Tilde, hell you can target Fasm at this point.
I guess LuaJIT is truly at both end of the IQ spectrum.
Anonymous 01/22/25(Wed)16:59:27 No.103999286
under budget ahead of schedule
Anonymous 01/22/25(Wed)17:04:08 No.103999343
>>103999153
>I wonder what's the point of all these languages when we have virtual machines anyway
Write directly in virtual machine code and find out why.
Anonymous 01/22/25(Wed)17:17:04 No.103999487
>>103999153
take the Clojure pill, it's one language that runs on the JVM, the CLR, DartVM, and via LLVM JIT
Anonymous 01/22/25(Wed)17:18:08 No.103999504
Pete Zah
Sisters, what's your programming fuel?
Anonymous 01/22/25(Wed)17:20:09 No.103999531
>>103999487
And Javascript
Anonymous 01/22/25(Wed)17:21:40 No.103999557
>>103999504
Estrogen
Anonymous 01/22/25(Wed)17:28:17 No.103999662
Anonymous 01/22/25(Wed)17:46:02 No.103999878
>>103996591
>how long would it take for an app to become an in a state where it's unusable and crashes?
The app is still listed in some jurisdictions (at least one of which is likely to be insistent that it continue to be so) so it's not had the malware banhammer applied; it's just delisted, which means you can't find it in the store (including for updates) when in your jurisdiction. I've no idea what would happen if you took a US-registered phone outside the US and tried to look for the app then.
Systems that permit side-loading (or alternate non-US stores) may have other ways to obtain the app or its updates (some of which might involve VPNs, for example) but the legal consequences would likely be on the person doing the circumvention. If caught by someone who cares.
Anonymous 01/22/25(Wed)18:24:38 No.104000334
GVUYb_2aYAE2yst
what am i doing wrong here, given
macro_rules! some {
(None) => {
None
};

($val:expr) => {
Some($val)
};
}

macro_rules! pattern {
($($args:expr), *) => {
[$(
some!($args),
)*]
};
}

the following lines compile fine
some!(None) as Option<usize>
[some!(0x85), some!(0xC0), some!(0x0F), some!(0x94), some!(0xC3), some!(0xE8), some!(None)]
&pattern!(0x85, 0xC0, 0x0F, 0x94, 0xC3, 0xE8)

but adding a none, causes it to fail
&pattern!(0x85, 0xC0, 0x0F, 0x94, 0xC3, 0xE8, None)

with this error
&pattern!(0x85, 0xC0, 0x0F, 0x94, 0xC3, 0xE8, None),
| ^^^^ expected `u8`, found enum `Option`
Anonymous 01/22/25(Wed)20:18:19 No.104001674
>>104000334
Looks like a bug:
This works:
    let mut t = Vec::new();
t.push(some!(0x85));
t.push(some!(None));
println!("{:?}", t);

And this doesn't:
macro_rules! pattern {
($($x:expr), *) => {
{
let mut temp_vec = Vec::new();
$(
temp_vec.push(some!($x));
)*
temp_vec
}
};
}
Anonymous 01/22/25(Wed)22:35:01 No.104003234
responsive-layout
>>103996604
Thanks, I'll save that for when I work on expanding the theming options.
Anonymous 01/22/25(Wed)23:02:42 No.104003450
>we keep getting bug reports due to one specific issue
>decide to fix it "once and for all"
>write a grammar to parse our DSL and pick out code fragments which are probably problematic for that issue
I'm going to be stuck maintaining this for the rest of my life, I know it.
Anonymous 01/22/25(Wed)23:38:44 No.104003782
>>104001674
It's not a bug.
Anonymous 01/22/25(Wed)23:45:09 No.104003829
1am16soqpt051
>>104001674
>>104003782
more voodoo fixed it
macro_rules! mask {
(None) => {
None
};

($val:expr) => {
Some($val)
};
}

macro_rules! pattern {
($($args:tt), *) => {
[$(
mask!($args),
)*]
};
}

macro_rules! mk_patch {
($name:ident, $comment:literal, [$($original:expr),*], $replacement:expr) => {
static $name: Patch = Patch {
comment: $comment,
original: &pattern!($($original),*),
replacement: &$replacement,
};
};
}

struct Patch <'a> {
comment: &'a str,
original: &'a [Option<u8>],
replacement: &'a [u8],
}
Anonymous 01/22/25(Wed)23:45:10 No.104003830
>>104001674
I don't use Rust but I recently read an article on differences between C++'s auto and Rust's type deduction and Rust does some forward scanning mumbo jumbo to deduce a type of the vector here when you don't specify the template arguments, but that doesn't apply to macros, if you plug your shit into Rust playground you can see the difference:
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=4bce5e6ba5c73e9abdd99b7b673e104d

>error[E0599]: no method named `poop` found for struct `Vec<_>` in the current scope
>error[E0599]: no method named `poop` found for struct `Vec<Option<{integer}>>` in the current scope

I don't know about Rust but try passing the type explicitly based on the first element of the expression when instantiating temp_vec.
Anonymous 01/23/25(Thu)01:18:00 No.104004449
10MB is unreasonable for a shared library right? how in the fuck do I figure out why it's so big and how I can make it smaller? Does CMake have some options you can set to remove garbage or something?
Anonymous 01/23/25(Thu)01:24:16 No.104004493
>>104004449
>10MB is unreasonable for a shared library right?
Not enough information. We don't know the language, the compiler, the target system, so all I can give you is generic advice.

>how in the fuck do I figure out why it's so big
Disassembling it.

>some options you can set to remove garbage or something
You can uninstall CMake; that removes plenty of garbage that didn't make it into the binary. Depending on the compiler you can also optimize for size, strip symbols, disable inlining ...
Anonymous 01/23/25(Thu)01:30:04 No.104004530
>>104004493
I found out that CMake does not do a 'release' build by default. rebuilt as release and it's now 1.6MB. still seems kind of large, it's a networking protocol

anything else I can do for a proper optimized release file?
>-DCMAKE_BUILD_TYPE=Release
Anonymous 01/23/25(Thu)01:33:36 No.104004564
>>104004530
What exactly confused you about "not enough information" or "disassembling it"? Heck, if you can't disassemble it, just open it in vim or something, look for something big and obvious, and google what it's for and if you can get it removed.
Anonymous 01/23/25(Thu)01:53:21 No.104004687
>>103998962
The even funnier thing is that C++ standard defers to the C standard for a lot of stuff, so it's even more pages than that.
Anonymous 01/23/25(Thu)02:07:27 No.104004789
>>104004530
Maybe it still has debug symbols?
strip -o mylibstripped.lib mylib.lib
Anonymous 01/23/25(Thu)02:10:37 No.104004818
>>104004687
>language with more features has more pages in the standard
no shit retards
Anonymous 01/23/25(Thu)02:18:32 No.104004876
>>104004818
>features
You misspelled "rubbish".
Anonymous 01/23/25(Thu)02:21:15 No.104004893
>>104004876
All of the web browsers are primarly written in C++.
All of the creative software for music production, video editing, and modelling is written in C++.
All of the big three game engines are written in C++.
Almost all of the AAA game titles are written in C++.
Hell, if you've ridden a modern bus or a train, the interactive kiosks and dashboards are made using QtEmbedded/QML, which, is also C++.

The fact is that C++ is the king that rules the world of actual useful software that benefits people.
C is big stink.
Anonymous 01/23/25(Thu)02:22:50 No.104004911
>>104003450
what's the problem? I fucking wish I would get hired to work on a DSL. No idea who would need that kind of thing though.
Anonymous 01/23/25(Thu)02:49:50 No.104005126
>>104004911
>things that may or may not require the engine to pend while they complete should be marked as such
>these things are then required to complete their effects
>we have about a million or so lines of code, several tens of thousands of frames this goes through
basically just ensuring maps are tagged with the correct metadata for their nested context, but it needs to be done top-down because most of the functions dont exist at compile time, so we can't get them via reflection.
It's all lisp-like though, so the grammar is easy.
Anonymous 01/23/25(Thu)03:11:59 No.104005300
part_of_the_problem
>>104004893
You have no idea what you're talking about, and I feel sorry for any retard stupid enough to listen to you.
Anonymous 01/23/25(Thu)03:19:23 No.104005360
Thoughts on Carbon? Does it have potential?
Anonymous 01/23/25(Thu)04:18:49 No.104005803
>>104005300
Ok, enjoy bikeshedding your fizzbuzz.
Anonymous 01/23/25(Thu)04:22:20 No.104005823
compilers_are_garbage_cpp_printf
Oh god, it's the incompetent nocodeshitter who deserves to be tortured to death on national television while his family is raped to pieces in the background with their eyes plucked out of their sockets.
Anonymous 01/23/25(Thu)04:23:27 No.104005832
>>104005360
It solves what was obviously C++'s greatest problem: not feeling vaguely like Javascript.