The general is very dead lately
How are you guys?
>>106108612 (OP)>no - in subject>no previous thread:>no what are you working on /g/
>>106108646what are you working on /g/?
>>106108653nothing it's the weekend
I got buck broken by an AI at my company's code duel yesterday. I've been feeling pretty shit, bro.
>>106108685Our jobs are safe for the next 10 years no worries bro
>>106108685Dumb frogposter
>>106108732Try 15, nocoder.
>>106108612 (OP)this image is actually accurate beyond author's comprehension. It is true that c++ feels like cloud, but once there is more people on the project, your cloud crumbles.
A person who conquered rust would be extremely proficient in actually good languages (C, Zig...) because it is a great playground for learning programming in general (though awful in production).
>>106108732they're safe until someone fundamentally changes how "AI" is made. LLMs have 0 chance of being anything other than very sophisticated autocomplete
My vibe coding experience so far:
>chatgpt.com copy and pasting, it verks so vell!
>grok.com + chatgpt.com copy and pasting to fix when it gets stuck in a loop of trying to fix an error/bug
>grok.com only copy & pasting
>cursor
>cursor + grok.com
>grok.com only copy & pasting
>github copilot inside Visual Studio
And that's where we are. Copilot is generating small, usable code snippets and intelligently inserting them whilst I have a discussion with the bot and manually edit the file in the background in between tasks I give it.
Also Grok4 is fucking broken for generating code, shit doesn't even work. Grok3 worked well though. Grok3 is not bad at programming.
This GitHub Copilot approach seems extremely reasonable even for a large project.
>>106108612 (OP)>decide to make shitty FTP-like program in Java to practice networking skills>discover I am basically making worse FileZillaThe fun of recreational programming is that nothing you make has to be particularly original or useful
>>106109754I start next to no projects and finish literally none because I have an unshakeable need to make something actually useful instead of just [thing] but worse and I don't know how to stop.
>>106108612 (OP)>C++>lvaues>rvalues>raii>move semantics>[[nodiscard]]>member initialisation>raii>sfinae>type erasurekek
>>106109998This is like a zoomer saying math is stupid and posting an image of 1 + 1 = 2 as if it's the most mindboggling shit in the world
>>106108612 (OP)>The general is very dead latelyI don't post in threads with tranime in the OP.
>>106110201Yet you posted in the frog thread
I wanted to use lua to make very basic command line programs, but I ran into a road block and was hoping for some insight.
when I run the script with the lua interpreter, the arguments are processed as expected, if I use rtc however, a Lua script to executable compiler that comes with LuaRT Studio, the varargs no longer prints, I tried using `io.write()` instead of `print()` but that didn't work either. Anyone familiar enough to point me in the right direction?
i feel like negative progress is being made in major compilers implementing C++26
>>106110294nevermind, I found it right after I posted this, replace `...` with `arg` then you get a table
9680
md5: c8946799b7901b9534331b84d4b45a44
๐
>>106110541holy shit a makefile im so impressed
>>106110910>cargo rrust won.
>>106108612 (OP)Working on O(1) switch/case statements for my compiler. It's very comfy
>>106109839Accept that some things are just practice and not everything you make has to be something you can show someone else. Your first projects in a new language or with a new library are probably going to be shitty, but the purpose of starting out like that is to learn something.
Making something bad is a stepping stone to making something good, anon.
original rust compiler in ocaml
interesting read
https://github.com/rust-lang/rust/blob/ef75860a0a72f79f97216f8aaa5b388d98da6480/src/boot/fe/lexer.mll
>>106110359Literally nobody completed std23, import std seems to be very challenging
>>106110248Yes, why are you confused?
>>106113785This remind me of this video
https://youtu.be/XJC5WB2Bwrc?si=ySnOufmSVFjBhQSH
Highly quality content
>>106114065can't stand aivoiceslop, can people really not just record themselves speak
>>106114079The whole thing looks like AI. ChatGPT wrote the script, read it out loud, and made the animations. Bet "George" (funny how the voiceover mispronounced his name) just asked a gen AI to make a video about a topic.
>>106114079When the audience asked the guy why is he using ai edited voice, he said he is from south America
I guess south American English accent aren't the nicest to the ear
>>106109461this is a thread about programming
I'm hate C style C++ ,I use classes everywhere
I wrap static functions inside a class
I make everything an object
I prefer using over #define
Thanks God for concepts they saved me from the pain of sfine
>>106114029Nobody cares about modules
What's the general logic for handling scheduling errors because of server downtime?
For example, a message has to be posted at 9:00 and deleted at 10:00, but the server crashed at 8:45 and came back online at 10:15.
What if it came back online at 9:30?
Anybody checking out jai after the leak?
I built a NAS a few days ago and wanted to make sure my files won't corrupt over time. Especially when I create backups on my external drive (unfortunately bit rot is a thing). I looked for open source tools but didn't find anything viable but hashdeep. However I wasn't really impressed by the time to run the tool since it didn't provide incremental hashing. That's why I implemented small tool to make sure my files won't rot without notice. And before making backups I make sure no rotten files are going into my backups. I'm pretty happy with it. First tool which I finished outside of work in the last years
>>106115609>leakHook me up
>>106115743>>106077531I haven't really tried it yet, but I'm reading the docs and tutorials. It's pretty comfy.
>>106115781Thanks. Will try it out.
>>106115331store message status in file or whatever
get time on server start
if startup time within hour of message required posting and message status not posted post message
else if time outside of message required posting and message status posted delete message
else do nothing
C++
md5: edd515848315c814c20eeb444f8b1cfe
๐
>>106108612 (OP)rate my code, how to improve this ?
export class VertexShader
{
std::string source;
public:
operator std::string() const { return source; }
operator std::string_view() const { return source; }
explicit VertexShader() = default;
explicit VertexShader(const std::string& src) : source(src) {}
explicit VertexShader(std::string&& src) : source(std::move(src)) {}
};
export class FragmentShader
{
std::string source;
public:
operator std::string() const { return source; }
operator std::string_view() const { return source; }
explicit FragmentShader() = default;
explicit FragmentShader(const std::string& src) : source(src) {}
explicit FragmentShader(std::string&& src) : source(std::move(src)) {}
};
>>106114736I do care about them and want to use them, I hate headers and pre compiled headers
>>106116294It's crazy to me that 90% of a C++ program is dedicated to fixing problems that arise from using C++.
>>106116718I made a value type to do a proper separation of concerns, std::string is too crude for what I'm doing, C strings are lame and make the API less safe less C string less problems
Inb4 wHy noT ruAt...
Too many restrictions and a lot of unsafe usage
ASMlet here, why is only the top function in my assembly listing working? other ones crash when called
I try swapping the functions around, only the top one works.
MASM x86
>>106116958just tried these with nasm BTW and they work. I fucking hate microjeet
>>106108612 (OP)Writing calibration tool for my diy gaming console.
What cross platform Makefile alternative do you guys like/recommend?
Cargo workspaces do not work the best with projects that uses different architectures for different crates and I have bunch of assets that have to be processed with ffmpeg/imagemagick/custom rust scripts and it doesn't make sense to put it all under build.rs script. I am currently using cargo-make, which has some really neat features but it's kind of tedious to write everything in toml and conditions ignore env vars(which I use as template variables).
What I am looking for is some make alternative that is:
>cross platform (at least linux and windows)>skips tasks if their output is newer than input/source>simple syntax without having to repeat yourself>macros/templates so I can write tasks for bunch of similar files without having to repeat same shit over and over>function as command alias (bonus)>translate common linux commands into windows equivalents (bonus)>autocomplete (bonus)I don't need any Rust specific functionality, I just need something to run right commands when they are needed.
If I'm designing a new protocol today, should I just swallow my pride and define that protocol as something that is implemented on top of HTTP+JSON or should I actually make that protocol an application-layer protocol that is transmitted directly on top of TCP+TLS? I feel like I would be fucking over everyone with the latter option because they can't do load balancing as easily anymore and things like Cloudflare won't work either.
>>106117579This entirely depends on what will the protocol be used for.
>>106117660How so? I don't expect it to be used from web browsers and to be completely fair I don't think anyone is going to know about it at all, I'm just making it for myself essentially, so it doesn't really matter, but still
>>106117746>How so?Because there is no reason to require entire IP+HTTP stack when you have two MCUs talking to each other on a single circuit board.
What is your usecase
>>106117794It's kind of an unusual RPC protocol that would be expected to be used over the public Internet and there is no real reason to send more than one RPC request before getting a response
Result/Option/Iterator play so nicely together in Rust.
Writing this imperatively required like 3 times more LoC and pointless intermediaries.
>>106118486>Result/Option/Iterator play so nicely together intraverse
file
md5: b855063e9c68e5023e79a25e749bf136
๐
thekuzzy.win
thekuzzy.win
thekuzzy.win
Is there no way to write a macro in C that computes the min of 2 args which both: evaluates each of its arguments only once, and is a compile time constant? Statement expressions don't work because declarations in statement expressions are considered stack variables.
pepe
md5: e6b29a0441c1f626958667c037aed491
๐
>>106109848All those are features, not curses like the borrow checker.
>>106108880Work on your own library with comfy syntax to be ready this year.
auto operator+(const auto& v) {
auto s = decltype(*v.begin()){};
for (const auto& i : v) s += i;
return s;
}
https://godbolt.org/z/qs19hbK5s
// *(ADVANCED NOTE):
//
// Note that because a [] array points at someone else's memory, if you take
// a pointer to an element of the array, it may not remain valid indefinitely!
// This can easily happen with [..] resizable arrays, covered below, or in
// any other situation where the backing array could be deallocated.
//
// This is true not just for pointers to elements within the array, but also
// for the .data pointer of a [] array. And if that pointer becomes wrong,
// it invalidates the whole array! So, for example, the following code is wrong,
// and is a common mistake that many people may make:
{
a: [..] int;
for 1..10 array_add(*a, it); // Just fill a with some values.
v: [] int = a; // Make a view onto a.
for 1..10 array_add(*a, it); // Add more stuff to a.
// The following use of 'v' is incorrect, so let's put it in an 'if false' so it doesn't break.
// The problem is, any time you call array_add on a, it might move its memory. If you do this
// after assigning v, that is no good!
if false {
for v print("%\n", it); // <------- This is BAD, since 'a' moved!
}
}
I've seen so many times Jon himself and other people in the nu-C crowd say that these resizeable arrays suck and you should be using either a chunked version or virtual memory tricks, so that they have stable pointers. Kinda shocked to see this basic ass reallocating vector in here.
>>106119429>Skill issue.No skill is going to improve compile time
>>106119182you can have a _Generic that accept all int types and evalutes to a different inline function in each clause and invoke that on (a, b)
that's standard but doesnt work on compile time constants
but then for compile time constants you dont care about double evaluation so you can use normal min-max macros
i don't think it's possible to write a macro that handles both cases
>>106119374the borrowil checker is a feature. Get good.
stare
md5: 6d46ba20f7619c3c749acd5b59f87d02
๐
Jai has a lot going on I gotta say. I like being able to intercept everything as it's being built.
>>106120701Stop wasting your time.
>>106116294>std::string&& srcreplace that without the &&, so it's just std::string, and you don't need 2 constructors, also the default constructor is pointless (explicit stops a certain silly syntax).
I personally just make a program and I don't hold onto the vertex or fragment shader, since after you make the program they aren't used anymore (you can delete them after compiling the shader program), the only reason to hold onto the shader is if you reuse the shader, but the GL driver should cache old shaders (GL performance debug callbacks should give you a notification when you compile a new shader that isn't cached, at least on nvidia).
I also don't use setters / getters when there is no point (just make variables public / use a struct), I also don't need to hold a copy of the shader text (RenderDoc/etc should already store a copy you can read, so I personally just have 2 functions, (const GLchar*) OR (const GLchar**, int count) for macros).
So my "shader" class just holds a program GLuint, and the uniform / attribute GLint's (plus an event handler for something else).
an initialization + destruction function that returns an error (constructors can't return errors).
then I have a function that initializes the VAO and VBO.
Also wtf is that export shit? This shouldn't be a module.
Modules are for library designers. As a C++ developer you should just stick to high level applications and stick with includes. Obviously it's all stylistic, you might just prefer the module style, but to me it seems like a solution to something that is very hard to explain in terms of productivity or fixing bugs, and for the issues it does solve, there is always a different way (C programmers will always prove you wrong in showing you that there is nothing that another language could do that you can't do in C, and all the issues you point out are just a skill issue).
I have a question regarding best practice. I have some code like
match my_choice:
case 1:
val_1 = ...
val_2 = ...
case 2:
val_1 = ...
val_2 = ...
some_val = val_1 + val_2
So obviously my IDE complains, that val_1 and val_2 could be unassigned if my_choice is neither 1 nor 2. However those two values are assigned through a combo-box in a UI, so it can only ever be 1 or 2. Nor do val_1 and val_2 have any default values that make sense that I can initialize them with or set them to in an else case.
Should I just leave it as is or is there some convention how to handle stuff like this, mostly for readability, since functionally there isn't anything more needed to cover all possible cases.
>>106117879Not that anon nor did I understand what you mean. Though I can suggest looking at:
>registerProtocolHandler>websockets>local proxy that handles your protocol and normally routes everything else (like i2p)
>>106121298case _:
raise Exception("unreachable")
Good for in case somehow another case becomes possible.
>>106121298You should always be able to create a "blank" value.
>>106108612 (OP)Borrow checker is such an infantile phrase. I would deconstruct such a thing to see if it has anything useful, but would never lower myself to using fisher-price trash.
>>106121298you should be asking yourself if you really need a switch statement for something so simple in the first place. iโd have to see the full code but you could probably make it branchless relatively easily
>>106121393That's the next best thing I could come up with
>>106121711I thought about it too, but couldn't come up with anything good.
This part is supposed to rescale an image while preserving aspect ratio, so the actual code looks more like
match reference_dimension:
case "width":
target_width = image.get_width() * scaling_factor
target_height = target_width * height_factor / width_factor
case "height":
target_height = image.get_height() * scaling_factor
target_width = target_height * width_factor / height_factor
So depending on if I select width or height to be scaled in the UI (I know I should probably make it an Enum not a string later) the way the target dimensions are calculated is slightly different. I'm not sure if there is some smart math trick to do here to simplify it, but if there is I'm too tired to see it
>>106121270Why is it a waste of time?
>>106119740I prefer the statement expression implementation for single eval, I'm fine with my code being coupled to clang/GCC because of how much useful stuff they provide
#define min(a, b) ({ \
typeof(a) a_ = (a); \
typeof(b) b_ = (b); \
a_ > b_ ? b_ : a_; \
})
After thinking about it a bit, this almost works, but doesn't work for at file scope, but it can be used in the length of a static array within a function.
#define min(a, b) (__builtin_choose_expr( \
(__builtin_constant_p((a)) && __builtin_constant_p((b))), \
min_ct((a), (b)), \
min_rt((a), (b))))
How do I sell the programs I make? Well, the programs AI make for me.
>>106122608submit them to an app store then start advertising
>>106122623Does it cost anything to put them up on Microsoft Store?
>>106121848this is a trick i use in a lot of cases like this, it's especially useful for applying masks to things. it will make the code branchless but it will also be a little more difficult to read
int should_scale_width = (reference_dimension == "width");
target_width = should_scale_width * (image.get_width() * scaling_factor);
target_height = !should_scale_width * (image.get_height() * scaling_factor);
target_width += !should_scale_width * (target_height * width_factor / height_factor);
target_height += should_scale_width * (target_width * height_factor / width_factor);
>I know I should probably make it an Enum not a string lateryes you should, or just a bool in a case this small. my example only uses the string comparison for clarity following your original code
>>106122626yep
https://www.windowscentral.com/software-apps/windows-11/windows-11-app-store-free-publishing-announcement-build-2025
>>106118486>3 times more LoCand 3 times more readable
what you posted is horrifying
image
md5: c677b0c991485119de030024e1b13ab7
๐
>>106122893You get used to reading it.
Eh, I hoped this will work but now even the compiler is giving up. I guess I can simplify the bounds if I ditch split_const altogether and generate these split_const_n with macros and a helper trait.
Are there any decent (And up to date) books on memory and writing allocators?
Or am i really stuck piecing together everything from cs books, github, blogs, and video presentations?
>>106124265I don't know, but you probably don't need that shit anyway.
>short lifetimeArena
>long lifetime, fixed sizeSlab
>long but predictable lifetime, variable sizeArena is still fine
>long and unpredictable lifetime and variable sizeThis is usually rare enough that you can just use malloc or even mmap and it will be fine.
>>106108612 (OP)Where's the game making guide? I got a crazy game idea that will set me up for retirement...
>>106122655Uhh that's a neat trick, I'll make sure to remember that.
I think in my case I'll stick with the switch case though, mainly because it's a lot more readable and for a 100 line script I'm not concerned with optimizing for performance
>>106124955Game making guide:
>1) download Unity>2) add some entities and components>3) add script>4) search "how do I do X in Unity" on Google>5) test if it is fun>6) go back to 2)There is no faster and more reliable way of making a game than just prototyping tons of shit until it is fun. Then you just add more content, assets and ship it as on itch.io or steam.
i want to contribute to an open source project but the only ones i actually use are too hard for me
>>106126644Search the issue tracker for smaller bugs. I was in the same boat and couldn't find much for the app I used, beyond styling errors. If you can't find any bugs, just download the repo and make changes on your own. You don't have to push them to the project, but you can improve your familiarity with the software. Having done that, when you do see a bug pop up, you might be able to solve it before the regular maintainers get to it.
>>106122925Got it working.
doing a read about github backup
pretty cool how a snapshot of the whole of github fits in a cabinet in some mine in norway
>>106118486which font are you using?
>>106126860JetBrains Mono IIRC
>>106118486had fun using rust for about 8 months at my old job but seeing that code i know i won't be going back. don't need the performance to warrant all that syntax, something like Haskell or Lisp is way more elegant.
>>106126906Except for the range operator (from..to), the syntax in that image is very basic. Just normal dot chains and lambdas, very similar to what you would see in Javascript or any other modern language.
It's the semantics that are complex here.
>>106126946the semantics you get used to in a few months. borrow checker, lifetimes, smart pointers, never had a problem with them. it's the syntax that's ugly and cluttered and hard to read.
>>106126966Are you sure you are not confusing IDE inline hints as part of the syntax?
Just add explicit return and change |_| into [](auto &&) and you got C++ syntax. Or () => and you get JS syntax.
The syntax here is nothing radical. If you want to see some complex syntax look at metaprogramming here:
>>106126823
>>106126946>Except for the range operator (from..to), the syntax in that image is very basicthe syntax may not be that bad but the code layout and indentation are profoundly retarded
>>106127027i wasn't talking about that example in particular, it just reminded me that rust in general is a bit of an eyesore. add in explicit types (which you have as IDE hints) and yes it's even worse.
fn fetch_and_parse(urls: Vec<String>) -> Result<Vec<(String, usize)>, Box<dyn std::error::Error>> {
let client = reqwest::blocking::Client::new();
let mut results = Vec::with_capacity(urls.len());
for url in urls.iter() {
let resp = client.get(url).send()?.text()?;
let line_count = resp.lines().filter(|l| !l.trim().is_empty()).count();
results.push((url.clone(), line_count));
}
Ok(results)
}
think about what this would look like in haskell lol
uh oh rust is not as "desired" as it was
https://survey.stackoverflow.co/2025/technology/#admired-and-desired
>>106127173>it just reminded me that rust in general is a bit of an eyesoreThe code you have included is not that weird as well. Except for ? operator and no parentheses in for, this is something you would often see in typescript or C++.
>think about what this would look like in haskell lolI don't know haskell though. Haskell is quite different from languages you generally use to get shit done.
>>106128208>haskell didn't make the listbros... we got too cocky
>>106128865>rustroons don't know we existwe're safe... for now...
>>106128208>>106128872>>106128865rust is literally stone dead all development has halted
>>106128920the developers who make it are looking for jobs
>>106128208>scroll through it>web shit>scripting shit>dockerWho fucking cares?
>>106128932lmao i was just reading about
two rust compiler devs weren't getting paid enough and now they are throwing a tantrum because the good paying jobs they are getting offered won't let them work on the rust compiler
>>106128913https://blog.rust-lang.org/2025/07/03/stabilizing-naked-functions/
Literally a month ago. What are you on about retard?
>>106128945Well, most developers are working on webshit, what do you expect?
Also what's interesting is that everyone is against vibe coding with almost no variance across age groups.
>>106128932Wasn't that just two people? It seems like a lot more than just two dudes work on it.
>>106128983>11% of people are vibe codingout of SO survey responders. which means probably 50% of devs are doing this
mental how im scrolling through rust contributors and all the "women" are men
running build_ext
running build_rust
error: can't find Rust compiler
If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
bros I hate rust trannies so fucking much
>>106128968Really telling how Jewish our society is that you need permission from your noseberg to contribute copyright code (legally) to FOSS. How did we let this happen?
>>106129008>A bloo bloo I'm a scripting babbyNo one cares about you thougheverbeit. Write your own cython or cffi bindings faggot.
>>106128968Reddit was acting like these two dudes are out on the streets begging for food. They're delusional asking for $600,000 a year to do what they want.
>>106129043kill yourself you fucking nigger
>>106129075Why are you so butthurt? Do you realize I'm right? This is /dpt/, start coding, stop whining or just install rustc.
>>106129092got it fixed by downgrading the packages but the ecosystem is going down the tubes because of rust trannies
>I'm right?kill yourself you fucking nigger
>>106129117Mate calm down. NTA I don't even use Rust but you can't shit on anything when you're working with that horrid mess that is pip. Delete Python and use something better.
file
md5: d60ed1fc99d7c31686a4a12c306ece3f
๐
>>106108612 (OP)>The general is very dead latelycomputers do the work.
>>106129176>see girl name in commiters>look "her" up>pic relatedEVERY
SINGLE
TIME
>>106129213Why you shouldn't troon out if you're Dutch
Bro we get it, you're obsessed with troons.
Can you maybe just post about programming though.
>>106129117>Muh ecosystem is going down the tubesI deal with a lot of fly-by-night JavaScript garbage too, but since I didn't write it and it works and having nodejs isn't onerous, I just accept it instead of throwing a shit fit. Set up a container that has all the build tools you need and stop crying like a bitch. I ask again, what exactly is your problem?
>>106129234why are you helping him when he's being so rude to you
>>106129221he must have a massive dick
>>106129253Because I legitimately don't understand the mindset. When I was younger I cared about purity and everything, but being forced down the stupid blackduck, sbom, retarded cancer path, I realized almost all of it is 100% a meme.
I'm implementing bit vectors as I'm trying to learn about compression and need some primitives for building variable length codes.
finally got around to fixing some things in my filemanager i am currently writing
>>106129866All I know is I have his book and it was easy to read and digest. Needed more depth though, but whatever. Points you in the right places at least.
should i be using final string static like this?
the key isn't changing
>>106130163why don't you ask chatgpt since you're just gonna vibe code anyway
>>106116294avoid implicit convertions, instead of operators use toString method
never return sting views
>>106131368projecting gojeet
>>106116294>modulesholy ARYANโฆ
>>106114029Why is it that challenging? I can write my own module std and import that. Am I missing something?
>>106114605Based Java-with-destructors GOD.
>>106114736No one wants to keep fully qualifying namespaces, Rajesh. I will use using statements as much as I please and modules are the key.
>>106128208>Gleam is a new addition to the list, and for good reason - developers like it!Oh, itโs โWhat if Rust, but also Elixir?โ for maximum transexuality
>>106128993>It seems like a lot more than just two dudes work on it.you forget how niche this """"""""languaige"""""""" is
The ideal language would be C++ with Java style conventions and syntax and Java sized standard library, Rust-style modernisations to standard library classes, and Rust-style ecosystem.
>>106116294where's the code
file
md5: e17fecb055a53de5a5b55023ce9201cf
๐
>>106127173>Box<dyn std::error::Error>
>>106133115holy shit it's real
why would they assume that nazis want to infiltrate a programming language to the point of having that on their front page
>>106133737>i only know java, heard that c++ is fast, and that rust has some improvements over it
Currently learning Rust right now.
Kill me.
Miss reading interesting articles written by humans back in the day.
https://www.joelonsoftware.com/2002/11/11/the-law-of-leaky-abstractions/
If the c math library is part of the standard library, how come I have to link it?
>>106134414Funny how every discussion on Gleam turns into an argument on their political messages.
https://news.ycombinator.com/item?id=42821399
Also funny that the creator is one of those 2014-twitter-SJW-tier militant progressives and thinks anything right of far-left is "Nazi bullshit" and will ban you for giving his posts a thumbs down.
>>106116294>rate my code>posts boilerplate
>>106134553the guy misunderstood (or at least misrepresented) what abstraction is
the point of abstraction in programming is that you are not supposed to care about the implementation details. but what he does is focus on the implementation anyway, then calls the abstraction "leaky" because there are bugs in the implementation. which, if fixed (like the SQL WHERE example), would not require any downstream corrections - only proving abstractions actually work as intended
>>106134941Yeah I don't think it's very good either, it's basically a strawman. Nobody thinks TCP is truly guaranteed delivery. The benefit of TCP is either your data gets delivered or you are made aware that data may have been dropped in the form of a TCP disconnect (keepalive timeout or TCP reset), and you can handle that appropriately for your application.
>>106134941his point is that you need to understand what's underneath the abstractions to actually fix the leak
if you're working with an abstraction like SQL or String class and something breaks or you get performance issues, you can only fix the problem if you understand the implementation
i guess a modern example is using a server framework but you hit a bottleneck and don't know why because you don't understand what network operations that framework does under the hood
>>106133115I can't imagine spending time creating something as big as a programming language, something that is already hard to get adoption for, and then going out of your way to be divisive up front. As if 1% of the population was just too many people to contribute they had to constrict it even farther.
weird how compilers have like 100,000 stars on github as if the people who star it will come back to it to make a contribution
>>106134984>his point is that you need to understand what's underneath the abstractions to actually fix the leakand it's a wrong premise when it's not a problem with the abstraction itself
yes, you do need to know of and have access to the implementation to fix issues with the implementation
but it's not a problem with the abstraction until there's an actual issue with its interface, eg. a SQL library/wrapper that doesn't let you use the same table twice in one query
Thoughts on Elixir for servers? It handles hundreds of thousands of connections out of the box (JVM thread-based servers could never).
>>106134888>https://news.ycombinator.com/item?id=42821399>It le speaks to meOldfags should have done a better job gatekeeping
Why did Rust off the deep end with appealing to trannies etc? Why didn't they just make a language and focus on that instead?
>>106134431I use C++ regularly, love the Java standard library, and wish C++ had a modern toolchain and ecosystem like Rust. Kill yourself fag.
>>106136607learn TLC, Prolog, Erlang, Lisp etc then come back and talk about languages
>>106134414reading these threads and posts like yours, I almost think having a filter like this is a good thing. I say this as someone who's probably more of a fucking nazi than most you cucks. get the fuck over your retarded opinons. FOSS is about code only. socioeconomic politics bullshit belong somewhere else.
>>106136607hey, at least zig (as a c++ compiler) exists. that has been an immense uplift in dev usability honestly.
I was able to remove a bunch of bullshit gcc build systems since zig can target most non-meme archs w/ libc choice in a ~100MiB distribution.
clangd is ok. vcpkg is acceptable if you don't care too much. etc.
>>106136662literal schizo can't see his own post contradicts itself.
>>106136607have you looked into C#?
P/Invoke is ok and they're making C# less boiler plate-y. If you're on Windows, you also have C++/CLI for more C++ interop, only works on Windows though and it's kind of a bitch.
>>106136698what is the c# equivalent for people who want nothing to do with windows
>>106136717uh... Vala I guess?
dead lang though. Pretty sure even GNOME is going with Rust moving forward.
>>106136417>Why did Rust off the deep end with appealing to trannies etc? Why didn't they just make a language and focus on that instead?It didn't. All it did was put a flag on their tranny discord and give out stickers on the US meetings. If you do not use discord and live in the first world, you never see any trannies even if you write in Rust.
>>106133115 >>106134888 this is going to "the deep end with appealing to trannies".
>>106136753Tranny detected. Pushing pro-trans propaganda is literally bringing politics to a programming group.
>>106136753>If you do not use discord and live in the first world, you never see any trannies even if you write in Rust.can confirm. more likely to see a Java, C#, python or js tranny in the real world than a rust dev even.
Damn is this board ever not obsessing over trannys
>>106136764no, it's called a filter to keep (You) out. No one else cares.
>>106119374Sepples is getting a borrow checker very soon! :D
>>106136791It's so obvious. You're here saying "nooo you can't talk about trannies this is programming keep politics out" while also being okay with programming language designers pushing USA-centric pro-tranny slogans all over their work.
>>106136803no one cares about your personal struggle with trooning out. keep that shit in /lgbt/ and /pol/, tranny.
>>106136875lmao based schizo, I am actually confused as to the point you are making
>>106136884NTA, but people who are most obsessed with trannies often happen to be huge degens themselves, but I digress.
You are right on something though. This is /dpt/, a daily programming thread. Talk about programming or fuck off. If you wish to discuss trannies go to >>>/lgbt/ or >>>/pol/ depending on you political preferences.
not gonna lie, after dealing with Windows, I am struggling to understand why anyone would hate systemd. Windows is much worse.
>>106136921>why anyone would hate systemdConsolidation of system responsibilities to single codebase rubs many people in the wrong way. It is a clear departure from unix philosophy that Linux originates from. Given complexity of systemd, some people justifiably worry about potential malicious code being included in it.
It's not like people hate it because it is worse than Windows. People hate it because it seems potentially worse than other Linux alternatives in some ways.
>>106136943and the alternative is basically worse than even windows. kind of nuts if you think about it.
>unix philosophykek, lmao. Windows already heems that why even bring it up?
>>106136948>Windows already heems that why even bring it up?Because it is relevant to Linux and systemd.
>>106136968ya, and windows mogs UNIX so hard, even Linux adds non-unix shit every release.
pidfd is one of the best things to ever happen to linux. It was pathetic how much global state and bullshit you needed just to properly handle child processes, vs Windows WaitForSingleObject() (or Multiple)
>>106136921speaking of Windows and systemd
https://systemd.io/CREDENTIALS/
are we going to see "just works" Kerberos in Linux now? would be based if systemd could hold username / passwords securely and set up a keytab in $CREDENTIALS_DIRECTORY for me.
Does anyone has the blog link of the guy sperging about Jean Heyd Meneides of the C and C++ comitee ?
>>106137010based black man
>>106137010All I know about that man is that some Rust trannies (yes actually trannies) removed him from a conference and other trannies got mad.
>>106136647>learn the (((goy lisp dialects))) that spam a million brackets everywhere before talkingnope, go back to your cs 101 class
>>106136676I have heard about using Zig as a C++ build system. Does it support modules? I've been using modules with clangd and a bunch of obnoxious CMake files. I heard XMake is good too but it breaks often for me.
>>106137268Never seen Lisp or Racket outside a CS 101 class. Don't know what you're being cocky about.
>>106108612 (OP)Hey programmers, where is my /wdg/?
>>106136698I wish C# had more manual memory management like C++ and had a more C++-style syntax for pointers. C# is fine though, I use it for my job though there are a few things about Java that I prefer over C#, mostly syntax and style choices though.
code = b"\x8d\x04\x37\xc3"
pcode = (c_char * len(code))(*list(code))
ptr = mmap(0, len(code), 0b111, 0x22, -1, 0)
memcpy(ptr, pcode, len(code))
FUNC_TYPE = CFUNCTYPE(c_int, c_int, c_int)
add = FUNC_TYPE(ptr)
child = fork()
if child == 0:
ptrace(0, 0, 0, 0) # trace me
os.kill(os.getpid(), signal.SIGTRAP)
result = add(2, 5)
exit(0)
else:
regs = USER_REGS()
status = c_int(0)
waitpid(child, byref(status), 0)
while not WIFEXITED(status):
ptrace(12, child, 0, byref(regs)) # get regs
if regs.rip == ptr:
print("parent: add reached")
break
ptrace(9, child, 0, 0) # single step
waitpid(child, byref(status), 0)
ptrace(7, child, 0, 0) # continue
waitpid(child, byref(status), 0)
assert WIFEXITED(status)
It werked
>>106137474what does it do
>>106137496Turns some assembly into a function then calls it from the child process while the parent steps through and waits for it to reach the assembly part.
I want to make a TUI mini-IDE for assembly with Textual.
Anyone know why Windows Server 2019 has such a broken TLS? I'm trying to connect to my message queue with TLS and getting protocol mismatch... I can use s_client in the openssl command line just fine...
>>106108827>actually good languages (C, Zig...) because it is a great playground for learning programming in generalTell me how would you create a closure in C or Zig.
That's right, you can't.
It can't be a good "playground" if you can't apply all computer science concepts in it.
>>106120456>the borrowil checker is a featurefound the human garbage collector here
>>106137789Rust and C++ are nightmares of complexity for a reason. Most people don't understand why and it's hilarious to me. I will admit I wish we had better captures syntax for rust closures, but it doesn't matter that much.
>>106133115>Oh, itโs โWhat if Rust, but also Elixir?โ for maximum transexualityAnyone who uses that shit instead of Erlang, as God intended us, shall die in hell.
>>106135884>Thoughts on Elixir for servers? It handles hundreds of thousands of connections out of the box (JVM thread-based servers could never).Grow a pair and use Erlang.
>>106137844Anyone who bothers with erlang is already retarded thougheverbeit. BEAM is slow and its only killer features can be replicated by anyone who bothered reading 7 concurrency models in 7 weeks.
>>106136647>learn TLC, Prolog, Erlang, Lisp etc then come back and talk about languagesbased
>>106137866>Anyone who bothers with erlang is already retarded thougheverbeit. BEAM is slow and its only killer features can be replicated by anyone who bothered reading 7 concurrency models in 7 weeks.Ok java developer, graduate of Durga solutions, tell me how can you spawn hundred of thousands lightweight processes in your wageslave programming language.
>>106137808Found the garbage human to be collected.
>>106137905Uh, have you been living under a rock? Most modern languages either have N:M green thread schedulers or stackless coroutines. Any sufficiently complete stackless coroutine framework can replicate actors trivially as well.
>>106137965>Uh, have you been living under a rock? Most modern languages either have N:M green thread schedulers or stackless coroutines. Any sufficiently complete stackless coroutine framework can replicate actors trivially as well.I wrote "lightweight", don't forget that.
Perhaps you are thinking of Go coroutinges, which require about 8x the memory allocation compared to an Erlang process. Or you're thinking of C++20 stackless coroutines, but then you'll be using that wreck of language called C++.
>>106137866whatsapp uses it pretty well retard
>>106137789>Tell me how would you create a closure in C or Zig.I wouldn't.
struct vtable {
// function pointers
int (*func1)(struct mydata *data);
};
struct mydata {
struct vtable *vtable;
// data fields
};
int mydata_func1(struct mydata *data) {
return data->vatable.func1(data);
}
int mydata_func1_something(struct mydata *data) {
// somethting useful
}
int some_func(struct mydata *data, int arg1, int arg2) {
// ...
int x = mydata_func1(data);
// ...
}
>>106109998huh, so you can emulate Deffer with class destructors
>>106138075>I wouldn't.Lol, just answer "i can't" instead of this absolutely ugly clusterfuck of code.
>>106138075Imagine writing all this shit every time you want to map/filter/reduce
>>106138126>I don't know what I'm looking atyeah, not surprising
>it's uglythe 2 struct definitions and the 1st function would be in a header file
mydata_func1_something is the implementation method btw
>>106138207>>>106138126 (You)>>I don't know what I'm looking at>yeah, not surprisingSo, you don't know what a closure is.
>>106138180Why it cannot be a .c executable?
>>106138323What I wrote generalizes closures.
>>106138432no it doesn't. what the fuck are you talking about?
>>106114079His voice is bad and he didn't want to it to detract from the actual information, he even did a poll and people in general wanted the AI voice for more clarity.
I'd take AI voice over a shitty indian accent or a bad voice any time.
>>106138484it's not a fucking closure, retard. you can't represent one in C's type system no matter how hard you try you absolute retard.
>>106138529>a class with 1 method is not a closure>you can't represent one in C's type system no matter how hard you try you absolute retardand yet you can implement closures in C and you can represent closure's C implementation on C's type system
>closures
JS level of retardation if those closures capture a mutable state instead of closing over values
you nibbas are so fucking bad at programming it's unreal
>>106138432>What I wrote generalizes closures.go back to school
>>106138442>no it doesn't. what the fuck are you talking about?I hope the other 5 or 6 Zig developers in the world aren't as dumb as him.
>>106138529>it's not a fucking closure, retard. you can't represent one in C's type system no matter how hard you try you absolute retardEXACTLY.
>>106138591>and yet you can implement closures in C and you can represent closure's C implementation on C's type systemstop smoking crack
>>106138773>>106138803>>106138788>no counter argumentsI accept your concessions, gentlemen.
I've never tired modifying anything but I have a modded game that makes a request and unlocks things based on the response.
The mod is just a DLL, and I know the URL it's getting, but I can't find it using strings and I have no clue what I'm doing with ghidra/IDA
the imports don't show anything related to http requests, but the game exe does have "WinHttp..." so I guess it's injecting the URL somewhere, but how do I change that if I can't find the string?
>>106138075based
retards ITT cannot stop circlejerking closures when they're literally a structure with a single function pointer, or a class with a single function (for the OOP pajeets)
>>106138922Could be parsing the string from an obfuscated byte array or something. Idk how you'd do it but I would step through execution until it made a network request to get the general location and then go from there.
>>106139013Is there a faster way to step through, I already wasted 20 minutes clicking next on x64dbg only to realize it hadn't even loaded the dll yet
>>106138955>when they're literally a structure with a single function pointer, or a class with a single functionThey are not, go back to CS 101.
>>106139059should be the opposite
>>106139059C++ lambdas > Rust lambdas
>>106108827>>106137789>muh zigHoly shit buy an ad. No one likes your memelang.
>>106137905>muh java muh durgasoftFound the seething Gojeet.
>>106137965>>106138010Java virtual threads won.
Goroutines lost.
>>106117239dont know of it fits your case but i use taskfile
>>106117239>diy gaming consolewhat do you mean by that?
file
md5: fceb80c999a9b1fa9b3e01490bd8abdf
๐
is this intentional obfuscation? I don't get what this is doing
>>106140119if it is its not very good obfuscation
>>106140119It adds and subtracts
>>106138862Here is my counter argument
https://en.cppreference.com/w/cpp/language/lambda.html
https://doc.rust-lang.org/book/ch13-01-closures.html
Your code isn't either of these.
>>106140177so if it's not obfuscation, why would it add then subtract the exact same values, is the result not exactly the same as the input?
>>106139255It's basically the same sans explicit captures syntax. That's the only difference between them.
>>106140235i dont know why, it doesnt even matter that its the same, even if it was different you could fuse all the additions/subtractions
file
md5: 6a5d23f9269d7ed312dde2a454f00f93
๐
I don't know anything about programming.
AI has built me a 8,000 line of code, 35 file big project. It's not done yet.
>>106138862fn make_ctr(mut x: i32) -> impl FnMut() -> i32 {
move || -> i32 { x += 1; x }
}
fn main() {
let mut x = make_ctr(0);
let mut y = make_ctr(5);
println!("{}", x());
println!("{}", y());
}
here's a real closure retard. you don't have any in C. without generics you will never have them either.
go back to fucking scool next time kid. maybe you'll learn what a closure is there.
>>106108827>t. noncoderI just want to write some C app for my retarded Android phone, but the Goygle jeets are leaving me no other choice than to install their 30GB of Android Curryio Java bullcrap
Anyone know a way around this ?
PS : Yes i know Termux is a sane environment but i want to make an actual graphical app
>>106140429why?
https://developer.android.com/ndk
>>106140350You absolute gorilla nigger, if you want that shit go write Lisp. Then you will have an actually clean and pure functional language. And most dialects integrate well with C.
C is meant for "real shit". It's basically humanized assembly. That's why it's so good, and that's why it has no fancy CS features; you implement that in C.
>>106140452I know about the NDK, but it still requires me to install the whole rest of Android Curryio. And to either write Gradle or deal with "project" bullshit.
>>106140464lowest IQ post I read all day.
good job.
C is not like hardware, let alone "humanized assembly" in the slightest, in fact, rust is closer to that goal since it has naked functions, #[no_std] and an actual syntax for inline assembly.
I'm just glad you gorilla nigger retards got filtered by C++ so I never have to deal with your kind.
jesus christ.
>>106140485no shit? you need to interact with userland and userland is java. what do you expect to do?
>>106140502>rust is "humanized assembly" because it lets you inline assemblydo you even understand the meaning of words?
>>106140517Use libc, libm and GTK like a sane person ?
Afaik the Java doesn't go that deep in android no ?
>>106140545>libc, libmyou can do that with JNI (fucking why?)
>GTKhow is GTK going to be supported?
>>106140502>naked functionsYou mean the thing that literally behaves like a C function ? Terrible name btw
>#[no_std]-ffreestanding ? -nostdlib ? It's not in the C standard yes, but those flags are supported by GCC and Clang, and i know TCC can do the same
>syntax for inline assemblyFirst, same thing as for your previous agrument, it's very much not in the standard but it's supported by virtually every compiler
Then, since C actually has a sane ABI, you can just write assembly in separate files and link to it directly with literally any toolchain.
>>106140619>You mean the thing that literally behaves like a C function ? Terrible name btwno? do you even know what a fucking ABI is you clueless C jeet? you have the nerve to call anyone a gorilla nigger and yet you post low IQ rebuttals like this?
>>106140559>you can do that with JNI (fucking why?)To make myself clear, i want to just write C
>how is GTK going to be supported?Yeah my bad it seems like it's not actually supported for android. But Qt is ? Anyways i would rather deal with OpenGL directly than with a Java UI lib.
>>106140648>i want to just write Cthen buy a librem 5. Android will never allow you to do anything useful from C.
>>106140632https://blog.rust-lang.org/2025/07/03/stabilizing-naked-functions/ This right ? In C you don't need special syntax for that.
#include <stdint.h>
uint64_t wrapping_add(uint64_t a, uint64_t b){
asm (
"lea rax, [rdi + rsi]\n"
"ret\n"
:
);
}
Is equivalent to the example from pagerel
>>106140741PS : Well you do need to compile that file using a SystemV 64 target, and i am using the GCC inline asm syntax here.
>>106140656Fuck me then. I guess i'll wait a bit more for a miracle of christ (you never know) and install the curry sdk
>>106139536Basically, I want a build system and command runner that is rather simple, succinct and language agnostic. For example, I really like how clean and short ninja files are, but it lacks many features useful to writing these by hand nor can it function as a command runner.
Currently, I have rules/tasks for the following:
>some tasks to run bunch of scripts like cargo script scripts/whatever.rs "$@" so I can do $ fizzbuzzmake script-whatever input output>bunch of tasks for building assets, often multi step, eg calling imagemagick or ffmpeg to transcode and then one of the scripts mentioned above to compress. These tasks should not run if the artifact is newer than its source.>some task that builds all these assets>some tasks that first does all the build commands and then cd into specific crate's folder and runs cargo run "$@" so I can pass extra arguments if needed>some tasks that builds everything and then runs some command to launch tests>some task to run bunch of commands to clean temporariesI checked out taskfile and from what I have seen, it "suffers" from similar issues as cargo-make that I am currently using. Namely, you have to write sources and destination manually alongside the command, splitting across multiple lines, repeating same thing over and over. I really would like something like ninja's rules where you can specify generic way of processing something and then just list files to extend from.
>>106139554I am making a handheld console together with a friend. The plan is to make it relatively small and cheap but also but whatever feature we can into it. It will be based on esp32 and support Pico-8 game cartridges. Here is the calibration in action that I just finished recently. I really have no idea why does the physical pixel grid doesn't align with logical ones on the screen. Physical 0x0 is addressable as 1x2.
I have a thread on /diy/ where I post updates every now and then. >>>/diy/2932429
>>106140741No. I do not think C supports naked functions at all.
In your example, compiler can add platform specific shims for handling arguments and return. Rust naked function is really just a basic asm label to some assembly code, with no ABI/language/platform specific stuff added implicitly.
>>106140903The difference isn't huge. And with -O2 it goes away.
>>106140946It's not about performance, it's about control. naked function is guaranteed to not have anything added implicitly by the compiler. C has no equivalent feature, all you can do is just hope it won't add anything for any platform, compiler and configuration, or separate assembly code into external asm file and link against it during compilation.
>>106140955Does just support build system-like features like skipping tasks if the output is newer than input? I thought it just works as a command runner.
I am seriously getting close to doing pic related but the size of the projects will not justify time invested into developing custom build system.
Once I have project that requires this, I will make one that cover's all use cases.
>>106140974>it's about control>Rustkek
Anyways, yes in fact
> all you can do is just hope it won't add anything for any platform, compiler and configurationHowever, GCC, Clang, even TCC are stable enough for "trust me bro" to be enough in this case.
If you are writing stuff that requires very very explicitly to not have anything added by the compiler (For which i literally do not know any usecase), you wouldn't want to do it in inline asm anyways.
>>106141038You are completely misunderstanding all of this.
This is not an issue of stability. Standard C has no way of expressing this. Even if your compiler does not add any shim one day for specific flags, it can change that behavior at any moment and it won't be a breaking change or regression because at no point it ever guaranteed such behavior. Rust's naked attribute is such guarantee. No matter what platform, flags or even compiler you use, it should never add any shim to that function and merely translate it to a symbol that points to this sole inline asm block.
However after quick search on google, I found that GCC does have non-standard extension for that.
https://gcc.gnu.org/onlinedocs/gcc/x86-Function-Attributes.html#index-naked-function-attribute_002c-x86
This is the C counterpart of Rust's naked function.
>If you are writing stuff that requires very very explicitly to not have anything added by the compiler (For which i literally do not know any usecase), you wouldn't want to do it in inline asm anyways.The entire reason why naked functions exists in Rust and GCC is to enable doing that.
>>106141038>seething C jeet when he realizes rust allows for lower level control than his shit language.always makes me kek. fuck off this board already. you worthless idiots are an insane drain of intellect.
>>106140974>Does just support build system-like features like skipping tasksno... sorry.
>>106141130>GCC does have non-standard extension for that.Problem solved then ?
>>106141149You do realize that this is an extremely pedantic extra bit of "control" over C ? Even more so because it's available as an extension ?
Then you will go back to your miserable nvim rice and bend over backwards for the borrow checker.
>>106108612 (OP)See OP in case you already forgot.
>>106141189>heh, rust makes you be explicit about pointing a loaded gun at your foot>checkmate foot-haversthis is literally how retarded (You) and (OP) sound.
>>106141189>Problem solved then ?The only problem here was just one clueless C programmer who had no idea what he was talking about.
Unless you are retarded you should understand the reasoning behind naked functions by now.
>>106140851im probably missing something obvious but create a task with variable name and use for loop over the filename array? probably any task runner can do that
>>106141250>im probably missing something obvious but create a task with variable name and use for loop over the filename array? probably any task runner can do thatYeah, that roughly what I am doing right now. Here is my cargo-make Makefile.toml for assets for example.
The issue is that it doesn't support env variables properly in the condition clause(it applies envs after the condition check[even if it fails], which I have already reported as an issue on the github). And it still feels bloated, just look at this shit.
I really really wish I could make it as simple as something like:
rule png_rgb565
command = ffmpeg -i $in -vcodec rawvideo -f rawvideo -pix_fmt rgb565 $out -y
rule rle
command = cd $repo_root && cargo make rle-encode assets/$in assets/$out
rule wav_pcm
command = ffmpeg -i $in -ar 44100 -ac 1 -af volume=0.1 -f s16le -acodec pcm_s16le $out -y
rule git_clean
command = git clean -Xdff
build BadApple.smol: rle BadApple.raw
build XD.smol: rle XD.raw
build calib1.raw: png_rgb565 calib1.png
build calib1.smol: rle calib1.raw
build calib2.raw: png_rgb565 calib2.png
build calib2.smol: rle calib2.raw
build calib3.raw: png_rgb565 calib3.png
build calib3.smol: rle calib3.raw
build calib4.raw: png_rgb565 calib4.png
build calib4.smol: rle calib4.raw
build calib5.raw: png_rgb565 calib5.png
build calib5.smol: rle calib5.raw
build calib-target.raw: png_rgb565 calib-target.png
build calib-target.smol: rle calib-target.raw
build kutasan.pcm: wav_pcm kutasan.wav
build build: phony BadApple.smol XD.smol \
calib1.smol calib2.smol calib3.smol calib4.smol calib5.smol \
calib-target.smol kutasan.pcm
build clean: git_clean
(translated by AI btw)
But ninja doesn't work well as command runner...
Maybe I could use both ninja and just together, but that sounds like an overkill.
>>106141130>I found that GCC does have non-standard extension for that.I found that clang supports the [[gnu::naked]] attribute, and that's actually the LLVM flag that rustc is setting.
It's a goddamn storm in a very very small teacup.
>reading nvidia's documentation on proper async compute usage in vulkan
>in order for queues to be dispatched asyncronously hardware scheduling has to be on
>queues may or may not be heavily virtualized so oversubscription is possible
>weird shit relating to task overlapping and scheduling based on workload
wtf
i heard once they used a heterogeneous architecture and that AMD used a homogeneous one
maybe that's the reason?
>>106142270Most of these unstable/non-standard attributes in Rust/C/C++ are just that, some random LLVM attribute or hint.
>>106142439a subset of them
sometimes things just use LLVM IR directly with C linkage as like ghetto compiler builtins for stuff completely impossible to represent but that still needs to be portable
>Why do people advertise that they have crabs?
>Just go to the doctor.
im working on a fun ant game where they dig and stuff
>>106142736How about the player can move selected ants that leave their pheromones on their path and by doing so the player must influence the colony (made of housands of NPC ants that all follow the ant algorithm) and reach targets, avoid targets or compete for a target against an adversial player?
>>106142736Total furry death.
>>106111294toml is as gay as makefile
if you cant compile in a one liner using a simple script to concat dependency locations you have failed
>>106143304It impresses me how mr "obvious" markup language over here somehow managed to fuck up his "simplistic" configuration format before any decent parsers were written. As far as I'm concerned, all the toml parsers no matter the language are complete hindu code. I may as well roll a damn JSON parser or import some XML shit at this point.
TOML > JSON > YAML >>>> XML
dependent = [ "path/to/dependency1", path/to/dependency2]
dependencies = ""
for each dependency in dependents += dependency + ";"
shell command = gcc dependencies etc
run shell command
why does anyone need more than this? are they fucking retarded?
cargo add <dep1> <dep2>
cargo build
why does anyone need more than this? are they fucking retarded?
>>106143606Maybe try coding something yourself and find out?
sudo rm -rf / --no-preserve-root
why does anyone need more than this? are they fucking retarded?
>>106143690i already use basic scripts for concating dependency paths and other flags into one liners
much better than toml or yaml or makefile or other such stupid bullshit designed to stave off engineers dilemma
>>106143679toml and ini ARE for nocoders though
>>106143721Does GNU Make works fine on windows too?
I need something cross platform.
>>106143768I use it in Cygwin and it works fine yeah.
should be a few ways to make it work well besides Cygwin.
>>106143768technically yes but realistically no, you're going to be boxed into a windows POSIX-like environ
which is fine if you're willing to put up with that
also it doesn't do half the shit that you want unless you intentionally misinterpret it as do linux thing but on windows
premake might qualify?
it's a lua based build system so it's at least programmable
i don't know how well it works with non-C tasks and with command translation
meson maybe?
i generally hear good things about it despite it being XML based and i think it's okay with rust
even without the windows problem i would avoid GNU tools, GNU and tools that expect GNU stuff suck at anything cross compilation related because of GCC's mono-architecture design and tradition of using filenames to identify architecture even though they shouldn't need to and should really just use a thin shim that mimics clang's --target option
GCC's single biggest weakness desu
>>106143241C++ is literally superior to C in every single way, no one thinks youโre a genius because you only use C and use raw pointers and manually manage memory.
where do you get your project ideas from
>>106144074holy shit, fuck off zombie brain
still more choices before i can even begin
https://pastebin.com/B26rGj2N
>>106144074github topics and awesome lists for existing open source projects that seem interesting and i think could be interesting to implement or are maybe done in a way i don't like
books and papers describing interesting techniques
although most of my finished projects are
>i need <thing> done/automated in <specific way> and <existing tool> is too specific/general/clunky/too slow/not mine/etc. to easily do itthe amount of fucking automation and utility shit written in python that has no business being written in python just because it's easy is infuriating
speed matters when it's being invoked on a shitton of files a shit ton of times and other downstream tasks depend on its output
Every build script for each language should be written in the language itself.
You can't prove me wrong.
>>106140851>I am making a handheld console together with a friend.Oh. I am myself more interested by the software side of this, which emulators will be on it.
>>106144330There shouldn't be a build script at all, unless there are compiler options or compile time parameters to specify.
>>106144405Precisely.
>compile this this and this with this flag>compile this with this flag>link statically/dynamically with this and run this test>run the executable and verify this testKinda like a makefile but with a turing complete language so you can do anything instead of having 20 separate config languages to compensate.
cola
md5: 35da8cc1bd7b3d87c148ab0531a55fae
๐
>>106144460Yes, I agree with most of this. Certainly that the build script/makefile should be a single turing complete language and that there should only one. It would be cool if the build script was in the "same language" than the program being compiled. I mean, a normal general purpose language would feel awkward for this purpose, but if it had DSL support you could have syntax and semantics more adapted for this purpose and the makefile would be a regular program.
The thing to improve imo are the flags. I hate them, and Jon Blow is right when he says that only the program source should affect the compiler's output. All the flags could be specified instead in the build script.
Even better, if the entire compiler was one big high level script that would call high level compiler functions (the compiler would be a library): read input file, parser, metaprogramming/compile-time execution/macros/etc.., type checking/inference, AST-to-IR, optimizing compiler analyses and passes, assembler, linker; it would be very to modify the compiler parameters, modify specific aspects of compilation in some way, or to extend the compiler. You would only need to know the data structure passed and returned by each phase.
Standardized systems language are irrelevant, only the compiler matters. If anything should be standardized it's the IR, not the front-end language.
>>106144863forgot about the code generation phase, between the optimizations and the assembler. It could itself be calls to high level functions: instruction selection, register allocation, scheduling
>>106143681>cargo add bevy>400 deps added>cargo build takes an hour to finish
>>106108612 (OP)lmao rust. it's just bloated, complex garbage for brainlets.
compiler daddy holding ur hand. borrow checker mental overhead is real, a tax on actual competency. for shitter devs who can't even code c/c++ right.
real engineers use c/c++ and proper tools (asan, tsan, etc), not some language babysitting their ass. you don't want unsafe engineers near critical systems, so why would you promote a language that lets them get closer without being caught?
rust just gives them fake safety while they stay incompetent. literally a language for juniors who can't hack it.
cope harder rustards. you know i'm right.
>>106143778I will give make a try then. After all, all my commands are rather simple and I just yearn for simplicity of makefiles really.
>>106143897If I do not plan to use coreutils or shell features, is this still an issue?
I will check out premake. Meson seems to be whole ass thing with dependency managment etc. Probably an overkill.
>>106144330Well, larger projects usually have multiple languages in them and some of the build related tasks might not even involve any compilation.
>>106144382So am I! I delegated most of the hardware stuff to my friend so I can focus on writing code.
>which emulators will be on it.Currently we are planning on writing Pico-8 emulator using modified piccolo lua interpreter. It's quite simple and have a nice library of free games. Before that I will probably port a very simple emulator for different architecture that I made some time ago since it's basically a freestanding library. And if I have enough time/energy I will try to port doomgeneric to it.
Right now I just finished basic interfaces for all the peripherals. But due to all these questionable abstractions it's not very fast. I really want to ditch ESP-IDF and FreeRTOS and just go bare metal with embassy and esp-hal. This way it will be probably much easier to properly set up DMA and I hope embassy will just set up SPI/I2S interrupts out of the box and combine it with its reactor. And esp-hal seems much better documented(and popular) than the esp-idf wrapper. I don't really need portability and its modules anyway.