<< 04-04-2020 >>

00:00:56*sleepyqt quit (Ping timeout: 256 seconds)
00:12:40*lritter quit (Quit: Leaving)
00:21:52*couven92 quit (Quit: Client Disconnecting)
00:22:50FromDiscord<KingDarBoja> Oh, new release D:
00:24:08FromDiscord<exelotl> "The Nim compiler now supports the --asm command option for easier inspection of the produced assembler code" oh this one is very cool
00:24:37FromDiscord<exelotl> very excited to try this on the GBA
00:49:20*dwdv quit (Ping timeout: 256 seconds)
00:49:58*krux02_ quit (Remote host closed the connection)
00:50:19*jegfish quit (Quit: Leaving)
00:50:23*euantor quit (Ping timeout: 272 seconds)
00:52:21*waleee-cl quit (Read error: Connection reset by peer)
00:53:30*euantor joined #nim
00:54:05*waleee-cl joined #nim
00:59:12*euantor quit (Ping timeout: 260 seconds)
01:00:20*euantor joined #nim
01:07:34*matlock quit (Ping timeout: 256 seconds)
01:11:12*matlock joined #nim
01:23:57*chemist69 quit (Ping timeout: 272 seconds)
01:25:15*chemist69 joined #nim
01:32:06FromDiscord<Varriount> How does that work? I thought the compiler shelled out to GCC/Clang/VCC
01:48:50*voltist joined #nim
01:54:25FromDiscord<KingDarBoja> I just discovered the options module few days ago and saw a possible equivalent to Python usage of `none` while setting default parameters on a proc
01:58:20voltistDoes anybody have an experience with using NumericalNim to solve systems of ODEs?
02:00:29*companion_cube joined #nim
02:00:49FromDiscord<treeform> @Varriount, I think it passes --asm equivalent to the compilers. So they output the asm code.
02:01:25FromDiscord<treeform> I think its `-S` for gcc...
02:08:26FromDiscord<KingDarBoja> But I see that If I do something like this: https://play.nim-lang.org/#ix=2gyD
02:08:45FromDiscord<KingDarBoja> It looks like I must pass an Option(2) instead of a common int 🤔
02:09:30FromDiscord<KingDarBoja> What I want to do is set default proc parameters to some Python equivalent to None
02:16:16FromDiscord<treeform> @KingDarBoja Nim way of doing that would be some thing like this:
02:16:17FromDiscord<treeform> https://play.nim-lang.org/#ix=2gyG
02:16:30FromDiscord<treeform> I think that is much more clear what is going on.
02:16:43FromDiscord<Rika> if you want to use the options still, you need to wrap it in a some()
02:17:09FromDiscord<Rika> though the options module is more suited for return types rather than parameters/arguments
02:17:13FromDiscord<treeform> @KingDarBoja another nim way of doing that is https://play.nim-lang.org/#ix=2gyH
02:17:50FromDiscord<treeform> I don't use options in my code, I think code is more clear without them...
02:18:46FromDiscord<Rika> it only really works when used as a return type, as ive said...
02:19:14*companion_cube left #nim ("WeeChat 2.3")
02:19:20FromDiscord<treeform> voltist, i have not used NumericalNim, but I find that nim is so fast at numeral kind of problems with just simple for loops and seqs... like insanely fast with -d:danger...
02:22:02voltist@treeform So just compute each step?
02:35:43*muffindrake quit (Ping timeout: 252 seconds)
02:37:56*muffindrake joined #nim
02:45:09FromDiscord<KingDarBoja> Jumm overload proc
02:46:37FromDiscord<KingDarBoja> That is a big problem to me as the source code (in Python) make use of default parameter as None for a class "__init__" function
02:47:33Yardanico?
02:50:29FromDiscord<KingDarBoja> Give me a second
02:51:38FromDiscord<KingDarBoja> https://github.com/graphql-python/graphql-core/blob/master/src/graphql/error/graphql_error.py#L83 This init function (on Python). Any suggestion to how it would be translated (at least the function parameters) into Nim? Ignore the typings like Optional or Union
02:59:38FromDiscord<companion_cube> does inim work? or is there some sort of playground?
02:59:44FromDiscord<Rika> one moment, ill convert it @KingDarBoja
02:59:52FromDiscord<Rika> @companion_cube play.nim-lang.org
02:59:56Yardanicoweill inim in itself is a workaround
03:00:01Yardanico:P
03:00:06FromDiscord<companion_cube> ah, thank you.
03:00:18Yardanico@Rika tbh inim is not similar to playground
03:00:20FromDiscord<KingDarBoja> Feel free to ignore the source parameter
03:00:27Yardanicoit's supposed to imitate a "repl"
03:00:34Yardanicothere's also "nim secret" which is called this way for a reason
03:02:12FromDiscord<Rika> @KingDarBoja okay so for things like this, if you think all parameters are "independently optional", that is to say, any parameters dont come as a bundle, then i think the options module is sufficient
03:04:25FromDiscord<companion_cube> I didn't find a a to do `a[2..]` to get "all elements starting from 2"
03:04:26FromDiscord<Rika> Yardanico: he asked if there was a playground
03:04:33Yardanicooh
03:04:38FromDiscord<Rika> you use `a[2..^1]`
03:04:46FromDiscord<Rika> ^1 meaning "the last element"
03:04:52FromDiscord<companion_cube> hu, interesting
03:05:06FromDiscord<Rika> `^2` means the 2nd last, and so on
03:05:19FromDiscord<KingDarBoja> So I can just write "myParam: Option(MyType)" on my initType proc?
03:05:29FromDiscord<Rika> brackets
03:05:35FromDiscord<Rika> Option[MyType]
03:05:41FromDiscord<KingDarBoja> Oops
03:05:41FromDiscord<Rika> i dont see why not
03:06:01FromDiscord<Rika> but you need to pass it like this: "some(myTypeInstance)" or "none(MyType)"
03:06:56Yardanicothe thing is just that when you do translating from a dynamic language like Python to a static language like Nim the code wouldn't really look that cood :P
03:07:24FromDiscord<Rika> you really need to rethink the whole code yeah
03:08:17FromDiscord<KingDarBoja> Yeah, I have seen that issue with the string | char problem I had few days ago, but solved using a custom proc + option module
03:09:02FromDiscord<KingDarBoja> I was going to ask, while writing a humble example of what you said (Rika), about something I probably asked before...
03:09:47FromDiscord<KingDarBoja> The Union types aren't allowed at proc params ? like the "nodes" parameter on the python code I shared before?
03:10:05FromDiscord<KingDarBoja> Please spare me if I asked before
03:10:06FromDiscord<Rika> "int or string"?
03:10:07Yardanicothey are, but "sum" types just implicitly create different procedure instantiations
03:10:14FromDiscord<Rika> yeah
03:10:29FromDiscord<Rika> and then you might need to do stuff like `when param is string:`
03:10:32Yardanicowell I mean there's no difference in proc(a: int | string) = when a is int: stuff else: another stuff
03:10:40Yardanicoand proc (a: int) and proc (a:string)
03:11:03FromDiscord<Rika> mhm
03:11:14FromDiscord<KingDarBoja> I see.. I do prefer going the lazy way and keep if possible as one type.
03:11:34FromDiscord<KingDarBoja> Like it MUST be a int 😆
03:12:32FromDiscord<KingDarBoja> But those "Union types" aren't allowed on the type definition, right?
03:12:48Yardanicono
03:12:51Yardanicoyou can use object variants instead
03:13:00FromDiscord<KingDarBoja> Ah, that's what I thought
03:14:04FromDiscord<KingDarBoja> Yeah, I think I discussed that question due to the limitation of using the same variable with different type (int, string for value) inside the case kind
03:14:21FromDiscord<KingDarBoja> And someone pointed me to a GitHub issue regarding that.
03:14:43Yardanicowell yeah, just name them differently
03:16:07FromDiscord<KingDarBoja> Writing all answers on a txt so I don't get lost again
03:24:27*chemist69 quit (Ping timeout: 260 seconds)
03:25:21*chemist69 joined #nim
03:28:08*waleee-cl quit (Quit: Connection closed for inactivity)
03:30:41*opal quit (Remote host closed the connection)
03:31:15*opal joined #nim
03:33:10FromDiscord<KingDarBoja> Ugh, wanted to make an example of what Rika said and ended with errors
03:33:10FromDiscord<KingDarBoja> https://play.nim-lang.org/#ix=2gz9
03:33:31FromDiscord<KingDarBoja> This -> but you need to pass it like this: "some(myTypeInstance)" or "none(MyType)"
03:34:17Yardanicouhh
03:34:20Yardanicouhhhh
03:34:47YardanicoI don't think "or" types work with "Option"
03:34:56FromDiscord<KingDarBoja> I am feeling the struggle with that
03:38:14Yardanicoyou should understand that "or" types don't magically make your code dynamic
03:40:07Yardanicohttps://play.nim-lang.org/#ix=2gzc
03:41:46FromDiscord<KingDarBoja> Impressive Yardanico
03:42:05FromDiscord<KingDarBoja> And I see what Rika meant wit the some downside :/
03:45:55FromDiscord<KingDarBoja> But thinking about it, that is fine as long as the init call is used internally 😄
03:46:56*disruptek quit (Quit: Bye)
03:46:56*disbot quit (Quit: Bye)
03:47:02FromDiscord<companion_cube> in <https://nim-lang.org/docs/manual.html#types-object-variants> it seems like nim doesn't know how to do pattern matching correctly? :(((
03:47:21Yardanicowdym exactly?
03:47:24FromDiscord<companion_cube> it only checks that one uses the right fields for the discriminator, at runtime, not at compile time
03:47:41FromDiscord<Rika> huh?
03:47:43FromDiscord<companion_cube> I wrote a `case` where the `nkIf` branch uses `strVal`
03:47:47FromDiscord<companion_cube> no compile error
03:48:09FromDiscord<Rika> huh?
03:48:17FromDiscord<Rika> can you playground it
03:48:26Yardanico@companion_cube well there's https://github.com/alehander92/gara
03:49:13FromDiscord<companion_cube> https://play.nim-lang.org/#ix=2gzdhttps://play.nim-lang.org/#ix=2gzd
03:49:33Yardanicohttps://play.nim-lang.org/#ix=2gzd *
03:49:41FromDiscord<companion_cube> https://play.nim-lang.org/#ix=2gzd
03:49:52FromDiscord<Rika> i see
03:50:03FromDiscord<companion_cube> this is quite disappointing
03:50:10Yardanicowell that's doesn't mean there's no "pattern matching"
03:50:28Yardanicoit just means that compiler doesn't check for accessing invalid branches of a case object
03:50:33FromDiscord<companion_cube> that's not better than C, if you want
03:50:53*disbot joined #nim
03:51:55*disruptek joined #nim
03:52:29FromDiscord<Rika> can it be added though
03:52:33*rnrwashere joined #nim
03:52:34Yardanicojust write a macro
03:52:34FromDiscord<Rika> i dont know much about the compiler
03:54:45shashlickleorize: you around?
03:55:07FromDiscord<companion_cube> wdym a macro? how would a macro add type safety?
03:55:27Yardanicoit can statically check if you're trying to access an incorrect field inside of a "case" branch
03:55:35FromDiscord<companion_cube> that's the compiler's job…
03:55:44Yardaniconot really, a macro is enough :)
03:56:04FromDiscord<companion_cube> the paragraph above claims this is "like a sum type in other languages", when, not really :/
03:56:52FromDiscord<Rika> its like one
03:56:57FromDiscord<Rika> its not exactly one
03:57:01FromDiscord<Rika> its just like it
03:57:44FromDiscord<companion_cube> it's more like a C struct with tag + union, really
03:58:19Yardanicowell that's what it is in C backend :P
03:58:53FromDiscord<companion_cube> it's just sad that there is no typechecking
03:59:12FromDiscord<companion_cube> (a bit like `not nil` not being the default, I guess… every language has some baggage)
04:06:02*supakeen quit (Quit: WeeChat 1.9.1)
04:06:42*supakeen joined #nim
04:07:14zedeusnil is useful
04:08:26*FromDiscord <KingDarBoja> nil is the future
04:08:38FromDiscord<Rika> what
04:08:48Yardanicoyes
04:09:51FromDiscord<Rika> what x2
04:09:53FromDiscord<companion_cube> yeah, it should just be opt-in, not opt-out
04:10:06FromDiscord<Rika> why is nil the future what
04:10:13FromDiscord<Rika> im still heavily confused
04:11:53FromDiscord<KingDarBoja> I was trying to make it like a compliment for the phrase "Nil is useful"
04:13:46FromDiscord<Rika> i dont see how it is
04:33:31disruptek!rfc author:alehander92
04:33:32disbothttps://github.com/nim-lang/RFCs/pull/169 -- 3Nilable and non-nilable types 7& 2 more...
04:37:26voltistWoah I knew Nim is fast, but I never thought it was THIS fast! My implementation of a state-of-the-art neuron model runs 100x faster than real life
04:37:34Yardanicolol
04:39:51FromDiscord<Rika> doesnt it literally say as fast as C
04:40:35voltistI haven't seen it in those exact words, but yeah maybe
04:42:12Yardanicojesus https://github.com/oakes/vim_cubed has 1.9k stars already :P
04:43:19voltistHaha! Lots of traffic from Reddit I presume?
04:43:22leorizethat's like 1/9 of nim
04:43:24leorizedamn
04:43:29leorizeand it's like several days old?
04:43:31Yardanicoleorize: well github stars are a very stupid thing
04:43:42Yardanico*cough* https://github.com/vlang/v *cough*
04:44:01leorizeshashlick: o/
04:44:27shashlickHey so the same question on variable importc
04:44:33FromDiscord<Rika> `V's backend has just been replaced on April 1` is this a joke or legit because i cannot tell lmao
04:45:05shashlickIf you are importing from a dynlib, the var doesn't exist right
04:45:16Yardanico@Rika it's not a joke
04:45:23FromDiscord<Rika> omg hahahaha
04:45:41Yardanicothey finally made a "somewhat" proper AST in the compiler
04:45:47Yardanicov 0.1 didn't have AST at all
04:48:38Yardanicoeven Zig author mentioned that "hype" thing with V in his article https://andrewkelley.me/post/why-donating-to-musl-libc-project.html
04:49:07*rnrwashere quit (Remote host closed the connection)
04:49:09voltistLol who would have guessed that 720 million floating point numbers in memory would make my computer hang
04:51:00leorizeshashlick: the var exists, after it's imported from the dynlib :P
04:51:11leorizeI'm not too sure what you meant to be honest
04:59:06FromDiscord<Rika> can anyone link me the article on building nim code w/ musl
04:59:14FromDiscord<Rika> i dont seem to recall who made it or the link
04:59:56Yardanicohttps://github.com/kaushalmodi/hello_musl
05:00:07Yardanicothat's not for cross-compiling though, for cross-compiling it's harder
05:00:17FromDiscord<Rika> darn
05:00:38FromDiscord<Rika> anything for cross?
05:00:52Yardanicowell, I only know if you want to cross-compile for linux buth for another architecture
05:01:01Yardanicothen there's https://github.com/richfelker/musl-cross-make/
05:01:50Yardanicoit basically builds a gcc toolchain (with musl) for the target you want
05:02:10FromDiscord<Rika> this is complicated
05:02:14Yardanicowhat do you want to do?
05:02:15FromDiscord<Rika> ill look into it
05:02:17Yardanicoit's actually quite easy
05:02:22FromDiscord<Rika> no no im just reading up on it
05:02:37FromDiscord<Rika> i have no use for it yet but it seems like itll be useful some other time
05:02:44*Pixeye joined #nim
05:02:59Yardanicoalso, extracted from my project
05:02:59Yardanicohttps://gist.github.com/Yardanico/45881fe24222329a0117194fc97ec4eb
05:08:07Yardanicoit's basically for cross-compiling a musl + libressl (for https or other crypto stuff) statically linked binary, based on hello_musl for libressl
05:09:38FromDiscord<Rika> is there a nim module for emulating inheritance (in a nicer way) with variant objects
05:10:01FromDiscord<Rika> because right now with a variant object im not a fan of making a super large proc with a case statement for separating the types
05:10:50Yardanicouse inheritance then? :P
05:10:54Yardanicoref objects and methods
05:11:15FromDiscord<Rika> okay, already am, was wondering if i could convert to variants
05:11:19FromDiscord<Rika> next question
05:12:12FromDiscord<Rika> if i store a subtype (lets say YoungPerson of type Person) in a seq[Person], how do i get the "original type" of the object
05:12:17FromDiscord<Rika> or is it unchanged?
05:12:36FromDiscord<KingDarBoja> That cube is a whole new level
05:12:54FromDiscord<Rika> like if i store an instance into the seq[ParentType], can i still call the methods associated with the subtype?
05:13:05FromDiscord<Rika> am i making sense
05:13:06shashlickUse dockcross for cross compiling
05:13:12shashlickMuch easier
05:13:24Yardanicodoes it support stuff like musl or libressl?
05:13:29Yardanicoto make statically linked binaries
05:14:04Yardanicooh I see they have predefined images
05:14:31Yardanicobut almost no with "musl" and static linking only for win
05:15:21shashlickI thought they had musl also
05:17:05FromDiscord<Rika> did i make sense?
05:17:11FromDiscord<Rika> or am i spouting nonsense
05:17:31Yardanicoi don't know because I almost never used inheritance in nim :P
05:17:53FromDiscord<Rika> i have to because im doing a port...
05:18:37FromGitter<sealmove> Rika, object variants has nothing to do with inheritance
05:19:49Araqsure they do, both are a way of introducing runtime polymorphism
05:20:04Yardanico@sealmove his question is "like if i store an instance into the seq[ParentType], can i still call the methods associated with the subtype?"
05:21:44FromGitter<sealmove> yes but, that's not inheritance. It's a sum type which means "either this or that", not "either the parent or child or grandchild"
05:23:48FromDiscord<Rika> i wasnt asking anything about inheritance this time
05:23:57FromDiscord<Rika> i was just stating it as the name of the uh feature?
05:24:12FromGitter<sealmove> I don't think object variants is true runtime polymorphism. It's manual, but you get the type safety
05:25:09FromGitter<sealmove> rika if you define them as methods instead of procs then the correct one depending on the actual type of the object will be called
05:25:46FromGitter<sealmove> and of course you have to use `X = object of Y`
05:27:48FromDiscord<Rika> yeah okay thanks, for some reason i was thinking i'd have to figure out what to cast the instance back to
05:29:58FromDiscord<Rika> how do i make a table that's filled on compile time but accessible on run time
05:30:05Yardanicoit's easy :P
05:30:22FromDiscord<Rika> uh
05:30:23FromDiscord<Rika> ??
05:30:38FromGitter<sealmove> With macros?
05:30:59FromDiscord<Rika> do i really have to make a macro for it ;;
05:31:04Yardanicono lol
05:31:04Yardanicohttps://play.nim-lang.org/#ix=2gzA
05:31:24FromDiscord<Rika> noice
05:31:31YardaniconewTable wouldn't work though, only initTable
05:31:34YardanicoTableRef vs Table
05:31:36Yardanico(ref object vs object)
05:31:53Yardanicoyou can't make a const TableRef
05:31:55FromGitter<sealmove> Rika: if you have to fill in hundreds of entries and you don't wanna type the assignments, then you would generate them with macros
05:32:23*silvernode joined #nim
05:33:54FromDiscord<Rika> i dont need a ref table so i'm good
05:34:04FromDiscord<Rika> i only have 10 assignments...
05:34:23FromDiscord<Rika> i dont need to make a macro for this ;;
05:47:44FromGitter<sealmove> sure, if they are only 10
05:48:00*silvernode quit (Ping timeout: 265 seconds)
05:59:00voltistIs there an easy way in Nim to map the values of a tuple to variables of the same name?
06:00:00FromDiscord<Rika> its macro time, it looks like
06:00:49*solitudesf joined #nim
06:00:57voltistYeah
06:01:05FromGitter<sealmove> voltist example?
06:02:48FromDiscord<Rika> sealmove: map a `tuple[a: int, b: int]` into variables `a, b`... WAIT A MINUTE
06:02:51FromDiscord<Rika> voltist
06:03:02FromDiscord<Rika> i think i know how, but it requires you to write the names in order
06:03:14FromDiscord<Rika> you can do `let (a, b) = theTuple`
06:03:17voltistYeah like that
06:03:38voltistHmm maybe? That wouldn't work for any given tuple though
06:04:29voltistI mean it doesn't matter much now because I've thought of a better way of doing things
06:04:59FromDiscord<Rika> oh ok
06:05:08voltistThanks for the help though
06:05:13FromDiscord<Rika> if you want it to conform to any tuple youll need a macro
06:05:23FromDiscord<Rika> but yeah okay i wont continue w/ the topic lmao
06:06:19FromDiscord<KingDarBoja> Just tried to do something like "extensions: Option[Table[string, string]] = none(Table[string, string])" on the initMyCustomType parameter and got an error
06:06:34FromDiscord<KingDarBoja> "Error: cannot instantiate: 'Table[A, B]'; Maybe generic arguments are missing?" :/
06:06:59FromDiscord<Rika> that sounds like a bug
06:09:41*silvernode joined #nim
06:10:21voltistIs there a way to have a proc be a property of an object?
06:11:08FromDiscord<Rika> uh, make the first argument of the object type
06:11:22FromDiscord<Rika> like `proc something(self: ObjectType)`
06:11:39FromDiscord<Rika> then you can call it like this `objectInstance.something`, no need for parentheses even
06:11:56FromDiscord<KingDarBoja> A bug? Yikes!
06:12:03FromDiscord<Rika> if you want, you can have constant properties this way too, make it a template
06:13:24voltistNah what I mean is to have an object contain a proc. Like to be able to go `objectInstance.myProperty = something` where something is a proc
06:14:32voltistSo that `objectInstance.myProperty(a)` is equal to `something(a)`
06:14:43voltist*equivalent
06:14:55FromDiscord<Rika> have a field `myProperty: proc()` and replace the proc signature with the intended one
06:15:15FromDiscord<Rika> (proc signature -> the `proc()` part)
06:15:53voltistAh Ok got it
06:15:54voltistThanks
06:15:56FromDiscord<KingDarBoja> So pretty much doomed trying to use Option with table 😢 I am using the latest version btw
06:16:01FromDiscord<KingDarBoja> (1.2.0)
06:19:04silvernodeGood morning/night everyone
06:19:21silvernodeI hope everyone is in good health.
06:19:28voltistNot quite either of those two for me
06:19:48FromDiscord<KingDarBoja> It is 1 AM here
06:19:55FromDiscord<KingDarBoja> So good morning mate
06:20:31silvernodeit is 23:20 here in AZ, sitting in the parking lot at work using th wifi and working on Space Nim as usual.
06:20:50FromGitter<sealmove> Space Nim? what is it?
06:21:16silvernodeI was off work for 4 days and oddly enough never commited one thing to my game in that time. Funny how that works.
06:21:32nekitsI dont need sleep, I need answers silvernode
06:21:37silvernodeSpace Nim is my first project in Nim, it's a text based space trading game
06:22:46silvernodenekits: answers huh?
06:23:14nekitsI need more info on this game
06:24:00FromDiscord<Rika> silvernode: are you calling the humanoids in the game `nimmers`
06:24:02FromDiscord<Rika> heh
06:25:04silvernodenekits: Well, I have been trying to commit myself to making a text based game for years but always start it and never finish. So this time I am not allowing myself to give up. It is going to be a single player game that is focused on trading and exploration. Very simple concepts, nothing too ambitious.
06:25:25silvernodeRika, there are no plans for NPCs at this time
06:25:40FromDiscord<Rika> who are you trading with then???
06:25:41silvernodeJust stations, items and a player
06:25:51silvernodeRika, space stations
06:26:25silvernodehttps://github.com/silvernode/space-nim/blob/planning/design.md
06:27:09nekitsheh, Dave.
06:27:19silvernodeI have some code already but decided I should really focus on what I really need/want in the game so I started a new branch called 'planning' which contains a design doc that is incomplete.
06:28:04silvernodeAbout to push another commit in a second for the stations section.
06:28:14silvernodeI have been working on this little by ittle every night before work
06:28:42FromGitter<sealmove> hey silvernode, have you heard about CRC cards?
06:29:13silvernodesealmove, CRC cards? Nope
06:29:39FromGitter<sealmove> I used them recently for a game and it's a surprisingly useful method
06:29:45FromGitter<sealmove> https://echeung.me/crcmaker/
06:30:11silvernodesealmove, I will check out that link and see what CRC cards even are.
06:30:17FromGitter<sealmove> example (sorry for long link): https://echeung.me/crcmaker/?share=W3sibmFtZSI6IlVzZXIiLCJzdXBlcmNsYXNzZXMiOiIiLCJzdWJjbGFzc2VzIjoiSGVybyIsInR5cGUiOjMsInJlc3BvbnNpYmlsaXRpZXMiOlsiTW92ZSIsIlNldCBPZmZlbnNpdmUgSXRlbSIsIlNldCBEZWZlbnNpdmUgSXRlbSIsIlNldCBTcGVsbCIsIkF0dGFjayIsIkNhc3QgU3BlbGwiLCJDb25zdW1lIiwiUnVuIEF3YXkiLCJFeGl0IEdhbWUiXSwiY29sbGFib3JhdG9ycyI6WyIiXX0seyJuYW1lIjoiR3JpZCIsI
06:30:17FromGitter... nN1cGVyY2xhc3NlcyI6IiIsInN1YmNsYXNzZXMiOiIiLCJ0eXBlIjoxLCJyZXNwb25zaWJpbGl0aWVzIjpbIlBsYWNlIEhlcm8iXSwiY29sbGFib3JhdG9ycyI6WyJIZXJvIl19LHsibmFtZSI6IlRlcnJhaW4iLCJzdXBlcmNsYXNzZXMiOiJHcmlkIiwic3ViY2xhc3NlcyI6IiIsInR5cGUiOjIsInJlc3BvbnNpYmlsaXRpZXMiOlsiIl0sImNvbGxhYm9yYXRvcnMiOlsiIl19LHsibmFtZSI6Ik1vdW50YWluIiwic3VwZXJjbGFzc2VzIjoiVGVycmFpbiIsInN1YmNsYXN ... [https://gitter.im/nim-lang/Nim?at=5e8829780073445dc5626a4e]
06:30:39silvernodejust pushed another commit to the design doc
06:31:59silvernodeinteresting, but in making a new card, I don't know what a superclass is.
06:43:51FromGitter<sealmove> It's whatever you want it to be ;P
06:44:00FromGitter<sealmove> Define your own rules
06:54:42*rockcavera quit (Remote host closed the connection)
06:59:23voltistI just got a phishing email pretending to be Github
06:59:36Yardanicowow
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:13*silvernode quit (Ping timeout: 264 seconds)
07:00:47voltistI'm going to slowloris the fake website, which might work because it would be cheaply hosted
07:01:55voltistOne would imagine anyway
07:03:36voltistLittle effect, must not be a threaded server
07:04:50*gmpreussner joined #nim
07:14:18*narimiran joined #nim
07:14:18*narimiran quit (Client Quit)
07:15:20FromDiscord<Rika> does nim still recommend mutimethods
07:18:03Zevvwow, 12 yours on the HN frontpage without *any* case-style whining. This is a major milestone people!
07:41:55*kenran joined #nim
07:42:33*vegai claps
07:42:45vegaithat was my go-to whinge as well before I dove deeper
07:42:50vegaia classic
07:43:10vegaiI still do think that things would be better without it, but oh well :)
07:52:28*hax-scramper quit (Read error: Connection reset by peer)
07:52:42*hax-scramper joined #nim
07:59:27*hax-scramper quit (Ping timeout: 260 seconds)
07:59:46*hax-scramper joined #nim
08:06:25Araqvegai, fwiw the compiler uses --styleCheck:error
08:06:59Araqto keep contributors from introducing snake_case behind my back
08:07:06Yardanicoxdd
08:08:21Araqit saved me about 4 seconds this year and only took a full day to develop. But "cost benefit" analysis is unheard of in the entire programming industry so nobody notices.
08:09:18*Vladar joined #nim
08:09:24AraqAnd here I am claiming it's a success story. ;-)
08:17:23*tane joined #nim
08:23:50*kenran quit (Ping timeout: 258 seconds)
08:25:57voltistThis is a bit of a stupid question but: how does one create a reference to something in Nim? As in, so if you change the reference you change the variable it refers to
08:27:18FromDiscord<Rika> voltist: `let someVar: ref SomeType = new SomeType; someVar[] = # set contents here`
08:27:35FromDiscord<Rika> like that?
08:28:24voltistMaybe, lets see
08:30:03voltistThat seems like it would only work with 'new SomeType'. What if I have an existing object of type 'SomeType' that I want to refer to?
08:30:37FromDiscord<Rika> `let someVar: ref SomeType = new SomeType; someVar[] = theExistingObject`
08:31:34voltistAh I see!
08:32:06voltistAnd then modifying someVar would change theExistingObject?
08:32:50FromDiscord<Rika> yeah
08:32:57FromDiscord<Rika> you have to modify it like this though
08:33:09FromDiscord<Rika> "someVar[].someField = someValue"
08:33:16FromDiscord<Rika> because you have to do dereferencing
08:33:24FromDiscord<Rika> [] will dereference the reference
08:33:33voltistOk
08:34:39Yardanico@Rika not really though
08:34:43Yardanicothere's auto dereference
08:34:47Yardanicohttps://play.nim-lang.org/#ix=2gAp
08:34:49voltist"type mismatch: got <SomeType> but expected 'ref SomeType'". Thoughts on this?
08:34:57Yardanicovoltist: read my snippet
08:35:05Yardanicoalso see https://nim-lang.org/docs/manual.html#types-reference-and-pointer-types
08:36:05solitudesfyou dont have to use `[]` when accessing fields, nim has implicit dereferncing
08:36:35solitudesfah, but i cant read that fast
08:40:36Araqauto-deref needs to be reworked :-)
08:41:05Araqnew rule shall be: x.f() can work as x[].f()
08:41:28Araqanything going further than that is known to cause way too much trouble
08:41:51voltistAraq: Is that rule not already the case? I have just tested something similar and it seemed to work
08:43:43voltistOh wait I'm using implicitDeref
08:50:49*sleepyqt joined #nim
08:51:19Araqvoltist, the current rule for implicitDeref is more "powerful", too powerful.
08:52:00voltistAh, I see
08:53:24axionAraq: Did you see the huge bug krux reported for me the other day?
09:06:45supakeenGood morning, I've been playing with asynchttpserver and pasted the example code in a test file but I end up with a SIGSEGV: https://bpaste.net/raw/XEMA my nim version is 1.2.0, what am I missing :) The example comes from here: https://nim-lang.org/docs/asynchttpserver.html
09:11:21Yardanicouh-oh
09:11:45*gangstacat quit (Quit: Ĝis!)
09:11:47Yardanicoit's a regression
09:11:57Yardanicoby https://github.com/nim-lang/Nim/pull/13846/
09:11:57disbotfix asynchttpserver content-length header
09:12:06Yardanicoi wonder how CI didn't catch it, it's really bad
09:12:15YardanicoI mean the implications of this :P
09:12:26supakeenAh, are the examples in the documentation ran by the CI?
09:12:38Yardanicomost are by now, yes
09:12:41Yardaniconot all
09:13:14supakeenShall I report this an issue?
09:13:30Yardanicoyeah, you can, and please also mention https://github.com/nim-lang/Nim/pull/13846/
09:13:31disbotfix asynchttpserver content-length header
09:13:35supakeenI will.
09:13:56Yardanicoit's the cause of this issue
09:16:11supakeenhttps://github.com/nim-lang/Nim/issues/13866 here you go.
09:16:14disbotasynchttpserver documentation example causes SIGSEGV ; snippet at 12https://play.nim-lang.org/#ix=2gAG
09:16:25supakeenWhere do I need to look at how the documentation examples are run by the CI?
09:16:38supakeenPerhaps a nice saturday project to add it.
09:18:04Yardanicoit's really sad that this regression got into 1.2.0, guess we'll have 1.2.2 soon anyway :P
09:18:18supakeenHey, I release software as well, there's never a clean .0 :)
09:20:30supakeenYardanico: If I understand correctly the content-length should be moved inside the header if.
09:21:04Yardanicosupakeen: not really, if you do that then Content-Length header won't be added if there's no custom "headers" provided
09:21:10Yardanicosince by default "headers" var is "nil"
09:21:15YardanicoI'm trying to figure out a good way to fix it too
09:21:22supakeenAh let me check out the code so I have some more context then and I'll grab some coffee.
09:21:30supakeenI went off the PR diff.
09:22:09Yardanicoyeah, the PR is incorrect since if "headers" is not provided it's "nil"
09:22:20Yardanicothe check is not fully correct I mean
09:25:42YardanicoI showed one of the ways to fix it in https://github.com/nim-lang/Nim/issues/13866#issuecomment-609001843
09:25:44disbotasynchttpserver documentation example causes SIGSEGV ; snippet at 12https://play.nim-lang.org/#ix=2gAG
09:25:49*dwdv joined #nim
09:30:53YardanicoAraq: is the first fix in https://github.com/nim-lang/Nim/issues/13866#issuecomment-609001843 good enough or not? the issue seems kinda important because right now on 1.2.0 asynchttpserver just doesn't work at all :D
09:30:54disbotasynchttpserver documentation example causes SIGSEGV ; snippet at 12https://play.nim-lang.org/#ix=2gAG
09:31:27Yardanicowell, I mean it will work if user always provides his own "headers", but not if there's no user-provided "headers" so it's "nil"
09:31:31supakeenI think I have a slightly better way, Content-Length should not be added if it was supplied in the custom headers otherwise we always add it (old situation).
09:32:23Yardanicosupakeen: well that's what my code does, or maybe I understood you incorrectly?
09:32:34supakeenBy the way, what is the implicit change in that PR for `msg.add content.len` vs `msg.addInt content.len`.
09:33:17Yardanicoit's deprecated
09:33:37Yardanico"addInt" was deprecated since 0.20
09:33:45YardanicoI mean "add"
09:33:50Yardanicofor adding an int to string
09:34:34Yardanicodom96: are you there maybe? https://github.com/nim-lang/Nim/issues/13866
09:34:35disbotasynchttpserver documentation example causes SIGSEGV ; snippet at 12https://play.nim-lang.org/#ix=2gAG
09:39:36dom96replied
09:39:51supakeendom96: I think we replied at the same time, I added an isNil to the conditional.
09:39:56supakeenWant me to PR that?
09:40:14dom96yes please
09:40:23dom96If you could write a test that would be awesome as well
09:40:33Yardanicosupakeen: but in your case wouldn't it fail if "headers" would be nil?
09:40:44Yardanicoif headers == nil then content-length wouldn't be added
09:41:09supakeenAh correct.
09:41:49Yardanicosupakeen: I replied with a fixed snippet
09:42:52supakeenAh yes!
09:43:05Yardanicomake a PR then :)
09:43:16Yardanicoguess you could add tests a bit later since this is a pretty bad regression
09:44:34supakeenCreated the PR here: https://github.com/nim-lang/Nim/pull/13867 going to take a look at the testing setup now.
09:44:36disbotAdd isNil check to custom Content-Length.
09:45:21*krux02 joined #nim
09:47:33Zevvdisruptek: how do I *unsubscribe* from a disbot channel?
09:53:24*gangstacat joined #nim
09:55:18*andinus joined #nim
09:58:21*WilhelmVonWeiner joined #nim
10:00:07voltistCalling Python from Nim feels... dirty
10:00:14Yardanicowith nimpy?
10:00:27FromGitter<deech> I'm a Windows noob, I'm trying to get a Nim executable to link with `foo.lib`, can I just pass in `{.passL: -lfoo .}` like I do on Unix?
10:01:14voltistYardanico: Yeah
10:01:18Yardanicowhy though?
10:01:20Yardanicolooks very nice for me
10:01:46YardanicoI mean it's the best way to do it probably
10:02:01Yardanicopython is not static typing so you have to explicitly convert the types
10:02:31voltistYeah nimpy is good at what it does, but the actual act of calling Python from Nim makes me uncomfortable
10:02:39voltistThe sentiment
10:02:43Yardanicodon't do it then :P
10:03:15voltistI wish I had the option
10:03:27voltistBut I need a fully featured graphing library
10:03:32supakeenAre you using a specific Python library? Ah.
10:03:33Yardanicofor plotting?
10:04:03voltistYeah matplotlib. It has support for this specific type of plot I need
10:04:07Yardanicowhat about https://github.com/Vindaar/ggplotnim
10:04:37Yardanicohttps://github.com/Vindaar/ggplotnim/blob/master/recipes.org for examples
10:04:37supakeenHow I've done such stuff in the past is have my $X code output some data so I can write a separate Python script to turn it into plots.
10:04:44supakeenInstead of calling into Python directly.
10:04:59supakeenBut that might not apply to your case.
10:05:20voltistggplotnim calls R though right?
10:05:28Yardanicono?
10:05:35Yardanicoit's pure nim
10:05:49voltistOh it's not a wrapper but a port, I get it
10:07:18voltistHmmm I could use it
10:08:46*natrys joined #nim
10:11:33voltistNim would have such good potential for scientific computing if it had a more fully-featured plotting library. But, I suppose the way you get to that point is by using it so...
10:11:44voltistI better try
10:12:29FromDiscord<Rika> `<voltist> Nim would have such good potential for scientific computing if it had a more fully-featured plotting library. But, I suppose the way you get to that point is by using it so... ` i'm the kind of fucker to use turtle to plot my shit lmaooooo
10:24:03FromGitter<Vindaar> @voltist: if there's something missing from ggplotnim, just let me know and I'll make it a priority to implement!
10:24:10FromGitter<Vindaar> And I think you missed this:
10:24:57FromGitter<Vindaar> https://gist.github.com/Vindaar/9c32c0676ffddec9078e4c0917861fcd
10:26:25supakeenIs there away to run a specific subtest, currently I am doing `./koch tests cat stdlib` but I'd like to run one subtest of stdlib :)
10:27:14voltistVindaar: Woah, that's just what I'm looking for! Missed it? Was it mentioned earlier?
10:27:48FromGitter<Vindaar> @voltist: when you talked about such plots the other day I only saw about 2 hours later and made this. I think by that time you had left irc
10:28:58voltistAh yeah my ZNC doesn't work for some reason so I can't see these things. Thanks so much!
10:29:11FromGitter<Vindaar> note though that the way I create the DF in this gist is not quite the way you would do it on the current master branch of `ggplotnim`
10:29:59FromGitter<Vindaar> as in there's no "newDataFrame" (you'd just write `var df: DataFrame`) and you don't have to write `toColumn` when assigning a `seq`
10:30:14voltistOK, I'll remember that
10:30:41FromGitter<Vindaar> unless I forget something right now it should work. But I should probably have merged the arraymancer backend this weekend anyways, so then it should all work
10:31:53Araqsupakeen, testament r <single_test>
10:32:35voltistVindaar: Cool. If I get this working, its definitely going into this computational neuroscience library I'm working on
10:33:08FromGitter<Vindaar> @voltist: awesome! It should work and if it doesn't I'll help you get it working. ⏎ Is the library open source?
10:35:25voltistIt will be soon. I went on a little tangent from my research project yesterday to make a more accurate model and realized that I could turn it into it's own library, so I haven't been going for long.
10:35:45voltistGood progress so far though
10:35:55FromGitter<Vindaar> that's good to hear
10:38:12voltistIt means that something more general-use will come out of my project, as well as the paper about a specific nervous system
10:39:38FromDiscord<Recruit_main707> is arc default gc in nim 1.2¿
10:39:47FromGitter<Vindaar> great to hear of other people using Nim for scientific research!
10:41:11supakeenAraq: Thank you.
10:41:24Yardanico@Recruit_main707 no
10:41:31supakeenIt's a load of fun figuring out how to setup these asynchttpserver testcases :)
10:41:37Yardanicoit still has bugs
10:41:58Yardanicobut people should test their code with --gc:arc and report issues :)
10:42:04*PMunch joined #nim
10:45:26*solitudesf quit (Read error: Connection reset by peer)
10:45:35*solitudesf joined #nim
10:45:45supakeenPASS: tests/stdlib/tasynchttpserver C ( 2.19 sec)
10:45:49supakeenOoh, getting there!
10:50:03*Zectbumo quit (Remote host closed the connection)
10:52:36PMunchAsync in ARC?
10:52:45Yardanicoi think it still leaks
10:53:11Yardanicoah, PMunch, supakeen is just making tests for asynchttpserver so regressions like https://github.com/nim-lang/Nim/issues/13866 don't happen
10:53:12disbotasynchttpserver documentation example causes SIGSEGV ; snippet at 12https://play.nim-lang.org/#ix=2gAG
10:53:33supakeenAnd learning a bunch about async in Nim while at it, I need to solve one more thing and I'll have a pretty clean setup.
10:53:42PMunchAaah right
10:54:36PMunchHmm, that reminds me. I should continue my multitasking article series
10:55:46supakeenI'm currently mostly setting up something that "run a server, add this callback, perform request, kill server, return resolved request".
10:56:54supakeenso one could do `let response = testServerWith(callback, request); doAssert(response.status == Http200)` and such.
10:57:17supakeenAdd an await in there.
10:58:06PMunchAh right
10:58:27FromDiscord<flywind> Our team has written an article regarding a new streaming mode of asynchronous non blocking io for nim for Nim.
10:59:04FromDiscord<flywind> https://dev.to/xflywind/a-new-streaming-mode-of-asynchronous-non-blocking-io-for-nim-3dno
10:59:57voltistVindaar: Well I'm not off to a good start with "undeclared identifier: 'newDataFrame'"
11:00:12voltistDespite having imported ggplotnim and arraymancer
11:00:15FromGitter<Vindaar> @voltist: that's what I mentioned above
11:00:35voltistAww snap I forgot about that
11:01:11Yardanico@flywind will netkit get english translations? :)
11:01:30YardanicoI see both source code comments and readme are in Chinese rn
11:02:15FromGitter<Vindaar> give me 5 minutes and I'll fix the gist for current master
11:02:36FromDiscord<flywind> It's not finished.Maybe have english version later.
11:02:39FromDiscord<flywind> https://github.com/iocrate/org/blob/master/README_en.md
11:02:44supakeenGoing through this it might be nice to have a `waitForAll[seq[T]](futs: seq[Future[T]]): seq[T]` and waitForOne or such but perhaps that's my Python leaking through.
11:07:00voltistV1ndaar: "Error: unhandled exception: Not implemented! nnkCallStrLit [Exception]"
11:09:22FromGitter<Vindaar> @voltist: yep that's another thing I forgot about :)
11:09:54FromGitter<Vindaar> but there's actually a problem on `master`, due to a bug that's present when using `xmin` and `xmax`, which I've fixed on the new branch
11:10:22FromDiscord<Chiqqum_Ngbata> What's the website that has nim code runner?
11:10:28*josch557 joined #nim
11:10:43FromDiscord<Recruit_main707> playground right?
11:10:43FromDiscord<Chiqqum_Ngbata> Scratch that
11:11:16FromGitter<Vindaar> so I'd suggest: try to checkout the `arraymancerBackend` branch of ggplotnim with the gist as it is. It should work fine I hope. ⏎ If not or you don't want to do that, I'd suggest you give me a little bit of time to finish the PRs and then it'll work for sure
11:12:43*opal quit (Ping timeout: 240 seconds)
11:13:27voltistOK I'll try that first one
11:13:46lbartFYI, Nim 1.2.0 is available on FreeBSD https://svnweb.freebsd.org/ports?view=revision&revision=530639
11:15:30FromDiscord<Chiqqum_Ngbata> What am I doing wrong here (genericParams()) https://play.nim-lang.org/#ix=2gBj
11:15:51voltistV1andaar: arraymancerBackend gives me this error "Error: cannot open file: ../playground/arraymancer_backend"
11:15:52FromDiscord<Chiqqum_Ngbata> This was working in 1.1 IIRC
11:16:50FromGitter<Vindaar> @voltist: that's weird. The file should be present
11:17:07voltistLet me try something else
11:19:00voltistNope still got that problem
11:20:16voltistV1ndaar: The file is present in the source but obviously nimble isn't installing it or something?
11:20:25FromGitter<Vindaar> ohhh
11:20:26FromGitter<Vindaar> yes
11:20:42FromDiscord<Rika> @Chiqqum_Ngbata internal errors are compiler bugs from what ive heard
11:20:53FromGitter<Vindaar> for it to work you'll have to clone the repository and use `nimble develop`. Otherwise it won't be installed, since `playground` is not considered a `src` directory
11:21:44voltistEy, that worked
11:22:07*opal joined #nim
11:22:20FromGitter<Vindaar> :)
11:22:27voltistDoes that mean I have to change those things back to how it was in the Gist?
11:24:40FromGitter<Vindaar> yes
11:25:07voltistV1ndaar: OK. I did that, but yet an another error presents: https://pastebin.com/0WB9kcXa
11:26:29FromGitter<Vindaar> @voltist: ah, indeed. I haven't commited the import of `strformat` in column.nim
11:27:01voltistAh ok I can fix that real quick on my end
11:27:13FromGitter<Vindaar> ok, just pushed that line
11:28:44vegaiAraq: ah, cool
11:28:59vegai(styleCheck:error is cool, that is)
11:29:29FromDiscord<Chiqqum_Ngbata> Wonder if genericParams() is supposed to work with typedesc
11:30:23voltistV1ndaar: Well that helped, in the sense that we are now getting a different error: https://pastebin.com/4BR5QFzP
11:31:19FromGitter<Vindaar> @voltist: ah damn. That's because the arraymancer backend depends on a new version of `ginger`, which isn't merged either yet: ⏎ https://github.com/Vindaar/ginger/pull/15
11:31:21disbotViewport, GraphObject are ref, less cairo calls ; snippet at 12https://play.nim-lang.org/#ix=2gBn
11:31:49FromGitter<Vindaar> sorry for the inconvenience :)
11:32:41supakeenIs there a nice way to cancel a future?
11:34:01voltistV1ndaar: Nah all good. I was going to say "Ok I'll just install your fork of Ginger", but of course that wouldn't work would it ;)
11:34:33voltistI can checkout the branch though
11:34:34FromGitter<Vindaar> for ginger it should work, since it's just a normal change in the main file
11:35:21FromGitter<Vindaar> so: `nimble install "ginger@#moreRefLessCairoCalls"` should work
11:36:06voltistYay it worked
11:36:08PMunchsupakeen, don't think so
11:36:12FromGitter<Vindaar> sweet!
11:38:14voltistV1ndaar: "Error: unhandled exception: Either `guessType` failed to determine the type due to multiple base types in the column or the data is really `VNull` [ValueError]"
11:38:26FromDiscord<Chiqqum_Ngbata> Found an old version of genericParams() that works in case anyone else needs it https://play.nim-lang.org/#ix=2gBp
11:38:41voltistCould this be because one column is made from an int seq?
11:39:56FromGitter<Vindaar> @voltist: hm, what's the output of the column type when you print the DF you want to plot?
11:40:27FromGitter<Vindaar> This is partly a leftover from the default backend DF, which didn't have typed columns so I had to guess the type by looking at a few elements
11:41:52*derka joined #nim
11:42:27voltistV1ndaar: Oh no, its a mistake on my part. There were no rows because I had incorrectly changed the parameters of the simulation
11:42:57FromGitter<Vindaar> ok!
11:47:56voltistV1ndaar: Hmmm, it seems that the DF only has one row, no matter how long the seqs are
11:49:06PMunchhmm, I had the idea to use tree edit distance (Zhang Shasha) to layout windows in my WM. But I'm afraid that checking all possible trees would be expensive.. Does anyone know of an algorithm to generate increasingly long edit scripts so I can stop when I have a valid one instead?
11:50:18FromGitter<Vindaar> @voltist: Hmm, that is.. weird? So you only see single row if you print it?
11:51:06voltistYeah I'll link a paste
11:51:14FromGitter<Vindaar> ok, thanks
11:53:05voltistOh wait no, error on my part again. This is what is actually causing the problem: "Error: unhandled exception: Cannot evaluate a formula of kind fkVector without a data frame as input! [ValueError]"
11:54:14FromGitter<Vindaar> Hm, that could be a bug or due to usage
11:55:22voltistOh and it specifies this as well: "arraymancer_backend.nim(2102) evaluate"
11:56:15FromGitter<Vindaar> yep, that's the proc that tries to evaluate the formula. But if I don't see the context in which that formula is created it's hard t say whether it's a bug or not
11:56:29FromGitter<Vindaar> A formula is just something that''s created with the `f{}` macro
11:57:43voltistHere is that last bit: https://pastebin.com/J7GKcn1p Pretty similar to how you had it but with the axes the right way round and stripped down a bit
11:58:16FromGitter<Vindaar> ah!
12:00:22FromGitter<Vindaar> I think that's just a bug. The problem is that a formula as `f{c"neurons" + 1.0}` essentially means "loop over column "neurons" and add 1 for each element". But apparently the evaluation is broken right now. I'll check it out
12:01:04voltistWhy do you think it wasn't broken with the formula you had in there?
12:01:51FromGitter<Vindaar> I don't quite know yet. Need to see what goes wrong
12:02:58voltistIt seems to work if I go with a single neuron and replace the formulas with 1.0 and -1.0
12:03:23voltistAnd then I get another error
12:04:27FromGitter<Vindaar> oh, I get it
12:04:36FromGitter<Vindaar> it's just a regression from a "fix" I did yesterday
12:04:45FromGitter<Vindaar> the gist doesn't work at all anymore. Sorry, I'll push a fix
12:05:08voltistOk
12:05:40voltistI'll give that one last shot (and whatever this new error is) and then I'll log off for the night
12:06:02*supakeen quit (Quit: WeeChat 1.9.1)
12:06:44*supakeen joined #nim
12:08:03FromGitter<Vindaar> yeah, no worries
12:08:52livcdPMunch: you disappeared :D!
12:09:38PMunchHuh?
12:09:42PMunchI'm here!
12:11:37livcdPMunch: I wanted to talk to you about parsetoml and arc. Did you try it yourself?
12:11:52PMunchAh, no
12:14:43supakeenI have a feeling I totally fubarred my test idea due to unfamiliarity with Nim's futures/asyncawait; here is a reduced example with genericness removed: https://bpaste.net/MP5Q the testcase works but pretty is different.
12:15:02FromGitter<Vindaar> @voltist: ok, I need to think about properly, otherwise I risk breaking other stuff
12:15:13supakeenAny pointers on how to make this more Nimlike? :)
12:15:49PMunchAha, undeclared identifier deepCopy
12:16:48voltistV1ndaar: All good, I'll leave you to it then. Talk tomorrow maybe. Thanks for all this help!
12:17:28*voltist quit (Quit: Leaving)
12:20:46*Guest19241 quit (Ping timeout: 265 seconds)
12:21:50*dadada joined #nim
12:22:14*dadada is now known as Guest44825
12:23:53FromGitter<Vindaar> @voltist: yeah, just ping me (but use @Vindaar please)
12:23:58FromGitter<Vindaar> and you're welcome!
12:24:06PMunchsupakeen, this fixes your issue: http://ix.io/2gBD/nim
12:25:04PMunchI think it's actually a bug in asynchttpserver, line 103 should have a nil check on it.
12:28:46supakeenPMunch: I've created the PR for that: https://github.com/nim-lang/Nim/pull/13867
12:28:48disbotAdd isNil check to custom Content-Length.
12:28:59supakeenCurrently looking at adding testcases to asynchttpserver in general so the CI can catch regressions like that.
12:32:44*couven92 joined #nim
13:00:45*couven92 quit (Read error: Connection reset by peer)
13:01:15*couven92 joined #nim
13:04:57FromDiscord<++x;> Nim has finally became a bit more popular, you guys did an amazing job.
13:06:08FromDiscord<++x;> Now goodbye people
13:10:29FromGitter<zetashift> ...goodbye?
13:13:10FromGitter<alehander92> i am tryyying
13:13:14FromGitter<alehander92> to rebase my custom branch
13:13:26FromGitter<alehander92> which was based on 1.0.6 to 1.2.0 but i have many new conflicts
13:13:44FromGitter<alehander92> is 1.2.0 supposed to be like linearly continued from 1.0.6 ?
13:14:00FromGitter<alehander92> like, i shouldnt get conflicts between commits in those 2 tags
13:14:05FromGitter<alehander92> or am i getting it wrong?
13:14:33*liblq-dev joined #nim
13:15:36liblq-devso I guess incremental compilation didn't make it to 1.2.0?
13:15:44liblq-devcan't see it in the changelog
13:16:05FromGitter<alehander92> oh no, so probably
13:16:11FromGitter<alehander92> 1) 2.0 is based on 1.0 not on 1.0.
13:16:13FromGitter<alehander92> 1) 0.6
13:16:25FromGitter<alehander92> makes sense, i should try to make my patch a single commit
13:21:58disruptekIC is immature.
13:24:30Zevv"Nim might be great. But how can a great language get traction if nobody big is behind it?"
13:24:34disruptek1.2 is a devel-side release w/o LTS.
13:25:52*josch557 quit (Ping timeout: 260 seconds)
13:27:36FromDiscord<clyybber> Zevv: Oh, that HN comment :/
13:28:37FromDiscord<clyybber> I think its fine to get big in hobbyist space only. Like python did. First get people to love you, then to vote for you
13:28:50Zevvright. who was behind python or ruby?
13:33:42FromDiscord<clyybber> Or research space
13:34:28FromDiscord<clyybber> Like at status or in bioinformatics
13:48:37*Vladar quit (Quit: Leaving)
13:51:43FromGitter<deech> Re-ask in case someone in the morning/afternoon crowd knows: how I do I link in a `.lib` static archive on Windows with `passL`? Ideally I'd like to set the path in an env variable (`PATH` doesn't seem to work) instead of a fully qualified path to the linker.
13:52:45Araq .passL: "foo.lib"
13:52:52*Vladar joined #nim
13:53:57FromGitter<deech> And do you know the env variable?
13:55:05*livcd quit (Ping timeout: 272 seconds)
13:55:13*livcd joined #nim
14:01:11*rockcavera joined #nim
14:01:21Araqconst e = getEnv("badIdea"); .passL: e
14:13:53FromGitter<alehander92> has someone used wiggle ?
14:17:04FromGitter<alehander92> ahhh ok https://stackoverflow.com/questions/16190387/when-applying-a-patch-is-there-any-way-to-resolve-conflicts
14:17:10FromGitter<alehander92> so git am -3 is what one does
14:17:17FromDiscord<joey> I'm trying to use the "-d:nimHasLibFFI" but it doesn't seem to be working (using prebuilt nim 1.2 binary)
14:17:19FromGitter<alehander92> i wonder if people maintain their own patches of nim do this
14:17:22FromGitter<alehander92> who *
14:17:28FromDiscord<joey> ./nim-1.2.0/bin/nim c -d:nimHasLibFFI test.nim
14:17:38FromDiscord<joey> /home/joey/tmp/2020-04-04/test.nim(4, 3) Error: cannot 'importc' variable at compile time; c_printf
14:17:38FromGitter<alehander92> joey oh yeah, are you installing the libffi package
14:17:51FromGitter<alehander92> no, i think you should compile the compiler itself
14:17:51disruptek~stream
14:17:53disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
14:17:54FromGitter<alehander92> first with that option
14:18:13FromDiscord<joey> Ah, the compiler has to be compiled with that?
14:18:16FromDiscord<joey> Thanks, I'll try
14:18:18FromGitter<alehander92> oh disruptek you're back here
14:18:36FromGitter<alehander92> joey yes, because in order to do the vm ffi, this has to be compiled in the vm itself i think
14:19:25FromGitter<alehander92> look at this comments https://github.com/nim-lang/Nim/pull/13091
14:19:27disbotenable testing -d:nimHasLibFFI mode
14:25:27*ehmry[m] is now known as ehmry
14:27:34liblq-devTIL about `@` for strings
14:27:56FromGitter<alehander92> what does it do
14:33:03liblq-devconvert a string to a seq[char]
14:33:37FromGitter<sealmove> guys, have you seen an error that looks like "could not import: X509_check_host" when trying to install a package with nimble
14:33:38FromGitter<sealmove> ?
14:37:17FromGitter<alehander92> hmm
14:41:06liblq-devI think sequtils needs a `find` with a callback and similarly `findIt`, I have to loop through a sequence right now to find the first thing that fulfills a given predicate
14:41:18liblq-devor does it already exist in the stdlib somewhere?
14:41:34FromGitter<alehander92> if its not in sequtils
14:41:36FromGitter<alehander92> it should be there
14:42:00FromGitter<alehander92> i am not entirely sure tho where is the difference with `algorithm`
14:42:35FromDiscord<joey> thank alehander92, it worked!
14:42:58FromGitter<alehander92> no problem, thank @timotheecour for the comments, i also used them
14:43:54disrupteki have a codegen bug in nim devel against nimph tests. it's arc only.
14:44:14disruptekFAILED: nim c --gc:arc -r tests/tpackage.nim
14:50:02liblq-devwhat is cpuRelax() useful for?
14:51:37FromDiscord<Generic> isn't it for spinloops?
14:55:15liblq-devwhat's a spinloop?
15:02:51FromDiscord<Recruit_main707> why am i getting this error? https://play.nim-lang.org/#ix=2gCo
15:08:26shashlick@alehander92: 1.2.0 is branched off from devel, like 1.0.0 was
15:08:57shashlick1.0.6 was built on 1.0.0 branch, not off of devel
15:10:12*PMunch quit (Quit: leaving)
15:10:36FromDiscord<Recruit_main707> what does 'export' is
15:10:37FromDiscord<Recruit_main707> only allowed at top level mean?
15:11:06disruptekshashlick: what do you mean by "how did nimph find the package"?
15:11:36*couven92 quit (Read error: Connection reset by peer)
15:11:46liblq-dev@Recruit_main707 exactly as it sounds, you can't use `export` in scopes deeper than the global scope.
15:12:04*couven92 joined #nim
15:12:39FromDiscord<Recruit_main707> it seems like a library error then...
15:16:07FromDiscord<Generic> liblq-dev: when you have a loop which does nothing but wait for a memory location to be set to a certain value
15:16:28FromDiscord<Generic> see https://www.felixcloutier.com/x86/pause for the instruction cpuRelax compiles to
15:18:08liblq-devmakes sense
15:18:39shashlickdisruptek: back on a laptop, re-reading the issue
15:18:46shashlickbasically asking how did user point to the package
15:19:37disrupteki dunno, they installed it with nimble i think.
15:20:18shashlickhow did nimph know to look for packages in ~/.nimble/bin?
15:20:24shashlickdid they set a nimble dir or do you look there
15:20:37disrupteknimph looks at whatever your nimble dir is set to.
15:20:59FromGitter<alehander92> shashlick yeahh sorry]
15:21:00disruptekactually, it looks at all your nimble dirs.
15:21:17shashlickthen why don't you use $nimbleDir which was recently added
15:21:19shashlickwhy reduce it to $nim
15:21:34shashlickand what made you think that $nim = ~/.nimble/bin? where did that come from
15:21:41disrupteki do, if nimph is built with a compiler that supports it.
15:22:26shashlickso 1.0.6 has it right? wasn't it backported?
15:22:51disrupteki don't think so. i'm using the compiler's path substitution. if it's supported, i can improve it.
15:23:02FromDiscord<clyybber> lqdev: a spinloop is waiting for a lock or something similar using this: `while not lock.isAvailable: discard`
15:25:13shashlickwait, i'm still trying to understand what the issue is here
15:26:16disruptekthe issue is that choosenim puts a shim to the nim binary in place A, which nim then uses as $nim.
15:26:55disruptekit's a choosenim bug.
15:27:07shashlicki've used choosenim for 3 years now and use $nim for nimterop every day
15:27:52disruptekcan you reproduce the issue?
15:28:29shashlickhttps://github.com/nimterop/nimterop/blob/master/config.nims#L15
15:28:34*vesper quit (Ping timeout: 240 seconds)
15:28:47shashlickhttps://github.com/nimterop/nimterop/blob/master/nimterop/ast2.nim#L5
15:29:09shashlicksetting $nim with choosenim works just fine - I can import the compiler files - $nim doesn't get substituted for $HOME/.nimble/bin
15:29:38shashlickthe question is why you reduce $HOME/.nimble/pkgs/xyz to $nim/pkgs
15:30:02disrupteki use whatever the compiler's path substitution provides.
15:30:26disruptekif $nim == $HOME/.nimble/pkgs then I say $nim/xyz
15:30:53shashlickwhere do you get $nim from
15:31:00disruptekomg dude.
15:31:01*Trustable joined #nim
15:31:06disrupteklook at the code i linked to in the issue.
15:31:25disruptekthere's no bug in nimph here.
15:31:56shashlickfine, I'll just stop caring
15:32:14disruptekwhy? because you don't understand it?
15:32:43disruptekyou don't even use nimph, right?
15:33:13disruptekand i guess kungtotte doesn't use choosenim anymore. so it only matters to you because... i dunno.
15:33:53shashlicki care about nim, choosenim, nimble and nimph - if you don't want to answer questions about code you wrote then that's up to you
15:34:40disrupteki don't know how to answer the question except to tell you that i use the compiler's code and as i've explained several times in the issue, nimph is doing exactly what it's supposed to do.
15:34:53disruptekit shortens paths by using substitutions when appropriate.
15:35:14shashlickok then i'll figure it out myself where the issue is, no thanks
15:35:18disruptekthe order in which it tests these substitutions for suitability is defined in the code i linked.
15:35:42disruptekthere's no issue.
15:36:22*silvernode joined #nim
15:44:27FromGitter<eliezedeck> Hey guys, how can I fail a `FutureStream` and cause an exception to be raised to the `await`?
15:44:48*NimBot joined #nim
15:52:23*companion_cube joined #nim
16:00:34FromGitter<alehander92> hm, good question
16:02:25*livcd quit (Changing host)
16:02:25*livcd joined #nim
16:02:25disruptekhttps://www.dropbox.com/s/mxje14sn8xschlg/map.svg?dl=0
16:02:35disrupteks/svg/png/ to maybe help you crash less.
16:05:00*jegfish joined #nim
16:06:02Araqeliezedeck: future's have a 'fail' proc
16:10:54*silvernode quit (Ping timeout: 240 seconds)
16:14:34FromGitter<zah> one simple idea for the tables module: have a helper that allows me to make an efficient deletion loop. It takes a block in which I mark slots for deletion. when the block completes, the table is potentially resized/rehashed
16:15:26FromGitter<eliezedeck> @Araq yes, I've already seen that, but what if I want to inform any arbitrary reader of the `FutureStream` of an error/exception, just like with `Future`? I think that is a legitimate use case
16:16:10Araqzah: interesting
16:20:29*dddddd joined #nim
16:21:44companion_cubeAraq: so yesterday I realized that nim doesn't typecheck the proper usage of tagged enums (or whatever the exact name for this is), any reason why not?
16:22:47*solitudesf- joined #nim
16:23:17FromDiscord<mratsim> but it does?
16:23:37Araqcompanion_cube: and when did you stop beating your wife? ;-)
16:23:42yumaikaszah: That sounds like a nifty idea
16:23:46FromDiscord<mratsim> you have a runtime error if you access the wrong field
16:24:04companion_cubeAraq: that doesn't help :p
16:24:30Araqquestions that imply wrong assumptions are mean
16:25:20*solitudesf quit (Ping timeout: 265 seconds)
16:25:50companion_cubehm ok, didn't mean to be mean. I was just kind of disappointed
16:26:42yumaikasAraq: I'm kinda with companion_cube here, what's the wrong assumption?
16:27:07companion_cubehttps://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants <--- I thought that the fields would only be accessible in the corresponding branch of a `case`
16:27:15*solitudesf- is now known as solitudesf
16:27:20companion_cubebut you can access the "wrong" fields, and it's a runtime error, not a compile-time one
16:27:20Araqyumaikas: the wrong assumption is that runtime checks to ensure safety are not "really safety"
16:27:49yumaikasAh
16:27:51companion_cubeI'm not talking about safety but well-typedness here
16:28:11companion_cubeit's like accessing a non-existing field of an object would fail at runtime
16:28:33yumaikasIt does mean that there are some runtime costs to unions, I suppose, but runtime checks could be later turned into comptime checks if someone was interested enough to do so
16:29:02Araqit's like an "index out of bounds"
16:29:37companion_cuberight now it is, but I was excited about nim having sum types, is all :/
16:29:50companion_cube(hence my question "why not have that" basically)
16:29:57FromDiscord<clyybber> Eh, so you complain about being able to do something?
16:30:04FromDiscord<clyybber> I guess we could optionally enable a warning
16:30:06FromDiscord<mratsim> how can you check at compile-time if the value are known at runtime only?
16:30:10Araqcompanion_cube: 1. there is a warning for it and with DrNim it'll be statically checked
16:30:30yumaikasWhat is DrNim?
16:30:37FromDiscord<clyybber> A static prover
16:30:37FromDiscord<mratsim> Nim + Z3 SMT solver
16:30:39FromDiscord<clyybber> using z3
16:30:45companion_cubeI didn't get a warning when I tried…
16:31:06companion_cubemratsim: you check in each branch of a case that only the fields for this case are accessed
16:31:18Araq2. usually there is little difference between memory safety and type safety.
16:31:20companion_cubeit's not as hard as index out of bound
16:31:58FromDiscord<mratsim> if you have "proc foo(myVariant: SumType) = myVariant.intField = 0
16:31:58FromDiscord<clyybber> we do that check already, and optimize the runtime checks away if possible AFAIK
16:32:15FromDiscord<clyybber> @mratsim He wants it to be disallowed
16:32:23FromDiscord<mratsim> ah
16:32:25FromDiscord<mratsim> ok I see
16:32:29companion_cubetbh yeah, that's a weird thing to do
16:32:42companion_cube(I come from ML languages, so…)
16:33:43companion_cubeI don't even think this should be disallowed if there's a runtime check, I just want a compile error if I do something that will 100% give a runtime error, like `case x.tag of A: use x.bField`
16:34:11Araqcompanion_cube: I agree that ML's design is better but Nim followed Ada's design
16:34:13FromDiscord<clyybber> You will get one.
16:34:21FromDiscord<clyybber> Actually let me test first
16:34:33yumaikasSo no type punning on unions in Nim?
16:34:44Araqwhich has the benefit that the enum aspect is distinct from the sum type aspect
16:34:53companion_cubeclyybber: I didn't get one, maybe I missed sth
16:35:01Araqwhich is a better fit for systems programming (IMO anyway)
16:35:05companion_cubeAraq: yeah accessing the tag is useful
16:35:22Araqand makes certain patterns easier to express when it comes to serialization
16:35:27companion_cubebut Zig, for example, has a similar syntax/design but typechecks
16:35:39FromDiscord<mratsim> Rust as well AFAIK
16:35:43companion_cubeyes, indeed
16:35:53AraqZig has the benefit of not being 10 years old
16:35:59companion_cubeoh I'm not questioning the design itself, just what I perceive to be a missing typecheck in the compiler
16:36:21companion_cubekotlin does it, too, btw
16:36:36AraqI know, Nim is a strange outlier
16:36:52companion_cubein some ways nim seems really similar to D
16:37:02companion_cube(with different choices when it comes to syntax, obviously)
16:37:05FromDiscord<clyybber> companion_cube: Nevermind, it doesn't
16:37:16companion_cubeclyybber: yeah I was also surprised :)
16:37:25Araqbut *shrug* we're getting there and in the mean time you can still write perfectly good code
16:37:41FromDiscord<clyybber> companion_cube: We do the same analysis in object construction
16:37:44companion_cube👍 sure
16:37:53FromDiscord<clyybber> So it warns you there
16:38:07companion_cubeif you use a tag and fields that mismatch?
16:38:12FromDiscord<clyybber> Yeah
16:38:28FromDiscord<clyybber> For the assignment case it may come naturally with z3
16:39:01FromDiscord<clyybber> Because we would collect the fact that e.kind is 1 in the respective branch
16:41:00companion_cubeindeed it fails at construction
16:42:33*lritter joined #nim
16:45:34Araqthere is warning[ProveObjectFields]:on or similar
16:55:39companion_cubebootstrapped in pascal… you're a Wirth fan? :)
17:02:58*silvernode joined #nim
17:07:37FromDiscord<KingDarBoja> Anyone has issues with VSCode nim extension not reporting errors unless you save another file?
17:08:00FromDiscord<Varriount> @KingDarBoja I've had it do that when using find/replace
17:08:13FromDiscord<Varriount> Although, in that case I've just had to re-save the current file.
17:09:04FromDiscord<KingDarBoja> Resaving the current file takes away the error lint
17:09:23FromDiscord<KingDarBoja> I have to save another file in order to trigger the lint which is very weird
17:12:53*sleepyqt quit (Ping timeout: 265 seconds)
17:14:15FromDiscord<clyybber> companion_cube: bootstrapped in nim now
17:15:48companion_cubeyeah, I saw that in some docs
17:16:17leorizeif you go back far enough in nim-lang/Nim commit history, you'll find the original pascal-based compiler
17:18:15FromDiscord<mratsim> @companion_cube, lots of Modula 2 and Oberon inspiration in Nim
17:18:21FromDiscord<Varriount> @KingDarBoja Could it be interference from another extension?
17:18:56FromDiscord<KingDarBoja> Jummm, this is the only Nim extension I have installed, but worth checking for other extensions
17:19:22FromDiscord<Varriount> @KingDarBoja You might also check the debug console
17:21:12*waleee-cl joined #nim
17:21:30disruptekAraq: seems like drnim requires --threads:on in its nim.cfg.
17:21:37disruptek<-- linux
17:25:31*couven92 quit (Read error: Connection reset by peer)
17:25:55*couven92 joined #nim
17:29:48*silvernode quit (Ping timeout: 265 seconds)
17:52:35FromGitter<alehander92> companion_cube is this about rust-like enums?
17:52:57companion_cubealehander92: yeah, sum types, in a way
17:53:26companion_cubesum types go hand in hand with pattern matching/exhaustiveness checking/…
17:54:03leorize!repo gara
17:54:05disbothttps://github.com/alehander92/gara -- 9gara: 11 15 63⭐ 5🍴
17:54:09leorize!repo patty
17:54:10disbothttps://github.com/andreaferretti/patty -- 9patty: 11A pattern matching library for Nim 15 173⭐ 10🍴
17:54:29leorizecompanion_cube: ^ one of them provides sum types, one of them provides pattern matching :)
17:55:54Araqcompanion_cube: I suppose I used to be
17:57:31FromDiscord<KingDarBoja> Ummm how to check a child object is empty (nil?) ?
17:57:51FromDiscord<Varriount> if isNil(object)
17:58:11FromDiscord<KingDarBoja> That only seems to work for the parent object, not the child one
17:58:18FromDiscord<KingDarBoja> Wait a minute and I will bring an example
18:00:28FromGitter<eliezedeck> > Hey guys, how can I fail a `FutureStream` and cause an exception to be raised to the `await`? ⏎ ⏎ Anyone?
18:04:41FromDiscord<KingDarBoja> https://play.nim-lang.org/#ix=2gDh the if part
18:05:48*couven92 quit (Read error: Connection reset by peer)
18:06:14*couven92 joined #nim
18:06:41liblq-dev@KingDarBoja regular objects cannot be nil
18:06:46liblq-devonly ref objects
18:10:53FromDiscord<KingDarBoja> https://nim-lang.org/docs/system.html#isNil%2Cref.T Ah, that what it means...
18:13:08FromDiscord<KingDarBoja> Thank you liblq-dev
18:13:45liblq-devyeah, you probably want an Option if you want this object to be optional. see the `options` module
18:17:14liblq-devis there a way of specifying command line params on the nim playground?
18:17:44*sleepyqt joined #nim
18:30:04*vesper11 joined #nim
18:30:13*Pix_ joined #nim
18:30:33*vesper11 quit (Read error: Connection reset by peer)
18:33:49*Pixeye quit (Ping timeout: 264 seconds)
18:37:47leorizeliblq-dev: no
18:38:12leorizewell you can write your nim file so that it calls the compiler to compile itself again with all the flags you want :P
18:38:46liblq-devbut that's hacky and not really feasible for bug reports
18:39:40liblq-devimo, if the first line begins with `#! nim` or something, it should be interpreted as command line parameters
18:40:00leorizeor you can just have a field for that :P
18:40:13leorizehttps://github.com/nim-lang/Nim/blob/devel/lib/system/repr_v2.nim <- any how the implementations are all in here
18:40:19leorizeso should be simple to add uint support
18:41:17*silvernode joined #nim
18:46:00*kenran joined #nim
18:50:14*vesper11 joined #nim
18:56:03*opal quit (Ping timeout: 240 seconds)
18:56:17FromDiscord<mratsim> @liblq-dev, I've fixed your issue with Weave by the way
18:57:42FromDiscord<mratsim> it was due to Nim sets not being able to hold "-1" and somehow at the beginning of June there was a corner case where it worked
18:57:52FromDiscord<mratsim> and after some patch it was fully disabled
18:58:17FromDiscord<mratsim> (https://github.com/mratsim/weave/issues/106)
18:58:18disbotNim sets don't support negative ID in thief ID checks
18:59:03FromDiscord<KingDarBoja> liblq-dev: Yeah, using that right now 🙂
18:59:18*opal joined #nim
18:59:59FromDiscord<clyybber> @mratsim Can you report it upstream? Seems like a bug to me
19:00:24FromDiscord<mratsim> well it was a bug that was fixed and I was relying on the bug
19:00:59FromDiscord<clyybber> oh
19:01:00FromDiscord<mratsim> I was doing "ascertain: req.thiefID in {myWorker().left, myWorker().right}" and thiefID could be negative
19:01:16FromDiscord<clyybber> and now thiefID can't be negative anymore?
19:01:22FromDiscord<clyybber> I thought you just changed the if condition
19:01:27FromDiscord<clyybber> To an or
19:02:04FromDiscord<mratsim> It's a sanity check, I just changed the check to "ascertain: req.thiefID == myWorker().left or req.thiefID == myWorker().right"
19:02:07*gangstacat quit (Ping timeout: 265 seconds)
19:02:57FromDiscord<mratsim> the bug was that somehow you could construct a set with negative int in the past I guess
19:03:24leorize!issue set variable
19:03:26disbothttps://github.com/nim-lang/Nim/issues/13764 -- 3set[T] construction is not typechecked for variables 7& 29 more...
19:03:26FromDiscord<mratsim> but only in one specific situation because I tried with naive {-1, 1} in old Nim version and the compiler refused
19:03:42AraqI remember seeing a bugfix for that
19:04:12FromDiscord<clyybber> but seq[int16] should still allow -1 right?
19:04:20leorizestill no fixes for this problem in set construction
19:04:52FromDiscord<mratsim> well that one is strange, int16 should have -32768..32767 range but currently it has 0..65535
19:08:09Araqah
19:17:03*kenran quit (Ping timeout: 260 seconds)
19:18:24*gangstacat joined #nim
19:21:26FromDiscord<mratsim> Weave 0.4.0 released. Finally I can target a stable Nim version
19:23:45Zevvcongrats mratsim!
19:24:03liblq-dev@mratsim, yeah, I saw that in my e-mail box in the morning :)
19:24:05liblq-devthanks for the fix
19:24:16*ryukoposting joined #nim
19:24:50ryukopostingnew PR for the SDL2 bindings https://github.com/nim-lang/sdl2/pull/122
19:24:52disbotAdd Audio Streams API, docs, example ; snippet at 12https://play.nim-lang.org/#ix=2gFd
19:25:53solitudesfryukoposting, thats cool, but where is new video
19:36:08ryukopostinglmao
19:36:47ryukopostingI want to make videos about my new project (which uses a toooooon of macros)
19:37:12ryukopostinghowever, due to the rapture, I am currently living out of my parents' basement so the audio would be awful
19:37:51ryukopostingand I gave my nice mic to my mother, since she's a teacher and needs it more than I do right now, so the audio would be even worse
19:39:27dom96ryukoposting, nice, merged
19:40:22rayman22201sigh. No Nim async experiments for me today. I have catch up on day job work that I didn't get finished during the week.
19:41:07dom96rayman22201, work on a weekend? Keep that work-life balance in mind
19:41:11ryukopostingnow that I basement dwell, suddenly I have more free time
19:43:49rayman22201Thanks dom96. I try not to make it a habit, but sometimes I can't help it.
19:44:18FromDiscord<KingDarBoja> That's terrible, watch out as dom96 said
19:48:51*Zectbumo joined #nim
20:02:00*josch557 joined #nim
20:11:55*Vladar quit (Quit: Leaving)
20:12:54*mjsir911 quit (Quit: Goodbye, World!)
20:13:31FromGitter<alehander92> companion_cube
20:13:35FromGitter<alehander92> patty and gara
20:13:39FromGitter<alehander92> were supposed to merge eventually
20:13:47FromGitter<alehander92> so in theory we can have this based on macros
20:13:56FromGitter<alehander92> 1) exhaustive checking if i recall correctly
20:14:03FromGitter<alehander92> with a bit more work
20:14:12FromGitter<alehander92> its not really limited by the language
20:15:30*mjsir911 joined #nim
20:30:34*andinus quit (Quit: ERC (IRC client for Emacs 26.3))
20:35:12disruptekshashlick: maybe you could explain to me your code that causes nimph to produce extra output in 1.2 and less in 1.0.6?
20:36:37shashlickWhat are you seeing
20:37:27disruptekwell, i've tried to explain it many times.
20:37:49disruptek👭cloning https://github.com/nitely/nim-unicodeplus...
20:37:49disruptekHint: used config file '/home/adavidoff/git/Nim/config/nim.cfg' [Conf]
20:37:49disruptekHint: used config file '/home/adavidoff/git/Nim/config/config.nims' [Conf]
20:37:49disruptekHint: used config file '/home/adavidoff/git/memrecall/nim.cfg' [Conf]
20:37:49disruptekHint: used config file '/home/adavidoff/git/memrecall/deps/pkgs/nimterop-#master/nim.cfg' [Conf]
20:37:52disruptekHint: used config file '/home/adavidoff/git/memrecall/deps/pkgs/nimterop-#master/config.nims' [Conf]
20:38:18disruptekto reproduce, try using nimph on 1.2 versus a version built with 1.0.6.
20:41:18shashlickWhat did you run - you bootstrapping nimph?
20:41:25shashlickOr installing a package
20:42:03disrupteki'm trying to build memrecall.
20:42:17disruptekit depends on rapid. rapid depends on glfw, nimterop-wrapped.
20:43:12shashlickOk
20:43:33shashlickYou referring to the cfg vs nims order of loading?
20:43:46disruptekno idea.
20:44:33shashlickOk so is the issue that you are seeing more hints or that it doesn't with at all
20:44:39shashlickWork
20:45:05disruptekwell, i have two problems right now.
20:45:13disruptekbut, i remembered that you care about nimph.
20:47:35disruptek~stream
20:47:36disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
20:48:05shashlickNot able to join the stream right now but give me something specific
20:48:31disrupteknimble build wants to install [email protected] though i only require 0.7.2 and i have 0.8.0.
20:48:35shashlickI know nimterop needs more work to make nimph more reliable
20:48:37disruptekjust trying to build nimterop.
20:49:16disrupteki guess nimph cannot build nimterop anymore.
20:49:53shashlickWhat changed?
20:50:16disrupteknimterop requirements?
20:51:14disrupteklemme try rolling it inside the nimph localdeps.
20:52:08*Zectbumo quit (Remote host closed the connection)
20:52:12disrupteknimble dump is super slow right now. feels almost hung. took 14.2s just to execute `nimph path nimterop`.
20:52:57shashlickI've been neck deep in getting ast2 working
20:53:05disruptekyeah, i cannot build nimterop, even an old version. due to needing latest unicodedb.
20:53:23shashlickYes regex has made many upstream changes
20:53:30shashlickAdded a new segmentation package
20:53:56shashlickI was thinking of moving back to pcre but it doesn't work at compile time
20:54:04disrupteki can build it just fine with nim, but not nimble.
20:54:10disrupteki usually just `nimble build`.
20:54:54disruptekmaybe nimble is the one producing extra output?
20:55:12disruptekhmm, no.
20:57:03shashlickI just ran the bootstrap yesterday and it worked
20:57:12shashlickWhat are you running - can you gist
21:01:45*couven92 quit (Read error: Connection reset by peer)
21:02:09*couven92 joined #nim
21:03:12*moerm joined #nim
21:03:22moermHello everyone
21:08:53FromDiscord<KingDarBoja> Hi
21:10:15*couven92 quit (Read error: Connection reset by peer)
21:10:40*couven92 joined #nim
21:12:50*josch557 quit (Remote host closed the connection)
21:12:51*silvernode quit (Ping timeout: 250 seconds)
21:24:34FromDiscord<Rika> Hello
21:29:39FromDiscord<exelotl> Would it be considered good form to do this? https://hastebin.com/raw/eqigusabob.nim
21:30:20FromDiscord<exelotl> essentially building 2 or more implementations into 1 function, to reduce clutter in the docs.
21:32:02FromDiscord<Rika> i dont see why not
21:36:03shashlickdisruptek: where can I find memrecall
21:36:13disruptek!repo memrecall
21:36:13disbothttps://github.com/liquid600pgm/memrecall -- 9memrecall: 11This future is war. Go back in time to fix it all. 15 17⭐ 1🍴
21:37:58*voltist joined #nim
21:38:18shashlickoki cloned it, set NIMBLE_DIR and ran nimph doctor
21:38:37disruptekwhy would you set NIMBLE_DIR?
21:39:10shashlickfor localdeps?
21:39:14*solitudesf quit (Ping timeout: 256 seconds)
21:39:21disruptekdo i have to do that now?
21:39:43shashlickno i'm just telling nimph to
21:39:53shashlickunable to resolve requirement `nimYAML**`
21:39:56disrupteki don't do that. does it help?
21:40:08shashlickok i'll get rid of nimble_dir
21:40:08disruptekyeah, it's nice that the compiler is case-sensitive but nimble isn't.
21:40:10disrupteklovely, huh.
21:41:29disrupteki use localdeps via nim.cfg. i --clearNimblePath and --nimblePath="$config/deps/pkgs/" and then i `mkdir deps` and `nimph doctor`.
21:42:31shashlickok cool - how do I deal with this nimYAML thing
21:43:56disrupteki dunno, i couldn't get past nimterop.
21:44:07disruptekprobably a pr to memrecall or something.
21:44:18disrupteki am batting .500 on such PRs.
21:44:24disrupteki think people think they are obnoxious.
21:44:37disrupteki think people's misuse of capitalization is obnoxious.
21:45:07moerm- afk -
21:45:53dwdvWhen asked about what should be removed for v2: "<4raq> remove proc vs iterator overloading". Why's the overloading regarded as a bad thing?
21:46:02*natrys quit (Ping timeout: 256 seconds)
21:46:22dwdvWhat would the alternative look like?
21:48:05disruptekthey wouldn't share the same "namespace"
21:48:52leorizedwdv: currently an iterator can overload a proc, and vice versa :)
21:50:48*sleepyqt quit (Ping timeout: 265 seconds)
21:50:52dwdvSure, sure, what would foo.split look like afterwards? Would we need to put foo.iter.split or something similar?
21:51:52FromDiscord<Rika> ~~toSeq(foo.split)~~
21:52:46*Zectbumo joined #nim
21:52:58dwdvAlright, or the other way around. Shame toSeq is one of the UFCS exceptions.
21:53:02Araqit was only an example I remembered, it makes much sense, consider that typeof(x) grew a special mode to distinguish between iters and procs
21:56:10FromDiscord<Rika> id like that toSeq be ufcs-able before this overloading removal is done
21:56:29*arecaceae quit (Remote host closed the connection)
21:56:48*arecaceae joined #nim
22:05:07shashlickdisruptek: i need some steps to reproduce some issue - not sure what to try here so any step 1 this step 2 that will be useful
22:06:39*josch557 joined #nim
22:07:45disruptekif you made the nim.cfg, you can issue the following:
22:07:55disruptekcd `nimph path nimterop`
22:08:09disruptekthen attempt to build nimterop with `nimble build` or `nimph build`.
22:11:30shashlickhow does nimterop get there in the first place
22:12:07disrupteki issued a `nimph clone nimterop`. i also tried updating it to HEAD.
22:12:19shashlickok
22:19:30FromDiscord<Rika> is countIt new in 1.2 sequtils?
22:20:05FromDiscord<Rika> new thought... how do i access old version docs
22:21:34shashlickdisruptek: I can fix that choosenim issue - are you good with a PR for that in nimph?
22:21:46disruptekto do what?
22:22:00disruptekit's a choosenim bug.
22:22:08shashlickdid you see my comment on the issue
22:22:16disrupteknope.
22:22:35shashlicksee what you think
22:22:53Araqhttps://nim-lang.org/1.0.6/manual.html Rika, like so, replace 'docs' with the version number
22:23:48FromDiscord<Rika> haha, thanks, it would prolly help if you added a selector in future docs versions like what python did
22:23:49disruptekshashlick: that PR has to be made against the compiler, as that's where the "bug" is, if you consider it a bug.
22:25:00shashlickwell, if findExe("nim") finds the shim/symlink, it should simply find the real location within choosenim
22:25:03disrupteki guess you could deprecate $nim and tell people to use $choosenim instead or something.
22:25:17shashlickits not a nim issue nor nimph issue
22:25:25disruptekso we agree.
22:25:35shashlickbut given choosenim exists and uses symlinks/shims, it is good to handle that case
22:25:52shashlickwhy can't nimph be aware of choosenim
22:25:53disruptekthere's lots of bad software i don't work around. that's why i had to write nimph.
22:26:25shashlickwell, if you want to improve the situation, you have to build on what's already in use and improve as you go
22:26:27disruptekwhat exactly should nim do with a nim.cfg that says $nim in it?
22:26:33kungtottechoosenim is also the officially recommended installation method.
22:26:34disruptekhow does that have anything at all to do with nimph?
22:26:49shashlickand i think the community deserves nimph to work well regardless of how nim was installed
22:26:50disruptekno one is recommending that anyone use nimph.
22:27:08disruptekwhat exactly should nim do with a nim.cfg that says $nim in it?
22:27:30shashlickit works just fine regardless of whether you use choosenim or not
22:27:46shashlickit only breaks because you compile in the compiler code into nimph and override getPrefixDir
22:28:12disruptekhow do you figure? $nim doesn't work when it appears in a .cfg and you use choosenim.
22:28:13shashlickand you have to override it no doubt, but findExe("nim") isn't always going to work
22:28:16disruptekam i wrong about that?
22:28:19Araqif it helps, I'm willing to "fix" it in the compiler, whatever that means
22:28:24shashlickno it works fine
22:28:40shashlicki tested it - using $nim is handed correctly by nim since th binary is nim.exe
22:28:54shashlickwhereas in your case, the binary is nimph so you need to find the real nim
22:29:04shashlickcompiler is not broken
22:29:08disruptekwait, what?
22:29:13disruptekmaybe i don't understand the problem after all.
22:29:37disruptekwhen i ask the compiler what $nim means, what does it say?
22:29:51leorizeit says, you gotta be the compiler :)
22:29:53shashlickhttps://github.com/disruptek/nimph/blob/master/src/nimph/config.nim#L106
22:30:03moermAraq Hello ;) - A propos fixing in the compiler: I *really* need a clean way to pass compiler args for *only* a given C file along with .compile - but *not* for the Nim file itself
22:30:19shashlick$nim in compiler is where the exe is and it works correctly irrespective of whether it is a shim or symlink
22:30:33disruptekblame leorize.
22:30:42disruptekthe one line someone contributed is a bug.
22:30:47disrupteki told you.
22:31:08leorizethe other way is to hardcode the path to the compiler that compiled nimph :P
22:31:14FromDiscord<exelotl> lol I've been using bootstrap recently and the version selector in their docs is completely broken
22:31:17disruptekyes, and that's what i did.
22:31:23shashlickthat won't work since the compiler in use can change
22:31:29leorizeand I hate it :)
22:31:38FromDiscord<exelotl> I expected better from "the world's most popular" frontend library
22:31:44disrupteklook, i want this software to be correct.
22:31:53disruptekit's on you to convince me what that means.
22:32:01shashlicki'll submit a PR, please see if you like it
22:32:04moermI tried push ... passC ... compile ... pop. didn't do what I needed. The *whole* project was compiled with those args
22:32:11disruptekas far as i'm concerned, it's correct now.
22:32:18leorizeyou can be as correct as you want, but it has to work
22:32:28disrupteknot for people that want to use choosenim.
22:32:36disruptekthis is not a democracy.
22:32:53disruptekif you want to use software that plays games with the path, you should expect shenanigans.
22:32:56shashlickcome one be realistic, don't restrict your software with such conditions
22:33:01disruptekwhat conditions?
22:33:09disrupteki don't believe that choosenim is doing the right thing.
22:33:13disruptekit's not correct.
22:33:22shashlickwhy is it wrong
22:33:31Araqmoerm: ok
22:33:48disruptekwell, i'm not sure i understand the problem anymore, honestly.
22:34:15Araqhow about this: .compile: ("file.c", "file.o", "more options here")
22:34:25moermAraq Thanks a bunch!
22:34:40disrupteki provide a prefix directory based upon the location of the compiler executable to a config object in memory. that is then later used to compute $nim.
22:34:48disruptekis there a better way to compute $nim?
22:35:01moermAraq yeah that should do it. Great, that will make my life (well, my builds) a lot easier
22:35:07disruptekwe could use the config.library iirc.
22:35:14leorizenope, the compiler should provide it
22:35:26disruptekso we should run the compiler?
22:35:30leorizeactually I lied, there's a better way, is to ask the compiler using a small hack
22:35:36leorizeyea
22:35:49Araqmoerm: ah hmm the tuple is already used for wildcard .compile
22:35:54disruptekwe can `nim dump` i guess.
22:36:03moermAraq ??
22:36:20Araqwill come up with something but I should sleep. good night
22:36:27disruptekpeace
22:36:39moermAraq Thx, sleep well and a nice weekend ;)
22:36:58disruptekhow is it that the compiler knows where its libs are but i cannot?
22:36:59Araqleorize: the compiler should be aware of Nim shims and ignore them
22:37:28Araqdisruptek: the compiler uses relative addressing and nimph is not in $nim/bin
22:38:04disruptekthe shim is a shell script?
22:38:06leorizenim dump seems to be the way to go, since the only thing you needed was the path to system libs
22:38:23leorizenim dump --skipUserCfg:on --skipProjCfg:on --skipParentCfg:on
22:38:27moermHey guys, let the man fall into his bed!
22:38:28shashlickwell the same issue will occur if nim is installed to /usr/bin and libs to /usr/lib
22:38:44Araqdisruptek: maybe on Unix. on Windows it's a fake nim.exe iirc
22:39:14shashlickyou cannot assume that findExe("nim").parentDir().parentDir() = $nim
22:39:29disruptekso we need this code added into the compiler so that the config can do proper pathSubs for tooling.
22:39:35shashlickthis is like findExe("gcc") might not be the gcc used by nim since it could be hard coded in nim.cfg
22:39:40disruptekit's silly to suggest that all tools should implement this themselves.
22:40:03shashlickthat I agree, but using $nim works fine (outside the /usr/bin use case)
22:40:13shashlickthis is an issue because you are compiling in the code
22:40:24shashlickand that is a valid use case no doubt
22:40:29disruptekyes, it's an issue that we need to work around for all tooling.
22:40:31leorizethis is why I just never import the compiler
22:40:37disrupteksilly.
22:40:40leorizeit's not designed to be used outside of the compiler
22:40:47shashlickfrankly i'm loving importing the compiler
22:40:48disruptekthe compiler is the most powerful nim program ever made.
22:40:52shashlicki'd prefer if it were a lib though
22:41:04shashlickshared by all the tools that use it
22:41:13shashlicknimgrep, nimsuggest, nim itself
22:41:14shashlicklibnim
22:41:18disrupteknimph is 540,000 lines of nim.
22:41:27leorizeshashlick: well it's technically a lib :p
22:41:33shashlickcompile the lib once and use it in many places
22:41:42disrupteki think he means dynlib.
22:41:51leorizenim shared library story is not a nice one :P
22:41:59disrupteknot on unix.
22:42:09moermI'll go too. Have a nice weekend everyone
22:42:13disruptekcya
22:42:16*moerm quit (Quit: Leaving)
22:42:22disrupteki'm not really clear on how we solve this, though.
22:42:22shashlickanyway, that's a dream, don't want to distract here
22:42:46shashlicki think for the near term, we can detect and use choosenim's path
22:42:51leorizeI'd say call `nim dump` then parse the output to get the list of system search path that you're looking for
22:42:55shashlicklonger term, $nim could be more resilient
22:43:11Araqdisruptek: listen to leorize please
22:43:20disruptekyes, i am inclined to do it that way.
22:43:28disruptekit will be choosenim-proof.
22:43:30shashlickhow does nim handle /usr installs today? how does it know to find lib in /usr/lib
22:43:41leorizeshashlick: hardcoded
22:43:55leorizegrep for /usr/lib/nim
22:43:58shashlickbut you cannot just run compiler once and cache it cause it can be changed
22:44:08shashlickso for every time that nimph needs $nim, it will have to run nim
22:44:22disruptekyes, that's just once per execution, though.
22:44:50shashlickwell, once everytime you actually need $nim, could be omitted if not needed in that particular run
22:45:10shashlicknot sure if that makes sense tho, don't know nimph details
22:45:26disruptekno, because to setup the config correctly, we need to know the lib paths.
22:45:41disrupteknimph has complete knowledge of the env.
22:45:49leorize`nim dump` and you got all the paths :P
22:45:58leorizewe should add more things into `nim dump`
22:46:06disruptekyes, but the order is brittle.
22:46:07*Trustable quit (Remote host closed the connection)
22:46:15Araqthere is also a json mode for 'nim dump'
22:46:29leorizethe json mode requires a .nim file, for whatever the reason
22:46:33Araqforgot how to enable it though
22:46:40Araqgreat...
22:46:44*liblq-dev quit (Quit: WeeChat 2.7.1)
22:46:52Araqgood night
22:46:58leorizeg'night
22:47:10dom96why do you need these paths?
22:47:10disruptekyou can pass it /dev/null
22:47:16disrupteknimph has complete knowledge of the env.
22:47:52disruptekit nicely provides the prefixdir for me. 🥳
22:48:34leorizewe just need a small patch to let it run without requiring a project file passed
22:48:35disruptekthat will be a neat new feature to play with.
22:48:51leorizelol it doesn't even need the path
22:48:59leorizeyou can pass in whatever, it doesn't check
22:49:05disrupteknice.
22:49:50disruptekalright, i'll code this up tomorrow.
22:49:57disruptekthanks, shashlick.
22:50:09disruptekyou see, it can work if you put the effort in. 😉
22:51:32dom96right, I still don't understand what the purpose of this is
22:52:13disruptekchoosenim's shim causes nimph to setup the compiler's config incorrectly.
22:52:26disruptekwhich causes it to produce $nim paths that are incorrect.
22:55:11dom96what changes does nimph make to the compiler's config?
22:55:54disrupteki don't understand.
22:56:17disrupteknone.
22:56:52disruptekbecause the compiler isn't capable of parsing nimble package structure, we have to supply --path statements.
22:56:58dom96in what way does nimph "setup the compiler's config" then?
22:57:09disruptekwe shorten these automagically using the compiler's pathSub routines.
22:57:26disruptek$nim is one such substitution.
22:57:40disruptekit holds the wrong value when nimph is used with choosenim.
22:57:55dom96Nimble packages aren't stored relative to Nim's location
22:57:58disruptekbecause the location of nim.exe has no bearing on the location of the libraries.
22:58:08dom96How are you using $nim to shorten these paths, and why are you even doing that?
22:58:29disrupteki'm doing it because it's nice.
22:58:32disruptekit's a nice feature.
22:59:20dom96In what way is it nice? lol
22:59:29disrupteki understand that it might not make much sense when you use a package manager that doesn't support local deps.
22:59:34dom96and I still don't understand how you shorten these, can you give an example?
22:59:51disrupteksure. my home directory is /home/adavidoff.
23:00:00disrupteki put most of my projects in /home/adavidoff/git.
23:00:13disruptekwhen i have local deps, which is 100% of the time, i put them in project/deps.
23:00:25disruptekthis turns into project/deps/pkgs for nimble-compat reasons.
23:00:27*tane quit (Quit: Leaving)
23:00:39disruptekso i specify my `--nimblePath="$config/deps/pkgs/"`
23:00:55disruptekbecause this is uniformly correct and shorter than specifying my home, etc.
23:01:22disrupteknimph automatically shortens paths when it adds --path statements to a nim.cfg.
23:01:30*josch557 quit (Quit: ERC (IRC client for Emacs 26.3))
23:03:37shashlickI think the use case for $nim was probably mainly for compiler
23:03:58disruptekyes, that's what i use it for.
23:04:15shashlickOr did you expect packages also to be there?disruptek
23:04:46disrupteki wanted to vcs a .cfg that specified --path="$nim".
23:04:53disrupteks/vcs/distribute/
23:04:56shashlickYep so this was just a case where $nim showed up there incorrectly
23:05:16shashlickdom96: this is the usecfg feature we discussed at length
23:05:27disruptekno, it's correct.
23:05:59disruptekwhat's incorrect is the assumption that `(which nim)/../lib` is the config.libpath.
23:06:19shashlickWell if you had the right compiler path, you'd never expect anyone to put nimble packages in the compiler base path
23:06:35disruptekit has nothing at all to do with packages.
23:06:38disrupteknothing.
23:06:59shashlickNever know though, there will always be someone
23:07:21disrupteknimph has a bug regardless of whether it's working with packages.
23:07:25dom96I'm still lost as to why this is important for nimph. But it's late so I'm likely just too tired to understand.
23:07:42disruptekit's important because bugs cause grief.
23:07:49disruptekbroken windows.
23:08:29dom96what bugs? How does this fix bugs?
23:08:55disrupteki just can't keep talking about this on stream.
23:09:01disruptekit's really not important.
23:09:05disruptekit'll be fixed tomorrow.
23:09:09disruptek😉
23:12:26shashlickdom96: nimph is creating nim.cfg with $ paths so that they aren't hard coded
23:12:55shashlickChoosenim creates shims / symlinks so $nim was coming out wrong
23:13:20dom96Why is nimph creating paths containing $nim though?
23:13:25shashlickSo nimph will use nim dump to get right $nim
23:13:56ryukopostingthis is the first time I've heard anything about nimph, shows how long I disappeared for lol
23:14:09disruptek$nim was the shortest path.
23:14:16FromDiscord<Rika> how long have you been gone for?
23:14:43*derka quit (Ping timeout: 265 seconds)
23:15:17shashlickCause findExe("nim") is ~~/.nimble/bin/nim so $nim becomes ~~/.nimble and then path to and pkg in ~/.nimble/pkgs became $nim/pkgs
23:18:17dom96Now I get it. That's a hack that depends on how choosenim installs nim
23:18:47dom96If you're putting these into the .nim.cfg and intend it to be pushed to git then that's a horrible idea
23:19:15disruptekhey, thanks, buddy.
23:19:29disrupteki think your choosenim shims are a horrible idea. 😁
23:19:50dom96Why?
23:20:20disruptekmuddy semantics that serve no purpose.
23:20:36disruptekbut i'm on stream and really don't have the interest in debating it.
23:20:41dom96You think I implemented these shims for fun? :)
23:20:48*couven92 quit (Read error: Connection reset by peer)
23:20:49disruptekyou can come on mumble if you want to chat about it.
23:20:54ryukopostingRika: few months
23:20:57dom96They have a very particular purpose: Windows has no symlink support
23:21:09ryukopostingwhat are shims?
23:21:14*couven92 joined #nim
23:21:24FromDiscord<Rika> executables that redirect input to the real executable
23:22:43ryukopostingas a way to have a standard reference point for where to find a program, even when it isn't there?
23:23:15dom96as a way to emulate symlinks because Windows sucks
23:24:23ryukopostingI've been developing my current project on Windows since it's something that will almost exclusively get used on windows, yeah this whole "4 different terminals to do what unix does with 1" thing is annoying
23:24:46ryukopostingwhy do you need to emulate symlinks?
23:25:07FromGitter<timotheecour> @dom96 i’ve always wondered about this; windows does have symlinks AFAIK https://docs.microsoft.com/en-us/windows/win32/fileio/symbolic-links; btw that’s the issue talking about using symlinks: https://github.com/dom96/choosenim/issues/126
23:25:09disbot`Error: Spawning of process failed` caused by choosenim using a wrapper process instead of symbolic link ; snippet at 12https://play.nim-lang.org/#ix=2gGt
23:25:13dom96ryukoposting, for choosenim
23:25:18leorizeryukoposting: choosenim need to switch between different compiler versions without altering paths
23:25:28leorizetimotheecour: you need admin to create them
23:25:44dom96^ also they suck, and only work on latest Windows versions AFAIK
23:25:57dom96I for one care about supporting as far back as Windows XP
23:26:02dom96or at least I did at the time
23:26:10FromGitter<timotheecour> https://www.wintellect.com/non-admin-users-can-now-create-symlinks-windows-10/
23:26:23FromGitter<timotheecour> (from dec 2016)
23:26:30leorizein windows 10 :)
23:26:39shashlickThis isn't 100%
23:26:40ryukopostingWhat if you just had an environment variable that pointed to a directory with some kind of compiler manifest? Then that file could just be JSON with either a bunch of absolute paths, or paths relative to the path specified in the env variable
23:27:02leorizeryukoposting: why are you making this more complicated :P
23:27:03shashlickScoop uses links and even as admin I couldn't delete them
23:27:38ryukopostingenvironment variables have relatively good portability
23:27:52leorizeor you can use shim binaries
23:28:01shashlickModifying path doesn't work either on windows, child process cannot change path for parent cmd process
23:28:07leorizewhich is much simpler :p
23:28:39FromDiscord<mratsim> @disruptek, are you rewriting PathOfBuilding in Nim? :p
23:28:48leorizeshashlick: I never figured out how chocolatey did it, though it might just be because it's written in batch/powershell
23:28:48ryukopostingAre the shims pointing to different compilers?
23:29:06leorizeyes, everytime you switch, new shims
23:29:08disruptekmratsim: yeah
23:29:11disruptekwell, sorta.
23:29:15disruptekbbiab
23:29:20dom96nimble does it a slightly different way btw, it sorta works but had flaws too (it generates .bat and .cmd files)
23:29:43leorizeshims are pretty battle proven
23:29:52leorizechocolatey uses them since forever
23:30:00disruptekyou know what's battle-proven?
23:30:02disruptekrename.
23:30:08FromDiscord<Rika> rename what
23:30:09disruptekit's atomic and very, very fast.
23:30:20shashlickNimble is worse since findExe doesn't work
23:30:22shashlickOn windows
23:31:04ryukopostinghuh. I guess it makes sense. shims have a nice advantage in the sense that you can call them like a normal program
23:31:40FromDiscord<mratsim> findExe works on Windows in powershell
23:31:43dom96disruptek, so tell me, do you have an alternative that isn't horrible? :)
23:31:46shashlickCross platform is hard even in Nim
23:32:03FromDiscord<mratsim> findExe is broken in bash windows
23:32:21leorize@mratsim: it's not broken :)
23:32:24ryukopostingI guess I wouldn't worry about atomicity in something that a user is changing very rarely, and from a command-line tool
23:32:24shashlickI had to change nimterop to look for toast in relative path since findExe wasn't reliable
23:32:25leorizebash is broken :)
23:32:38FromDiscord<mratsim> It ate about 2 days of fighting against Windows CI to finally have a script that work on WIndows + Mac + Linux
23:32:59FromGitter<timotheecour> I think we could simply add a `—usesymlinks` option: `choosenim —usesymlinks path`
23:33:23leorizeplease don't complicate it anymore
23:33:41FromGitter<timotheecour> so vast majority of users who are on a OS that can use symlinks can use that, others (on old windows versions) can keep using shims.
23:33:58leorizeuhmm, on linux it uses symlinks
23:34:07leorizeshims are only used on windows iiuc
23:34:09FromGitter<timotheecour> Huh? not on OSX at least
23:34:37FromGitter<timotheecour> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e89198c167a0419f1877556]
23:35:04ryukopostingI mean, why would you use them on a system where symlinks exist
23:35:10dom96it doesn't
23:36:06FromGitter<timotheecour> shims IS the complication. It caused bugs like https://github.com/dom96/choosenim/issues/126, and is less performant as it involves a process call overhead just to invoke nim. It’s fine as a workaround if your OS is old windows, but other ppl shouldn’t have to suffer from its consequences
23:36:08disbot`Error: Spawning of process failed` caused by choosenim using a wrapper process instead of symbolic link ; snippet at 12https://play.nim-lang.org/#ix=2gGt
23:36:12ryukopostingthat was directed at leorize, dom
23:37:07ryukopostingIf a single extra process call is the thing causing performance issues with your builds, there's a bigger problem and it has nothing to do with nim
23:37:07FromGitter<timotheecour> I think `—usesymlinks` is the perfect answer. Nothing complicated.
23:37:22leorizedon't add more choices, make the choices permanent
23:37:31leorizeuse symlinks when supported, else shims
23:37:39FromDiscord<Rika> the shim overhead is barely noticeable
23:37:43leorizealso please avoid symlinks on windows
23:38:04ryukopostingI can see where shims are fragile, for sure, but what on Windows isn't
23:38:17leorizeanything related to new features in windows that tries to emulate unix is inherently broken
23:38:32FromGitter<timotheecour> on OS where symlinks are always supported, we can make `—usesymlinks` the default. on windows, it makes senses to make it an option
23:38:55ryukopostinguntil fork() exists in windows, nothing except the most trivial stuff made for unix will work 100% right on windows
23:39:09leorizenah, choosenim is supposed to be "the simple tool" to manage your installations
23:39:27leorizemore choices are evil in this case
23:39:36dom96yep
23:39:54ryukopostingthe entire process model is fundamentally different, and shims seem like the most straightforward way to deal with that
23:40:32FromGitter<awr1> fork() was a mistake
23:40:49*FromDiscord <KingDarBoja> Meanwhile, been coding my entire life on Windows
23:40:56ryukopostingyour opinion is trash and you should feel bad awr1
23:41:23FromGitter<awr1> lol
23:41:25leorizelol
23:41:35leorize[m]lol
23:41:38ryukopostinglol
23:42:01FromDiscord<KingDarBoja> lol
23:42:05ryukopostingKingDarBoja I admire your bravery
23:42:33FromGitter<awr1> windows aint bad
23:42:34ryukopostingIn other news, I'm making a Visual Novel engine to end all other visual novel engines
23:42:35FromDiscord<KingDarBoja> I have seen the symlink issue on Windows several times, mostly on NodeJS stuff
23:43:14FromGitter<awr1> https://www.microsoft.com/en-us/research/uploads/prod/2019/04/fork-hotos19.pdf
23:43:23leorizewindows is where bugs are features, tbf
23:43:36FromDiscord<KingDarBoja> The only thing that is really annoying are tutorials always being made on linux or mac... But there are few on Windows lol
23:44:04FromGitter<awr1> honestly most of the win32 api is pretty straightforward
23:44:04leorizeWSA_poll randomly broke? oh, we know but everyone has been walking around it, so it's a feature now :)
23:44:31ryukopostingit's all Nim macros sitting on top of SDL2. dom96 there's a reason I made that PR lol
23:45:02*krux02_ joined #nim
23:45:10leorizeI don't mind not using fork(), it's an artifact of a time where posix refuses threads
23:45:41FromDiscord<mratsim> pitchfork()
23:45:43FromGitter<timotheecour> => https://github.com/dom96/choosenim/issues/189 (regarding shims vs symlinks)
23:45:43disbotuse symlinks instead of shims where symlinks are supported
23:46:29FromGitter<awr1> introducing the all-new system call, `spoon`
23:46:34ryukopostingthere are cases where processes are the appropriate solution. If you *can* do something with threads, 99% of the time you shouldn't be doing it with processes
23:46:47ryukopostingthat doesn't make fork() bad, it serves an entirely separate purpose from threads
23:47:08leorizethe fork()-exec() pattern for spawning is bad
23:47:13leorizesans where it makes sense
23:47:19leorize(ie. security applications)
23:47:42*krux02 quit (Ping timeout: 260 seconds)
23:47:42leorizebut for general usage, it's slow and it's completely horrible to work with
23:48:18ryukopostingcompared to what alternative?
23:48:23leorizeposix_spawn
23:49:02FromDiscord<Rika> awr1: should have said cutlery
23:49:50ryukopostingon any system with an MMU posix_spawn is just fork-exec with a couple other minor system calls in between
23:49:56leorizeyou don't have to do makeshift message passing just to tell your parent that you couldn't exec() to the child due to some syscall failed before
23:50:12leorizeyou don't carry the cost of copying the entire address space
23:50:22ryukopostingyou don't copy the entire address space with fork
23:50:30leorizeyes, you still do
23:50:38leorizevfork() existed just to avoid that
23:50:46leorizeand then it died because it's too unsafe
23:51:05leorizealso, posix_spawn is implemented efficently on non-linux systems
23:51:17leorizeie. it's vfork()-exec() on haiku
23:51:40leorizeon linux you have to ask for it to be efficient, which is why we still use our clone()-based implementation in the stdlib
23:51:44FromGitter<awr1> there has been pushback to implementing posix_spawn with fork
23:52:20ryukopostingfork doesn't copy a process' virtual address space with the exception of the few places it has to, e.g. the page currently containing the bottom of the stack
23:52:43ryukopostingit's all COW
23:52:53leorizewell it has to copy the stack, and that's not small
23:53:14leorizegitlab actually measured the impact in their own software caused by fork-exec
23:53:19FromGitter<awr1> COW also invokes its own problems
23:53:53ryukopostingthe default limit on linux AFAIK is 8MB
23:54:51ryukopostingand it only /needs/ to copy whatever frame the stack pointer is currently in. When the sp drops back below that frame, or a write occurs based on an offset that goes up the stack far enough to be in a different frame, then it copies
23:57:11leorizewell the page table still have to be copied
23:58:10FromGitter<awr1> do fork/COW impls do that in practice RE: stack frame copying
23:58:29FromGitter<awr1> i would have just assumed that they would copy the whole stack
23:58:43leorizethis problem has been well researched and has it's impact measured in a real-world program
23:59:26ryukopostingin a hierarchical page table, which is all x86 machines, you'd need to copy the outer page and one inner page at a minimum. only 8K