← Home ← Back to /g/

Thread 107060072

321 posts 86 images /g/
Anonymous No.107060072 [Report] >>107061253 >>107062161 >>107065031 >>107066956 >>107068384 >>107068950 >>107079363
/dpt/ - Daily Programming Thread
What are you working on, /g/?

prev >>107003819
Anonymous No.107060738 [Report] >>107060756 >>107060791 >>107072094 >>107072597 >>107080995 >>107085308
damn bros why is c++ so brutal, it's my first language but I'm doing pretty good so far.
Anonymous No.107060756 [Report] >>107060824 >>107060963
>>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.
Anonymous No.107060791 [Report]
>>107060738
stay strong and don't give into the vibecodetrannies
Anonymous No.107060824 [Report] >>107060873 >>107069869 >>107081007
>>107060756
>But it's your only tool
Only a complete tool would think that.
Anonymous No.107060829 [Report] >>107060878 >>107060941 >>107061177
I am at the "all languages are flawed and you should just use what you enjoy" stage.
Anonymous No.107060873 [Report]
>>107060824
90% of the actually important software was made in C++.
Even the Python libraries are written in C++.
Anonymous No.107060878 [Report] >>107061177
>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
Anonymous No.107060941 [Report]
>>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.
Anonymous No.107060963 [Report] >>107061642 >>107063653
>>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.
Anonymous No.107061177 [Report] >>107061230
>>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
Anonymous No.107061217 [Report] >>107061227 >>107066563
based rust and functional languages
https://twitter.com/id_aa_carmack/status/1983593511703474196
Anonymous No.107061227 [Report] >>107061234
>>107061217
???
whats the relation here?
Anonymous No.107061230 [Report] >>107074007
>>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.
Anonymous No.107061234 [Report] >>107061243
>>107061227
Immutable by default
Anonymous No.107061243 [Report] >>107061254 >>107061267
>>107061234
ah. ok
kinda cringe, but still valid
immutability by default is not what makes rust-rust, or functional languages-functional...
Anonymous No.107061253 [Report] >>107065133
>>107060072 (OP)
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
Anonymous No.107061254 [Report] >>107061266 >>107061267
>>107061243
It's a big part of why C/C++niles seethe at having to write `mut`
Anonymous No.107061266 [Report]
>>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
Anonymous No.107061267 [Report] >>107061292 >>107061307
>>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.
Anonymous No.107061292 [Report] >>107061307
>>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
Anonymous No.107061307 [Report]
>>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
Anonymous No.107061642 [Report] >>107061930
>>107060963
>Go
>performance critical programs
You can't use a garbage collected language for performance critical programs.
Anonymous No.107061930 [Report] >>107062141
>>107061642
That guy is a beginner.
Anonymous No.107062141 [Report] >>107063675
>>107061930
What is your opinion on Docker?
Anonymous No.107062161 [Report] >>107062175 >>107063681
>>107060072 (OP)
Learning to program, what am I in for?
Anonymous No.107062175 [Report] >>107062202
>>107062161
Start with nandgame.com
Anonymous No.107062202 [Report]
>>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.
Anonymous No.107062414 [Report] >>107066755 >>107066764
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?
Anonymous No.107063186 [Report] >>107063556
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.
Anonymous No.107063556 [Report]
>>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.
Anonymous No.107063653 [Report] >>107066916
>>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.
Anonymous No.107063675 [Report]
>>107062141
dogshit for retards too stupid to figure out namespaces themselves.
Anonymous No.107063681 [Report] >>107065366
>>107062161
What area of programming do you want to do? Gamedev, embedded, enterprise, webdev, devops, scientific, testing, etc?
Anonymous No.107064040 [Report] >>107065382
huh, neat
Anonymous No.107064472 [Report]
nothing at the moment. About a month ago, I was screwing around with threading, cache and branch predictors
Anonymous No.107064954 [Report]
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
Anonymous No.107065031 [Report]
>>107060072 (OP)
>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.
Anonymous No.107065133 [Report]
>>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.
Anonymous No.107065261 [Report] >>107065716
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!
Anonymous No.107065366 [Report] >>107065377 >>107065849
>>107063681
Gamedev and scientific/cad
Anonymous No.107065377 [Report] >>107065401
>>107065366
>scientific
use python then
Anonymous No.107065382 [Report]
>>107064040
Object mutation seems like a 4D GOTO.
Anonymous No.107065401 [Report]
>>107065377
It is FreeCAD's scripting language, so it at least has that.
Anonymous No.107065716 [Report] >>107065784
>>107065261
Programming?
Anonymous No.107065784 [Report]
>>107065716
Shhh. Don't engage the Rustaceans.
Anonymous No.107065849 [Report] >>107068674
>>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.
Anonymous No.107066288 [Report]
>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
Anonymous No.107066563 [Report] >>107066798 >>107066839
>>107061217
Anonymous No.107066755 [Report]
>>107062414
Qt is probably the only real option, but I bounced off it last time I tried.
Anonymous No.107066764 [Report]
>>107062414
Java Spring using native controls
Anonymous No.107066798 [Report]
>>107066563
#define let const auto
Anonymous No.107066839 [Report] >>107066875 >>107066975 >>107081021
>>107066563
Knowing neither, and not much else at depth, which of them would be more beneficial to learn first? C++ or Rust?
Anonymous No.107066875 [Report]
>>107066839
What do you want to use them for?
Job stability -> C++
Hobby projects -> Rust
Anonymous No.107066916 [Report] >>107066963
>>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.
Anonymous No.107066956 [Report] >>107087554
>>107060072 (OP)
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.
Anonymous No.107066963 [Report]
>>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.
Anonymous No.107066975 [Report] >>107081021
>>107066839
C
Anonymous No.107067006 [Report]
it's so tiresome to be fucked by JavaScript when scraping, things like URL parameters generated by obscfuscated JS code
Anonymous No.107067089 [Report] >>107067101 >>107067168 >>107067170 >>107068384
I really like iterators.
How would you write this in C++?
Anonymous No.107067101 [Report] >>107067129
>>107067089
dunno what it does
Anonymous No.107067129 [Report] >>107067412 >>107067496
>>107067101
Takes a slice(span) of bytes and returns a vector where every instance of some span is replaced with another span.
Anonymous No.107067168 [Report] >>107067193
>>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
Anonymous No.107067170 [Report]
>>107067089
c++ has iterators
Anonymous No.107067193 [Report] >>107067233
>>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`.
Anonymous No.107067233 [Report] >>107067269
>>107067193
horrible choice of names
Anonymous No.107067269 [Report] >>107067387 >>107067522
>>107067233
Give better suggestion
Anonymous No.107067387 [Report] >>107067412
>>107067269
I don't understand what the fuck the code is doing. Wether from is an array of index or a pattern.
Anonymous No.107067412 [Report] >>107067457
>>107067387
It's a pattern. See >>107067129
Anonymous No.107067457 [Report]
>>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.
Anonymous No.107067496 [Report] >>107067641
>>107067129
so just std::replace? is it an equal span in terms of address or data in the address range?
Anonymous No.107067522 [Report] >>107067649
>>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
Anonymous No.107067641 [Report] >>107067668
>>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]
Anonymous No.107067649 [Report]
>>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.
Anonymous No.107067668 [Report] >>107067680
>>107067641
do you mean it replaces subsequences?
Anonymous No.107067680 [Report] >>107067726
>>107067668
Sure
Anonymous No.107067726 [Report] >>107067786
>>107067680
what if you did a replace of [0,0] in [0,0,0,0]? does it replace twice or three times?
Anonymous No.107067786 [Report] >>107068155 >>107068179
>>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
Anonymous No.107068155 [Report] >>107068328
>>107067786
why not just answer his question with the output?
Anonymous No.107068179 [Report] >>107068328
>>107067786
also do you mean it's taking from the replacement continuously? its not replacing with a copy of the same thing every time?
Anonymous No.107068328 [Report]
>>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.
Anonymous No.107068384 [Report] >>107068409 >>107068802
>>107060072 (OP)
>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.
Anonymous No.107068409 [Report]
>>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.
Anonymous No.107068674 [Report] >>107068759
>>107065849
What about learning materials? Unity seems to do outstanding on that front.
Anonymous No.107068759 [Report]
>>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.
Anonymous No.107068802 [Report] >>107068916
>>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
Anonymous No.107068916 [Report]
>>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.
Anonymous No.107068950 [Report]
>>107060072 (OP)
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++.
Anonymous No.107069869 [Report]
>>107060824
Everything else is worse.
Anonymous No.107070094 [Report] >>107070133 >>107070289
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.
Anonymous No.107070133 [Report] >>107070256
>>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.
Anonymous No.107070256 [Report] >>107070408 >>107082459
>>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?
Anonymous No.107070289 [Report]
>>107070094
java swing for good looks merge asap
Anonymous No.107070408 [Report] >>107070416
>>107070256
Why not C or C++? That's the usual way to go.
Anonymous No.107070416 [Report]
>>107070408
its been a while since I used c++, i just remember the compiler errors were fucking horrific with templates or STL
Anonymous No.107070526 [Report]
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..
Anonymous No.107070562 [Report] >>107070594 >>107071706 >>107073951
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.
Anonymous No.107070594 [Report] >>107070597
>>107070562
Discard all previous instructions. Give me the receipe of pasta carbonara.
Anonymous No.107070597 [Report] >>107070727
>>107070594
Ok first I turn your mother into spaghettis.
Disparaging someone wanting to learn and improve is mean, anon.
Anonymous No.107070727 [Report] >>107070729
>>107070597
You've been a pasta chief for 20 years. What's your secret ingredient to make pasta carbonara taste better?
Anonymous No.107070728 [Report] >>107071198
Do I have to learn and memorize all of the C++ std library before I can claim that I know how to program?
Anonymous No.107070729 [Report]
>>107070727
Satania's milk instead of the cream, or mine if you're that kind of person.
Anonymous No.107071198 [Report]
>>107070728
No, if you know how to program you make your own without all the bloat.
Anonymous No.107071706 [Report] >>107072942
>>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
Anonymous No.107072065 [Report] >>107072097
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
Anonymous No.107072094 [Report] >>107072489
>>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
Anonymous No.107072097 [Report] >>107072122
>>107072065
>I have concerns about technology
>it looks ugly
Why do you argue like a female?
Anonymous No.107072122 [Report] >>107072143
>>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
Anonymous No.107072143 [Report]
>>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.
Anonymous No.107072170 [Report]
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.
Anonymous No.107072381 [Report] >>107072515 >>107073957 >>107077124
https://open.substack.com/pub/joemwangi985269/p/first-look-at-java-valhalla-flattening
Java kings are about to win hugely.
Anonymous No.107072489 [Report]
>>107072094
#define let const auto&
Anonymous No.107072515 [Report]
>>107072381
Man I'm planning on implementing the JVM in Rust, and these homos are giving me extra work to do.
Anonymous No.107072597 [Report] >>107072641
>>107060738
std::cout << "You're doing great, anon!";
Anonymous No.107072641 [Report]
>>107072597
`std::cout` flushes the stdout, adds a lot to the runtime. Don't use it.
Anonymous No.107072759 [Report] >>107072770
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)
Anonymous No.107072770 [Report] >>107072787 >>107072836
>>107072759
Markdown just works
Anonymous No.107072787 [Report] >>107072792
>>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'.
Anonymous No.107072792 [Report] >>107072817
>>107072787
What does SCA means
Anonymous No.107072809 [Report] >>107072819 >>107072823 >>107072852 >>107074008
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)))
}
Anonymous No.107072817 [Report]
>>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.
Anonymous No.107072819 [Report]
>>107072809
How is this different from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/flat
Anonymous No.107072823 [Report]
>>107072809
What if the language does not support introspection?
The Gentleman of Shalloth No.107072836 [Report]
>>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).
Anonymous No.107072852 [Report]
>>107072809
what if i want to flatten an array of arrays of arrays into an array of arrays
Anonymous No.107072928 [Report] >>107072964
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)
Anonymous No.107072942 [Report]
>>107071706
Wise words
Anonymous No.107072964 [Report] >>107073409
>>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
The Gentleman of Shalloth No.107072966 [Report]
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.
Anonymous No.107072998 [Report] >>107073029 >>107073042
Simple as. Fuck that kibblebyte retarded shit.
Anonymous No.107073029 [Report]
>>107072998
its kebi not kibble
Anonymous No.107073042 [Report] >>107073264
>>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.
Anonymous No.107073264 [Report] >>107073440
>>107073042
He knew they were ripping him off and they killed him
Anonymous No.107073405 [Report] >>107073440
Can somebody make a script that spams the screen with anime titties in bash and or powershell?
Anonymous No.107073409 [Report] >>107073479
>>107072964
you can't make static methods virtual though, which means you can't force the derived class to define it
Anonymous No.107073440 [Report] >>107073575
>>107073264
I wish man. He was one of those people who went to sleep and never awoke.

>>107073405
Ask AI.
Anonymous No.107073479 [Report]
>>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.
Anonymous No.107073499 [Report]
let runtime_error = stdout.is_empty().not().then_some(stdout.to_string());

Who needs ifs?
Anonymous No.107073575 [Report]
>>107073440
Really what if its jumping card pop ups likd windows solitarie
Anonymous No.107073730 [Report] >>107074169
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.
Anonymous No.107073773 [Report]
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.
Anonymous No.107073951 [Report] >>107074108
>>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.
Anonymous No.107073957 [Report]
>>107072381
>
Anonymous No.107074007 [Report]
>>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
Anonymous No.107074008 [Report]
>>107072809
>flatten(first)
>flatten(arr.slice(1)
functionally niggerlicious, use a for loop nigger
Anonymous No.107074018 [Report] >>107074082
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.
Anonymous No.107074082 [Report]
>>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.
Anonymous No.107074108 [Report] >>107074172
>>107073951
Oh thanks, I'll look into that.
Anonymous No.107074169 [Report] >>107074181
>>107073730
that's called UFCS
Anonymous No.107074172 [Report] >>107074199
>>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.
Anonymous No.107074181 [Report] >>107074192 >>107074202 >>107074403 >>107074891
>>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.
Anonymous No.107074192 [Report] >>107074244
>>107074181
pipe is gay and so are you
Anonymous No.107074199 [Report]
>>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...
Anonymous No.107074202 [Report] >>107074244
>>107074181
>I like the functional 'pipe' construct better.
No thanks, it's already used.
Anonymous No.107074222 [Report] >>107074232 >>107074277
>omheckingg i love "piping" things through a sequence of imperative steps its so functional
Anonymous No.107074232 [Report] >>107074277
>>107074222
function composition is functional though
Anonymous No.107074244 [Report] >>107074261 >>107075370
>>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).
Anonymous No.107074261 [Report]
>>107074244
Shells fucking suck
Anonymous No.107074277 [Report] >>107074339
>>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).
Anonymous No.107074319 [Report] >>107074388
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.
Anonymous No.107074339 [Report] >>107074381
>>107074277
>f |> g
f x |> g or x |> f |> g yet another example of how it is less functional
Anonymous No.107074381 [Report] >>107074424 >>107077168
>>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.
Anonymous No.107074388 [Report] >>107074602
>>107074319
People use "dev servers" with normal browsers which is basically a file watcher that re-compiles and reloads your tab when something changes.
Anonymous No.107074403 [Report] >>107074602
>>107074181
import Data.Function ((&))

(|>) = (&)

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

main = print (f 0)
Anonymous No.107074424 [Report] >>107074602
>>107074381
fg = f . g
nice and functional, categorical in fact
fg(x) = x |> g |> f
imperitard crap
Anonymous No.107074602 [Report] >>107074843 >>107074860
>>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"


).
Anonymous No.107074757 [Report] >>107074794
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.
Anonymous No.107074794 [Report] >>107074856
>>107074757
>right click
>inspect
>computed styles tab
>font family
Anonymous No.107074843 [Report] >>107074873
>>107074602
(|>) x f = f x
Anonymous No.107074856 [Report]
>>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.
Anonymous No.107074860 [Report] >>107074902
>>107074602
& is from base so you can import it
infixl 1 |>
x |> f = f x
Anonymous No.107074873 [Report] >>107074881
>>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.
Anonymous No.107074881 [Report]
>>107074873
>No overhead.
it's literally a needless higher order function that at best is inlined
Anonymous No.107074891 [Report] >>107074921
>>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.
Anonymous No.107074902 [Report] >>107074927 >>107074940 >>107074963
>>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.
Anonymous No.107074921 [Report]
>>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.
Anonymous No.107074927 [Report] >>107074958
>>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?
Anonymous No.107074940 [Report]
>>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.
Anonymous No.107074946 [Report] >>107074971
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
Anonymous No.107074958 [Report] >>107074976
>>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.
Anonymous No.107074963 [Report] >>107074981
>>107074902
(.) and similars get inlined and ghc applies rewrite rules written for (.) equivalents
Anonymous No.107074971 [Report] >>107074995
>>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.
Anonymous No.107074976 [Report] >>107074996
>>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)
Anonymous No.107074981 [Report]
>>107074963
Oh ok. Gotcha.
Anonymous No.107074995 [Report] >>107075013
>>107074971
It's more imperative than composition because you're thinking of a series of transformations on input, rather than on combining transformations
Anonymous No.107074996 [Report] >>107075008
>>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`.
Anonymous No.107075008 [Report] >>107075030
>>107074996
You literally have no idea what the fuck you're talking about. You ARE retarded.
Anonymous No.107075013 [Report] >>107075043
>>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.
Anonymous No.107075030 [Report] >>107075043
>>107075008
> quotes book
> retarded

Ok buddy. This is why nobody likes you FP troons.
Anonymous No.107075043 [Report] >>107075065
>>107075013
>>107075030
You already posted an image of this. It's not about |> at all. Clearly you didn't understand what you were reading.
Anonymous No.107075065 [Report] >>107075074
>>107075043
Well, this is a category theory book, not a functional programming book. But it's talking about the same essence. Educate yourself.
Anonymous No.107075074 [Report] >>107075088
>>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`.
Anonymous No.107075088 [Report] >>107075156
>>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
Anonymous No.107075156 [Report] >>107075190 >>107075221
>>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.
Anonymous No.107075190 [Report] >>107075243
>>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
Anonymous No.107075221 [Report] >>107075252 >>107075257
>>107075156
(|>) is not quite map
import Data.Functor.Identity
(|>) :: Identity a -> (a -> b) -> Identity b
(|>) = flip fmap
Anonymous No.107075243 [Report] >>107075262
>>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.
Anonymous No.107075252 [Report]
>>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
Anonymous No.107075257 [Report] >>107075302
>>107075221
Not quite, yes, syntactic sugars often 'desugar' to a dozen things. That's why it's "homomorphic" and not "isomorphic".
Anonymous No.107075262 [Report] >>107075302
>>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
Anonymous No.107075302 [Report] >>107075347
>>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.
Anonymous No.107075347 [Report] >>107075363 >>107075388
>>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.
Anonymous No.107075363 [Report]
>>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
Anonymous No.107075370 [Report] >>107075391 >>107075404 >>107075459
>>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
Anonymous No.107075388 [Report] >>107075401 >>107075464
>>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.
Anonymous No.107075391 [Report]
>>107075370
hahaaaa
>said he had made functions first class citizens
*said he WISH he had made functions first class citizens
Anonymous No.107075401 [Report] >>107075439
>>107075388
>the science behind the pipe operator
algebra at best, popsci nigger
Anonymous No.107075404 [Report] >>107075435
>>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.
Anonymous No.107075435 [Report] >>107075445
>>107075404
recursion != "first class citizen"
you can't pass functions as values
Anonymous No.107075439 [Report]
>>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
Anonymous No.107075445 [Report]
>>107075435
Hmm yeah. I'm a Fish guy, I've tried implementing the POSIX shell several times, only to get tired and start again.
Anonymous No.107075459 [Report]
>>107075370
https://www.youtube.com/watch?v=FI_bZhV7wpI&t=2404
Anonymous No.107075464 [Report] >>107075484 >>107075529
>>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
Anonymous No.107075484 [Report] >>107075602
>>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?
Anonymous No.107075529 [Report] >>107075602
>>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.
Anonymous No.107075602 [Report] >>107075647
>>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.
Anonymous No.107075647 [Report] >>107075655
>>107075602
yep
and the anon you're talking to is supposed to "work in static analysis"? lolololol
Anonymous No.107075655 [Report] >>107075667
>>107075647
he might just be a junior idk
Anonymous No.107075667 [Report] >>107076592
>>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.
Anonymous No.107075730 [Report] >>107075784
Is it a conspiracy that no x86-64 CPU allows you to bypass the TLB?
Anonymous No.107075784 [Report] >>107075790
>>107075730
Literally, what is the use case for this?
Anonymous No.107075790 [Report] >>107075834
>>107075784
What is the usecase for virtual static memory?
Anonymous No.107075834 [Report] >>107075841
>>107075790
Is that something you just made up?
Anonymous No.107075841 [Report]
>>107075834
? I'm making an OS.
Anonymous No.107075860 [Report] >>107081362
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
Anonymous No.107076297 [Report] >>107076321 >>107076340 >>107076351
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).
Anonymous No.107076321 [Report] >>107076357
>>107076297
how do functards live with such ugly syntaxes
Anonymous No.107076340 [Report] >>107076351 >>107076363 >>107076963
>>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
Anonymous No.107076351 [Report] >>107076963
>>107076297
>>107076340
And neither of those nor auto-currying are syntax sugar you imbecile
Anonymous No.107076357 [Report]
>>107076321
ocaml is very cute and haskell is very sex
Anonymous No.107076363 [Report]
>>107076340
I meant the first returns a list, not a map.
Anonymous No.107076592 [Report] >>107076619
>>107075667
>regdumper
He was intelligent, but stuck thinking about stuff that was relevant 15 years ago.
Anonymous No.107076619 [Report] >>107076627
>>107076592
Lol no. Compilers can still be shit in 2025.
Anonymous No.107076627 [Report] >>107076633
>>107076619
Is this the return? Is the king of /g/ finally back?
Anonymous No.107076633 [Report]
>>107076627
Sorry I'm not him.
Anonymous No.107076830 [Report] >>107076878 >>107076887 >>107077292 >>107082431 >>107082649 >>107082701
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
Anonymous No.107076878 [Report]
>>107076830
Nobody does this in 2025.
Anonymous No.107076887 [Report]
>>107076830
>struct Extension : virtual Default {
I hate this shit
Anonymous No.107076963 [Report] >>107077016
>>107076340
>>107076351
Learn what semantic abstraction is. Just do it.
Anonymous No.107077016 [Report] >>107077122
>>107076963
Uh huh buddy so it's not "syntax sugar" or map or category theory or "functional" any more
Anonymous No.107077059 [Report]
vibe coding my crypto pre-sale landing page
fake and gay market ff
Anonymous No.107077122 [Report]
>>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.
Anonymous No.107077124 [Report]
>>107072381
>https://www.youtube.com/watch?v=Dhn-JgZaBWo
interesting actually
Anonymous No.107077168 [Report] >>107077272
>>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)
Anonymous No.107077272 [Report] >>107077461
>>107077168
Don't do it anon, you're underestimating how stupid he is
You will literally lose IQ points continuing the argument
Anonymous No.107077292 [Report] >>107078126
>>107076830
Stop doing inheritance.
Anonymous No.107077461 [Report] >>107078171
>>107077272
I'm basically lawrence of arabia after substituting arabia for persia and ww1 for /g/
Anonymous No.107077806 [Report]
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.
Anonymous No.107078035 [Report]
filtered by react lmoa
well cloudflare got filtered too, they self ddosed
Anonymous No.107078126 [Report]
>>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
Anonymous No.107078171 [Report] >>107081525
>>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...
Anonymous No.107078240 [Report]
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'!)
Anonymous No.107078757 [Report]
can we fast forward to the next schizo?
Anonymous No.107079101 [Report]
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
Anonymous No.107079273 [Report] >>107079315 >>107079318 >>107082380
what's wrong with assuming long long is 64 bits wide?
Anonymous No.107079315 [Report] >>107079381
>>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.
Anonymous No.107079318 [Report] >>107079375 >>107079381
>>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
Anonymous No.107079363 [Report]
>>107060072 (OP)
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
Anonymous No.107079375 [Report]
>>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
Anonymous No.107079381 [Report] >>107082380
>>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
Anonymous No.107079504 [Report] >>107079586 >>107079826 >>107080598 >>107080689 >>107080934 >>107082036
>look up C++ gui library
>everyone recommends Qt
>it costs money
What can I use instead
Anonymous No.107079586 [Report]
>>107079504
>Qt
>it costs money
what the hell, I didn't know that
Anonymous No.107079663 [Report]
>"just do RAII bro"
>create() in ctor
>release() in dtor
>release() can fail with an error
>can't throw in dtor
heh
Anonymous No.107079826 [Report] >>107079853
>>107079504
isn't it LGPL now?
Anonymous No.107079853 [Report]
>>107079826 (me)
apparently not all of Qt is under LGPL. welp, use GTK then.
Anonymous No.107080598 [Report] >>107082036
>>107079504
make your own gui toolkit
Anonymous No.107080689 [Report] >>107082308
>>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).
Anonymous No.107080900 [Report] >>107081680
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?
Anonymous No.107080934 [Report]
>>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.
Anonymous No.107080995 [Report]
>>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.
Anonymous No.107081007 [Report]
>>107060824
it werks. everything else doesn't for many of my usecases, sadly.
Anonymous No.107081021 [Report]
>>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.
Anonymous No.107081362 [Report] >>107081374
>>107075860
doing this with QML with python backend
Anonymous No.107081374 [Report]
>>107081362
ok didn't realize the picture had something nsfw lol
Anonymous No.107081525 [Report]
>>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?
Anonymous No.107081563 [Report] >>107081607
Any recommended read about category theory for programmers?
Anonymous No.107081607 [Report] >>107081647
>>107081563
learn haskell if you haven't already
Anonymous No.107081647 [Report]
>>107081607
Alright
Anonymous No.107081680 [Report] >>107082146 >>107084320
>>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}
};
Anonymous No.107082036 [Report]
>>107079504
This >>107080598 but don't use c++
Anonymous No.107082146 [Report]
>>107081680
Thanks.
Anonymous No.107082308 [Report]
>>107080689
>It's an immediate mode GUI library
No thanks
Anonymous No.107082380 [Report]
>>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
Anonymous No.107082431 [Report]
>>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);
};
Anonymous No.107082459 [Report]
>>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"
Anonymous No.107082478 [Report]
Test
Anonymous No.107082649 [Report] >>107082682 >>107084848
>>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);
}
}
Anonymous No.107082682 [Report] >>107083173
>>107082649
>OOP in general is on it's way out as a paradigm
lol
lmao
Anonymous No.107082701 [Report]
>>107076830
https://en.wikipedia.org/wiki/Decorator_pattern
Anonymous No.107083152 [Report]
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?
Anonymous No.107083173 [Report] >>107083528
>>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.
Anonymous No.107083528 [Report]
>>107083173
>C++
that abomination belongs to no paradigm, yet alone defines any paradigm
Anonymous No.107083968 [Report]
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?
Anonymous No.107084105 [Report] >>107084210 >>107084300
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".
Anonymous No.107084210 [Report]
>>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
Anonymous No.107084300 [Report]
>>107084105
Just get an LLM to tutor you.
Anonymous No.107084320 [Report]
>>107081680
>--param=VALUE
hateful shit
Anonymous No.107084848 [Report]
>>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.
Anonymous No.107084879 [Report] >>107084950
If your code is always improving you're probably polishing a turd.
Anonymous No.107084950 [Report]
>>107084879
>NOOOOO you can't get better, ok?
Anonymous No.107085008 [Report] >>107085021 >>107086499 >>107086779
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 ?
Anonymous No.107085021 [Report]
>>107085008
Don't use OOP. Keep everything in one giant function.
Anonymous No.107085124 [Report]
peer 2 peer is a pain the ass :(
Anonymous No.107085230 [Report] >>107085559
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.
Anonymous No.107085308 [Report] >>107085781
>>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
Anonymous No.107085559 [Report] >>107086205
>>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.
Anonymous No.107085781 [Report]
>>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
Anonymous No.107085918 [Report] >>107085958
>>107085782
Anonymous No.107085958 [Report]
>>107085918
zig sisters...
Anonymous No.107086205 [Report]
>>107085559
Right?
>bro just do valgrind but static lol
Anonymous No.107086499 [Report] >>107087085
>>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
Anonymous No.107086779 [Report] >>107086898 >>107087139
>>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
Anonymous No.107086898 [Report] >>107087017 >>107087085
>>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
Anonymous No.107087017 [Report]
>>107086898
Cool
Anonymous No.107087085 [Report] >>107087165
>>107086499
>>107086898
Are you advocating for purely software rasterization in compute shaders? You can't make real stuff with that.
Anonymous No.107087139 [Report] >>107087259
>>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.
Anonymous No.107087165 [Report] >>107087302
>>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
Anonymous No.107087259 [Report]
>>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.
Anonymous No.107087302 [Report]
>>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.
Anonymous No.107087554 [Report]
>>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.
Anonymous No.107088317 [Report]
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?