<< 23-07-2023 >>

00:04:13FromDiscord<sirolaf> Also got `x = newSeq(1)` working now, should make why I want it more obvious
01:06:45FromDiscord<konsumlamm> if i do `s.setLen(0)`, does that deallocate the seq, or is it kept around?
01:06:57FromDiscord<Elegantbeef> It keeps it around
01:07:13FromDiscord<konsumlamm> ok, thx
01:07:38FromDiscord<konsumlamm> sometimes i wonder if you do other things besides being in this channel xd
01:07:53FromDiscord<Elegantbeef> Hey I rewrote my atlasser today
01:07:58FromDiscord<Elegantbeef> But no I do not
02:11:23*rockcavera quit (Remote host closed the connection)
02:44:48FromDiscord<xtrayambak> In reply to @PMunch "Well someone didn't read": Shhhh. I wrote that at 11:00 PM, don't let anyone know. :')
02:46:10FromDiscord<xtrayambak> Plus the mersenne twister backend isn't even done yet, it's kinda there as is because I gave up in the night trying to fix the wonky typecasting.
02:46:20FromDiscord<xtrayambak> That's the problem with RNG algorithms to be fair
02:46:34FromDiscord<xtrayambak> or PRNG I should say
02:47:06NimEventerNew question by Emilia Qtless: Send file in HappyX, see https://stackoverflow.com/questions/76746478/send-file-in-happyx
02:47:20FromDiscord<xtrayambak> I'll probably add a hardware based RNG generator too which is "true" RNG as far as the OS isn't just using the clock time
03:04:38*lucasta quit (Quit: Leaving)
04:03:38*azimut quit (Ping timeout: 240 seconds)
06:40:31FromDiscord<demotomohiro> sent a long message, see http://ix.io/4BfN
06:42:10FromDiscord<demotomohiro> In reply to @xtrayambak "I'll probably add a": Nim already has hardware based RNG.
06:45:53*junaid_ joined #nim
06:48:13FromDiscord<demotomohiro> And hardware based RNG is slower than PRNG.
06:57:51FromDiscord<demotomohiro> https://github.com/xTrayambak/librng/blob/main/src/librng.nim#L68↵https://github.com/nim-lang/Nim/pull/18744↵It uses time as seed.↵Nim's std/random initialize PRNG in the better way.
06:58:50FromDiscord<uninnocent> My program doesn't compile unless I import puppy
06:58:53FromDiscord<uninnocent> But it doesnt use puppy
06:59:10FromDiscord<Elegantbeef> What happens if you compile without it?
06:59:29FromDiscord<uninnocent> In reply to @Elegantbeef "What happens if you": Im using strenc
06:59:30FromDiscord<uninnocent> 1 sec
07:00:00FromDiscord<uninnocent> https://media.discordapp.net/attachments/371759389889003532/1132567777186676756/image.png
07:00:01FromDiscord<uninnocent> This is with
07:00:30FromDiscord<uninnocent> https://media.discordapp.net/attachments/371759389889003532/1132567901979811881/image.png
07:00:31FromDiscord<uninnocent> this is without
07:00:45FromDiscord<uninnocent> Deleting nimcache didnt fix it
07:01:02FromDiscord<Elegantbeef> throw a `-f` in your build flags
07:01:34*ntat joined #nim
07:02:04FromDiscord<uninnocent> Oh wait, I was mispelling release
07:02:11FromDiscord<Elegantbeef> Though you're clearly writing malware, so uhhh overthere
07:02:16FromDiscord<uninnocent> If I add -d:release it compiles no issues
07:09:42FromDiscord<odexine> If you’re thinking strenc would make it harder to decypher your malware then...
07:12:33FromDiscord<uninnocent> In reply to @odexine "If you’re thinking strenc": I don't
07:13:34FromDiscord<uninnocent> My program checks if a certian string is present in certain files, and strenc makes sure my program won't accidentally do something to itself
07:13:47FromDiscord<uninnocent> Also, it protects against script kiddies somewhat
07:14:03FromDiscord<uninnocent> (edit) "do something to" => "find that string in"
07:15:15FromDiscord<terrygillis> quick question how do you add the theta sign (in O log n) to be rendered by nim docs in docs comments?
07:35:23FromDiscord<demotomohiro> https://en.wiktionary.org/wiki/%CE%B8↵Copy 'θ' and paste it to your docs comment?
07:38:34FromDiscord<xtrayambak> In reply to @demotomohiro "Nim already has hardware": osrand?
07:38:48FromDiscord<xtrayambak> I don't use mersenne twister by default
07:39:26FromDiscord<demotomohiro> In reply to @xtrayambak "osrand?": https://nim-lang.org/docs/sysrand.html
07:41:36FromDiscord<xtrayambak> librng implements mersenne twister, xoroshiro128, lehmer64, marsaglia 69069 and LCG as of right now, but I hope to add more algorithms for niche use cases
07:54:09FromDiscord<terrygillis> just asking because it seems hacky 😄
08:01:48FromDiscord<Elegantbeef> Alternatively terry gillis you can learn the unicode input for your OS
08:03:13FromDiscord<Elegantbeef> Like on X11 it's ctrl + shift + u then type 03b8 and bam unicode theta
09:03:29FromDiscord<bung8954> sent a code paste, see https://play.nim-lang.org/#ix=4Bg9
10:32:08NimEventerNew thread by Mark_Howser: Some of Nim's convention needs to change in order for it to succeed, see https://forum.nim-lang.org/t/10349
10:34:28FromDiscord<odexine> haha
10:34:29FromDiscord<odexine> sure
10:36:33FromDiscord<arathanis> that has to be bairt
10:36:35FromDiscord<arathanis> (edit) "bairt" => "bait"
10:40:00FromDiscord<demotomohiro> In reply to @bung8954 "https://github.com/bung87/crowngui/blob/ce5d7b8a536": Is `msg.lParam` == `cast[LPARAM](cb.rawProc)`?
10:42:05FromDiscord<bung8954> I think so
10:45:38*junaid_ quit (Quit: leaving)
10:50:54*azimut joined #nim
10:55:56FromDiscord<demotomohiro> In reply to @bung8954 "https://github.com/bung87/crowngui/blob/ce5d7b8a536": Then, `cb`'s calling convention is not stdcall. But you cast it to a procedure with stdcall calling convention.↵Is it safe?↵https://en.wikipedia.org/wiki/Calling_convention
10:59:02FromDiscord<bung8954> why is that , cb is closure cb.rawProc is stdcall, right ?
11:02:11FromDiscord<demotomohiro> Nim's stdlibs document doesn't tell it is stdcall:↵https://nim-lang.org/docs/system.html#rawProc%2CT
11:05:06FromDiscord<demotomohiro> sent a long message, see http://ix.io/4BgM
11:06:48FromDiscord<summarity> hmm, a recent version of Nim 2 is suddenly nil-ing ref objects (a waterpark Pool containing database handles passed to a thread, after a random amount of time the handles disappear). Trying to bisect when this happened (somewhere between 1c7fd717206c79be400f81a05eee771823b880ca and the current commit on the 2-0 branch.
11:09:41FromDiscord<bung8954> In reply to @demotomohiro "> closure is the": you mean I should pass `rawEnv` too ? I thought it acess inside that rawProc
11:17:43FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4BgP
11:24:26FromDiscord<bung8954> yeah, you're right, should cast to proc takes env as first argument
11:24:59FromDiscord<demotomohiro> sent a code paste, see https://play.nim-lang.org/#ix=4BgT
11:33:07FromDiscord<bung8954> thanks ! my callback successfuly invoked
12:10:20*jmdaemon quit (Ping timeout: 246 seconds)
13:30:09*zaher joined #nim
13:34:41*zaher left #nim (#nim)
13:59:01FromDiscord<konsumlamm> is there some easy way to measure allocations of a nim program?
14:00:30FromDiscord<Andreas> In reply to @konsumlamm "is there some easy": on macOS i use `leaks`, i'm sure linux has other/more tools..
16:04:37FromDiscord<voidwalker> anyone have experience building anything with maps/routes/routing in nim ?
16:05:49FromDiscord<voidwalker> geographical routes, not web routes : P
16:31:03*junaid_ joined #nim
16:58:47*junaid_ quit (Remote host closed the connection)
17:04:14*syl quit (Quit: C-x C-c)
17:05:05*syl joined #nim
17:47:41FromDiscord<huantian> I don’t know if many Nim users go outside 🙃
18:41:47NimEventerNew thread by khaledh-nim: Nim grammar top-level stmt vs complexOrSimpleStmt, see https://forum.nim-lang.org/t/10350
18:46:30FromDiscord<Chronos [She/Her]> How should I structure my code for a programming language? Should it be 1 lexer per file or 1 lexer for all of the scanned files?
18:55:38FromDiscord<haywiressc> Can nim be used with c without bindings
19:13:03FromDiscord<michaelb.eth> In reply to @haywiressc "Can nim be used": Wdym?
19:15:23FromDiscord<demotomohiro> I don't think so. Nim's stdlib calls system call or windows API. They are imported using importc.↵If you dont want to use C bindings, you would need to write inline assembly code to call OS APIs.
19:17:12FromDiscord<michaelb.eth> In reply to @haywiressc "Can nim be used": Maybe nlvm is worth a look for you?↵↵https://github.com/arnetheduck/nlvm
19:17:17FromDiscord<michaelb.eth> (edit) "you?↵↵https://github.com/arnetheduck/nlvm" => "you?↵https://github.com/arnetheduck/nlvm"
19:17:19FromDiscord<bung8954> @elegantbeef your lib document server is down https://nimdocs.com/beef331/oopsie
19:27:23FromDiscord<.matrixagent> Hello guys
19:27:36FromDiscord<.matrixagent> is nim suitable for building highly concurrent servers?
19:27:58FromDiscord<.matrixagent> production grade websocket streaming servers precisely
19:28:17FromDiscord<.matrixagent> i need to scale to at least 400k users per second on a single server
20:08:47FromDiscord<Elegantbeef> @bung8954\: that's actually treeforms 😄
20:11:05FromDiscord<bung8954> In reply to @.matrixagent "Hello guys": https://www.techempower.com/benchmarks/#section=data-r21&l=zhb2tb-6bj&test=plaintext
20:18:49FromDiscord<spotlightkid> If you want to know whether a racing car is fast enogh to give you a chance of winning a race, you would usually take it for a test drive.
20:28:15FromDiscord<turtlebasket> what's the standard way of populating varargs with items in a seq? like `...list` in JS or `args` in python
20:30:29FromDiscord<huantian> Just pass the seq directly
20:31:07FromDiscord<huantian> Varargs can either take multiple params, or an entire seq/array of values
20:33:44*ntat quit (Quit: leaving)
20:37:46FromDiscord<juan_carlos> In reply to @turtlebasket "what's the standard way": `varargs[SomeType]` for varargs, or `openArray[SomeType]` for 1 array of any size.
20:51:32NimEventerNew thread by Mark_Howser: This forum software needs to go!, see https://forum.nim-lang.org/t/10351
21:04:56FromDiscord<exelotl> lol
21:06:26FromDiscord<huantian> In reply to @juan_carlos "`varargs[SomeType]` for varargs, or": array or seq or magic 🪄
21:14:51FromDiscord<turtlebasket> oh I didn't know you could just pass it in lol
21:14:56FromDiscord<turtlebasket> "list expansions? what for?"
21:16:59FromDiscord<Elegantbeef> It's really just a bad design 😄
21:17:57FromDiscord<Elegantbeef> It only makes sense to unpack the fields for like `proc(a, b, c: float)` and you have `seq[float]` but still somewhat silly
21:19:05FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#types-varargs↵> A varargs parameter is an openarray parameter that additionally allows to pass a variable number of arguments to a procedure. The compiler converts the list of arguments to an array implicitly:
21:30:29FromDiscord<caravaggio> What's a good nim framework for gui's?
21:31:07FromDiscord<Elegantbeef> Owlkettle is a nice GTK abstraction
21:31:58FromDiscord<Elegantbeef> wxnim, uing, nigui, are some others worth mentioning
21:40:46FromDiscord<caravaggio> Ty
21:40:59FromDiscord<caravaggio> Do u think interfacing with electron would be worth the hassle?
21:41:12FromDiscord<Elegantbeef> I don't like web apps, so no
21:41:18FromDiscord<turtlebasket> as in nim -\> js -\> run on electron?
21:41:19FromDiscord<caravaggio> 😅
21:41:23FromDiscord<turtlebasket> definitely possible with something like karax
21:41:23FromDiscord<caravaggio> Yeah
21:41:41FromDiscord<turtlebasket> kind of a janky setup though fwiw
21:50:15*jmdaemon joined #nim
23:46:10FromDiscord<turtlebasket> is it possible to access params as non-NimNodes inside a macro?
23:46:21FromDiscord<turtlebasket> e.g. passing in an enum value or table
23:47:04FromDiscord<huantian> It should work if you mark the param as static right? Or am I making stuff up
23:47:16FromDiscord<huantian> beef you should know
23:48:07FromDiscord<Elegantbeef> yes static params
23:57:40FromDiscord<turtlebasket> damn, now we've got `lots[of[nested[brackets]]]`
23:58:44FromDiscord<turtlebasket> that's one gripe i have with nim, that I'm doing that a lot↵although to be fair it's `Not<Much<Better<Elsewhere, None> > >` ;)
23:59:31FromDiscord<Elegantbeef> `type MyType = Lots[Of[Nested[Brackets]]]`
23:59:37FromDiscord<turtlebasket> yes.