<< 02-07-2022 >>

00:00:04*syl quit (*.net *.split)
00:00:04*sagax quit (*.net *.split)
00:00:04*averell quit (*.net *.split)
00:00:05*GreaseMonkey quit (*.net *.split)
00:00:05*gsalazar quit (*.net *.split)
00:00:05*matt_13377 quit (*.net *.split)
00:00:23*matt_13377 joined #nim
00:00:27*gsalazar joined #nim
00:00:30FromDiscord<retkid> whats the function to convert a hex into to a hex char
00:00:40FromDiscord<retkid> eg procy(20) == "
00:00:42FromDiscord<retkid> (edit) """ => """"
00:00:42FromDiscord<retkid> (edit) """" => "" ""
00:01:12*greaser|q joined #nim
00:01:25FromDiscord<retkid> might be toHex
00:01:26*averell joined #nim
00:01:33*averell quit (Changing host)
00:01:33*averell joined #nim
00:01:46FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/992580810005819472/unknown.png
00:01:47FromDiscord<retkid> no
00:02:25FromDiscord<demotomohiro> https://nim-lang.org/docs/strutils.html#toHex%2CT
00:02:51FromDiscord<j-james> `char(0x20)`?
00:03:30FromDiscord<demotomohiro> !eval echo char(0x20)
00:03:34NimBot
00:03:48FromDiscord<retkid> its base 10 ints
00:04:15FromDiscord<retkid> i got it i think
00:04:25*syl joined #nim
00:04:41FromDiscord<retkid> hmm
00:05:15FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#lexical-analysis-numeric-literals
00:07:03FromDiscord<retkid> parseHexStr(toHex(42))
00:12:06FromDiscord<j-james> In reply to @j-james "i think the problem": turns out this does actually cause a problem - as `result != return T`
00:13:04FromDiscord<j-james> so i've got a bunch of useless structures as the layouts' parents instead of a pointer to the returned type
01:21:52*CyberTailor joined #nim
02:46:28FromDiscord<valerga> does breaking inside a block, which is inside a for, not break the for?
02:47:15FromDiscord<j-james> it should not
02:47:57FromDiscord<valerga> so it breaks what, the block?
02:48:11FromDiscord<j-james> yeah
02:48:14FromDiscord<valerga> using continue works as expected though so idk
02:48:30FromDiscord<j-james> if you want to break out of both the block and the for loop, you can use a named block
02:48:38FromDiscord<valerga> that's what i do yeah
02:50:19FromDiscord<j-james> sent a code paste, see https://play.nim-lang.org/#ix=41p0
02:50:50FromDiscord<valerga> so inside the block, "break", and "continue", do the same?
02:50:50*CyberTailor quit (Remote host closed the connection)
02:51:25FromDiscord<valerga> without using the name
02:52:00FromDiscord<j-james> break and continue should refer to the current scope
02:52:18FromDiscord<valerga> ok yeah. i mean on outer scrope
02:52:20FromDiscord<valerga> (edit) "scrope" => "scope"
02:52:25FromDiscord<valerga> inside the block
02:53:46FromDiscord<j-james> oh inside `block name` but outside the for loop and the second block?
02:53:49FromDiscord<j-james> yes
02:54:34*CyberTailor joined #nim
02:56:30FromDiscord<j-james> yeah you don't _need_ to name named blocks in break statements
03:02:05FromDiscord<j-james> In reply to @valerga "using continue works as": oh yeah - continue statements aren't effected by blocks
03:02:22FromDiscord<j-james> /s/effected/affected
03:02:45FromDiscord<j-james> (edit) "effected" => "affected"
03:03:09FromDiscord<j-james> they'll just immediately skip to the next iteration
03:08:23FromDiscord<Elegantbeef> Continue is only effected by continuable control
03:08:26FromDiscord<Elegantbeef> So `for` and `while`
03:10:36FromDiscord<!Patitotective> hey guys i was thinking on making a twitter bot that retweets & likes any tweet with the #nimlang hashtag or containing "nimlang"↵how else do you guys think i should filter the tweets? i was thinking of only in english and maybe exclude tweets including the word malware lol
03:11:00FromDiscord<Elegantbeef> This is indeed a society
03:11:46FromDiscord<Prestige> I hate twitter
03:12:12FromDiscord<Elegantbeef> Well we're not answering their question with our critique 😛
03:12:36FromDiscord<Elegantbeef> Sounds fine to filter the way you're doign
03:12:59FromDiscord<Prestige> I think he should filter out all the tweets, then work on literally anything else
03:13:25FromDiscord<!Patitotective> :[
03:13:46FromDiscord<Elegantbeef> Though this gives me an idea a social media platform where traffic is done by bots but content is human generated
03:13:48FromDiscord<Elegantbeef> We can call it insert your least favourite social media platform here
03:14:19FromDiscord<!Patitotective> In reply to @Elegantbeef "Though this gives me": that sounds like youtube but well made
03:14:46madpropswondering if any of you have as an example of a simple nim program published in the arch's aur ?
03:15:04FromDiscord<Elegantbeef> Is nimdow there?
03:15:06FromDiscord<Elegantbeef> I dont recall
03:15:22madpropshttps://archlinux.org/packages
03:15:27madpropsoh wait
03:15:36madpropshttps://aur.archlinux.org/packages
03:16:11madpropsit should depend on the nim compiler. then just fetch from github, and compile
03:16:18madpropsim looking for an example pkgbuild
03:16:25FromDiscord<Elegantbeef> There you go now hit prestige to give you answers
03:16:30FromDiscord<Prestige> Yes nimdow-bin is in the aur
03:16:48FromDiscord<Prestige> I just have it upload the pre-compiled binary though
03:17:04FromDiscord<Elegantbeef> Not very archy
03:17:06FromDiscord<Prestige> Cuz I couldn't figure out how to pull in Nim so I could compile nimdow
03:17:28FromDiscord<Prestige> Cuz nim was super outdated and we couldn't pull down choosenim etc
03:17:42FromDiscord<Elegantbeef> Well it's modern now iirc
03:17:54FromDiscord<ripluke> In reply to @Elegantbeef "Not very archy": What does that mean
03:18:09FromDiscord<Elegantbeef> Does what i say ever really have meaning
03:18:31FromDiscord<!Patitotective> ive already said this, hes high
03:18:47FromDiscord<ripluke> In reply to @Avahe "Cuz I couldn't figure": It's 1.4.8
03:18:53FromDiscord<Prestige> @ripluke do you have any PKGBUILD experience?
03:18:59FromDiscord<ripluke> Yes lol
03:19:07FromDiscord<Elegantbeef> I'm never high, i thought that arch had a reputation for easily enabling compilation from source
03:19:07FromDiscord<ripluke> I literally only package for arch
03:19:20FromDiscord<Prestige> nim is 1.6.6 in community/nim
03:19:26FromDiscord<Prestige> So you should be good
03:19:46FromDiscord<ripluke> They updated it then
03:20:11FromDiscord<Prestige> yeah pretty recently
03:21:10FromDiscord<Prestige> oh it was madprops that was asking, mb
03:21:37madpropsyeah im reading the guidelines
03:21:40madpropsdon't want to mess up
03:21:45FromDiscord<Prestige> https://wiki.archlinux.org/title/Creating_packages#PKGBUILD_functions
03:21:59FromDiscord<Prestige> and check out other PKGBUILDs with build steps
03:22:17FromDiscord<ripluke> Funny thing I actually figured out how to write pkgbuilds from reading the nimdow pkgbuild
03:23:27FromDiscord<Prestige> Heh, that's cool
03:23:35FromDiscord<ripluke> Lol yea
03:25:31FromDiscord<Prestige> If I land this new job, I'll have to start using Ubuntu for work. So I'll likely be packaging it for Ubuntu then
03:25:43FromDiscord<ripluke> Oh
03:25:56FromDiscord<Elegantbeef> Sorry for your loss 😄
03:25:58FromDiscord<Elegantbeef> snapd WM when?
03:26:05FromDiscord<ripluke> Lol I have to write a pkgbuild now for an aur now
03:26:15FromDiscord<ripluke> In reply to @Elegantbeef "snapd WM when?": 😳😳
03:26:28FromDiscord<ripluke> I'd use it 💀
03:26:38FromDiscord<!Patitotective> In reply to @Elegantbeef "Sorry for your loss": 😄
03:26:46FromDiscord<ripluke> (edit) "use" => "~~use~~ try"
03:30:13FromDiscord<Prestige> In reply to @Elegantbeef "Sorry for your loss": Yeah, at least it's Linux though
03:30:42FromDiscord<Prestige> If it's not managed like crazy I could transform it into whatever I'd like
03:31:10FromDiscord<Elegantbeef> at that point just use debian and play it off 😛
03:34:01FromDiscord<Prestige> Eh has to be some specific ubuntu lts version unfortunately
03:36:21madpropsripluke you have an example of a pkgbuild that pulls from github and compiles with the nim compiler?
03:37:10madpropsthis is a simple program though, doesn't even have 3rd party libs
03:37:22madpropsonly depends on the compiler
03:37:54FromDiscord<ripluke> Yup
03:38:05FromDiscord<ripluke> Give me a sec
03:40:11FromDiscord<ripluke> sent a code paste, see https://play.nim-lang.org/#ix=41p4
03:40:57FromDiscord<Prestige> I thought you're not supposed to use sudo for install here
03:41:14FromDiscord<ripluke> idk it didnt work without it
03:41:25madpropsare you installing to /usr/local/bin?
03:41:25FromDiscord<ripluke> so i just put it there
03:41:29FromDiscord<ripluke> yea
03:41:30FromDiscord<Prestige> Gotta do like `install -D "nimdow-$pkgver" "$pkgdir/usr/bin/nimdow"`
03:41:33madprops"Packages should never be installed to /usr/local/"
03:41:36madpropsfrom the docs ^
03:41:40FromDiscord<j-james> hey, we've got an aur helper written in nim
03:41:41FromDiscord<ripluke> oh
03:41:42FromDiscord<j-james> https://aur.archlinux.org/packages/pakku
03:41:59FromDiscord<ripluke> In reply to @j-james "hey, we've got an": lol im actually working on one
03:42:14FromDiscord<ripluke> In reply to @madprops ""Packages should never be": yea this was my first pkg
03:42:27FromDiscord<ripluke> it gets the job done tho
03:44:48FromDiscord<!Patitotective> also guys, what do you think is the best way to host the twitter bot? running it with a cron task locally? heroku?
03:47:09FromDiscord<ripluke> Nvim is fun
03:47:14FromDiscord<ripluke> Super fun
03:47:19FromDiscord<Prestige> I love neovim
03:47:31FromDiscord<ripluke> Yea but it has quirks
03:47:33FromDiscord<Prestige> In reply to @Patitotective "also guys, what do": How do you want it to run, periodically?
03:47:47*noeontheend joined #nim
03:47:51FromDiscord<!Patitotective> yea
03:47:57FromDiscord<ripluke> In reply to @ripluke "Yea but it has": Like pasting with "p" always puts it in the wrong spot
03:48:11FromDiscord<Prestige> Huh? It works perfectly for me
03:48:48FromDiscord<ripluke> Idk sometimes when I want to paste something inside a string, it puts it outside of the quotes
03:49:00FromDiscord<!Patitotective> In reply to @Patitotective "also guys, what do": actually github actions might work :o
03:49:08FromDiscord<ripluke> In reply to @Patitotective "actually github actions might": Ya
03:49:16FromDiscord<Prestige> Depends if you yanked a newline at the end, or if your cursor is inside the quotes
03:49:24FromDiscord<Prestige> but it works consistently and how it's intended to work
03:50:00FromDiscord<ripluke> In reply to @Avahe "Depends if you yanked": Yea but with shift+v then yanking it does that
03:50:24FromDiscord<Prestige> That yanks the newline at the end of the line
03:50:36FromDiscord<Prestige> and `p` pastes _after_ the current character
03:51:08FromDiscord<Prestige> maybe you want `yg_` then you can `p`
03:51:32FromDiscord<Prestige> or `0yg_`
03:51:48FromDiscord<ripluke> In reply to @Avahe "maybe you want `yg_`": I'll try that
04:01:36FromDiscord<Rika> Shift P?
04:03:12madpropsshould i make the arch x86_64 or any for the pkgbuild if nim is compiling it?
04:07:31madpropsim guessing nim can compile to anything
04:10:39FromDiscord<Prestige> In reply to @Rika "Shift P?": That'd put it on the previous line if he's yanked a whole line
04:25:50FromDiscord<!Patitotective> does nim have a URL query parser?
04:31:05*arkurious quit (Quit: Leaving)
04:32:15FromDiscord<j-james> url queries?
04:33:08FromDiscord<!Patitotective> `https://github.com/search?q=parser&l=nim`↵the `?key=val&otherkey=otherval`
04:33:19FromDiscord<Elegantbeef> `std/uri`
04:33:30FromDiscord<j-james> anything that implements uri parsing should do that
04:33:33FromDiscord<j-james> https://github.com/treeform/urlly is another one
04:34:50*noeontheend quit (Ping timeout: 260 seconds)
04:35:10FromDiscord<!Patitotective> :]
04:39:54*noeontheend joined #nim
04:42:26FromDiscord<Prestige> `This library has no dependencies other than the Nim standard library.`
04:42:28FromDiscord<Prestige> Music to my ears
04:51:08FromDiscord<huantian> But you do realize that if you use it your library now has an extra rep
04:52:39FromDiscord<Elegantbeef> Rep or dep?!
04:53:03FromDiscord<huantian> Dep lmao
04:55:02*noeontheend quit (Ping timeout: 260 seconds)
04:58:45FromDiscord<Prestige> In reply to @huantian "But you do realize": 🤔
05:09:44FromDiscord<j-james> got that treeform rep
05:22:09*CyberTailor quit (Remote host closed the connection)
05:22:52*CyberTailor joined #nim
05:28:37*rb quit (Quit: ZNC - https://znc.in)
05:34:14*rwb joined #nim
05:44:02madpropsuploaded the package if anybody wants to try it !
05:44:03madpropshttps://aur.archlinux.org/packages/goldie-git
06:06:13FromDiscord<Prestige> Is that like ripgrep?
06:06:43madpropshaven't used that. i used ag before, but it sometimes just wouldn't work. so i wrote my own thing
06:06:56madpropsand it's surprisingly fast
06:50:02FromDiscord<d4rckh> any cool library for generating text tables?
06:51:30FromDiscord<Elegantbeef> As a TUI?
06:53:28FromDiscord<d4rckh> yes
06:54:00FromDiscord<Elegantbeef> https://github.com/xmonader/nim-terminaltables
06:55:20FromDiscord<d4rckh> thanks, looks pretty
07:31:24*rockcavera quit (Remote host closed the connection)
07:41:07*greaser|q quit (Changing host)
07:41:07*greaser|q joined #nim
07:41:10*greaser|q is now known as GreaseMonkey
07:51:49*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
07:54:38*wallabra joined #nim
08:14:10FromDiscord<Casato> Hello, can anyone show me an example of downloading file (yes downloading) via puppy library?
08:14:43FromDiscord<ezquerra> Why not use httpclient?
08:15:08FromDiscord<Casato> I woud like to stick with native libraries
08:15:39FromDiscord<ezquerra> Not sure what you mean. httpclient is in the standard library
08:17:06FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=41pB
08:17:33FromDiscord<Casato> sent a code paste, see https://play.nim-lang.org/#ix=41pC
09:04:13*Network2501 quit (Read error: Connection reset by peer)
09:49:25madpropswhat's faster than strutils.contains ?
09:51:25FromDiscord<Rika> What’s your exact use case, there might be a better way than naive string operations
09:51:37madpropsi want to check if a substring exists in a line of text
09:51:52madpropsin a case insensitive manner. currently i toLower it
09:52:10madpropsbut that the bottleneck is at contains
09:53:42madpropsim gonna try re.contains
09:54:17FromDiscord<Rika> Regex is possibly slower
09:54:34FromDiscord<Rika> Might not be depending on optimisations but it’s prolly going to be slower
09:57:11madpropshmm how can i build this
09:57:14madpropslet regexp = re(&"/{q}/")
09:57:21madpropstrying to use the variable (q)
10:00:47madpropsre(q) works in my case
10:01:12madpropsbut speed is basically the same
10:01:57madpropsim trying to beat "ag" in speed but something funny happens
10:02:05madpropsit alternates between 6ms and 16ms in time
10:02:12madpropsit's not consistent (ag)
10:02:28madpropsmy implementation is at around 14ms but consistent
10:04:49madpropsbut ag is still faster overall when i try whole directories
10:05:09madpropsit probably cheats in some way
10:11:27madpropsah interesting. like 10ms from the 16ms are spent making it toLower
10:23:47FromDiscord<phargob> alloc() documentation suggests a separate heap per thread. with ARC/ORC is this valid anymore? isnt there one shared heap?
10:29:42FromDiscord<vindaar> are you using `toLower` for unicode runes or for regular chars? the former is likely pretty slow. the latter should be pretty quick (just shifting based on `ord`)↵(<@709044657232936960_madprops=5b=49=52=43=5d>)
10:29:50FromDiscord<Rika> How are you profiling your application
11:24:03FromDiscord<enthus1ast> ag is the\_silver\_searcher right?
11:24:13FromDiscord<enthus1ast> they also use pcre ↵#include \<pcre.h\>
11:43:34FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=41qf
11:46:34FromDiscord<Yardanico> I have a similar proc in my Nim eventer , lemme see if it's better
11:47:08FromDiscord<Phil> I have a playground project with benchy etc. already set up, if you can throw in the proc I can copy paste it in quickly for a comparison
11:47:33FromDiscord<Yardanico> it's a bit different as it does that by words
11:47:38FromDiscord<Yardanico> But there's an idea to make your proc faster
11:48:01FromDiscord<Yardanico> iterate on split (there's an iterator version of it) and increment untill you get 40 words
11:48:05FromDiscord<Yardanico> then just break
11:49:04FromDiscord<Yardanico> rugby now you split, then slice and then join again
11:49:38FromDiscord<Yardanico> I'm not a home so I can't write a complete proc, maybe in the evening
11:52:32FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=41qg
11:53:28FromDiscord<Yardanico> how are you benchmarking?
11:54:10FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=41qi
11:54:13FromDiscord<Yardanico> this doesn't keep the result string
11:54:24FromDiscord<Yardanico> Add `keep str` to all blocks
11:55:14FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=41qj
11:56:22FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=41qk
11:56:31FromDiscord<Yardanico> you don't need the splitString, as I said, use split as an iterator
11:56:43FromDiscord<Phil> Ohhh that's what you meant, alrighty, let me see
11:57:20FromDiscord<Yardanico> https://nim-lang.org/docs/strutils.html#split.i%2Cstring%2Cchar%2Cint
11:57:32FromDiscord<Yardanico> Also you don't need to concat like that
11:58:19FromDiscord<Yardanico> " " & str
12:00:11FromDiscord<Phil> Holy shit
12:00:30FromDiscord<Phil> Okay, yeah that's a significantly better approach, and I haven't even done anything to the concat yeah
12:00:58FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=41qn
12:02:02FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=41qo
12:03:02FromDiscord<Yardanico> you can make it add word first and space later, then you can remove setLen but you'll have a leading space
12:04:07FromDiscord<Phil> Given that I'll be adding "..." to indicate there's more text either way, I think I can save myself the hassle of even doing that
12:04:54FromDiscord<Yardanico> yeah although this approach makes it impossible to not add ... if you put in the whole string
12:05:06FromDiscord<Yardanico> you can make it possible with parseutils, but it'll be a bit more low level
12:12:30*attah joined #nim
12:14:26*Guest21aaaaaa joined #nim
12:14:49*Guest21aaaaaa quit (Client Quit)
12:17:42FromDiscord<Phil> sent a code paste, see https://paste.rs/EFO
12:18:31FromDiscord<Phil> I've rerun he above a couple of times, at avg time of the last 3 fluctuates enough that any one of them is first place depending on chance
12:19:00*FromDiscord quit (Remote host closed the connection)
12:19:13*FromDiscord joined #nim
12:20:09FromDiscord<Yardanico> yes, but it depends on what input you feed to them
12:20:27FromDiscord<Yardanico> the preallocated memory one will be more performant for longer strings with longer words
12:23:31FromDiscord<enthus1ast> this is the truncate in nimjautils\: https://github.com/enthus1ast/nimja/blob/620aceecd91a9c34b408755e5a50ce6218cc33a7/src/nimja/nimjautils.nim#L113
12:24:09FromDiscord<enthus1ast> idk how well it performs
12:24:31FromDiscord<Yardanico> it keeps the whole string split in memory
12:24:48FromDiscord<Phil> sent a code paste, see https://paste.rs/UIN
12:26:57FromDiscord<Phil> In reply to @enthus1ast "this is the truncate": Hmmm you truncate by characters, rather than words
12:27:10FromDiscord<Yardanico> I do too in nimeventer
12:27:17FromDiscord<Yardanico> But I check if it's the word boundary
12:28:08FromDiscord<Yardanico> So I split by words but max context length is in chars
12:28:11FromDiscord<enthus1ast> do you want to truncate by words?
12:28:18FromDiscord<Yardanico> that way you can control resulting length of the string better
12:28:23FromDiscord<Yardanico> I think it makes more sense
12:28:42FromDiscord<Yardanico> Unless you're doing unicode, then doing that is not so simple
12:29:06FromDiscord<Phil> In reply to @enthus1ast "do you want to": I originally wanted to in order to avoid having cut-off words and thought doing it by word was simpler than doing it by char overall
12:29:35FromDiscord<Phil> Due to the complexity added by checking for "am I in the middle of a word, if not add more chars/remove chars until I am not"
12:30:02FromDiscord<Yardanico> There's no complexity
12:30:04FromDiscord<Phil> Which I found not-so-nice to have for a first naive implementation
12:30:36FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=41qt
12:30:43FromDiscord<Yardanico> fullText is needed to add ...
12:31:08FromDiscord<Yardanico> postWords can be str.split(' ')
12:31:42FromDiscord<Yardanico> although after that I join the words from res seq, you can add words inline like you do already
12:32:33FromDiscord<Yardanico> So you still split by words, but you have precise control over max context string length
12:35:33FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=41qw
12:36:13FromDiscord<Phil> Just an FYI since I thought you might find it interesting
12:37:32FromDiscord<Phil> From what I've seen, performance wise `splitWhitespace.pairs()` is really hurting
12:37:42FromDiscord<enthus1ast> yeah, some perfomance potential still there
12:37:44FromDiscord<Phil> (edit) "hurting" => "hurting, compared to having var i = 0"
12:38:02FromDiscord<enthus1ast> ill fiddle with it a little
12:38:26FromDiscord<Yardanico> Yeah you can just use std/enumerate instead
12:38:27FromDiscord<Phil> I think I should do a lot more optimizations. Not that they're insanely useful for me, but you can learn quite a bit
12:38:36FromDiscord<Yardanico> there's a splitWhitespace iterator iirc
12:38:37FromDiscord<Phil> It's fun!
12:38:41FromDiscord<Yardanico> And enumerate adds indexes
12:38:46FromDiscord<Yardanico> to iterators
12:40:39FromDiscord<enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=41qx
12:40:41FromDiscord<enthus1ast> indeed wow
12:40:57FromDiscord<Phil> Yeah, similar results here
12:41:18FromDiscord<Phil> sent a code paste, see https://paste.rs/2f8
12:41:35FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=41qy" => "https://play.nim-lang.org/#ix=41qA"
12:44:43FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=41qB
12:45:11FromDiscord<Yardanico> enumerate is the same as manual indexing
12:45:13FromDiscord<Phil> I guess it gets compiled into similar assembly in the end
12:45:15FromDiscord<Phil> Check
12:45:20FromDiscord<enthus1ast> thinks its quite the same
12:45:34FromDiscord<Phil> I'll definitely keep enumerate in mind more
12:46:13FromDiscord<Yardanico> I mean it's just sugar over manually declaring a variable and inc'ing it
12:46:37FromDiscord<Phil> I like sugar, I'll use that sugar
12:47:10FromDiscord<enthus1ast> wonder if we can teach the pairs() or the normal looping these tricks as well
12:47:31FromDiscord<enthus1ast> would be nice if the simplest is also the fastest
12:48:55FromDiscord<Yardanico> but the problem is that you call pairs on the non-iterator version
12:49:01FromDiscord<enthus1ast> yes
12:49:04FromDiscord<Yardanico> You can't really compose non-closure iterators
12:49:47FromDiscord<enthus1ast> did you not have these lib (zero functional?)↵(@Yardanico)
12:50:46FromDiscord<enthus1ast> ah no, but stuff like this would be nice
12:55:58FromDiscord<enthus1ast> sent a code paste, see https://paste.rs/n6Q
12:56:21FromDiscord<enthus1ast> min time is not always lower, but avg is always
12:56:43FromDiscord<Phil> it also seems to fluctuate less if the std dv is semi stable
12:56:48FromDiscord<enthus1ast> yes
12:57:05FromDiscord<Phil> I guess because less allocations mean less chance of having to wait for the system or sth?
12:57:20FromDiscord<enthus1ast> yes i also think so
12:58:58FromDiscord<enthus1ast> think i pr nimja \:D
12:59:34FromDiscord<Phil> Thanks Yard!
12:59:41*TakinOver joined #nim
12:59:47FromDiscord<enthus1ast> yeah
13:01:00FromDiscord<Phil> Actually, I'll post some of this on stackexchange codereview simply because I can
13:33:56FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=41qK
13:34:19FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=41qL
13:36:36FromDiscord<enthus1ast> huh
13:36:42FromDiscord<enthus1ast> what can possible be -4 here
13:37:05FromDiscord<Phil> no clue. even if I pass in straight up 400 into newStringOfCap it throws that
13:37:37FromDiscord<enthus1ast> maybe its something else
13:37:57FromDiscord<enthus1ast> (have to leave, get some food etc..)
13:57:50madprops> Error: Can't read '' :o
14:11:28NimEventerNew thread by NameUndefined: ErrorStream(p) returns output stream, see https://forum.nim-lang.org/t/9277
14:17:05FromDiscord<halc> sent a code paste, see https://paste.rs/KK1
14:17:05*pch quit (Read error: Connection reset by peer)
14:17:44*pch joined #nim
14:17:54FromDiscord<halc> sent a code paste, see https://play.nim-lang.org/#ix=41qR
14:18:33FromDiscord<halc> (edit) "https://play.nim-lang.org/#ix=41qT" => "https://play.nim-lang.org/#ix=41qS"
14:18:35*arkurious joined #nim
14:19:06FromDiscord<halc> In reply to @halc "I had been getting": just make a test `hello-world.nim` and try using `newStringOfCap`
14:21:57FromDiscord<halc> ah wait, yours is a runtime error
14:22:02FromDiscord<halc> mine happened at compile-time
14:22:06FromDiscord<halc> probably not the same issue
15:07:27FromDiscord<Phil> The proc itself even works, it's just when I throw it in a timeit block that the error occurs
15:11:18*noeontheend joined #nim
15:12:50FromDiscord<xflywind> I checked with `koch temp`. It seems to be a benchy/Nim bug => .nimble\pkgs\benchy-0.0.1\benchy.nim(109)
15:13:33FromDiscord<xflywind> https://media.discordapp.net/attachments/371759389889003532/992810265202667551/unknown.png
15:15:41FromDiscord<xflywind> `template dots(n: Natural): string =` requires `Natural`, but the pass parameters `dots(40 - tag.len - m.len)` is somehow equal to `-4`.
15:16:02FromDiscord<xflywind> https://github.com/treeform/benchy/blob/848dc851559d48b60bd368fddb2761414daa8c3c/src/benchy.nim#L109
15:18:40FromDiscord<Yardanico> but it's a template
15:19:00FromDiscord<Yardanico> I don't think Natural would affect anything for a template
15:19:18FromDiscord<Yardanico> it should be a proc so Natural can actually check the range of the int
15:19:24FromDiscord<xflywind> Change 40 to 60 works.
15:19:36FromDiscord<xflywind> (edit) "Change 40 to 60 ... works." added "and then it"
15:20:51FromDiscord<xflywind> In reply to @Yardanico "I don't think Natural": Yeah, it calls `repeat` internally => `func repeat(c: char, count: Natural)`
15:23:34FromDiscord<xflywind> For a naive solution, I thin it should change `40` to a variable adjusting itself relative to `tag.len + m.len` in case that they are too large.
15:24:17FromDiscord<xflywind> In reply to @Isofruit "The proc itself even": In this case I think benchy cannoyt handle a tag name which is as long as `truncate_breakfor_enumerate_memoryalloc`.
15:24:23FromDiscord<xflywind> (edit) "cannoyt" => "cannot"
15:24:35FromDiscord<Phil> The length of the tag name is the issue? Fascinating
15:25:44FromDiscord<xflywind> Yeah, shorter name works. You can submit a issue or PR to benchy.
15:26:02FromDiscord<xflywind> sent a code paste, see https://play.nim-lang.org/#ix=41ro
15:26:04FromDiscord<xflywind> (edit)
15:32:16FromDiscord<xflywind> In reply to @Isofruit "The length of the": These has been a fix => https://github.com/treeform/benchy/pull/11
15:32:26FromDiscord<xflywind> (edit) "These" => "There"
15:35:19FromDiscord<Phil> In reply to @flywind "There has been a": Check, thanks, noted that in the issue
15:36:38FromDiscord<dain> i got the new nim book that araq wrote
15:36:43FromDiscord<dain> trying to follow the first example
15:37:00FromDiscord<dain> it doesnt work, sdl window just shows what's below
15:37:04FromDiscord<dain> https://media.discordapp.net/attachments/371759389889003532/992816183973777458/unknown.png
15:37:07FromDiscord<dain> i drag it around and it's fixed
15:37:39FromDiscord<dain> also i got errors when i tried to do it at first, book doesnt say to install SDL dependencies first which i didnt have
15:37:59FromDiscord<dain> is there more stuff i need to install
15:40:29FromDiscord<Yardanico> can't really help as I don't have the book
15:40:40FromDiscord<Yardanico> Unless you show the code :P
15:41:10FromDiscord<dain> oh sorry i forgot
15:41:24FromDiscord<dain> sent a code paste, see https://play.nim-lang.org/#ix=41rr
15:41:30FromDiscord<xflywind> You can also send an email to ask support from the author.
15:42:08FromDiscord<Phil> Is that the entire code?↵Isn't there stuff like creating a window etc. missing?
15:42:20FromDiscord<Yardanico> pixels library does the
15:42:22FromDiscord<Yardanico> that
15:42:23FromDiscord<Yardanico> I think
15:42:24FromDiscord<dain> no the book just gives that code snippet and i typed it verbatim
15:42:29FromDiscord<Yardanico> Also, are you on Wayland?
15:42:33FromDiscord<dain> no
15:42:46FromDiscord<dain> actually how do i check
15:43:06FromDiscord<dain> KDE isnt wayland right
15:43:06FromDiscord<Phil> What distro do you use?
15:43:22FromDiscord<dain> manjaro kde
15:43:24FromDiscord<Phil> KDE does have wayland support backed in↵WHen you log in on the lower right you should be seeing a gear
15:43:40FromDiscord<Phil> That's where you choose what type of session to run, whether its wayland or not
15:44:01FromDiscord<Phil> Mot sure whether KDE defaults you to wayland already, I know gnome does
15:45:06FromDiscord<Yardanico> In reply to @dain "manjaro kde": do `echo $XDG_SESSION_TYPE` in the shell
15:45:15FromDiscord<Yardanico> I'm not sure Wayland is the case, but it might be
15:46:02FromDiscord<dain> x11
15:47:14FromDiscord<Phil> I just ran the example myself, can confirm error:↵`could not load: libSDL2_ttf(|-2.0).so(|.0)`
15:47:34FromDiscord<Phil> I am under wayland
15:47:45FromDiscord<Yardanico> well you need sdl
15:47:54FromDiscord<Yardanico> and sdl ttf obviously
15:48:06FromDiscord<xflywind> In reply to @Isofruit "I just ran the": https://github.com/Vladar4/sdl2_nim/blob/master/LINKS.md
15:48:08FromDiscord<Yardanico> Maybe Araq omitted that from the book in the hopes that people would have it installed already
15:49:37FromDiscord<Phil> Yeh, that info should've been included somewhere, if not in the book, then in the github page of pixels or some kind of docs there
15:50:32FromDiscord<xflywind> I agree.
15:51:55FromDiscord<Phil> Is pinging Araq a thing for this?
15:52:09FromDiscord<Phil> Ah, no, mail is an option you said earlier, nevermind.
15:53:45FromDiscord<xflywind> PR welcome for pixels 😜
15:55:13FromDiscord<xflywind> (edit) "PR" => "PR/Issue" | "PR/Issuewelcome for pixels 😜 ... " added "Since I will probably translate it later."
15:57:55*noeontheend quit (Ping timeout: 260 seconds)
15:58:11FromDiscord<Phil> I have way too little skin in the game to start writing the issue, as it would entail doing the research on what the needed package names are for the lib in an example I never plan on using and discovered as part of troubleshooting for somebody else
15:59:16FromDiscord<xflywind> Yeah, just kidding 😆
16:05:58FromDiscord<dain> k i made a github issue about it
16:18:21FromDiscord<dain> ill try it on my laptop as well
16:34:32FromDiscord<ripluke> Is getHomeDir run at compile time
16:40:57*pch quit (Read error: Connection reset by peer)
17:01:34FromDiscord<Rika> not that im aware of, no
17:01:51FromDiscord<Phil> It should not, since getHomeDir depends on environment variables
17:05:36*pch joined #nim
17:18:28*pch_ joined #nim
17:18:28*pch quit (Read error: Connection reset by peer)
17:29:44FromDiscord<Prestige> If it ran at compile time, you could compile it on your machine and send it to someone else, and the path would be incorrect - has to be runtime
17:30:38reversem3[m]Anyone uses nimlsp on neovim ?
17:30:55reversem3[m]How do you get the references to pop up ?
17:33:19*noeontheend joined #nim
17:39:34FromDiscord<ripluke> In reply to @Rika "not that im aware": Well when I have someone a binary of some code that read the home dir and made some folders it tried using my home dir
17:39:50FromDiscord<ripluke> Because I had compiled it
17:40:06FromDiscord<ripluke> When I sent them the code and they compiled it it worked fine
17:42:40*wallabra_ joined #nim
17:44:10*wallabra quit (Ping timeout: 272 seconds)
17:44:17*wallabra_ is now known as wallabra
17:47:25FromDiscord<PyryTheBurger> how do i prevent error lenght of seq changed while iterating over it?
17:49:23FromDiscord<Yardanico> copy the seq to a new variable and iterate over that copy
17:49:36FromDiscord<Yardanico> I mean iterate over the original and modify the cooy
17:49:42FromDiscord<Yardanico> (edit) "cooy" => "copy"
17:51:39*pch_ is now known as pch
17:51:40*noeontheend quit (Ping timeout: 260 seconds)
17:53:29reversem3[m]Ok I figured it out , you have to create the nim file first then you can go in to edit using nvim or neovim. For some reason you can't just create the file using neovim.
17:55:28*sagax joined #nim
17:56:54FromDiscord<Luckayla> In reply to @ripluke "When I sent them": Something sounds fucky. Might want to share your relevant code.
17:58:15FromDiscord<ripluke> sent a code paste, see https://play.nim-lang.org/#ix=41rQ
17:58:41FromDiscord<Rika> Const
17:58:50FromDiscord<Rika> Compile time
17:58:52FromDiscord<Rika> Use let
17:58:55FromDiscord<ripluke> oh
18:00:37FromDiscord<huantian> why not just use getCacheDir or whatever for yoru cache
18:01:32FromDiscord<ripluke> because i want the directory in a specific spot
18:02:09FromDiscord<huantian> but then you're not adhering to the xdg desktop specifications! 😛
18:09:16FromDiscord<ripluke> In reply to @huantian "but then you're not": Yea
18:13:36reversem3[m]where can I find more information between the differences of a ; semicolon and , comma using a nim proc ?
18:14:04FromDiscord<Phil> difference in what sense?
18:14:11FromDiscord<Phil> In proc parameters?
18:15:07reversem3[m]yes in proc parameters
18:19:29FromDiscord<Phil> https://nim-lang.org/docs/manual.html#statements-and-expressions↵https://nim-lang.org/docs/manual.html#procedures
18:19:40FromDiscord<Phil> The latter is what you're looking for, the former shows another way in how it's used
18:28:10reversem3[m]ok so its for readability ?
18:42:53*rockcavera joined #nim
18:42:53*rockcavera quit (Changing host)
18:42:53*rockcavera joined #nim
18:49:56FromDiscord<Phil> Of sorts. I'm really not the best person to ask, I'm personally not a massive fan of using `;` for separating proc params because it's a "non-standard" thing to me. But I also don't use `using` so...eh
18:50:46FromDiscord<Phil> It's one of those things you "have to know" and I tend to avoid those
18:50:59FromDiscord<Phil> (edit) ""have" => ""just have"
19:09:02reversem3[m]So you use only , "commas" for your proc parameters?
19:13:49FromDiscord<Phil> pretty much
19:14:30FromDiscord<Phil> ElegantBeef, enthus1ast, Rika or Yard likely can make a better case for using comma
19:14:54FromDiscord<Phil> Semicolon, I mean semicolobn
19:17:10reversem3[m]ok , thanks
19:21:29FromDiscord<Rika> Not really
19:21:47FromDiscord<Rika> If you don’t use using you don’t really have a reason to use semicolon other than preference
19:38:46FromDiscord<dom96> there is no differences between the comma and semicolon as far as I know
19:39:24FromDiscord<dom96> they are only there to allow more clearly to separate generic types in param lists
19:39:36FromDiscord<dom96> I also don't use them
19:49:47reversem3[m]dom96: what don't you use? semicolon , or colon?
19:50:43FromDiscord<dom96> semicolon
19:51:58FromDiscord<Yardanico> In reply to @dom96 "there is no differences": there are differences, but they only appear when you use `using|
19:52:06FromDiscord<Yardanico> (edit) "`using|" => "`using`"
19:52:16FromDiscord<enthus1ast> There is a difference↵(@dom96)
19:52:58FromDiscord<enthus1ast> a,b\: string
19:53:10FromDiscord<enthus1ast> Both are string
19:53:34FromDiscord<enthus1ast> a;b\: string
19:53:42FromDiscord<enthus1ast> Only b is string
19:54:09FromDiscord<enthus1ast> (I'm on mobile atm, sorry)
19:54:43FromDiscord<enthus1ast> This becomes relevant in generics
19:55:21reversem3[m]he's referring to `proc(x, y: int, s: string) to `proc(x, y: int, s: string)` comma compared to semi-colon for proc parameters
19:55:35FromDiscord<enthus1ast> Foo[A; B\: string\|int]
19:55:48FromDiscord<Yardanico> yes, this is a more common case than using actually
19:55:54reversem3[m]s/,/;/
19:57:02reversem3[m]Ok but the end of day using a semi-colon or a comma for proc parameters doesn't really matter.
19:57:17reversem3[m]Expect in special cases correct ?
19:57:21FromDiscord<Yardanico> I was replying to enthusiast
19:57:29reversem3[m]s/Expect/Except/
19:57:44FromDiscord<Yardanico> yes, in most cases the difference isn't visible, but the main thing is - , and ; ARE different
19:57:52FromDiscord<Yardanico> It's just that this different is not apparent in most cases
19:58:05FromDiscord<Yardanico> (edit) "different" => "difference"
19:58:12reversem3[m]great , got it
19:58:49FromDiscord<enthus1ast> No [A\: any, B\: int\|\|float] should also work in this case↵(<@709044657232936960_reversem3=5b=4datrix=5d>)
20:02:54reversem3[m]umm , now I'm confused
20:03:07reversem3[m]can you post that in a proc ?
20:04:22FromDiscord<Yardanico> proc test[A; B: SomeNumber](a: A, b: B)
20:04:33FromDiscord<Yardanico> in this case A will just be a generic for any type
20:04:43FromDiscord<Yardanico> While B is restricted for types from SomeNumber
20:05:14FromDiscord<Yardanico> If you replace ; with , both A and B will require the type to be SomeNumber
20:09:59reversem3[m]Ok so why doesn't this work using inim https://play.nim-lang.org/#ix=41sk
20:14:30FromDiscord<Yardanico> spacing I think
20:14:36FromDiscord<Yardanico> 0 ..<
20:18:44reversem3[m]hmm , https://play.nim-lang.org/#ix=41sr
20:19:23reversem3[m]/home/nixfreak/nim/master_nim/20220702/generics.nim(9, 15) template/generic instantiation of `items` from here
20:19:23reversem3[m]/home/nixfreak/nim/master_nim/20220702/generics.nim(5, 5) Error: type mismatch: got 'int' for 'i' but expected 'string'
20:22:12FromDiscord<Prestige> Weird, I'd expect that to work
20:34:20FromDiscord<Prestige> oh reversem3 you need `yield s[i]`
21:00:28reversem3[m]ahh yes thanks
21:22:42reversem3[m]https://play.nim-lang.org/#ix=41sI
21:23:30reversem3[m]Ok ... so stupid question (I think) if Point[float] is already declared as var p , why would you need to declare it again with x and y ?
21:24:11reversem3[m]var p: Point[float] p = Point[float](x: 1.0, y: 2.0)
21:26:18FromDiscord<Generic> I don't really understand what your question is
21:26:39FromDiscord<Generic> you can also write `var p = Point[float](x: 1.0, y: 2.0)` to do everything in one step
21:28:40reversem3[m]ok maybe that's what I was referring to
21:31:38reversem3[m]ok so var p: Point[float](x: 1.9, y: 3.4) is not the same as var p: Point[float](x: 1.8, y: 1.5)
21:31:53reversem3[m] * ok so var p = Point[float](x: 1.9, y: 3.4) is not the same as var p: Point[float](x: 1.8, y: 1.5)
21:37:59*pch quit (Quit: Leaving)
21:49:13*pch joined #nim
22:01:28FromDiscord<Elegantbeef> The answer reversem is that Nim doesnt have any funky intializer syntax it only has constructors or field access
22:03:36FromDiscord<Elegantbeef> You can of course use tuple assignment syntax https://play.nim-lang.org/#ix=41sT
22:34:17FromDiscord<!Patitotective> damn the twitter bot code is just 18 lines long↵i might have done something wrong, it needs to be longer
22:38:00FromDiscord<Elegantbeef> RIIR
22:38:08FromDiscord<Elegantbeef> Or RIIC
22:48:18*CyberTailor quit (Read error: Connection reset by peer)
22:49:09*CyberTailor joined #nim
22:53:20*CyberTailor quit (Remote host closed the connection)
22:54:10*CyberTailor joined #nim
23:06:01FromDiscord<!Patitotective> https://twitter.com/nimlangbot :D
23:27:44FromDiscord<retkid> efficient way to remove every 4th element in an array?
23:28:31FromDiscord<Elegantbeef> `del`
23:29:28FromDiscord<retkid> countup(0 x.high, 4):
23:29:30FromDiscord<retkid> (edit) "4):" => "4)"
23:29:48FromDiscord<retkid> (edit) "4)" => "4): x.del(delete)"
23:31:14FromDiscord<Generic> this won't work because eventually del will move items which where previously on a fourth position into the holes created by previous deletions
23:33:14FromDiscord<retkid> for delete in countup(0, a.high, 4): a.delete(delete)
23:33:22FromDiscord<retkid> i know
23:35:15FromDiscord<Elegantbeef> I mean they said delete the 4th element
23:35:39FromDiscord<voidwalker> why does adding entries to a table takes twice as long vs a sequence ?
23:36:11FromDiscord<voidwalker> same data, same algorithm
23:36:18FromDiscord<Elegantbeef> Oh i misread
23:36:36FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=41tf
23:36:38FromDiscord<Generic> tada, I think this'll do
23:37:19FromDiscord<Generic> (edit) "https://play.nim-lang.org/#ix=41tf" => "https://play.nim-lang.org/#ix=41tg"
23:37:49FromDiscord<Generic> In reply to @voidwalker "why does adding entries": because adding data to a table is a fundametally more complex operation
23:38:33FromDiscord<voidwalker> Searching string in the table values is also 2x or 3x slower
23:38:37FromDiscord<Elegantbeef> Tables are hashed
23:38:53FromDiscord<Elegantbeef> Also are you testing in release or debug?
23:38:59FromDiscord<voidwalker> in danger
23:39:11FromDiscord<Generic> In reply to @voidwalker "Searching string in the": searching as in iterating over it or using it's proper access functions?
23:39:33FromDiscord<voidwalker> @Generic iterating over all values to search for a substring
23:40:05FromDiscord<Generic> I think you should make yourself familiar with some basic knowledge on data structures
23:40:20NimEventerNew thread by Matthesoundman: How to let nim know to search an additional path for linking a lib?, see https://forum.nim-lang.org/t/9278
23:40:25FromDiscord<Generic> the data lies sparsely in a table
23:40:56FromDiscord<Generic> in a seq all values lies contigously in memory, accessing one by one is trivial
23:41:12FromDiscord<Generic> in a table it has to check every entry first to see if there even lies a value
23:42:22FromDiscord<Yardanico> huh?
23:42:25FromDiscord<Yardanico> there are hashes
23:42:40FromDiscord<Generic> hashes don't help you when iterating over the table
23:46:11FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=41th
23:46:19FromDiscord<retkid> (edit) "https://play.nim-lang.org/#ix=41th" => "https://play.nim-lang.org/#ix=41ti"
23:46:20FromDiscord<retkid> no need for that we have math
23:46:24reversem3[m]Type inference doesn't work for object construction , that's why.
23:47:19FromDiscord<Generic> sent a code paste, see https://play.nim-lang.org/#ix=41tj
23:47:25FromDiscord<retkid> good enough
23:47:36FromDiscord<Generic> not when O(n) is possible 😛
23:48:14FromDiscord<retkid> the largest the array will get is like 64
23:48:24FromDiscord<Elegantbeef> Or reversem you were asking why you had to specify its generic parameters?
23:48:29FromDiscord<Elegantbeef> oh reversem\
23:48:55FromDiscord<retkid> sent a code paste, see https://play.nim-lang.org/#ix=41tl
23:49:01FromDiscord<retkid> its chunked and it just slices the last element
23:49:15FromDiscord<Elegantbeef> Two maps and a slice
23:49:28FromDiscord<Elegantbeef> Damn buh bye heap allocations 😄
23:49:49FromDiscord<Generic> also string conversion :puke:
23:49:59FromDiscord<Elegantbeef> yea what're you even doing
23:49:59FromDiscord<retkid> In reply to @Generic "also string conversion :puke:": what other option do i have
23:50:11FromDiscord<retkid> I've shown too much I'm being questioned
23:50:16FromDiscord<Generic> bit and
23:50:39FromDiscord<Generic> ah no
23:51:33FromDiscord<Elegantbeef> I dont even get what you're doing
23:52:16FromDiscord<Generic> me not really either, though converting things to a string and then back again is just scary
23:52:18FromDiscord<retkid> https://y.yarn.co/531e70aa-a107-4f0f-b819-ce7f4a3ce4a7_text.gif
23:52:42FromDiscord<Generic> what type is x?
23:52:43FromDiscord<Elegantbeef> Seems they have some type that they want to extract the first 3 ints from
23:52:43FromDiscord<retkid> In reply to @Generic "me not really either,": i have a bytechar, i need to convert into a its int numeric
23:52:55FromDiscord<Elegantbeef> "bytechar"
23:53:00FromDiscord<retkid> look
23:53:02FromDiscord<Generic> what is a bytechar?
23:53:16FromDiscord<Elegantbeef> retkid we're willing to help you dont have to act all defensive
23:53:27FromDiscord<retkid> y'know when you reading and you cast an array with a type
23:53:33FromDiscord<retkid> buffer[type]
23:53:37FromDiscord<retkid> this is of buffer[char]
23:53:44FromDiscord<retkid> that kind of data
23:53:51FromDiscord<Generic> so it's the raw bytes of some unspecified object?
23:53:57FromDiscord<retkid> yes
23:54:03FromDiscord<retkid> but i need it to be an int
23:54:11FromDiscord<Generic> ah
23:54:17FromDiscord<retkid> so it goes from (unprintable)=>(FF)=>256
23:54:18FromDiscord<Elegantbeef> `copyMem(dest.addr, myArray[0].addr, sizeof(dest))`
23:54:59FromDiscord<Generic> yeah memcpy go brr
23:55:57FromDiscord<retkid> i should learn more about memcpy
23:56:02FromDiscord<Generic> I think in Nim cast[int](object) should even work
23:56:13*wallabra_ joined #nim
23:56:21FromDiscord<Elegantbeef> Otherwise bitwise ops should work
23:56:31FromDiscord<Generic> why do you need bitwise ops for this?
23:56:37FromDiscord<Generic> ah you mean to combine bytes?
23:56:42FromDiscord<Elegantbeef> I really wish you provided more code so we could give other solutions
23:56:55FromDiscord<Elegantbeef> Instead of screaming about us offering to better your code
23:57:04FromDiscord<Generic> or pointer aliasing works too
23:57:06*wallabra quit (Ping timeout: 264 seconds)
23:57:16FromDiscord<Elegantbeef> strict aliasing says no
23:57:27FromDiscord<Generic> doesn't Nim compile with strict aliasing disabled?
23:57:37FromDiscord<Elegantbeef> Not by default
23:57:53*wallabra_ is now known as wallabra
23:58:07FromDiscord<Elegantbeef> I'd say it should but i dont know how beneficial strict aliasing is for performance
23:58:39FromDiscord<Generic> me neither, though I can say from experience that violating strict aliasing with strict aliasing enabled works 99% of the time
23:59:01FromDiscord<Elegantbeef> UB is UB and should be avoided
23:59:07FromDiscord<Generic> in the other 1% of the cases debugging is pretty painful, because in worst case it only happens in lto builds where there are no symbols at all
23:59:18FromDiscord<Generic> and you have to load your own binary into ghidra to figure out where the problem happens
23:59:22FromDiscord<Generic> but I'll do it anyway