<< 27-07-2026 >>

00:05:42*Mister_Magister quit (Quit: bye)
00:31:56*Mister_Magister joined #nim
01:22:21*rockcavera quit (Remote host closed the connection)
04:01:31FromDiscord<_timurski> sent a code paste, see https://play.nim-lang.org/#pasty=wWYJKmWI
04:01:38FromDiscord<_timurski> not done yet
04:01:43FromDiscord<_timurski> there are some stupid inefficiencies happening
04:02:40FromDiscord<_timurski> there is an endianness issue causing a `rev` instruction where there shouldn't be, some branching which might not be optimal, and other general improvements, so seems quite likely that i can push this to under 1 ns
04:03:34FromDiscord<_timurski> In reply to @_timurski "working on a perfect": (256 random strings with 1..256 length); the proc receives a string and returns its index in the dense array
04:03:42FromDiscord<_timurski> (edit) "the" => "a"
04:42:00*tokyovigilante joined #nim
05:34:34*GnuYawk129 joined #nim
05:37:31*GnuYawk12 quit (Ping timeout: 272 seconds)
05:37:31*GnuYawk129 is now known as GnuYawk12
08:12:48*beholders_eye joined #nim
09:57:11FromDiscord<tempestro> In reply to @_timurski "there is an endianness": If you're at a level this low, why do you not write the assembly yourself?
10:46:44*tokyovigilante quit (Ping timeout: 259 seconds)
11:13:59*tokyovigilante joined #nim
11:35:38FromDiscord<karolyi> https://blog.lx.oliva.nom.br/2026-02-01-freedom-is-not-the-end.en.html
11:35:54FromDiscord<karolyi> very true
11:39:45FromDiscord<mratsim> In reply to @tempestro "If you're at a": because writing Nim is way less boilerplate than dealing with calling conventions in windows/macos/linux X ARM64/s86_64/...
11:39:58FromDiscord<mratsim> (edit) "ARM64/s86_64/..." => "ARM64/x86_64/..."
12:31:51FromDiscord<j.ailer> sent a long message, see https://pasty.ee/NoqiYUWV
12:36:42FromDiscord<demotomohiro> <@&371760044473319454>
13:32:23*Skippy8 joined #nim
14:11:22*Skippy8 quit (Ping timeout: 260 seconds)
14:18:57*Skippy8 joined #nim
14:27:31*Skippy8 quit (Ping timeout: 261 seconds)
14:31:35FromDiscord<_timurski> In reply to @tempestro "If you're at a": it's a perfect hadh map generator
14:31:43FromDiscord<_timurski> i don't write the assembly
14:31:51FromDiscord<_timurski> i write the algorithm that writes the assembly
14:39:00FromDiscord<_timurski> sent a long message, see https://paste.rs/CL0EQ
14:39:43FromDiscord<_timurski> im currently not taking length into account for the "hash" generation which means I need length partitions which means I need branches
14:39:53*Skippy8 joined #nim
14:40:00FromDiscord<_timurski> so that's probably gonna be the next improvement
14:41:36FromDiscord<_timurski> though perhaps I would need to then synthesize a function of the data itself to figure out what byte groups to load, since length + (distinguishing bytes bounded by shortest string) is not necessarily injective
14:47:02FromDiscord<_timurski> i think it should be possible to get this to generate procs that allow hashmap lookup to be <1ns for a very vast range of inputs. it also scales incredibly well for large strings because the amount of work it needs to do actually scales with the # of input strings as log2(N) / 8, but it might become basically constant once I take length into account
14:50:23FromDiscord<_timurski> this runs at compile time but not exactly.. it compiles nim binaries first and then used them with CLI, so requires 2 step build process. there are simply too many possibilities that need to be searched through
14:53:38*Skippy8 quit (Ping timeout: 256 seconds)
15:05:07FromDiscord<tempestro> In reply to @_timurski "it's a perfect hadh": ooooh, cool
15:34:12*Skippy8 joined #nim
15:58:58*skulk quit (Quit: ZNC 1.10.1 - https://znc.in)
15:59:56*skulk joined #nim
16:13:45*joast quit (Quit: Leaving.)
16:14:39*Skippy8 quit (Ping timeout: 272 seconds)
16:17:06*Skippy8 joined #nim
16:19:56*skulk quit (Quit: ZNC 1.10.1 - https://znc.in)
16:24:16*beholders_eye quit (Ping timeout: 260 seconds)
16:25:19*Skippy8 quit (Ping timeout: 245 seconds)
16:26:31*Skippy8 joined #nim
16:33:13*Skippy8 quit (Read error: Connection reset by peer)
16:37:47*Skippy8 joined #nim
16:42:19*Skippy8 quit (Ping timeout: 264 seconds)
17:04:54*joast joined #nim
17:06:42*jjido joined #nim
17:47:58FromDiscord<gesee37> In reply to @_timurski "the code currently has": That's cool. I have done something like this in the past, but not applied to strings (though I think making it works for integers can generalize it to anything that can be hashed). I was using `pext` cpu instructions for that (even though my first trial used magic numbers which were more cumbersome to find).
17:48:11FromDiscord<gesee37> (edit) "this" => "that"
17:49:04FromDiscord<_timurski> In reply to @gesee37 "That's cool. I have": my code aims to automatically find the "magic numbers" for stuff like this which makes it a little more general :)
17:50:30FromDiscord<_timurski> `pext` seems to work on vector registers which i haven't touched for this kinda stuff
17:50:59FromDiscord<_timurski> might look into it though might not fit my usecase exactly
17:52:12FromDiscord<_timurski> sent a code paste, see https://paste.rs/TEMLz
17:52:57FromDiscord<_timurski> sent a code paste, see https://paste.rs/AdWyZ
17:53:05FromDiscord<_timurski> (edit) "https://paste.rs/IJliG" => "https://paste.rs/4Rd0E"
17:56:11FromDiscord<gesee37> In reply to @_timurski "`pext` seems to work": It's about extracting some bit following a bitmask and putting them all on the right↵if you have `10100` and your mask is `11100`, you get this `00101` which is highly useful since it means that you just have to find a mask which for each element of your set will output (through `pext`) and unique integer.↵I think there are some algorithms about how to find that mask
17:57:00FromDiscord<_timurski> In reply to @_timurski "or for a more": i started working on my own productivity app which i plan to be a rich typst & code editor + llm interface and realized i needed some string caching but a lot of my strings were known at compile time so i started overengineering 😆
17:57:37FromDiscord<_timurski> In reply to @gesee37 "It's about extracting some": that seems like it loses a lot of information
17:58:14FromDiscord<_timurski> hmm interesting
17:58:30FromDiscord<_timurski> i'm on a mac and arm has a semi equivalent `bext` instruction
17:58:54FromDiscord<_timurski> In reply to @gesee37 "It's about extracting some": what's the difference between this and `and`
17:59:04FromDiscord<_timurski> oh it puts them in least significant spot
17:59:09FromDiscord<_timurski> (edit) "puts" => "packs" | "spot" => "spot?"
17:59:23FromDiscord<gesee37> In reply to @_timurski "that seems like it": not actually it keeps them all
17:59:30FromDiscord<gesee37> In reply to @_timurski "oh it packs them": Yep
17:59:40FromDiscord<_timurski> In reply to @gesee37 "not actually it keeps": well it loses the information it zeroes but that's not a bad thing so ignore what i said
17:59:46FromDiscord<_timurski> arm has `ubfx` which extracts a contiguous range of bits
17:59:55FromDiscord<_timurski> which is my main machinery along with `and`
18:00:33FromDiscord<_timurski> i gotta do more research but i think because arm's equivalent works on vector registers it might be worse for latency?
18:00:46FromDiscord<_timurski> but really do gotta check because that seems like it could be very useful
18:01:25FromDiscord<_timurski> In reply to @gesee37 "It's about extracting some": this seems like an np-hard problem so a branch-bound algorithm would probably be all you can do for an exact solution but heuristic is probably good enough
18:01:41FromDiscord<_timurski> in my own code i just use heuristic everywhere and it works well enough
18:01:56FromDiscord<_timurski> the bottlenecks are more structural than that
18:02:20FromDiscord<gesee37> In reply to @_timurski "arm has `ubfx` which": Well that explain it. I was also asking myself how you were doing to work with string directly as they may have variable length
18:02:45FromDiscord<_timurski> In reply to @gesee37 "Well that explain it.": that's actually handeled in my first check
18:02:50FromDiscord<_timurski> right now i have a pretty bad solution
18:02:55FromDiscord<_timurski> i split things up into multiple partitions based on length
18:03:11FromDiscord<_timurski> because you can only safely extract as many bytes as are in the shortest string without partitions
18:03:20FromDiscord<_timurski> and that might not be enough to distinguish all the strings
18:03:31FromDiscord<_timurski> i.e.: `"a", "ab", "ac"`
18:03:35FromDiscord<_timurski> impossible to distinguish with first byte
18:03:53FromDiscord<_timurski> but my partitioning approach introduces branching would could be aided by using `length` in my hash
18:04:09FromDiscord<_timurski> but this still doesn't fix it yet because there are still pathological cases for this
18:05:33FromDiscord<_timurski> even if you take the first byte + length into account you can't distinguish `"a", "ab", "ac"` with length + first byte
18:05:43FromDiscord<_timurski> (i make the assupmtion the queried string is one of the valid strings in unchecked mode)
18:05:57FromDiscord<_timurski> checking for its validity is a completely different problem that can have a separate optimization scheme
18:06:22FromDiscord<_timurski> In reply to @_timurski "even if you take": however one solution to this would be to have your bytes_loaded be a function of length
18:07:20FromDiscord<gesee37> In reply to @_timurski "this seems like an": Perfect hash have always been hard problem I think since they operate on a fixed universe of known key, they might be highly context dependent to find. Cause I have seen, some guy trying to make perfect hash through the first 3 letters, this is obviously not generalizable but works: https://www.youtube.com/watch?v=DMQ_HcNSOAI
18:07:48FromDiscord<gesee37> (edit) "In reply to @_timurski "this seems like an": Perfect hash have always been hard problem I think since they operate on a fixed universe of known key, they might be highly context dependent to find. Cause I have seen, some guy trying to make perfect hash ... through" added "map"
18:07:54FromDiscord<_timurski> In reply to @_timurski "however one solution to": then you could have for example which would work, but i think synthesizing functions here might be extremely difficult because of the huge search space https://media.discordapp.net/attachments/371759389889003532/1531362509116674138/Screenshot_2026-07-27_at_11.07.48_AM.png?ex=6a68eff9&is=6a679e79&hm=e63974032183589bf03f98bdc7fe67be2eadfd31ac99a3ccd94531f50ba7367c&
18:08:08FromDiscord<_timurski> In reply to @gesee37 "Perfect hash have always": yeah first 3 letters is easy
18:08:33FromDiscord<_timurski> oh wow
18:08:39FromDiscord<_timurski> this guy does very extensive perf profiling though
18:08:45FromDiscord<_timurski> this is a good video to reference
18:08:56FromDiscord<_timurski> i'm reading apple's guide to m-series cpu optimization to learn more about it haha
18:09:25FromDiscord<_timurski> (edit) "In reply to @gesee37 "Perfect hash have always": yeah first 3 letters is easy ... " added "(from a conceptual standpoint)"
18:10:14FromDiscord<gesee37> In reply to @_timurski "i'm reading apple's guide": Well I'm also in the my "learning optimization" phase so...↵Wait, apple use arm ?
18:10:26FromDiscord<_timurski> yeah
18:10:59FromDiscord<_timurski> all their new chips use arm p sure (m-series and a-series)
18:11:25FromDiscord<_timurski> i saw a video of cppcon about cpu pipelining and realized i actually still have no idea how cpu's work
18:11:53FromDiscord<gesee37> For someone trying to do optimize through the core would have to go through their instructions set ? ↵Well that's cumbersome :p
18:12:11FromDiscord<_timurski> i'm hoping i can keep most of it in Nim and just write it in such a way that it gives me the assembly i want
18:12:15*skulk joined #nim
18:12:28FromDiscord<_timurski> but if i see real performance improvements from `asm` then i'll do that
18:12:49FromDiscord<_timurski> this is a hobby project anyway so it's fine if it's not crazy portable
18:13:33FromDiscord<gesee37> In reply to @_timurski "i saw a video": Well when making an ECS I was a bit forced to learn that. Even thought it's mostly about how it execute thing to go faster
18:13:46FromDiscord<gesee37> In reply to @_timurski "but if i see": `asm` seems best only to profile
18:13:54FromDiscord<_timurski> wdym?
18:14:03FromDiscord<gesee37> so you see if the compiler did something stupid
18:14:31FromDiscord<gesee37> Like using multiple instruction were only one could have done it
18:14:44FromDiscord<gesee37> The guys in the video I linked also explain it
18:15:01FromDiscord<_timurski> yeah there are a few cases where compiler might not be smart enough to translate some stuff properly
18:15:26FromDiscord<_timurski> all this just to have slightly faster text rendering for UI...
18:16:18FromDiscord<_timurski> this is kinda inspiring me to eventually do some runtime code generation because there are times when perhaps the static map isn't perfectly static but needs to change very infrequently
18:16:32FromDiscord<_timurski> but idk if i'll actually need that
18:16:58FromDiscord<gesee37> In reply to @_timurski "all this just to": Well that's how it goes for all of us 😂.↵Sometimes you have to explore the dark side of programming just to get some speed.↵I often feels that when using macros
18:17:30FromDiscord<_timurski> speaking of macros
18:17:39FromDiscord<_timurski> i think it's really funny how c++ is integrating metaprogramming into their language
18:17:46FromDiscord<_timurski> and it's just fucking awful
18:17:49FromDiscord<_timurski> like so ugly
18:17:53FromDiscord<_timurski> and looks difficult to use
18:18:12FromDiscord<_timurski> Nim really feels like a c++ replacement
18:18:32FromDiscord<_timurski> (not quite in all circumstances but in many)
18:19:24FromDiscord<gesee37> Well I guess most people fear metaprogramming in the first.↵As code generating code is a complicated art when you are not accustomed to it.↵And then you see how other languages do it, and you feel once again that's it's obscure dark magic
18:20:23FromDiscord<gesee37> In reply to @_timurski "Nim really feels like": Well if the market actually find it worthy. I would say nim is rather unique, and with nim 3 that uniqueness will just be more visible.
18:20:34FromDiscord<_timurski> i agree
18:20:40FromDiscord<_timurski> i'm very excited for Nim 3 compiled plugins
18:20:54FromDiscord<_timurski> right now i have to hack around with a 2 stage build system because comptime interpreter is too slow
18:21:04FromDiscord<_timurski> In reply to @_timurski "i'm very excited for": + people are already making borrow checkers with this
18:21:09FromDiscord<_timurski> but there is so much more you could do
18:21:28FromDiscord<_timurski> jonathan blow made a good point that the rust borrowchecker is one system that is `constraints -> guarantees`
18:21:35FromDiscord<_timurski> and that there are likely many other useful such systems
18:21:50FromDiscord<_timurski> for example writing part of your code in a state machine format that is checked at compile time and you're guaranteed certain things
18:22:12FromDiscord<_timurski> really just a very nice system
18:22:30FromDiscord<_timurski> hopefully in 2027 or 2028 Nim3 is all i'll be using
18:22:58FromDiscord<_timurski> and with good tooling Nim might finally hit mainstream
18:23:04FromDiscord<gesee37> In reply to @_timurski "+ people are already": I would recommend that experience to nobody 😅. Not that it's awful but while doing it I was just understanding why I don't like borrow checking and why values semantics is waaaay better
18:23:16FromDiscord<_timurski> yeah no that's understandable
18:23:23FromDiscord<_timurski> but the fact that it's even possible is quite awesome
18:24:36FromDiscord<gesee37> I wa thinking about it as a real way to add constraints to AI (or make custom compiler pass).↵Since everyone is vibe coding, at least we can make sure the compiler prevent them from doing some shit :p
18:24:45FromDiscord<gesee37> (edit) "wa" => "was"
18:25:33FromDiscord<_timurski> tbh not sure how effective that'll be but yeah in general static analysis is great for preventing bugs
18:26:38FromDiscord<_timurski> In reply to @gesee37 "I was thinking about": it's 2026 and I'm finally getting on the llm hype train. planning to write my own orchestration and such. main goal is to figure out how to be extremely token efficient with task and progress state representation
18:26:50FromDiscord<gesee37> In reply to @_timurski "tbh not sure how": I was thinking of highly context dependent constrainst that could also apply to variables and stuff.↵Like don't do X or Y, follow these guidelines, don't introduces side effects, etc etc
18:27:07FromDiscord<_timurski> there's actually a lot of research on agent orchestration and memory management and delegation and such
18:27:14FromDiscord<_timurski> but it doesn't seem like many people are reading it lol
18:27:32FromDiscord<_timurski> even when a study shows a 10x token decrease in some cases
18:27:41FromDiscord<_timurski> In reply to @gesee37 "I was thinking of": yeah
18:27:57FromDiscord<_timurski> In reply to @_timurski "even when a study": i only have a $20 openai plan and i gotta make that work
18:28:03FromDiscord<gesee37> In reply to @_timurski "it's 2026 and I'm": I am only missing the tokens to get on train 😅
18:28:46FromDiscord<_timurski> can't lie the biggest issue for me with llms rn is they won't tell you when they're not sure what to do
18:28:56FromDiscord<_timurski> like I want to be making all of the decisions
18:29:06FromDiscord<_timurski> if I missed a decision that should've been made it should abort immediately
18:29:14FromDiscord<_timurski> but I can't ever get them to do that properly
18:30:12FromDiscord<_timurski> llms work so well for math research because the goal is crystal clear
18:30:22FromDiscord<_timurski> programming is suffering because it's not as precise
18:30:46FromDiscord<gesee37> In reply to @_timurski "can't lie the biggest": And if tell them to ask they end up asking what to do for everything.↵I requires metacognition to know when you don't know so it's the whole problem.↵They can't know it's wrong until they encounter a contradiction
18:32:42FromDiscord<_timurski> yeah i think it would be nice to figure out some optimum where i can reliably define "decisions within these specific scopes you can handle yourself" but any ambiguity about the expected output or some specific implementation details should be sent back to the user
18:35:00FromDiscord<_timurski> writing code is a hobby and while i am still using it to learn a lot, i use it as a break from the truly difficult things for me like math and physics studying, so offloading some of the smaller details is not really much of a loss for me
18:35:11FromDiscord<_timurski> but that doesn't mean i don't want a quality result :>
18:35:54FromDiscord<_timurski> like the happiest i ever am with llms is when i do something like "i need to solve this problem with these assumptions. research existing methods for this" and that always works very well
18:36:12FromDiscord<_timurski> if i could get that level of satisfaction with agentic coding that would be great
18:38:54FromDiscord<gesee37> In reply to @_timurski "like the happiest i": Well it's kind of hard.↵Sometimes when going really low level, AI also start to be... less reliable as they flag som commands as "dangerous"↵Like they are more concerned by "ethics" than laws.↵The problem is that "ethics" is not something as clearly defined as law so you often feels like they are getting overly defensive for random shit
18:39:40*beholders_eye joined #nim
18:40:11FromDiscord<gesee37> So you always need to frame your work under all sort of name like you were hiding something while it's completely legal 😑
18:40:52FromDiscord<_timurski> In reply to @gesee37 "Well it's kind of": what kind of prompts are you sending that give you these problems 😆
18:42:46FromDiscord<gesee37> In reply to @_timurski "what kind of prompts": Like when I discovered the famous fork bomb and asked it about that to prank a friend.↵It was like "No, I can't help you to do a DoS attack" I was like "how is it a dangerous ?"
18:43:01FromDiscord<gesee37> He just need to reboot it's pc and it over
18:43:19FromDiscord<gesee37> (edit) "it" => "it's"
18:44:13FromDiscord<gesee37> Also since I am working on a cheat engine currently for some game I like but am too lazy to explore every secret, asking question is an interogation