<< 12-10-2018 >>

00:05:23*rnrwashere quit (Remote host closed the connection)
00:10:11*rnrwashere joined #nim
00:15:05*darithorn quit ()
00:23:13*rnrwashere quit (Remote host closed the connection)
00:25:32*rnrwashere joined #nim
00:47:46*rnrwashere quit (Remote host closed the connection)
00:52:58*vlad1777d_ quit (Ping timeout: 245 seconds)
00:55:33*PrimHelios joined #nim
01:05:50*craigger joined #nim
01:06:38*craigger_ quit (Ping timeout: 268 seconds)
01:12:59*endragor joined #nim
01:17:08*endragor quit (Ping timeout: 245 seconds)
01:24:51*smt joined #nim
01:29:27*abm quit (Ping timeout: 268 seconds)
01:31:53*sg-james[m] quit (Ping timeout: 276 seconds)
01:32:07*sg-james[m] joined #nim
01:33:34FromGitter<zacharycarter> changed up my tooling quite a bit on OSX - after I destroyed my macbook pro on Wednesday evening on accident
01:33:46FromGitter<zacharycarter> now using fish shell, kakoune, kitty term
01:33:57FromGitter<zacharycarter> and nix for package management
01:47:40FromGitter<yyyc514> is there a way to pass a default for an untyped arguemnt to a template?
02:03:27*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:04:44*banc quit (Quit: ZNC - http://znc.in)
02:06:48*rnrwashere joined #nim
02:08:48*dddddd quit (Remote host closed the connection)
02:13:11*xet7 joined #nim
02:21:24*banc joined #nim
02:30:46*rnrwashere quit (Remote host closed the connection)
02:31:33*rnrwashere joined #nim
02:34:24*rnrwashere quit (Remote host closed the connection)
02:34:25*endragor joined #nim
02:34:43*Death916_ quit (Changing host)
02:34:43*Death916_ joined #nim
02:34:43*Death916_ quit (Changing host)
02:34:43*Death916_ joined #nim
02:54:22*rnrwashere joined #nim
02:59:09leorizekaushalmodi: here's an another hack: pass this to musl-gcc: `-idirafter /usr/include`
03:08:52*PrimHelios quit (Quit: Leaving)
03:12:05FromGitter<kaushalmodi> leorize: thanks. I'll try that tomorrow when at computer.
03:13:03FromGitter<kaushalmodi> After our last chat, I found an ugly hack to get past the linux/version.h not found error for openssl only to stumble upon a new https://travis-ci.org/kaushalmodi/hello_musl/builds/440340345#L1417
03:13:37FromGitter<kaushalmodi> See the third to last commit on ssl branch in .travis.yml
03:14:49FromGitter<kaushalmodi> Looks like I'll have to find all the missing .h files and symlink them one by one of your suggested switch doesn't work.
03:15:06FromGitter<kaushalmodi> s/of/if
03:15:29*PrimHelios joined #nim
03:17:01leorize;
03:17:07leorizeyou just have to do this
03:17:08FromGitter<yyyc514> where can i find newSymNode
03:17:31leorizekaushalmodi: `ln -s /usr/include/linux /usr/include/<musl path thingy>/linux`
03:17:43leorizeyyyc514: `macros` module?
03:17:52FromGitter<yyyc514> doesn’t seem like it
03:18:00FromGitter<yyyc514> i’ve imported macros
03:18:27*chemist69 quit (Ping timeout: 252 seconds)
03:20:10leorizeyyyc514: looked up in theindex, no result
03:20:23FromGitter<yyyc514> astGenRepr is outputting it
03:20:36*chemist69 joined #nim
03:21:46leorizeyou can try `bindSym`
03:22:36FromGitter<yyyc514> that results in undeclared identifier
03:22:52leorizeofc, you can only bind what's in the scope
03:22:58leorizewhat are you trying to do?
03:23:08FromGitter<yyyc514> i want the literal symbol
03:23:16FromGitter<yyyc514> tryingt o build an AST in multiple pieces
03:23:33FromGitter<yyyc514> first pieces declares a var and references it
03:23:37FromGitter<yyyc514> i want to reference it again later
03:23:52FromGitter<yyyc514> but if you just add quote it’ll treat it as an identifier not a symbol
03:24:16leorizeif you want a symbol then use `genSym`
03:28:48FromGitter<yyyc514> treeRept outputs "Sym “acc"
03:28:55FromGitter<yyyc514> I want to know how to add anotehr node just like that to the tree
03:29:46leorizeuse `genSym` to generate a symbol node then add it to the tree?
03:30:01FromGitter<yyyc514> how? that gives a string
03:30:25leorizeare you sure? http://nim-lang.github.io/Nim/macros.html#genSym%2CNimSymKind%2Cstring
03:30:30leorizeit outputs NimNode
03:32:00FromGitter<yyyc514> ok genSym(nskVar,"acc”) :)
03:44:02FromGitter<yyyc514> i’m missing something still, grrr
03:44:17FromGitter<yyyc514> if i add it myself it blows up but AFAIK i’m building the same tree quote is
03:45:40leorizewhat are you trying to build? and you can actually just use `quote` to build things...
03:46:27FromGitter<yyyc514> but separate quote blocks lose context
03:46:32FromGitter<yyyc514> you can’t build things one peice at a time
03:47:25FromGitter<yyyc514> changing the symbol type has some effect even though it’s not showing up in the repr
03:47:38FromGitter<yyyc514> is there anything like ruby’s inspect that will show full attributes of a type?
03:48:27leorizeyyyc514: you can keep the part you want to pass to some other `proc/macro` with you, and `quote` the rest
03:49:55FromGitter<xmonader> @kaushalmodi why do you need src/libc-dev ?
03:50:17FromGitter<xmonader> also the travis is against ubuntu trusty :S
03:50:46FromGitter<yyyc514> you lost me
03:51:19leorizeso you wanted to use `quote` to build a `var`, but you also want to keep the symbol, right?
03:51:37FromGitter<yyyc514> i want to be able to reference it from a different quote later, yes
03:51:54FromGitter<yyyc514> genSym(nskVar,"acc”) adds the correct AST node as far as i can tell but it doesn’t work in practice
03:52:31leorizehttps://ptpb.pw/oGzZ/nim
03:52:43leorizehere's how to use `quote` to use the symbol you created
03:53:03FromGitter<yyyc514> ok i can maybe work with that, let me try it
04:00:59FromGitter<yyyc514> omg that took some doing :)
04:03:08*narimiran joined #nim
04:03:42*PrimHelios quit (Quit: Leaving)
04:04:15FromGitter<yyyc514> https://gist.github.com/yyyc514/60700bae2c65c1522f4270ff6e4bd130
04:05:32FromGitter<yyyc514> maybe i can build the inside separately
04:05:45*kadin_ quit (Ping timeout: 244 seconds)
04:06:26*kadin joined #nim
04:06:59leorizewhy do you need `{.inject.}`?
04:07:23FromGitter<yyyc514> i neede it with template, haven’t tried removing it since this became a macro
04:07:53FromGitter<yyyc514> i needs to be accessable to the caller
04:08:48leorizeafaik `inject` only work with templates
04:09:07FromGitter<yyyc514> yeah without it i get undeclared identifier
04:09:13FromGitter<yyyc514> seems to work just fine :)
04:09:24*banc quit (Ping timeout: 252 seconds)
04:11:55*banc joined #nim
04:13:46FromGitter<yyyc514> (updated git)… better
04:13:50FromGitter<yyyc514> still verbose
04:15:36leorizeisn't the thing is that either you `+=` `i` or `body`?
04:15:49leorizethis is certainly better being a template...
04:16:23FromGitter<yyyc514> yes but i is literal and `body` is passed in
04:16:36FromGitter<yyyc514> i coudln’t figure out how to do the coditional inner iteration with a template
04:17:07leorize`when`?
04:17:25FromGitter<yyyc514> when what
04:17:48FromGitter<yyyc514> all of this is to default body to i when it’s not given
04:18:05leorize`when body == nil`? :P
04:18:33leorizenever tried actually, or you could just use overloads
04:18:38FromGitter<yyyc514> that didn’t work because of the whole typed untyepd thing
04:18:54FromGitter<yyyc514> yeah i just made a proc that called it with (i) but then i wanted to see if i could put it all in one thing :)
04:19:15FromGitter<yyyc514> maybe that was silly :)
04:20:52FromGitter<yyyc514> yeah that looks a lot nicer one sec
04:21:21FromGitter<yyyc514> can you look at the template version?
04:21:51FromGitter<yyyc514> oh let me see if i can just compare nil directly now that wasn’t working before
04:22:34FromGitter<yyyc514> yeah it doesn’t like that
04:22:46FromGitter<yyyc514> got <int, nil>
04:23:11FromGitter<yyyc514> because the same code is now being generated for both cases
04:23:16FromGitter<yyyc514> and one of them can’t compile with nil
04:23:20FromGitter<yyyc514> since you can’t add nil to an int
04:24:03leorizehttps://ptpb.pw/VnaJ/nim
04:24:04FromGitter<yyyc514> the version i pasted works though if you use a sep overload
04:24:19leorizeyea, that's how you should do it...
04:26:22FromGitter<yyyc514> well i did learn a bit about macros though, lol
04:29:39leorizeif you wanted to force `n` to be an integer literal, use `n: int{lit}` as the param
04:30:02*jsn- quit (Ping timeout: 244 seconds)
04:30:09*jsn- joined #nim
04:35:48*narimiran quit (Quit: Konversation terminated!)
04:37:28FromGitter<yyyc514> actual n isn’t liternal :)
04:37:33FromGitter<yyyc514> but that’s nice to know
04:48:59FromGitter<yyyc514> is there anyway to do postfix macros?
04:49:10FromGitter<yyyc514> like `delete_file() unless protected()`
04:49:36FromGitter<yyyc514> i need the delete_file() portion to scope it inside an if
04:52:41leorizeyou mean an infix macro instead?
04:52:57FromGitter<yyyc514> i dunno, i want to write code like exactly what i just pasted
04:53:02FromGitter<yyyc514> with the condition at the END
04:53:08FromGitter<yyyc514> ruby style :)
04:53:57leorizeno that's not possible :P
04:54:01leorizeunless
04:54:23leorizeyou wrap the entire thing in an another macro
04:54:38leorize`rubyStyle: delete() unless protected()` :P
04:54:42FromGitter<yyyc514> rofl
04:54:53FromGitter<yyyc514> right because then you can just have your own language happening up in there
04:55:36leorizeor just do it the nim way...
04:55:40leorizeor you can use crystal lol
04:59:34FromGitter<yyyc514> lol
04:59:43FromGitter<yyyc514> nim seem way faster than crystal but i haven’t looked at crystal ina while
04:59:48FromGitter<yyyc514> lot to like about nim
05:03:44FromGitter<yyyc514> hmmm
05:03:48FromGitter<yyyc514> you could make it a guard:
05:04:07FromGitter<yyyc514> the default parser gets confused witht he grammer though so you’d have to start really parsing by hand
05:04:18FromGitter<yyyc514> it thinks “false unless …” is some kind of expression
05:18:55FromGitter<yyyc514> sons: seq[NimNode]
05:18:58FromGitter<yyyc514> why not daughters? :)
05:20:49*rnrwashere quit ()
05:24:20FromGitter<yyyc514> how can i access sons on a NimNode?
05:26:36*leorize quit (Ping timeout: 252 seconds)
05:29:30*nsf joined #nim
05:44:37FromGitter<yyyc514> why is findChild a template?
05:47:07FromGitter<rayman22201> everyone is asleep apparently lol. Because findChild is just sugar around a for loop and an if statement?
05:47:38FromGitter<rayman22201> https://github.com/nim-lang/Nim/blob/master/lib/core/macros.nim#L1129
05:47:42FromGitter<yyyc514> i need a recursive version and tempaltes don’t seem to like that
05:48:01FromGitter<yyyc514> Error: template instantiation too nested
05:48:16FromGitter<yyyc514> i only imagine it’s looping forever since it’s a template :)
05:49:15FromGitter<rayman22201> You can just implement your own version of find child as a recursive proc
05:49:21*leorize joined #nim
05:50:19FromGitter<yyyc514> i don’t know how to do the cond: untyped stuff then
05:50:23FromGitter<yyyc514> would i have to change it to pass in a proc?
05:51:40FromGitter<rayman22201> yeah, you would have to actually use a concrete value for the cond
05:51:57FromGitter<yyyc514> surely someone has written some helper libraries for AST manipulation
05:54:06FromGitter<rayman22201> there is https://github.com/alehander42/breeze or https://nimble.directory/pkg/astpatternmatching
05:54:11FromGitter<rayman22201> I don't use them though
05:54:29FromGitter<rayman22201> It's pretty simple to write what you are asking for by hand though
05:55:35FromGitter<yyyc514> probably, i’m very new to nim :)
05:57:18FromGitter<rayman22201> hold on. I'm trying to write something to help you out in the nim playground
06:04:16FromGitter<yyyc514> trying to figure out how to compare ident nodes now
06:06:39FromGitter<yyyc514> i’m getting something working now with a hard coded conditions
06:06:44FromGitter<rayman22201> https://nim-lang.org/docs/macros.html#eqIdent
06:07:14FromGitter<yyyc514> well but it’s comparsing two strings
06:07:20FromGitter<yyyc514> oh i see :)
06:07:25FromGitter<yyyc514> overloads
06:10:39FromGitter<rayman22201> 👍 😎
06:12:21FromGitter<yyyc514> proc `[]`*(n: NimNode, i: int): NimNode {.magic: "NChild", noSideEffect.}
06:12:30FromGitter<yyyc514> magic huh? lol
06:15:55FromGitter<rayman22201> lol. Yes. Araq the magical compiler god has blessed us mortals with certain functions
06:20:41FromGitter<yyyc514> no easy way to get parent nodes?
06:22:59leorizewhy would you need the parent nodes?
06:23:15FromGitter<yyyc514> node.parent.delete(node)
06:23:48leorizeseriously, why would you ever need to do that?
06:23:59FromGitter<yyyc514> rewriting the AST
06:24:04leorizesince you construct the ast yourself, you should already got hold of the parent, no?
06:24:19FromGitter<rayman22201> If you want to do something like that, you copy the AST and modify the copy. Or build a new AST, yeah.
06:24:24FromGitter<yyyc514> well the AST is flowing in from a block
06:24:39FromGitter<yyyc514> but yeah i can save the parent when i iterate over it
06:25:09FromGitter<rayman22201> The AST is approximately immutable inside macros. You have to make a copy
06:25:26FromGitter<rayman22201> because other code in the runtime can still be pointing to those AST nodes
06:25:50FromGitter<yyyc514> this is all in a macro at compile time
06:26:16FromGitter<yyyc514> if it doesn’t work i think saw some code for a deep copy somewhere
06:26:26FromGitter<rayman22201> you need to do deep copy
06:26:29FromGitter<rayman22201> there is no other wya
06:26:31FromGitter<rayman22201> way
06:26:39leorizeofc, unless you own that ast...
06:26:49leorizewhich seems to be the case here
06:27:01FromGitter<yyyc514> yeah, i’d think so :)
06:27:09FromGitter<yyyc514> but again i’m new
06:27:22FromGitter<yyyc514> it’s coming straight into macro and then i presume the emitted AST is what gets compiled
06:27:37leorizeno worries, just make sure you explain what you're trying to do :)
06:28:50FromGitter<yyyc514> trying to see how har it would be to get a guards: macro that allows postfix if/unless notation :)
06:29:07leorizeps: really hard :P
06:29:07FromGitter<yyyc514> and it looks like the easiest way is to take the AST the parser give me and hack it around a bit
06:29:13FromGitter<yyyc514> i’m not so sure
06:29:38FromGitter<yyyc514> looks like i just need to lift out the “unless” block, fixup the intro and then wrap it all in the appropriate if
06:32:32FromGitter<rayman22201> https://gist.github.com/rayman22201/cff1d8da2fa92dc5c11ad837567e4640
06:33:31FromGitter<rayman22201> actually sounds like it might be doable using a term rewriting macro, but that feature has lots of bugs atm from what I've seen
06:33:44FromGitter<yyyc514> thanks but does nil actually work?
06:34:16FromGitter<yyyc514> i’m using `if res.kind != nnkNilLit:` in mine
06:34:26FromGitter<yyyc514> since that’s the default node if your don’t init it
06:34:42leorizeyes, since this is a function call
06:34:43leorizenot macro
06:34:51FromGitter<rayman22201> bingo
06:42:05FromGitter<yyyc514> (res, _) = findUnless(c)
06:42:08FromGitter<yyyc514> so no _ yet?
06:42:11FromGitter<yyyc514> i thought i saw it somewhere
06:43:58FromGitter<rayman22201> That would be pattern matching, and we don't have that yet. It's contentious. There are some third party implementations of it though. https://github.com/andreaferretti/patty
06:46:35FromGitter<yyyc514> contentious eh?
06:46:44FromGitter<rayman22201> I have to go to bed now. Good look @yyyc514! macros are fun :)
06:46:50FromGitter<yyyc514> thanks!
06:49:06FromGitter<yyyc514> oh i might have to build a whoel tree anyways
06:49:11FromGitter<yyyc514> del doesn’t seem to modify the tree in place
06:49:20FromGitter<rayman22201> see here for some of the "contentious" debates lol: https://github.com/nim-lang/Nim/issues/8649
06:49:28FromGitter<rayman22201> ok, going to bed for real now!
06:49:32FromGitter<yyyc514> night thanks!
06:56:04FromGitter<yyyc514> little confused though since i thought all NimNodes were just pointers
06:56:06FromGitter<yyyc514> /refs
06:56:48leorizeall NimNode are `ref`s
06:57:12leorizeyou don't want to copy the entire tree anywhere, do you?
06:57:21FromGitter<yyyc514> `(res, par) = findUnless(blk); del(par, 1)` has no effect on blk it seems
06:57:40FromGitter<yyyc514> i can if that’ll magically make it work :)
06:59:32FromGitter<yyyc514> `var extra = copy(blk)`
06:59:35FromGitter<yyyc514> same behavior
07:00:29leorizeI think you should build the entire tree from scratch :P
07:01:44FromGitter<yyyc514> it’s looking like i may have to do that
07:38:24*smt` joined #nim
07:38:50*smt quit (Read error: Connection reset by peer)
07:52:49FromGitter<yyyc514> so if they are all pointers why would deleting a part of the tree not be visible everywhere?
07:53:40leorizemagic, really
07:53:48leorizecan you write a small case? I'm curious
07:55:56FromGitter<yyyc514> hmmm can you not push to gists like mini repositories? i thought you could
07:56:26FromGitter<yyyc514> https://gist.github.com/yyyc514/6f397bb23bcffb2ae341131972a9c094
07:57:37*PMunch joined #nim
07:57:38leorizeI hoped for a small test case, really :P
07:57:48FromGitter<yyyc514> sorry it’s what i got
07:57:58FromGitter<yyyc514> the portion that matters isn’t large
08:00:12*abm joined #nim
08:02:02leorizesorry, I can't really follow your macro
08:02:27FromGitter<yyyc514> it doesn’t do anything yet just call del and log some stuff
08:02:39FromGitter<yyyc514> but you see the delete isn’t effective at the top level
08:02:51FromGitter<yyyc514> echo extra.treeRepr # unmodified
08:02:56FromGitter<yyyc514> par is modified though
08:03:24FromGitter<yyyc514> del(par, 1) aims to delte the whole unless branch
08:03:57*gmpreussner joined #nim
08:04:44*gmpreussner_ quit (Ping timeout: 268 seconds)
08:09:12*crem quit (Ping timeout: 250 seconds)
08:10:24*crem joined #nim
08:11:34leorizeyyyc514: a hidden copy might lurk somewhere...
08:11:56leorizeif you extract the exact node with `[]` operator
08:12:01leorizeassign it to something
08:12:06leorizethen run del on it
08:12:16leorizeit affect the whole tree
08:12:40FromGitter<yyyc514> but you can’t run del on a NodeObj only a ref Node
08:13:01leorizehence "hidden" copy
08:13:12FromGitter<yyyc514> i’m not sure what you’re asking me to change
08:13:26leorizeI'm not telling you to change anything
08:13:32FromGitter<yyyc514> lol
08:13:38FromGitter<yyyc514> thanks! ;-)
08:13:41leorizeit's just that findUnless somehow copy things
08:14:22FromGitter<yyyc514> it’s just returning NimNodes which are all refs
08:16:41leorizeand uh, you do notice there's `len()` for NimNode right?
08:16:53leorizeyou don't have to do the entire `toSeq` thing...
08:17:03FromGitter<yyyc514> ha, that’d help :)
08:17:25FromGitter<yyyc514> nice improvement :)
08:20:30PMunchHmm, what is `strVal` in the macros module used for. I can't get it to work like I would expect it to
08:20:59leorizeit's used to get a string representation of the node afaik
08:22:13PMunchIt doesn't seem to work though..
08:22:26PMunchI can get a string representation if I do toStrLit().strVal()
08:24:01leorizeI don't think all kind of nodes have strVal
08:31:31*leorize1 joined #nim
08:32:09leorize1yyyc514: your findUnless function is a bit too complex...
08:32:18*leorize quit (Ping timeout: 252 seconds)
08:32:22*leorize1 is now known as leorize
08:33:46PMunchHmm, why is callsite deprecated?
08:39:18FromGitter<andreaferretti> a quick question for those familiar with the compiler
08:39:28FromGitter<andreaferretti> I am trying to debug something
08:39:34FromGitter<andreaferretti> I used to be able to do
08:39:50FromGitter<andreaferretti> `if n.info ?? "somemodule.nim"`
08:40:01FromGitter<andreaferretti> as suggested in https://nim-lang.org/docs/intern.html
08:40:12FromGitter<andreaferretti> but if I do that now I get the error
08:40:47FromGitter<andreaferretti> `type mismatch: got <TLineInfo, string>`
08:40:49*TheLemonMan joined #nim
08:40:58FromGitter<andreaferretti> `but expected one of: `
08:41:07FromGitter<andreaferretti> `proc `??`(conf: ConfigRef; info: TLineInfo; filename: string): bool`
08:41:12TheLemonManandreaferretti, use `??`(config, n.info, "string")
08:41:26FromGitter<andreaferretti> the point is - where do I find a config?
08:41:50FromGitter<andreaferretti> I have a context, a node and not much more
08:41:53FromGitter<andreaferretti> I am inside
08:41:54FromGitter<andreaferretti> `proc semParamList(c: PContext, n, genericParams: PNode, s: PSym) =`
08:41:55leorizeeither `newConfigRef()` or use one in your context
08:42:06TheLemonManp.graph.config
08:42:23TheLemonManerr, I meant c.graph.config
08:42:38FromGitter<andreaferretti> ok thanks!
08:42:58FromGitter<andreaferretti> (the docs should be updated if anyone more knowledgeable than me finds some time)
08:46:02leorizeyyyc514: looks like a transparent copy happen when you pass a NimNode to a proc
08:47:41leorizeactually, nvm
08:56:25*floppydh joined #nim
08:58:51FromGitter<alehander42> @PMunch strVal is only for nnkStrLit and similar I think
08:59:16FromGitter<alehander42> at least it's used in the compiler repr of those nodes
08:59:25FromGitter<alehander42> not sure about the macros, always used repr there
09:00:06FromGitter<alehander42> something else could do what callsite can iirc
09:00:20PMunchalehander42, the documentation for strVal is super confusing then..
09:00:45PMunchAnd I tried to figure out what repr did behind the scenes because that's what I normally use as wel
09:01:22FromGitter<alehander42> @rayman22201 @yyyc514 there are two other pattern matching libs: https://github.com/krux02/ast-pattern-matching (only for NimNodes) and https://github.com/alehander42/gara (but I have to finish 0.2 soon which should be more stable)
09:01:45FromGitter<alehander42> @PMunch I remember intLit had intVal etc
09:03:16TheLemonManxxxVal macros extract the value of type xxx from ntyxxxLit nodes
09:03:44FromGitter<alehander42> ah yeah look at the "fake" definition in the docs
09:03:49FromGitter<alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc06375e65a634336c5c8c8]
09:03:52TheLemonManthen there's `$` for NimNode and repr of course
09:04:00FromGitter<alehander42> it's actually a magic afaik
09:04:28FromGitter<alehander42> so actually all of those are accessors, not fields
09:06:05FromGitter<alehander42> `$` for NimNode is worthless in general
09:06:21FromGitter<yyyc514> indeed
09:06:30FromGitter<alehander42> I just use `repr`
09:17:17*leorize quit (Ping timeout: 276 seconds)
09:26:02*craigger quit (Read error: Connection reset by peer)
09:27:23*craigger joined #nim
09:30:19FromGitter<vinodvinu> How to use choosenim ?
09:30:50FromGitter<vinodvinu> This is my assumption. ⏎ ⏎ Open CMD ⏎ type choosenim ⏎ It will show all installed versions of nim ... [https://gitter.im/nim-lang/Nim?at=5bc069c9e65a634336c5f8fa]
09:32:03*Vladar joined #nim
09:32:33FromGitter<mratsim> choosenim stable or choosenim devel or choosenim 0.18.0
09:33:00FromGitter<mratsim> `treerepr`> `repr` in macros ;)
09:33:36FromGitter<vinodvinu> do i need to add choosenim path in PATH ?
09:33:45FromGitter<vinodvinu> if so which directory
09:34:49FromGitter<narimiran> @vinodvinu my memory might be wrong, but doesn't choosenim tell you upon the installation what you need to do regarding PATH?
09:34:51FromGitter<vinodvinu> Actually, i just want to update from nim 0.18 to nim 0.19.
09:35:21PMunchchoosenim update stable
09:35:48FromGitter<narimiran> PMunch: his original 0.18 nim was not installed via choosenim
09:36:01FromGitter<vinodvinu> @narimiran choosenim's installation story was a horrible one
09:36:23FromGitter<vinodvinu> I didnt get enough info from the github page
09:36:40PMunchnarimiran[m], ah, then purge that install and `choosenim stable`
09:36:40FromGitter<alehander42> @mratsim perfect people dont need any repr :D
09:36:56FromGitter<narimiran> @vinodvinu my experience was completely opposite. :/
09:37:17FromGitter<vinodvinu> Actually do i need this choosenim in order to get the latest nim version ?
09:37:40PMunchvinodvinu, you don't need it per se, but it's highly recommended
09:37:43FromGitter<vinodvinu> Everybody says that 0.19 is good but i am confused
09:37:46FromGitter<mratsim> you don’t, but it’s easier imo, though I don’t know about windows
09:37:48PMunchMuch easier to update in the future
09:37:54FromGitter<narimiran> @vinodvinu you need it to make your life easier in the long run
09:38:32FromGitter<vinodvinu> Ok, to upgrade nim 0.19, do i need to un install nim 0.18 first ?
09:38:43PMunchvinovinu, why was the installation so difficult? Not on Windows myself but the install instructions seems easy enough
09:39:14FromGitter<mratsim> choosenim can install both side by side
09:39:15FromGitter<narimiran> @vinodvinu i would say, deinstall your current nim (0.18), remove it from PATH, deinstall choosenim (as you said, something went wrong), and then do a clean installation of choosenim and follow the instructions (including the instruction what/where to add to the PATH)
09:39:22PMunchviovinu, with choosenim you can have both installed an easily switch between them. But if you have installed 0.18.0 without choosenim I would remove it before using choosenim to install 0.19.0
09:40:16FromGitter<narimiran> i have installed nim via choosenim on windows before, and there weren't any problems
09:40:42FromGitter<vinodvinu> Ok thank you guys. The problem is, i am expecting this programs (choosesnim in this case) to add path in PATH
09:40:57FromGitter<mratsim> it should
09:41:04FromGitter<vinodvinu> but now i know that its my responsibility
09:41:21FromGitter<mratsim> I’m pretty sure one of the script maybe finish.exe is doing that
09:42:07FromGitter<vinodvinu> In my PC, i installed nim 0.19 manually . That PC had nim 0.18
09:42:50FromGitter<vinodvinu> I expect nim installation would add path to PATH automatically but it didnt
09:42:53PMunchmratsim, the script tells you to add it to your path
09:43:12PMunchSo I don't thin kit does so automatically
09:43:16FromGitter<narimiran> @mratsim i think choosenim does not do it automatically, but it guides you with the exact steps you need to follow
09:43:23FromGitter<mratsim> ah, windows :P
09:44:01FromGitter<vinodvinu> All windows programs which needs PATH would add their paths in to PATH
09:44:37FromGitter<vinodvinu> but programmers from linux or mac wont add that feature in their code
09:45:15FromGitter<mratsim> they
09:45:18FromGitter<mratsim> they do
09:45:36FromGitter<vinodvinu> Basically, in windows, we love to double clicking an exe file and watch the play
09:45:49FromGitter<mratsim> programs will add a line in ~/.bashrc $PATH=$PATH;./nimble/bin
09:46:41*platoff joined #nim
09:47:28FromGitter<vinodvinu> So i am asking one more for clarity sake. ⏎ ⏎ 1) Remove all junks from my pc ⏎ 2) Install Nim 0.19 fresh ⏎ 3) Install nimble latest version ... [https://gitter.im/nim-lang/Nim?at=5bc06db0ae7be9401643b894]
09:48:37PMunchvinovinu, 1) Remove all old versions of Nim 2) Install choosenim 3) Use choosenim to install Nim and Nimble
09:49:12FromGitter<vinodvinu> Oh , please choosenim is horrible i think
09:49:42FromGitter<vinodvinu> Anyway, i will try
09:50:00FromGitter<vinodvinu> Thanks for the help @PMunch
09:50:20FromGitter<vinodvinu> And thanks @mratsim & @narimiran
09:50:29TheLemonManrustup updates the PATH on both Windows and Leenox (and OSX too) with relatively little effort
09:50:32TheLemonManhttps://github.com/rust-lang-nursery/rustup.rs/blob/f546c2bd8e496e23348c2b2c3d97c85470a5af88/src/rustup-cli/self_update.rs#L1190,L1268
09:50:54FromGitter<kayabaNerve> Choosenim is great IMO
09:51:09FromGitter<vinodvinu> Ha ha thats good thing about rustup
09:51:36FromGitter<vinodvinu> But choosenim want user to do partial job
09:52:42FromGitter<vinodvinu> BTW, nimble will installed automatically when i install nim 0.19 ?
09:52:50TheLemonManyep
09:53:11FromGitter<vinodvinu> Ok thats enough. Nimble is simple and i love it.
09:53:36FromGitter<vinodvinu> Everything is explained very well in the github page
09:54:11FromGitter<vinodvinu> But choosenime is not documented as nimble
09:54:34TheLemonManthis is the perfect chance to become a contributor!
09:55:11FromGitter<vinodvinu> Yeah, i know and my first contibution is getting ready for the release.
09:56:14FromGitter<vinodvinu> But all my work is related to windows
09:56:52FromGitter<vinodvinu> My biggest hurdle was understand and learn stuff in nim
09:57:28TheLemonManthen this may also be a good chance to implement the automatic PATH update mechanism for windows :)
09:58:29FromGitter<vinodvinu> Well, thats in my plan, BTW, does asking help is turning to DIY here ?
09:58:55FromGitter<vinodvinu> I mean, if you ask for something, then create it and enjoy it
10:00:12FromGitter<vinodvinu> If i ask about any feature about nim, then people will say that to create a language from scratch
10:02:16FromGitter<vinodvinu> @TheLemonMan, Its my luck that you didnt tell me to create something like choosenim.
10:09:39TheLemonManthat's a weird way to twist what I said, sometimes people implement stuff for other people to enjoy if they have enough time (& competence). That's it
10:10:18TheLemonManand since the Hacktoberfest is going strong people may be even more interested in contributing
10:10:34FromGitter<vinodvinu> This is the problem of talking in electronic media. I can't see the expressions.
10:11:15FromGitter<vinodvinu> Anyway no offence. I am here for knowledge. Only knowledge.
10:12:19TheLemonManindeed, I added a :) in order to convey it was not a "DIY or fuck off" response
10:13:26TheLemonManno offense taken ofc, I hope you'll enjoy the 0.19 version
10:13:34FromGitter<vinodvinu> Ha ha.. I am sorry if my words hurt you.
10:14:08FromGitter<vinodvinu> Installation is the big hurdle and now i am doing it with choosenim.
10:14:31FromGitter<vinodvinu> We in windows expects everything as an exe file.
10:14:56FromGitter<vinodvinu> So we as programmers in windows, we like to upload everthing as exe also
10:15:08FromGitter<vinodvinu> Thats why i came to nim.
10:15:35FromGitter<vinodvinu> Because in Python, i need an extra program to make exe
10:17:08FromGitter<vinodvinu> The most easiest language in windows is vb.net but i hate framework dependancy.
10:18:05TheLemonManI wholeheartedly agree, a single .exe is the best deployment solution for Windows (considering both platform and the average user base)
10:18:06FromGitter<vinodvinu> Then there is a lot of scripting langs and other programming langs but none of them are interesting
10:18:58TheLemonMantoo many times I had to ship a small py file and a long list of instructions on how to run it
10:19:30FromGitter<vinodvinu> Ha ha
10:20:26FromGitter<vinodvinu> FBSL was a good scripting language in windows but it died.
10:21:01copygirlIs there a Nim library that can validate JSON using .schema.json files like these: https://github.com/KhronosGroup/glTF/tree/master/specification/2.0/schema ?
10:21:47TheLemonMancopygirl, https://github.com/PMunch/jsonschema by PMunch
10:22:08*SenasOzys__ quit (Remote host closed the connection)
10:22:20*SenasOzys joined #nim
10:22:22copygirlIt mentions a DSL but can it use .schema.json too?
10:22:31TheLemonManoh, _that_ json schema, I guess not
10:23:13FromGitter<kayabaNerve> TheLemonMan Are you LemonBoy on GH?
10:23:30TheLemonMankayabaNerve, yep
10:23:41FromGitter<kayabaNerve> What's your OS
10:24:07TheLemonManlinux x64
10:24:33FromGitter<kayabaNerve> Thanks for the validation.
10:24:46TheLemonManyou said you're on windows... can you get a better idea of where the crash happens using a debugger?
10:24:54FromGitter<vinodvinu> Oh you are the lemonby ! I have heard about the hard work you have done in latest nim release
10:25:02FromGitter<kayabaNerve> You couldn't reproduce my thread issue. Wanted to make sure you weren't also on Windows and it was platform specific.
10:25:06TheLemonMan(I guess you're asking about the threadvar Channel issue)
10:25:09FromGitter<vinodvinu> sorry "lemonboy" - typo
10:25:10FromGitter<kayabaNerve> Yeah
10:26:13FromGitter<kayabaNerve> Give me a sec
10:26:34TheLemonManvinodvinu, we all worked hard in order to make Nim even more pleasant :)
10:26:54FromGitter<kayabaNerve> My main curiosity is the fact it doesn't even run the first echo
10:26:58FromGitter<yyyc514> why should code inside a macro generate compile errors if the macro isn’t emitting an AST?
10:27:06FromGitter<yyyc514> shouldn’t pretty much any syntax fly?
10:27:39TheLemonMankayabaNerve, the threadvars are initialized in the init section
10:28:00FromGitter<yyyc514> i think the parser just really hates prefixed conditionals :)
10:28:06FromGitter<vinodvinu> @TheLemonMan,
10:28:40FromGitter<vinodvinu> You guys are amazing. You made programming an easy job
10:29:19FromGitter<kayabaNerve> ```code paste, see link``` ⏎ ⏎ GDB [https://gitter.im/nim-lang/Nim?at=5bc0777fe65a634336c65f03]
10:29:47FromGitter<yyyc514> yikes
10:29:56FromGitter<kayabaNerve> That's just from `run`. I didn't ask for any more info. Mainly because I don't know how to use GDB.
10:30:02TheLemonMankayabaNerve, get a backtrace with `bt`
10:30:16FromGitter<kayabaNerve> Why the hell does it not even print `echo` though? 0_0 Computers are weird.
10:30:22FromGitter<kayabaNerve> TLM: I do know that command.
10:30:36FromGitter<kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc077cb271506518dfbf17b]
10:30:53FromGitter<kayabaNerve> I didn't compile with --debugInfo or --debugger:native but can recompile if you want.
10:34:25TheLemonManhmm, can you upload the generated C file somewhere?
10:35:11FromGitter<kayabaNerve> Gist or pastebin?
10:35:14FromGitter<kayabaNerve> Or some other?
10:35:32TheLemonManeverything but pastebin is fine
10:36:00FromGitter<kayabaNerve> https://pastebin.com/TQJSRBKj
10:37:43FromGitter<kayabaNerve> The GCC command has my full path in it. TIL. ⏎ ⏎ I didn't edit it since I don't care about people knowing my username. Yes it is in another Nim project. I did make sure it was a... clean environment. I have no system level custom cfg/nims and the nims in that project only applies to "main.nim". This was not named main.
10:39:17AraqTheLemonMan: are you familiar with dataflow analysis algorithms?
10:40:33TheLemonManAraq, not really, I've only dabbled with CFA algorithms (and even then only with the kCFA family)
10:41:00Araqwhat's that, control flow analysis?
10:41:51TheLemonManyep, it was in order to approximate the types in scheme programs
10:43:24*enthus1ast joined #nim
10:44:56TheLemonMankayabaNerve, try compiling with -t:-g (don't know if --debugger:native does the same)
10:45:21enthus1astwhat is your preferred way to enshure byte endianess when defining a network protocol?
10:46:12*dddddd joined #nim
10:48:58enthus1astor do you think it will fall on my feet when i just read a structure and send this over the network, or do i make a thinking error
10:49:01*elrood joined #nim
10:50:21FromGitter<yyyc514> (https://files.gitter.im/nim-lang/Nim/Ezp0/carbon.png)
10:50:23FromGitter<yyyc514> thoughts on syntax?
10:51:06enthus1astthis will fail when one machine is big endian and the other is little endian right?
10:51:20Araqas an exercise in macros this is fine, yyyc514.
10:51:39AraqI'd never use it in production code though
10:51:54TheLemonManenthus1ast, check out the endians module and make sure you convert all the numeric fields to either BE or LE
10:51:56FromGitter<yyyc514> yeah, guards is a macro… i really wanted to use “if” but the syntax doesn’t allow it i don’t think
10:52:18Araq"unless" is just pointless sugar IMO
10:52:19ryuoenthus1ast: there's even a socket ABI for unsigned short/long for this purpose.
10:52:29ryuoenthus1ast: API*
10:52:38FromGitter<yyyc514> I’m spoiled by ruby’s plain english :)
10:52:48Araqplus I don't enjoy control flow that lies
10:53:06Araqclearly the condition needs to be evaluated before the corresponding action
10:53:36ryuoenthus1ast: htons, htonl, etc.
10:53:39FromGitter<yyyc514> i was just trying to think of a better work than given :)
10:53:53FromGitter<yyyc514> not argueing the merits of the approach, which obviously people can disagree on :)
10:54:22ryuoenthus1ast: alternatively, you can use a field to record the byte order. if it's different for the reader, they swap the bytes of fields they read.
10:54:30ryuoenthus1ast: this is how ELF format does it.
10:54:45FromGitter<yyyc514> when is also a reserved word
10:54:52enthus1astso just out of curiosity, there is no magically transfer happen, i must always to this for every structure i need to send over the wire
10:54:59Araq"buy an umbrella if it will rain tomorrow"
10:55:05FromGitter<alehander42> i think there was an interesting dbc lib https://github.com/Udiknedormin/NimContracts
10:55:09ryuoenthus1ast: something must, yes.
10:55:14enthus1astok
10:55:16FromGitter<alehander42> not the same as guards, but probably interesting for people interested in them
10:55:24enthus1astthank you
10:55:25ryuoenthus1ast: how you handle it is up to you.
10:55:43ryuoenthus1ast: this applies not just to networks but also files.
10:56:08ryuoenthus1ast: amusingly though, single byte data chunks are immune to this issue.
10:56:26enthus1astso i could just use strings everywhere? :)
10:56:31FromGitter<kayabaNerve> Is it objects or just ints?
10:56:31FromGitter<yyyc514> ah yeah this is neat
10:56:54enthus1astobjects
10:57:54enthus1astits funny, i've naively written a lot of network programs withouth considering this
10:58:00FromGitter<kayabaNerve> TheLemonBoy ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc07e38271506518dfc1dda]
11:00:00TheLemonManif we're both getting the same stdlib_system.c you're hitting the raiseOutOfMem handler
11:01:35ryuoenthus1ast: you could, i'm just saying some data is naturally immune.
11:01:37FromGitter<kayabaNerve> Need me to upload that?
11:03:06FromGitter<kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc07f691c100a4f2972b429]
11:03:11FromGitter<kayabaNerve> The last line in that is 1517
11:03:17enthus1astok thank you for clearing this up
11:05:04Araqhttps://gist.github.com/Araq/6bb3b253c6ac6c0a27e61ae36d65f1d7 who can prove this algorithm correct? :P
11:05:18FromGitter<kayabaNerve> TheLemonMan: If I change test.nim to just be the var decl, with no procs or echos, it still fails with the same backtrace.
11:05:27Araqand it likely isn't...
11:06:00FromGitter<kayabaNerve> So it appears to be failing when Nim 'itself' tries to print something. Of course, the cause of this is the channel in some way.
11:06:14Araq"for all paths ..." is such a hard condition to implement :P
11:06:18*PMunch quit (Ping timeout: 245 seconds)
11:08:00TheLemonMankayabaNerve, maaaaaybe you're hitting the critical section before InitializeCriticalSection is called
11:08:48FromGitter<kayabaNerve> Maaaaaaybe I have no idea what's going on and I'm just trying to give you the data because I appreciate you trying to fix the problem I found.
11:09:03FromGitter<kayabaNerve> Oh.
11:09:17FromGitter<kayabaNerve> I lied. GDB gave slightly different output when it was just the var decl
11:09:35FromGitter<kayabaNerve> Nope. Just misread it. It was the same. Don't mind me.
11:10:07*Guest71257 quit (Ping timeout: 246 seconds)
11:10:23*PMunch joined #nim
11:10:48TheLemonManI have no debugger nor 8-ball, that's my best guess by looking at the generated code and the backtrace
11:11:32TheLemonManthe 'maaaaaybe' was because of that, today I'm being misunderstood by everyone heh
11:11:47FromGitter<narimiran> Araq: re merging test: yeah, i didn't know what to do with concepts. i'll re-split them back. it is nice to have this kind of feedback - now i know what (not) to do with my future merges
11:12:50FromGitter<alehander42> @Araq is that the lastReadOf from the destructors proposal?
11:12:58Araqyes
11:14:24FromGitter<kaushalmodi> TheLemonMan: how would rustup update the PATH?
11:14:41FromGitter<narimiran> btw, i already asked about these: https://github.com/nim-lang/Nim/tree/devel/tests/benchmarks - they don't even compile - why do we have them?
11:14:47Araqfinish.exe does PATH updates on Windows, you can just steal the code.
11:14:57FromGitter<kaushalmodi> I have it installed and I don't remember it messing with my .bashrc or anything to update the PATH.
11:15:13Araqnarimiran: fix them and add some timings so that we notice performance regressions
11:15:16TheLemonMankaushalmodi, I've pasted a link to its source code
11:15:22TheLemonMangtg
11:15:24*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
11:15:30FromGitter<kaushalmodi> PATH is a user config env var, no app should update it transparently.
11:15:37Araqthat was the idea anyway, problem is, these benchmarks are not typical Nim code
11:16:12Araqkaushalmodi: installers ask about it before they go on and change it
11:16:17FromGitter<narimiran> hm, okay, i'll see what i can do (and how to measure those reliably)
11:17:27Araqit's probably a lost cause with the CIs and their unpredictable VMs
11:17:43FromGitter<kayabaNerve> TLM: I know :P Just joking a bit.
11:18:12*PMunch quit (Ping timeout: 244 seconds)
11:18:21Araqbtw I need to tell you about my revolution in computing
11:18:38AraqPATH=/programs/*/bin
11:19:01Araqprograms can stay in their own directory and no path modifications are required
11:20:24FromGitter<narimiran> yeah, that unpredictability is why i'm asking why do we even have those "tests"
11:20:44FromGitter<kaushalmodi> TheLemonMan: I didn't see a link.
11:21:18Araqbut that's way to innovative so let's better have a billion different package managers over /usr/bin that only have to solve NP complete problems to figure out the right version(s) to install
11:21:36FromGitter<alehander42> @kaushalmodi eh everything is "user configuration", let the program set my PATH or at least ask me to, thanks
11:21:39Araqthis is all so fucked up...
11:22:06FromGitter<alehander42> what does usr bin have to do with version management
11:23:29FromGitter<kaushalmodi> @alehander42 what OS are you on? I think it's a norm on Windows to let apps update the PATH.
11:23:52Araqeverything IMO. the package manager's job is mostly to manage this /usr/bin madness
11:24:28Araqit's true that it does much more than that but that was the primary motivation for its existance
11:26:24FromGitter<kayabaNerve> when AraqOS
11:27:05FromGitter<kayabaNerve> I picture another TempleOS coming. "I was so pissed off by everyone else's OS I built my own. It only runs code I write to maintain it's purity."
11:27:07FromGitter<narimiran> @Araq i've splitted the merged concept tests. should i also split concept-issues like it was before, or can the issues stay in one file?
11:28:02Araqsorry what?
11:28:11*platoff quit (Read error: Connection reset by peer)
11:28:20*platoff joined #nim
11:29:04FromGitter<alehander42> @Araq `if c.g[pc].sym == s:` i need a paper and pencil to follow the variables in this code ..
11:30:17FromGitter<alehander42> otherwise i wonder, why the final api is planned to be `a = lastReadOf b` instead of e.g. `a = move b` (as the plan is to move b's ownership to a for those statements iirc)
11:30:38FromGitter<vinodvinu> How to print the nim version ? I mean not in cmd. In our code
11:30:42FromGitter<narimiran> you said that concept tests shouldn't be merged. so i did split the file with various concept tests. but i've made another file where i put all the tests that came from some issue (before that were files t1128.nim, t3330.nim, t3414.nim, etc. - i've put them all in `tissues.nim` file). should i also split those back to the original files (one per issue)?
11:31:01Araqnah, tissues.nim is fine
11:31:25Araqand yeah, test cases named after issue numbers are usually tests nobody cares about :-)
11:31:31Araq(as long as they stay green, ofc)
11:31:48Araqecho system.NimVersion
11:32:01FromGitter<narimiran> ok, i'll push it then, thanks
11:32:02FromGitter<vinodvinu> Thanks Araq :)
11:34:06Araqalehander42: it becomes clear when you think about the mutability aspects
11:34:40Araq'move b' needs to empty the 'b' afterwards but usually 'b' is not an lvalue
11:35:48Araqso the design is careful about not turning everything into an lvalue or 'var T' parameters
11:42:42*leorize joined #nim
11:46:09FromGitter<vinodvinu> How to change the nim compiler in VS Code ? any help ?
11:46:24FromGitter<vinodvinu> Currently it is 0.18
11:46:33FromGitter<vinodvinu> But i want to use nim 0.19
11:46:41FromGitter<narimiran> @vinodvinu did you install it via choosenim?
11:47:02FromGitter<vinodvinu> Yes. and my choosenim says that already switched to 0.19
11:47:40leorizeis it in your `PATH`?
11:48:05FromGitter<bung87> if you can build it https://github.com/bung87/vscode-nim
11:49:12FromGitter<bung87> (https://files.gitter.im/nim-lang/Nim/tDbf/Screen-Shot-2018-10-12-at-7.48.41-PM.png)
11:49:29FromGitter<vinodvinu> @leorize, Only nimble path is in PATH
11:49:35FromGitter<vinodvinu> C:\Users\TransLap_W10\.nimble\bin
11:50:47FromGitter<bung87> (https://files.gitter.im/nim-lang/Nim/Ka8b/Screen-Shot-2018-10-12-at-7.50.22-PM.png)
11:50:56FromGitter<bung87> will give you a switch
11:51:57FromGitter<vinodvinu> Since, english is not my first language, can you please elaborate it a little bit
11:52:19FromGitter<vinodvinu> I mean What to do step 1 and 2 and etc
11:52:37FromGitter<bung87> yeah not my native language though.
11:53:06FromGitter<bung87> a swich at vscode status bar -> click -> popup a menu for you choice.
11:54:33FromGitter<vinodvinu> I am confused
11:54:52FromGitter<vinodvinu> All i want to change the compiler
11:55:04FromGitter<vinodvinu> But code-runner is the extension
11:55:05FromGitter<bung87> I mean you build the extension by yourself
11:55:51FromGitter<vinodvinu> OMG So i can't change it in my current code-runner extension ?
11:56:37FromGitter<bung87> well, if you use the code-runner, I could say you have many choice do same work.
11:56:56Araqdownload 0.19 from the website, run finish.exe, done
11:56:56FromGitter<vinodvinu> Ok
11:57:16Araquninstall 0.18 first
11:57:30FromGitter<vinodvinu> Its not programs list
11:57:36FromGitter<vinodvinu> Then how do i uninstall
11:57:47FromGitter<vinodvinu> I am completely struck
11:57:50Araqjust delete the directory you've put it in
11:58:29FromGitter<vinodvinu> Ok, But i think PATH variable is the problem.
11:59:30FromGitter<bung87> em , you just need read the extension document.
11:59:37FromGitter<vinodvinu> Then what is the job of choosenim ?
11:59:54Araqit works well on Not-Windows I've been told
11:59:56FromGitter<vinodvinu> I told it to "choosenim stable"
11:59:59FromGitter<bung87> there’s Configuration section for runner
12:00:12FromGitter<vinodvinu> It says that it already switched
12:00:19FromGitter<bung87> `"php": "C:\\php\\php.exe",`
12:00:22FromGitter<vinodvinu> Switched what ?
12:00:38Araqchoosenim doesn't set the PATH for you afaik
12:01:01FromGitter<vinodvinu> Ok, then what is it doing ?
12:01:04FromGitter<bung87> I cant follow you,`choosenim stable` does not make affect to extension.
12:01:35FromGitter<vinodvinu> Ok, @bung87 then what is the keyword to change the nim version in choosenim
12:01:36FromGitter<bung87> the extension know nothing about you command
12:02:11FromGitter<bung87> https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner
12:02:17AraqVSCode uses the PATH, if you changed the PATH, you likely have to restart it
12:02:30FromGitter<bung87> you just need read carefully Configuration section
12:02:51FromGitter<vinodvinu> @Araq OK. let me try
12:03:30FromGitter<bung87> it’s only depends on how the code-runner implemented.
12:04:15FromGitter<vinodvinu> I think PATH is the problem. Let me explain ; ⏎ I have only nimble path is in PATH
12:04:40FromGitter<vinodvinu> So i think i need to enter nim path also
12:06:25FromGitter<bung87> all extension do same work just need to know your exec path, whether by PATH or config file.
12:08:35FromGitter<bung87> I donno how code-runner receive pieces of code.but you only need to tell where you nim.exe is to extension.
12:08:45FromGitter<vinodvinu> But nim path is not in PATH and still VS code is working with nim 0.18
12:09:39FromGitter<bung87> well , that’s because all these extension trying to get nim.exe from PATH by default.
12:10:42FromGitter<bung87> that would make the extension work at startup,and provide config when you ready for chose a exe path.
12:10:57FromGitter<vinodvinu> C:\Nim in C\nim-0.19.0_x32\bin
12:11:06FromGitter<vinodvinu> Is it enough for the PATH
12:12:23FromGitter<bung87> if you have multiple version , it will use the first it get
12:13:37FromGitter<vinodvinu> I was used nim 0.18 but can't un install since it is not listed as an entry in installed programs list
12:14:02FromGitter<narimiran> @Araq: similar story as before: generics tests have lots of tests named after a single issue. should i merge them into `tissues.nim`?
12:14:24FromGitter<bung87> so you need read the extension document. that’s all.
12:14:59FromGitter<vinodvinu> At last success !!!
12:15:07FromGitter<vinodvinu> It printed 0.19.0
12:15:23FromGitter<vinodvinu> Windows has 2 places for PATH variables
12:15:35FromGitter<vinodvinu> I just edited at one place only
12:15:49FromGitter<vinodvinu> Now i entered all placed where i see a PATH
12:18:18FromGitter<vinodvinu> Thank you @bung87 for your help. I will sure check your extension.
12:18:39FromGitter<vinodvinu> Hop you will help me to install and use it
12:21:07FromGitter<bung87> well , I dont use such a feature at all, the vscode-nim I provide only for switch nimsuggest version.
12:36:11*TheLemonMan joined #nim
12:37:51TheLemonMankayabanerve, can you try this patch? https://gist.github.com/LemonBoy/ca5d03d0a8a2298fadf2022d4fc49fdb
12:39:19TheLemonMankaushalmodi, here's the link https://github.com/rust-lang-nursery/rustup.rs/blob/f546c2bd8e496e23348c2b2c3d97c85470a5af88/src/rustup-cli/self_update.rs#L1190,L1268
12:41:54*PMunch joined #nim
13:16:05*TheLemonMan quit (Quit: "It's now safe to turn off your computer.")
13:32:01*SenasOzys quit (Ping timeout: 244 seconds)
13:35:20*chemist69 quit (Ping timeout: 276 seconds)
13:35:50*chemist69 joined #nim
13:37:25*endragor quit (Remote host closed the connection)
13:41:56*SenasOzys joined #nim
13:45:15*stefanos82 joined #nim
13:46:07*PMunch quit (Quit: Leaving)
13:46:22*PMunch joined #nim
13:51:34*endragor joined #nim
13:56:15*endragor quit (Ping timeout: 252 seconds)
14:07:38Araqnarimiran, yeah
14:08:16Araqbtw the algorithm is not enough, you also need to prove that the 'def x' dominates the 'use x' instruction...
14:13:49FromGitter<narimiran> thanks, will do it in part 3 :)
14:25:36*PrimHelios joined #nim
14:32:54*saintdevUe joined #nim
14:33:12nolan_dHas anyone done any advanced, non-proof-of-concept work on building Nim libraries to wasm? I have some Nim code that works fine natively, but fails in wasm. So I'm looking for best practices, or at least some good pointers.
14:33:30nolan_dI.e. GC, what do you use: --gc:none? --gc:v2?
14:35:13nolan_dIf I leave the GC setting alone, I get a segfault whenever I try writing anything to memory I create with `create`. If I disable GC, SQLite's mallocWithAlarm function has a fit, so I feel like I'm getting something wrong with memory handling.
14:36:44nolan_dAlso, if I disable GC, I get lots of warnings that suggest I need it enabled. I can provide more details if needed, I'm just wondering if anyone has done this and can point me to a working nim.cfg/config.nims/Emscripten setup. And yes, I saw the forum post where someone compiled the GC test and posted their nim.cfg, just wondering if there's anything more recent.
14:37:05*enthus1ast quit (Ping timeout: 250 seconds)
14:39:03*PMunch quit (Quit: Leaving)
14:39:24Araqnolan_d: I only know some theory
14:40:27*saintdevUe quit (Remote host closed the connection)
14:43:51nolan_dtype
14:43:52nolan_dMap = object
14:43:52nolan_ddb: DbConn
14:44:52nolan_dI create that with `create(Map)`, and trying to set map.db in JS throws a segfault.
14:45:15nolan_dAm I doing that correctly? Is there a way to just allocate and create a DbConn directly without making it a member variable of a type?
14:45:45nolan_dLike just make `Map` a `DbConn` on which I can define procs?
14:49:15Araqcreate(Map) is totally not required
14:50:00FromGitter<alehander42> you can define procs on DbConn itself
14:51:22FromGitter<kaushalmodi> leorize: alas -idirafter is also no go: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc0b4e9384492366129c07c]
14:51:22*tay_ joined #nim
14:53:30nolan_dI'd rather not define procs directly on DbConn because I do want to create a new type, Map, that represents a SpatiaLite database on which I can run different queries.
14:54:02nolan_dAnd I'm trying to return a `ptr Map`, is `create` still unnecessary for that?
14:54:12*PrimHelios quit (Ping timeout: 268 seconds)
14:57:03FromGitter<zacharycarter> is there still work ongoing on the language server protocol implementation for Nim?
14:58:43FromGitter<kaushalmodi> @PMunch had started some work on it: https://github.com/PMunch/nimlsp
14:59:04FromGitter<zacharycarter> yeah - I saw his work and zahary's but wasn't sure if it was still in progress or had stalled out
15:00:04FromGitter<alehander42> @nolan_d why do you need ptr Map ?
15:00:13FromGitter<alehander42> using ptr is very rarely needed
15:02:19*Kraps joined #nim
15:04:03*Vladar quit (Remote host closed the connection)
15:04:15*floppydh quit (Quit: WeeChat 2.2)
15:04:56*Kraps quit (Remote host closed the connection)
15:06:13*nsf quit (Quit: WeeChat 2.2)
15:06:13*omenar joined #nim
15:14:12*tay_ quit (Quit: Leaving)
15:19:51*platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:20:35nolan_dalehander42: Building a wasm javascript library that needs to work with advanced types. These need to be `void *`, or something that maps to a JS number for Emscripten.
15:21:27Araqwell it feels like Nim's alloc() doesn't even work, nor does sqlite's
15:21:42*platoff joined #nim
15:22:22*narimiran joined #nim
15:23:38nolan_dYeah. I had this working in Rust, but now that I think of it, I was trying to do more in Rust than I am here, so SQLite/SpatiaLite weren't being worked with as pointers.
15:23:59FromGitter<iffy> @alehander42 thank you for your help! The argument parser is coming along well (and even has a nicer syntax). The code also feels very clean thanks to your explanations: https://github.com/iffy/nim-argparse#usage
15:24:16nolan_dSo maybe there's something broken with allocating a pointer to an SQLite connection and trying to pass that back from JS.
15:25:19nolan_dI've been thinking of building this code as a Node module and working with it via Electron/nodejs-mobile. Maybe that's the only way forward.
15:32:00*shakygatormH joined #nim
15:37:08*shakygatormH quit (Ping timeout: 245 seconds)
15:43:20Araqor: you use emscripten instead, wasm is vaporware
15:43:56FromGitter<zacharycarter> one issue I ran into w/ emscripten - and the jsbind library - is that event handlers become problematic with the GC
15:44:10FromGitter<zacharycarter> and maintaining references to them
15:44:12*cryptokiddS joined #nim
15:44:32FromGitter<zacharycarter> Yuriy solved this with the gcRef stuff he added to the jsbind library - but it's not a full solution to the problem
15:45:02FromGitter<kaushalmodi> leorize: I got openssl to compile on Travis!!
15:45:20leorizenice
15:46:03*cryptokiddS quit (K-Lined)
15:46:11leorizenext time try to install a proper cross toolchain...
15:48:18*koobskV joined #nim
15:48:24*koobskV quit (Remote host closed the connection)
15:48:33nolan_dzacharycarter: js-bind?
15:48:57leorizekaushalmodi: https://crosstool-ng.github.io/
15:49:08nolan_dAraq: What do you mean? I was using Emscripten, at least, using it as the compiler toolchain from Nim.
15:49:23leorizekaushalmodi: for a potentally friction-less cross tool generation
15:49:42leorizewill probably works better when you starts having to bring in complicated libraries
15:50:13nolan_dDoes anyone know of any good examples of NPM modules built via Nim? I can probably muddle my way through if needed, but I'm muddling through lots with this project, so any help skipping the muddling is useful. :)
15:52:42FromGitter<iffy> Is there a builtin way to pop from the front of a sequence?
15:53:07leorize`s[1..^1]`?
15:53:11FromGitter<zacharycarter> nolan_d: https://github.com/yglukhov/jsbind
15:53:23FromGitter<iffy> leorize: will that remove the element?
15:53:42leorizeyou're taking a slice without the first element so...
15:54:18*larstobi joined #nim
15:55:16FromGitter<iffy> leorize: okay, so no proc that will remove the first element in place. I can handle that
15:55:31FromGitter<kaushalmodi> leorize: thanks, I have never heard of that (probably this is the very first time I got into binary packaging)
15:55:34nolan_dOh, interesting. Does it only work with asm.js or can it work with wasm as well?
15:55:37FromGitter<kaushalmodi> I have noted that
15:56:19FromGitter<zacharycarter> nolan_d: I was using in a project that was targetting WASM via emscripten
15:56:27leorizeiffy: There's `delete[T]()` if you want in-place
15:56:40nolan_dHmm.
15:56:46FromGitter<zacharycarter> but I ran into issues with passing event handlers to / from Nim and JS
15:56:47*larstobi quit (Remote host closed the connection)
15:56:56Araqasm.js used to be the more mature toolchain, dunno about the present
15:57:00FromGitter<zacharycarter> mostly because the pointer to the handler needed to be refd by the GC
15:57:09FromGitter<zacharycarter> but it was impossible to unref it on the other side of things, once it was no longer needed
15:58:16nolan_dYeah, I'm worried about those sorts of issues creeping up on me later. I think I'm probably going the nodejs-mobile/electron route. Having a single self-contained module that'd run everywhere with a wasm runtime is a nice idea. Maybe in a few years it'll be more practical.
15:58:31FromGitter<zacharycarter> why not just go with webview?
15:58:33FromGitter<zacharycarter> and Nim?
15:58:41FromGitter<zacharycarter> or CEF?
15:59:04FromGitter<zacharycarter> I don't think you need to resort to electron / nodeJS - but I'm not exactly sure what you're trying to do either
15:59:10nolan_dI'm trying to link against native libraries, specifically SpatiaLite.
15:59:14FromGitter<zacharycarter> I know you said you had issues passing pointers to the MySQL lib or something
15:59:42nolan_dIf that's possible then I'm all for it. :)
15:59:44FromGitter<zacharycarter> interesting - I've never seen / heard of this lib before but it looks useful
16:00:23FromGitter<zacharycarter> I figured your hangup was more around the x-platform GUI stuff
16:00:27FromGitter<zacharycarter> and that's why you wanted electron
16:00:41*bobdox joined #nim
16:01:45nolan_dNo. I'm trying to write a GPS navigation app, and I'm trying to do it in as platform-agnostic a way as possible, because I have some specific requirements, and I don't know that any one platform (I'm looking at you, Android) will necessarily support them in a few years.
16:02:25FromGitter<zacharycarter> gotcha
16:02:58FromGitter<zacharycarter> well - I can't comment on the pointer passing / allocation stuff regarding they spatiaLite library
16:03:14*abm quit (Quit: Leaving)
16:03:16nolan_dAnd I also need access to GPS-level location data, and AFAICT that's not possible outside of mobile browsers. Geoclue2 may allow it, but everyone sort of hand-waves around the idea of getting location data from a GPS without something like gpsd.
16:03:22FromGitter<zacharycarter> but I think that there are answers for portable apps - besides electron, that are available to Nim programmers - which I mentioned above (webview, CEF, etc...)
16:03:25FromGitter<zacharycarter> hrm
16:03:29FromGitter<zacharycarter> yeah that's definitely another complication
16:04:11nolan_dWhat is CEF? And is WebView an actual project, or just the idea of running the app inside a mobile WebView?
16:04:26FromGitter<zacharycarter> chromium embedded framework
16:04:37FromGitter<zacharycarter> https://github.com/zserge/webview
16:06:58FromGitter<kayabaNerve> CEF is the basis of Electron. WebView is a like CEF but with more quirks and less bloat.
16:07:24nolan_dThanks. I think I'll just go the NPM module route for now. Build the application core as a Nim library, then compile in NPM bindings when a flag is defined. That keeps me free to just pull the native library into something using a native UI later.G
16:08:04narimiranthis fails when i try to run it manually: https://github.com/nim-lang/Nim/blob/devel/tests/generics/t2tables.nim can somebody confirm?
16:08:56FromGitter<kaushalmodi> yes
16:09:00FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc0c71c271506518dfe84d9]
16:10:09narimirannow the big question: why CI doesn't mind?
16:10:46FromGitter<kaushalmodi> may be `g` is somehow getting initialized?
16:11:08FromGitter<kaushalmodi> is that test part of a bigger test where there is another initialized `g` table?
16:11:09*whaleydv joined #nim
16:12:15*whaleydv quit (Remote host closed the connection)
16:16:30leorizeor maybe testament just compile but not run it
16:16:58leorizenarimiran: ^
16:17:48*enthus1ast joined #nim
16:17:48narimiranyeah, it might be. i'll leave it as it is :)
16:17:58*TemporalBeingiS joined #nim
16:20:19*TemporalBeingiS quit (Remote host closed the connection)
16:21:29FromGitter<zacharycarter> nolan_d: np - probably a sound approach
16:27:48FromGitter<kaushalmodi> Thanks to the immense help from leorize and collab with @xmonader, ladies and gents, I present: https://github.com/kaushalmodi/hello_musl/releases/tag/v0.3.0
16:28:28FromGitter<kaushalmodi> 64-bit GNU/Linux users can download/extract that release archive and try running the musl+openssl statically compiled `hello_musl_ssl` binary in there :D
16:28:49Araqwow that's pretty cool
16:28:51*Trustable joined #nim
16:29:03Araqthat means I can ship Nim binaries to Linux, right?
16:29:17leorizeit's worth pointing out that `-DOPENSSL_NO_SECURE_MEMORY` is being used to build openssl...
16:29:25leorizehopefully no ill effects :P
16:29:26FromGitter<kaushalmodi> yes, I have made a note in the README
16:29:58FromGitter<kaushalmodi> let me raise that note to the top so as not to look like I am masking that
16:30:20Araqnarimiran: https://github.com/nim-lang/Nim/pull/5664 please fix the tester merge conflict and merge this PR
16:30:31FromGitter<mratsim> @nolan_d, Nim webview bindings are not bad, try to run this example: https://github.com/oskca/webview/blob/master/tests/bindEx.nim
16:31:17narimiranAraq: you sure that's the correct link? (sizeof-alignof)
16:31:39Araqyeah, krux02 made it green
16:31:43FromGitter<mratsim> “less bloat”, more like no bloat at all. webview is a couble bytes at most kB, while CEF/Electron is 200MB
16:32:02narimiranAraq: ok, will do it
16:32:10Araqthanks, you're awesome
16:32:17narimiran:D
16:33:56FromGitter<kaushalmodi> Araq: I think now choosenim can be statically compiled so that I can finally use it on RHEL 6.8 :P
16:35:01FromGitter<kaushalmodi> leorize: That #undef trick for libressl didn't work.. with or without, I get this error: https://travis-ci.org/kaushalmodi/hello_musl/builds/440709973#L1420
16:35:05leorizekaushalmodi: btw https://github.com/kaushalmodi/hello_musl/blob/4e29b1533b3ac8f363d1b77cc49b00f074b20f08/config.nims#L66
16:35:16leorizeyou're missing a `C` in `CC`
16:35:28FromGitter<kaushalmodi> hmm, but it works
16:36:26FromGitter<kaushalmodi> but I will fix it, thanks
16:36:31FromGitter<kaushalmodi> not sure why `C` works
16:36:42leorizeit doesn't
16:36:48leorizehttps://travis-ci.org/kaushalmodi/hello_musl/builds/439863716#L618
16:37:12leorizejust happen that pcre use a subset of libc that's binary compatible between glibc and musl
16:37:34FromGitter<kaushalmodi> ah
16:38:18leorizeand yea I'm aware of the libressl issue
16:38:33leorizeturns out you've to add it below `#include <sys/syscall.h>`
16:39:04FromGitter<kaushalmodi> ok, that should be simple (I think).. simply refactor that sed cmd
16:39:11narimiranAraq: strange, when i tried to follow github's instruction for solving merge conflict - i had no conflicts locally. i'll investigate what's going on
16:39:23FromGitter<kaushalmodi> leorize: but shouldn't configure that that undef?
16:39:33Araqtester.nim was moved, that's why
16:39:44leorizekaushalmodi: what do you mean?
16:40:14FromGitter<kaushalmodi> leorize: I thought configure does the job of figuring out what is present/absent on the system, and avoid failures like "foo not found"
16:40:35leorizethe thing is... it only works if you add tests for it
16:41:08leorizeI mean, no one would've thought `<linux/sysctl.h>` is not available on Linux, right?
16:43:04FromGitter<kaushalmodi> leorize: instead of adding that undef, what if I symlink this bits dir to a linux dir? ref: https://travis-ci.org/kaushalmodi/hello_musl/builds/440688916#L1190
16:43:20*PrimHelios joined #nim
16:43:25FromGitter<kaushalmodi> in one of the old runs, I just printed out all the .h files present in the travis /usr/include
16:43:43leorizethat's a hack actually
16:43:53FromGitter<kaushalmodi> better than undef?
16:43:57leorizethe correct way is to build a proper cross toolchain
16:44:05leorizein some way worse
16:44:28FromGitter<kaushalmodi> wait.. linus/sysctl.h is present: https://travis-ci.org/kaushalmodi/hello_musl/builds/440688916#L2447
16:44:47FromGitter<kaushalmodi> I just need to add that `-idirafter`
16:45:04leorizeyes, it is
16:45:08leorizedoesn't mean it'll work
16:45:26FromGitter<kaushalmodi> hmm
16:45:28leorizeback in the old kernels you've to patch the linux api headers to make it work with musl libc
16:45:55leorizepretty sure Ubuntu trusty is still using one of those old versions
16:46:14leorizethat's why when you add `-idirafter` it doesn't work as you've shown me
16:46:21leorizeit tries to include bits from glibc
16:46:51FromGitter<kaushalmodi> no, I never added -idirafter for libressl
16:47:10FromGitter<kaushalmodi> just added and committed to libressl branch.. fingers crossed
16:48:51*xet7 quit (Remote host closed the connection)
16:49:18leorizeI think you should try to integrate crosstool-NG
16:49:29leorizeperks: works even if your distro doesn't provides musl
16:50:10FromGitter<kaushalmodi> leorize: that didn't work. yeah, I'll have to just note crosstool-NG for now
16:50:36leorizeactually, if you integrate crosstool-NG, you might be able to write a `.nims` that can spit out windows, mac,... binaries
16:50:50*xet7 joined #nim
16:51:18FromGitter<kaushalmodi> that does sound very lucrative! Though, I am a bit burned out by this ssl thing
16:52:03*darithorn joined #nim
16:52:40leorizelook at the log https://travis-ci.org/kaushalmodi/hello_musl/builds/440722014#L688
16:53:03leorizecan you tell what's missing?
16:53:48leorizethat's because your commit placed that flag in the wrong place...
16:53:55FromGitter<kaushalmodi> argh.. yeah
16:54:34*endragor joined #nim
16:54:36FromGitter<kaushalmodi> *told you.. am burned out* thanks :) another try ..
16:58:29FromGitter<kaushalmodi> leorize: progress!
16:58:40FromGitter<kaushalmodi> just needs that other idirafter switch too
16:58:51*endragor quit (Ping timeout: 252 seconds)
16:59:00*omenar quit (Remote host closed the connection)
16:59:28*Trustable quit (Remote host closed the connection)
16:59:34*omenar joined #nim
17:03:41*omenar_ joined #nim
17:04:53*omenar quit (Ping timeout: 244 seconds)
17:07:05FromGitter<kaushalmodi> leorize: .. and it worked https://travis-ci.org/kaushalmodi/hello_musl/builds/440726767#L4276
17:07:53*omenar_ quit (Ping timeout: 250 seconds)
17:08:12FromGitter<kaushalmodi> may be I should rename the switches to `-d:openssl` and `-d:libressl`
17:08:22FromGitter<kaushalmodi> \* rename that one switch
17:08:35leorizecongrats, now I won't touch your `config.nims` without a pole lol
17:08:52FromGitter<kaushalmodi> hehe
17:21:12narimiranAraq: i've merged krux's PR locally, but i'm not sure that's what you asked of me because now it seems like i did all those changes, not him
17:21:27Araqhmm
17:22:39*omenar joined #nim
17:23:32*omenar quit (Remote host closed the connection)
17:25:10narimirancan we just delete `tests/testament/tester.nim` from his PR (that's doable on github), and then manually make that one change on line 470 of `testament/tester.nim`?
17:25:54narimiraneither that or somebody else, who is more experienced with git, should do that stuff instead of me
17:26:15*omenar joined #nim
17:26:16*omenar quit (Remote host closed the connection)
17:26:29*omenar joined #nim
17:26:40*omenar quit (Remote host closed the connection)
17:27:15*omenar joined #nim
17:28:58narimiranor, as the third option, krux02 might make those changes himself :)
17:32:04*omenar quit (Ping timeout: 268 seconds)
17:35:16*PrimHelios quit (Quit: Leaving)
17:38:55*Trustable joined #nim
17:39:23Araqnarimiran: your solution seems fine
17:45:27*omenar joined #nim
17:46:08*omenar quit (Remote host closed the connection)
17:46:47*Trustable quit (Remote host closed the connection)
17:51:24*narimiran quit (Quit: Konversation terminated!)
17:51:30*craigger_ joined #nim
17:53:38*craigger quit (Ping timeout: 272 seconds)
17:54:53*dddddd quit (Remote host closed the connection)
18:04:26*hitchhooker[m] quit (Ping timeout: 276 seconds)
18:04:35*hitchhooker[m] joined #nim
18:04:42FromGitter<kaushalmodi> leorize: See https://github.com/kaushalmodi/hello_musl/blob/master/README.org
18:04:52FromGitter<kaushalmodi> I haven't been more proud of my config.nims :D
18:05:33FromGitter<kaushalmodi> Araq: would love if you could critique this use of config.nims: https://github.com/kaushalmodi/hello_musl/blob/master/config.nims
18:07:01AraqI would use 'let' for getEnv, not 'const'
18:07:23Araqcurrently it depends on murky compiler behaviour
18:07:33FromGitter<kaushalmodi> ok!
18:07:47FromGitter<kaushalmodi> but then everything else will need to become let
18:08:12FromGitter<timotheecour> @narimiran if you locally merge his PR, there would only be that one merge commit marked as you, previous commits would be attributed to their respective authors
18:10:58*darithorn quit ()
18:12:02*Trustable joined #nim
18:14:38*SenasOzys quit (Ping timeout: 244 seconds)
18:22:16elroodnarimiran[m], you could also change a commit's author with something along the lines of git commit --amend --author="krux.." if you feel that's really necessary
18:22:52*Jesin joined #nim
18:23:35FromGitter<kaushalmodi> leorize: interestingly the libressl binary built over travis works for me
18:23:46FromGitter<kaushalmodi> only when I build locally, it crashes instantly
18:24:10FromGitter<kaushalmodi> and running with `--debugger:native` gives nothing: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc0e6ca435c2a518e975aaa]
18:24:41FromGitter<kaushalmodi> so either libressl is not getting built correctly locally, or the nim compiled binary
18:25:43FromGitter<kaushalmodi> Araq: for history, if I build this binary using libressl lib, it build fine but instantly ends with "Killed"
18:26:02FromGitter<kaushalmodi> that doesn't happen with openssl built binary
18:26:23FromGitter<kaushalmodi> Is that any file I can provide from the cache to help debug this?
18:26:28FromGitter<kaushalmodi> s/that/there
18:29:57*paulrs joined #nim
18:34:49*omenar joined #nim
18:35:39*paulrs quit (Remote host closed the connection)
18:36:14*icywizmS joined #nim
18:40:11*darithorn joined #nim
18:42:17*rockcavera quit (Remote host closed the connection)
18:42:48*icywizmS quit (Ping timeout: 252 seconds)
18:43:12*rockcavera joined #nim
18:46:37*wildlander joined #nim
18:48:10*omenar quit (Remote host closed the connection)
18:48:43*omenar joined #nim
18:53:17*omenar quit (Ping timeout: 252 seconds)
18:57:39*omenar joined #nim
19:01:55*omenar quit (Ping timeout: 246 seconds)
19:06:41*omenar joined #nim
19:08:22*omenar quit (Read error: Connection reset by peer)
19:08:34*omenar joined #nim
19:13:22FromGitter<timotheecour> if someone could please review https://github.com/github/linguist/pull/4295 which adds syntax highlight of nims, nim.cfg, nimble files (currently broken on github)
19:13:59*omenar quit (Ping timeout: 276 seconds)
19:16:55*krux02 joined #nim
19:17:53*omenar joined #nim
19:21:27FromDiscord<An unconspicuous looking friend> is this expected? https://gist.github.com/dawkot/4c76295f92ef064a861704ee93f61690
19:23:34*omenar quit (Ping timeout: 272 seconds)
19:25:25FromGitter<kaushalmodi> @timotheecour That looks great! Just today when I shared my config.nims on Github, I wished it had syntax highlighting
19:25:33*aziz joined #nim
19:25:52FromGitter<timotheecour> that’s what triggered my forum post :)
19:26:08FromGitter<kaushalmodi> oh, just checked the forum post :)
19:26:09FromGitter<kaushalmodi> thanks
19:26:35*irc-5225225 joined #nim
19:26:45*Guest71257 joined #nim
19:26:56FromGitter<timotheecour> (for reference: https://forum.nim-lang.org/t/4307 syntax highlight of nims, nim.cfg, nimble files broken on github, highlight, sublimetext)
19:27:30*EvilBillPB joined #nim
19:27:58FromGitter<kaushalmodi> they have some "pedantic" test that fails that PR
19:27:59FromGitter<kaushalmodi> https://travis-ci.org/github/linguist/jobs/440777089#L1574
19:28:00*omenar joined #nim
19:28:20FromGitter<kaushalmodi> may be just do alpha sort in that list
19:28:32FromGitter<timotheecour> gotcha, i missed that thx!
19:29:26*EvilBillPB quit (K-Lined)
19:29:34*irc-5225225 quit (Remote host closed the connection)
19:29:35*flaviu quit (Ping timeout: 250 seconds)
19:32:39*vlad1777d_ joined #nim
19:33:03*PMunch joined #nim
19:34:00*zachk joined #nim
19:35:24*zachk quit (Changing host)
19:35:24*zachk joined #nim
19:41:10*bobdox quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:41:12*flaviu joined #nim
19:47:38*aziz quit (Ping timeout: 272 seconds)
19:53:58*Guest71257 quit (Read error: Connection reset by peer)
20:00:07*aziz joined #nim
20:01:52*omenar quit (Remote host closed the connection)
20:03:11*omenar joined #nim
20:06:28FromGitter<yyyc514> *yawn*
20:06:29FromGitter<yyyc514> afternoon all
20:08:52*omenar quit (Remote host closed the connection)
20:09:24*omenar joined #nim
20:10:53FromGitter<kaushalmodi> "nim doc" on any Nim file creates the docs, but with the search box, but we don't have a dochack.js associated with those
20:11:23FromGitter<kaushalmodi> I tried copying the dochack.js from Nim docs, but that always ends up with "no search results"
20:12:19FromGitter<kaushalmodi> @rayman22201 any help getting search to work with "nim doc" generated page for any nim project?
20:12:52*craigger joined #nim
20:13:36*craigger_ quit (Ping timeout: 272 seconds)
20:16:20*u-ouAI joined #nim
20:17:36*omenar quit (Ping timeout: 244 seconds)
20:18:09*shadowbane quit (Quit: Konversation terminated!)
20:19:51*chemist69 quit (Ping timeout: 250 seconds)
20:21:02*chemist69 joined #nim
20:21:16*u-ouAI quit (Remote host closed the connection)
20:29:25*stefanos82 quit (Quit: Quitting for now...)
20:32:13*omenar joined #nim
20:33:00FromGitter<timotheecour> CI recently broke all PRs: see https://github.com/nim-lang/Nim/issues/9339
20:39:59FromGitter<mratsim> woot: https://github.com/nim-lang/Nim/commit/fcca59e415fe2f3ccbd5c4a977b65305e80f83e8
20:47:35*aziz quit (Ping timeout: 276 seconds)
20:53:47FromGitter<alehander42> @iffy no problem I took a look today and I saw you fixed the dsl syntax
20:53:49FromGitter<alehander42> very nice
20:54:03FromGitter<alehander42> i had a different workaround in mind, but yours is even better
20:55:17FromGitter<alehander42> btw I am planning to maybe stream a bit tomorrow working on gara, trying for the first time to stream
20:56:06FromGitter<alehander42> how do people include the nim-twitch gitter in their twitch channels?
20:56:24*Jesin quit (Quit: Leaving)
20:57:17*Trustable quit (Remote host closed the connection)
20:58:43*dddddd joined #nim
21:00:29*aziz joined #nim
21:00:44*rodgortlc joined #nim
21:06:51*rodgortlc quit (Remote host closed the connection)
21:10:43FromGitter<yyyc514> when comparing sequences does check want the order to be the same also?
21:14:27FromGitter<alehander42> i hope so
21:14:35FromGitter<yyyc514> lol
21:14:44FromGitter<yyyc514> yeah switching to an OrderedTable helped a lot :)
21:15:03FromGitter<alehander42> ah, I thought you are talking about seq
21:15:17FromGitter<yyyc514> yeah was using toSeq on an interator running against a table
21:15:30FromGitter<yyyc514> and the results were out of order from what was expected :)
21:15:53FromGitter<alehander42> yeah I guess you might need OrderedTable
21:16:04FromGitter<alehander42> i find myself using it more often these days
21:16:54FromGitter<yyyc514> hmmm, is there any Nim docset for dash?
21:18:05FromGitter<kaushalmodi> what is dash?
21:20:04FromGitter<yyyc514> https://kapeli.com/dash really nice API browser for Mac
21:20:17FromGitter<kaushalmodi> ah OK
21:20:23FromGitter<kaushalmodi> there is *similar* devdocs
21:20:37FromGitter<kaushalmodi> https://devdocs.io/nim/
21:21:11*smt` quit (Ping timeout: 260 seconds)
21:21:36FromGitter<kaushalmodi> hmm, though they don't seem to be of the latest release
21:25:37*tzui joined #nim
21:26:09*tzui left #nim (#nim)
21:29:31FromGitter<yyyc514> https://github.com/nim-lang/Nim/issues/1401
21:30:21FromGitter<kaushalmodi> @yyyc514 which editor do you use?
21:30:28FromGitter<yyyc514> sublime
21:30:49FromGitter<kaushalmodi> ok, they might have a devdocs plugin
21:30:53*xace joined #nim
21:31:31FromGitter<kaushalmodi> otherwise it works in Emacs like this: https://scripter.co/accessing-devdocs-from-emacs/nim-devdocs.gif
21:32:17FromGitter<yyyc514> i’ll take a closer look at that dash github isse and see if perhaps i can build my own
21:32:25*PrimHelios joined #nim
21:32:25FromGitter<yyyc514> or look into why it never got made official
21:32:42*PrimHelios quit (Client Quit)
21:32:45*rmk0NE joined #nim
21:32:53FromGitter<yyyc514> what would the idiomatic way to name a iterator for some type of object?
21:33:25FromGitter<yyyc514> iterms?
21:35:12*rmk0NE quit (Remote host closed the connection)
21:35:42FromGitter<kaushalmodi> I don't think `items` is idiomatic.. it's a special name
21:36:34*tzui joined #nim
21:36:44FromGitter<yyyc514> i’m doing exercism and it has an object… and a lst() method that wants a sequence… but i wrote an iterator because i thoguth that made more sense so lst() just calls toSeq on the iterator
21:36:50FromGitter<yyyc514> but i wasn’t sure what to name the iterator
21:37:14*tzui left #nim (#nim)
21:38:09FromGitter<Vindaar> @yyyc514 precisely because it is special, it is idiomatic imo. If you use `items` for your custom type, it allows you to just call `for x in obj`, which will implicitly call the `items` iterator. Of course only if you want that implicit behavior
21:39:28FromGitter<yyyc514> ah, right :)
21:39:34*arecaceae quit (Remote host closed the connection)
21:39:38FromGitter<yyyc514> for is probasbly template or macro or something?
21:39:53*arecaceae joined #nim
21:42:09FromGitter<Vindaar> for is implemented in the compiler, so that's where that implicit magic happens
21:44:36*riveter joined #nim
21:47:36*aziz quit (Ping timeout: 252 seconds)
21:48:29*riveter quit (Remote host closed the connection)
21:48:56*jsn- left #nim (#nim)
21:49:33FromGitter<kaushalmodi> @Vindaar you have a good idea to implement when-let in Nim?
21:49:38FromGitter<kaushalmodi> may be add to nimy_lisp?
21:51:19FromGitter<kaushalmodi> I think that would need some heavy use of macros
21:54:10FromGitter<Vindaar> Hmm, have never used `when-let`. Need to look at what it does first :)
21:54:20*endragor joined #nim
21:57:10FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc118b6271506518d01093c]
21:58:14FromGitter<alehander42> i think with slightly different iterators one would be able to define a for with macro
21:58:52*endragor quit (Ping timeout: 244 seconds)
21:58:53*platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:59:24FromGitter<kaushalmodi> @Vindaar I think the tricky part is the concept of nil/non-nil applies everywhere in emacs-lisp. In Nim, the boolean applies only to bool type
21:59:25FromGitter<kaushalmodi> hmm
22:00:10*aziz joined #nim
22:00:24*omenar quit (Remote host closed the connection)
22:00:34FromGitter<Vindaar> Yep, thought the same. But for most types a "nil" equivalent is easily definable
22:01:02FromGitter<Vindaar> Or one just keeps it to bools for a start
22:03:18FromGitter<kaushalmodi> I cannot even come with a psedo code..
22:03:46FromGitter<Vindaar> not like I am a lot further than you, haha
22:04:31FromGitter<kaushalmodi> the idea is this:
22:04:34FromGitter<kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc11a72c7bf7c366200059f]
22:04:38FromGitter<kaushalmodi> but it doesn't compile
22:05:57*aziz quit (Quit: Ex-Chat)
22:06:13FromGitter<kaushalmodi> .. and then be able to shrink all that code into something like: ⏎ ⏎ ```whenLet ⏎ a = 1 ⏎ b = a + 2 ⏎ c = (b > 1): ⏎ echo "all a, b, c are non-nil!"``` [https://gitter.im/nim-lang/Nim?at=5bc11ad4435c2a518e98da95]
22:06:42FromGitter<Vindaar> it's a fun problem. I'll think about it! :) will head to bed soon though
22:06:52FromGitter<kaushalmodi> alright
22:06:53FromGitter<kaushalmodi> thanks
22:07:04FromGitter<Vindaar> no worries :)
22:07:16elroodyyyc514, a recent docset for dash/zeal is available at https://www.dropbox.com/sh/7jdv2e8zdr03dfz/AADlSvHZ5IRehieM--J1c4Dxa?dl=0
22:07:29*omenar joined #nim
22:08:40*tzui joined #nim
22:10:10*tzui left #nim (#nim)
22:18:52*omenar quit (Remote host closed the connection)
22:19:58*craigger_ joined #nim
22:21:36*craigger quit (Ping timeout: 244 seconds)
22:23:11FromGitter<Vindaar> one more note: your snippet there does compile, if you replace the `x is bool` ifs by whens (will just remove all 3 when branches, since no var is a bool)
22:23:17FromGitter<Vindaar> @kaushalmodi ^
22:24:34*omenar joined #nim
22:29:52*craigger joined #nim
22:30:54*craigger_ quit (Ping timeout: 244 seconds)
22:32:21*elrood quit (Quit: Leaving)
22:40:05*craigger quit (Read error: Connection reset by peer)
22:41:23*craigger joined #nim
22:43:58*darithorn quit ()
22:46:34*tzui joined #nim
22:47:11*tzui left #nim (#nim)
22:53:36*omenar quit (Read error: Connection reset by peer)
22:54:10*omenar joined #nim
22:58:25FromGitter<rayman22201> @kaushalmodi Hey, what's up? Sorry. I'm at work, wasn't able to respond earlier.
22:59:39FromGitter<kaushalmodi> Hey, not a problem. I was bugged by the search box not working on arbitrary nim projects
22:59:51FromGitter<rayman22201> interesting. I never tried doing that
23:00:11FromGitter<kaushalmodi> The box gets generated, but it is not functional
23:00:32FromGitter<rayman22201> can you see if any error happens in the javascript console?
23:00:40FromGitter<kaushalmodi> First of all, it expects the dochack.js, but there is none, so you get 404
23:01:02FromGitter<rayman22201> Well, that is a problem. dochack.js will need to be generated.
23:01:02FromGitter<kaushalmodi> Then I copied it from Nim docs, then I get "no search results"
23:01:29FromGitter<rayman22201> I bet I know why! the search uses the index.html to generate it's results.
23:01:43FromGitter<rayman22201> do arbitrary nim projects generate an index.html file by default?
23:01:50FromGitter<kaushalmodi> Oh!
23:02:08FromGitter<kaushalmodi> See the search box of any project in wild to test this
23:02:30FromGitter<kaushalmodi> I recently saw the glob project docs by citycide
23:02:45FromGitter<kaushalmodi> Same issue (missing dochack.js)
23:03:33FromGitter<kaushalmodi> Would you have bandwidth to work up a flow to generate search index for any arbitrary nim doc generated HTML?
23:03:35FromGitter<rayman22201> Nim doc probably needs to be modified to compile dochack.js and move it to the correct folder
23:03:57FromGitter<rayman22201> but the other issue is that an index.html file needs to be generated.
23:04:06FromGitter<rayman22201> That is something Araq and I were discussing the other week
23:04:32FromGitter<rayman22201> I just need to get some time to do it. work and my personal life has been a bit busy lately :-/
23:05:14FromGitter<kaushalmodi> No problem. I was just surprised seeing this wasn't working. Life first, code later.
23:05:21FromGitter<rayman22201> A separate "searchIndex" file should be generated separate from the main index file
23:06:09FromGitter<kaushalmodi> For single file docs, I rename then to index.html
23:06:17FromGitter<kaushalmodi> As that's the landing page itself
23:06:30FromGitter<kaushalmodi> Then the challenge is to generate the .idx for that.
23:07:04FromGitter<rayman22201> this is the page I'm referring to: https://nim-lang.org/docs/theindex.html
23:07:34FromGitter<kaushalmodi> Hmm, but do even small projects need that?
23:07:45FromGitter<kaushalmodi> See my small project: https://kaushalmodi.github.io/nimy_lisp/
23:08:15FromGitter<rayman22201> The .idx files that are currently generated are fine. A new output target with slightly different formatting needs to be created for those .idx files is all
23:08:30FromGitter<rayman22201> It's only needed if you want the search box feature
23:08:47FromGitter<rayman22201> the search needs a database to search from.
23:09:15FromGitter<kaushalmodi> Right, but can that happen from a single page HTML?
23:09:29FromGitter<kaushalmodi> No thein
23:09:57FromGitter<rayman22201> You could embed the database into the HTML page. idk if that is a good idea though
23:10:27FromGitter<rayman22201> The search box is not a text search. It doesn't work the same as "ctrl+f" in the browser for example.
23:11:15FromGitter<rayman22201> embedding the database is a bad idea for a big project, because that is a lot of extra data that needs to be loaded with every page.
23:13:29FromGitter<kaushalmodi> I mean, If you have just a single page HTML doc, generate a doc.idx and search.js
23:13:57FromGitter<kaushalmodi> So you will end up with 3 files with `nim doc foo.nim`
23:14:07FromGitter<rayman22201> yeah, that should be sufficient.
23:14:36*rockcavera quit (Remote host closed the connection)
23:14:54FromGitter<kaushalmodi> If the current dochack.js is generic, problem statement is "how to generate that .idx?"
23:15:14FromGitter<rayman22201> nim generates the idx files already?
23:15:21FromGitter<rayman22201> at least for the built in docs
23:15:45FromGitter<rayman22201> I assumed it generates them for all other docs as well. is that wrong?
23:15:53FromGitter<kaushalmodi> `nim doc foo.nim` doesn't do that
23:16:27FromGitter<rayman22201> interesting. Araq pointed me to the idx generation code a while back. let me go look
23:19:22FromGitter<rayman22201> So the rst generator makes idx files: https://github.com/nim-lang/Nim/blob/c404163bbf39d8d8311c516d6e89d531ffea151c/lib/packages/docutils/rstgen.nim#L151
23:19:50FromGitter<rayman22201> let me "go up the stack" and see if you have to pass a flag or something to enable it
23:22:40FromGitter<rayman22201> you have to do `nim doc --index:on`
23:23:51*omenar quit (Remote host closed the connection)
23:24:24*omenar joined #nim
23:25:58FromGitter<kaushalmodi> Thanks! Will try as soon as am as my PC
23:26:14*craigger quit (Read error: Connection reset by peer)
23:28:02*craigger joined #nim
23:29:21*omenar quit (Ping timeout: 252 seconds)
23:32:56*omenar joined #nim
23:33:49FromGitter<rayman22201> 👍
23:35:59*craigger_ joined #nim
23:36:31*craigger quit (Ping timeout: 244 seconds)
23:39:25*omenar quit ()
23:45:51*vlad1777d_ quit (Ping timeout: 252 seconds)