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


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: 116846640_p0.jpg (1.26 MB, 1200x1683)
1.26 MB
1.26 MB JPG
Old thread: >>101363112

What are you working on, /g/?
>>
>>101403054
Tiny Forth-like thing with fully inferred static types for doing some sanity checks in a mostly transparent fashion.
>>
>>101403074
Did you mean to type fortnite
>>
>>101403104
Not sure if trying to be funny or just nu-/g/.
>>
>>101403054
Get the fuck out of my face, I wanna read what's behind you, you dumb fucking whore.
>>
File: reddit.png (39 KB, 403x206)
39 KB
39 KB PNG
>>101403054
redis server from scratch
>>
>>101403054
lust provoked
>>
>>101403054
>7AM
way too early
>7PM
what the fuck are you still doing there
>>
File: file.png (32 KB, 789x521)
32 KB
32 KB PNG
thoughts?
>>
>>101403586
Does C++ STILL not provide a file mapping mechanism? Christ on a stick.
>>
>>101403104
Yes! Sorry!
>>
actually i just read std::ifstream internally buffers

then why do people say std::ifstream is slow compared to mallocing a file to a buffer and reading char by char from there?
>>
>>101403650
Because the buffer might be limited, and it can end up overwriting data you still needed.
Use file mappings. No need for malloc or anything like that.
>>
>>101403664
>Because the buffer might be limited, and it can end up overwriting data you still needed.
oh i see

>Use file mappings. No need for malloc or anything like that.
isn't it effectively the same thing? i mean if i malloc an entire file, and write it back out to disk later.
isn't file mapping just a buffer that automatically the kernel writes back to disk? i guess its a little more useful?
>>
>>101403676
>isn't it effectively the same thing?
malloc works in userspace and needs to allocate memory from the kernel for the actual data plus for its own internal bookkeeping. File mappings work in the kernel via page table, which is already allocated and ready to go. Plus, as long as you don't write to the mapping, the kernel may have the file already in its I/O cache and can map its contents into your process, meaning it doesn't have to perform a copy.

With malloc + read you always have one copy.
>>
>>101403703
i see very cool thanks
>>
>>101403703
>via page table, which is already allocated and ready to go
what?
>may have the file already in its IO cache
nobody keeps file contents in memory that way because it is stupid
>>
>>101403851
https://learn.microsoft.com/en-us/windows/win32/fileio/file-caching
https://lwn.net/Articles/806980/
Commit seppuku.
>>
>>101403519
Thanks
>>
>>101403882
well, i guess both nt faggots and linus are retards.
>>
it's always funny to see hackernews fags and redditors have a meltdown from seeing arthur whitney-style code
>>
>>101404121
>everyone is a retard but me
Anon, I ...
>>
>>101404150
literally yes, let me make some things clear to you:
NT requires root access to have a window, meaning virtually all application programs run on root
Linux claims to be some super secure sandboxed OS but drivers are running on ring 0 instead of having a "drivers only" system call to interface with devices

It is all a farce, i am the only smart person on earth.
>>
>>101404330
for reference, drivers running on ring 0 have access to memory, a ring 0 thread with access to memory will take a couple of microseconds to change its pagetree root, rebuild a pagetree and then overwrite the firmware
>>
>nooooo but pagefaults
*changes the descriptor in gdt*
*forever monitors your user*
>>
File: 1621030108525.png (114 KB, 687x768)
114 KB
114 KB PNG
>>101404330
No.
>>
>>101403054
Is there a situation where processes sharing memory might want to map different parts of a file?
Like say process 1 maps the lower portion of the file while 5 other processes are mapping the rest of the file each
Does this ever happen?
>>
>>101404147
Absolutely anon.
static F1(jtcfr){A c,r,*wv;I t;
ASSERT((-AR(w)&-(AN(w)^2))>=0,EVLENGTH);
wv=AAV(w);
if(AR(w)){c=C(wv[0]); r=C(wv[1]);}else{c=num(1); r=C(wv[0]);}
ASSERT(((AR(c)-1)&(AR(r)-2))<0,EVRANK);
ASSERT((-(NUMERIC&AT(c))&((AN(r)-1)|-(NUMERIC&AT(r))))<0,EVDOMAIN);
t=AT(r); t=AN(r)?t:B01; if(t&B01+INT)t=XNUM; t=maxtyped(t,AT(c));
ASSERT(!(t&QP),EVNONCE) // no qp support
if(TYPESNE(t,AT(c)))RZ(c=cvt(t,c));
if(TYPESNE(t,AT(r)))RZ(r=cvt(t,r));
AF tf; tf=(AF)jtcfrd; tf=t&CMPX?(AF)jtcfrz:tf; tf=t&XNUM?(AF)jtcfrx:tf; tf=t&RAT?(AF)jtcfrq:tf;
R (*tf)(jt,c,r);
} /* coefficients from roots */
[\code]
Always love reading this kind of code. Read it like I read my morning newspaper.
>>
>>101404653
You have to be an incredible autist to see this clear product of mental illness and mistake it for style.
>>
>>101403054
my filemapping was fucking garbage, eating and then making it as good as linux' with hundreds of thousands less lines of code
>>
>>101404743
reddit reaction
>>
>>101404868
And?
>>
File: 1693584224673692.png (26 KB, 1045x106)
26 KB
26 KB PNG
Spent the afternoon trying to figure out why code analysis for error lens wasn't being automated despite having it set to true in settings. Found this option which did the trick.
>>
I landed a 6 figure job using AI and youtube tutorials in 4 months because im good looking. I dont know what Im doing lol.
>>
>>101405131
unironically: based

Fuck an HR roastoid's daughter
>>
what to do when you love programming but you have no idea what to program and everything that sounds remotely interesting would take years to finish and also would require lots of multi-disciplinary skills.
i dunno what to do with my life man. everything exists already.
>>
>>101403586
Oh, wow. That's bad. Imagine using C++.
>>
>>101405131
Took you all morning to come up with that bait, eh?
>>
>>101404103
>Extreme, potentially incoherent tl;dr: is there a name for a pattern where each function which might be modified by an observer returns a struct that describes whether and how it was mutated, and that struct is then used to decide whether to continue with the regular control flow or call new custom logic now embedded in the struct by observers? The key aim is to avoid turning everything into an object but to still be able to modify the steps of an already running function via the interference of observers.

>Mother function calls modifiable subfunction.
Subfunction executes observer-independent logic, makes a struct, asks observers to modify it, and returns it to the mother function
Mother function checks the struct and either continues executing the default logic that is treated as the "child" of the subfunction or calls the custom logic the struct points to instead
>Nest as needed
Explain what you're trying to do. It will save you a lot of pain.
>>
Do different terminals have different rules and syntax?
I am not a programmer, I'm just trying to use yt-dlp because I'm done with using websites for that.
In Windows terminal, to use it I have to enter
*full path to the binary* *options* *link*

and specify the path every single time.
When having launched the Python cmd line I can't even run anything, it says "syntax error" to everything I try to execute and lines for Python I found on the internet look like this
$ python3 yadda yadda

I don't understand what to do with them, do I have remove something from them?
MEANWHILE
I open up VS Code, open the terminal and enter
yt-dlp *link*

and boom, there it goes.
Same goes for pip, perfectly usable and easy command, in Windows cmd it's a whole bunch of parameters.
I repeat, I barely started getting into code and stuff all around it.
The question is, am I doing something wrong or the whole experience depends on the program I am using for running, debugging and editing?
>>
>>101405289
>am I doing something wrong
Yes.
>>
>>101405289
$PATH
>>
>>101405207
posting from my new office rn, wish me luck today lol
>>
>>101405318
Will I really have to edit variables for every single program and script? Any way to automate this?
>>
>>101405353
Windows installers are shit at modifying the path for some reason, so you'll have to do it when they fail
>>
>>101405372
Well, shit. Guess I'm switching to Linux.
>>
>>101405319
It's sunday, dingus.
>>
i again have ~20days break in my project because... idk why
>>
Is this the place for asking retarded programming questions from retarded beginner programmers?
>>
>>101405481
When, d'you think, has that stopped anyone from asking?
>>
>>101404611
in general, yea, that's an ipc technique
that situation specifically, potentially?
i can maybe see a situation or two where it might come up
>>
>>101405225
In short, I'm on the third rewrite of a card game in the vein of Magic: The Gathering. If you are unfamiliar, the important bit is that cards consist of effects ("functions") that go on a last-in-first-out stack, and that many effects modify other effects that are already on the stack. In some cases even after the modifying effects are no longer on the stack.

Since several effects can modify or outright replace another, and unique effects number in the hundreds, it can be tough to structure a card's code in a clean and maintainable way. For example, say you have an effect that consists of 10 lines. You know that lines 2-5 might get overridden, so you let the observers call back and tell you whether you should run this segment or something else. You do a simple if statement and refer to the function pointer array if need be.

Later, you realize that you might need to replace just 2 and 4. The hook is for the entire 2-5 segment, so you need to refactor. Add two new hooks, register them in the observer system, and make the appropriate observers react to them. This happens over and over and now your code is an intensely nested jungle where every third line is a hook. Usable, but hard to work with as scale increases.

What I'm thinking about doing instead is essentially turning every game event into a struct which can be subscribed to by observers, points to structs that are logically dependent on it and should be read next (e.g. a target acquirer points to what is done with the target, so if it's replaced the next step doesn't happen), and can be mutated.

The upside is that hooks no longer pollute functionality-related code. The downside is that each card's code is distributed among many files, making it tricky to read if you forget how something works. It's also much slower, but that's not too relevant to me. Mostly, I'm worried that I'm missing something.
>>
>>101405497
If I wanted GUI that displays a python dictionary with two columns, one being keys and the other being values. Also the dictionary updates constantly.

Where do I start? Tkinter? Is there a good tutorial for this?
>>
>>101405353
it's %PATH% on windows and the seperators are ; unlike linux
the python installer should have asked you if you wanted to add it to the path
generally with stuff like dev tools where it needs to be on the path i have a few locations i put binaries (and libraries, the PATH is also a way windows locates dlls installed outside of application directories) set up using unix style directory setups since INCLUDE and LIB also work like path but for C/C++ headers/static libs
generally one for a specific programming language environ
just use symlinks to set shit up stuff you can't move so everything's in a couple of directories
if you need admin permission you can tick a setting in the dev settings on win10+
>>
>>101405574
Can I just create 1 folder to drop packages into and add 1 link for that folder to PATH for usablility?
>>
>>101405547
That's GUI programming. You can use Tkinter for that (https://docs.python.org/3/library/tkinter.html), or you do raw WinAPI programming. Challenging, but you'll learn a lot.
>>
>>101405594
>>101405574
OK, apparently not.
I surrmise that I have to specify the path for every binary IDE can't find itself.
>>
>>101405596
>452 pages

Good God, how does anything get made if there's always these branch-offs to learn?

How bad is it using ChatGPT to fill in the gaps of my program?
>>
Today I learned something about system paths, packages and terminals!
I truly believe it's the beginning of something beautiful!
>>
>>101405594
yes, that's how path works, it's folder based
python would have added the package binary install directory to PATH had you checked the biox for it

>>101405630
is it actually a binary or is it just a script
linux can execute python scripts natively and without a file extension if they have a #! and a path to the interpreter as the first line
whereas windows has a fairly complex system for mapping a file extension to a file type to shell verbs which can control how a filename is passed to a program, iirc one of which is used to set up executing files as a program, then you have to add that extension to environment variable that stores all the "executable" extensions

python packages on windows have to be built into a wheel and installed which makes it into an .exe or you have to set up extension file mapping for .py files so you can run them as binaries
that's a bit more difficult, it's like 3 or 4 layers of registry entries pointing to each other but i think batch (old command prompt) has some builtins you can use as an administrator to map an extension to a file class and a file class to simple interpreter execution
don't remember them though
>>
>>101405715
>How bad is it using ChatGPT to fill in the gaps of my program?
to find function names? not bad at all, that was the purpose of it after all.
to write code for you? please commit suicide.
>>
>>101405727
based grandpa


>>101405745
>all of this abstraction is needed because you are retarded and cant into using real programming languages that compile into binaries
pretty fucking funny desu
>>
>>101405745
>python would have added the package binary install directory to PATH had you checked the biox for it
I think I did. Windows being Windows I suppose.
>is it actually a binary or is it just a script
A pre-built binary.
>mapping a file extension to a file type to shell verbs
>add that extension to environment variable that stores all the "executable" extensions
>built into a wheel and installed
Yeah, all that sounds more complex.
>>101405764
>based grandpa
After hitting 24 I kind of gave up on starting a programmer career, everyone is so ageist in the industry, my train is long gone. Now I'm 26 and feel more like RMS and learning stuff for myself rather than money. I feel something similar to happiness when I write code and it works.
>>
>>101405764
as long as you pick the right language it's still worth it
back when i used windows i'd only ever done it the once to set up executing lua scripts with luajit from the command line
was really good for scripts especially for stuff that only ever needed to call a few win32 API functions
but it is still very stupid, especially compared to shebangs and binfmt_misc which feels like linux's better take on the way windows does it
>>
File: file.png (1.78 MB, 2113x924)
1.78 MB
1.78 MB PNG
>>101403054
where's the bottom half of her body?
>>
I HATE DP PROBLEMS I HATE DP PROBLEMS I HATE DP PROBLEMS I HATE DP PROBLEMS I HATE DP PROBLEMS I HATE DP PROBLEMS I HATE DP PROBLEMS I HATE DP PROBLEMS I HATE DP PROBLEMS I HATE DP PROBLEMS I HATE DP PROBLEMS I HATE DP PROBLEMS I HATE DP PROBLEMS I HATE DP PROBLEMS I HATE DP PROBLEMS I HATE DP PROBLEMS
>>
I love other people's DP problems.
>>
>>101403054
i legit suck ass at programming so im not doing anything related to it even though im gonna do IT/compsci in college
>>
>>101405748
So what should I do in regards to my program? It's a decent app idea.

I'm still far away from finishing learning python.
>>
>>101406068
do it in c++, the standard library environment is more similar to python than C so you dont have to worry about anything.
>>
>>101405539
Have you considered simply factoring your behaviors into dynamically composable blocks and using some kind of tag system to turn blocks on and off dynamically?
>>
>>101406088
Change to another language?
>>
>>101406137
Yes.
C++ is pretty much python but you have the "auto" keyword you can use whenever you get stupid type errors from the standard library constructs instead of types being completely removed from the equation
>>
>>101404840
done, moving on to fixing the ir and sysr environment
>>
If I can't solve problems like https://leetcode.com/problems/edit-distance/ without hints and even spoonfeeding, am I fucked?
>>
>>101406207
It's just CS knowledge.
It's called Levenshtein distance.
>>
>>101406282
I know what it is, but am I really expected to remember something that was covered in my studies 10 years ago?
>>
>>101406207
If you couldn't think of any solution at all, it's over. If you could only think of a retardedly inefficient one it's probably still over, depending on how long you've been at it.
>>
>>101406282
akshually levenshtein distance counts 2 edits for substitution
>>
holy fucking shit they actually approved the initial implementation of the reflection proposal for C++26
i gave up on it coming out for at least a few more standards
>>
>>101406674
>approving dumb retarded shit
not surprised desu
>>
>>101406674
Failed language.
>>
>>101406690
>dumb retarded shit
fucking hundreds of projects and libraries require shit like LIBNAME_OBJECT_REFLECTION(type) and then repeating that for every field of an object in turn
compile time static reflection is something lots of people desperately need

and reflection is necessary for the metaclasses and code generation proposal which effectively sunsets template metaprogramming and replaces it with something that's actually coherently designed, integrated with the language, and not a fucking accident
>>
>>101406736
Just learn lisp, retard.
>>
>>101406746
no thank you
i think instead i'll just write the common lisp object system in C++
>>
>>101406769
You can't because C++ is a primitive programming language with weak features and minimal expressive power.
>>
>>101406736
>hundreds of libraries are poorly written
99% of the time metaprogramming is shitty programming
it's like if you have some abstract thing with fields thinking that there has to be a literal class with each field on it with that name
>>
Trying to figure out which part of the encryption phase is fucking up initial HMAC value while a guy that has kermit the frog as a voice pierces the walls at 200hz with weeping willow monotone inflections every 7 seconds.
>>
>>101406791
years ago i almost got the basic framework for it done on the reference implementation of the compiler for the metaclasses and code generation proposal before the fact that i was trying to keep a fork of clang made by actually qualified guys up to date with upstream llvm by myself with hardware that results in 7-11 hour build times bit me in the ass and ICEs started creeping in and just gave up
that was before most of the C++20 changes to C++ constant expressions were even implemented too
>>
>>101406807
>99% of the time metaprogramming is shitty programming
>t. retard who doesn't understand DSLs
>>
File: lain-smartphone.png (368 KB, 643x481)
368 KB
368 KB PNG
Imagine that you need to do all your software development on a smartphone.
Forget for a moment that it is dumb and inefficient compared to using your desktop, just imagine.
How would your development environment look like?
Would you stick to the "creating software = editing blocks of text" paradigm? Would you reuse visual programming ideas? Would you try something completely alien and novel?
>>
>>101406977
i won't
>>
>>101406977
I'd use some kind of visual representation of code structure beyond function/method scope and AI-powered autocomplete for actually writing code.
>>
>>101406977
i already do do some software dev on my phone
you install a full keyboard with all the characters, an editor of your choice (emacs actually has an app but there's plenty of other editors) and termux and termux-x11 in case you want to run graphical linux applications
none of this requires root
>>
n00b question: i want to learn risc-v assembly to learn the nitty gritty of programming and was wondering how close to native performance it could get on other architectures? ive seen someone emulate the isa in ~400 loc and use it to make a fully functioning computer in terraria so is it really that lean? certainly not as intuitive as c as a beginner but my dream is to make a microkernel operating system in the language
>>
>>101406862
If C++ was any good you wouldn't need to modify the compiler.
>>
>>101406904
Except it's not a DSL, it's C++ you retard
You can already do DSLs with operator overloading, functions, and compile time string literals
>>
>>101407223
>Except it's not a DSL, it's C++ you retard
C++ problems. If C++ wasn't a homosexual language you could do DSLs in C++ using metaprogramming. :^)
>>
>>101407252
99% of C++ reflection shills are retards like you. You don't even know what it does but you're adamant C++ needs it because you're too stupid to realise your problems can be solved without it.
>>
>>101407293
I'm not a reflection shill and I don't care what they do with C++, I'm just pointing out that you misunderstand metaprogramming.
>>
>>101407312
>I don't know what C++ reflection is about but let me tell you why you are wrong about it
Maybe /dpt/ hasn't changed after all
>>
>>101407370
I'm not arguing about C++ reflection, though, I'm just pointing out that you misunderstand metaprogramming.
>>
>>101407106
i haven't really touched a risc architecture before so i'm probably wrong but isn't the while idea behind reduced instruction set architectures that they use a lot more ops to do the same things but the implementation is a lot better because it's simpler?
i know x86 can be mapped to ARM and apparently not lose a lot of performance but i don't know about the reverse
trying to optimize the resultant code by fusing operations back together seems like it would probably be a more difficult optimization pass
>>
i still don't understand why people treat metaprogramming and reflection as the second coming. it lets people write serialization libraries, whoop de doo. no one can ever explain why they're important, or you get some lisp jerkoff going on about muh power with nothing concrete to back it up
>>
>>101407427
C++ is retarded and will never have decent metaprogramming, so you will never understand why metaprogramming is useful.
>>
haskell!
>>
>>101407526
Haskell is not an acceptable lisp but lisp is an acceptable Haskell.
>>
>>101407427
i mean in the case of the metaclasses proposal one of the core ideas was basically to use it to implement like a Concepts+
validation and error correction of user defined types that conform to a given base idea
as well as defining high level Concepts not otherwise representable within the language itself
one of the examples i remember from the paper was the classic OOP idea of the Interface, i.e. an pure virtual abstract class with only public functions and nothing else
the comparable C# specification for interfaces is like 5 pages and isn't actually validatable
the C++ metaclass for them was like 10 lines and was compile time validated and error correcting

then there's the whole boilerplate automation angle to which automatic generation of serialization is part of
like it or not sometimes shit requires metadata
i know i'd be a lot happier if i could trivially and safely automate certain vulkan boilerplate
>>
>>101407543
i get the boilerplate automation stuff, but that never seemed as groundbreaking as it's made out to be. ok, one sorta tedious thing down, there's still plenty of real problems that it does nothing for.

i don't use c++ primarily, but hear it from other languages too (jblow makes a big deal about this for jai and gamedev but never made sense and he never showed huge benefits). it lets a very small number of people write libraries that help everyone but the hard problems are still hard
>>
>>101407427
Unironically most of those people couldn't turn N calls to a function into a loop, it's that level of issue. Or worse, it's shit where you have cargo cult guidelines that you have to fucking work around.
>>
>>101407670
>it lets a very small number of people write libraries that help everyone but the hard problems are still hard
yes and that's exactly the way template (and macro) metaprogramming is used in library code today except libraries using TMP or MMP split out completely incoherent error messages and can very easily bloat binaries to an extreme degree
like sure your average dev is going to get more use out of stuff like the executors proposal which is a standard API to adapt concurrency frameworks to (and was also what was holding up the networking proposal)
but metaclasses would be more useful to the people mapping those concurrency frameworks to the executors proposal and would also result in much more cleaner error messages and debuggability
>>
>>101407534
nyooo
>>
>>101407750
also when i say better error messages i don't mean like errors get shorter
part of the proposal is the ability to cause customizable compiler errors
>>
>>101407704
>people couldn't turn N calls to a function into a loop, it's that level of issue
C++ programmers?
>>
why do so many jeetcode youtube videos refer to a set as a hashset? Nothing is being hashed so why is it a "hashset"
>>
>>101408228
Usually before "s" sounds in their languages there's a "huh" so it's probably naturally coincidental.
>>
>>101408228
Maybe they're talking about an actual HashSet?
https://docs.oracle.com/javase/8/docs/api/java/util/HashSet.html
>>
>>101408228
set is too overloaded of a term, and could be referring to the abstract idea of a mathematical set. easier to just say hashset and hashmap to avoid confusion unless you need to be more precise. it's also how they're called in things like java
>>
>>101405145
especially if she's cute and funny!
>>
>>101405153
No, few things take years to finish unless you insist on doing them "right the first time". Learn how to prototype, and build things because they interest you, not because they don't exist yet. You'll start seeing more and more possibilities the more you do. So shut up and just do something, you retarded troglodyte.
>>
In C, when should I use wchar_t instead of char?
>>
File: XZhd15Z.jpg (211 KB, 2994x1078)
211 KB
211 KB JPG
>>101408517
>In C, when should I use wchar_t instead of char?
>>
>>101405539
What you want is a way to pause the execution of card effects whenever something is allowed to respond to what's happening, and then to be able to resume execution after. You're designing the game, so you'll know what kinds of things need checked on resume.
>>
>>101408517
No. Locales are a fucking mess, and wchar_t is an even bigger mess because Microsoft fucked up their implementation too.
>>
>>101408517
when using win32 in UTF16 mode, otherwise it does the conversion at runtime
>>
>>101406306
Only if it comes up in your work.
>>
>>101407427
I could write lots of tedious code. Or I could see the obvious pattern and tell the computer how to write that tedious code. The point of metaprogramming is to pull compiler concepts into your work.
>>
>>101408228
based jeets caring about implementation details
>>
>>101408619
Or you could program better instead of trying to program your programming
>>
>>101408619
>Or I could see the obvious pattern and tell the computer how to write that tedious code
Or you could just use normal programming constructs to abstract away that pattern. Unless your language is crap, in which case, yeah, you'd have to generate code instead. lel
>>
>>101408517
You use wchar_t when you're poking splinters under your fingernails.
I believe some people call it "using C on Windows"
>>
>>101408679
>she doesn't understand what a DSL is
Dumb plussies.
>>
>>101408698
You obviously don't know what a DSL is because it's not just an "obvious pattern"
>>
>>101408688
>normal programming constructs
What falls under this definition?
>>
>>101408698
no one has ever shown me a good example of a "dsl" compared to the thousands of times i've read about these mythical things that solve every problem
>>
>>101408517
wchar_t is like a generic big char type
on windows it's UTF-16 (technically a fucked up version of UTF-16)
on linux it's UTF-32
the only place you're actually going to see it used is on windows with wide character APIs because all the regular char APIs on linux use UTF-8
in windows 10+ the windows API actually supports UTF-8 properly as a character set and whole system codepage so all its regular char APIs can use it too
meaning the only place you'll want to use it is when you need to call a windows api function that takes a wchar_t and doesn't have a corresponding char variant or if there's some compatibility difference between the two or if you're writing code for versions below 10
even then you should only use it for type signature compat, C has proper character types for unicode, i forget what they are but in C++ they're char8_t char16_t and char32_t
>>
>>101408707
No, I agree with you that the other plussie also doesn't know what metaprogramming is for (it's not for abstracting away "patterns").
>>
>>101408732
watch as he now responds with something totally unrelated to what we're talking about that 99% of reflection shills will never use as they "automate" getX/setX
>>
>>101408721
>What falls under this definition?
The non-meta ones.
>>
>>101408736
>actually supports UTF-8 properly as a character set
On my system it still says it's a beta feature
>>
>>101408761
setting it as the system codepage is but developers can also explicitly ask for it in the application manifest
besides back when i used windows i set it as the system codepage as soon as it gave me the option to and it came out a few years ago
the only thing that ever broke were some icons in an app that was using text for the close icon
>>
>>101408732
>she never made a constraint logic programming DSL
>she never made a database schema DSL
>she never made a templating engine DSL
>she never made a data protocol definition DSL
>>
>>101408732
shadingg languages like hlsl or glsl are dsls
>>
>>101406977
i think i would just write assembly
>>
>>101408732
Build system definitions are a DSL.
>>
>>101408808
>designated shidding languages
They're DSLs but you can also use DSLs to integrate them into your main language better.
>>
>>101408822
build system dsls are dogshit. not a good example
>>
>>101408808
Shader languages are more like general purpose languages but with limited scopes. They're designed by groups and nothing like the impromptu DSLs that people saying how great DSLs are make you believe they whip them up out of nowhere to solve every programming task
>>
first time posting here.
thoughts? is this retarded?
why can't a 15 million loc compiler inline this?

#include <stdio.h>

static inline char *retstr() __attribute__((always_inline)){
char str[64];
sprintf(str, "%s\n", "llvm chads");
return str;
}

int main(){
puts(retstr());
}
>>
>>101408908
>she never made a constraint logic programming DSL
>she never made a database schema DSL
>she never made a templating engine DSL
>she never made a data protocol definition DSL
>she doesn't understand why shidding languages are DSLs
>>
>>101408910
i dunno, it decided to
apparently -Winline will tell you why
>>
>>101408798
>>101408935
Shut the fuck up already retard. You don't have a clue what you're talking about.
>>
>>101408948
Just giving you some examples of DSLs I wrote that made my life much easier in various projects. Give me some examples of DSLs you wrote.
>>
>>101408962
I don't remember the last time I've needed any beyond just functions. Are you even talking about embedding them or are you just a totally insane narcissistic retard? I guess HRT hits hard
>>
>>101409002
>I don't remember the last time I've needed any beyond [features of the shitlang I'm used to]
Not an argument.
>>
>>101409033
its literally an argument you insufferable retard
>>
>>101409069
No, it isn't, you're just mentally challenged and incapable of abstract thought, which ironically is the same thing that caused that assertion in the first place.
>>
>>101409103
oh when you said dsl you meant you were a dumbass spastic liability
>>
>>101409157
>she never made a constraint logic programming DSL
>she never made a database schema DSL
>she never made a templating engine DSL
>she never made a data protocol definition DSL
Kek.

>b-b-but i never needed ...
I never needed 90% of the features of C++, starting with classes. DSLs have been a thousand times more useful than most of them, on the other hand.
>>
>>101409191
>she
this is the registry dumper schizo by the way
>>
>>101409249
The what?
>calls me a schizo
>is actually suffering from delusions
>>
>>101409258
>thinly veiled admission to being the registry dumper schizo
>accusations
The when*
>>
>>101409501
>thinly veiled admission
You are actually suffering from psychotic delusions.
>>
>>101409542
You talk just like xer
>>
>>101409551
You can keep doubling down. I don't care. Too bad this worthless board has no IDs because it really has one of the highest proportions of overt psychotics on the site and by far the most obsessive ones, too.
>>
>>101409583
Yeah thats why you keep replying KEKEK
>>
I fooled around with Python for a while a few years back, found it boring as shit because scripting and ML isn't for me. Now I'm learning C: what are some projects I should do to better learn the language? I'm reading C Programming Absolute Beginner's Guide, then King's C Programming (and I may read CLRS after).
>>
>>101409832
stop reading and do (which is going to make you read actually new things), reading books for the syntax of a fucking programming language is so retarded i cant even begin to fathom it
>>
>>101409947
>anon asks for projects
>yeah you should stop reading and start doing
>doesn't name any ideas
>leaves
alright
>>
>>101409977
when i help others i do it to help myself, hence i will help you out only on the portion that interests me.
Anyway, do [whatever i am doing] kek
Seriously, write a registry dumper for windows (unironically though)
>>
programmers without ideas shouldn't program
way too many NPCs polluting the space with their inane trash and wailings
>>
>>101410085
you have got to get a job somehow

>>101408744
UNCHECKED DUHS ON PAGE 9
>>
I am writing a program that will monitor a 6 row x 3 column csv file and load the data into an array every 60 seconds.

Is it worth checking the file for changes and only updating the array if there are any or just reloading the whole thing each time?
>>
what algorithm do I use when I want to do a sort of travelling salesman problem except there is a start & end point, some places can be visited multiple times, some places don't need to be visited (but can be visited to shorten the path) and some connections between locations are 1 way?
>>
>>101410698
Checking the file for changes is a linear time complexity, at least
To hash the file its input must be read in its entirety
>>
>>101410698
Check the file's "last modified" attribute.
Worth it for performance in the long run? Probably not.
>>
>>101410698
>60 seconds
if you are working with such large timeframes you want to load the entire thing.
>>
>>101403054
Writing a booru site to make following colt steele a lot easier because he is boring as fuck and his examples are geared towards npc cattle.
>>
File: zed123.jpg (32 KB, 1113x247)
32 KB
32 KB JPG
This comment was DELETED by someone in the Zed shill thread.
Stay away from this shit.
>>
>>101412465
>Rust 97.8%
>Scheme 1.0%
>JavaScript 0.2%
shan't
>>
Can anyone translate what does he meant by this? I'm trying to figure out how to extract models from this game but currently I'm stuck at the file type .pak and .tpl. I know .tpl is texture file for the models but what the hell is .pak and how to read it?
https://forums.kc-mm.com/index.php?topic=43708.195;wap2
>It's been a while since I last ripped from Radiant dawn so I might not remember all the steps correctly, but here we go:
>First, open a path of radiance iso with a program called GCTool (I'm not sure if wiiscrubber works there as well) and find where the battle models are stored. Then extract every single file that you will find in a character folder (every character works).
>Now open a radiant dawn iso with wiiscrubber, find where the battle character models are stored and then find a folder called SwoLE, which contains edward's myrmidon files. Replace everything except the pack.cmp (which is edward's model) with path of radiance's files. That will make the character go to the famous T-pose in battle.
>Then find the folder that contains the character you want to rip (for example, trueblade mia is SwoSW I think) and extract the pack.cmp and the tpl files, which are the textures.
>Replace edward's pack.cmp file with your character of choice and convert the texture files using a program called tpl converter. Then you should have the texture images in an usable format.
>Close wiiscrubber (it automatically saves the changes) and run the dolphin emulator with 3d ripper dx. Start a new game and skip everything until you can control edward. attack the bandit and voila! you get the character of your choice t-posed. >Get the frame with 3d ripper DX and find the character in a 3d editing program (know you'll have to deal with the weird double sided faces).
>And that's it, you need a bunch of programs but in the end it's worth it.
>>
>>101412587
are you sure you're not confused, there's no actual mention of a .pak file
and pack.cmp seems to be the model file
if you do have a .pak file it's gonna be an asset archive, of some kind, probably compressed
unfortunately there's like a dozen or more different formats of pak files and it'll depend on the engine
presumably something in the tools he listed is capable of unarchiving them, the post does mention extracting things from files
>>
File: tpl editor.png (103 KB, 754x746)
103 KB
103 KB PNG
>>101412700
My bad, I should've made myself clear. I'm also following the steps from this tutorial https://youtu.be/8tW0cZH0yQ8?si=JFOIM0LagiVSTuvo but the difference was the game I'm trying to extract the model produce 3 file types on the characters; .tpl, .pak and .cmp.
pic rel is extracted file using Dolphin and I'm currently only able to view the tpl file, still figuring the .pak & .cmp.
>>
File: gatrie rd ref-min.png (2.3 MB, 3888x2304)
2.3 MB
2.3 MB PNG
>>101412836
I'm remodeling the character for 3D printing (since he's kinda obscure and unpopular) and I prefer studying the ingame model for better understanding.
Here's the file:
https://filepost.io/d/KV7sv821iV
picrel is his official and fan art (plus concept art too)
>>
>src/main.zig:38:37: error: expected type 'cimport.struct_Rectangle', found 'cimport.struct_Rectangle'
GO TO HELL
>>
it's over...
>>
>>101412465
this site is THAT bad now?
>>
>>101412465
jannietranny maintains the shit and he got pretty mad at you
>>
>>101403054
putting together the network stack, then i am revising all of the code (skipped mutexes and "NOTE HARDENING" all over the place)

tomorrow i start writing drivers, thank God for Intel, I could rewrite the entire firmware if somebody paid me.
>>
>b&
n-not that i am begging or anything
>>
>>101406977
I have several times only had an Android phone, I just use neovim and termux.
>>
>>101403054
Hello sirs, I'm working through android.developers codelabs to learn how to make shitty apps.
I like kotlin, even more than python
>>
>>101413487
>>101407008
> sticking to "creating software = editing blocks of text" paradigm
How well does it work for you? What are your pain points?
>>
Let me guess. You language uses a compiler *UGH*
>>
>>101403054
>qemu doesnt do my hardware
grim
>>
how do I go about making AI chatbot? what AI model should I use?
>>
>>101413738
pretty good, weirdly most android apps still act like desktop applications would when they receive full keyboard inputs
the pain points are mostly termux <-> host interaction, in particular android safety features
sandboxed storage and the fact that outside termux you can't use things like symlinks
it's somewhat mitigatable, you can share the termux usr dir with other apps and turmux can access normal storage
>>
>>101413916
Cool. I gave up quickly after getting fed up with constantly having to switch between letters/symbols kb layouts, the typing got too tiresome. I admire those who found a way to make it work.
>>
>>101409832
get K&R
do all the exercises
>>
any bitch in here uses abap
>>
>>101414224
hi chad
>>
>>101413832
llama.cpp-python with llama-3-8b
>>
>>101414241
that's cold, im tired of this shit language, but idk im good with it
>>
File: android_keyboard_layout.png (113 KB, 1718x405)
113 KB
113 KB PNG
>>101413980
anon when i said "full keyboard" this is what the keyboard i use on my pixel 6 looks like
it's called hacker's keyboard, it's old and not maintained anymore, text suggestions only work some of the time, but it's a full keyboard in landscape mode and most apps weirdly accept things like Ctrl and arrow keys
termux doesn't probably because it has its own separate way of handling emulating those keys
layout switching is just to access function keys without swiping up/down to toggle the function row, scroll lock, break, syrq (pause?), a numpad, and ins/home/pg up/del/end/pg dn,
>>
File: emacs in termux.jpg (727 KB, 2400x1080)
727 KB
727 KB JPG
>>101406977
I often write code on my phone, either because I have some particularly neat idea while I'm away from my desktop pc or just to pass the time while I ride a train or whatever.
>>
File: clojure scratch.png (32 KB, 1240x470)
32 KB
32 KB PNG
>>101414614
>>101406977
but yeah I'd probably want some kind of structural editor with a touch interface if I were to make my smartphone my primary dev environment.
It's actually one item on thr long list of projects I wish I had the time to get around to implementing. Picrelated is a mockup of how the code in the editor might look like, I made this a few months ago. I just watched the talk >>101413740 posted and apparently someone already made a Racked editor called Fructure that goes in a similar direction.
>>
>>101414651
Why hello world to you too anon. But this thread is for serious programmers who create and/or already know the tools that make them productive. Not for tinker trannies playing with disfunctional languages.
If you knew c you would know why functions are considered harmful, but this program should give you an inkling.
>>
>>101406977
entering text on a smartphone is a hellish experience, so it would have to be entirely graphical or apl-tier terse
no one has yet solved the problem
>>
>>101413740
>let me debug prod on site
>no
>>
Use C# for everything.
Desktop
Web backend
Web frontend
Games
Scripts
It can do it all and it does it well
>>
>>101415864
learn something other than a corporate poo language
>>
>>101415559
Entering text takes practice, and is prone to mistakes, but falls short of being "hellish". The real difficulty for phone UIs is selecting text, or any other fine grain manipulations you might otherwise use a mouse for. This is solved by using text based navigation instead.
>>
What's your favorite logging method? I have experience with rotating file handlers when I can trust disk storage, centralized remote syslog when I can't, cloudwatch for webshit, and transforming log messages into metrics shoved into kairosDB. I really like cloudwatch but what about for homelab and hobby projects?
>>
>>101418300
fprintf
>>
File: 1720818837279205.png (299 KB, 578x469)
299 KB
299 KB PNG
Today, I will become a programmer.
>>
>>101418300
this idea's been rattling round my head rent free for a bit but i've been considering trying to write a logging framework as a very very thin clang sanitizer pass for automatic integration or something of that nature
kind of like how the vulkan validation layers or debug utils logging capability don't have to be explicitly used anymore really since you can just enable them globally and they have a good default logger
except automatically supporting code that doesn't inherently support redirection and hooking like the vulkan runtime

not sure what to back it with though, i think there are logging specific databases out there
>>
>>101418300
Sending logs formatted as a giant denormalized uncompressed JSON via a blocking HTTP request to a server across the globe.
>>
>>101418300
prog 2>log
>>
>>101418451
honestly if you just know shell you are better than 99.9% of the "programmers" in this thread that play with disfunctional languages.
Either you are a systems programmer or you are a domain expert using a program (that might have a dsl) made by that systems programmer.
I guess you could consider disfunctional langauges as dsls for some useless usecase though, like j and julia for numerical computing, lisp for symbolic computation etc
>>
I am learning CSS formatting and I hate it.
>>
>>101418565
is this the alter ego of cschizo?
>>
>>101418583
Don't you have some kikeloop talks to watch or did that die too?
>>
>>101418609
so it is
>>
>>101418649
>calls others schizos
>starts talking to birds
Ok then
https://www.youtube.com/watch?v=OCYU0LtqRH0
Whoo boy I do love lisptard "livecoding"
>the only time my langauge is useful is in the first
page
>>
>>101418677
What's wrong with you?
>>
>>101418709
Right back at you lisptard. You spent 60 years shilling a shit version of python as a real programming language. Be ashamed.
>>
>>101418709
the notion that some people write actually useful apps, websites, tools etc. goes over his head, he thinks we should all just dick around with registry dumpers in C
>>
>>101419081
I heard he tried and failed to write a parser for C, which led to him starting a year-long shitposting crusade against C.
>>
Every day I stray closer to a JVM language when I see the obscene amount of code that's been written for it
>>
>>101419837
most of it is terrible to use
>>
>>101419837
>Every day I spray closer to the designated street when I see the obscene amount of shit that's been put in it
>>
>>101419837
it's 2024 and mongoloids still think more code be more gooder
>>
>>101418565
>>101418451
moddies talking in threads instead of the secret discord?
>>
>>101403054
fixing *all* the nonsense i have(not) written up till now before i implement tcp
>>
>>101419946
>>101419869
The code may be terrible, but it sure beats having to write it myself
I don't want to have to wrap some C library because no one's bothered to do that in the language of my choice when I can use someone else's efforts
>>
>>101403054
I have 17 individual feature prototypes that were developed independently but ultimately need to be refactored then put in to a single application. At the same time I have at least 3 more prototypes that need to be developed.
>>
>>101419971
use go or racket if having a large amount of of packages available is really that important to you. or clojure if you want to handle the jvm wearing disposable gloves.
>>
>>101419999
omg you are literally me but i dont have a job
>>
>>101420181
There isn't a company on earth that could afford to pay me enough to do this for them. I do it because I hate myself.
>>
>>101420240
so you dont have a programming job on the side?
>>
Anyone using Claude Sonnet with VSCode? I'm tired of copy/pasting and updating parts of the code, I want to prompt directly into VSC and approve/deny results from Claude, any good plugin to reco?
>>
That feeling when a function is 20 lines of straight up statements and no logic.
>>
>>101403054
>interrupt routine
>using 'this.'
what the fuck was this guy thinking?
C++ is cancer.
>>
>>101420683
this-> is useful in templates
>>
>>101420832
dude, i am talking about teh fact that the continued usage of "this" makes you use it where you should not
Because of the fact that you want to use classes outside of their little sand boxes the entire model of oop collapses
>>
>>101420918
its called oops for a reason
>>
>>101405866
behind a lectern
have you ever seen a teacher
>>
>>101421680
A noose.
>>
>>101420634
Functions that just call other functions
>>
>>101421791
there's no lectern in front of her. that's the border of the blackboard. the AI just got confused
>>
>>101421853
there is a metal object with an obvious edge, what do you think that could be
>the AI
hmmm.
>>
>>101422066
>there is a metal object with an obvious edge,
it's the same colors/shape/height/size of the blackboard shelf. it's not a lectern.
>>
>>101403054
boys i need to solve the connections swapping problem
Basically the way i do swapping in the filesystem is through "listeners" (processes mmaping) parts of the file (divided in pages of different sizes for now, could change to fixed 2mb)
Now, nobody is fucking mmapping the socket (because i give an error on that, i forgot why) and on connections big enough that will like eat through my swap
So basically the idea is to have a syscall to create files out of "download" connections outside of the swap and then just place the pointer in the appropriate directory on disk

am i brainletting?
>>
>>101422173
Without context of what you're actually doing, what you're talking about no fucking sense.
>>
>>101422390
network stack
>hello fren
>hello fren
>establish packets per ack number, packetsize and other things
many times this:
>hello fren *packets num
>hello fren / hello fre missing a pakker :(
...
>getting packets
>assembling then into some non-consecutive pages with an array of pointers (and an array of 1byte counters for swapping in typical storage files)
>other processor wants swappie
>go through filesystem
>omg look at this 2gig file, all in ram with no processes playing with him :(
>he doesn't belong, move him to disk
repeat x10

dp you see that there is a problem? i want someone to be free to download terabytes of stolen data and other illegal goods on 4gigs of ramsticks
>>
Drooling zoomer retard too stupid for C++
I want to use Dear ImGui. Specifically I'm trying to use the Combo/ListBox thing (a dropdown menu). It demands the list of items to be in the form of const char* const char *. As far as I can tell, a const char* const * is completely immutable and the only documented way of using the Combo/ListBox is to use a hard-coded array of strings. This is fucking bullshit in my opinion; I want to be able to read a bunch of filenames for textures (or whatever else) and use those names as items in the Combo/ListBox. However this requires mutating the data structure I'd store these names in, which precludes the use of a const char* const *. What the fuck do I do? Why am I such a skullfucked nigger retard?
>>
>>101424008
*it demands the list of items to be in the form of const char* const *
Every attempt I've made at sneaking in an array of strings that I've modified/iterated over results in segfault. I know for a fact this is possible but I am too retarded to figure it out
>>
>>101424008
>Why am I such a skullfucked nigger retard?
Yes, but only because you asked here instead of looking up the solution.
https://github.com/ocornut/imgui/issues/2259#issuecomment-450827547
>>
>>101424008
const char* means the string is immutable but the pointer is not immutable you can point it to a different string any time you want
>>
>>101424008
passing a non-const to a const makes it const you goof

a const char* const * is a mutable pointer to a constant pointer to a char
which means it's a mutable array of pointers to constant strings
unfortunately there's no easy way of representing that using standard containers and i don't think it's really a good idea for you to step out of basic STL usage and try to do anything clever
std::vector<std::string> storage_for_the_strings; //fill this somehow
std::vector<const char*> storage_for_the_array{};
storage_for_the_array.resize(storage_for_the_strings.size());
for(size_t i{0}; i < storage_for_the_strings.size(); ++i){
storage_for_the_array[i] = storage_for_the_strings[i].data();
}


storage_for_the_array.data() should be able to be passed to the combo/list box
if you want to update the string you'll need to both update storage_for_the_strings[index] and reassign storage_for_the_array[index] to storage_for_the_strings[index].data() because it could trigger a reallocation and change the memory address of the string data
>>
Apart from C++ what are other low level OOP languages?
>>
>>101424212
D is a low level systems language that is backwards compatible with C/C++ in all the ways that actually matter
Ada is the standard aerospace language and the gold standard of readability
Verse is the language of Fortnite
>>
>>101424212
>low level OOP languages
Haskell
>>
>>101422558
if you delay file syncing this is a good idea, you are still acting like a retard though, 4gigs of ram is pretty much infinite for most applications
>>
>>101403054
Mutties wake up up, these monkeys in europe dont program for shit
>>
>>101406123
Yes. It's a promising idea, but I'm nervous about handling control flow through these blocks. At that point it might be a good idea to write a DSL, which I'm reluctant to do. Seems like scope creep. Maybe that's the move, though. I'll think about it some more.

>>101408541
What I found is that I often fail to predict changes in direction down the line, so making refactoring simple is important.
>>
>>101403054
procrastinating on implementing ip/tcp

its not even a lot of work, i am just blergh
>>
is it a bad sign if an interface implementation depends on the interface itself? for example does it make sense for a cached user service class to both implement the user service interface, and have a fallback user service to call, in case the user is not in cache?
>>
>>101426881
>is it a bad sign if an interface implementation depends on the interface itself
>does it make sense for a cached user service class to both implement the user service interface, and have a fallback user service to call
these have a total of zero things to do with each other.
>>
>>101427005
the cached service has a fallback service to call precisely because it's injected with the interface itself
>>
>>101403054
>programming in the 80s:
takes years to implement XXX thing ebcause he needs to go through the manual for every little thing
>programming in 2024:
"hey gpt show me [] header"
"Certainly Master! Here is the header you were asking about..."
++++++
| info |
++++++


which is often even better than the manual because what you were reading one or two specifications out of date
>>
>>101422083
It's the same color but the shading is notably different, just like with the desks. Also it doesn't line up with the left hand side of the chalkboard, and the bottom half is made of metal as well.
Anyway, you're retarded because it's done by an actual artist who has been doing poor anatomy for years, it's not AI.
>>
>>101427083
no.... it is standard to have a fallback for evrey single interface type, and then that would probably be pointed to by the interface so that you can do
if !(somethingsomething){
itnerface->backup_handler(void);
//etectc
>>
>>101427109
>which is often even better than the manual because what you were reading one or two specifications out of date
which is often worse because gpt comes up with shit that doesn't exists or quotes somebody who has not read the manual.
>>
>>101427160
when it invents things it is because you poisoned it, just remove the session hash from the url bar, start another and ask the right things
You should be able to pick up instantly when it lies and eventually it will give you the right information, for 99% of cases at least
>>
>>101427179
>ask about thing you don't know
>You should be able to pick up instantly when it lies
oh the new generation of programmers will be the downfall for us all
>>
>>101403531
Probably 11:35.
>>
>>101427109
holy fuck AI bros are retarded
>>
>>101427293
you are supposed to have read most of the manual you dumb fag, this is about not remembering 4000 pages completeyl down to the comma, not fucking knowledge of the argument at hand
>>
>>101427418
if you have read the manual it's usually just easier to use the table of content and check the page where the information was
>>
>>101427443
>.t has never read a manual in his entire life
>>
File: GCKYtTIXIAArBi2.jpg (229 KB, 1280x946)
229 KB
229 KB JPG
>lol just download an entire different toolchain for every platform/architecture you target brah

Why are gcc and clang like this. Why can't they just have one single binary per host platform, and you specify the output platform/isa with an argument (and typing no argument gets you the same platform/isa as you're running the compiler on). This would be so much nicer than having to deal with having a boatload of different compilers.
>inb4 "noooo but the heckin binaries would be bigger then!"
Who gives a shit, it's 2024, disk space is cheap. And it'd actually be less space for people who need the support, since the alternative is to download tons of full fledged toolchains.
>>
>>101427732
when I'm working on a project I have all relevant data sheets open because the examples and SDKs are usually buggy.
>>
>>101427750
you clearly have never read a datasheet you dumb nigger
>>
File: yay.jpg (35 KB, 499x374)
35 KB
35 KB JPG
>>101403054
Hey /dpt/ I finally understand debuggers after programming for 1 years plus

I'll never go back to littering print statements in my codebase ever again ^_^
>>
>>101428021
do you understand debuggers or do you know how to use debuggers? big difference.
>>
>>101427734
hmm. I had actually only ever tried to cross compile to non-proprietary platforms using gcc, and I just assumed clang was also like that, because the proprietary clang cross compilers I use are all obviously different programs. But it turns out that there is in fact just one clang binary that targets every open platform. So I revise my complaint to be only leveled at gcc.
>>
>>101427734
the whole free software culture is about printing hello world with as many disadvantages as possible, not actually making things that people would use.
An implication of this mindset is that portability is a not a factor, gnu doesnt write portable software and they dont want you to write portable, useful software either.
>>
>>101403054
Holy fucking garbage shit, rust programs are huge bloat and take forever to compile. I have been compiling the cosmic desktop for the last 30 minutes. It's compiling ~2000 dependencies and it's still not done. I can compile the xorg server, picom and dwm all together in seconds.
>>
>>101428675
and im compiling on amd ryzen 9 5900x which has 12 cores and 24 threads.
>>
>>101427734
Zig solves this. You can compile c and c++ programs using the built-in clang and from any platform you can target any other platform and architecture without having to download anything extra or setup anything extra. You target other platforms with just one argument to the compiler. The compiler is a single static binary that you can just download prebuilt on any platform (including linux).
>>
>>101428731
and the zig binary still manages to be smaller than a gcc/clang installation that can only compile for your platform
>>
>>101428743
and it can also target specific glibc versions, so you can compile binaries that depend on glibc and still run on any linux machine. It also comes with musl built in if you want to use that instead.
>>
>>101403054
Is istqb useful for devs or devops in job hunting? Or is it something that may be seen badly and lower my creed?
>>
>>101428731
>any platform
That's overselling it.
https://ziglang.org/download/0.13.0/release-notes.html#Support-Table
>>
File: screen-20240716-170016.webm (3.31 MB, 1680x756)
3.31 MB
3.31 MB WEBM
Today I created a simple spin-the-wheel app (cuz there wasn't one in fdroid kek).
was my second time making an android app, and i learned a heck of a lot, like: how to make a button animate its border, or: how to create a settings menu that actually works.
rate my work out of 10. (webm related)
>>
>>101429582
That is hecking great my fellow redditor!
>>
>>101429582
UI wise, I don't like the pop-up and I think the result should be a caption in the blank space between the wheel and the spin button.
Functionally, it seems fine? The only deficiency I see is weights for the wedges.
>>
>>101428841
Wrong, it straight up supports every platform that still exists and actually matters and that I personally use on a daily basis
>>
>>101427734
???
clang IS like that
so are literally all the rest of the LLVM tools as a matter of fact

the binaries llvm provides with the GNU style filenames are just symlinks to or copies of the original clang/llvm binaries which clang and the llvm tools can also pull config options from (including mappings to config files) and also determines which other toolchain's frontend to emulate
cross compilation for windows from linux is literally as easy as running the binary called clang-cl which automatically picks the MSVC (CL.EXE) emulating frontend and the -windows-pc-msvc target triplet and telling it where directories mimicking the layout of the visual studio install dir and windows sdk are
>>
>>101429824
yep, thats a good idea.
>>
>>101429803
Thanks! As a redditor myself, I hecking love positive support.
>>
Just got a promotion for being good looking, still havent touched the java machine or whatever. Why do these nerds love coffee so much?
>>
>>101429881
It supports Windows and Linux on 64 bit x86, Mac or 64 bit x86 and ARM, and Web Assembly.
Everything else is is varying states of "does not work".

There is a tier of support for
>one will likely need to contribute to Zig in order to build for these targets
and it's not the bottom tier.
>>
'''hello world'''
>>
>>101429987
That is far better cross platform support than some other languages we could name
>>
>305
nearly there /g/
>>
>>101403650
it's slow because of virtual functions and extractor functions.
but it's not slow because you aren't using the istream abstraction which actually uses the virtual functions, and you aren't using << or >>.
I don't like memory mapped files because boost uses C++ exceptions for errors, and if you use the low level API you need to deal with unportable code, signals and other weird stuff (but technically the chance of an error is pretty rare and a signal might be what you want because your code isn't prepared for this type of error).
I don't think the performance improvement from memory mapped files is actually worth it unless you know it's your hotspot.
I know that some people say that memory mapped files are great for random access, for example a good example of this would be how gettext works, I think gettext stores it's translation strings in a hash or some sort of tree inside the file so when you open the translation file it takes zero time to process, and to find the string you need random access. But I have not done any benchmarking however.
However the reason why people just copy the file into a std::string or whatever is not because it's fast but because it's a lot easier to work with because you don't need to deal with errors.
>>
>>101408910
because this is a huge ub? you "allocated" a string on the stack and then returned the pointer to that
>>
>>101408910
thread_local it and you are golden.
>>
>>101432262
thread_local inline char *retstr()
>>
>>101432521
no
const char * retstr() {
static thread_local char str[64];
snprintf(str, sizeof(str), "%s\n", "llvm chads");
return str;
}
>>
>>101432573
did you try with -O3
>>
>>101432573
i was joking
>>
>>101432224
the performance increase if fucking huge from memory mapping because the kernel will never say "on disk now"
Unless your process gets swapped
>>
>>101432244
>muh ub
crab cult
>>
New thread:
>>101433089
>>101433089
>>101433089
>>
>>101432781
the performance is negligible because fopen and fstream internally use kernel open / write / read /etc, which is internally implemented as memory mapped files in the kernel.
>that is slow because you are copying the memory! + kernel functions are heckkin slow!
benchmarks say it's negligible.
https://stackoverflow.com/questions/48994329/is-memory-mapped-i-o-worthwhile-for-sequential-processing
I genuinely don't care about theory, I only care about benchmarks.
Also if you aren't loading files that aren't being accessed randomly, there is simply no benefit to memory mapped files, at most maybe some benchmark might be slighting faster mmap is faster than malloc, but when it comes to files it just doesn't matter.
>>
>>101429899
See >>101428309, I take back the "clang" part, it's specifically gcc that has this problem.



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