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


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 1745759844820620.jpg (105 KB, 473x496)
105 KB
105 KB JPG
what are you working on, /g/?

prev: >>107370538
>>
>>107417196
nothing, nothing at all
>>
File: cex.jpg (65 KB, 811x447)
65 KB
65 KB JPG
I have a problem and I don't know how to solve it.
you have a group of people, you know which of them are friends with each other.
you need to assign each person to another person, in a circle, in a way where the most people who are friends with each other get assigned to each other.
any of them may have no friends, or be friends with everyone, or anything in between.
bonus: they can also opt out of being assigned to certain people, regardless of if they're also friends.
>>
>>107417397
>assign each person to another person
>in a circle
What does this mean?

First naïve thought: build chains of the people on each friend group and then connect the chains. If you have partially intersecting friend groups, make sure you put the people in the intersections at the end of each chain.
>>
>>107417397
i think you're describing a hamiltonian cycle which is basically the TSP
>>
>>107417397
First you could start from understanding the problem, now that you do, you can write it in words that make sense, at that point, you might know a solution without having to post here.
>>
File: circle.png (11 KB, 292x275)
11 KB
11 KB PNG
>>107417567
>in a circle
>What does this mean?
>>
>>107418367
Delete this post and redraw those arrow heads you embarassment
>>
>From the bit allocation the number of bits nb that has to be read for the samples in each subband is known.
>The order of the samples is given in 2.4.1.5 for each mode. After the bits for one sample have been gathered from the bitstream, the first bit has to be inverted.
I don't get it. Why don't they just send the bit in the state it should be?

>The resulting number can be considered as a two’s complement fractional number, where the MSB represents the value -1.
I don't understand this next sentence either.
I know what a two's complement number is, and I thought I knew what a fractional number is, but I don't understand what they mean by two's complement fractional number.
MSB means most significant bit, i.e. the first of the nb number of bits that I read for a sample at the given place in the bit stream.
>>
>>107418568
>>107418581
What I think they mean (and this is just a guess) is a two's complement integer, but divided by 2^n such that the MSB is -1, the next significant bit is 0.5, 0.25, ... so the biggest positive number 0.9999ish is 01111
>>
File: chrome.png (8 KB, 375x104)
8 KB
8 KB PNG
Chrome thinks i'm bad for cheating in chess
>>
>>107418605
Maybe...
>>
File: Tohru.jpg (1.48 MB, 1708x2600)
1.48 MB
1.48 MB JPG
>>107417397
>doing graph theory for fun
You are a maid. You are. Between a quarter and a third of your life is spent wearing a maid dress and you use your Maid Computer to do advanced Mathematics and Computer Science research.

Also you can solve your problem with the Kuhn-Munkres algorithm.
>>
File: 1756043022679418.png (1.66 MB, 2048x2048)
1.66 MB
1.66 MB PNG
>>107418696
AI isn't good at games, you want search algorithms found in chess engines
better yet write one yourself, it's pretty fun
https://www.chessprogramming.org
>>
>>107417397
is friendship bidirectional?
if so then I have a solution
but I'm not going to post it because you should do your homework yourself, that's the only way to learn
>>
>>107417397
is this for a wedding or something?
>>
>>107417397
I feel a pointer
>>
>>107420420
Not that anon, but you don't learn from being stuck.
>>
>>107420979
For seating at a maid cafe.
>>
File: maid-research.png (22 KB, 450x300)
22 KB
22 KB PNG
>>107421508
shut up withe the fucking maids
post highly optimised code or really
get fucking sacrificed to kek
>>
i dont mind the maid meme
i even defended eli bc him recycling all the weirdos into maids and make em do maths sounded like a good idea

but thy produced no maths, only cp
and a cancerous meme
post fukken code, make yourselves useful
you have a lot of bad will to go through, so dont give up bc the first person you shared code to will tell you youre a faggot

or dont, idrc id gladly sacrifice you to kek
i like throwing things into fires
>>
>>107418798
>>107422190
speaking of which,
explain crc to me so that i understand it
>>
>>107418367
So, like a lemon party?
>>
File: F-4gyLOa8AAPTk9.jpg (16 KB, 550x281)
16 KB
16 KB JPG
>>107417196
>what are you working on, /g/?
Tool for analysing binary and memory layout of my firmware.
>>
y'all cowards won't ever bring the text boards back
>>
>>107423279
those wouldn't allow glowies to sufficiently distract us
>>
>>107417397
You are looking for hamiltonian path in your graph. That wouldn't be difficult on its own, but in case there is no such path, you want to find the minimal changes you need to do to have one which has a hamiltonian path.
I don't know of any such algorithm, but you might find something if you search for related problems. Maybe weighted hamiltonian path optimization or something?
>>
>>107423319
This is NOT VIP quality.
>>
>>107423329
This is just the assignment problem and the maidposter is correct about how to solve it.
>>
>>107417196
I don't know how to implement vertical scrollbar. I'm so lost
bool _ZEKEObjectOnScrollV(ZEKEWindow*w, ZEKEObject *p, ZEKEObject *v1, ZEKEObject *v2){
ZEKEMouse *tm=ZEKEMouseInit;
bool con=FALSE;

int getY=AbsI64(tm->Y-w->Y) - v1->H/2;
w->GetTick=w->SetTick;
if(ZEKEObjectOnPress(w, p) and getY >= v1->Y and getY <= (v1->Y+v1->H/2)){
v2->X=v1->X;
v2->Y=AbsI64(tm->Y-w->Y) - v1->H/2;
}

free(tm);
return con;
}

bool ZEKEObjectOnScrollV(ZEKEWindow *w, ZEKEObject **p, ZEKEObject *v1, ZEKEObject *v2, int Y=0, int H=0){
if(Y >=0){
v1->H=p[1]->H - H;
_ZEKEObjectOnScrollV(w, p[1], v1, v2);

}
>>
File: Untitled.png (39 KB, 1874x932)
39 KB
39 KB PNG
>>107423637
Kuhn-munkres is about assigning elements from one set to another. It can't be applied to arranging people in a circle AFAIK, since your cost will depend on pairs of people and not just people to seats. If you want to make a circle out of some people, you need to find some sequence of them so that as many friends are next to each other as possible. You can think of it as a graph where people are the nodes, and friends have low weight edge and non-friends have high weight edge(and people who don't want to sit next to each other have no edge). Now this problem is about finding hamiltonian path through this graph that minimises the sum of weights of the edges.
>>
>>107424079
>I don't know how to implement vertical scrollbar
which part of it, the rendering or the functionality?
>>
How much do you use AI tools for programming?
>>
>>107417196
I fell down a hole of depression and now I'm in my 30s with a patchwork understanding of code. What's the best method to learn C++ so I can make video games?
>>
>>107424471
>What's the best method to learn C++ so I can make video games?
Go school. Or just pick up a book and start doing exercises. And pick a game engine and start making small games while you're learning.
>>
>>107424431
I generated schema for a json file using ChatGPT once.
>>
>>107424431
Not at all.
>>
>>107424471
You won't make it with C++, making a game / engine in C++ is something only for kids who started programming when they were 13, and were working on the engine for a decade before making anything with it (basically so much free time, you need to be autistic to fail).
You really aren't that far behind those autistic kids with 10+ years of experience in C++, just because they have a deep understanding of C++ doesn't actually translate much into good work ethics and progress.
Without time, you are going to learn a lot more by just using unity or godot or whatever (unreal engine is not C++, it's blueprints, the fact it supports C++ is no different than how godot supports C++, it's a 2nd class citizen when it comes to support / tutorials / examples).
Some games are 90% code, some games are 90% art and ideas. Some games might be more dependent on content than you expect. Just getting a game idea on paper and actually fleshing out the idea into something real, that you can convey the gameplay and fun to other people (in the paper form), is already hard enough (some ideas sound great in a short sentence, like LEFT 4 DEAD BUT ANIME GIRLS, but like what's it exactly going to be like? why would people play the game more than once after playing the map?).
>>
>>107424471
In gamedev, you choose your tools and then learn whatever language they require, not the other way around. Mastering a specific language, or even a very good programmer is secondary in terms of skills needed to make a good game.
If you really want to use C++, you can check out unreal engine, but you should also consider Unity and specialised game engines if there are any for the niche you are aiming for. And most importantly, you should focus on learning that engine and related tools and making a lot of prototypes/demos(this is very important) over learning just the language by itself.
>>
>>107424750
>or even a very good programmer
*or even being a very good programmer
>>
>>107424358
The functionality
>>
>>107424677
>and were working on the engine for a decade before making anything with it
I managed to get 3D graphics, audio and basic networking up in just 1 month. Don't overestimate the effort needed, but it's still quite a bunch.
>>
>>107424840
that's actually normal for 13 year olds, it's very common for kids to show extremely high programming skills with no prior experience. It's called high functioning autism.
the problem is that those kids usually burn out and lose motivation or whatever, I don't know what the name of this phenomenon is called, but it's a real thing.
not saying that you are 13 years old btw, I am one of those kids, not necessarily doing 3D in my first month, but I made a rougelike with networking with SDL2 and SFML for tcp when I was 14.
>>
This is what javatards need to simulate go channel maps


import java.util.Map;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.ConcurrentHashMap;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.TimeoutException;

public class FutureHashMap<K, V> {
private final Map<K, CompletableFuture<V>> futures = new ConcurrentHashMap<>();

public void put(K key, V value) {
CompletableFuture<V> future = futures.computeIfAbsent(key, k -> new CompletableFuture<>());
future.complete(value);
}

public CompletableFuture<V> get(K key) {
CompletableFuture<V> future = futures.computeIfAbsent(key, k -> new CompletableFuture<>());
future.whenComplete((result, error) -> futures.remove(key, future));
return future;
}

public CompletableFuture<V> get(K key, long timeoutMs) {
CompletableFuture<V> future = get(key);
return future.orTimeout(timeoutMs, TimeUnit.MILLISECONDS)
.exceptionally(e -> {
if (e instanceof TimeoutException) {
return null;
}
throw new RuntimeException(e);
});
}
}
>>
>>107424840
And that a month that could be used making 4+ different prototypes for gameplay ideas.
Having basic implementation is also one thing. But it will probably take you several extra months more until you will be able to rapidly prototype ideas without having to edit engine code all the time.
>>
>>107425236
in haskell this is just Map k (Chan v)
>>
>>107424750
Every single game engine I look at offers C++ as an option and I figured better to know that one because it's the big one.
>making a lot of prototypes/demos
Just like old times. Should they be for the games I've wanted to make or should I come up with a new one?
>>107424677
>engine
No, I know enginedev is a silly side project at most. However I've been aware of C++ since I was practically a toddler and it felt like it'd make more sense to get a broad idea. Also, I fucking hate the look of default unity/unreal/etc games and I'd be hamstrung if I stuck exclusively to the local slop. It's what discouraged me years back in fact.
>>
>>107425367
>Every single game engine I look at offers C++ as an option and I figured better to know that one because it's the big one.
None of the game engines support C++ as a first class language (except niche engines that nobody uses like O3DE, LOL).
It's very strange to say this since almost every engine is written in C++, how could it not support C++ well?
Just take a look at the API, and you would get it.
Unreal has one of the the worst C++ programming styles, and people like C++ because the C++ standard never changes or breaks old code (relative to other langauges), but unreal changes and breaks C++ all the time (from what I have heard).
And this is also true for the main language of the engine as well, but at least you will have 1000x more reddit comments complaining about the error compared to C++.
Meanwhile for Godot... I think the C++ api isn't fucked up (I don't remember seeing macro hell), I feel like you are going to enter a world of toolchain hell if you tried to compile your code for web (one of the nice things about using a game engine is that you can export it to most platforms including the web). But that's a guess, maybe the C++ godot plugin works perfectly on the web!
And then, most importantly, most engine game devs are lazy.
If you spent 10% of your energy learning C++ engine dev into trying to learn a proper engine, you could probably learn how to change the default look and feel of the engine very quickly.
But I admit, if you use the default UI, it will feel like the default UI, and the big benefit of engines are the built-in UI editors.
Coding UI is not fun, and making a placeholder UI usually takes an embarrasingly long time to add without an engine, and even longer to polish and add basic things to it (option menus, a text prompt, etc), so for an engine, you will use it as a placeholder because it only takes like 5 minutes, but then before you know it, it ends up being in the final product, because you abandon it for a new game :)
>>
>>107425709
I remember looking at the UE code and it was the most Java-like C++ I had ever seen
>>
File: output.webm (357 KB, 800x600)
357 KB
357 KB WEBM
I'm building a stupid little Atari style game with SDL3 in C just for the learning experience. Just need to add the music track/ effects track (still learning the new mixer), and it's ready for a 1982 cartridge release.
>>
>>107425955
Cool. Do you rotate sprites on the fly or in advance?
>>
>>107425985
Sdl has rotate texture render function. I was going to load my own sprite sheet, but it seemed like the path of least resistance to just use the built in. With the rotate, the texture is only loaded in once.

I got a little experience with rendering the sprite sheet textures with the twinkling meteor dust though.
>>
>>107425985
>>107426019
  //Render player texture
if (g->player->is_moving)
{
SDL_RenderTextureRotated(g->renderer, g->player->image2, NULL, &g->player->rect1, g->player->orient, NULL, SDL_FLIP_NONE);
}
else
{
SDL_RenderTextureRotated(g->renderer, g->player->image1, NULL, &g->player->rect1, g->player->orient, NULL, SDL_FLIP_NONE);
}
>>
>>107418798
What is this shit, trying to insert identity politics into graph theory?
>>
I'm going to make my own digital garden. I think I'll also make it my first docker container too. I am having trouble debating between making it db-less or not. I like the idea of just folder hierarchy keeping thoughts simplified, but I like the idea of just adding tags to thoughts/posts then browsing the tags after some time.
I also need to get on making a telegram workout bot. Just need to track last weight, sets, and reps on machines.
>>
Idempotent code has terrible performance and great ergonomics
>>
>>107424471
The best method is just making a game or a part of the game, and when you get stuck look stuff up until you're unstuck, and change course as needed. Doesn't matter if it's an LLM, blog posts, YouTube videos, or ancient programming tombs. Everything you learn will be relevant to what you want to do, you'll learn a lot along the way, and you'll get where you want to go much faster.

This is how kids learn to program. They play Roblox, they want to make a Fortnite Roblox mod, they lookup "how 2 make Roblox mod", learn Lua just enough to make what they want, and then continue this over and over.

Starting a project by reading a language book is for Academic fags and for Intermediate/Advanced programmers wanting a programming philosophy course.

So for you, SDL2/Raylib/whatever in C++ + follow some guide along and whenever something is confusing, just look up that specific thing (like "what is constexpr") and read until it makes some sense (it'll make more sense over time, you just need enough to know what you're doing).
>>
>>107427541
>So for you, SDL2/Raylib/whatever in C++
The NGMI stack
>>
>>107426447
Graph Theory is for maids. Anybody willing and able to discuss it is already wearing a maid outfit.
>>
>>107427696
kys eli suckup
>>
File: 1739837611998512.png (123 KB, 783x944)
123 KB
123 KB PNG
I did it :D
First solution got time limit exceeded because it threw a tree at me with like 3,000 nodes, then I went back and redid it with recursion after taking a brief look at the solutions and figuring out a better way to do it
>>
>>107430107
also glad to say that it's faster than the solution I was imitating. The original solution used an array for the queue in the deserialization function instead of a double ended queue, so it took 117ms. My solution took 27ms, which is top 81% runtime and 98% memory
    func serialize(_ root: TreeNode?) -> String {
guard let root = root else { return "_" }
return "\(root.val)," + serialize(root.left) + "," + serialize(root.right)
}

func deserialize(_ data: String) -> TreeNode? {
//print(data)
var dequeue = Deque(data.split(separator: ","))

let first = dequeue.popFirst()
guard first != "_", let firstVal = first, let intVal = Int(firstVal) else { return nil }

var root = TreeNode(intVal)
root.left = deserialize(&dequeue, dequeue.popFirst() ?? nil)
root.right = deserialize(&dequeue, dequeue.popFirst() ?? nil)
return root
}

func deserialize(_ queue: inout Deque<String.SubSequence>,_ queueNode: String.SubSequence?) -> TreeNode? {
guard let qn = queueNode else { return nil }
let val = String(qn)
guard val != "_", let intVal = Int(val) else { return nil }

var newNode = TreeNode(intVal)
newNode.left = deserialize(&queue, queue.popFirst() ?? nil)
newNode.right = deserialize(&queue, queue.popFirst() ?? nil)
return newNode
}
>>
>just use arenas bro
okay, how big should my arena's allocations be?
My usecase does not need big contiguous memory.
>>
>>107424431
For me sometimes it works as a hail-mary when documentation is garbage. If the information is in there but its impossible to find then LLMs can do a good job of piecing stuff together, but if it isn't it will just hallucinate something that seems like a probable answer.
Other than that, some robotic tasks like writing sql inserts for existing objects.
>>
>>107427583
>>107427541
You either use a game engine with C++ or you use libraries, but then you use high productivity languages like C# or Java. Libraries with C++ gives you so little productivity that you'll never finish anything.
>>
>>107430245
Then use a chunk allocator.
>>
>>107430203
Hate to be the guy but the %-ile numbers on leetcode dont mean anything.
You can rerun the same solution and get different results.
Gratz on the solve though
>>
>>107427699
>t. tsundere maid
>>
Why doesn't "$HOME" work on gitmodules? These motherfuckers want you to either use a garbage /usr package manager or put it in github. So much for "user freedom". Linux is so fucking garbage man.
>>
File: scroll.png (16 KB, 940x576)
16 KB
16 KB PNG
>>107424834
just need to map ranges of movement for your window/view and the slider, then when you move one, you also move the other to the same fraction of a position, eg. if you slide the scrollbar to 24/160, your view gets moved to 11/70
>>
>>107430826
Anon... How big should those chunks be?
>>
>>107431314
Page size (4096) and allocated them aligned.
>>
>>107431354
>mmap and munmap every 4096 bytes
uh I doubt this is good for performance, is this best anti-overcommit guys can do?
>>
>>107431367
Use 2M then? Do you not know this depends on your usecase?
>>
>>107431385
I could say that my usecase depends on non-retarded system configuration where me allocating 64TiB of virtual memory is a non-issue.
>>
That is to say, I live in a retarded world and I'm asking for a retarded solution to this retarded non-problem that is solved by just overcomitting. Get it?
>>
>>107431488
You're trying to find 1 solution to a multivariate equation.
>>
>>107431517
No I'm not, I'm specifically trying to find one solution to one problem: when I need memory arenas that allocate memory in cucked amounts, while it gets cleaned up using reference counting, to pretend like those small amounts are a design choice and not a cope with potentially badly misconfigured systems especially in this economy where 64GiB of RAM costs more than my whole gaming computer when I built it.
>>
File: frog.jpg (138 KB, 976x850)
138 KB
138 KB JPG
I suppose it's good to reuse memory, so bitmap allocators are great, 64bit int can determine if 64 pages are free/empty, one is reserved for metadata, anyway, this means that allocation is 256KiB
Now I have a bunch of space left after metadata so I may aswell implement refcounting per page so memory gets reused in heavy alloc/dealloc usage and no extra memory is allocated until 256K becomes completely full, in which case that whole block becomes a zombie where new allocations cannot happen anymore. When all refcounts hit 0, which is easy to check using that bitmap allocator which tracks everything, the zombie arena can be moved to a freelist of arenas inside the current active arena that is having active allocations performed on, this should result in optimal memory use, for example if I use it for strings that are copy on write and a copy is just refcount bump to same page, memory efficiency is slightly over 98% and goes over 100% in case a program actually "copies" strings a lot, and performance will be undoubtedly good.
Seems like I solved it, feel free to criticize if you can.
>>
>>107427696
What IS Euler wearing on his head?
>>
File: chains_of_friend_sets.png (15 KB, 990x606)
15 KB
15 KB PNG
>>107418367
>>
File: 1747136885468645.png (286 KB, 1200x1000)
286 KB
286 KB PNG
>>107417196
I'm about to fall for the rust meme. C requires too much manual effort, C++ is a pile of vomit, that leaves meme-langs like Go and pseudo meme-langs like Rust and D. Rustransisters shill me it
>>
>>107431984
>C requires too much manual effort
>about to fall for the rust meme
Oh man, are you in for a rude awakening.
>>
>>107431984
Rust is great if you want to build slop like userspace programs, but is completely unsuitable for real system's programming.
>>
The article I'm currently working on for my program safety job is about assessment of static analysis tools. I have come up with several 'assessment metrics' such as:

1. Time it takes to carry the analysis on a normal-sized project;
2. The precision. How many false positives we get;
3. The ability of the analyzer to recognize C's various dialects;
4. How many data flow analyses is carried out;

This is just 4 of the 'assessment metrics'.

I am paid per-citation. The more articles and papers I cite, the more I get paid. Sadly, I can't find many articles on this subject. So I'll probably get paid the base fee.
>>
>>107417196
I made a desktop fishtank desktop pet thingy and it is janky as shit but it works
>>
File: pepe-eyeroll-eyeroll.gif (14 KB, 220x220)
14 KB
14 KB GIF
>>107432405
Back in university, I had to do a presentation on security in general.
My only talking point is that humans are always the weakest link, because systems are programmed by humans and only can do what they were programmed to do, while humans make final decisions, I specifically prepared for the mandatory Q&A to dismantle any midwit cope that might get thrown at me, and everyone was too pussy to speak up, even to question my assertion, because they knew it to be true.
In other words, static analysis tools are bloat and slop and you should do code reviews, nigger.
>>
>>107433018
Free ones suck ass, yes. But commercial ones are much better. So if you cannot afford them, you are p00r.
>>
>>107433139
I can tell that your company cannot afford white, blue eyed, blonde haired men.
>>
>>107433150
Yes, those are 'amrads' used for sex. We are not a butt-selling company.
>>
File: capture.png (93 KB, 672x746)
93 KB
93 KB PNG
where do i get my cash prize
>>
>>107432082
>slop like userspace programs, but is completely unsuitable for real system's programming.
I have been using Rust for embedded development and it has been a really good experience so far.
>>
>>107433442
Link?
>>
>>107433511
>>>/diy/2932429
>>
>>107433601
>>107433511
>>
>>107433679
I linked you to my blog-thread about that project, what do you want
>>
>>107433691
The code?
>>
>>107433708
The codebase is large and not yet public/announced. Is there any particular part you want to see? I can post snippets and/or talk about techniques and crates I've used.
If you want to read about my general experience while doing that project, I went into details in my posts in that thread.
>>
>>107433745
>Rust is so good I have nothing to show for it
>>
File: 1453432155643.png (28 KB, 186x208)
28 KB
28 KB PNG
>>
>>107433851
would interrobang
>>
>>107433745
Show me the output of
grep -Rho "\.unwrap()" --include="*.rs" . | wc -l
on your codebase xD
(Just joking, Nice job on this project, I wish I had your dedication)
>>
>>107431984
C3 and Odin (and maybe Jai) look like the only real modern languages but they're all meme status currently
maybe Zig is ok too
Python has surprisingly managed to stay relatively unbloated and clean from what I've seen
Java/C# are bloated corposhitlangs
Rust is just a cock and ball torture lang for trannies
C++ is a disgrace to humanity
>>
>>107433691
>I linked you to my blog-thread about that project, what do you want
Post maid outfit.
>>
https://www.youtube.com/watch?v=ADIjOYYS0Bc

I did not know "Gentoo" is a penguin. I thought it meant 'Virgin Loser'.
>>
File: file.png (63 KB, 862x717)
63 KB
63 KB PNG
I love this problem
>>
File: file.png (70 KB, 819x559)
70 KB
70 KB PNG
>>107434672
>>
File: dancing-ferris.gif (258 KB, 734x490)
258 KB
258 KB GIF
>>107434249
ty!
>>
>>107431682
How do you plan to manage each individual page internally?
>for strings that are copy on write
use case?
use case for copying string? outside of reallocs and concatenating strings together
>>
File: angry-emoji-hat.png (346 KB, 1024x1024)
346 KB
346 KB PNG
What do you folks have anything against OCaml? It's a great language, a great suite. I think you're letting your anti-French sentiment ruin your experience with it.

Sure, the French are amongst the worst of Arabic/Jewish people alive. But that does not mean OCaml is a bad language.

All hail INRIA and OCaml. Also, Coq, or whatever they've decided to call it.

(It's much, much better than SPJ's piece of shit curry sandwich.)
>>
>>107436453
>reddit spacing
>>
>>107436453
>boxed types
>no macros, need external system
>different syntax for float
>shitty ffi
sml is better
>>
>>107436453
Funny, I read something about OCaml yesterday and I made a dream where I decided I was going to use OCaml. Now that I am awake, no I won't.
>>
>>107436512
>betraying Haskell in your dreams
traitor
>>
>>107436431
Bitmap allocator picks an empty page and sets it as current, strings are bump allocated in current page until it would overflow, then another page is picked. The pages are free'd via reference counting. If arena would overflow, then a new one is allocated to cope with memory requirement, eventually old arena will be deallocated because of refcounting, either put into freelist or unmapped entirely if there's enough free ones.
The usecase is heavy string processing and data structures like radix trees.
When I need a long string, there are better ways, but this seems like it should work for esoteric data structures.
>>
>>107436502
> boxed types

It's not meant for systems programming.

> no macros

So what is PP/PPX?

> external system

It has interop with C, you're lying, stop lying, liar.

> different syntax for float

No. Only if you buy into Jane Street's 'core' bullshit.

> shitty FFI

So why did you say 'no external system'?

> sml is better

Sure, because the best SML compiler is written by Andrew Appel. He once replied to my email about making an SML frontend for GCC. Great man, Appel.
>>
>>107436453
I don't know anything about OCaml. I have never had reason to touch it. I'd rather write something in a language I know, and get better at that in the process, that start over learning every new meme languages that anons decide to shill this week.
>>
>>107436512
I'm making an static analyzer with OCaml. It's called Blurook. It leverages three of OCaml's best libraries: CIL, OCamlGraph and SMTML.

I've already slopped out a dossier for it:

https://chubak.neocities.org/blurook-dossier

You're free to use it.
>>
>>107436559
dumb bot
>>
>>107436577
I guess you only fuck woman of your own race, then. Sad. There are other languages out there, anon, and there are other women out there besides pygmy women --- which you have 'boxed' yourself into, due to them being of your race.

>>107436611
I am not a 'bot' sir. I am a human. But not of your species of human. I am an Iranoid-Human. We are not 'interoperable' with Westoid-Human. A female born as a result of an Iranoid-Human getting too frisky and committing the sin of banging a Westoid-Human is infertile. It's been proven by science.
>>
File: 1764701888073999.jpg (289 KB, 1161x1820)
289 KB
289 KB JPG
>>
>>107436665
>There are other languages out there
And I don't have time to fuck them all.
>>
>>107436715
What kind of object is that? Never seen one before. Looks like a bullet from a video game. My father had two of those which he had brought back from war with the Arabs and Jews. He said, he'd shot dozens of Arabs and Jews there.
>>
Making some gigaslop in bash.
>>
>>107436543
KEK
Sorry to disappoint but I'm not an FP fag. It was rather a betrayal of low level imperative languages. Too much reading about the old perl6 and parrot recently, it messes with my head.
>>
>>107436860
Haskell is a low level imperative language
>>
>>107436887
>>107436887
I know you think that, but the laziness, heap allocated function frames and GC ... ?

About perl6 and Parrot (which was VM supposed to run all "dynamic"/scripting languages), one thing they cared a lot about (both of them) was continuations and I can't understand why they cared so much about them. I need to know.

It's one way to implement iterators but that's overkill, coroutines are enough. Exceptions can also be implemented with continuations but again it's not necessary.

It seems that they wanted to support some amounts of laziness. I don't really understand laziness but maybe this would warrant continuations for an otherwise strictly evaluated language?
>>
>>107437069
because continuations are awesome
>>
>>107437069
>VM supposed to run all "dynamic"/scripting languages
Hah, what foolish hubris of its designers!
Such systems encode their assumptions, and not all languages share that base set. For example, if you throw out mutable values or change name binding rules, and the way you implement an efficient VM changes a lot.
Write something that can encode everything and you've just got portable assembly (and even the best attempts at that, such as LLVM IR, have their weird things).
>>
>>107437069
https://github.com/augustss/MicroHs
Haskell for chips.
>>
>look into sml
>it doesn't have lsp server
it's owari da for functional fags
>>
It seems the MSVC doesn't want to inline ever. Why?
>>
>>107437552
What optimization level? (Inline was always just a hint.)
>>
>>107437069
Continuations are the mother of all monads, they can encode all monads, encode all effects, encode all control flows.
And they give you continuation passing style, turning all control flows into function calls, reducing stack overhead and enabling tail call optimization.
The problem is not so much call/cc but that creating the language and environment that supports the implementation is not trivial or efficient so...
>>
>>107437646
Wrinkle-brained post for /dpt/, I must admit.

I must add that CPS, SSA and ANF are isomorphic. But SSA is mostly used for imperative languages, where as CPS and ANF are used for functional languages.

This hasn't stopped retards from tryna use LLVM for their functional language. I saw people like these on the Functional Programming Discord server, and I just laughed at them.

Thank God I was banned from there. I think I insulted homosexuals a bit too many.

Either way, functional programming has so far failed to 'take over the world'. But it's still great for LPT-related programs, such as my static analyzer.
>>
>>107437137
but why?
I understand that they can be used to implement high level funky control flow mechanisms, but there is a very limited set of them: exceptions, iterators, coroutines, backtracking (which is more that just control flow btw (unless your language is immutable), it doesn't solve the part where old values of variables and data structure and restored), that's it. If you already have them what's the point?

From a high/middle level POV If you have coroutines and naked exceptions you can have the rest.
From a low level POV if you have computed gotos you can have everything else.

>>107437341
>Hah, what foolish hubris of its designers!
Yeah that's what I thought too, but PyPy exists so it's possible and it's already a done thing.

The main pain point is the exact semantics of the operations that manipulate data: arithmetic operations, bitwise, string operations and how numbers and strings are represented. But on the other hand, there are plenty of things that don't really change from language to language: control flow, function calls, exceptions, the GC, local variables.

If you have a good solution to the problem of executing each data manipulation primitive of each language, it should be doable.
>>
>>107437788
>there's a very limited set i'm aware of
>>
I wanna commission my cousin to paint me a portrait of the CIA Nigger man, but I have no money. Better yet, she's a cunt.
>>
>>107437788
>control flow
It's just gotos at the VM level. They're universal, but also mostly trivial. Except for jump table mappings.
>function calls
Except for the intense complexity of the large number of different calling conventions. For example, Python has both args and kwargs, and they're very much not the same thing, but other languages have different models for doing varargs (or just don't do it at all).
>exceptions
There's many models of the world here too.
>the GC
Really not universal.
>local variables
Very much not universal either; what callbacks do you trigger when you read or write one of those?
Or did you assume that there was never any such thing?
>>
>>107437341

>Write something that can encode everything and you've just got portable assembly (and even the best attempts at that, such as LLVM IR, have their weird things).
Yes of course. Concerning scripting languages, you can make a literal "low level vm" that does additions on unboxed uint64_t, etc.. and implement Python's addition like that, but it will be dog slow. I know that.

Even for native compiler's IR it's a problem because architectures can have different semantics for bitwise operations, or support additions of uint64_t with int64_t, etc.. and contrary to scripting languages you can't really drop to a lower level so it's kind of unsolvable. You need to pick a common denominator subset of instruction and that sucks, and do shit like declare that a shift bigger than the width is UB.

The thing is, the CPU instructions that manipulate data (arithmetic, bitwise and by extension vector instructions) are problematic, but on the other hand there shouldn't be problems for control flow, function calls, stack allocation, etc.. It's really only the data manipulation instructions that are problematic.
>>
>>107437341
This is that revelation that made me changed my mind about the feasibility of a VM that can execute scripting languages.

IMO the best solution for native compiler's IR is to make it open, being able to add new data manipulation instruction (or at least there should be at least one compiler that does that). This means that the IR is no longer fully architecture generic but at the same time the optimizer can fully reason about the program with UB interfering.

Similarly, a solution for a VM that can execute all scripting languages is to have an open set of instruction. One part would be fixed for all languages and one part would be specific. Each new language wanting to target the VM would need to write the implementation of its specific arithmetic, string instruction, etc... You might say that then, each language would implement its own VM, but this is only a tiny bit of the VM. There is no need to reimplement the GC for example.

I can see 2 ways for executing bytecode where one set of instruction is fixed and the other is variable.
Either the interpreter dispatch is done by function pointer calls, and in that case the langauge needs to make its own array of function pointers. The low part with function pointers to the common instructions, the high part with function points to langauge specific instructions.
Either, the same thing thing but with a jump table, either in assembly or with GCC's computed gotos.

If a language wants to call a function of another language, all it needs to do is changing the jump table / array of function pointer pointer before making the call and then restoring it back.
>>
>>107436453
kys negro faggot
i told you your ai gens are derivative
and actually lame as fuck
make some proper oc, chubakka
fkn
negrofag
>>
>>107436453
also ocaml sucks cock
wtf is this even
>>
File: sepples-ripley.png (2.53 MB, 1092x2695)
2.53 MB
2.53 MB PNG
actually its not that bad
ur stil a faggot, chubaka
you deserve to be beaten up with long bamboo sticks for your complete lack of orijinal content
>>
>>107438204
Haskell
>>
>>107438326
i honestly hate that shit
i just wanna do c
and more c
and then c on top of that
>>
File: c++-vs-rust.png (437 KB, 726x1207)
437 KB
437 KB PNG
>>107438326
>>107438367
anon, i wanna put c inside your c
i know its gonna feel weird at first
but once im finished you will understand the grandeur of what were doing here
just let it happen, anon
its already happening anyways
>>
>>107437935
>>107437871
The set of arithmetic, etc.. is not that big either and is not too hard to implement, it's repetitive. Once you have implemented the addition, you will have the substraction, multiplication, division, modulo for free.

>>107437935
>Except for the intense complexity of the large number of different calling conventions.
Each language may have semantics differences sure, but in terms of implementation there really isn't a convention. For the simplest case of function calls with a fixed number of arguments (it doesn't matter that the number of arguments is checked at runtime), the bytecode VM can pass the arguments however it likes.

>(or just don't do it at all).
Yep in that case it's not a problem. Here I'm assuming that the bytecode VM would have 2 ways of doing function calls: function calls with a fixed number of arguments and vararg function calls. Which it is is determined by the function call made by the caller.
>For example, Python has both args and kwargs, and they're very much not the same thing, but other languages have different models for doing varargs
This kind of stuff is an issue for the callee, not the caller afaik. The callee can take the arguments and build a tuple, array or dictionary with them at function entry. In effect this woud be a concern for the bytecode compiler.

>There's many models of the world here too.
There are 2. Stack-like exceptions and random access exceptions (setjmp/longmp). Catchable-by-exception-type exceptions can be implemented on top of random access exceptions.
>>
>>107436453
>What do you folks have anything against OCaml?
I read /dpt/ every day and I don't recall anyone ever bitching about Ocaml
>>
>>107437935
>>107438400
>>the GC
>Really not universal.
How? Outside of finalizers, I am not aware of any way where the semantics of a language depend on the way the GC is implemented. There are concurrency issues but it's not something semantically specific to a language.

>local variables
>Very much not universal either; what callbacks do you trigger when you read or write one of those?
That's a concern relating to the boxing/unboxing of values. Local variable just store a pointer/reference to boxed values. That said, the VM could support both static access (essentially fixed offset to RBP) and late binding kind of stuff, dictionary look up by string. Both of those are language independent.
I think that boxing/unboxing would be language specific instructions. For passing values between languages, a language would unbox the underlying int64_t, float, double, etc.. and the receiving language would box it.
>>
>>107438167
Why make OC when AI can do you 100 times better and write you a 64-chapter dossier on Unix.

I'm just generating the chapter on Gaming on Linux - Part 3.

I'm also writing a dossier on SCA tool assessment (CppCheck vs. Clang-Tidy vs. Sparse) for my shitty work which I hate. This one's with Grok. Great LLM for slop.

And with Sonnet 4.5, I'm writing a dossier on FUSE, the Telegram Bot API, and leveraging libfuse + Telegram Bot API to create a Telegram bot that takes the allocated space and makes a Cloud Storage from it.

I'm on TOP OF THE WORLD.

I'm totally not in a loop and addicted to generating dossiers.

SHUT UP.
>>
File: ai-lmao-embedded.png (101 KB, 499x819)
101 KB
101 KB PNG
>>107438470
>ai can do better
no
or yeah but if thats the case you should be posting on reddit
>>
>>107438470
>>107438486 cotn
make oc, faggot
im fairly certain we already discussed quite advanced shit
but even your cats are superior to your karens
>>
>>107438486
This is how 90% of my interactions with LLMs go. They really only work for the most braindead shit.
>>
File: ai-lmaoo-ebshittery.png (65 KB, 602x427)
65 KB
65 KB PNG
>>107438537
yeah...
such is agi i guess...
>>
>>107437646
>And they give you continuation passing style, turning all control flows into function calls, reducing stack overhead and enabling tail call optimization.
Yes, it's possible that they make sense for an optimizing compiler's IR, so the compiler can reason and optimize exceptions and the like.
But in terms of VM primitive? Like you said it's not trivial to make them efficient.
And in terms of programming expressivity? It's one of those things where no one seems to know the answer.
>>
File: 1764889649319080.png (33 KB, 528x285)
33 KB
33 KB PNG
Does anyone here know about setter and getter methods?
>>
>>107438421
>How?
Try to glue different GCs together in the one process sometime. Not impossible, but a massive pain in the ass and difficult to get right.
Component gluing is an important use case for some languages.
>>
>>107438537
>>107438556 cont
it works for boilerplate though
it can be leveraged
but people who say they dont touch code are either retards about to fail or liars

picrel is ai gen though
it saved me easily 4 days of browsing manuals, if not better (4days is actually optimistic)
>>
>>107438531
>>107438537
>>107438556
I'm just addicted to it, mang. It feels soooo good to make one of my dossiers and then half-read them.

>>107438577
My OOP dossier touches up on them: https://chubak.neocities.org/oop-dossier
>>
>>107438602
un-addict yourself then
being a dopaminje fiend makes you an inferior version of what you can be
>>
>>107438537
>They really only work for the most braindead shit.
It's all max midwit tier hallucinations, coupled to a yesbot. Train a system on everything ever written, you gonna have a lot of mediocrity in the mix.
>>
>>107438599 corr
>picrel is ai gen
not even in its entirety
but finding the majority of flags i used here woudl have been a chore
>>
>>107438629
you get a much much bigger hit from completely solving a tricky problem entirely by yourself; you're the master of the whole universe, at least for a little while
>>
>>107438638
theres ways to get around that
the smart man will take a piece of shit
and still use it to further his goals

a frozen shit can be used as fulcrum, for example
>>
>>107438680
you get a hit even bigger than that when you get paid for your effort.
and not in a wagie-way
when you get paid thanks to the software you created
>>
>>107438572
>But in terms of VM primitive? Like you said it's not trivial to make them efficient.
No such thing as a VM primitive. As the implementation grows more complex and you allow shared mutable aliasing you end up with copies upon copies of the environment unless you relinquish some continuation power or your performance (either way can be seen in Scheme implementations).
>And in terms of programming expressivity? It's one of those things where no one seems to know the answer.
It is extremely powerful and therefore very expressive. CPS is also UGLY, the masses want to call 1 + 2 and not call k x y + 1 2.
>>
>>107438602
That's actually impressive
>>
>>107438748
It's AI slop my man :(
>>
I realize some of y'all actually like my dossiers, they don't harm anything -- I mean, as far as slop goes, these are actually informative and I feed them hundreds of books and papers so chances of error are small.

So I uploaded my largest one yet, my "Ultimate Rust Dossier", 100 chapters, several appendices. There's several 'case studies' in it, wherein we implement various software across several chapters, such as an implementation of AWK in Rust (which is the solo subject of several of my other dossiers, implementing AWK in Rust is my quest).

https://chubak.neocities.org/rust-ultimate-dossier

WARNING: Very, very large HTML file.
>>
>>107438593
>Try to glue different GCs together in the one process sometime. Not impossible, but a massive pain in the ass and difficult to get right.
No of course, that would be a nighmare. But we're about a single VM for running multiple language, there would only one GC. Or several pluggable GC like the JVM does, but still it's something part of the runtime and not language specific.
>Component gluing is an important use case for some languages.
Idk what you mean desu.
>>
>>107438844
*But we're talking about (at least I am)
>>
i got my virtual machine to read asm source files
=)
>>
>>107438869
Nice anon. What architecture?
>>
>>107438830
> What if we forget to free? Memory leak!
retard, not freeing memory is not a memory leak
>What if another thread accesses buffer? Data race!
retard
>>
>accidentally step into my 'learn-graphics-programming'
>made 10months ago
>last change 9 months ago
its over i haven't done shit in the last year
i should have drastically improve at programing, make my own ui layer and find a cool new job
instead i just sit around doing nothing
>>
>>107438887
Stop correcting my AI slops. They're meant to be supplementary material to actual books and papers.
>>
File: images(233).jpg (14 KB, 279x304)
14 KB
14 KB JPG
>be me
>front-end dev, mid-level at best, been here 6 months
>manager gives whole team Claude Pro
>he and the new hire instantly become AI hype bros
>every standup is now "I got Claude to.."
>ok bro
>need a simple but oddly specific dropdown component that’s honestly not that hard
>spend a day on it, get all the "oddly specific" logic done, just needs a few props hooked up and some styling
>think to myself “perfect learning task for new hire" bc i have more important tasks (playing Uma Musume)
>send the kid my code over Teams (we still live in the stone age, no git server)
>explain everything slowly, even left extra comments
>he seems hyped, says he’ll knock it out
>week goes by, nothing, figure he’s got it manager + new hire show up at my desk looking defeated
>“we kept feeding it to Claude and even Copilot and now nothing works”
>open the file
>it’s… bad
>half my logic is gone, replaced with AI-generated spaghetti that errors on line 12
>the dropdown button is gone and the menu just floats in the middle of the page
>spend 30 minutes undoing the damage, put my original code back (works first try)
>they both just kinda watch in silence
>tfw your boring human brain > two guys + unlimited Claude credits
>feelsgoodman.jpg
>>
>>107439291
Bro, use AI to learn new skills. Front end is not going to last. I can assure you, Israel will be less nuked by Iran in the future, than there will be job opportunities for frontend devs.
>>
>>107439353
I actually genuinely love AI for learning and i do have job security here due to other reasons

But these guys are just mindlessly prompting and its turning them illiterate
>>
Is this a C++ mental illness, or an nvidia specific mental illness?
>a vector (of one element) that never gets mutated (so why isn't it just a const array?)
>only every used to assign a single value to check for + "iterate" with
std::vector<VkQueueFlags>        queues                = {VK_QUEUE_GRAPHICS_BIT};

Nvidia's queue family property function has to be the most retarded one i've seen yet, and im trying to understand why they're even using a vector here
https://github.com/nvpro-samples/nvpro_core2/blob/main/nvvk/context.cpp#L359
>>
>>107439439
because its a simple example that's going to be called very infrequently compared to the cost of the driver functions it calls?
>>
>>107439439
>>107439477
oh nvm you linked a totally different thing that is even objectively more correct and are complaining for no reason
>>
>>107439477
>>107439488
I'm just wondering why it's a vector and not either a const array or const value.
>>
>>107439439
Because it's the initializer for a field in a struct that you might want to pass different values into
#include <vector>

struct S {
std::vector<int> i = { 1 };
};

void foo() {
S s {
.i = { 1, 2, 3 },
};
}
>>
Another thread ruined by the Iranian Masturbator.
>>
>>107438593
>Try to glue different GCs together in the one process sometime. Not impossible, but a massive pain in the ass and difficult to get right.
It occured to me, there is problem if the GCs are precise. The problem happen for non-precise """""conservative""""" GCs, but those are niggerlicious.
>>
error handling is so much better with languages with goto
>>
What is the use case for terminal coding agents like Claude Code? I can see that they could be integrated to other tools but other than are they just full retard vibe coding tools?
>>
I'm working on evangelizing AI across all of /g/. AI has the promise to enhance your life by at least 1000x—AI is incredible and all humans are required to use AI if they want to live in the future. Use AI—AI is to be used. AI.
>>
new data compression scheme
>pi offset + length
anyone who wants to decode the data simply has to calculate pi to the requisite digits and can then extract the data. we can add pi accelerators in place of h265/etc and if you want to compress something lossy you can use an algorithm to find a lower pi index that approximates the data
>>
>>107441561
the length number would be very very long, many times larger than the data itself
>>
>>107441561
>attempt to compress data
>takes literally forever to find sequence in pi
nice scheme
>>
Everyone agrees to use a binary format scheme and terminals implement it so we can edit binary files from the terminal and not have to boil 2 liters of water to convert ASCII to structs.
>>
Tell me Anons, should I start learning Rust (safe C) or Zig (sane C)?
>>
>remove first of 3 branches, use second branch to handle that range of inputs
>the THIRD branch gets slower, the second one gets FASTER
>>
File: image-248.png (1.08 MB, 1280x1009)
1.08 MB
1.08 MB PNG
>>107442803
Assembly
Zero bug and Memory safe
>>
>>107442959
pic unrelated?
>>
>>107442911
>change code
>code is different now
wow
>>
>>107443228
You don't even understand what the implication of the post is kek
>>
>>107443259
The implication is that you're a nocoder who doesn't understand how compilers work, and by the looks of it, the problem that you're trying to solve.
>>
>>107442803
"sane C", if true, honestly sounds better for your mental health.
>>
Should I use c++ modules? I'm trying to separate my project into multiple files, I guess "modules". From what I can tell the tried and true way of doing this is .cpp + .hpp files and theres some "new" modules feature
>>
> what are you working on, /g/?

I'm abusing free Gemini credits from my university to OCR 600 GiB worth of financial PDFs for all companies in my broke ass country. Scraping them was also a challenge.

Anyone have a good idea where to dump the dataset after I'm done? Kaggle?
>>
>>107443523
no idea personally, but have a you
thats insanely based
>>
>>107443567
Thank you. I'm doing it in the most /g/ way possible where I have a frankenstein T480 which logs in with my glowy-issued smart card and downloads the PDFs from the official portal. They make you auth every 8 hours with the smart card to prevent scraping but I detect the window for the smartcard pin with pywin and write the pin automagically. It's been on for two weeks. He's begging for death atp.
>>
>>107443622
and then you repackage the thing using ai-lmaoo and sell the slop back to them at a profit
this is indeed the most /g/ thing i heard in a while
>>
>>107443622
make sure to backup everything as you go in case the chinkpad dies
>>
Erlang is KING!
>>
>>107443381
Let's see your best code
>>
>>107443902
>tries to deflect
I accept your concession.
You can now either post your own code that confused you, get laughed at again, or you can fuck off immediately, end result will be the same.
>>
>>107443500
No.
>>
>>107444071
You are here bitching daily about 'nocoders', I have never seen a code block in one of your posts.
>>
>>107444115
>I have never seen a code block in one of your posts.
This tells more about you than about me if you truly believe what you just wrote, and I have no doubt in my mind that you do, because you started this pointless reply chain by implying that the world is wrong and you totally aren't a little nocoder retard.
>>
>>107444131
Yeah I do, have seen multiple of your posts in other threads, never posts anything other than bitching at other people.
>>
>>107444148
You should send your CV to cloudflare, they don't have enough of you worthless narcissistic retards shitting everything up with their worthless nocodeshittery and constant whining whenever called out.
Try learning something of value before you post like your opinions matters, tranny.
>>
>>107444160
You lost lol
>>
>>107444169
If you weren't a mentally ill waste of space, you'd have posted code and asked why it is so, but you never intended to have a productive discussion since you're a narcissistic piece of shit that only wants attention. You will never be a woman no matter how much dramabait you throw out to shit this thread up, just a heads up before you have yet another deranged meltdown over something irrelevant.
>>
So how do you guys keep up your typing speed? Due to the fact that I pretty much have to keep my left pinky on control or shift all the time my typing technique has gone to shit, making me slower and more error prone than previous.
>>
>>107444205
>control
>shift
why?
you write unicode camelcase?
>>
>>107444205
>typing speed
For what?
>>
>>107444222
When programming yes. Also for brachets and other symbols.
>>107444235
Speed by itself is not the issue, more that I make a lot of mistakes while typing.
>>
>>107444254
I put (){}:& on non-shift keys, you can try that.
>>
>>107444254
Just type slower? Switch which hand deals with shift every hour? Programming doesn't require a lot of it.
But if this is such an issue to you, my first recommendation would be to buy foot pedals and bind problem keys there, it's cheapest and easiest to accustom to. I might be biased though as I am a pianist and have no problem using foot pedals seamlessly.
Everything else is meme keyboards that don't solve the issue, and costs more.
>>
>>107444254
french keyboard supremacy
i get my brackets and bacticks with alt gr which i press with my thumb
and all the weird letters are unshifted numbers
frogs though this shit out very well

i dotn think theres a magic fix for precision though
i think your peripherial nervous system just has to adapt to new reference points for your hands
>>
Is it better to return an integer or throw an exception that will be caught by try-catch?
>>
>>107444484
You have to define a metric by which you measure better first.
>>
>>107444493
In my case performance is less important than code readability/maintainability. It's for a web server
>>
>>107444205
stopped caring about typing speed since realizing 95% of work with code is reading and analyzing, and the remaining 5% is still mostly auto-completing from initials
manual typing is almost completely reduced to just naming things not yet in the source, or renaming existing things

>my typing technique has gone to shit, making me slower and more error prone than previous
use an IDE so you can do things without risk of manual error
>>
>>107444502
Then use exceptions for http errors. But don't be surprised when you realize that performance does matter lol.
>>
>>107444544
>But don't be surprised when you realize that performance does matter lol
Does try-catch really have that much performance penalty?
>>
Backend for a web app that displays chords for guitarists
>>
>>107444553
Yes, exceptions are so bloated that you can notice a stutter even in a minimal cli tool that uses exceptions to bail out from command arg parsing and print minimal error telling user to use --help and RTFM.
If you want your code to be readable, then make each response its own distinct data struct, HTTP error isn't a C++ error.
>>
>>107444484
Also you should be returning neither integer nor an exception, you should implement abstract classes http_response and http_request with http_handler that can be chained in tree-like structures to deal with authentication, errors etc.
If you want to know more, just read about how to do it in Java, and do it in C++.
t. >>107444571
>>
File: janet.jpg (17 KB, 474x214)
17 KB
17 KB JPG
Anyone tried Janet? Looks like a peculiar Lisp like language.
>>
>>107444668
>If you want to know more, just read about how to do it in Java, and do it in C++.
based
>>
File: 1735949699302014.png (242 KB, 2090x1685)
242 KB
242 KB PNG
Want to make a render/task graph a la https://www.youtube.com/watch?v=pr8HaIaZfpk with stuff like resource aliasing, automatic barrier insertion and parallel command buffer recording, etc. Got some basic building blocks going but I think I'll need to restart a few more times before I get something that will hold up.
>>
File: 1763430865799314.jpg (144 KB, 800x600)
144 KB
144 KB JPG
>>107445301
>5+ .unwrap() and that's just the code we can see.
>>
>>107417294
lucky
>>
File: 1486348567612.jpg (109 KB, 563x1003)
109 KB
109 KB JPG
>>107442959
people actually use linked lists outside of school?
>>
>>107445835
a linked list contained within a cache page is 5% slower than accessing a cache array
>>
>>107445887
(from my experiments)
theres prolly something i missed and its actually ~10-25% (because it should be based off 4cycles- 1 cache access)
but also some latency hiding ooo mechanism might come into play
>>
>>107431984
all the c alternatives require substantially more effort, maybe you have to write less, but they expose a lot of stuff that c hides from you. the cognitive load is higher, so to speak. if you want something high-level and with lots of libraries, unironically try kotlin, f# or python. tools were made to be used
>>
>>107442803
can you write an epoll/io_uring asynchronous event loop in c without leaking memory (not even on errors)?
if yes, then zig, if no, then rust
>>
>>107445835
I used them to manage creation, updating, and deleting/freeing of the bullets and meteor dust sparkles in my little Atari game here >>107425955

I figured there can only be 3 bullets on screen at any given time, and with the creation cooldown and disappear time on the meteor dust (analogous to coins), the code for having them both managed by linked list stacks was a bit less convoluted than the logic needed to overwrite and clear array elements.
>>
>>107446031
Not him, but why would there be any memory to leak in either of those?
>>
>>107432055
lol, this
>>107431984
>C requires too much manual effort
There's a magical thing called code reuse. Never heard of it?
>>
>>107446054
you mean why event loops allocate or why would they leak? to answer the first, you have to allocate because the number of operations in the event loop is probably not known at compile time. and to answer the second, it is because of how both of those APIs work (deferring io operations) the user interface of the event loop has to, in the case of c, use callbacks and type erasure, which can make it hard to keep track of lifetimes
>>
>>107446215
Yes, I'm asking why would high throughput low latency async loop do one of slowest operations possible instead of preallocating memory, especially if reliability is a factor, you cannot afford to get oomkilled randomly.
>>
>isosize's output contains NO-BREAK SPACE chararacters
dude
>>
>>107446236
if you preallocate you save in syscalls but you still have to do the bookkeeping and you can still functionally leak. for example, if I allocate an internal buffer and use that instead of malloc(), but I don't use an equivalent for free(), then there are parts of that internal buffer that will be wasted. this is the same as leaking even if you free the internal buffer at the end of the program
>>
>>107425236
Why would anyone care about this? You have anal autism
>>
>>107426447
It's the resident retarded faggot. You can report him or ignore him, but don't reply or you'll get AIDS
>>
>>107446362
I cannot think of a scenario where this could happen but not be caught in first 5000 cycles of stress testing which is usually done if you actually go out of your way to use epoll, or an even more annoying and experimental API that has even more ways to fuck shit up and memory management is least likely place to have issues.
>>
I am extremely grateful for studying Java and its variations to receive my yuan and a headache at the end of the day.
>>
>>107446440
yes, the stress testing for a hobby project you are theoretically doing to decide between programming languages
>>
File: 1763494869271487.png (41 KB, 540x485)
41 KB
41 KB PNG
>>107446583
>hobby is when quality is piss poor and I'm a retarded nigger
No, that's just code written in Rust, the rest of us don't have this issue, I'm not sure why, but it's probably because I do stress test my hobby projects since I actually care about quality and I don't have a cult gaslighting me about some novel meme language taking care of all the bugs or something, but that's just my uneducated hobbyist guess.
>>
>>107446640
hobby as in "throwaway" but it seems like the conversation is over because I don't see what point you are trying to make anymore
>>
>>107446828
>I spend my time getting nothing done because I do nothing of value and then I throw it away to make sure that the value is actually negative
There was no conversation, just you being retarded.
>>
There should be a rule about having to post code, or reply specifically with or about code in a technical way, in these threads. Language wars should be off topic.

Calling each other retarded niggers or faggots stays though. Important part of the culture.
>>
>>107447310
I accept your concession, you can shut the fuck up now, buy an fucking ad you worthless redditniggerfaggot.
>>
>>107447352
I have to be a different anon than you think I am. I just want to see more code and projects.
>>
>>107447389
You could start from being more convincing then, samefagging nigger.
>>
vibe coding a thing or whatever
>>
File: 1763523653433.jpg (123 KB, 1080x1388)
123 KB
123 KB JPG
Why can't we all just be polite and constructive and post maids?
>>
>>107447409
You're gay.
>>
Don't be a meanie
>>
I can be as much of a meanie as I want you stinky idiot moron moron moron retard idiot
>>
*gets sad
>>
>>107447389
you aren't entitled to leer at people's code and projects like some parasocial creep and there's plenty of reasons not to post shit directly and only talk about it conceptually and abstractly, or in reference to specific tasks you're working on
more than a few faggots have wound up with deranged mentally ill stalkers for posting less persistently identifiable info than that, literally every one of /agdg/'s shitty spinoffs is fucking full of that shit
>>
File: 1764384749369034.png (131 KB, 1080x1080)
131 KB
131 KB PNG
>>107445301
This anon used .unwrap() and learned rust in his wasted life and time
Very hilarious kek
>>
>>107447310
Not everything in programming is about code. Sometimes you need to bounce ideas before you put things into code.
Being too focused on code facilitates the language wars.
>>
File: pepe-eyeroll-eyeroll.gif (14 KB, 220x220)
14 KB
14 KB GIF
>>107450109
Nothing wrong with using unsafe in Rust for a linked list btw, too bad the compiler and language as a whole is a hopeless toy at the lowest level so I can't bear to invest time into rust to dispell retarded cope memes like the one you posted.
>>
>>107450144
>Not everything in programming is about code
Beyond a certain point, the code itself is obvious. The arrangement of ideas behind the code is where it's at (plus the psychosocial patterns induced in people in response to it all).
>>
You can use C++ as a scripting language if you PCH all the includes and compile with -O0. Subsecond build times.
>>
File: 1764384668883619.png (100 KB, 627x722)
100 KB
100 KB PNG
>>107450152
>>
>>107444668
Thanks, I will look at the Java documentation but later because I need to ship this code pronto.

I was thinking about how I would separate input validation from the class logic. What I've been doing up to now was putting most validation in the file which takes the API requests, which left the rest of my code nice and clean. However not all validation can happen outside the classes unless I have a shit ton of getters. It seems like there are no solutions here, only tradeoffs.

Instead of a struct, I added a new class to pass messages to the API file:
class BasicResponse {
public:
BasicResponse(int http_status, std::string message) : http_status(http_status), message(message) {}
int http_status;
std::string message;
};

so it's easy to return an error like:
return BasicResponse(400, "Duplicate group " + std::to_string(group_id) + " detected");
>>
>>107450317
Just add shitty codegen to the list and I have no issue with the rest.
>>107450325
Yes, that looks more like proper C++ and less like retarded cnile slop.
>>
>>107450106
I was probably being too nice. What i meant to say is the two nigger-behaved faggots jacking up this, and probably every, programming daily thread with language wars and shrieking "nocoder" at each other like retarded monkeys aren't as entertaining as seeing what people are actually up to. They should take their gay never ending dick measuring to a private chat.
>>
File: 1764971848902251.jpg (93 KB, 800x503)
93 KB
93 KB JPG
>>107450366
You're currently doing exactly what you're accusing others of doing, this is exactly why I will keep calling you a stupid worthless nocoder until you fuck off from this place.
>>
>>107450373
>fuck off from this place.
Nigga, I've been here since mudkips.

Post code or gtfo
>>
>>107450267
sometimes i genuinely consider just actually using c++ as a scripting language
after all, clang has an interpreter library and an example of usage in the form of a c++ repl
why not
it would solve all the problems of interop between compile time to runtime
>>
File: rooby.jpg (52 KB, 720x404)
52 KB
52 KB JPG
i will remember you, ruby
>>
>>107450613
Why is Ruby losing to Python? I know that a lot of AI stuff is happening in Python.
>>
>>107450613
https://www.youtube.com/watch?v=WU-G4-uI8eM
>>
>>107450613
I'm looking for a video of him from at least 4 years ago. He was in his car and was saying that someone he know told him that for a new technology to replace the current one, it must be at least 10 times better otherwise it's not worth switching to it. I can't find it.
>>
>>107450653
because there's more demand for shit like node/go/python than ruby since we need everything to """scale""" and large companies don't need generalists
funny because so many billion $ tech companies started using fullstack frameworks in ruby/python/php and were built by 1 guy or a tiny team
technically you can still use ruby and you'll probably be more productive than someone who has to pick their stack from 100 of different choices but then you wont be learning employable skills except for freelancing maybe
>>
>>107450935
i didn't even watch that video btw i just find those retarded thumbnails funny
>>
>>107451010
somehow I found it: https://www.youtube.com/watch?v=KzGLbgK0P2M
>>
>>107417196
I miss /prog/.
>>
>>107450267
in C++23 this is just
import std;
>>
i have no idea what rust is. cargo? shit even go makes more sense than that.
>>
>>107445835
Yes, but in very specific situations. If you can use dynamic array(vector) use it. But sometimes you are designing some special structure, especially something where you want to chain different kinds of objects together(see Vulkan API) it might be useful. Or if you want to make an editor for very large files you might want to split it into chunks chained into a linked list so you can easily insert/remove some elements without having to move megabytes of memory left and right on each key stroke.
General purpose linked list is a meme.
>>
>>107445301
>with stuff like resource aliasing, automatic barrier insertion and parallel command buffer recording, etc. Got some basic building blocks going but I think I'll need to restart a few more times before I get something that will hold up.
I haven't watched the video, but maybe try with some simpler stuff first.
When I was doing graphics in rust, I started with simple things like game of life, fractal renderer, simple 2D game/demo, simple 3D demo, etc before doing my engine. It takes quite some experience with Rust and whatever library you use in order to be able to design clean and robust abstractions.
>>
>>107446640
>>hobby is when quality is piss poor and I'm a retarded nigger
>No, that's just code written in Rust, the rest of us don't have this issue,
From my experience, Rust projects have one of best code bases I've seen. Especially in terms of documentation. Rust documentation practices are the state of art.
>>
gccrs will save rust
>>
>>107452529
>gccrs
this acronym sounds like a soviet-era branch of secret police
>>
>>107452542
>gcc commies
>rust authoritarian glowies
>>
>>107431174
I think I got it but kinda buggy
Im gonna fix it later anon
>>
>>107452774
ok, this explains alot
my instincts werent far off
>>
>>107452967
no you were right on point
>>
>lowmathsolution
>https://tululoo.com
I mean, i solved the one half, of the graphics. i could use the intelligent solution...in that route
>95-5
>>
File: file.jpg (160 KB, 1280x720)
160 KB
160 KB JPG
>>107430245
what the fuck are you talking about?
use virtual memory reserve/commit if you can't figure out an upper bound

>>107444254
pic related

>>107445835
yes, atomic insertion and pointer stability are useful properties
>>
>>107453271
Mathfree/least coding tutorials plsss
for http://tululoo.com/
also for, XXXXXXXXXXXXXX genres. ok maybe its not that man- hhmmm
>>
>>107453698
>http://tululoo.com/
http://tululoo.com/
whysitnotembed
>>
>>107417196
What is a good way to learn CS fundamentals as someone who already is fairly experienced as a programmer but didn't come from that background? I've been coding numerical methods and optimization, and statistical algorithms for nearly a decade now but every once in a while I run into a problem that reminds me I know next to nothing about computer architecture and programming fundamentals.

Are there any good resources for learning the fundamentals of CS that don't assume you need to be taught what a for loop is or how to do f-string manipulation and basic scripting?
>>
>>107430245
>My usecase does not need big contiguous memory.
whats's your use case?
>>
>>107453808
make a calculator
>>
>>107454067
> make a calculator

I remember making an arithmetic processor on a breadboard in my digital logic class. That was fun.

If you're serious, do you mean at an incredibly low level or something?
>>
>>107454157
No, a software calculator.
You will need to parse expressions and evaluate them.
>>
File: download (3).png (47 KB, 344x135)
47 KB
47 KB PNG
whats The most comprehensive tutorial on coding game ,like in gamemaker or http://tululoo.com ? like from menus to control to graphic and to even turning html to exe likes?
>>
>>107454061
Already stated in this thread, I'm not expecting anything of value from you if you're this blind/illiterate.
>>107453294
>use virtual memory reserve/commit
how much at a time, retard?

This retardation of yours is why I currently choose to mmap 64TiB of memory, so far none of the opposers of this were able to coherently explain their "superior way" that they themselves clearly never did since they just use malloc and free like the nocodeshitters that they are.
>>
>>107452774
I just installed gccrs and I'm baffled by the fact that it cannot seem to do anything at all.
It's been 6 years now.
>>
>>107455298
You should use a trip so we can filter you. Bonus for you: you won't get "nocoder" replies to your cryptic pointless questions.
>>
>>107456383
I was never called a nocoder here, and considering I'm the one pointing nocodeshitters like you out, your response doesn't make any sense.
Did you really think that asking me questions would lead anywhere?
I'm looking for someone more intelligent than me who can teach me, I'm not looking for retards like you who need to be explained basic English words.
So about that trip thing, maybe you should put it on with a name "nocoder" so I know to not waste more time on you?
>>
>>107456434
>>107456434
>>107456434
>>
>>107453808
You mean CS as comp sci in general? 3 Tanenbaum's books are a good place to start.
>>
>>107456393
Nobody likes you here.



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