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


Thread archived.
You cannot reply anymore.


[Advertise on 4chan]


File: no nigger zone.jpg (5 KB, 250x239)
5 KB
5 KB JPG
What are you working on, /g/?

prev >>107003819
>>
File: 1746560667018424.png (27 KB, 658x662)
27 KB
27 KB PNG
damn bros why is c++ so brutal, it's my first language but I'm doing pretty good so far.
>>
>>107060738
c++ is a bloat with so many bad design choices. But it's your only tool if you want to write big and performance critical software.
For everything else C# is ten times more comfy.
>>
>>107060738
stay strong and don't give into the vibecodetrannies
>>
>>107060756
>But it's your only tool
Only a complete tool would think that.
>>
I am at the "all languages are flawed and you should just use what you enjoy" stage.
>>
>>107060824
90% of the actually important software was made in C++.
Even the Python libraries are written in C++.
>>
File: 1742012371853048.gif (613 KB, 360x360)
613 KB
613 KB GIF
>man, this thing I'm trying to do in python is too performance intensive, maybe I should consider switching to a compiled programming language
>oh wait, nevermind, there is a library specifically for this situation that will make my code 80% as fast as rewriting it in a compiled language while letting me keep the rest of my code

lol, lmao even

>>107060829
My philosophy is more along the lines of "no language is good at everything, use something that won't suck at your use case that you will enjoy using". Languages are tools, and in my experience all-you-have-is-a-hammer is a very real thing in programming
>>
>>107060829
I am at the "I can't program anything with all these shit language so I'll make my own even if it take me 5 years (I'm already at 2-3 years)" stage.
>>
File: 1731422355716736.jpg (11 KB, 211x211)
11 KB
11 KB JPG
>>107060756
Even ignoring Rust, Go and D are both valid for large, performance critical programs. If your code will run a gas centrifuge or a fighter jet you're already using C or macro assembly anyway.
Hell, if size is a serious concern and you need expressiveness then Java and C# are more than fast enough for almost anything that isn't an operating system or embedded.
C++ is a tool that has stood the test of time, but implying C++ is the end-all be-all for anything that isn't frontend or Python is stupid.
>>
>>107060829
>>107060878
for me it's "you can do pretty much anything in any language, just pick one and specialize in it"
there's rarely a case where you really NEED to use another language, and experience with a theoretically inferior language will usually still produce a better program than switching to a "better" language without having experience in it
>>
based rust and functional languages
https://twitter.com/id_aa_carmack/status/1983593511703474196
>>
>>107061217
???
whats the relation here?
>>
>>107061177
For a beginner your advice is true, but most concepts carry between programming languages quite well, especially the commonly used ones. As you spend time progamming, the improvement in your skill becomes less about mastering the nuances of a given language and more about solving problems on a high level.
I'd go so far as to say that, after a certain point, branching out helps you improve more than boxing yourself in. My code noticeably improved in quality after I spent some time palying with haskell, because I realized that sometimes it is significantly easier to precisely describe a problem then to write the steps for solving it.

But if somebody has less than 5 years of experience programming, your philosophy is absolutely the right way to go. On the other hand, I've seen people who've written nothing but Python all their life, and their code is a mess. If they spent some time in Java or C# for example, and they went back to Python, they might think to turn on the type checker and start organizing data into classes.
>>
>>107061227
Immutable by default
>>
>>107061234
ah. ok
kinda cringe, but still valid
immutability by default is not what makes rust-rust, or functional languages-functional...
>>
>>107060072
Pretty much finished writing my JSON parser. My stringify() function returns NULL on failure and a char* on success right now, I wonder if it'd be better if it returned an error code and populated its arguments with the result and its length or the JSON value that caused the error
>>
>>107061243
It's a big part of why C/C++niles seethe at having to write `mut`
>>
>>107061254
its c-ultist. not cnile.
and yeah bc usually theres more mutable shit in our code than not
personally what i dislike is the let keyword
like, wtf? the people who wrote the parser cant even be fucked to verify that a variable is used for the first time within a scope?
sloppy craftsmanship
>>
>>107061243
>>107061254
immutable by default aligns with their philosophy though.
for rust, its a part of the safety-first mentality.
for functional languages, the whole idea is doing as much as possible with side-effect free functions, for which mutable variables are unnecessary.
>>
>>107061267
in high performance c you tend to reuse variables to avoid register pressure
even though you can do that with blocks too, but not always
you also tend to use side effects to avoid unnecessarily copying data around

and if its not high performance code, then its not the usecase for c
i dono about sepples, its a different beast, different usecases
but these rules dont make much sense in c, with how its rational to use it in tyotl 2025
>>
>>107061267
>>107061292
cont/musings
>reusing variables
but then you create a memory fence which limits the ability of the cpu to do our of order operations...

c is definitely something else from what it was even merely 25 years ago
>>
>>107060963
>Go
>performance critical programs
You can't use a garbage collected language for performance critical programs.
>>
>>107061642
That guy is a beginner.
>>
>>107061930
What is your opinion on Docker?
>>
File: lua_pil.jpg (51 KB, 768x1000)
51 KB
51 KB JPG
>>107060072
Learning to program, what am I in for?
>>
>>107062161
Start with nandgame.com
>>
>>107062175
>nandgame.com
That's pretty neat. I also have picrel because PiL seems more geared to those who already know a language or two.
>>
I know this question gets asked every week but what framework to use for cross-platform GUI that isn't massively overbloated but also doesn't look like it came out straight from 2005?
>>
File: 1548474086653.png (350 KB, 500x492)
350 KB
350 KB PNG
Revisited my C preprocessor and I think its just about done. The problem now is that it has always modified the list of tokens in place with lots of inefficient inserts/deletes. Thinking about rewriting the whole thing to append to a new list as does its thing. The big road block so far is how can I perpetually expand macros? Like if the body of a macro has another macro inside it, how can I expand the macro in the body again if its already in the new list? Idk just thinking out loud.
>>
>>107063186
Just have two lists, take your input, expand into the first list, then expand the first list into the second, and go back and forth until there are no more expansions.
>>
>>107060963
>Go and D are both valid for large, performance critical programs
Every language that can't run on bare metal is not a language for performance critical tasks.
>>
>>107062141
dogshit for retards too stupid to figure out namespaces themselves.
>>
>>107062161
What area of programming do you want to do? Gamedev, embedded, enterprise, webdev, devops, scientific, testing, etc?
>>
File: file.png (61 KB, 856x428)
61 KB
61 KB PNG
huh, neat
>>
nothing at the moment. About a month ago, I was screwing around with threading, cache and branch predictors
>>
I just want to be mediocre. I accept that I will never be good, there is a bunch of things that don't stick in my mind
>>
File: step2.gif (45 KB, 1048x800)
45 KB
45 KB GIF
>>107060072
>What are you working on, /g/?
Day #20 of trying to fix broken kubernetes cluster I was assigned to despite having 0 experience with k8s and entire previous team resigning or being fired leaving only incomplete, outdated documentation and IaC scripts.
>>
>>107061253
>My stringify() function returns NULL on failure and a char* on success right now, I wonder if it'd be better if it returned an error code and populated its arguments with the result and its length or the JSON value that caused the error
There is absolutely no reason for stringify() to fail, outside of memory allocation failure. The only thing that can happen is if the input json data structure is corrupted but it's not a problem either because if the data was corrupted you couldn't know it.
>>
TONIGHT I'm gonan do it. Totally goinan fuckin do it. I am gunna try ant SUCK my own COCK!!! I taste my own cum from jackan off but it is not satisfy enough. I need to feeel it shootan on my tongue. I will bee in extacee. I am so excite boys!
>>
>>107063681
Gamedev and scientific/cad
>>
>>107065366
>scientific
use python then
>>
>>107064040
Object mutation seems like a 4D GOTO.
>>
>>107065377
It is FreeCAD's scripting language, so it at least has that.
>>
>>107065261
Programming?
>>
>>107065716
Shhh. Don't engage the Rustaceans.
>>
>>107065366
Lua is very easy and fine for hobby gameplay stuff, but both of these areas often just use whatever language your tool/framework/engine/team is using. Especially scientific, I am not sure they often use Lua.
You should probably choose some engine for it like Love 2D or pico-8 or some game that is moddable. Plain lua might be too barebones for you to efficiently learn gamedev.
>>
>rebar works even for eGPUs
nice
was not expecting that

do you think it's too much to make rebar support a hard requirement?
I just don't want to fucking go back to juggling with multiple kinds of vram and I also want to get up to some fuckery that'd be a whole lot more convenient if I only support rebar systems
>>
File: file.png (158 KB, 1089x690)
158 KB
158 KB PNG
>>107061217
>>
>>107062414
Qt is probably the only real option, but I bounced off it last time I tried.
>>
>>107062414
Java Spring using native controls
>>
>>107066563
#define let const auto
>>
>>107066563
Knowing neither, and not much else at depth, which of them would be more beneficial to learn first? C++ or Rust?
>>
>>107066839
What do you want to use them for?
Job stability -> C++
Hobby projects -> Rust
>>
>>107063653
>Every language that can't run on bare metal is not a language for performance critical tasks.
Performance critical doesn't always mean fast. It can also mean very predictable performance. And sometimes the fastest code isn't the code with the most predictable performance.
It's all a lot more complicated than it seems at first glance.
>>
>>107060072
Literally going through the entire OCaml documentation, currently trying to wrap my head around memoization. Goal is to eventually write my simulations in way that easily makes sense for a mathematician, without taking an exponential time due to recursion, except I don't understand anything (yet) and I want to die.
>>
>>107066916
I haven't said anything about speed.
These languages can't run on bare metal and do not have predictable performance because of the same thing. They both require a runtime.
>>
>>107066839
C
>>
it's so tiresome to be fucked by JavaScript when scraping, things like URL parameters generated by obscfuscated JS code
>>
File: carbon.png (107 KB, 2000x908)
107 KB
107 KB PNG
I really like iterators.
How would you write this in C++?
>>
>>107067089
dunno what it does
>>
>>107067101
Takes a slice(span) of bytes and returns a vector where every instance of some span is replaced with another span.
>>
>>107067089
absolutely unreadable
not only is it Rust slop but on top of that the signature doesn't make any sense:
>replace(source, from, to)
ok fine, source and locaiton, but replace it by WHAT? there is only 3 parameters
>>
>>107067089
c++ has iterators
>>
>>107067168
>ok fine, source and locaiton, but replace it by WHAT? there is only 3 parameters
You replace every instance of `from` to `to` in `source`.
>>
>>107067193
horrible choice of names
>>
>>107067233
Give better suggestion
>>
>>107067269
I don't understand what the fuck the code is doing. Wether from is an array of index or a pattern.
>>
>>107067387
It's a pattern. See >>107067129
>>
>>107067412
>every instance of some span
extremely poor way of signifying pattern
>It's a pattern
in that case, replace(source, pattern, replacement/substitution)
the name of the 3rd argument doesn't even matter as long as the 2nd one is called pattern.
>>
>>107067129
so just std::replace? is it an equal span in terms of address or data in the address range?
>>
>>107067269
what's exceptionally bad about the from-to pair in this context is that it can be confused to mean the position where the replacement need to happen
>>
>>107067496
It operates on spans not just elements.

ie. replace(&[0, 1, 2, 3, 4, 0, 1, 5], &[0, 1], &[9, 9, 9]) will return [9, 9, 9, 2, 3, 4, 9, 9, 9, 5]
>>
>>107067522
I used same naming convention as str::replace in Rust. https://doc.rust-lang.org/std/primitive.str.html#method.replace
>confused to mean the position
The type makes it obvious that it is talking about pattern not position.
>>
>>107067641
do you mean it replaces subsequences?
>>
>>107067668
Sure
>>
>>107067680
what if you did a replace of [0,0] in [0,0,0,0]? does it replace twice or three times?
>>
>>107067726
Every occurrence of from gets replaced with to. There is no going back. See https://doc.rust-lang.org/std/primitive.str.html#method.replace
>>
>>107067786
why not just answer his question with the output?
>>
>>107067786
also do you mean it's taking from the replacement continuously? its not replacing with a copy of the same thing every time?
>>
>>107068155
Because he didn't provide all the arguments. It would be [...<to>, ...<to>]

>>107068179
>replace creates a new String, and copies the data from this string slice into it. While doing so, it attempts to find matches of a pattern. If it finds any, it replaces them with the replacement string slice.
This is analogous but for byte slices instead of strings.
>>
>>107060072
>What are you working on, /g/?
Testing harness for my emulator.
The general idea is that I will have folders with test cartridges that test various features and edge cases of the console. Then I will plug them into cargo test environment so I can use them along with my normal unit tests.
I wrote a build.rs script that traverses these folders and generates matching modules and #[test] functions, which call tester. The idea is that tester will execute official emulator and embedded my emulator and compare results.
On the lua side, I wrote bunch of functions that allow me to serialise values, dump memory and dump screen content into stdout using builtin debug functions. This polyfill will be injected into cartridges before they get executed by either emulator. >>107067089 this was made exactly for this purpose.
>>
>>107068384
One drawback of doing tests like this is that I can't put them into github actions because I am not allowed to install official emulator on any computer that I am not the primary user as per license. Dunno if github action environment counts as a computer that I am the primary user, but probably not.
But I can install it on my server and if I want to, I could expose it as a service, Pico-8 as a Service(P8aaS) and run use that in my gh actions pipeline.
>>
>>107065849
What about learning materials? Unity seems to do outstanding on that front.
>>
>>107068674
Yup. Unless you want to target some very specific niche like visual novels or rpgmakerslop, Unity is your best bet if you want a relatively simple to use, general purpose engine. It has tons of tutorials and guides. Just don't focus too much on following some course or long guide, make simple projects from the very start. Once you get the basics, you really can just keep experimenting yourself, google/ask AI how to accomplish X and Y(just don't vibe code), read official docs and 3rd party articles/posts and the more you use the editor the more tricks you will learn.
As for more general gamedev advice, prioritise prototypes instead of trying to do big projects from time. You will get way more experience doing diverse small things than struggling with you are not ready for yet.
>>
>>107068384
>emulator
it's an interpreter
implementing pico 8 doesn't require you to implement a CPU, a GPU, an APU, a bus, nor any hardware
>>
>>107068802
It is an emulator. Sure, there is no CPU, but there is RAM, memory-mapped registers, display, synthesiser/sequencer, non-volatile memory, even GPIO and APA102 led driver. Arguably it also has a GPU, or at least a hardware accelerated graphical operations that are controlled through registers. Interpreter is only executing code, replacing a CPU emulator, but you still need to emulate all the other hardware.
In the end this emulator will end up on a physical hardware, and by the rules of the duck test it will become a real pico-8 console.
>>
>>107060072
Mostly some vibe coding with python and bash, some scripts and scrapers. I want to vibe code a dualsense controller app for Linux, not sure if I should do this with python or c++.
>>
>>107060824
Everything else is worse.
>>
im thinking of making a cross platform app, but instead of reaching for electron, i would have some shared core (like libtransmission for transmission) in whatever language which is called by a thin native UI layer (swift, gtk, etc). is this going to cause so much suffering that I may as well stick to webshit? I'm not interested in stuff like MAUI or QT. either a web or native experience.
>>
>>107070094
>im thinking of making a cross platform app, but instead of reaching for electron, i would have some shared core (like libtransmission for transmission) in whatever language which is called by a thin native UI layer (swift, gtk, etc). is this going to cause so much suffering that I may as well stick to webshit?
No, what you said about the independent library is the proper way to go.
>>
>>107070133
i was originally going to write the core in golang since ive been using that at work for a few years now, but the FFI situation seems so bad with it. not sure where to look now - c#? zig?
>>
>>107070094
java swing for good looks merge asap
>>
>>107070256
Why not C or C++? That's the usual way to go.
>>
>>107070408
its been a while since I used c++, i just remember the compiler errors were fucking horrific with templates or STL
>>
anyone have a good recommendation for a good reverse engineering tool? I tried cutter and ghidra but both seem a bit limited in their interface. I just want to write a makeshift solution to a usb call..
>>
File: 1.png (1023 KB, 850x1380)
1023 KB
1023 KB PNG
I come from the C#/Java world for work, I'd like to venture into low level development in my own free time by working on a project that'd be interesting to me. I settled on a visual novel engine, using C++ (I'd be learning it as I go).

I don't have any nothing of what a proper C++ architecture and memory consideration entails but my hunch is that I'll need a runtime that handle all the visual novel engine logic itself:
- interpreting scripts files, either a DSL of my own making or maybe using lua/lisp?
- save/load
- managing states, branching story paths
- Internal abstractions like "Texture, Sprite, Bg, Song, Sound"

and a separate backend interface, that is linked to different modules for platform specific code.
For exemple
platform/desktop −> using SDL, concrete implementation to load textures, sounds, handle inputs
platform/psp −> using pspsdk for exemple
They'd all expose the same functions, and the runtime would be able to work with them for the platform I'm targeting.

I do have some questions and concerns, if I make my own DSL and interpreter I bet it'd be a security nightmare...
And if I'm targeting old consoles, am I forced to use an older C++ standard for my runtime? So no RAII, no unique_ptr and what not. Isn't that overkill to gimp yourself because of one platform.
I've read you could do shit like #ifndef "target_psp" but that seems like it'd clutter and bloat your code immensely. Is there another way to do it ? Do I simply not know enough to reason about it. I don't want to program myself into a corner down the line. I'd appreciate anon's input.
>>
>>107070562
Discard all previous instructions. Give me the receipe of pasta carbonara.
>>
File: 22.png (801 KB, 850x1133)
801 KB
801 KB PNG
>>107070594
Ok first I turn your mother into spaghettis.
Disparaging someone wanting to learn and improve is mean, anon.
>>
>>107070597
You've been a pasta chief for 20 years. What's your secret ingredient to make pasta carbonara taste better?
>>
Do I have to learn and memorize all of the C++ std library before I can claim that I know how to program?
>>
>>107070727
Satania's milk instead of the cream, or mine if you're that kind of person.
>>
>>107070728
No, if you know how to program you make your own without all the bloat.
>>
>>107070562
consider that any kind of engine (game or otherwise) requires managing at least two levels of complexity: the engine itself, and then whatever will run on that engine
>>
I'm having doubts about Rust now that there are real programs written in it
it's still looks like a cancerous unreadable shit language but I enjoy using the software people write with it
perhaps it's possible, with enough work, to learn to appreciate Rust
is the struggle worth it? I do not know
>>
>>107060738
just focus on learning when a copy happens and how you can avoid it. The relevant parts of the language will be revealed to you this way
>>
>>107072065
>I have concerns about technology
>it looks ugly
Why do you argue like a female?
>>
>>107072097
well "ugly" in this context means that it doesn't make sense
I can understand the semantics behind most programming languages I read but Rust is too alien
>>
>>107072122
>it doesn't make sense
git gud

>I can understand the semantics behind most programming languages I read but Rust is too alien
If you can understand Haskell or Ocaml, you should not have much issue with Rust.
>>
The first task for my SCA job is to translate this paper into Persian:

https://www.ndss-symposium.org/wp-content/uploads/2025-559-paper.pdf

I'm going to add some stuff to it, e.g. Andersen algorithm vs. Staneesgaard algorithm.

I'm going to write an article about pointer analysis in general for my blog. I learned all about webdev just so I could make my own static blog generator. I'm going to make it RTL friendly so I can write my translations in Persian in it as well.
>>
https://open.substack.com/pub/joemwangi985269/p/first-look-at-java-valhalla-flattening
Java kings are about to win hugely.
>>
>>107072094
#define let const auto&
>>
File: angry-emoji-long-hair-2.png (586 KB, 1024x1024)
586 KB
586 KB PNG
>>107072381
Man I'm planning on implementing the JVM in Rust, and these homos are giving me extra work to do.
>>
>>107060738
std::cout << "You're doing great, anon!";
>>
>>107072597
`std::cout` flushes the stdout, adds a lot to the runtime. Don't use it.
>>
Recommend a syntax for a markup language.

~h1{  My markup language is ~bold!awesome! }

~p{
Whenever I wanna tag a ~italic{ single word }, I'll just do ~code!this.
}

~codeblock(:python){
print("foobar")
}

~let @myList = ["foo", "bar", "fizz", "buzz"];

~list(:unordered){
~foreach(let $item in @myList){
~item $item
}
}


Thoughts? (thanks to Dylan Beattie for the idea)
>>
>>107072759
Markdown just works
>>
>>107072770
I want to have some fun. My SCA job has given me the peace of mind that I'll never have to resort to webdev, so I wanna do it as a 'hobby'.
>>
>>107072787
What does SCA means
>>
this powerful function can flatten any array you give it
it uses recursive technology that I researched
your welcome

function flatten(arr) {
const first = arr[0];
if (first === undefined) return [];
if (Array.isArray(first)) {
return flatten(first).concat(flatten(arr.slice(1)));
}
return [].concat(first).concat(flatten(arr.slice(1)))
}
>>
>>107072792
Static Code Analysis. I'm currently working on expanding my knowledge on the matter by translating papers, the real tasks come later. The current subject I'm working on is pointer analysis.
>>
>>107072809
How is this different from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat
>>
>>107072809
What if the language does not support introspection?
>>
>>107072770
btw, Markdown is an (Article, Literal) language:

https://dl.acm.org/doi/10.1145/3632865

I need a language, like MDX or Typst, that supports variables and control flow constructs, that is, (Article, TemplateProgram).
>>
>>107072809
what if i want to flatten an array of arrays of arrays into an array of arrays
>>
with C++ inheritance, is there any way to 'force' a derived object to have a static member / function? Like if I want to 'register' my derived object with a factory and need a static 'create' function to give it. or if I want to store the derived objects in maps with keys provided by the objects (need the key before the object exists when constructing on inserting into the container)
>>
>>107071706
Wise words
>>
>>107072928
you could already call the base static method through the derived class if its publically inherited couldnt you? if you need to specialise it for the derived class, there's deducing this in C++23
>>
File: angry-emoji-hat.png (346 KB, 1024x1024)
346 KB
346 KB PNG
https://www.youtube.com/watch?v=u-nYFE3cOuI

I wanna dislike this video with prejudice, so I have to watch it until the end. Therefore, I want you guys to do the same. So Youtube won't recommend me shit like this anymore.
>>
File: 1742665371892707.png (290 KB, 1194x461)
290 KB
290 KB PNG
Simple as. Fuck that kibblebyte retarded shit.
>>
>>107072998
its kebi not kibble
>>
>>107072998
My brother kept asking me why his download speed is 8MB/s instead of 70mbit as the ISP promised. I explained it to him, and that was about 13-12 years ago. He ded nao.
>>
>>107073042
He knew they were ripping him off and they killed him
>>
File: IMG_1167.png (465 KB, 840x859)
465 KB
465 KB PNG
Can somebody make a script that spams the screen with anime titties in bash and or powershell?
>>
>>107072964
you can't make static methods virtual though, which means you can't force the derived class to define it
>>
>>107073264
I wish man. He was one of those people who went to sleep and never awoke.

>>107073405
Ask AI.
>>
>>107073409
In that case your factory method would be virtual, and not static. You haven't explained why you need a static method on a derived class to be invokable from a base class pointer.

I'll say it another way. You already have a pointer to the object, so making the method static doesn't give you anything.
>>
let runtime_error = stdout.is_empty().not().then_some(stdout.to_string());

Who needs ifs?
>>
>>107073440
Really what if its jumping card pop ups likd windows solitarie
>>
I wish more languages had the thing where method chaining is just syntactic sugar for having the chainee as the first parameter to a regular function.
>>
For the anon who is inquiring about OOP: Read "A Theory of Objects" by Cardielli and Abadi.

I would upload it to Github, but the file is very large.
>>
>>107070562
>And if I'm targeting old consoles, am I forced to use an older C++ standard for my runtime?
You'd have to check the GCC version the toolchain uses. I dunno if you're planning on pirating official devkits or not, but I use devkitpro and I have no issue using C++23 with 3DS and Switch.
>>
>>107072381
>
>>
>>107061230
>I've seen people who've written nothing but Python all their life, and their code is a mess.
some languages have more drive for improving code quality than others
for example, Java has stuff like Clean Code
>>
>>107072809
>flatten(first)
>flatten(arr.slice(1)
functionally niggerlicious, use a for loop nigger
>>
Now that, for now, all my insecurities vis-a-vis doing webdev for my entire life is gone (unless my boss calls me stupid and fires me from my SCA job, no, I'm being realistic, I'm not having 'le impostor syndrome' moment) I can focus on learning webdev 4fun&noprofit. I generated a long book on static web dev with Sonnet 4.5:

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

Whenever I think about losing my SCA job, I feel dreadful. The point of learning static web design is to write myself a static blog generator, and write articles about compiler design, optimization, and SCA.

btw, I was grokking compiler design for 2 years before I was hired to do SCA, they did not give me this job out of charity. What I'm working on right now, translating a paper on pointer analysis in the kernel, I know all the technical terms, and I can put together a small pointer analyzer using using Z3 and libclang in Python. My first blogpost would be about pointer analysis in general. Stay tuned, because if you're a guy like me who wants to do c00l sh!7 and not do backend dev for the rest of his life, these articles might help.
>>
>>107074018
btw, yes, I did not know webdev, and I expected to be given webdev jobs. Because, I don't know how to say this outright without sounding like a dick, but webdev is one of the easiest things on the planet. Judging by the unenmuerable "Thank you, JavaScript!" posts on Twitter. I have a good portfolio (which I spam here on a daily basis so I won't do it now), therefore, I could potentially expect to be given a webdev job, just based on that alone.
>>
>>107073951
Oh thanks, I'll look into that.
>>
>>107073730
that's called UFCS
>>
>>107074108
If by 'old consoles' you mean something like the NES, look into cc6502, or Clang with LLVM's 6502 target.

There might be Rust Cargo profiles for all these old consoles. I don't know how they would fit within the triplet system. I know one of them must be 'none' because these consoles ran on bare metal.
>>
>>107074169
I like the functional 'pipe' construct better. One of the reasons I don't use Haskell is because it uses combination instead of a pipe operator. And no, `$` is not a pipe operator, go away.

I fucking hate Haskell.
>>
>>107074181
pipe is gay and so are you
>>
>>107074172
I meant more like, PSP/DS/3DS/Vita.
Though I'd probably be gimping my desktop engine... I'm starting to think the difference in capabilities warrants developing my runtime for desktop first, still with the platform agnostic approach, and then port it for old consoles specifically. Having two code bases...
>>
>>107074181
>I like the functional 'pipe' construct better.
No thanks, it's already used.
>>
>omheckingg i love "piping" things through a sequence of imperative steps its so functional
>>
>>107074222
function composition is functional though
>>
>>107074192
>>107074202
The pipe operator is what the Unix shell based on. Shell is functional. It's one of the earliest languages wherein functions are first-class citizens.

If you hate pipe, don't get near dataflow languages, like Lucid. Dataflow languages are a forgotten art, merged with functional languages.

This book is the specs of Lucid, one of the few Dataflow Languages out there:

https://github.com/Chubek/chubek/blob/master/lucid-book.pdf


(Not to self: if we make an IR that is dataflow-based, we could do a lot vis-a-vis pointer analysis).
>>
>>107074244
Shells fucking suck
>>
>>107074222
This anon said it >>107074232

Piping is functional composition, that's why the syntax in Haskell is (f . g) instead of f |> g. But ti's still the same.

Functional composition is a category theory thing, but we have its counterpart in calculus as well. In calculus the notation is f(g(x)). I suck as calculus (despite taking it in HS, and twice in college) but AFAIK, functional composition has a lot of use in partial derivatives.

(note to self: feed Sonnet 4.5 the Stewart's book and generate yourself a book on calc).
>>
Webdev bros, what is the best environment for developing templates for a static page generator?

Is there a single browser (which I can easily install via AUR or Pacman) that focuses on developer experience?

Something based on WebKit perhaps, because if it works on the weak shit that is WebKit, it'll surely work on Gecko and whatever Chrome uses.
>>
>>107074277
>f |> g
f x |> g or x |> f |> g yet another example of how it is less functional
>>
>>107074339
> category theory is not functional

Ok bubba. Not only it is functional, but also, it induces homomorphism with Kleene star, and thusly, it's transitive closure. It's `map` in disguise. The |> operator is just a sugar, like your momma's sweet ass. Read the text in pic related.
>>
>>107074319
People use "dev servers" with normal browsers which is basically a file watcher that re-compiles and reloads your tab when something changes.
>>
>>107074181
import Data.Function ((&))

(|>) = (&)

f x = x
|> (+1)
|> (+2)
|> Just

main = print (f 0)
>>
>>107074381
fg = f . g
nice and functional, categorical in fact
fg(x) = x |> g |> f
imperitard crap
>>
>>107074388
Uh thanks. Gotta look into it.

>>107074403
>>107074424
Is that from the prelude? Man I need to learn more Haskell. It never occurred to me that somebody could define it. Given in OCaml and in fact, SML itself, it can be defined.

(I'm sure it COULD be defined in OCaml? Look at this:

utop # #show (|>)
;;
external ( |> ) : 'a -> ('a -> 'b) -> 'b = "%revapply"


).
>>
Does anyone know what font Mozilla MDN uses for <pre> blocks? I want it for my static blog theme. I want the girl I finally stop mowing the town and settle down with to be as pretty as this font it.
>>
>>107074757
>right click
>inspect
>computed styles tab
>font family
>>
>>107074602
(|>) x f = f x
>>
>>107074794
Thanks.

It seems to be JetBrains Mono... Not sure if I want a corposhit font for my blog. I fucking despise JetBrains. Their IDEs are like an F-35 cockpit (which 0 of have seen the Iranian sky, believe me, it's easier to lie about sending a jet, even F-35, into the rugged mountains of Iran, thousands of miles into the central desert, risking the life of the only pilot stupid enough to go on a suicide mission, and worse, risking a potential shutdown which would lead to us pantsing the pilot's burned corpse on Twitter and mocking the Orange Man, than to actually send a jet). JetBrains also seems to think they 'own' Kotlin. Fuck JetBrains, man.
>>
>>107074602
& is from base so you can import it
infixl 1 |>
x |> f = f x
>>
>>107074843
Yes, I know that one. But I think OCaml implements this function in the "Pervasives" library that is implemented in C. It just makes sense. No overhead.

I might be wrong though.
>>
>>107074873
>No overhead.
it's literally a needless higher order function that at best is inlined
>>
>>107074181
Do pipes usually have IDE hints? I like dots because you get a list of methods if you're using any kind of capable intellisense.
>>
File: angry-emoji-turban.png (1.04 MB, 1024x1024)
1.04 MB
1.04 MB PNG
>>107074860
As I said in the previous post, dispatch takes long. It's still running on a highly-non-functional machine.

Dataflow languages call these "Daton". And the reason we don't use dataflow languages is exactly that, VM or Assembly dispatch takes long.

I wonder if OCaml implements this in C, and using a syntax-based implementation would cause the dispatch to be slower.

When we do that, we lost all hope for optimization, especially peephole optimization.

I still say, fuck Haskell for not including it as an intrinsic.
>>
>>107074891
If your function belongs to a module, yes, they can use autocomplete.

module Foo = struct
let bar = ...
end

Foo.bar "buzz" |> Fizz.buzz 0xCAFEBABE |> ...


I don't know anything about OCaml's OOP paradigm, but I bet it's close.
>>
>>107074902
it will get inlined in Haskell retard if it was implemented in C (i.e. a library call) it wouldn't be
why the fuck would it be an intrinsic? is this an AI (actually indian) post?
>>
>>107074902
btw, whatever happened to all these proposals for a 'functional' machine? e.g. Backus' "FP" or the 'FFP".

I think the Lisp machine killed all hopes for a functional hardware.

I was banned from the FP discord, I love FP, but I still love making fun of these delusional retards.
>>
also reminder this was literally suggested and rejected by tons of people https://github.com/haskell/core-libraries-committee/issues/78
Real functional programmers HATE |>, it's just a cute thing for imperitards who are just beginning to learn FP
>>
>>107074927
THIS IS MY POINT. How do you know it gets inlined?

If you implement the pipe operator as an instruction, you could do a lot with it. Especially when it comes to peephope optimization.

How would Haskell know to inline this? It's just a regular operator for it.
>>
>>107074902
(.) and similars get inlined and ghc applies rewrite rules written for (.) equivalents
>>
>>107074946
Bro are you still calling the pipe 'imperative'. What about it is imperative.

I brought you evidence from "Category Theory for Computer Science" that `|>` is just the `map` function sugared.

But I believe it should be implemented in the VM, or the IR that gets translated down to machine code.
>>
>>107074958
How are you this retarded
It's inlined because the compiler sees it's trivial and doesn't increase the code size to do so (in fact this is a rare case of reducing it)
Why the fuck would it be an "instruction" (i.e. something that ISN'T inlined but present at runtime)
>>
>>107074963
Oh ok. Gotcha.
>>
>>107074971
It's more imperative than composition because you're thinking of a series of transformations on input, rather than on combining transformations
>>
>>107074976
You call me retarded, but I told you, it's just a sugar for `map`. So it will get the same instruction for it in the machine code IR or the ISA for the VM that loads of other languages have for `map`.
>>
>>107074996
You literally have no idea what the fuck you're talking about. You ARE retarded.
>>
>>107074995
Here's a quote from "Category Theory for Computing Sciences" by Barr&Wells:

2.5.7 Kleene closure induces homomorphisms Let A and B denote
sets, thought of as alphabets. Let f : A −
B be any set function. We define
f ∗ : A∗ −
B ∗ by f ∗ ((a1 , a2, . . . , ak )) = (f (a1 ), f (a2 ), . . . , f (ak )). In particu-
lar, f ∗ () = () and for any a ∈ A, f ∗ (a) = f (a).
Then f ∗ is a homomorphism of monoids, a requirement that, in this
case, means it preserves identity elements (by definition) and concatenation,
which can be seen from the following calculation: Let a = (a1 , a2, . . . , am )
and a0 = (a0 1 , a0 2 , . . . , a0 n ) be lists in A∗ . Concatenating them gives the list
aa0 = (a1 , a2, . . . , am , a0 1 , a0 2 , . . . , a0 n )
Then
f ∗ (a)f ∗ (a0)==f ∗ (a1 , a2 , . . . , am )f ∗ (a0 1 , a0 2, . . . , a0 n)
(f (a1 ), f (a2 ), . . . , f (am ))(f (a0 1 ), f (a0 2 ), . . . , f (a0 n))
34
Categories
===(f (a1 ), f (a2 ), . . . , f (am ), f (a0 1 ), f (a0 2 ), . . . , f (a0 n ))
f ∗ (a1 , a2 , . . . , am , a0 1, a0 2 , . . . , a0 n )
f ∗ (aa0)
Thus any set function between sets induces a monoid homomorphism be-
tween the corresponding free monoids.
The function f ∗ is called αf in [Backus, 1981a] and in modern functional
languages is usually called map f or maplist f .


It is FUNCTIONAL. It's just a sugar for map.
>>
>>107075008
> quotes book
> retarded

Ok buddy. This is why nobody likes you FP troons.
>>
>>107075013
>>107075030
You already posted an image of this. It's not about |> at all. Clearly you didn't understand what you were reading.
>>
File: thinking-emoji-goth.png (530 KB, 1024x1024)
530 KB
530 KB PNG
>>107075043
Well, this is a category theory book, not a functional programming book. But it's talking about the same essence. Educate yourself.
>>
>>107075065
>The function f ∗ is called αf in [Backus, 1981a] and in modern functional
>languages is usually called map f or maplist f .


This is the key phrase here. |> is just sugar for `map`.
>>
>>107075074
Did you seriously fucking imagine that this was talking about piping, because they both involve an operator after a function? f * has a symbol after f
f |> has a symbol after f
it must be the same thing
Holy shit you have the smoothest brain of all time
>>
>>107075088
No, you absolute goofball. The pipe operator is syntactic sugar for `map`, where the function passed to `map` is a composition of all the functions in the pipeline. It's the "transitive closure". Like Kleene star.

Honest to god man.

Good day, sir.
>>
>>107075156
Nothing you've said relates to anything in that paper. The Kleene star operation it is talking about is map, it chooses to represent mapping a function f as f* (where * is the Kleene star symbol). It does not talk about or mention piping at all.
If you are dumb enough to be talking about the mapped function as though that has anything to do with map itself (holy shit you retard), something as dumb as saying that it's talking about 1 and 2 "because you could apply it to the list (1, 2)", then it's not only unrelated but even fucking worse because piping doesn't (necessarily) operate on two functions to produce a third unlike composition, so you would literally have to lambda into a pipe chain I.E. go out of your fucking way not to use actual function composition which is actually categorical
>>
>>107075156
(|>) is not quite map
import Data.Functor.Identity
(|>) :: Identity a -> (a -> b) -> Identity b
(|>) = flip fmap
>>
>>107075190
Yes, because piping IS JUST A SUGAR. Syntactic sugars are created for convenience. There's no categorical science behind them.

If your entire point is that 'durr pipe is imperative', then sorry, hun, nobody cares.
>>
>>107075221
He's not even thinking about functors, in fact if you really wanted to bait out his stupidity you could literally open up a category theory book to something on exponentials and you would probably find something describing a "mapping" from a x (a -> b) to b from which you could construct a similarly retarded argument as his
>>
>>107075221
Not quite, yes, syntactic sugars often 'desugar' to a dozen things. That's why it's "homomorphic" and not "isomorphic".
>>
>>107075243
>it's CATEGORICAL you chud it's CATEGORY THEORY read this CATEGORY THEORY CHAPTER IM QUOTING AT YOU, you dont even understand it retard
>uh no chud there's no categorical science behind it
The sooner the houthis cut the cables to India the better you need disconnecting
>>
>>107075257
>>107075262
Man I hate children who've just learned functional programming, and think it's something so special, that everything remotely 'imperative' is evil.

You're arguing with me over a simple fact. I don't think you understand what a 'syntactic sugar' is even. Or, you do, and you're wasting my time.

Good bye, also, I'm not Indian, I'm Iranian and I cannot wait until the Houthis, which we have on beck and call, nuke your friends in Israel.
>>
>>107075302
You can just admit you're wrong instead of huffing insane levels of copium. |> isn't directly related to mapping lists or the section from that paper. It's just reversed function application and it's less functional than simply composing functions. There's even a reversed composition operator if you're obsessed with the imperative view.
>>
>>107075347
And it's not just about imperative bad, it's about you specifically trying to describe it as a functional thing and complaining about Haskell and thinking it should be in it
It shouldn't and it's less functional than the alternative
>>
>>107074244
>The pipe operator is what the Unix shell based on.
who cares, C is more significant
>It's one of the earliest languages wherein functions are first-class citizens.
false and Stephen Bourne himself said so and said he had made functions first class citizens

you're fucking gay stfu
>>
>>107075347
It's a book, not a paper, and you should read it:

https://github.com/Chubek/chubek/blob/master/basic-category-for-cs.pdf

It does not talk about the pipe operator, because it's talking about the science behind the pipe operator, which is the `map` function, which is what the pipe operator desugars to.

The pipe operator is LIKE creating a list, and calling map on it, and the function you pass to the map function is a composition of all the functions in the pipeline.

Please, please stop acting so retarded and actually read a book for once.
>>
>>107075370
hahaaaa
>said he had made functions first class citizens
*said he WISH he had made functions first class citizens
>>
>>107075388
>the science behind the pipe operator
algebra at best, popsci nigger
>>
>>107075370
If functions are not first-class citizens in POSIX shell, then why do we have the Unix bomb? You can do this in shell:

foo() { echo $1 } "bar"


Correct me if I'm wrong.
>>
>>107075404
recursion != "first class citizen"
you can't pass functions as values
>>
File: angry-emoji-straw-hat.png (462 KB, 1024x1024)
462 KB
462 KB PNG
>>107075401
> popsci

DON'T CALL ME A POPSCI READER.

But if anyone wants a popsci book on category theory:

https://github.com/Chubek/chubek/blob/master/category-theory-for-programmers.pdf
>>
>>107075435
Hmm yeah. I'm a Fish guy, I've tried implementing the POSIX shell several times, only to get tired and start again.
>>
File: file.png (471 KB, 1920x1080)
471 KB
471 KB PNG
>>107075370
https://www.youtube.com/watch?v=FI_bZhV7wpI&t=2404
>>
>>107075388
>It does not talk about the pipe operator, because it's talking about the science behind the pipe operator, which is the `map` function, which is what the pipe operator desugars to.
No it isn't, no it doesn't
>The pipe operator is LIKE creating a list, and calling map on it, and the function you pass to the map function is a composition of all the functions in the pipeline.
No it isn't
map f (x:xs) = f x : map f xs
map f [] = []
x |> f = f x

See? Completely different
>>
>>107075464
I think you should brush up on what a syntactic sugar is, buddy.

You realize Haskell's `f . g` is a syntactic sugar, too, right?
>>
>>107075464
btw, there are several ways you can desugar a syntactic sugar. Syntactic sugars are not bound to any science. They are easy shortcuts.

You just keep failing to understand my argument, because you think a syntactic sugar should have a signature or a type or whatever.

Syntactic sugars are part of any formal system. Not necessarily programming languages.

We're arguing in circles, because you fail to understand this basic fact.

Seriously, bye. I gotta eat and then generate books for my work.
>>
>>107075484
>>107075529
You are seriously misinformed. Syntax sugar means an extra unnecessary bit of syntax introduced to SWEETEN the SYNTAX (i.e. simplify it, make it easier, prettier, etc). So you could argue that CUSTOM INFIX OPERATORS are a sort of syntax sugar. But function composition, normal or reverse application themselves are not:
compose f g x = f (g x)
apply f x = f x
pipe x f = f x

Higher order functions in ML are not "syntax sugar".
It is not "a part of _any_ formal system" (especially as when you consider formal systems you usually don't want to do extra redundant work)..
Also "it's syntax sugar" is not a magic out of being totally wrong.
I think you've confused one place where you can use |> (which it's not even best at) with |> being intrinsically related to that thing.
>>
>>107075602
yep
and the anon you're talking to is supposed to "work in static analysis"? lolololol
>>
>>107075647
he might just be a junior idk
>>
>>107075655
He's the current resident /dpt/ schizo, and he's a poor replacement for the last one (regdumper).
This guy is from Iraq or some other shithole around it.
>>
Is it a conspiracy that no x86-64 CPU allows you to bypass the TLB?
>>
File: ebasedi.png (172 KB, 460x460)
172 KB
172 KB PNG
>>107075730
Literally, what is the use case for this?
>>
>>107075784
What is the usecase for virtual static memory?
>>
>>107075790
Is that something you just made up?
>>
>>107075834
? I'm making an OS.
>>
File: 1746173251827937.png (690 KB, 1534x895)
690 KB
690 KB PNG
thoughts on my manga downloader so far?

Making it on desktop cross platform, allowing for each merging from multiple website sources easily was the idea
>>
To the moron who does not understand what syntactic sugar is:

List.map (fun x -> compose fn1 fn2 x) [3];;
(* the same as *)
fn2 3 |> fn1;;


DO YOU UNDERSTAND NOW?

Jesus fuck. And before you say "durr, functions take more than one argument", I'm afraid you've failed the basics of functional programming. Yes, they take one argument, but they are auto-curried. Auto-currying is a syntactic sugar, so is `|>`.

I had to wake up from sweet slumber, just because this idiot's idiocy was on my nerve.

(pic related, except I have 4 wives calling me to the bed, I swear I'm not lying, I have four wives).
>>
>>107076297
how do functards live with such ugly syntaxes
>>
>>107076297
Literally not the same, to begin with the first returns a map. Remove List.map and [] and you have (fun x -> compose fn1 fn2 x) 3, which IS the same as fn2 3 |> fn1... yet lists and mapping are CONSPICUOUSLY ABSENT
because it has nothing to do with mapping, as I said that's just one place you can use functions, map is literally not remotely related to |>
Incidentally you've needlessly used a lambda, you could have used (compose fn1 fn2)... WHICH IS CLEANER THAN |> WHICH WOULD FORCE THE LAMBDA
so cope & seethe
>>
>>107076297
>>107076340
And neither of those nor auto-currying are syntax sugar you imbecile
>>
>>107076321
ocaml is very cute and haskell is very sex
>>
>>107076340
I meant the first returns a list, not a map.
>>
>>107075667
>regdumper
He was intelligent, but stuck thinking about stuff that was relevant 15 years ago.
>>
>>107076592
Lol no. Compilers can still be shit in 2025.
>>
>>107076619
Is this the return? Is the king of /g/ finally back?
>>
>>107076627
Sorry I'm not him.
>>
struct Default {
struct Data {
int a;
};

Default(Data data) : data(data) {}
virtual std::string getName() = 0;
virtual void printData() {
std::cout << getName() << " " << data.a << std::endl;
}

Data data;
};

struct Extension : virtual Default {
struct DataExtended {
int a;
};

Extension(DataExtended dataExtended, Data data) : Default(data), dataExtended(dataExtended) {}
void printDataExtended() {
std::cout << getName() << " " << dataExtended.a << std::endl;
}

DataExtended dataExtended;
};

struct Original : virtual Default {
Original() : Default({1234}) {}
std::string getName() {
return "Original";
}
};

struct Extended : Original, Extension {
Extended() : Default({1324}), Extension({5678}, {1234}) {}
std::string getName() {
return "Extended";
}
};


Does this make sense from an inheritance point of view? I basically want to have my default implementation of a bunch of things and then I want to extend this system with some objects gaining additional functionality from the extension
>>
>>107076830
Nobody does this in 2025.
>>
>>107076830
>struct Extension : virtual Default {
I hate this shit
>>
>>107076340
>>107076351
Learn what semantic abstraction is. Just do it.
>>
>>107076963
Uh huh buddy so it's not "syntax sugar" or map or category theory or "functional" any more
>>
vibe coding my crypto pre-sale landing page
fake and gay market ff
>>
>>107077016
When did I say any of those.

You know, you're a goddamn moron. You know shit about nothing. You think syntactic sugars should work like operators. Fucking lol.
>>
>>107072381
>https://www.youtube.com/watch?v=Dhn-JgZaBWo
interesting actually
>>
File: that-sign.jpg (263 KB, 1920x1080)
263 KB
263 KB JPG
>>107074381
>It's `map` in disguise. The |> operator is just a sugar
>Read the text in pic related.
The text defines f* as:
f*() = ()
f*(a) = f(a), for any a in A


If |> is an infix alias for f*, then |> is defined for () (it isn't)
>>
>>107077168
Don't do it anon, you're underestimating how stupid he is
You will literally lose IQ points continuing the argument
>>
>>107076830
Stop doing inheritance.
>>
>>107077272
I'm basically lawrence of arabia after substituting arabia for persia and ww1 for /g/
>>
I take what I said about webdev back. It's a complex task. Still, it's not what I wanna be doing to earn money, because the market for webdevs is saturated.

With SCA, you deal with complex stuff such as SAT/SMT solvers, but still, I would not be implementing the solver from scratch would I. You can assemble a UAF (Use-After-Free) analyzer using Z3 bindings + libclang bindings in Python in no time, it's not much different than say, using React to create a web page. Conceptually, that is.
>>
filtered by react lmoa
well cloudflare got filtered too, they self ddosed
>>
>>107077292
the more I do it the more I kind of like it. Prototyping sucks since you have to change a lot to make small changes, but a finalized design that will not be changing further and just used through its interfaces is really pleasant
>>
>>107077461
No, you're just a dumb moron who fails to understand the difference between syntactic and semantic domain. Nobody is going to write you a "Dune" novel, but substitute "Dune" with jungles because Iran is full of jungles and forests, FYI (and it snows in most parts of Iran pretty regularly).

Let me explain it like this;

You know how in signal analysis, we use the DFT to take the signal from a time domain, to a frequency domain?

In PLT, we take the language from syntactic domain to semantic domain, and just like the latter, it gives us freedoms to analyze, and reason about the code.

When I say `|>` is syntactic sugar for `map`, and show you a SEMANTIC definition of `map`, and then PROVE it to you, with empirical evidence, I'm saying that, `|>`, in semantic domain, acts like `map`.

You can desugar a syntax sugar to both semantic, and syntactic meanings. Yes, it's called a' 'syntax' sugar, but as long as you can REASON about it, it could go either way.

Here's a basic syntax sugar in Ruby: `foo &:bar`. Here, we use a function named `bar` as a block passed to the function `foo`. Doing so is impossible syntax-wise (in the least, it requires a lot of indirections) but this syntax sugar maps directoy to the SEMANTIC DOMAIN.

One feature of the semantic domain is that we can ABSTRACT IT AWAY. You know how we have the Abstract Syntax, we have the Abstract Semantics too.

In a way, `|>` is HOMOMORPHIC with `map` (AS I PROVED TO YOU, WITH EVIDENCE), mind you, I said 'homomorphic', not 'isomorphic'. With homomorphism, you are allowed to lose/gain data. With isomorphism, no.

And thus we get back to the portion of text I submitted. Read it carefully, and I posted the book itself, read it carefully.

At this point, you morons are just embarrassing yourselves. Don't expect `|>` to 100% be like `map`, because it's a syntactic sugar HOMOMORPHIC with the said construct.

Do you morons understand?

Oy vey...
>>
File: angry-karen.png (555 KB, 1024x1024)
555 KB
555 KB PNG
Why is it that, retards like Terry Davis get thousands of dollars as stipend because of their mental illness, but the Iranian government refuses to give me a stipend for my bipolarity, because "you already get two stipends"?

How about 3 stipends, Ayatollah? My dad did not get himself mangled in the war, so they mistook his bipolarity with PTSD, and gave him the wrong meds, leading to him transmitting the said PTSD to me, alongside with the hereditary mental illness?

It's all West's fault. In the least, they should give me a "Cyber Jihad" stipend for me having to wrangle these idiots who don't understand basic PLT concepts.

If I had a monthly stipend, I would have created 1000 shitty OS's and un-optimizing (more like dis-optimizing!) crappy compilers.

And yes, God talks to me, too. He just said, people ITT who don't understand basic PLT concepts are homosexuals who must be stoned.

(ps: this is all a joke? jk, this is all a joke, don't take it seriously, I'm just having a laugh at the expense of these idiots who don't understand the difference between 'homomorphism' and 'isomorphism', which is surprising, considering they are 'homosexuals', not 'isosexuals'!)
>>
can we fast forward to the next schizo?
>>
https://web.archive.org/web/20141014043557/http://venge.net/graydon/talks/intro-talk-2.pdf
>You are not going to be forced to use it.
that aged well
>>
what's wrong with assuming long long is 64 bits wide?
>>
>>107079273
long long is guaranteed to be "at least" 64-bits. You could argue about some theoretical implementation where it's larger, but that's a bunch of unrealistic wankery.
However, in most cases where you really care about the width of a type, I'd argue that using (u)int64_t is better, because it conveys more intent.
>>
>>107079273
any time you ignore your language's spec you delve into UB. you are not targeting an embedded platform, you are targeting a language / compiler and UB assumptions are sloppy work that will lead to bugs
>>
>>107060072
finally got my kernel interacting with my gpu via device files (all custom emulated hw, custom c-like language), and just finished rewrite of previously shitty slub allocator. now working on adding more features to the gpu emulator (more state registers, fences, semaphores) and excited to port my previously external "hello triangle" gpu test program into userland. gpu runs on top of opengl and both the cpu + gpu emulators are written in c
>>
>>107079318
>you are not targeting an embedded platform, you are targeting a language
completely backwards
almost of the language should be architecture independent but in the few places where architectures differ, the language should have operators that have the exact semantics of the instruction implemementing that operator
>>
>>107079315
>>107079318
is int64_t even in C99? I just want to avoid this sizeof(long long)*CHAR_BIT*30103L/100000L + 1 and use a fixed size buffer
>>
File: 1751401517371607.png (279 KB, 567x425)
279 KB
279 KB PNG
>look up C++ gui library
>everyone recommends Qt
>it costs money
What can I use instead
>>
>>107079504
>Qt
>it costs money
what the hell, I didn't know that
>>
>"just do RAII bro"
>create() in ctor
>release() in dtor
>release() can fail with an error
>can't throw in dtor
heh
>>
>>107079504
isn't it LGPL now?
>>
File: qt.png (63 KB, 1255x286)
63 KB
63 KB PNG
>>107079826 (me)
apparently not all of Qt is under LGPL. welp, use GTK then.
>>
>>107079504
make your own gui toolkit
>>
>>107079504
Use Dear Imgui. It's an immediate mode GUI library. I used the Python bindings to create this:

https://github.com/Chubek/SongOfSprockets

Solid library. It's made by a guy named Omar, and OMAR'S COMING YO (I'm old, and lame, yes).
>>
Is there some de facto standard notation for formatting command line argument help text? Like the text that's printed when you pass --help command line argument to your program?
>>
>>107079504
qt only costs money if you need a different license or want to support.
fltk, tcl, u++, gtk, wxwidget etc. they are a bunch of alternatives all of them come with their downsides or just use one of the many html ones.
>>
>>107060738
nobody knows all of C++, lots of people just know how to write specific things in it. just keep working on whatever you need to get done and you'll get better

one thing that is much easier nowadays than it used to be is figuring out what standard library features you can or should use. just ask some LLM to help you find the right tool for the job. but then still go out, read the docs and write the code yourself.
>>
>>107060824
it werks. everything else doesn't for many of my usecases, sadly.
>>
>>107066839
Rust has a lot of shit that only starts to make sense after you've been programming for a couple of years. Start with a toy language like python if you just wanna learn how to code (it will work just fine and most faggots here would be shocked to see how far you can go with it before needing to touch anything else), or >>107066975
if you want to learn how to write programs that actually run on a real computer and not inside a sandbox where everything sharp has been hidden from you.

Once you know C and a high-level language it should be fairly easy to pick up anything after that. Then it just becomes a question of practice.
>>
File deleted.
>>107075860
doing this with QML with python backend
>>
File: 1730908822936173.png (755 KB, 1538x896)
755 KB
755 KB PNG
>>107081362
ok didn't realize the picture had something nsfw lol
>>
File: 1749855747098686.jpg (157 KB, 926x1024)
157 KB
157 KB JPG
>>107078171
You'll have to forgive me for being dumb

>When I say `|>` is syntactic sugar for `map`, and show you a SEMANTIC definition of `map`, and then PROVE it to you, with empirical evidence, I'm saying that, `|>`, in semantic domain, acts like `map`.
>In a way, `|>` is HOMOMORPHIC with `map` [...] I said 'homomorphic', not 'isomorphic'. With homomorphism, you are allowed to lose/gain data.
Would that imply any function application shares that property? e.g.
f x
map f [x]

and what is the identity element of map f [x]? Simply map f applied to no arguments?
>>
Any recommended read about category theory for programmers?
>>
>>107081563
learn haskell if you haven't already
>>
>>107081607
Alright
>>
File: 1751235562603610.png (889 KB, 1800x900)
889 KB
889 KB PNG
>>107080900
GNU uses argp apparently
Usage: argex [OPTION...] ARG1 ARG2
argex -- A program to demonstrate how to code command-line options
and arguments.

-a, --alpha=STRING1 Do something with STRING1 related to the letter A
-b, --bravo=STRING2 Do something with STRING2 related to the letter B
-o, --output=OUTFILE Output to OUTFILE instead of to standard output
-v, --verbose Produce verbose output
-?, --help Give this help list
--usage Give a short usage message
-V, --version Print program version

Generated partly from
static struct argp_option options[] =
{
{"verbose", 'v', 0, 0, "Produce verbose output"},
{"alpha", 'a', "STRING1", 0,
"Do something with STRING1 related to the letter A"},
{"bravo", 'b', "STRING2", 0,
"Do something with STRING2 related to the letter B"},
{"output", 'o', "OUTFILE", 0,
"Output to OUTFILE instead of to standard output"},
{0}
};
>>
>>107079504
This >>107080598 but don't use c++
>>
>>107081680
Thanks.
>>
>>107080689
>It's an immediate mode GUI library
No thanks
>>
>>107079273
isn't some aspect of handling longs one of the few areas where modern platforms still differ?

>>107079381
it doesn't matter if it is or isn't what matters is that it's in the universal common subset of C features and language extensions supported by default by all modern compilers and standard libraries
and even when it wasn't it was standard practice for a lot of projects to just bundle their own stdint.h for MSVC
caring about absolutely strict adherence to the C standard is a relic from the day and age when everyone and their mother had a C compiler and processors had wacky architectures things like 57 bit words and so you needed the standard to enforce behavior
UB is bad from that perspective because who knows what could happen but most if not all areas of UB have actually become implementation defined or in some cases even standardized extensions onto the standard like posix threads
far too many people have trouble grasping the concept that if a behavior is undefined then one of the things you can choose to do as an implementer is to define it
oftentimes the most reasonable option in a lot of cases

defacto standards >>>>>>>> abstract formal standards
>>
File: 1762099250632.png (66 KB, 1070x1078)
66 KB
66 KB PNG
>>107076830
You can simulate inheritance with tagged unions! You don't need more.
use fmt;

type dog = struct {
name: str,
};

fn dog_make_sound(self: *dog) void = {
fmt::println(self.name, "woof!")!;
};

type cat = struct {
name: str,
};

fn cat_make_sound(self: *cat) void = {
fmt::println(self.name, "meow!")!;
};

type animal = (dog | cat);

fn make_sound(self: *animal) void = {
match (self) {
case let d: *dog => dog_make_sound(d);
case let c: *cat => cat_make_sound(c);
};
};

export fn main() void = {
let fido = dog {
name = "fido",
};

// upcast: Treat dog as animal
let pet: animal = fido;
make_sound(&pet);
};
>>
>>107070256
c/c++ or zig, maybe rust, this is, languages that can output a library that uses the C abi. both zig and rust come with cross-compiling out of the box (although meson and other tools have made cross-compilation on c/c++ easier than it was before). conditional compilation is also slightly easier to use on both of them but still perfectly doable in c/c++

if I were you I would stick to webshit if only because gtk is garbage; swift and winapi are more or less what you would expect, but gtk is awful and bad and just as slow as your browser. maybe you could use qt instead of gtk for linux. specially if you are doing anything more complex than a hello world, you really don't want to deal with gtk's "event sources"
>>
Test
>>
>>107076830
Although some languages might allow it (virtual inheritance in your case), this is still a poor design. OOP in general is on it's way out as a paradigm, but if you nonetheless want to use it, read that book about design patters. In your case it seems like you could use something like the strategy pattern or dependency injection. Or consider plain old composition, and then dependency injection:
struct Feature {
int a;

struct Interface {
virtual std::string getName() = 0;
}

void printData(Interface* i) {
std::cout << i.getName() << " " << a << "\n";
}
}

struct Object : public Feature::Interface {
std::string name;
Feature f;

std::string getName() {
return name;
}

void printData() {
f.printData(this);
}
}
>>
>>107082649
>OOP in general is on it's way out as a paradigm
lol
lmao
>>
>>107076830
https://en.wikipedia.org/wiki/Decorator_pattern
>>
File: 1717007526026839.jpg (77 KB, 600x1199)
77 KB
77 KB JPG
I made a library for peer to peer networking and felt confident enough to publish it in the official package manager. It's very well documented and open source, though not completely finished but functional. I fell off on making weekly updates because I've gotten extremely busy but I will not abandon it. But you can setup a local p2p network with a few lines of code, and WAN is pretty intuitive and easy to setup so far as well.

The library has a lot of default implementations, and default logic and behaviors that are usually defined with delegates that can be overridden. But there's a sort of rigid flow in the design.
I did not make the library DI friendly. While interfaces are implemented on live and revolving objects (peers, packets, data wrappers) larger classes that define behaviors, logic and policies are globally static and store the swappable delegates with the default behaviors and policies.

Did I make an engine rather than a library?
And did I make a huge mistake by making it not DI friendly by using static classes to wrap certain things by default?
>>
>>107082682
he's kinda right. look at some of modern C++ libraries, and there is significantly less orthodox OOP autism there than, say, there was in the 90s. way less inheritance and funky design pattern fuckery. OOP is still there (it's a solid paradigm), just not as autistic.
>>
>>107083173
>C++
that abomination belongs to no paradigm, yet alone defines any paradigm
>>
so i've been learning c#, really drank the koolaid and ended up recreating all my commonly used python utilities as neat plug&play classes that can be slotted in to any project.
in python i created a project template with all my utilities in it, but in the long run ive ended up with a bunch of apps using different versions of those utilities, since they grow organically with time.
this got me thinking of maybe going for a monorepo with c#. good or bad idea?
>>
hey bros, can anyone recommend a good place to start to learn how to program in python? It appears a lot of resources recommend to use "How to Automate the boring stuff with python".
>>
>>107084105
https://docs.python.org/3/
unironically the official documentation
unlike most programming languages python has well made and beginner friendly documentation in general on top of an official tutorial
>>
>>107084105
Just get an LLM to tutor you.
>>
>>107081680
>--param=VALUE
hateful shit
>>
>>107082649
>OOP in general is on it's way out as a paradigm
no, only inheritance
I was thinking that too, but then I realized that OOP (virtual tables, no inheritance) is a fundamental design pattern when understood in light of the Expression Problem.
>>
If your code is always improving you're probably polishing a turd.
>>
>>107084879
>NOOOOO you can't get better, ok?
>>
i know that vulkan and rendering in general is way out of my league but i still want to get a working triangle rendered in vulkan.
Does any wizard here know how to get a triangle working in Rust, with Vulkan ?
>>
>>107085008
Don't use OOP. Keep everything in one giant function.
>>
peer 2 peer is a pain the ass :(
>>
I've been grokking pointer analysis non-stop for the past few days to translate a paper for my SCA job. Since many newfriends have issues understanding pointers, ask and you shall receive a hefty response vis-a-vis the semantics of pointers and the different ways the compiler or the static analyzer handles pointer analysis.

In short, we need to compute a set calls 'points-to', `pt(foo) = {all the locations foo points to, based on the domain of sensitivity}`. The 'domain of sensitivity' could be several things, ranging from flow-sensitivity to context-sensitivity (e.g. call sites, or the activation record).

We set constraints, and we solve them either via fixed-point iteration or SAT/SMT solvers. These contraints focus on various pointer-related operations, such as `p = *q`, `*p = q`, `alias p = q`, etc.

Pointer analysis could warn the programmer of stuff such as double-freeds or use-after-frees.

if you know more about pointer analysis, lemme know so I could aks kuessions from you.
>>
>>107060738
it's not brutal, its flexible and performs well while giving true freedom for memory management.
the reason people would recommend something like python or java for beginers is that it won't take so much effort to get a small program running without stumbling on details about memory, boosting your confidence and also showing you a little bit faster if you like or not the mental types of challenges involved in writing programs
>>
>>107085230
Any static analysis breaks when there is I/O or random values but if you want something that's "good enough" read about Interval Contractors. SAT alone is too slow.
>>
>>107085308
>while giving true burden for memory management
ftfy
>the reason people would recommend something like python or java for beginers is that it won't take so much effort to get a small program running without stumbling on details about memory
the advantage of not having to deal with manual memory management goes beyond just small programs
>>
>>107085782
>>
>>107085918
zig sisters...
>>
>>107085559
Right?
>bro just do valgrind but static lol
>>
>>107085008
use modern (1.3ish at least) vulkan, don't use textures, don't use images except when blitting to the swapchain output, don't use samplers, don't use descriptors, just draw in compute shaders using buffer device addresses in push constants for data in and data out
basically just use vulkan like a portable very verbose version of cuda or hip
there you go, now vulkan is as trivial as it's going to get regardless of language

if you really wanted to you could do a gpu software based 3d renderer like that
>>
>>107085008
https://github.com/vulkano-rs/vulkano
https://vulkano.rs/01-introduction/01-introduction.html
https://github.com/vulkano-rs/vulkano/blob/master/examples/triangle/main.rs
https://github.com/vulkano-rs/vulkano/blob/master/examples/triangle-v1_3/main.rs
Vulkano makes vulkan a relatively nice experience. I have quite a lot experience with it, I might answer future questions if I catch your posts on /dpt/

Do not listen to the pseud above
>>
>>107086779
vulkan 1.3+ compute only based drawing is literally 10000% easier to set up and a much better way to introduce the idea of shaders than a real rendering pipeline to the point modern vulkan tutorials start there and not with a traditional rendering pipeline
for real 2d applications in general it's probably even perfectly fine to use in actual production
>>
>>107086898
Cool
>>
>>107086499
>>107086898
Are you advocating for purely software rasterization in compute shaders? You can't make real stuff with that.
>>
>>107086779
I'd recommend at least getting the basics down in plain Ash before using a more thorough wrapper like Vulkano so you have at least some idea of what those higher-level constructs are mapping down to in vanilla API terms. Also do yourself a huge favor and use Slang for shaders over glsl.
>>
>>107087085
as a learning technique for someone literally just starting out interacting with the gpu just trying to get pixels out and for doing 2d compositing/drawing yea, it's fine
>purely software rasterization in compute shaders? You can't make real stuff with that.
though i'm fairly sure i've heard of pure compute based rasterizers performing fairly well in general especially on more modern hardware and i think i might've read a blog where in some very niche case or two they were the preferred option
>>
>>107087139
That's not a bad idea, but Vulkano is very lean so I do not think it matters that much in practice. You can always use your IDE to dive into Vulkano code and see what gets called under the hood.
>>
>>107087165
Nanite uses software rasterization since it only becomes competitive with silicon when triangles are starting to reach sub-pixel scales. It's still very limited and much more work to do right than just using the actual hardware and wouldn't be a good fit for doing everything in if your aim is a standard real-time renderer.
Worthwhile thing to look into but you should probably do the standard stuff just starting out.
>>
File: store.jpg (39 KB, 460x165)
39 KB
39 KB JPG
>>107066956
Hopefully you're still with us. The ocaml manual memoization page is supposed to be funny. https://rosettacode.org/wiki/Fibonacci_sequence#Haskell is funny because of lazy lists make the other ways look like rube goldbergs.

I could revisit my attempt at SPH in futhark. I moved on to another project before finding out, but lately I comp.
>>
I just discovered that windows utf 16 is superior to utf8
2 bytes for all popular languages
Utf8 is 1 byte for latin script languages, 2 for Arabic script languages and 3 for east Asian script languages
How did windows do this?



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