<< 06-09-2020 >>

00:00:02*junland quit (Quit: %ZNC Disconnected%)
00:00:38audiofilethanks will look into fidget
00:01:13audiofilewow that looks real clean m8
00:01:47*junland joined #nim
00:01:53audiofilejust to clarify, if i write a nim script with this library and end up packaging to a binary, it is self-conttained right
00:02:35audiofileohhhh
00:02:43audiofilei remember fidget, some dude did a demo in nimconf
00:02:55FromDiscord<Elegant Beef> "Some dude" being treeform 😄
00:03:05audiofilethey not here
00:03:20FromDiscord<Elegant Beef> Huh?
00:03:20audiofilebut yes, it is treefrog as you say
00:03:28FromDiscord<Elegant Beef> Treeform uses discord
00:03:36audiofileah ok
00:03:37audiofileirc
00:22:18*krux02_ quit (Remote host closed the connection)
00:24:42FromDiscord<19> shashlick: trying to wrap https://github.com/Kode/Kinc
00:32:43*gmaggior quit (Quit: Leaving)
00:41:00FromDiscord<PizzaFox> best way to generate most random numbers?
00:41:05FromDiscord<PizzaFox> ideally without using OS specific apis
00:41:30FromDiscord<19> https://en.wikipedia.org/wiki/Mersenne_Twister
00:42:37FromDiscord<PizzaFox> is this ture
00:42:38FromDiscord<PizzaFox> (edit) 'ture' => 'true'
00:43:12FromDiscord<PizzaFox> https://nim-lang.org/docs/mersenne.html↵this doesnt explicitly say not to use it for crypto like `random` does, time to go ape mode
00:43:33FromDiscord<Rika> no
00:43:41FromDiscord<Rika> mersenne is even weaker than what random uses
00:43:49FromDiscord<PizzaFox> yeah i figured
00:44:08FromDiscord<PizzaFox> random reddit thread says read `urandom` (only linux), another comment says use libsodium
00:44:21FromDiscord<PizzaFox> surely there is a better method
00:44:41FromDiscord<19> mersenne not so good for crypto?
00:44:54FromDiscord<PizzaFox> > The Mersenne Twister is a pseudorandom number generator
00:44:56FromDiscord<PizzaFox> pseudorandom
00:44:58FromDiscord<PizzaFox> = bad
00:45:04FromDiscord<19> got it
00:45:11FromDiscord<PizzaFox> > Is not cryptographically secure, unless the CryptMT variant (discussed below) is used. The reason is that observing a sufficient number of iterations (624 in the case of MT19937, since this is the size of the state vector from which future iterations are produced) allows one to predict all future iterations.
00:46:03FromDiscord<19> so what is the other classification called other than pseudorandom
00:46:34FromDiscord<PizzaFox> true random
00:46:45FromDiscord<19> cool
00:48:24FromDiscord<Rika> true random is technically os-specific by design
00:51:25FromDiscord<PizzaFox> so nim doesnt have a builtin way to generate random bytes
00:51:35*FromDiscord quit (Remote host closed the connection)
00:51:49*FromDiscord joined #nim
01:15:17federico3there's no true random generator on most hardware
01:15:22federico3only CSPRNG
01:30:15*apahl quit (Ping timeout: 272 seconds)
01:31:34*apahl joined #nim
01:44:55*arecacea1 quit (Remote host closed the connection)
01:45:29*arecacea1 joined #nim
01:49:18*bouzu__ quit (Quit: Leaving)
01:51:40disruptekError: inconsistent typing for reintroduced symbol 'nobj': previous type was: object; new type is: object
02:11:58*a_chou joined #nim
02:30:43shashlick19: will try later tonight - which os
02:35:01*thomasross quit (Ping timeout: 264 seconds)
03:08:57*r4vi quit (Ping timeout: 246 seconds)
03:09:06*r4vi joined #nim
03:19:02*Zectbumo joined #nim
04:01:40*audiofile quit (Quit: Default Quit Message)
04:06:02*supakeen quit (Quit: WeeChat 2.9)
04:06:46*supakeen joined #nim
04:50:55disrupteki can't even.
05:15:27*narimiran joined #nim
05:53:41*solitudesf joined #nim
06:24:42*waleee-cl quit (Quit: Connection closed for inactivity)
06:31:38*a_chou quit (Quit: a_chou)
06:52:32*gmaggior joined #nim
07:17:14*pietroppeter joined #nim
07:44:35*arecacea1 quit (Remote host closed the connection)
07:45:10*arecacea1 joined #nim
08:01:16*narimiran quit (Ping timeout: 246 seconds)
08:06:48*bouzu_ joined #nim
08:23:32*hasbeen joined #nim
08:24:27hasbeenHi. In nim, can I ensure that this[1][2] doesn't happen? ie. I can somehow reference the in-class field specifically? [1] https://paste.debian.net/1162826/ [2] https://paste.debian.net/1162827/
08:28:14*Zectbumo quit (Remote host closed the connection)
08:30:48*antranigv quit (Ping timeout: 256 seconds)
08:31:44*antranigv joined #nim
08:43:52*bouzu__ joined #nim
08:46:22*bouzu_ quit (Ping timeout: 260 seconds)
08:54:44*krux02 joined #nim
08:56:08*hasbeen quit (Quit: Leaving)
09:22:21*hnOsmium0001 quit (Quit: Connection closed for inactivity)
09:53:43Oddmongercan i import only unindent from strutils ?
09:54:02Oddmongeryes i can, but not with «import unindent from strutils»
09:59:57Oddmongerok: from « strutils import unindent » (i was _so_ sure of the above 🤔 )
10:14:18ZevvHow could I optimize this so that I don't need the intermediate Row type to implement the double [y][x] indexing? http://ix.io/2whM
10:16:43*muffindrake joined #nim
10:17:01*pietroppeter quit (Quit: Connection closed for inactivity)
10:26:06*guelosk[m] quit (*.net *.split)
10:26:06*skrylar[m] quit (*.net *.split)
10:26:06*silvernode[m] quit (*.net *.split)
10:26:08*leorize[m] quit (*.net *.split)
10:26:08*l1x quit (*.net *.split)
10:26:08*stefantalpalaru quit (*.net *.split)
10:26:08*lain quit (*.net *.split)
10:26:08*Cadey quit (*.net *.split)
10:27:53*lain joined #nim
10:32:28*skrylar[m] joined #nim
10:32:28*guelosk[m] joined #nim
10:32:28*silvernode[m] joined #nim
10:32:28*leorize[m] joined #nim
10:32:28*l1x joined #nim
10:32:28*stefantalpalaru joined #nim
10:32:28*Cadey joined #nim
10:43:03*Trustable joined #nim
10:59:20*Vladar joined #nim
11:11:56*krux02_ joined #nim
11:14:25*krux02 quit (Ping timeout: 240 seconds)
11:20:16stisa[m]Zevv any reason you don't want [y, x] for indexing?
11:30:42*shodan45 quit (Quit: No Ping reply in 180 seconds.)
11:35:03*shodan45 joined #nim
11:38:11Zevvbecause people come and ask for it all the time
11:38:35Zevvit's one of these things that come op on #nim
11:39:12Zevvof course, "just use a 1d array and do the indexing yourself" is a perfectly fine answer. But I was wondering if I could abstract this away for dynamic sized arrays
11:52:39*Hotbees quit ()
12:04:34stisa[m]Mmh ok, I've used a concept that matches data is seq[T] , width is int for [y,x] , but for [y][x] I don't know, sorry
12:04:48Oddmongeris it possible to alias a function ?
12:05:04Oddmongerlike var shortname = myfunctionwithaverylongname
12:06:02*supakeen quit (Quit: WeeChat 2.9)
12:06:39stisa[m]I think something is wrong with discord bot, irc -> discord works but discord->irc doesn't seem to work
12:06:41*supakeen joined #nim
12:09:41*FromDiscord quit (Remote host closed the connection)
12:09:59*FromDiscord joined #nim
12:12:08stisa[m]@Oddmonger maybe `template short(a: varargs[untyped]) = longname(a)` ?
12:12:56FromDiscord<Hearthstone (LGBTQ+)> I'm assuming that's a no on Matrix-
12:12:57Oddmongerthank you stisa[m] , i was seeing that a bit more easier
12:14:03stisa[m]@Heartstone oh it started working again
12:14:06Oddmongerwell in fact
12:14:24Oddmongervar bar = foo # work in inim, but not in my source
12:14:31Oddmonger(foo is a proc)
12:15:27stisa[m]oh you're right, works in the playground too
12:15:28Oddmongerok it was another error in fact, it's working
12:18:53Oddmongerand while searching that, i have discovered that modules can be renamed easily
12:19:11Oddmongerfrom mymodule as m import nil
12:19:18Oddmongerm.x()
12:19:33FromDiscord<Rika> you lose ufcs that way
12:19:52FromDiscord<Hearthstone (LGBTQ+)> Oh cool
12:20:26*pietroppeter joined #nim
12:21:08OddmongerRika: i don't understand the link with UFCS
12:21:30FromDiscord<Rika> you must qualify all procs that way
12:21:49Oddmongerah, when you rename module ?
12:21:52FromDiscord<Rika> you cannot use `obj.proc()` anymore since it must be `module.proc(obj)`
12:21:57FromDiscord<Rika> when you use `import nil`
12:22:05FromDiscord<Rika> there is no reason to rename a module without `import nil`
12:22:30Oddmongerimport nil , is for importing everything from the module, isn't it ?
12:22:33FromDiscord<Rika> well there is when a clash happens but that is rare enough
12:22:48FromDiscord<Rika> `import nil` is for requiring qualified import
12:23:42FromDiscord<Rika> use `import xxx as yyy` if you want to use unqualified but renamed import
12:23:51Oddmongerah i understand
12:23:54FromDiscord<Rika> though as ive said its only useful when there is a clash
12:24:11Oddmongeryou import nothing by default, and must qualify everything, then
12:24:14Oddmongerso no UFCS
12:24:16Oddmongerok
12:25:02Oddmongermay be we can do this another way…
12:25:37Oddmongerimport strutils as su , is working but as you said no interest
12:25:56Oddmongerbecause functions are all in the global space
12:26:08Oddmongerit's clearer now, thank you
12:27:11Oddmongeri'm using inim often, to learn nim and test things: is it possible to list the objects imported with the repl ?
12:27:58Oddmongerlike in Lua: for i,v in pairs(_G) do print(i,v) end
12:28:39FromDiscord<Rika> i do not know, i dont use inim
12:29:12FromDiscord<Hearthstone (LGBTQ+)> If you can list all the imported modules in Nim normally, you should be able to do the same in Inim
12:29:28Oddmongerbut the import is just done for the compilation stage, or is it accessible from the AST ?
12:30:24Oddmongeri have no idea how to coin this
12:32:18*lritter joined #nim
12:41:40FromDiscord<19> sent a code paste, see https://play.nim-lang.org/#ix=2wiz
12:43:20FromDiscord<Rika> yes
12:43:29FromDiscord<Rika> actually
12:43:39FromDiscord<Rika> `pipeline:kinc_g4_pipeline_ptr` -> `pipeline:kinc_g4_pipeline_t_ptr` you missed the t
12:44:39FromDiscord<19> well its giving me SIGSEGV
12:44:45FromDiscord<19> how can i debug it
12:45:22FromDiscord<Rika> im not sure, someone else might know
12:45:44FromDiscord<19> sent a code paste, see https://play.nim-lang.org/#ix=2wiA
12:51:39*gmaggior quit (Ping timeout: 265 seconds)
12:51:49FromDiscord<Rika> well pipeline is nil
12:51:58FromDiscord<Rika> thats why youre getting the sigsegv
12:52:47FromDiscord<19> oh yeah
12:53:50ehmryZevv: can I pm you with some npeg questions?
12:54:20FromDiscord<Clyybber> or post them here :)
12:55:07ehmryI'm trying to figure out a good strategy to deal with backtracking
13:02:35ehmryClyybber: are you familiar with peg parsing?
13:04:20*gmaggior joined #nim
13:06:54FromDiscord<haxscramper> What are dependencies for installing nimterop in addition to just nimble? When I install it normally everything works, but inside docker `[email protected]` fails to install. Installation using `nimble install nimterop`, nim 1.2.6
13:07:41FromDiscord<Clyybber> ehmry: Not too much, I asked Zevv questions yesterday too.
13:08:39ehmryso I have a big grammar https://git.sr.ht/~ehmry/dhall-nim/tree/master/src/dhall/parse.nim
13:09:48ehmryI'm trying to break string matches into "terms", I understand that can npeg can walkback string matches, but I don't know how to correctly walk back the terms that I parse in capture blocks
13:13:33ehmrymaybe I just don't understand the lexer example
13:16:45*awe00 joined #nim
13:34:37*gmaggior quit (Quit: Leaving)
13:35:13AraqClyybber: I'm making cursor inference "scope" aware
13:35:22Araqbut here is a nasty problem:
13:35:39Araqvar x: seq[string]; x.add "a"
13:36:12Araqhow do we know that 'x' is not a cursor?
13:38:09FromDiscord<Clyybber> emhry: Sorry, don't know, probably best to ask Zevv
13:38:31FromDiscord<Clyybber> Araq: Hmm
13:38:46FromDiscord<Clyybber> Why does it matter?
13:39:46Araqwell we better destroy this 'x'
13:39:59Araqbut I think it's just a bug in my implementation
13:40:11FromDiscord<Clyybber> Araq: Also regardinng semiStmtList, I'm not sure whats an attribute grammar, we simply parse an ifExpr instead of an ifStmt when we are in a semiStmtList context
13:40:17Araqand my design is good
13:40:24FromDiscord<Clyybber> I can move the branching into semiStmtList
13:40:36FromDiscord<Clyybber> Araq: Yeah, I think so too
13:41:06Araqwell so move the branching into semiStmtList
13:41:14FromDiscord<Clyybber> Ok, will do.
13:41:40Araqif it avoids the parameter to complexOrSimpleStmt(maybeExpr = true)
13:41:51disruptekis there really no way to achieve static generics?
13:42:08Araqwhat's a static generic?
13:42:22disrupteka proc that takes static[T]
13:42:54FromDiscord<Clyybber> That is possible.
13:43:03disrupteki finally impl jason properly and discovered bug after bug.
13:43:13FromDiscord<Clyybber> so report them
13:44:33disruptekwell, you can think about it and get back to me. 😁
13:54:45*arecacea1 quit (Remote host closed the connection)
13:55:39*arecacea1 joined #nim
13:59:12Araqdisruptek: waiting on your concepts improvement
14:00:09*tane joined #nim
14:02:32shashlick@haxscramper what's the failure you see, can you share a snippet
14:02:37*krux02_ quit (Read error: Connection reset by peer)
14:04:14*krux02_ joined #nim
14:05:31FromDiscord<haxscramper> I don't see any compilation errors. After running `nimble --vebose install nimterop` it just fails and prompts for installation for `#head`.
14:06:27FromDiscord<haxscramper> It is quite possible that I'm broke something on my side/missing something assumed be available default on linux
14:07:36FromDiscord<haxscramper> It fails on `toast.nim` compilation
14:08:45FromDiscord<haxscramper> Full installation log: http://ix.io/2wje
14:12:29ZevvDo not fear, the npeg support man is here!
14:13:10Zevvemhry: whats up
14:13:42Zevvi guess you got the same issue as everyone
14:13:52Zevvcode block caputres dont backtrack, right?
14:14:21ZevvWhy does no one complain about that with lpeg, which has the same problem, i wonder
14:16:41FromDiscord<Clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2wjg
14:17:30*haxscramper joined #nim
14:22:54Zevv@disruptek: ^^
14:29:05FromDiscord<Recruit_main707> smart move there
14:30:14*pietroppeter quit (Quit: Connection closed for inactivity)
14:31:42Zevvwha?
14:37:42ehmryZevv: yea, same as everyone, code block backtrack
14:37:49Zevvbwah
14:38:03Zevvit's one the problems I hope to go away by ignoring it for a long time
14:38:12ZevvI think it'll take another 50 years
14:38:55Zevvproblem is that code blocks run at match time and are also used for validation and custom matchers
14:39:12Zevvmy usual answer is: if you need backtracking, your syntax is bad. But that doesn't help anyone
14:41:56ehmryyea, my syntax has "minimal" backtracking, but thats different from no backtracking
14:43:10ehmryZevv: could memoization help?
14:45:22ehmryor rule entry and exit hooks?
14:48:13*theelous3 joined #nim
14:48:57*NimBot joined #nim
14:49:21disruptekAraq: waiting on your feedback for IC. concepts has no deadline. 😉
14:49:23ehmryidk, I'll play around some more
14:49:37Zevvbasically, the call into Nim would need to be postponed until any open choices are comitted
14:49:40disruptekZevv: what's up?
14:49:54Zevvbut that would change order in the calls, and breaks the validation-by-code
14:50:39Zevvalternative would be to allow some syntax to register code for a callback later. So the block itself gets called at match time, but you can add a "onfinal:" block or something similar, which will be stashed away until the match is certain
14:51:07Zevvdisruptek: Clyybber posted something for you, but the discord bridge dropped your name it seems. It's put into a silly nim-playground snippet
14:51:32disruptekoh i don't read discord anymore.
14:53:33FromDiscord<mratsim> @Clyybber now Higher Kinded types 😉
14:53:43FromDiscord<mratsim> they work but only if you don't specify them
14:54:24FromDiscord<mratsim> i.e. proc[A, B: Foo[A]](a: A, b: B)
14:54:51disruptekError: the macro body cannot be compiled, because the parameter 'j' has a generic type
14:55:28FromDiscord<mratsim> this would work but then you need to check the Foo[A] constraint↵↵proc[A, B](a: A, b: B) = static: doAssert B is Foo[A]
14:56:20disruptekZevv: i handle that npeg problem in nim. if there's a way to do it in npeg, great, but to me it's no big deal.
14:57:16disruptekanyone on irc know what that error message means?
15:08:02Zevvdisruptek: well, how would you know in nim that particular part of your grammar backtracked? There's no signalling for that
15:10:01shashlick@haxscramper you don't have g++ installed
15:10:05shashlick'cc1plus': execvp: No such file or directory
15:12:00disruptekZevv: you're right, i think ehmry's use-case may be more demanding than mine.
15:12:41disrupteki don't really understand why they need to know about backtracks that were fruitless, though.
15:13:46Zevvwell, npeg *tries* to capture something, and on the fly calls your code block with the match
15:13:55Zevvbut only later figures out this was wrong
15:13:58Zevvbut your call was already made.
15:14:03ZevvMaybe we can add uncall to nim
15:14:05Zevvor decall
15:14:12disruptekheh
15:14:30disruptekunComeFrom
15:15:06ZevvI was hoping this never has to be solved, but it's actually the only issue that gets reported
15:15:26Zevvthe good news is that Npeg has proved to be almost bug free
15:16:28disruptekwhen you figure out that you want to backtrack, what do you do?
15:16:32Zevvreading back all reported issues, I can say "bug free until proven otherwise"
15:16:46ZevvThe idea is that these calls should be postponed until the choice is comitted
15:16:59disruptekthey can go into a stack.
15:16:59Zevvbut that will change semantics, your calls come in in reverse order, for example
15:17:08Zevvsure
15:17:23disruptekas long as we have a way to identify them...
15:17:27Zevvbut then it breaks the current api where code blocks are called for validation or custom matches
15:17:36Zevvif your code block says "no", the match can fail. That's super handy
15:17:47Zevvbut that needs to run at match time
15:17:49disruptekyou won't believe this, but i'm not too bothered by breaking other people's code.
15:18:15Zevvalternative is to either add some kind of way to indicate this in your code, maybe by adding some sugar to register a callback that gets called on commit
15:18:25Zevvor add another operator ">" is for match time, ">>" is for commit time
15:18:28Zevvsomething like that
15:18:49disruptekto keep the api you'd need to just add a way to query the mode.
15:19:02Zevvthe npeg paring engine was a piece of cake. But captures were a bit of apain
15:19:17Zevvquery what mode?
15:19:34disruptekcommit vs. offer
15:19:54Zevvwell, it's only ran once. If I run it for two modes, I'd have to call the same block twice
15:19:58disruptekAraq: comments would go a long way to soliciting contributions.
15:20:14disruptekZevv: so what?
15:20:33*waleee-cl joined #nim
15:20:55disruptekdon't you know if you're going to handle commits when you compile the code?
15:21:09disruptekit's not like you can't read it, right?
15:21:35disruptekmaybe i'm missing something.
15:22:53Zevvyeah well. For now I choose to still ignore it. LPEG got away with it for 10 years :)
15:22:56disruptekthe problem with the operator solution, to me, is that it means i cannot reuse the grammar as easily.
15:23:25disruptekit's a logic issue so i think it should be handled in logic.
15:23:36ZevvIt seems that everyone reporting this found a way to solve this. So I'm not sure if fixing this in npeg is worth the hassle
15:23:59ZevvBut you can not properly handle it in your own logic, because that logic *can not know* the capture was backtracked
15:24:23ZevvI can make up a grammar where your caputure block will be called 10 times
15:24:29Zevvnone of which actually should have happened
15:24:56disrupteki get it.
15:26:12ehmryI've found workarounds in the grammer, but then my grammers are misleading
15:26:48ehmrylike matching the first half of a rule, and if the optional second half is missing then I backtrack
15:28:17ZevvBut it's optional, so why backtrack
15:29:20haxscrampershashlick: thanks, now it is worked as expected.
15:30:23ehmryso I can throw out the first half of the match
15:31:03ehmryanyway, I'm going to read these npeg issues
15:33:35*Trustable quit (Remote host closed the connection)
15:34:32*Trustable joined #nim
15:36:13disruptekZevv: sealmove's kaitai thing is done, right?
15:36:32FromDiscord<19> i'm having a weird issue with nim binding, i can get the size of the file and the number of characters but i cant retreive the data from the pointer: https://play.nim-lang.org/#ix=2wjR
15:36:46ehmrybacktrack hack -> https://git.sr.ht/~ehmry/dhall-nim/tree/master/src/dhall/parse.nim#L164
15:44:59Zevvdisruptek: dont know, why?
15:45:22disruptek!repo kaitai
15:45:23disbothttps://github.com/sealmove/nimitai -- 9nimitai: 11A native Nim macro implementation of Kaitai Struct 15 13⭐ 0🍴 7& 3 more...
15:47:47*kkk joined #nim
15:48:09*kkk is now known as Guest33034
15:48:45*Guest33034 quit (Remote host closed the connection)
16:12:09*bra-ket joined #nim
16:14:16*zyklon quit (Ping timeout: 244 seconds)
16:16:03*narimiran joined #nim
16:21:42*vicfred quit (Ping timeout: 256 seconds)
16:31:24stefantalpalaruThis example is wrong: https://nim-lang.org/docs/system.html#add%2Cseq%5BT%5D%2CopenArray%5BT%5D
16:31:55stefantalpalaruIt should be: `s.add(@["test"])`
16:32:47federico3can nimitai output a .nim file?
16:32:49Zevvnope
16:32:50Zevvnot wrong
16:33:01stisa[m]That kaitai things looks pretty cool, I might give it a try later
16:33:44Zevvany scalar passed to an openarray argument will implicitly be converted to an array
16:33:51Zevvalthough I can't find that in the manual
16:33:57federico3if it could avoid adding more dependencies at build time...
16:44:08*solitudesf quit (Remote host closed the connection)
16:44:32*Zectbumo joined #nim
16:47:41disruptekthe example is wrong, but only because it's attached to the wrong proc.
16:47:47disrupteka string is an openarray.
17:00:26*superbia1 joined #nim
17:02:14*superbia quit (Ping timeout: 260 seconds)
17:02:16*superbia1 is now known as superbia
17:06:40*hnOsmium0001 joined #nim
17:07:21*WilhelmVonWeiner joined #nim
17:09:03*kwilczynski quit ()
17:11:25Zevvdisruptek: that's bull.
17:11:31Zevvthe example is perfectly fine
17:11:58disruptekhow do you figure?
17:12:03Zevvwell, it works, right?
17:12:07Zevvit does what it says it does?
17:12:11disruptekbecause it's using the other proc.
17:12:38Zevvoh well wait a second now
17:12:42disruptekthe example exemplifies the add(seq[T], T) not the add(seq[T], openArray[T]).
17:12:53Zevvhow did I make up the bull about passing a single argument to an openarray making it an array implicitly?
17:13:12disruptekhey, i tried to correct you gently.
17:14:05Zevvdon't do that
17:14:08Zevvthat's so confusing
17:14:20Zevvtalking to a dutchie here, right
17:14:40disrupteklol, true.
17:18:38disrupteki'm trying to fix the compiler so dust works to minimize bugs that prevent macro behavior that i need for frosty to work in the compiler for IC.
17:18:53disruptekit's a many-layered onion of regret.
17:19:17Zevvoh man
17:19:42Zevvthe world is so full of nicely isolated problems
17:19:47Zevvand you pick this sh*t
17:20:39disrupteki know. i'm a masochist.
17:24:17disruptekwhat's sad is i think i can't get mangling in until concepts work in nim-1.0, which, y'know, they don't.
17:25:02disruptekwe really need to clone araq a few times. i dunno why i have these clyybbers growing in the vat when what i really want is a few dozen araq.
17:36:03*kwilczynski joined #nim
17:36:13Zevvwe can have scotty beam him up and not destroy the original
17:37:05*thomasross joined #nim
17:37:22*muffindrake quit (Quit: muffindrake)
17:38:12ZevvI read a cool book once, there was this professional "proletaric mover", who used star-trek like technology for moving himself somewhere, steal the loot and move himself out ago. And then all the ghosts of his killed originals team up to haunt him because they are jealus of the last copy that actually gets to survive.
17:39:05FromGitter<Quelklef> Would somebody mind taking a look at the following and verifying that it's not expected behaviour before I submit a bug report? ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ issue seems to be that `setimpl.nim(29, 10)` is using my `[]` overload for some reaosn. [https://gitter.im/nim-lang/Nim?at=5f551eb99566774dfe5a2b35]
17:39:05disruptekbut that means that when he moves, the entity they were haunting becomes a haunter.
17:39:19Zevvright
17:39:48Zevvand they all are guilty, excepty for the last one who is still alive
17:40:04disruptekdoes the hauntee know what's up?
17:40:12Zevvhe went insane
17:41:16disruptekdust is really dumb. i wish someone would help me with it.
17:41:27disrupteki know what has to change i just... i'm tired.
17:41:37Zevvman I can imagine. you just wont stop
17:41:49Zevvconcentrate, focus, one thing
17:41:51*solitudesf joined #nim
17:41:57disruptekit is eating all my memory.
17:42:05disruptek25gig so far.
17:42:46disruptekwhaddya mean i won't stop?
17:42:59Zevvyou just do too many things
17:43:10disruptekoops, int128 bug.
17:43:22disruptekjust too many damned bugs.
17:43:38disruptekdude, there is so much that needs writing. most of it is dogshit, too.
17:43:39voidpidisruptek: what is dust?
17:43:48voidpinimble search didn't return anythins
17:43:52voidpianything*
17:44:37disruptekthere are people out there that don't use nimble.
17:44:56disruptek!repo dust
17:44:56disruptekdisbot: wtf; you okay, buddy?
17:44:57disbothttps://github.com/disruptek/dust -- 9dust: 11DUST is Unattended Syntax Truncation 15 3⭐ 0🍴 7& 1 more...
17:44:57disbotyep. 😊
17:45:13disruptekmust be his lunch hour.
17:46:19voidpiheh
17:46:27voidpidisruptek: thanks
17:47:56disruptekthat readme isn't up-to-date.
17:48:02disruptekyou run it like the compiler.
17:48:10disruptekdust check bug.nim
17:48:22voidpiIt will overwrite your source file during operation.
17:48:30voidpiis that up to date?
17:48:33disruptekyes.
17:49:32disruptekit has to do that because i haven't patched the compiler to make it easier to embed.
17:50:11disruptekdust is an example of erosion of ambition in the face of practicality.
17:50:44voidpilooks like the kind of program that benefits of a taunting module
17:50:54voidpi"i erased all your crap!"
17:52:38disruptekthat's the best possible scenario.
17:52:52Zevvhaha
17:52:55Zevvvery true :)
17:54:12disruptekit's working, at least.
17:54:23disrupteki mean, it doesn't always work, but when it does, it's fuckin' sweet.
18:03:18FromDiscord<UNIcodeX> @dom96 any insight on GC'ed memory error when trying to use jester with threadpool? https://www.pastery.net/shhbrc/
18:03:41disruptekone thing it should do it monitor unused symbols and then remove them.
18:04:18disruptekand also score mutations by how high or large their removals are.
18:04:22*Vladar quit (Quit: Leaving)
18:07:31FromDiscord<dom96> @UNIcodeX {.threadvar.} on the `db` or disable threads
18:07:49*FromDiscord quit (Remote host closed the connection)
18:08:07*FromDiscord joined #nim
18:09:34*thomasross quit (Ping timeout: 246 seconds)
18:11:00FromDiscord<UNIcodeX> > @UNIcodeX {.threadvar.} on the `db` or disable threads↵@dom96 hmm. ok. doing `db {.threadvar.} = db.getNextConnection()` gets me a different error `Error: a thread var cannot be initialized explicitly; this would only run for the main thread`
18:14:44FromDiscord<dom96> yes, you need to initialise it per-thread
18:15:27FromDiscord<dom96> sent a code paste, see https://play.nim-lang.org/#ix=2wlf
18:23:36*muffindrake joined #nim
18:25:04*the-oaks joined #nim
18:29:51*the-oaks quit (Client Quit)
18:30:10*the-oaks joined #nim
18:30:24*the-oaks quit (Client Quit)
18:31:10*the-oaks joined #nim
18:31:22*the-oaks quit (Client Quit)
18:32:23disruptekseems like there are no issues at all mentioning static[T] and macros.
18:32:37disruptekwhy can't we use these together?
18:33:33disruptekif base.isMetaType and procKind == skMacro: localError(c.config, info, errMacroBodyDependsOnGenericTypes % paramName)
18:36:15ZevvI also want generic macros. macro foo[T](). and a pony.
18:38:28FromDiscord<UNIcodeX> sent a code paste, see https://play.nim-lang.org/#ix=2wlp
18:39:28FromDiscord<dom96> seems like `bson` is using global vars :/
18:40:29FromDiscord<UNIcodeX> any way I can fix that?
18:40:48FromDiscord<dom96> you'll have to fix bson I guess, or just disable thread for now and ask the maintainer to
18:41:51FromDiscord<UNIcodeX> maintainer of `bson` mentions `nimongo` for threads, but the initialization and the way you interact with the db is different. I seem to remember name collisions with `%*`
18:42:44FromDiscord<UNIcodeX> well... more accurately... maintainer of `mongopool`
18:47:58FromDiscord<UNIcodeX> > you'll have to fix bson I guess, or just disable thread for now and ask the maintainer to↵@dom96 https://github.com/JohnAD/bson/issues/11
18:48:00disbotbson module not thread safe (using globals) ; snippet at 12https://play.nim-lang.org/#ix=2wlu
18:51:14FromDiscord<tomck> hello! I want to eval some nim source code at runtime with a custom env - what're my options for that, or is it basically not possible?
18:52:05FromDiscord<tomck> ideally with decent performance for running many short scripts thousands of times
18:53:42*natrys joined #nim
18:59:11FromDiscord<UNIcodeX> The reason I'm working on switching to Nim&Jester for my back-end is that I'm currently using Python&Sanic, which gives me 2200 requests / second when running on 4 cores using uvloop with hypercorn, whereas Jester on ONE core gives me 3150 requests per second. The machine in question is a simple 4 core AWS lightsail machine.
19:01:15*FromDiscord quit (Remote host closed the connection)
19:01:29*FromDiscord joined #nim
19:08:40haxscramperIs it possible to `import` some code inside `.nimble` file for project? I have `module.foo()` function that is a part of source code and want to use it inside nimble too.
19:08:40haxscramper
19:08:40haxscramperI cannot simply do `import module` or `src/module` inside nimble as it won't work during installation.
19:09:01*sacredfrog quit (Quit: ZNC 1.8.1 - https://znc.in)
19:09:19FromDiscord<tomck> @haxscramper brill! Is it suitable for loads of tiny scripts? I'm building a game engine where scripts are used to customise entity behaviour, so there's likely be a *bunch* of tiny scripts that get run every frame
19:10:58FromDiscord<dom96> @UNIcodeX interesting, if you are successful and have some time I'd love to see a write up of the things you ran into (this being one of the things, we need this kind of feedback to make it better :))
19:11:00FromDiscord<tomck> oh yeah that code example makes more sense, thanks
19:11:14FromDiscord<dom96> actually, even if you're not successful, in fact especially so
19:11:28FromDiscord<dom96> (posting the write up on the forum would be idal)
19:11:29FromDiscord<dom96> (edit) 'idal)' => 'ideal)'
19:12:19FromDiscord<haxscramper> I can't really comment on how performant nimscript is, but for running **everty frame** you might want to look for a solution that is specifically optimized for performance.
19:13:12FromDiscord<haxscramper> There are several projects for making embedding lua much easier
19:13:35FromDiscord<tomck> will lua be much faster than nim?
19:13:52FromDiscord<lqdev> no
19:13:57FromDiscord<tomck> (nimscript)
19:14:01FromDiscord<lqdev> yes
19:14:02*sacredfrog joined #nim
19:14:06FromDiscord<tomck> i see
19:14:09FromDiscord<lqdev> luajit, that is
19:14:24FromDiscord<tomck> yes, i keep hearing about how magic that is
19:14:37FromDiscord<tomck> is nim's `include` literally just text substitution?
19:14:45FromDiscord<tomck> like, can i `include` in the middl eof a random block?
19:15:09FromDiscord<tomck> or will it mess up the indentation?
19:15:18FromDiscord<lqdev> it's AST substitution
19:15:32disruptekhaxscramper: yes, but i'd recommend against it.
19:15:33FromDiscord<lqdev> so it won't mess up your indent
19:15:35*mipri joined #nim
19:15:45FromDiscord<lqdev> though i haven't tried using it inside of a block
19:15:53FromDiscord<tomck> ahhhh cool yeah i see the example in the manual now, it works inside a block just fine
19:16:02FromDiscord<lqdev> TIL
19:18:00FromDiscord<UNIcodeX> sent a long message, see http://ix.io/2wlF
19:18:01FromDiscord<tomck> sent a long message, see https://paste.rs/0yA
19:18:54FromDiscord<UNIcodeX> (edit) 'http://ix.io/2wlF' => 'http://ix.io/2wlG'
19:18:58FromDiscord<Idefau> can't you do that with a `when`
19:19:08FromDiscord<haxscramper> There is hot reloading for compiled nim code. I only tested it, haven't done anythin serious though
19:20:46FromDiscord<haxscramper> https://nim-lang.org/docs/hcr.html and also https://github.com/genotrance/plugins
19:29:22*gmaggior joined #nim
19:35:04FromDiscord<UNIcodeX> Why are string conversions not thread safe? I'm sure there's a reason, but I'm at a loss as to what that would be. `.choosenim/toolchains/nim-1.2.6/lib/pure/asyncmacro.nim(278, 31) Error: 'matchIter' is not GC-safe as it calls '$'`
19:35:35FromDiscord<Rika> there are more details if you look up more in the error
19:35:38FromDiscord<Rika> that's just one line
19:35:49FromDiscord<Rika> to get the whole idea we need the whole error block
19:37:06FromDiscord<UNIcodeX> I'm still messing with the `bson` module. It's mentioned in the traceback. I'm guessing it's an overload and that's why it's saying that `$` is not threadsafe.
19:37:31FromDiscord<Rika> no
19:37:37FromDiscord<Rika> overloads are resolved in compile time
19:37:52FromDiscord<Rika> or wdym "its an overload"
19:38:27FromDiscord<UNIcodeX> a string method defined for the `Bson` type in module `bson`
19:38:38FromDiscord<UNIcodeX> sent a code paste, see https://play.nim-lang.org/#ix=2wlJ
19:38:41FromDiscord<UNIcodeX> wall - o - text
19:39:29FromDiscord<dom96> You may want to create a simple repro without Jester/Async. Should make the errors much easier to follow
19:42:15FromDiscord<Rika> `collectionToString` and `genExtendedJson` seem to be the issues?
19:42:17FromDiscord<UNIcodeX> > a string method defined for the `Bson` type in module `bson`↵@Rika is my understanding / terminology incorrect here?
19:42:18FromDiscord<Rika> or maybe just `genExtendedJson`
19:43:54FromDiscord<UNIcodeX> > `collectionToString` and `genExtendedJson` seem to be the issues?↵@Rika ok. noted. I'm gonna take a short break and mull it over. The wife wants to watch a movie.
19:44:10FromDiscord<UNIcodeX> Thank you all for your help. I'm sure I'll need more of it. 😅
19:44:20FromDiscord<Rika> `genExtendedJson` is in bson.nim
19:44:26FromDiscord<Rika> seems to be the real issue
19:45:13FromDiscord<Rika> @UNIcodeX dw about answering me now, but why bson? why not cbor or some other binary representation? just asking really, no real reason for you to answer
19:45:28*tane quit (Quit: Leaving)
19:48:43FromDiscord<UNIcodeX> > @UNIcodeX dw about answering me now, but why bson? why not cbor or some other binary representation? just asking really, no real reason for you to answer↵@Rika It's what mongopool uses / recommends
19:55:10FromDiscord<Rika> I see, okay, thanks for answering
19:55:16disrupteksucks.
19:56:42FromDiscord<haxscramper> > I cannot simply do `import module` or `src/module` inside nimble as it won't work during installation.↵@haxscramperFigured this one, Just need to check `when fileExists(thisDir(), "src/foo_file.nim"): import src/foo_file else: import foo_file`
19:57:22FromDiscord<haxscramper> having source for all nimble packages turned out to be very useful
19:57:41FromDiscord<haxscramper> Found this one by `fd -e nimble | xargs grep "import src"`
19:59:34disruptekAraq: fwiw, sigv4 has been failing ci for the last couple days on devel. i will move it to github actions and maybe bisect it later.
20:00:05disrupteki thought it was in important packages but maybe not. i don't really pay attention to nim's ci setup; it's a moving target.
20:11:46*lritter quit (Ping timeout: 256 seconds)
20:17:32*lritter joined #nim
20:42:57FromDiscord<Rika> Does nim have an http/2 web server impl?
20:43:20FromDiscord<Rika> Actually wait I can prolly use a c lib
21:04:32disruptekeh, it's my fault.
21:04:54disrupteki can't believe it. i have to run a custom nimcrypto to make this shit work.
21:04:56disruptekmadness.
21:18:40*solitudesf quit (Ping timeout: 265 seconds)
21:25:34*narimiran quit (Quit: leaving)
21:32:16*natrys quit (Quit: natrys)
21:36:40*Trustable quit (Remote host closed the connection)
21:37:08FromDiscord<iWonderAboutTuatara> What are some problems that are "good" for metaprogramming solutions?
21:37:26FromDiscord<iWonderAboutTuatara> Like can someone give me an example of something that would be super hard to do normally that macros make a lot easier?
21:37:30superbia1) create your own language
21:37:44disruptek!repo jason
21:37:44disbothttps://github.com/disruptek/jason -- 9jason: 11JSON done right 🤦 15 19⭐ 1🍴
21:38:22disruptek!repo openapi
21:38:22disbothttps://github.com/disruptek/openapi -- 9openapi: 11OpenAPI Code Generator for Nim 15 32⭐ 3🍴 7& 5 more...
21:38:34disruptek!repo testes
21:38:37disbothttps://github.com/disruptek/testes -- 9testes: 11a small unittest framework with decent support 🔴🟡🟢 15 12⭐ 0🍴 7& 29 more...
21:38:51disruptek!repo cps
21:38:52disbothttps://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim 🔗 15 32⭐ 1🍴
21:42:28*krux02__ joined #nim
21:43:09*vicfred joined #nim
21:44:49*krux02_ quit (Ping timeout: 246 seconds)
21:49:54*awe001 joined #nim
21:52:11*awe00 quit (Ping timeout: 240 seconds)
21:53:57haxscramperHow can I prevent nimble from deleting temporary nimscript file? It dies with `invalid indentation` error, on some line and I don't understand which line this corresponds to in my `.nimble` file
21:54:31disruptektoo funny. if you only knew how much grief not deleting those files has caused others...
21:56:26haxscramperSo there is no way to figure this out except for just carefully examining every possible place where indentation error can occur?
21:57:10disruptekset the sticky bit on tmp and/or cwd so it cannot be deleted?
21:57:17disruptekhack nimble?
21:57:28disrupteki dunno. i don't use nimble.
21:57:28federico3people invented directories...
21:58:18disruptekchurch.
22:00:16FromDiscord<Clyybber> disruptek: please minimize your concept bugs, if you can
22:00:26FromDiscord<Clyybber> otherwise we can't help you
22:06:27*wiml joined #nim
22:17:29haxscramperThere is no other way to check if package is installed other than `when compiles(import X)`?
22:17:48haxscramperBecause it also fails if there is some error in package too
22:17:58disruptekyeah, it's pretty cool, right?
22:18:13haxscramperYeah, makes your life interesting
22:18:21disruptekconfucious say...
22:22:17*haxscramper quit (Remote host closed the connection)
22:23:02wimlIs there a list of the .experimental pragmata somewhere and what they do? I'm updating some old code ...
22:23:15disruptek~concepts
22:23:15disbotconcepts: 11user-defined type classes; documented in the experimental section of the manual: https://nim-lang.org/docs/manual_experimental.html#concepts -- disruptek
22:23:22disruptekcheck that page.
22:25:34wimlI found that but it seems incomplete? Maybe I need a list of old experimental pragmata and what they did?
22:26:08disruptekonly if you have old pragmas in your code.
22:26:53wimlwell like I said, I'm updating old code.
22:27:08*gmaggior quit (Ping timeout: 260 seconds)
22:27:11disruptekso, do you have an old pragma in your code?
22:27:24wiml...
22:28:26wimlwhat do yuo think. yes, I do. that's why I'm looking for documentation.
22:28:36disruptekwell, good luck, buddy.
22:29:18wimlso there's no documentation?
22:30:05wimli mean, the current compiler still accepts this code, so it's not completely historical. it's just not documented, apparently.
22:30:21FromDiscord<Rika> wiml: what version was it
22:30:31shashlick@haxscramper are you using Nim devel
22:30:43FromDiscord<Rika> can you tell us what pragmas you're unfamiliar with
22:32:24disruptekwiml: your guess is as good as mine. maybe if you hold the code closer to your router, i'll be able to read it.
22:34:13wimlRika: I'm not sure what version of nim was current when it was written. It's 'experimental: "notnil"'. But I guess I have to go muck through the compiler sources
22:34:30wimlI think there are others in this codebase as well, which is why I'm looking for documentation
22:37:09FromDiscord<Rika> wiml: i found it in the nim devel docs
22:37:39FromDiscord<Rika> `All types for which nil is a valid value can be annotated with the not nil annotation to exclude nil as a valid value:`
22:38:23FromDiscord<Rika> install nim devel and search its docs maybe
22:38:31FromDiscord<Rika> usually in manual_experimental
22:39:02*gmaggior joined #nim
22:43:36wimlAha. Just cloned the nim-lang repo and found it in there. I guess it's just not in the version that's on nim-lang.org.
22:43:57FromDiscord<Rika> so its not an old pragma, its a new one
22:44:01wimlGrubbing around, it was originally documented in th echangelog for 0.19, but changelogs aren't part of the documentation any more
22:44:09FromDiscord<Rika> oh really?
22:44:27FromDiscord<Rika> so it was only recently documented
22:44:49wimlyeah: https://github.com/nim-lang/Nim/blob/devel/changelogs/changelog_0_19_0.md
22:46:47wimlwell, now I know what it's doing in there. thanks for the pointers, they were helpful
22:50:39*SenasOzys joined #nim
22:53:47*SenasOzys quit (Client Quit)
22:53:51*lritter quit (Quit: Leaving)
22:54:27*SenasOzys joined #nim
22:58:45*krux02__ quit (Remote host closed the connection)
23:09:21*theelous3 quit (Ping timeout: 265 seconds)
23:34:42*abm joined #nim
23:35:01*gmaggior quit (Ping timeout: 264 seconds)
23:47:20*awe001 quit (Ping timeout: 258 seconds)
23:48:27*gmaggior joined #nim