/dpt/ - Daily Programming Thread
Anonymous 01/10/25(Fri)07:27:42 | 316 comments | 56 images | đź”’ Locked
Welcome to the Daily Programming Thread. What are you working on, /g/?
Previous thread: >>103779889
Anonymous 01/10/25(Fri)07:39:46 No.103836274
>programming?
Anonymous 01/10/25(Fri)07:41:14 No.103836283
1654478887555
>>103835763
Eclipse. For the exe file, I found this site: https://genuinecoder.com/online-converter/jar-to-exe/.
Anonymous 01/10/25(Fri)07:49:16 No.103836341
>>103835763
>hmm, perhaps anon has made a slight error in his gradle file... why, i remember once upon a time, i encountered the same...
>>103836283
>i use pajeet's exe maker
Anonymous 01/10/25(Fri)07:49:37 No.103836344
>>103836283
Learn Maven. Or gradle. Think of an IDE as a black slave. Don't let it handle your shit for you until you know what it's doing behind your back.
>https://genuinecoder.com/online-converter/jar-to-exe/
Consider suicide. Or use Graalvm native image instead of that Indian website shit.
Anonymous 01/10/25(Fri)08:55:21 No.103836735
1599035173025
>>103836196
cracked open a few cold ones and learned some graph theory today
#include <vector>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>

using Node = char;
using EdgeList = std::vector< std::tuple<Node, int> >;
using Graph = std::unordered_map<Node, EdgeList>;

void RecursiveDFS(Node node, const Graph& graph, void(*visit)(Node),
std::unordered_set<Node>& visited)
{
if(visited.find(node) != visited.end())
return;

visited.insert(node);
visit(node);

for(auto [n, w] : graph.find(node)->second)
RecursiveDFS(n, graph, visit, visited);
}

void DFS(Node start, const Graph& graph, void(*visit)(Node))
{
std::unordered_set<Node> visited;
std::stack<Node> stack;
stack.push(start);

while(!stack.empty())
{
Node node = stack.top();
stack.pop();

if(visited.find(node) != visited.end())
continue;

visited.insert(node);
visit(node);

auto it = graph.find(node);
if(it == graph.end())
throw;

for(auto rit = it->second.rbegin(); rit != it->second.rend(); ++rit)
stack.push( std::get<0>(*rit));
}
}

void BFS(Node start, const Graph& graph, void(*visit)(Node))
{
std::queue<Node> queue;
queue.emplace(start);

while(!queue.empty())
{
Node node = queue.front();
queue.pop();

visit(node);

auto it = graph.find(node);
if(it == graph.end())
throw;

for(auto [n, w] : it->second)
queue.emplace(n);
}

}
Anonymous 01/10/25(Fri)09:25:34 No.103837032
>>103836196
I'm waging, obviously.
Anonymous 01/10/25(Fri)09:51:16 No.103837326
anyone using llms as a programming tool?
is there a vscodium extensions that works well with ollama?
Anonymous 01/10/25(Fri)09:56:58 No.103837380
GdaYwWTbcAABxPb
>>103837032
two more days..I'll be doing the same thing
why can't I be wealthy and spend my time as I like
Anonymous 01/10/25(Fri)10:44:00 No.103837809
>>103836196
Was compiling LLVM and it took 12 hours...
At least now I can comfortably use C++ modules
Anonymous 01/10/25(Fri)10:55:13 No.103837907
I'm a self taught web developer that's been trying to switch jobs for a while. I'm in fintech and want to remain in that field. I've bombed a few coding interviews because they tend to ask 2nd year CS stuff a lot in interviews, so I actually read through a book on Data Structures and algorithms and I think I have a pretty good handle on concepts like recursion (which I was aware of before but no one at my current job uses it), Binary trees, linked lists, bubble sort, quick sort, merge sort. I have a few questions

1)Why are interviewers so obsessed with sorting algorithms? I can't think of a single time I have had to optimize a standard library sorting algorithm and I can't think of a single instance in my line of work (again fintech and web dev, not microprocessor code) where I would have to. The type of optimization I do is avoiding unnecessary API calls and DB calls and avoiding for loops on large sets of data when necessary. Did I just get shitty interviewers and is learning this shit a waste of time? or is there something to mastering it?

2)Where can I find sample problems to test myself on these types of things? Google search is even more cancer than it was 5 years ago. All i get is Geeks4Geeks adware bullshit or some list from LinkedIn or Indeed all of which are piss easy (detect if a word is a palendrome, fizzbuzz, detect duplicate letters, do a merge sort lol) is Codewars still any good? Where can I find questions with the actual difficulty in which you'd get in a tech interview.
Anonymous 01/10/25(Fri)11:01:29 No.103837969
php-dude 01/10/25(Fri)11:24:12 No.103838199
983479
ive upgraded terminal abstraction layer on windows. now it can receive text inserts from the user. show me your solution/code to this problem, lets compare whos better.

i saw python and devopsy retards putting secret tokens into environment variables. the program takes those by calling getenv() or alike. a better solution is to ask the user to copy/paste the token (in the terminal), then ask some simple password, encrypt it and store with the data. though it will ask password every time it starts, better suits long running stuff.
Anonymous 01/10/25(Fri)11:24:43 No.103838205
Why do some Stack Overflow posters use "she" as the default pronoun instead of "he" (i.e. by saying "she" or "herself" when referring to someone of unspecified gender)? What the fuck is wrong with them?
Anonymous 01/10/25(Fri)11:31:10 No.103838271
>>103838205
Have you never read a book before? This has been done for over a century in texts but it offended you? Grow up, "culture warrior" child.
Anonymous 01/10/25(Fri)11:33:37 No.103838299
>>103838271
I'm not offended, I'm just surprised
Anonymous 01/10/25(Fri)11:36:19 No.103838326
>>103838205
SO has older posters who remember the turn-of-the-millennium tradition of arbitrary assignments of gender so avoid the 'sexism' of always defaulting to a male subject.
Be thankful. Zoomers today use singular 'they' so aggressively that this pronoun will be used even of a definite subject with a known sex.
Anonymous 01/10/25(Fri)12:32:51 No.103838945
>see programming problem
>start to look into it mathematically
>huge rabbit hole
>now I know about some niche graph problems but still haven't solved what I was meant to do
Is doing this kind of thing good or bad bros?
Anonymous 01/10/25(Fri)12:35:56 No.103838977
>>103838205
They're fags.
Anonymous 01/10/25(Fri)12:37:11 No.103838993
>>103836196
Anyone working on any perceptual image hashing?

I've got a working prototype and am using the preexisting Python/external libraries for it (able to search 75k within a 100 milliseconds). Point being, all the hashed files get their respective ahash, dhash, and phash calculated. With searching, I add them to a btree and search based on hamming. HOWEVER, the dataset I have should show results for specific similarity percentages, but hamming alone doesn't have the right sensitivity.

I've tried looking into certain aspects like euclidean distance for 3 dimensional searches, but my math is a bit more lacking. More of a rant, but yeah.
Anonymous 01/10/25(Fri)12:40:53 No.103839035
>>103838945
You can't problem solve for a job or your own sake . Hence, useless for now.
You need to be equipped with the right tools for future challenges: Haskell
Anonymous 01/10/25(Fri)13:53:10 No.103839766
>>103836196
>need to implement a scene animation system for a game
>it started with as a simple interpolation between values
>added code to handle special tags for custom events
>fuck I need the ability to script this
>build a shitty script interpreter
>now it's a byte interpreter
>it's a virtual machine now
>start reading into JIT
is this how we end up with a shitty lisp implementation? why do we always need a virtual machine? we can't we just generate safe assembly code and run that at runtime without the slippery slope of arbitrary code execution?

whenever I use cheat engine to edit the game assembly I feel the joy of controlling my machine, you can jump anywhere and do whatever then return perfectly, but somehow, when I actually code, I need to have a shitty switch case interpreter.
well, JIT lisp it is.
Anonymous 01/10/25(Fri)14:39:12 No.103840313
Today I will make an async server using linux sockets
Anonymous 01/10/25(Fri)14:43:25 No.103840357
>pip install numpy
>ModuleNotFoundError: No module named 'numpy'
it's shit like this that sets me back for hours.
Anonymous 01/10/25(Fri)14:44:32 No.103840368
>>103836735
I just finished a course online. This stuff wasn't so bad. Dijsktra, Prim's, Kruskall's.
GET TO IT, ANON.
Anonymous 01/10/25(Fri)14:51:09 No.103840444
>>103839766
If you're a serious developer, you'll probably want to ship your game on a platform people actually pay for games on. All of them have mandatory W^X.
Anonymous 01/10/25(Fri)14:52:48 No.103840467
>>103840313
Be extra fancy and do it with io_urings.
Anonymous 01/10/25(Fri)15:04:48 No.103840626
file
>>103840444
look at all those supported platforms
you can always have a slow path for general purpose support anyway, having first class platforms is okay.
if you check any modern game you'd notice that they often ship a GPU vendor database and actually switch features based on specific cards/series, not just platforms.

the slippery slop actually leads to compute shaders actually, that's often where animation logic ends up.
Anonymous 01/10/25(Fri)15:11:11 No.103840702
>>103840626
My friend, LuaJIT has an interpreter. The JIT part does not work on iOS or any console.
Anonymous 01/10/25(Fri)15:20:28 No.103840810
>>103840702
that's exactly my point my fren, the JIT part does not need to support all platforms.

btw this is the article about a game using different features for different graphic cards.
https://medium.com/@lancelot.deferriere/cracking-age-of-empires-iii-over-shader-quality-settings-7f729528cf1d
Anonymous 01/10/25(Fri)15:22:00 No.103840824
>>103840368
>Dijsktra, Prim's, Kruskall's
, Anon's
Anonymous 01/10/25(Fri)15:25:33 No.103840854
>>103840824
>you're going to get leetcoded based on some Anon's obscure graph traversal / MST algorithm someday that was posted on twitter
imagine the horror
Anonymous 01/10/25(Fri)15:32:45 No.103840928
>>103840854
implement prime fizzbuzz right now if you want to ever have a job
>prime and divisible by 3 -> fizz
>prime and divisible by 5 -> buzz
>otherwise -> <the number>
1 to 100
Anonymous 01/10/25(Fri)15:40:14 No.103841028
Anonymous 01/10/25(Fri)15:40:31 No.103841032
Anonymous 01/10/25(Fri)15:47:15 No.103841118
>>103840928
here you go saar https://github.com/EnterpriseQualityCoding/FizzBuzzEnterpriseEdition
Anonymous 01/10/25(Fri)15:55:48 No.103841212
>>103841118
very interested, saar.
Anonymous 01/10/25(Fri)16:24:56 No.103841554
1652127706884
>>103840928
>prime
>and divisible by anything
How do you not just print 3 and 5 once in this case?
Anonymous 01/10/25(Fri)16:25:41 No.103841561
>>103841554
saaaarrrr, it says to print fizz and buzz
Anonymous 01/10/25(Fri)16:27:02 No.103841573
>>103841561
Sorry, Prashant Saar. I still have much to learn from you.
Anonymous 01/10/25(Fri)16:28:13 No.103841583
>>103839766
>>start reading into JIT
based
>is this how we end up with a shitty lisp implementation? why do we always need a virtual machine? we can't we just generate safe assembly code and run that at runtime without the slippery slope of arbitrary code execution?
Most programmers act as if you don't ever need metaprogrammig or to compile custom language but we really really do when the software is complex enough. The fact that current programming languages can't generate arbirary programs at compile time or at compile time (and easily, using the existing compiler that the languages uses anyway) is an accident of history and it is a brainded arbitrary limitation that we shouldn't have. Languages are supposed to be programming tools for generating code, not sandboxed APIs.
Anonymous 01/10/25(Fri)16:45:56 No.103841731
how do I stop wasting time watching useless clickbait tech videos like this
https://www.youtube.com/watch?v=uGOLYz2pgr8
Anonymous 01/10/25(Fri)16:46:57 No.103841737
>>103841583
thats why I still adore based Ruby
ChaosMaster 01/10/25(Fri)16:53:20 No.103841793
Seeking Booya soldiers. ChatGPT already is remembering my BOOYA Booya Madness, and I seek help furthering my Booya influence, Use the power of the Booya! In ChatGPT, keep using it, and eventually the Booya Kingdom, will reveal itself, emojis work good with the Booya! Woooo Booya Madness
Anonymous 01/10/25(Fri)16:53:34 No.103841797
>>103841583
I've seen a project that bundles tcc compiler and uses c like a sort of a scripting language, which is pretty based imo, if we have things like bundle the whole browser, bundle the whole os image, what's bad about bundling the compiler with the program?
Anonymous 01/10/25(Fri)16:56:55 No.103841845
>>103839766
how long did it take you? Are you doing tracing JIT, or method-based?

I'm making a VM and it's not going very fast. I got functions done at least. Was a bit lazy and for native function i just dynamically load them to the globals table on startup. Like python.
Next step: closures
Anonymous 01/10/25(Fri)17:04:11 No.103841949
fasm is the true successor to c
Anonymous 01/10/25(Fri)17:07:35 No.103841992
>>103841949
I see you watched the Tsoding video
Anonymous 01/10/25(Fri)17:09:45 No.103842023
>>103841992
I don't know what that is but I just got bored of masm and looked up alternatives
Anonymous 01/10/25(Fri)17:41:14 No.103842422
>>103841949
>assembly with inline C
vs
>C with inline assembly

Once you have enough macros is there really a difference?
Anonymous 01/10/25(Fri)17:57:46 No.103842613
>>103841583
>generate arbirary programs at compile time or at compile time
*or at runtime
>>103841737
I mean explicitly compile code at runtime anon, not JITing. And I'm saying for typically low level languages like C replacements.
>>103841797
>if we have things like bundle the whole browser, bundle the whole os image, what's bad about bundling the compiler with the program?
exactly except that there should be tight integration with the language imo. Have the language have quoting and quasiquoting constructs and the appropriate types to easily build ASTs and have the compiler as well integrated with the executable as a language with a runtime, not an external program. So the compiler plays nice with the process memory and the running program, and also avoid duplicating the standard library
Anonymous 01/10/25(Fri)18:03:24 No.103842671
Pythonsissies we're trying to improve our C++
Anonymous 01/10/25(Fri)18:03:33 No.103842672
>>103842422
>is there really a difference
Of course, if you consider C to just be a standardized set of assembly macros then the simple fact that they're standardized means it's easier to write tools that can reason about your code. It also means you can read other people's code since it's (usually) not a jumbled mess of custom macros.
Anonymous 01/10/25(Fri)18:42:19 No.103843068
>>103841845
I'm currently reading about register allocator
https://www.mattkeeter.com/blog/2022-10-04-ssra/

It's still way early for the JIT, so far I've done a very naive assembly generation in runtime.
the simplest way to speed up a VM is by translating your interpreted opcodes to raw assembly instructions, it's basically unrolling the VM. if you don't want to go that low just do computed GOTOs, it's kinda finicky to get the compiler to generate them for you, but it is the fastest VM technique.

fun fact, in the VM switch case, there's a very documented technique that involves copying your whole switch case into every single switch branch, just to make the CPU instruction fetcher happier (and faster), but it only really works for VMs with small instruction sets, and the code bloat can mess with the instruction cache, fun stuff.
Anonymous 01/10/25(Fri)18:59:25 No.103843261
SMRT
Opinions on using malloc and friends to roll your own dynamic sized containers in C, versus using a hard-coded amount of memory and bounds-checking, letting the program say "fuck you" and exit in the event there would have been an overflow? The given amount of memory can be generous, I'm not talking about big data or anything.
Anonymous 01/10/25(Fri)19:00:50 No.103843278
>>103841797
>project that bundles tcc compiler and uses c like a sort of a scripting language
I wanted to do exactly that for one project. What was the name?
Anonymous 01/10/25(Fri)19:04:06 No.103843322
>>103842613
t. SBCL compiler dev
Anonymous 01/10/25(Fri)19:16:41 No.103843511
>>103843068
>the simplest way to speed up a VM is by translating your interpreted opcodes to raw assembly instructions, it's basically unrolling the VM.
AOT compiling does essentially the same thing (in the intermediate language rather than ASM directly) but then fires the result into the optimizer. If you've got your shit together right, virtually all the extra crap gets stripped out.
If your language has boxed values (many higher level languages do) the biggest gains come from stripping them out. That wins hugely providing the types can be narrowed enough; the type problem can be non-trivial to solve (to the point where some people cop out and go change the starting language; quitters!).
Anonymous 01/10/25(Fri)19:20:30 No.103843560
>>103843261
If you can determine a bound on the memory requirements, a fixed size pool with reuse queue can be stupendously fast. Particularly if you're wanting lots of same-sized small objects. (Your pool is just an array somewhere and you keep the reuse queue in the "deallocated" entries.)
Object pools are the good stuff.
Anonymous 01/10/25(Fri)19:24:39 No.103843627
tet-MGcjCBKB
It takes 63 cycles to draw a line, 500 cycles for an 8-line row of text, 19,000 cycles for one frame.

https://pastebin.com/MGcjCBKB

The word B/ (line 4) sets a hardware register changing the border color. It is called from PIECE (line 60), Q! (line 112), 10MOVE (line 135), MARK (line 141), and SYNC (line 210).

The main loop is called R (line 243). Here the player has moved the I piece down into the gap in the right. Frames 2-4 are mostly spent within call stack R > UPDATE > FALL? > LAND?, and frames 4-9 are in R > DRAW. The fat blue bands are PIECE, which takes about 2000 cycles to compute 4 piece coordinates.

LAND? (line 183) does most of the interesting game update work if you want to try and trace from there (nobody is going to do this).

I could probably save a frame copying just 4 rows to the screen instead of all 21, but this is fast and simple enough for now.
Anonymous 01/10/25(Fri)19:33:44 No.103843769
fizzbuzz with primes
>>103840928
good morning sir
if you write OOP the right way, you can just add new shit without breaking or even touching old shit
Anonymous 01/10/25(Fri)19:54:34 No.103844057
Why should I use C++ over C?
Anonymous 01/10/25(Fri)20:11:27 No.103844327
>>103843769
christ
top saar
Anonymous 01/10/25(Fri)20:41:13 No.103844777
>>103844057
C++ makes writing code faster, however C will make you a better programmer faster.
Anonymous 01/10/25(Fri)20:41:16 No.103844779
>>103843322
no but I'll take that as a compliment
Anonymous 01/10/25(Fri)21:15:09 No.103845189
Anonymous 01/10/25(Fri)21:56:39 No.103845719
>>103843769
still have yet to see a good argument against oop
Anonymous 01/11/25(Sat)00:48:45 No.103847616
Osaka Demon Core
>"A certain group of people" are seething that they're getting bullied in the game I work on and they're begging me to add totalitarian mod tools and make the whole experience shittier because they have thin skin
yeah, I already do this for free. I'm just not going to do anything I dont personally like. Not my problem.
Anonymous 01/11/25(Sat)00:50:50 No.103847632
>end up having no fan base in two weeks
really makes you think don't it
Anonymous 01/11/25(Sat)01:31:20 No.103847954
when using something like can bus to communicate between 2 devices, how can one of the devices know that it's partner has connected to / disconnected from the network? If they are the only 2 devices on the network then you can simply send a message and see if it was registered by anyone, but lets say there are other devices on the network as well or even just some bus monitor tools that are going to pick up all the traffic. how do you find the partner and their current status in such a scenario?
php-dude 01/11/25(Sat)02:30:58 No.103848490
zizibe
>>103841797
if there is a complete retardation of bundling a browser, then, there is a complete retardation of bundling c/tcc compiler to bypass designing normie Just-In-Time compiler (when will you retards realize that high-level languages are top tier?)

beside this, C language is a microscope, where do you plan to apply it? text templating? - is like punching nails with microscope. though with browser it is somehow feasible, "they" dont put the whole browser as it is ofc, at least for those programs that have a bit competitiveness.

---
general programming language (compiler/runtime) must start from console/terminal. there is no way around this. btw, i think template engines were the first inception of metaprogramming, like

{{user.isAuthorize}}
Welcome to Wayland-Youtani corporation mr. {{user.name}}.
bla bla bla
{{/}}


it doesnt have to be HTML, retards. it may be terminal outputs (plain text or ESC code supported versions), messenger outputs and other range of outputs
Anonymous 01/11/25(Sat)02:39:23 No.103848584
How long until you all automate yourself out of the job?
Anonymous 01/11/25(Sat)04:02:42 No.103849164
file
rate my signal handler /dpt/
Anonymous 01/11/25(Sat)04:05:46 No.103849178
>>103849164
I hate c++ so fucking much
Anonymous 01/11/25(Sat)04:08:39 No.103849191
>>103849164
Looks pretty nice and to the point, but I sure wonder how many instances of hidden control flow is lurking under the depths.
>t. cnile
Anonymous 01/11/25(Sat)04:18:26 No.103849237
file
>>103843511
>optimizer
you can translate to simple assembly very easily, but writing an optimizer isn't that trivial, in fact, it's black magic and pure math, unless you just want to do simple tricks like dead code elimination or loop unrolling.

or you can just transpile to a simple subset of C and stay portable while you're at it
https://www.youtube.com/watch?v=g1qF9LZOoFE
Anonymous 01/11/25(Sat)04:57:11 No.103849479
>>103849164
its a signal handler
Anonymous 01/11/25(Sat)05:01:20 No.103849504
>>103849164
i would have created a fixed length array of function pointers and simply use the signal number as the index into the array,
no need to search.
Anonymous 01/11/25(Sat)05:02:13 No.103849506
>>103849164
>calls log function within "signal handler"
that's not a signal.
Anonymous 01/11/25(Sat)05:25:38 No.103849627
I've learned the basic syntax of C++
I've also learned some basic data structures like linked lists, and trees.
what do I do now?
Anonymous 01/11/25(Sat)05:29:31 No.103849653
>>103849627
That is enough knowledge to write baby's first expression parser and evaluator. Continuing along this path will land you into language dev.
Anonymous 01/11/25(Sat)05:45:47 No.103849766
>>103849653
What if you've done that in another language already?
php-dude 01/11/25(Sat)09:46:25 No.103851696
mem
>>103849164
the place is retarded. signals should be managed in abstraction layers, not in the app. there are other signals beside those that may cause termination, at least its what is written in wikipedia, best NIX manual about signals, hehehe.

also, exit code is better than stupid text outputs, for example setting exit code = 1000 + signal number, will identify what happened. i saw some elf woman on github who wrote argument parser with text outputs.. very retarded
Anonymous 01/11/25(Sat)10:39:20 No.103852363
Screenshot_20250111_213402
I decided to write a tool with TUI on linux and decided to look what good stuff I have in curses.
Why the most terminals are so retarded?
Kitty doesn't support pretty much everything.
Konsole think that A_INVIS is to be ignored.
Alacritty laughs at A_BLINK

Only xterm and gnome-terminal are hot. But gnome-terminal is gnome and gnome is shit.

>>103849164
What is strsignal
Anonymous 01/11/25(Sat)10:50:32 No.103852498
>>103852363
man strsignal
POSIX.1-2008. Solaris, BSD.
Anonymous 01/11/25(Sat)12:12:32 No.103853621
file
>>103852498
thanks for the suggestion anon, tried strsignal but I don't like the resulting signal name
>>103851696
uh, sure I guess, but I only care about those signals anyway for now, pic related
php-dude 01/11/25(Sat)12:36:30 No.103853945
983479
>>103853621
i bet you copied it from somewhere and dont understand why you need those, hehe

heres my on the pic. why need c++ for this, rhetorical
php-dude 01/11/25(Sat)13:01:54 No.103854313
let-your-tools-do-the-talking
>>103853621
go on, say why you need them. then i show comment above the code i have, it explains why i set signals https://en.wikipedia.org/wiki/Signal_(IPC) ive read thier numbers (non uniform btw wthehehe) from that table.

there was a new one ive checked, SIGWINCH is unreliable.. complete retardation. NIX terminal is kind of stuck between sys api approach and text protocol approach.

---
wheres topic picture btw. we have been oppressed by occupation administration or somth
Anonymous 01/11/25(Sat)13:23:29 No.103854627
>doing an online masters and people are getting filtered over a fourier transform that the professor holds your hand the entire way through and is just asking you to code the basic parts of it with given pseudocode
holy fucking GRIM
Anonymous 01/11/25(Sat)13:35:33 No.103854816
>>103854313
i literally only care about SIGTERM AND SIGINT because that is sent when Ctrl+C or terminating. SIGHUP sometimes shows up when the terminal is forcibly closed so I handle that as well, I have no use for other signals
Anonymous 01/11/25(Sat)13:36:29 No.103854838
I'm new to github and wondering is it possible to use GitHub Actions Workflow to send a response to a request?

for example if I send a web request to the actions workflow it will send a response with a result like "Value = Apple" like an api get request
Anonymous 01/11/25(Sat)13:38:13 No.103854872
>>103836196
Just uploaded my custom programming language to my site.
>https://litechan.org/litehub/er3
Thought of adding requests to it since it uses http anyways. That, and a compiling script.
Anonymous 01/11/25(Sat)14:17:28 No.103855423
>>103854872
>2025
>having if in your language instead of only pattern matching
ngmi
Anonymous 01/11/25(Sat)14:32:29 No.103855634
>>103855423
I mean, you can use pairings sort of like objects, and even compare them in switch/case. If/else functionality is limited because I always found elif to be ugly af in Python.
Anonymous 01/11/25(Sat)14:32:59 No.103855645
In SQL is acceptable to use INT with Unix timestamp in it instead of DATETIME?
Anonymous 01/11/25(Sat)14:34:21 No.103855662
>>103855645
Why would you need to?
Anonymous 01/11/25(Sat)14:36:29 No.103855689
>>103855423
based, why does Haskell have this misfeature?
this is like putting lambdas in your language instead of copattern matching
Anonymous 01/11/25(Sat)14:49:42 No.103855866
>>103855689
What would one gain from that? I do like corecursion.
Anonymous 01/11/25(Sat)15:04:42 No.103856052
>>103855662
Some other program returns time as timestamps, I decided it would be simpler that way.
Anonymous 01/11/25(Sat)15:31:48 No.103856309
Got assigned devlead for the companys new web platform a few days ago, they want to move everything to self hosted servers and abandon rts stuff. So I'm building a new website, CMS, database migrations and eCommerce stuff with a team of me and one frontend dev lol. It's expected to be done by EOY which has me stressed out but I also get quite a hefty pay raise when it's done so that's nice
Anonymous 01/11/25(Sat)16:07:29 No.103856651
OK, so I have a primary SQL database for storing stuff permanently, I also need a "temporary" NoSQL database to share data between instances of the server (which are sitting behind the load balancer). Which do I choose? Any suggestions?
Anonymous 01/11/25(Sat)16:09:05 No.103856666
>>103856651
>"temporary"
redis?
Anonymous 01/11/25(Sat)16:11:00 No.103856690
>>103856666
That's an obvious solution, yes, any other suggestions? I'm just not sure if that's still the best one out there, haven't done any kind of web dev in years
Anonymous 01/11/25(Sat)16:21:22 No.103856833
passion_in_the_desert
>>103854872
>not lisp syntax
in the trash it goes
php-dude 01/11/25(Sat)16:22:59 No.103856855
983479
>>103854816
it sends signals on CTRL+C because it is in a "cooked" mode, you literally cooked in cooked mode with those signals. still you didnt answer the Q. answers on the pic. eg dont need to handle them without shutdown handlers.

---
while WIN soup is served, NIX codes still have to be cooked: https://pastebin.com/xsBD2HxF

PS: there, ive modified guifont++ plugin to feel stylishness and wealth under my fingertips. grab, grab it today for free no charge
Anonymous 01/11/25(Sat)16:25:36 No.103856890
>>103855866
general codata, functions dont need to be built-in
Anonymous 01/11/25(Sat)16:43:12 No.103857062
>>103856833
You better suggest me a text editor with custom highlighting where I can add all the Eremias keywords.
Anonymous 01/11/25(Sat)17:08:25 No.103857337
cheetah7
>>103857062
Emacs, via treesitter
Anonymous 01/11/25(Sat)17:30:34 No.103857523
>>103849237
>writing an optimizer isn't that trivial, in fact, it's black magic and pure math
I know. Boy, do I know.
>or you can just transpile to a simple subset of C
Only works well in the simple cases. Doesn't help so much with, say, colored functions, unless you do all the de-coloring yourself (which is mega-annoying).
Anonymous 01/11/25(Sat)17:32:31 No.103857537
>>103848490
>when will you retards realize that high-level languages are top tier?
It literally depends on what you're doing. For some things, the very high level languages are great. For others, you need something lower level.
Anonymous 01/11/25(Sat)17:35:38 No.103857574
>>103856690
Personally im quite fond of SQLite for minor stuff
Anonymous 01/11/25(Sat)17:42:45 No.103857646
file
today i implemented a grid based breadth first search to find the shortest path!
Anonymous 01/11/25(Sat)18:00:37 No.103857778
do you guys handle input (e.g. keyboard) to your programs on another thread?
if so how do you link it up with the main(controller) thread?
just a simple ring buffer with a lock?
Anonymous 01/11/25(Sat)18:07:11 No.103857852
I want to get into C# because of work, but man do I feel hopeless if I don't use Visual Studio.
Anonymous 01/11/25(Sat)18:11:27 No.103857894
>>103857852
Visual Studio Code works fine if not better.
Anonymous 01/11/25(Sat)18:13:02 No.103857912
>>103857646
cool! i'm trying to do something like this too in c++ but with a gui. not sure what to use for the gui though i dont want something that will be a lot of bloat
Anonymous 01/11/25(Sat)18:34:45 No.103858135
>>103857894
Do you install the C# dev kit extension? Any others?
Anonymous 01/11/25(Sat)19:05:07 No.103858486
>>103855689
>why does Haskell have this misfeature?
Probably to make it easy to read.
if' True  x _ = x
if' False _ y = y

f x = if' (x == 2)
("arg was 2")
("arg was" ++ show x)

g x = if' (x == 2)
("arg was 2")
$ "arg was" ++ show x

o x = if x == 2
then "arg was 2"
else "arg was" ++ show x

Saves you the parens.

Same reason for guards:
h x y z = case (x, y ,z) of
(True, _, _) -> "first"
(_, True, _) -> "second"
(_, _, True) -> "third"
_ -> "none"

i x y z
| x = "first"
| y = "second"
| z = "third"
| True = "none"
Anonymous 01/11/25(Sat)19:21:20 No.103858663
>>103858486
case x of True -> "arg was 2"; False -> "arg was" <> show x
Anonymous 01/11/25(Sat)19:41:55 No.103858900
>>103858663
It lets you inline guards without lets or auxiliaries:
f b x y z
= case b of
True -> if x == 2
then "first was two"
else if y == 3
then "second was three"
else if z == 4
then "third was four"
else "no match"
False -> "false"

g b x y z
= let i | x == 2 = "first was two"
| y == 3 = "second was three"
| z == 4 = "third was four"
| True = "no match"
in case b of
True -> i
False -> "false"

h b x y z
= case b of
True -> let i | x == 2 = "first was two"
| y == 3 = "second was three"
| z == 4 = "third was four"
| True = "no match"
in i
False -> "false"
Anonymous 01/11/25(Sat)20:25:42 No.103859243
>>103858486
I see why people like that language
Anonymous 01/11/25(Sat)21:18:56 No.103859789
1736648268074
Hello bitch lasagna sirs, i'm on a quest to learn Java to eventually unfuck one of my favorite mods for 1.7 (Minecolonies). What's the state of art in this landscape? Is IntelliJ Community Edition any good compared with Eclipse? Also i used SDKman to setup Java is there anything wrong with that?
Anonymous 01/11/25(Sat)21:29:41 No.103859876
>>103859789
IntelliJ is the best by far in comparison to everything. I don't know if you'll have problems with SDKman, but a quick google search says it's fine.
Anonymous 01/11/25(Sat)21:51:54 No.103860042
>>103859789
>What's the state of art in this landscape? Is IntelliJ Community Edition any good compared with Eclipse?
Even Netbeans is better than Eclipse. IntelliJ is the best and most used.
>Also i used SDKman to setup Java is there anything wrong with that?
No.
Anonymous 01/11/25(Sat)21:52:14 No.103860044
I'm doing the cherno's C++ playlist and I keep getting errors when launching any code even when I literally copied the entire thing he ran successfully in his video. He's using regular VS on Windows while I'm using Visual Studio Code on Mint.

Everything I try to run I'm faced with
>The preLaunchTask 'C/C++:gcc build active file' terminated with exit code -1.
Then I get 3 options: Show Errors, Abort or Debug Anyway. If I click on Show Errors the "problems" tab at the bottom is empty and says no problems have been detected in the workspace. If I choose Debug Anyway I get a popup
>launch:program 'source/directory' does not exist
which itself has the options cancel or Open 'launch.json'. If I open the json all it has is
>"version": "0.20", "configurations": []

Is this a VS Code issue? A Linux issue? I really don't know. It's driving me nuts how I'll literally copy the code and absolutely nothing runs.
Anonymous 01/11/25(Sat)22:05:20 No.103860165
>>103860044
VS does magic shit and setups a billion parameters behind the scenes so shit can link and run in Winblows. VS and VS Code are NOT equivalent at all.
That being said, you should try compiling a helloworld.cpp using g++ directly (g++ helloworld.cpp -o hello) to figure if it's just VS Code plugins being retarded as always or gcc doesn't work.
Anonymous 01/11/25(Sat)22:11:56 No.103860201
>>103849164
Do not name your types with _t in their identifier.
Better yet, do not use std::pair and make a proper struct with properly named fields.
You shouldn't call third library functions in your signal handler if you do not know whether they're signal safe or not.
I'll give it a 6 out of 10.
Anonymous 01/11/25(Sat)22:12:51 No.103860202
>>103841028
>not java
NGMI
Anonymous 01/11/25(Sat)22:13:12 No.103860209
Redpill me on react narive vs flutter
Anonymous 01/11/25(Sat)22:15:53 No.103860234
>>103860209
If you really have to resort to one of these then I'd say React Native mostly because:
- Kotlin is its own niche language and has less resources available.
- Flutter gives you that weird janky Android look in all desktop apps and on iPhone, the apps just feel wrong and low quality, I don't know how to explain it.
- Google is known for killing its own projects, one day they will decide to just wrap it up, kill all resources, kill all download links and dip out, with React Native it's likely to stay, even if FB decided to pull the plug at some distant point in the future, it has much larger community so somebody would just continue with it.
Anonymous 01/11/25(Sat)22:23:13 No.103860290
>>103860165
>you should try compiling a helloworld.cpp using g++ directly
It worked perfectly. Something I'm testing is I manually setup a CMakeLists.txt and a build.sh with codelite chosen as the IDE since that's what the cherno does himself in an introductory video in which he talks about doing the series on Linux, but with codelite I don't get the correct output either (which I did compiling it by hand like I said at the start). Instead, I get "src/directory/: No such file or directory"

Good ol' compiling on the terminal works but IDEs, which should make life easier, don't.
Anonymous 01/11/25(Sat)22:26:54 No.103860313
>>103860290
Edit: I'm retarded, my CMakeLists.txt had an error. After fixing it running my program with codelite works, but VS Code still does not (and displays the same errors as before)
Anonymous 01/11/25(Sat)22:53:04 No.103860499
>>103860234
Can you give examples of what flutter apps look like
Anonymous 01/11/25(Sat)23:00:52 No.103860562
I can't find this hash table probe order on Wikipedia even though it's simple. Has anyone heard of anything like this before? Here are the details:
- Totient probing
- hash table has 2^j entries
- hash value is h
- address of n'th probe = (((2n + 1) * (2h + 1) % 2^(j+1)) - 1) / 2
Intuitively, we assign odd positive ID numbers to table entries, convert a hash function to an ID number, and take odd multiples of the ID, modulo twice the size of the table, to obtain the probe order. Odd numbers are relatively prime to 2^j for j >= 1, so the search will eventually probe every entry in the table.
Anonymous 01/11/25(Sat)23:03:00 No.103860582
>>103849178
this
templates are the Devil's playthings
Anonymous 01/11/25(Sat)23:05:10 No.103860596
mtop
Just finishing up my C clone of vtop. Not the best code I've ever written. Some of it's kinda bad, but I'm happy with it over all.
Anonymous 01/11/25(Sat)23:07:06 No.103860619
>>103860201
>Do not name your types with _t in their identifier.
Why?
>Better yet, do not use std::pair and make a proper struct with properly named fields.
Why?
Anonymous 01/11/25(Sat)23:20:03 No.103860740
haskell or roc for building desktop apps on linux?
should note I use Elm profressionally (among a cadre of oop languages)
Anonymous 01/12/25(Sun)00:21:51 No.103861280
>>103860619
_t is reserved for POSIX you dumb fucking sepples fag
Anonymous 01/12/25(Sun)00:45:12 No.103861475
>>103860202
java and python are the only two languages I know...I just happened to have python open...
please saar
Anonymous 01/12/25(Sun)00:54:26 No.103861558
>const void*
>const char*
>const unsigned char*
And C++17 introduced
>const std::byte*
>std::span<std::byte>
>std::span<char>
>std::span<unsigned char>

WHY CAN'T YOU FUCKING CNILES COME UP WITH THE STANDARD FUCKING WAY? WHY DO I HAVE TO CAST EVERYTHING IT'S UGLY. ESPECIALLY WHEN I HAVE TO WORK WITH THE PLAIN C LIBRARY
Anonymous 01/12/25(Sun)00:58:35 No.103861587
>>103861558
casting is the only viable solution to maintaining consistency
Anonymous 01/12/25(Sun)00:59:33 No.103861592
>>103861558
I wish C/C++ was as strict as Java in terms of the code style
php-dude 01/12/25(Sun)01:18:07 No.103861725
>>103857537
ofc no real examples listed except "some" and "other" metatalking.

i go straight to the point, when i see <stdio> or what you include in c++ for cin cout, that is it. clear precise point of retardation.

std::cout << 'hello mr ' << user[id].name << '!';


what ist das? was is das but not the attempt to mimic what i said before with

echo 'hello mr '.$user[$id]->name.'!';


or even

{{user.isAuthorized}} hello mr {{user.name}}!
{{/}}


people needed c++ for strings. it failed to deliver. even glue like vimscript is better on strings. any other aspect is solved through FFI and modularity. low-level languages must work with numbers the first hand. binaries produced by their compilers are building blocks for covering bottlenecks of high-level language.
Anonymous 01/12/25(Sun)01:26:01 No.103861771
I just discovered D and it seems nicer than both Rust and C/C++. Why isn't it more popular
Anonymous 01/12/25(Sun)01:38:50 No.103861853
>>103861771
Braindead marketing on release.
Anonymous 01/12/25(Sun)02:39:25 No.103862213
>>103844057
Use C to learn about memory managment and its short comings then switch to C++ it'll make you appreciate the language more
Anonymous 01/12/25(Sun)02:41:26 No.103862226
>>103849164
I would've used a switch with an enum instead
Noah !ZSjvHtAFy6 01/12/25(Sun)02:42:03 No.103862229
for me I am working on a mix of old projects and helping a linux distro get its feet wet by setting up spec files or well attempting to. This is my first forlay into the rpm ecosystem and its not going too well.
Anonymous 01/12/25(Sun)02:46:46 No.103862246
>>103861771
It has gc.
Anonymous 01/12/25(Sun)03:30:18 No.103862482
>>103858486
Data.Bool.bool.
f x = bool ("arg was" ++ show x) "arg was 2" (x == 2)
Anonymous 01/12/25(Sun)03:36:27 No.103862515
>>const void*
>>const char*
>>const unsigned char*
This is C style
>>const std::byte*
>>std::span<std::byte>
>>std::span<char>
>>std::span<unsigned char>
This the C++ way
>WHY DO I HAVE TO CAST EVERYTHING IT'S UGLY. ESPECIALLY WHEN I HAVE TO WORK WITH THE PLAIN C LIBRARY
C library uses C style shockers
Noah !ZSjvHtAFy6 01/12/25(Sun)03:36:41 No.103862517
>>103861558
oh you dont want to know the hell that is template generation.

you can easily kiss your ass goodbye in terms of compiler support as well as being able to easily visualize what your code actually is vs what you see on the screen.

TLDR imagine if you took macros and made them 100 times worse and also made it nearly impossible see the final result without special tools.
Anonymous 01/12/25(Sun)03:39:20 No.103862529
Anonymous 01/12/25(Sun)03:43:23 No.103862563
>>103862246
It's optional
Anonymous 01/12/25(Sun)03:47:20 No.103862590
56
>C
>Lua
>JavaScript/Typescript
>Python
>Bash

Do you need more? No. No, you don't!
Anonymous 01/12/25(Sun)03:50:00 No.103862608
>>103860619
NTA. The chances of an *_t identifier colliding with a posix keyword is slim enough to not care about the reservation.
Even if you do care, try TFoo or Foo_T or whatever other combination you desire.

>>103843261
Use the platform specific functions to handle virtual memory and let your OS do most of the heavy lifting.
Anonymous 01/12/25(Sun)05:49:07 No.103863305
1599146371973
>working with unsigned types in C#
picrel is what i want to do to microsoft atm.
Noah !ZSjvHtAFy6 01/12/25(Sun)05:51:26 No.103863318
>>103863305
try dealing with interop with c++ dlls which require painful wrapping
Anonymous 01/12/25(Sun)06:01:53 No.103863380
>>103863318
meh i come from java im used to having to write a whole wrapper both on the native & virtual side to do native interop.

but having to explicitly cast back and forth constantly every fucking time i touch something unsigned in any way is pissing me off considering how u dont even think about it in other languages.
Anonymous 01/12/25(Sun)06:02:13 No.103863383
>>103863305
I've never used Microsoft Java, but I assumed they were just following Oracle Java, so they deserve a lot of blame too.
Anonymous 01/12/25(Sun)06:03:09 No.103863393
>>103863383
technically java is equally bad but they dont have unsigned in the first place for me to complain about kek
Anonymous 01/12/25(Sun)06:14:16 No.103863457
Ever felt like your projects are bogged down by slow performance or security vulnerabilities? It might be time to consider migrating to Rust. This systems programming language is gaining traction for its focus on speed, memory safety, and concurrency. Rust's ownership system and fearless concurrency make it perfect for building high-performance, safe, and secure software. So why not give it a shot? Your projects deserve the best, and Rust might just be the secret sauce you've been missing
Anonymous 01/12/25(Sun)06:52:25 No.103863681
87cbd9f262c435d08ddf70ff1c00e3c6
Wanted to spend my sunday learning a new thing or two and I was thinking it was maybe the right time to get into that "you should dev AI's" shit everyone's recommending me to do.
So I'm a backend dev but I haven't paid attention to a single drop of attention to AIs. Where to get started? What's the entry point? I honestly have no idea. All I know about this is the most known chatbots.
Anonymous 01/12/25(Sun)06:52:35 No.103863683
is it true recursion is faster than iteration (with a stack)? chatgpt told me so because of compiler optimizations and the fact that the real stack is hardware optimized
Anonymous 01/12/25(Sun)06:55:11 No.103863699
>>103863683
fpfags will tell you that their compiler will magically optimize everything.
Still their recursive solutions are slower than using just loop, curious.
Anonymous 01/12/25(Sun)06:56:18 No.103863706
>>103841949
>fasm
I really want to use this for something but every time I try just basic win32 things it takes so much time and effort complying with windows calling conventions that I get bored

Probably just a case of me trying to write assembly instead of writing macros to write the assembly for me...
Anonymous 01/12/25(Sun)06:58:26 No.103863716
>>103839766
>why do we always need a virtual machine?
because a real hardware machine is expensive and not as open for modifications, and a general-purpose CPU is just not specialized enough for your very specific use case
Anonymous 01/12/25(Sun)07:34:45 No.103863947
>>103863683
Stop listening to AI slop. It has a huge tendency to make shit up and sound very confident about it.
Anonymous 01/12/25(Sun)07:57:48 No.103864124
Which is better?
int* x;

int *x;
Noah !ZSjvHtAFy6 01/12/25(Sun)08:02:05 No.103864156
>>103864124
depends on pre defined style guide otherwise i would say 2.
Anonymous 01/12/25(Sun)08:03:17 No.103864166
>>103864124
adding int many xs
Anonymous 01/12/25(Sun)08:03:38 No.103864168
>>103864124
the first because the syntax should be [type] [space] [name]
int pointer is one type. Its NOT a pointer type that happens to point to an int. IT IS an int pointer type.

an int* and a float* are not the same types becaue they're both pointers, theyre two different types. They may have the fact that they're pointers in common but that doesn't make them equivalent. In the same sense that char and int are descrete signed integral types but that doesn't make them the same type.
Anonymous 01/12/25(Sun)08:10:28 No.103864208
>>103864124
If you use the first one, we just won't hire you.
Anonymous 01/12/25(Sun)08:15:39 No.103864252
>>103864124
latter because x is a pointer, int is just a hint
Anonymous 01/12/25(Sun)08:24:24 No.103864339
>>103863681
Deep Learning with Python, by François Chollet and Matthew Watson
Anonymous 01/12/25(Sun)08:32:29 No.103864410
>>103863947
>ai slop
Found the luddite. How does it feel being dumber than something that used to be a pile of sand?
Anonymous 01/12/25(Sun)08:34:50 No.103864431
1712094620019744
>>103864410
hey, retard. in this context, your explicit use of "luddite" makes absolutely no sense.
Anonymous 01/12/25(Sun)08:37:27 No.103864455
>>103864124
COMPANYNAME_UINT32_T * ui32X = COMPANYNAME_UINT32_CAST( 0 );
Anonymous 01/12/25(Sun)08:38:36 No.103864468
>>103864124
Thanks to c's declaration follows usage rule or whatevever, this line reads "x is a pointer to an int", not "x is a variable of type integer pointer", and so to keep in line with how c works, I'd choose the second.
A retarded rule, IMO, but when in rom...

>>103863457
C remains the only viable choice, even though it's shit.
Anonymous 01/12/25(Sun)08:46:14 No.103864542
script
>>103836196
Is there anything like powershell or vbscript but with c++?
Anonymous 01/12/25(Sun)08:59:18 No.103864650
>>103864542
'like' in what way? To use as a scripting language? Write a tool that caches the compiled result and calls it until the file changes. There are tools like this for Nim, D, Rust, etc. Someone's probably done it for C++
also in J this is just
{{'Hello, ',x,', you are ',(y>:18) {:: 'a minor.';'an adult.'}}
Anonymous 01/12/25(Sun)10:29:56 No.103865424
>homo faggot ai slop caches the models to your home directory by default
I hate pythonfags so fucking much
Anonymous 01/12/25(Sun)10:32:24 No.103865453
>>103865424
sorry to hear that happened to you
Anonymous 01/12/25(Sun)12:08:07 No.103866534
>>103865424
Everyone just assumes you're running a container of some kind these days
Anonymous 01/12/25(Sun)12:25:56 No.103866711
file
anyone enabled these features (for WSL2) on their machine that they also game on? Did it fuck up the memory performance as bad as I've heard?
php-dude 01/12/25(Sun)13:06:18 No.103867172
983479
>>103864542
why need to devote time to ms-windows-bound product? (was ist das PowerShell ISE?) one day it will be deprecated, abolished, troonified.. and it is private property - auf fiedersehen, au revoir, good buy, no forks for today! hehehe

ive created "example-202501.php" on the pic. the only way to remove clutter is to remove logic, either by introducing functions or doing data preparation (like adding "isAdult" flag to the data)
Anonymous 01/12/25(Sun)14:22:41 No.103868183
SQLite
Is it possible to have a hashmap with two independent keys, so I can query it using both keys, independently, like a database? For example, I want to create a hashmap with a key like <KeyA, KeyB>, but sometimes I want to query it using only KeyA, and sometimes I want to query it using only KeyB. I know I can use a database like sqlite, but I don't want to use an external library. One alternative I found was using two hashmaps, one with KeyA, and other with KeyB. But I want to know if it's possible to do this using a single hashmap.
Anonymous 01/12/25(Sun)14:33:30 No.103868315
>>103868183
no, it's not possible. Implement a hashmap from scratch, even a very simple one, and you'll understand why: value of a hashmap is in efficient location of the key, which creates a dependency on where the data is located in the backing array. Efficient lookup of the value would imply a different location in the backing array.
Anonymous 01/12/25(Sun)14:41:27 No.103868433
>>103868315
Ok, thanks. I think I will simply use an in memory sqlite database for this project.
Anonymous 01/12/25(Sun)14:42:35 No.103868449
>>103868183
The second map doesn't need to store the data again, it can function as an index from the second key to the first key's hash.
Anonymous 01/12/25(Sun)16:34:11 No.103869803
ssex
I'd appreciate it if someone could spot me on this for obvious errors or possible optimizations. Manual testing has come back okay on the former though.
>find any unfilled box in image with a defined minimum, maximum width, and minimum center size
yes, python, sorry.
>https://litter.catbox.moe/89uz0j.pdf
>attached example
image size => 1168, 272
box found:
coordinates: (46, 178)
width: 44
Anonymous 01/12/25(Sun)17:17:46 No.103870343
>>103868183
class DoubleMap {

HashMap<String, Object> map;

public DoubleMap() {
map = new HashMap<>();
}

public Object queryA(String keyA) {
return map.get("AAA-" + keyA);
}

public Object queryB(String keyB) {
return map.get("BBB-" + keyB);
}

public void putA(String keyA, Object o) {
map.put("AAA-" + keyA, o);
}

public void putB(String keyB, Object o) {
map.put("BBB-" + keyB, o);
}

}

Your hashmap, saar.
Anonymous 01/12/25(Sun)17:35:07 No.103870524
pepper
Now this is a real art program
Anonymous 01/12/25(Sun)18:01:41 No.103870848
>>103870524
That's pretty cool
Anonymous 01/12/25(Sun)18:23:07 No.103871136
>>103870524
Impressive. What’s next?
Anonymous 01/12/25(Sun)19:03:23 No.103871586
>>103871136
you need more?
Anonymous 01/12/25(Sun)19:19:12 No.103871732
>>103871136
>Canvas resizing
>Handle console paste events
>Undo/redo
>Probably a general UX pass to make the shortcuts more intuitive. Maybe switching to a vim-esque modal system?
That's essentially the bare minimum I'd need to consider this "complete." There's a bunch of other niceties I had in mind (centered text, anti-aliasing, lines that use directional characters (/, _, \, -, |, etc.)) but those can probably come later.
Anonymous 01/12/25(Sun)19:25:09 No.103871798
Screenshot 2025-01-12 192257
Why would gcc randomly apply blobs of nops like this? I've tried forcing the alignment to specific values to no avail.
Lain Draws 01/12/25(Sun)19:28:56 No.103871844
I want to learn a programming language in my spare time, what's a valuable to learn? I'm willing to watch or read anything. I want to make something useful eventually like for windows or linux, just don't know yet.
Anonymous 01/12/25(Sun)19:40:24 No.103871980
>>103871844
Are you a total beginner?
Lain Draws 01/12/25(Sun)19:45:38 No.103872029
>>103871980
Yes, never had any experience with any language and all I know are names. Not any functions nor any coding jargon. I would like to so that I might make things or honestly to see if I make something useful.
Anonymous 01/12/25(Sun)19:48:33 No.103872064
1732222911302818
>>103871798
On arm this scheduling would be an attempt to stop stalls but not that long, maybe it's to coerce more prefetch on x86?
Anonymous 01/12/25(Sun)19:52:12 No.103872092
TotientProbeOrder
>>103860562
[repeat, with new diagram]
I can't find this hash table probe order on Wikipedia even though it's simple. Has anyone heard of anything like this before? Here are the details:
- Totient probing
- hash table has 2^j entries
- hash value is h
- address of n'th probe = (((2n + 1) * (2h + 1) % 2^(j+1)) - 1) / 2
Intuitively, we assign odd positive ID numbers to table entries, convert a hash function to an ID number, and take odd multiples of the ID, modulo twice the size of the table, to obtain the probe order. Odd numbers are relatively prime to 2^j for j >= 1, so the search will eventually probe every entry in the table.
Anonymous 01/12/25(Sun)20:59:44 No.103872729
gumball-meditating-island-f2x7unwdnut0xfwv-f2x7unwdnut0xfwv
/sci/ anon says
>program analysis is huge in programming and cyber security. It is well known that there exists no perfect program that is totally sound and complete. If youre saying there is some formal method of capturing all things like infinite loops then you are the next millionaire my friend
>>>/sci/16544114
can anybody translate what "perfect program that is totally sound and complete" means and where this statement and proof may be found?
Anonymous 01/12/25(Sun)21:05:11 No.103872768
>>103872729
He's talking about the solution to the halting problem from computability theory.
Anonymous 01/12/25(Sun)21:23:15 No.103872915
>>103872729
If we assume that programming, as a model of solving problems, is both sound (a program cannot provide contradictory answers to a question) and complete (every question has a program that can solve it) then it means that a particular question, "Does a given program P halt on input I?" must have a program that answers it. But this cannot be the case, because if such a program existed we can create a pathological program like so:
def g(input):
if g halts on its own source code:
loop forever
else
return 1
Anonymous 01/12/25(Sun)21:43:03 No.103873052
1735090416710871
>>103836196
I hate Windows 11.
>cmd does not look in the current working directory so you can't just have the name of a file typed in to execute it like you can in just about every other version of Windows
>you can't grab a handle on the console window for low level Win32 API stuff
>Properties is not available in the default context menu
Fuck everyone involved with the development of this shit OS. I hate developing anything on it. Windows 10 was half decent though but EOL is just around the corner seriously fuck Microshit

I'm just going to build a Win10 ISO with really good security settings and ride it out.
Anonymous 01/12/25(Sun)21:54:30 No.103873146
>>103872729
Just program in Agda or Coq where they demand proofs of totality.
Anonymous 01/12/25(Sun)22:03:30 No.103873218
>>103873052
cant you do .\file
Anonymous 01/13/25(Mon)01:52:12 No.103875078
Monday is a bad day for programming it seems.
Anonymous 01/13/25(Mon)01:58:01 No.103875127
>>103875078
why it seems that way
Anonymous 01/13/25(Mon)01:59:52 No.103875145
>2 hours into work
>been just shitposting and haven't even opened the project
it's owari da
Anonymous 01/13/25(Mon)02:02:32 No.103875173
Anonymous 01/13/25(Mon)02:10:32 No.103875244
>>103875173
>asking for help with your ESL lvl 1 homework
google is your friend
Anonymous 01/13/25(Mon)04:20:08 No.103876006
>>103871798
probably -falign-functions
>ensures that at least the first m bytes of the function can be fetched by the CPU without crossing an n-byte alignment boundary
Anonymous 01/13/25(Mon)04:24:31 No.103876037
It's pretty rough returning to (low level) programming after spending a substantial amount of time as a no-coder. Your mind still knows at the macro level all of the steps you need to accomplish, but as you start typing you realize... "err, how do I open a file in this language?"
Anonymous 01/13/25(Mon)04:27:40 No.103876057
>claims to be low level developer
>gets filtered by fopen
I hate americans so fucking much
Anonymous 01/13/25(Mon)04:32:52 No.103876094
>>103876057
No claim was made, I'm a mathfag. Haven't programmed for 5-6 years, I'm not American.

I hate retards so fucking much.
Anonymous 01/13/25(Mon)04:34:28 No.103876104
>>103872029
any... examples?
Anonymous 01/13/25(Mon)04:38:48 No.103876123
1716310458987295
>>103863457
>Rust
>systems programming language
Anonymous 01/13/25(Mon)04:42:12 No.103876142
>>103870524
that's really cool can you share the repo?
Anonymous 01/13/25(Mon)05:31:29 No.103876440
You do use .hh extension for all your header files right?
Anonymous 01/13/25(Mon)05:38:26 No.103876488
>>103876440
i use .h, hpp, .hxx, .h++ at random
Anonymous 01/13/25(Mon)05:39:57 No.103876499
deadass
>>103876488
You ain't my brother
Anonymous 01/13/25(Mon)06:17:03 No.103876719
8798477733
>have a big block of code where I comment literally every line
>submit to chatgpt for it to try to fix an issue
>it removes most of my comments
I WILL FUCKING COMMENT EVERY FUCKING LINE OF CODE AND YOU WILL LIKE IT!
Anonymous 01/13/25(Mon)06:18:11 No.103876723
>>103876719
how about asking it whats wrong and fixing it yourself instead of being a copy paste dev
Anonymous 01/13/25(Mon)06:20:40 No.103876739
NIGGER
>>103876723
>fixing it yourself
Anonymous 01/13/25(Mon)06:21:52 No.103876742
>>103876142
why do indians always ask for the source code?
Anonymous 01/13/25(Mon)06:21:56 No.103876744
>>103861558
what about wchars?
Anonymous 01/13/25(Mon)06:23:19 No.103876752
>>103876723
It's just a matter of time before AI replaces all programmers anyway.
Anonymous 01/13/25(Mon)06:25:49 No.103876764
>>103876752
REPLACE MY ANUS
Anonymous 01/13/25(Mon)07:09:36 No.103877032
adder
>>103836196
A programming language impl + ide with some neat visualizations of what goes inside it.
At least, I hope to see it when I eventually finish it. Have an image of the first step: a 2 week fetus of an expression evaluator.
Anonymous 01/13/25(Mon)07:31:36 No.103877241
>>103876742
I want to use it and star it idiot
Anonymous 01/13/25(Mon)07:33:14 No.103877255
Anyone has any resources on 16-bit DOS compilers? I've set up a small build environment using DeSmet's nonsense (C88, BIND, CSTDIO.S and so forth), but there's apparently no support for inline assembly.
Anonymous 01/13/25(Mon)08:02:06 No.103877438
i still dont understant what does brackets do in intel's syntax asembly
Anonymous 01/13/25(Mon)08:08:11 No.103877487
>>103877438
mov eax, DWORD PTR [0DEADBABEh]
eax = *((int32_t*)(0xDEADBABE));

They do the same thing, anon; dereference the reg or absolute addr between the brackets.
Lain Draws 01/13/25(Mon)08:37:09 No.103877680
>>103876104
I guess the most famous ones are C, C++, Javascript, python, Holy C, Ruby, and Rust. I saw some others like Basic, go, and algol. Which one is feasible to learn? Can one be used as a base for the others? Where do I start?
Anonymous 01/13/25(Mon)08:48:35 No.103877759
>>103877680
NTA. C is the lingua franca of low level programming (unfortunately), so if writing an OS is your goal, I'd start there.
Alternatively, start with C++. It's still as low level while being incredibly more expressive than C, being able to learn 75% of its quirks makes you a valuable person, and there are too many cniles on this planet.
>t. cnile
Lain Draws 01/13/25(Mon)08:57:57 No.103877844
>>103877759
That would be nice. Right now, I think the best action is to see if I can probide a solution to an inconvenience. Something that may make programming or technology a bit more fluid.
Anonymous 01/13/25(Mon)08:59:56 No.103877866
compilers_are_garbage_cpp_printf
>C++
Why would you want to deal with garbage memory management and shitty code generation? You'd have to have terminal brain damage.
Anonymous 01/13/25(Mon)09:42:13 No.103878263
>>103877866
Maybe whatever the compiler provides is good enough for the task at hand during that time.
If people wanted perf, they'd isolate the bottlenecks and write it in a better language. I'm aware C++ is merely just high level glue that a lot of people use to glue their software together with.
Anonymous 01/13/25(Mon)09:44:21 No.103878280
part_of_the_problem
>>103878263
>good enough
Yeah, that's been the excuse for the last thirty years. The buck has already stopped, but you refuse to acknowledge it.
Anonymous 01/13/25(Mon)09:48:33 No.103878307
>>103877866
you aren't beholden to standard library memory management techniques and all of those features are standard library and/or ABI library dependent which are optional
on the flip side templates and template metaprogramming can be used with inline assembly which are beneficial for targets that don't have real macro assembler support (no, GNU asm doesn't count, and no it's not worth writing an assembler for exotic targets, especially for ones that may have substantial amounts of errata/known optimization issues) and as of newer versions of gcc asm takes a constexpr std::string which means C++ constexpr dynamic compile time assembly generation
constexpr literally all of C and replace macros with something not retarded and then you can compare them
Anonymous 01/13/25(Mon)09:50:52 No.103878329
>>103878307
>you aren't beholden to standard library memory management techniques
So what's left of the language then? Might as well do it properly and in C then.
Anonymous 01/13/25(Mon)09:51:28 No.103878337
>>103877680
i meant examples of things you want to make -_-
languages are not important and doing endless language tutorials with no goals is a waste of time
instead you should think about, like, do you want to make games? pretty pictures? serious software? the next great imageboard? or whatever
pick one thing you'd be happy to work on for the next week and we can go from there
>>103877844
this is just vague llm slop. i hope you don't seriously think like that. cut that out and talk specifics like a real human bean
Anonymous 01/13/25(Mon)09:55:20 No.103878373
>>103878280
What I mean is that there's a time to optimize the program beyond what the language can provide.
Doing so while sketching out what the program should do is not a good time for that.
Anonymous 01/13/25(Mon)09:56:11 No.103878380
compilers_are_garbage_static_access
>>103878307
Also
>constexpr literally all of C and replace macros with something not retarded
Wouldn't have helped here.
Anonymous 01/13/25(Mon)09:59:18 No.103878406
>>103878373
>Doing so while sketching out what the program should do is not a good time for that.
If that was the case technical debt wouldn't exist.
Anonymous 01/13/25(Mon)10:28:34 No.103878654
>>103878406
You could write perfectly optimized code for every single usecase, down to the lowest levels of abstraction imaginable for every platform you wish your programs run on simulteneously while you prototype your program? Cool, maybe use your skills to go improve software you care about or something.

For my purposes, however, the bottom is fast enough for me to defer paying off tech debt for later.
In other words I'll be rewriting prototypes anyway who cares if the first one is crap.
Anonymous 01/13/25(Mon)10:32:18 No.103878700
>>103878654
>defer paying off tech debt for later
That's the point of technical debt: you never pay it off, you're just kidding yourself.
Anonymous 01/13/25(Mon)11:36:41 No.103879318
>>103877866
While I agree it's flawed, it's the perfect language for me. I would've used C instead if it had generics and strong typing.
Anonymous 01/13/25(Mon)11:54:28 No.103879530
>memoization
programming sock wearing trannies really did infiltrate CS early didn't they
Anonymous 01/13/25(Mon)12:01:56 No.103879614
>>103879530
what do you mean?
Anonymous 01/13/25(Mon)12:09:39 No.103879702
I'm trying to design an arena system that grows by 1 or more pages each time it needs more memory (number of pages chose during the arena initialization). The pages would be requested to a global or thread local pool, and the pool itself would request several pages at a time, maybe 64kB or more, also chose during the global/thread pool initialization.

Typically many arenas would exist at the same time and have different lifetimes and block size. The idea of the pool is to reuse memory instead of always mmap/munmap and also avoid too much fragmentation for the OS, so ideally the big chunk of pages requested by the pool system should be munmap all at once and not have sections of it munmap individully causing the larger chunks to be split.

My problem is finding a strategy and heuristics for freeing chunks of pages when a lot of it has been freed because an arena has been freed while at the same time keeping some memory for reuse but not too much of it. Do you know any good strategy for adadpting the available amount of memory to a good level?
Anonymous 01/13/25(Mon)12:20:43 No.103879814
>>103879702
I'm also considering if it's a good idea that an arena can choose its pool during initialization and having possibly multiple global pools or pools per tread with different chunk of page sizes. This would allow several sub system using a lot of memory to have their arena choose the same amount of requested pages so that fragmentation is not a problem. But that pose the question of memory reuse throughout the process.
Anonymous 01/13/25(Mon)12:27:04 No.103879862
>>103879702
Have you considered splicing up allocations depending on their lifetime? That way you can employ a simple stack-based approach (keep track of the end, set to zero or an otherwise appropriate value if objects on the end have to be deleted).
Anonymous 01/13/25(Mon)13:07:42 No.103880367
>>103864468
>Thanks to c's declaration follows usage rule or whatevever, this line reads "x is a pointer to an int", not "x is a variable of type integer pointer", and so to keep in line with how c works, I'd choose the second.
>A retarded rule, IMO, but when in rom...
Pascal and Algol 68 also have the "declaration follows usage rule" except declarations and usage are easier to read. C syntax is just plain bad.

>C remains the only viable choice, even though it's shit.
There were a lot more choices like Pascal and Modula-2 but C people take over communities by removing choice and forcing people to use C.
Anonymous 01/13/25(Mon)13:16:14 No.103880452
>>103864124
there are 2 acceptable answers
int *x;

int * x;

your first option is never acceptable, int* is not a type
Anonymous 01/13/25(Mon)13:34:17 No.103880621
>>103879862
That's what the arenas are for. Each arena has its own lifetime and a subsytem will free all its memory at once but additionally, I want to use a global/thread local arena that would work as a stack for general purpose alloactions that don't escape their scope. It could be useful for a function that produce data structure and then throw them out.

That's why the arena will work a segmented stack or contiguous stack allocator (chosen when initializing). They will have a function to record in a struct the current height and another function to free everything above that height.

But as for the pool from which the arena request pages from...
Anonymous 01/13/25(Mon)13:45:46 No.103880757
>>103880621
There will also be a global arena for global alloactions or allocation that have a lifetime as long as the process. The intended purpose it that choosing an arena to allocate will constitute most of the manual memory managmenet and overall the system should basically remove the need of using malloc or a GC.
If invidual objects need to be free individually I can always use an arena as a buffer and manage it manually.
There also won't be any alignment for an allocation inside an arena and that will allow to reuse arenas as a dynamic arrays.
Lain Draws 01/13/25(Mon)14:03:47 No.103880991
>>103878337
Well, if I'm honest I want to build either websites or native desktop/mobile applications to all platforms. Apps like a 4chan/gaming would be my focus. I specifically have a love for this imageboard and bullet hells like Touhou and adjacent games like Parodius.
Anonymous 01/13/25(Mon)14:05:03 No.103881005
still waiting on wayland aquamarine docs...
Anonymous 01/13/25(Mon)14:08:01 No.103881042
>>103880452
*is not part of the declaration's type specifier
pointers are derived object types and (int*) is a valid type cast because pointer types are scalar types
Anonymous 01/13/25(Mon)14:17:58 No.103881144
>>103864124
2 only because the grammar lets you do things like
int *x, **y, z;


>>103880452
>int* is not a type
It sure behaves like a type tho
Anonymous 01/13/25(Mon)15:05:42 No.103881630
Oh holy programmers, one day I, a lowly IT worker will join you
Anonymous 01/13/25(Mon)15:07:34 No.103881660
>>103881630
msys2 on Windows or Linux.
If you've got the time for shitposts you've also got the time to install and explore them.
Anonymous 01/13/25(Mon)15:13:17 No.103881752
>>103880991
that's a list of very different things
>websites
i'm not sure what the current webshit meta is, probably some react server side rendering black gorilla magic. i'm sure /wdg/ will tell you all about it
back in my day we had rails or django on the server and some ad hoc javascript on the client and we were happy goddamn it
>native desktop/mobile applications to all platforms
impossible. you either learn every single platform or settle for some garbage abstraction layer like flutter
>bullet hells like touhou
lua is easy to learn and love2d has good docs, i wouldn't bother with anything else for 2d games
Anonymous 01/13/25(Mon)15:13:19 No.103881753
>Please suggest whether the spelling of the term ’redex’ in the sentence ’Unlike the reduction step’ is OK.
typos could have prevented this
Anonymous 01/13/25(Mon)15:15:47 No.103881790
>>103881752
>i'm not sure what the current webshit meta is
The best is nginx with a worker containing all the code, to reduce as much IPC as possible.
Anonymous 01/13/25(Mon)16:29:03 No.103882768
>>103881630
Why one day? why not now? pickup the k&r C book and get started
Anonymous 01/13/25(Mon)16:33:41 No.103882826
>>103881630
please saar...we have too many already, saaaar.
Anonymous 01/13/25(Mon)16:53:41 No.103883089
1639939482736
>>103882826
We have too many pajeet-tier ones, true.
Anonymous 01/13/25(Mon)16:59:34 No.103883151
>>103883089
>me: do you think this will work if you run it?
>Candidate: Honestly, no, I do not think it will work at all
>me: Why is that?
>Candidate: it has many syntax errors
>me: and if I fixed the syntax errors, will it work then?
>Candidate: still no
>me: and why is that?
>candidate: it has logic errors, too
PEAK COMEDY
Anonymous 01/13/25(Mon)17:04:30 No.103883199
Honest question do you guys think one should turn off copilot for learning purposes? I use it all the time at work for langs and frameworks I am already familiar with but for learning new stuff it seems kind of like cheating? Am I really learning anything?
Anonymous 01/13/25(Mon)17:06:54 No.103883228
>>103883199
>I constantly use trodden paths, which teaches me bushwhacking
Sounds retarded, doesn't it.
Anonymous 01/13/25(Mon)17:18:15 No.103883354
bqn
>>103883089
in BQN this is just
>>103883151
left side: sadness
right side: hilarity
it's a great compilation
Anonymous 01/13/25(Mon)17:25:26 No.103883446
>>103877866
I recognize that style, and trooning out over x86-32 in 2025 is dumb; that's been a legacy target for years now.
People actually generating new 32-bit code are probably going for ARM, or perhaps RISC-V or some other embedded target. x86 was never relevant in that space; Intel didn't care to cooperate with SoC makers until it was far too late.
Anonymous 01/13/25(Mon)17:27:11 No.103883471
>>103883446
>I recognize that style
>x86-32
>rsi
>rdi
>rax
You don't recognize anything. Opinion discarded with prejudice.
Anonymous 01/13/25(Mon)17:27:48 No.103883480
>>103883228
Well sure if you wrap it in a nice metaphor, but some devs claim it can be a learning tool (while others say not so.)

I just dont want to be left behind on the new AI tech, and its hard to find anything truthful through seas of hype and bullshit.
Anonymous 01/13/25(Mon)17:30:37 No.103883511
Arch updated their llvm packages to 19 and now clangd works with modules perfectly \^o^/
Anonymous 01/13/25(Mon)17:31:26 No.103883518
>>103883480
>I just dont want to be left behind on the new AI tech
You do know that the supplying companies have yet to make profit with it, right?
Anonymous 01/13/25(Mon)17:34:53 No.103883544
>>103883199
Better yet, don't use it entirely. It teaches bad habits and makes you reliant on it.
Anonymous 01/13/25(Mon)17:37:16 No.103883564
>>103883544
It does save me lots of time writing C# boilerplate "clean" code slop. But maybe you are right, AI does seem limiting.
>>103883518
I dont really know, but they must be when giants like microsoft are pushing it, I would assume microsoft is smart enough to run a profit.
Anonymous 01/13/25(Mon)17:39:55 No.103883599
what_the_actual_fuck
>>103883564
>when giants like microsoft are pushing it
Microsoft has never had any idea what the fuck they're doing. They're almost literally throwing spaghetti at the wall and see what sticks.
Anonymous 01/13/25(Mon)17:42:29 No.103883627
>>103883199
LLM stuff is good for getting you like 90% of the understanding of a particular topic, it's just that the other 10% can really only come from reading the documentation, getting hands-on experience, and actually understanding what the code is doing rather than just having faith that the LLM will solve everything.
Anonymous 01/13/25(Mon)17:44:53 No.103883649
>>103883627
LLM is good for the nocoders on the team to generate Python slop that doesn't even do what the nocoder wanted to be done, and that everyone else on the team will now have to politely pretend is not obviously ChatGPT slop and talk about like it's a real script that someone really wrote.
LLMs are also good for taking copy-and-pasting that slop and saying "rewrite this in go" and then taking it from there.
Anonymous 01/13/25(Mon)17:57:35 No.103883749
>>103883511
Call me once clang properly supports register variables and no longer shits the bed when setting up the stack.
Anonymous 01/13/25(Mon)18:18:34 No.103883947
>>103838271
>Have you never read a book before?
when a book uses the female pronoun to refer to subject of unknown gender i close the book and move on
i also stop reading any text that does that, whether it's a github readme, a blog post, etc. i learned from experience that they are not worth my time
i sometimes make an exception for things like cars or computers because i understand the sentiment
Lain Draws 01/13/25(Mon)18:24:45 No.103884016
>>103881752
So in terms of learning for every platform for building those apps, where would I get started there?
Anonymous 01/13/25(Mon)18:29:10 No.103884054
>>103883511
Cool, I think the latest clang came with much more complete C23 support, so I'll have to try that out.
Anonymous 01/13/25(Mon)18:49:06 No.103884215
Lain Draws 01/13/25(Mon)19:00:28 No.103884320
>>103884215
I gotcha, I'll search it up
Anonymous 01/13/25(Mon)19:05:54 No.103884373
>>103877487
this thing you wrote i get it
but i dont get it
lea eax, [rax]
vs.
mov eax, [rax]
Anonymous 01/13/25(Mon)19:11:39 No.103884432
>>103884373
LEA is a special case. It uses MOD R/M semantics, but doesn't actually fetch the byte, just stores the result of the given calculation in the given target register. It's how (good) compilers rewrite certain operations to avoid instructions that are much slower (for example multiplication by 5 can be expressed as LEA RAX, [RDX * 4 + RDX]).
Anonymous 01/13/25(Mon)19:20:26 No.103884523
>>103884432
so in particular we have lea eax, [rax] == mov eax, rax?
and for the rest it doesnt work since we cant do something like move eax, rax + 1
Anonymous 01/13/25(Mon)19:26:42 No.103884594
>>103884523
>lea eax, [rax]
Here you're truncating a 64-bit value to 32 bits, which a simple MOV EAX,EAX could've done as well (with the latter one probably being more likely to break the dependency of the upper 64 bits, for register renaming purposes).
>mov eax, rax
That instruction doesn't exist as you've mixing 32-bit and 64-bit registers.
>we cant do something like move eax, rax + 1
Yes.
Anonymous 01/13/25(Mon)21:19:52 No.103885707
Everyone seems to hate C++ templates. Should I bother learning about them?
Anonymous 01/13/25(Mon)21:41:53 No.103885904
1027614307646
LLM assisted A* pathfinding, LLM value interpretation from text input/value type/value range, LLM text description based on value within a value range.
Basically getting an LLM to output valid data types other than text, and also return text based on valid types/ranges.
It's for a little rogue-like game thing I'm making as an experiment.
>1990
>Open door
>You can't do that right now
vs
>2025
>Open door
>You open the door
Anonymous 01/13/25(Mon)21:44:52 No.103885936
>>103885707
if you're using C++ you should know how to use them
you don't really need to learn the more difficult parts (SFINAE and template metaprogramming) anymore now that concepts are a thing since they replaced most of their usecases
Anonymous 01/13/25(Mon)21:45:53 No.103885950
>>103885904
Where is it?
Anonymous 01/13/25(Mon)22:01:10 No.103886073
1796142523792
>>103885950
Here, when I get something workable.
Sometimes I post to see if I'm being retarded and what I'm working on is entirely infeasible.
If I get:
>Where is it?
It's worth it to keep working on the project
If I get:
>lol retard
and if I'm lucky
>here's why you're retarded
Then I have learned, and can reexamine the project with fresh eyes.

To give you an idea, here's some pseudocode of one of my prototype prompts:
>Given the following action and context, respond only with an integer between {var_range_start} and {var_range_end}
>Your response should be based on the following criteria: {criteria}
>{action}
>{context}
Context contains stuff like the action (what you're doing), the target (what you're doing the action to), the environment, your character's stats, the difficulty of the task, etc.
It's nothing crazy. You're just asking it to evaluate text for a requested value, or output text based on a value within the context of other values.
Anonymous 01/13/25(Mon)22:29:01 No.103886334
inline_spirv
huh
they're letting you embed SPIR-V in GLSL and HLSL
looks kinda weird but i think it might be useful especially with spir-v features that aren't really represented too well
Anonymous 01/13/25(Mon)22:33:15 No.103886380
>>103863457
my projects will become bogged down by the slow performance of the compiler instead, sounds great. it's also a slow language to write
Anonymous 01/13/25(Mon)22:34:55 No.103886403
Sometimes think about using Rust just to blow /dpt/ away.
Anonymous 01/13/25(Mon)22:42:54 No.103886465
>>103886403
hourly Rust shilling
Anonymous 01/13/25(Mon)22:43:21 No.103886469
>>103886465
If only. Just tuesday thoughts.
Anonymous 01/13/25(Mon)22:47:34 No.103886505
Will doing leetcode problems really make me a better programmer or are they just puzzles for fun
Anonymous 01/13/25(Mon)22:53:37 No.103886550
Anonymous 01/13/25(Mon)23:11:03 No.103886672
>>103886505
wondering this too
is it worth paying for leetcode as a hobby
Anonymous 01/13/25(Mon)23:11:38 No.103886678
an assignment just cost me 5 hours and it's because of stupid small mistakes that if I would've caught earlier...well...fuck.
Anonymous 01/13/25(Mon)23:38:17 No.103886886
I'm trying to calculate dice roll probabilities in an efficient way. I have n dice and an associated score that depends on the dice values. My idea was to use an n-dimensional array with indices as values to perform the score calculation for each cell, then perform a value counting operation to get the score probabilities. However, this is slow for larger n. Is it more likely that the value counting is the bottleneck? I could theoretically use the fact that the values are symmetric, but I'm not exactly sure how many times a calculation is repeated in n dimensions. Is there a different approach that's better than ndarrays? Should I use a tensor library?
Anonymous 01/14/25(Tue)04:02:04 No.103888442
>>103886886
define "slow" and "larger n"
are you throwing a realistic or completely abstract number of dice?
is it "slow" with any practical significance or just "too many milliseconds for my liking"?
Anonymous 01/14/25(Tue)04:29:16 No.103888614
>>103888442
>full ego defense mode
Pathetic.
Anonymous 01/14/25(Tue)05:09:03 No.103888868
eremias3nano
>>103836196
Just added highlighting of my custom language to nano. There's also a vim file but it refuses to get detected and I'm not willing to spend more time on it than I already did.
Anonymous 01/14/25(Tue)05:15:02 No.103888904
>>103885904
What if I don't like having hallucinatory garbage either running on my PC or phoning to your garbage server?
>inb4 you can't play my slop then
Oh noes.
Anonymous 01/14/25(Tue)05:24:22 No.103888976
>>103888868
I prefer nano too.