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:34 | FromGitter | <zacharycarter> changed up my tooling quite a bit on OSX - after I destroyed my macbook pro on Wednesday evening on accident |
01:33:46 | FromGitter | <zacharycarter> now using fish shell, kakoune, kitty term |
01:33:57 | FromGitter | <zacharycarter> and nix for package management |
01:47:40 | FromGitter | <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:09 | leorize | kaushalmodi: here's an another hack: pass this to musl-gcc: `-idirafter /usr/include` |
03:08:52 | * | PrimHelios quit (Quit: Leaving) |
03:12:05 | FromGitter | <kaushalmodi> leorize: thanks. I'll try that tomorrow when at computer. |
03:13:03 | FromGitter | <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:37 | FromGitter | <kaushalmodi> See the third to last commit on ssl branch in .travis.yml |
03:14:49 | FromGitter | <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:06 | FromGitter | <kaushalmodi> s/of/if |
03:15:29 | * | PrimHelios joined #nim |
03:17:01 | leorize | ; |
03:17:07 | leorize | you just have to do this |
03:17:08 | FromGitter | <yyyc514> where can i find newSymNode |
03:17:31 | leorize | kaushalmodi: `ln -s /usr/include/linux /usr/include/<musl path thingy>/linux` |
03:17:43 | leorize | yyyc514: `macros` module? |
03:17:52 | FromGitter | <yyyc514> doesn’t seem like it |
03:18:00 | FromGitter | <yyyc514> i’ve imported macros |
03:18:27 | * | chemist69 quit (Ping timeout: 252 seconds) |
03:20:10 | leorize | yyyc514: looked up in theindex, no result |
03:20:23 | FromGitter | <yyyc514> astGenRepr is outputting it |
03:20:36 | * | chemist69 joined #nim |
03:21:46 | leorize | you can try `bindSym` |
03:22:36 | FromGitter | <yyyc514> that results in undeclared identifier |
03:22:52 | leorize | ofc, you can only bind what's in the scope |
03:22:58 | leorize | what are you trying to do? |
03:23:08 | FromGitter | <yyyc514> i want the literal symbol |
03:23:16 | FromGitter | <yyyc514> tryingt o build an AST in multiple pieces |
03:23:33 | FromGitter | <yyyc514> first pieces declares a var and references it |
03:23:37 | FromGitter | <yyyc514> i want to reference it again later |
03:23:52 | FromGitter | <yyyc514> but if you just add quote it’ll treat it as an identifier not a symbol |
03:24:16 | leorize | if you want a symbol then use `genSym` |
03:28:48 | FromGitter | <yyyc514> treeRept outputs "Sym “acc" |
03:28:55 | FromGitter | <yyyc514> I want to know how to add anotehr node just like that to the tree |
03:29:46 | leorize | use `genSym` to generate a symbol node then add it to the tree? |
03:30:01 | FromGitter | <yyyc514> how? that gives a string |
03:30:25 | leorize | are you sure? http://nim-lang.github.io/Nim/macros.html#genSym%2CNimSymKind%2Cstring |
03:30:30 | leorize | it outputs NimNode |
03:32:00 | FromGitter | <yyyc514> ok genSym(nskVar,"acc”) :) |
03:44:02 | FromGitter | <yyyc514> i’m missing something still, grrr |
03:44:17 | FromGitter | <yyyc514> if i add it myself it blows up but AFAIK i’m building the same tree quote is |
03:45:40 | leorize | what are you trying to build? and you can actually just use `quote` to build things... |
03:46:27 | FromGitter | <yyyc514> but separate quote blocks lose context |
03:46:32 | FromGitter | <yyyc514> you can’t build things one peice at a time |
03:47:25 | FromGitter | <yyyc514> changing the symbol type has some effect even though it’s not showing up in the repr |
03:47:38 | FromGitter | <yyyc514> is there anything like ruby’s inspect that will show full attributes of a type? |
03:48:27 | leorize | yyyc514: you can keep the part you want to pass to some other `proc/macro` with you, and `quote` the rest |
03:49:55 | FromGitter | <xmonader> @kaushalmodi why do you need src/libc-dev ? |
03:50:17 | FromGitter | <xmonader> also the travis is against ubuntu trusty :S |
03:50:46 | FromGitter | <yyyc514> you lost me |
03:51:19 | leorize | so you wanted to use `quote` to build a `var`, but you also want to keep the symbol, right? |
03:51:37 | FromGitter | <yyyc514> i want to be able to reference it from a different quote later, yes |
03:51:54 | FromGitter | <yyyc514> genSym(nskVar,"acc”) adds the correct AST node as far as i can tell but it doesn’t work in practice |
03:52:31 | leorize | https://ptpb.pw/oGzZ/nim |
03:52:43 | leorize | here's how to use `quote` to use the symbol you created |
03:53:03 | FromGitter | <yyyc514> ok i can maybe work with that, let me try it |
04:00:59 | FromGitter | <yyyc514> omg that took some doing :) |
04:03:08 | * | narimiran joined #nim |
04:03:42 | * | PrimHelios quit (Quit: Leaving) |
04:04:15 | FromGitter | <yyyc514> https://gist.github.com/yyyc514/60700bae2c65c1522f4270ff6e4bd130 |
04:05:32 | FromGitter | <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:59 | leorize | why do you need `{.inject.}`? |
04:07:23 | FromGitter | <yyyc514> i neede it with template, haven’t tried removing it since this became a macro |
04:07:53 | FromGitter | <yyyc514> i needs to be accessable to the caller |
04:08:48 | leorize | afaik `inject` only work with templates |
04:09:07 | FromGitter | <yyyc514> yeah without it i get undeclared identifier |
04:09:13 | FromGitter | <yyyc514> seems to work just fine :) |
04:09:24 | * | banc quit (Ping timeout: 252 seconds) |
04:11:55 | * | banc joined #nim |
04:13:46 | FromGitter | <yyyc514> (updated git)… better |
04:13:50 | FromGitter | <yyyc514> still verbose |
04:15:36 | leorize | isn't the thing is that either you `+=` `i` or `body`? |
04:15:49 | leorize | this is certainly better being a template... |
04:16:23 | FromGitter | <yyyc514> yes but i is literal and `body` is passed in |
04:16:36 | FromGitter | <yyyc514> i coudln’t figure out how to do the coditional inner iteration with a template |
04:17:07 | leorize | `when`? |
04:17:25 | FromGitter | <yyyc514> when what |
04:17:48 | FromGitter | <yyyc514> all of this is to default body to i when it’s not given |
04:18:05 | leorize | `when body == nil`? :P |
04:18:33 | leorize | never tried actually, or you could just use overloads |
04:18:38 | FromGitter | <yyyc514> that didn’t work because of the whole typed untyepd thing |
04:18:54 | FromGitter | <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:15 | FromGitter | <yyyc514> maybe that was silly :) |
04:20:52 | FromGitter | <yyyc514> yeah that looks a lot nicer one sec |
04:21:21 | FromGitter | <yyyc514> can you look at the template version? |
04:21:51 | FromGitter | <yyyc514> oh let me see if i can just compare nil directly now that wasn’t working before |
04:22:34 | FromGitter | <yyyc514> yeah it doesn’t like that |
04:22:46 | FromGitter | <yyyc514> got <int, nil> |
04:23:11 | FromGitter | <yyyc514> because the same code is now being generated for both cases |
04:23:16 | FromGitter | <yyyc514> and one of them can’t compile with nil |
04:23:20 | FromGitter | <yyyc514> since you can’t add nil to an int |
04:24:03 | leorize | https://ptpb.pw/VnaJ/nim |
04:24:04 | FromGitter | <yyyc514> the version i pasted works though if you use a sep overload |
04:24:19 | leorize | yea, that's how you should do it... |
04:26:22 | FromGitter | <yyyc514> well i did learn a bit about macros though, lol |
04:29:39 | leorize | if 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:28 | FromGitter | <yyyc514> actual n isn’t liternal :) |
04:37:33 | FromGitter | <yyyc514> but that’s nice to know |
04:48:59 | FromGitter | <yyyc514> is there anyway to do postfix macros? |
04:49:10 | FromGitter | <yyyc514> like `delete_file() unless protected()` |
04:49:36 | FromGitter | <yyyc514> i need the delete_file() portion to scope it inside an if |
04:52:41 | leorize | you mean an infix macro instead? |
04:52:57 | FromGitter | <yyyc514> i dunno, i want to write code like exactly what i just pasted |
04:53:02 | FromGitter | <yyyc514> with the condition at the END |
04:53:08 | FromGitter | <yyyc514> ruby style :) |
04:53:57 | leorize | no that's not possible :P |
04:54:01 | leorize | unless |
04:54:23 | leorize | you wrap the entire thing in an another macro |
04:54:38 | leorize | `rubyStyle: delete() unless protected()` :P |
04:54:42 | FromGitter | <yyyc514> rofl |
04:54:53 | FromGitter | <yyyc514> right because then you can just have your own language happening up in there |
04:55:36 | leorize | or just do it the nim way... |
04:55:40 | leorize | or you can use crystal lol |
04:59:34 | FromGitter | <yyyc514> lol |
04:59:43 | FromGitter | <yyyc514> nim seem way faster than crystal but i haven’t looked at crystal ina while |
04:59:48 | FromGitter | <yyyc514> lot to like about nim |
05:03:44 | FromGitter | <yyyc514> hmmm |
05:03:48 | FromGitter | <yyyc514> you could make it a guard: |
05:04:07 | FromGitter | <yyyc514> the default parser gets confused witht he grammer though so you’d have to start really parsing by hand |
05:04:18 | FromGitter | <yyyc514> it thinks “false unless …” is some kind of expression |
05:18:55 | FromGitter | <yyyc514> sons: seq[NimNode] |
05:18:58 | FromGitter | <yyyc514> why not daughters? :) |
05:20:49 | * | rnrwashere quit () |
05:24:20 | FromGitter | <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:37 | FromGitter | <yyyc514> why is findChild a template? |
05:47:07 | FromGitter | <rayman22201> everyone is asleep apparently lol. Because findChild is just sugar around a for loop and an if statement? |
05:47:38 | FromGitter | <rayman22201> https://github.com/nim-lang/Nim/blob/master/lib/core/macros.nim#L1129 |
05:47:42 | FromGitter | <yyyc514> i need a recursive version and tempaltes don’t seem to like that |
05:48:01 | FromGitter | <yyyc514> Error: template instantiation too nested |
05:48:16 | FromGitter | <yyyc514> i only imagine it’s looping forever since it’s a template :) |
05:49:15 | FromGitter | <rayman22201> You can just implement your own version of find child as a recursive proc |
05:49:21 | * | leorize joined #nim |
05:50:19 | FromGitter | <yyyc514> i don’t know how to do the cond: untyped stuff then |
05:50:23 | FromGitter | <yyyc514> would i have to change it to pass in a proc? |
05:51:40 | FromGitter | <rayman22201> yeah, you would have to actually use a concrete value for the cond |
05:51:57 | FromGitter | <yyyc514> surely someone has written some helper libraries for AST manipulation |
05:54:06 | FromGitter | <rayman22201> there is https://github.com/alehander42/breeze or https://nimble.directory/pkg/astpatternmatching |
05:54:11 | FromGitter | <rayman22201> I don't use them though |
05:54:29 | FromGitter | <rayman22201> It's pretty simple to write what you are asking for by hand though |
05:55:35 | FromGitter | <yyyc514> probably, i’m very new to nim :) |
05:57:18 | FromGitter | <rayman22201> hold on. I'm trying to write something to help you out in the nim playground |
06:04:16 | FromGitter | <yyyc514> trying to figure out how to compare ident nodes now |
06:06:39 | FromGitter | <yyyc514> i’m getting something working now with a hard coded conditions |
06:06:44 | FromGitter | <rayman22201> https://nim-lang.org/docs/macros.html#eqIdent |
06:07:14 | FromGitter | <yyyc514> well but it’s comparsing two strings |
06:07:20 | FromGitter | <yyyc514> oh i see :) |
06:07:25 | FromGitter | <yyyc514> overloads |
06:10:39 | FromGitter | <rayman22201> 👍 😎 |
06:12:21 | FromGitter | <yyyc514> proc `[]`*(n: NimNode, i: int): NimNode {.magic: "NChild", noSideEffect.} |
06:12:30 | FromGitter | <yyyc514> magic huh? lol |
06:15:55 | FromGitter | <rayman22201> lol. Yes. Araq the magical compiler god has blessed us mortals with certain functions |
06:20:41 | FromGitter | <yyyc514> no easy way to get parent nodes? |
06:22:59 | leorize | why would you need the parent nodes? |
06:23:15 | FromGitter | <yyyc514> node.parent.delete(node) |
06:23:48 | leorize | seriously, why would you ever need to do that? |
06:23:59 | FromGitter | <yyyc514> rewriting the AST |
06:24:04 | leorize | since you construct the ast yourself, you should already got hold of the parent, no? |
06:24:19 | FromGitter | <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:24 | FromGitter | <yyyc514> well the AST is flowing in from a block |
06:24:39 | FromGitter | <yyyc514> but yeah i can save the parent when i iterate over it |
06:25:09 | FromGitter | <rayman22201> The AST is approximately immutable inside macros. You have to make a copy |
06:25:26 | FromGitter | <rayman22201> because other code in the runtime can still be pointing to those AST nodes |
06:25:50 | FromGitter | <yyyc514> this is all in a macro at compile time |
06:26:16 | FromGitter | <yyyc514> if it doesn’t work i think saw some code for a deep copy somewhere |
06:26:26 | FromGitter | <rayman22201> you need to do deep copy |
06:26:29 | FromGitter | <rayman22201> there is no other wya |
06:26:31 | FromGitter | <rayman22201> way |
06:26:39 | leorize | ofc, unless you own that ast... |
06:26:49 | leorize | which seems to be the case here |
06:27:01 | FromGitter | <yyyc514> yeah, i’d think so :) |
06:27:09 | FromGitter | <yyyc514> but again i’m new |
06:27:22 | FromGitter | <yyyc514> it’s coming straight into macro and then i presume the emitted AST is what gets compiled |
06:27:37 | leorize | no worries, just make sure you explain what you're trying to do :) |
06:28:50 | FromGitter | <yyyc514> trying to see how har it would be to get a guards: macro that allows postfix if/unless notation :) |
06:29:07 | leorize | ps: really hard :P |
06:29:07 | FromGitter | <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:13 | FromGitter | <yyyc514> i’m not so sure |
06:29:38 | FromGitter | <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:32 | FromGitter | <rayman22201> https://gist.github.com/rayman22201/cff1d8da2fa92dc5c11ad837567e4640 |
06:33:31 | FromGitter | <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:44 | FromGitter | <yyyc514> thanks but does nil actually work? |
06:34:16 | FromGitter | <yyyc514> i’m using `if res.kind != nnkNilLit:` in mine |
06:34:26 | FromGitter | <yyyc514> since that’s the default node if your don’t init it |
06:34:42 | leorize | yes, since this is a function call |
06:34:43 | leorize | not macro |
06:34:51 | FromGitter | <rayman22201> bingo |
06:42:05 | FromGitter | <yyyc514> (res, _) = findUnless(c) |
06:42:08 | FromGitter | <yyyc514> so no _ yet? |
06:42:11 | FromGitter | <yyyc514> i thought i saw it somewhere |
06:43:58 | FromGitter | <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:35 | FromGitter | <yyyc514> contentious eh? |
06:46:44 | FromGitter | <rayman22201> I have to go to bed now. Good look @yyyc514! macros are fun :) |
06:46:50 | FromGitter | <yyyc514> thanks! |
06:49:06 | FromGitter | <yyyc514> oh i might have to build a whoel tree anyways |
06:49:11 | FromGitter | <yyyc514> del doesn’t seem to modify the tree in place |
06:49:20 | FromGitter | <rayman22201> see here for some of the "contentious" debates lol: https://github.com/nim-lang/Nim/issues/8649 |
06:49:28 | FromGitter | <rayman22201> ok, going to bed for real now! |
06:49:32 | FromGitter | <yyyc514> night thanks! |
06:56:04 | FromGitter | <yyyc514> little confused though since i thought all NimNodes were just pointers |
06:56:06 | FromGitter | <yyyc514> /refs |
06:56:48 | leorize | all NimNode are `ref`s |
06:57:12 | leorize | you don't want to copy the entire tree anywhere, do you? |
06:57:21 | FromGitter | <yyyc514> `(res, par) = findUnless(blk); del(par, 1)` has no effect on blk it seems |
06:57:40 | FromGitter | <yyyc514> i can if that’ll magically make it work :) |
06:59:32 | FromGitter | <yyyc514> `var extra = copy(blk)` |
06:59:35 | FromGitter | <yyyc514> same behavior |
07:00:29 | leorize | I think you should build the entire tree from scratch :P |
07:01:44 | FromGitter | <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:49 | FromGitter | <yyyc514> so if they are all pointers why would deleting a part of the tree not be visible everywhere? |
07:53:40 | leorize | magic, really |
07:53:48 | leorize | can you write a small case? I'm curious |
07:55:56 | FromGitter | <yyyc514> hmmm can you not push to gists like mini repositories? i thought you could |
07:56:26 | FromGitter | <yyyc514> https://gist.github.com/yyyc514/6f397bb23bcffb2ae341131972a9c094 |
07:57:37 | * | PMunch joined #nim |
07:57:38 | leorize | I hoped for a small test case, really :P |
07:57:48 | FromGitter | <yyyc514> sorry it’s what i got |
07:57:58 | FromGitter | <yyyc514> the portion that matters isn’t large |
08:00:12 | * | abm joined #nim |
08:02:02 | leorize | sorry, I can't really follow your macro |
08:02:27 | FromGitter | <yyyc514> it doesn’t do anything yet just call del and log some stuff |
08:02:39 | FromGitter | <yyyc514> but you see the delete isn’t effective at the top level |
08:02:51 | FromGitter | <yyyc514> echo extra.treeRepr # unmodified |
08:02:56 | FromGitter | <yyyc514> par is modified though |
08:03:24 | FromGitter | <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:34 | leorize | yyyc514: a hidden copy might lurk somewhere... |
08:11:56 | leorize | if you extract the exact node with `[]` operator |
08:12:01 | leorize | assign it to something |
08:12:06 | leorize | then run del on it |
08:12:16 | leorize | it affect the whole tree |
08:12:40 | FromGitter | <yyyc514> but you can’t run del on a NodeObj only a ref Node |
08:13:01 | leorize | hence "hidden" copy |
08:13:12 | FromGitter | <yyyc514> i’m not sure what you’re asking me to change |
08:13:26 | leorize | I'm not telling you to change anything |
08:13:32 | FromGitter | <yyyc514> lol |
08:13:38 | FromGitter | <yyyc514> thanks! ;-) |
08:13:41 | leorize | it's just that findUnless somehow copy things |
08:14:22 | FromGitter | <yyyc514> it’s just returning NimNodes which are all refs |
08:16:41 | leorize | and uh, you do notice there's `len()` for NimNode right? |
08:16:53 | leorize | you don't have to do the entire `toSeq` thing... |
08:17:03 | FromGitter | <yyyc514> ha, that’d help :) |
08:17:25 | FromGitter | <yyyc514> nice improvement :) |
08:20:30 | PMunch | Hmm, what is `strVal` in the macros module used for. I can't get it to work like I would expect it to |
08:20:59 | leorize | it's used to get a string representation of the node afaik |
08:22:13 | PMunch | It doesn't seem to work though.. |
08:22:26 | PMunch | I can get a string representation if I do toStrLit().strVal() |
08:24:01 | leorize | I don't think all kind of nodes have strVal |
08:31:31 | * | leorize1 joined #nim |
08:32:09 | leorize1 | yyyc514: 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:46 | PMunch | Hmm, why is callsite deprecated? |
08:39:18 | FromGitter | <andreaferretti> a quick question for those familiar with the compiler |
08:39:28 | FromGitter | <andreaferretti> I am trying to debug something |
08:39:34 | FromGitter | <andreaferretti> I used to be able to do |
08:39:50 | FromGitter | <andreaferretti> `if n.info ?? "somemodule.nim"` |
08:40:01 | FromGitter | <andreaferretti> as suggested in https://nim-lang.org/docs/intern.html |
08:40:12 | FromGitter | <andreaferretti> but if I do that now I get the error |
08:40:47 | FromGitter | <andreaferretti> `type mismatch: got <TLineInfo, string>` |
08:40:49 | * | TheLemonMan joined #nim |
08:40:58 | FromGitter | <andreaferretti> `but expected one of: ` |
08:41:07 | FromGitter | <andreaferretti> `proc `??`(conf: ConfigRef; info: TLineInfo; filename: string): bool` |
08:41:12 | TheLemonMan | andreaferretti, use `??`(config, n.info, "string") |
08:41:26 | FromGitter | <andreaferretti> the point is - where do I find a config? |
08:41:50 | FromGitter | <andreaferretti> I have a context, a node and not much more |
08:41:53 | FromGitter | <andreaferretti> I am inside |
08:41:54 | FromGitter | <andreaferretti> `proc semParamList(c: PContext, n, genericParams: PNode, s: PSym) =` |
08:41:55 | leorize | either `newConfigRef()` or use one in your context |
08:42:06 | TheLemonMan | p.graph.config |
08:42:23 | TheLemonMan | err, I meant c.graph.config |
08:42:38 | FromGitter | <andreaferretti> ok thanks! |
08:42:58 | FromGitter | <andreaferretti> (the docs should be updated if anyone more knowledgeable than me finds some time) |
08:46:02 | leorize | yyyc514: looks like a transparent copy happen when you pass a NimNode to a proc |
08:47:41 | leorize | actually, nvm |
08:56:25 | * | floppydh joined #nim |
08:58:51 | FromGitter | <alehander42> @PMunch strVal is only for nnkStrLit and similar I think |
08:59:16 | FromGitter | <alehander42> at least it's used in the compiler repr of those nodes |
08:59:25 | FromGitter | <alehander42> not sure about the macros, always used repr there |
09:00:06 | FromGitter | <alehander42> something else could do what callsite can iirc |
09:00:20 | PMunch | alehander42, the documentation for strVal is super confusing then.. |
09:00:45 | PMunch | And I tried to figure out what repr did behind the scenes because that's what I normally use as wel |
09:01:22 | FromGitter | <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:45 | FromGitter | <alehander42> @PMunch I remember intLit had intVal etc |
09:03:16 | TheLemonMan | xxxVal macros extract the value of type xxx from ntyxxxLit nodes |
09:03:44 | FromGitter | <alehander42> ah yeah look at the "fake" definition in the docs |
09:03:49 | FromGitter | <alehander42> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc06375e65a634336c5c8c8] |
09:03:52 | TheLemonMan | then there's `$` for NimNode and repr of course |
09:04:00 | FromGitter | <alehander42> it's actually a magic afaik |
09:04:28 | FromGitter | <alehander42> so actually all of those are accessors, not fields |
09:06:05 | FromGitter | <alehander42> `$` for NimNode is worthless in general |
09:06:21 | FromGitter | <yyyc514> indeed |
09:06:30 | FromGitter | <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:19 | FromGitter | <vinodvinu> How to use choosenim ? |
09:30:50 | FromGitter | <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:33 | FromGitter | <mratsim> choosenim stable or choosenim devel or choosenim 0.18.0 |
09:33:00 | FromGitter | <mratsim> `treerepr`> `repr` in macros ;) |
09:33:36 | FromGitter | <vinodvinu> do i need to add choosenim path in PATH ? |
09:33:45 | FromGitter | <vinodvinu> if so which directory |
09:34:49 | FromGitter | <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:51 | FromGitter | <vinodvinu> Actually, i just want to update from nim 0.18 to nim 0.19. |
09:35:21 | PMunch | choosenim update stable |
09:35:48 | FromGitter | <narimiran> PMunch: his original 0.18 nim was not installed via choosenim |
09:36:01 | FromGitter | <vinodvinu> @narimiran choosenim's installation story was a horrible one |
09:36:23 | FromGitter | <vinodvinu> I didnt get enough info from the github page |
09:36:40 | PMunch | narimiran[m], ah, then purge that install and `choosenim stable` |
09:36:40 | FromGitter | <alehander42> @mratsim perfect people dont need any repr :D |
09:36:56 | FromGitter | <narimiran> @vinodvinu my experience was completely opposite. :/ |
09:37:17 | FromGitter | <vinodvinu> Actually do i need this choosenim in order to get the latest nim version ? |
09:37:40 | PMunch | vinodvinu, you don't need it per se, but it's highly recommended |
09:37:43 | FromGitter | <vinodvinu> Everybody says that 0.19 is good but i am confused |
09:37:46 | FromGitter | <mratsim> you don’t, but it’s easier imo, though I don’t know about windows |
09:37:48 | PMunch | Much easier to update in the future |
09:37:54 | FromGitter | <narimiran> @vinodvinu you need it to make your life easier in the long run |
09:38:32 | FromGitter | <vinodvinu> Ok, to upgrade nim 0.19, do i need to un install nim 0.18 first ? |
09:38:43 | PMunch | vinovinu, why was the installation so difficult? Not on Windows myself but the install instructions seems easy enough |
09:39:14 | FromGitter | <mratsim> choosenim can install both side by side |
09:39:15 | FromGitter | <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:22 | PMunch | viovinu, 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:16 | FromGitter | <narimiran> i have installed nim via choosenim on windows before, and there weren't any problems |
09:40:42 | FromGitter | <vinodvinu> Ok thank you guys. The problem is, i am expecting this programs (choosesnim in this case) to add path in PATH |
09:40:57 | FromGitter | <mratsim> it should |
09:41:04 | FromGitter | <vinodvinu> but now i know that its my responsibility |
09:41:21 | FromGitter | <mratsim> I’m pretty sure one of the script maybe finish.exe is doing that |
09:42:07 | FromGitter | <vinodvinu> In my PC, i installed nim 0.19 manually . That PC had nim 0.18 |
09:42:50 | FromGitter | <vinodvinu> I expect nim installation would add path to PATH automatically but it didnt |
09:42:53 | PMunch | mratsim, the script tells you to add it to your path |
09:43:12 | PMunch | So I don't thin kit does so automatically |
09:43:16 | FromGitter | <narimiran> @mratsim i think choosenim does not do it automatically, but it guides you with the exact steps you need to follow |
09:43:23 | FromGitter | <mratsim> ah, windows :P |
09:44:01 | FromGitter | <vinodvinu> All windows programs which needs PATH would add their paths in to PATH |
09:44:37 | FromGitter | <vinodvinu> but programmers from linux or mac wont add that feature in their code |
09:45:15 | FromGitter | <mratsim> they |
09:45:18 | FromGitter | <mratsim> they do |
09:45:36 | FromGitter | <vinodvinu> Basically, in windows, we love to double clicking an exe file and watch the play |
09:45:49 | FromGitter | <mratsim> programs will add a line in ~/.bashrc $PATH=$PATH;./nimble/bin |
09:46:41 | * | platoff joined #nim |
09:47:28 | FromGitter | <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:37 | PMunch | vinovinu, 1) Remove all old versions of Nim 2) Install choosenim 3) Use choosenim to install Nim and Nimble |
09:49:12 | FromGitter | <vinodvinu> Oh , please choosenim is horrible i think |
09:49:42 | FromGitter | <vinodvinu> Anyway, i will try |
09:50:00 | FromGitter | <vinodvinu> Thanks for the help @PMunch |
09:50:20 | FromGitter | <vinodvinu> And thanks @mratsim & @narimiran |
09:50:29 | TheLemonMan | rustup updates the PATH on both Windows and Leenox (and OSX too) with relatively little effort |
09:50:32 | TheLemonMan | https://github.com/rust-lang-nursery/rustup.rs/blob/f546c2bd8e496e23348c2b2c3d97c85470a5af88/src/rustup-cli/self_update.rs#L1190,L1268 |
09:50:54 | FromGitter | <kayabaNerve> Choosenim is great IMO |
09:51:09 | FromGitter | <vinodvinu> Ha ha thats good thing about rustup |
09:51:36 | FromGitter | <vinodvinu> But choosenim want user to do partial job |
09:52:42 | FromGitter | <vinodvinu> BTW, nimble will installed automatically when i install nim 0.19 ? |
09:52:50 | TheLemonMan | yep |
09:53:11 | FromGitter | <vinodvinu> Ok thats enough. Nimble is simple and i love it. |
09:53:36 | FromGitter | <vinodvinu> Everything is explained very well in the github page |
09:54:11 | FromGitter | <vinodvinu> But choosenime is not documented as nimble |
09:54:34 | TheLemonMan | this is the perfect chance to become a contributor! |
09:55:11 | FromGitter | <vinodvinu> Yeah, i know and my first contibution is getting ready for the release. |
09:56:14 | FromGitter | <vinodvinu> But all my work is related to windows |
09:56:52 | FromGitter | <vinodvinu> My biggest hurdle was understand and learn stuff in nim |
09:57:28 | TheLemonMan | then this may also be a good chance to implement the automatic PATH update mechanism for windows :) |
09:58:29 | FromGitter | <vinodvinu> Well, thats in my plan, BTW, does asking help is turning to DIY here ? |
09:58:55 | FromGitter | <vinodvinu> I mean, if you ask for something, then create it and enjoy it |
10:00:12 | FromGitter | <vinodvinu> If i ask about any feature about nim, then people will say that to create a language from scratch |
10:02:16 | FromGitter | <vinodvinu> @TheLemonMan, Its my luck that you didnt tell me to create something like choosenim. |
10:09:39 | TheLemonMan | that'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:18 | TheLemonMan | and since the Hacktoberfest is going strong people may be even more interested in contributing |
10:10:34 | FromGitter | <vinodvinu> This is the problem of talking in electronic media. I can't see the expressions. |
10:11:15 | FromGitter | <vinodvinu> Anyway no offence. I am here for knowledge. Only knowledge. |
10:12:19 | TheLemonMan | indeed, I added a :) in order to convey it was not a "DIY or fuck off" response |
10:13:26 | TheLemonMan | no offense taken ofc, I hope you'll enjoy the 0.19 version |
10:13:34 | FromGitter | <vinodvinu> Ha ha.. I am sorry if my words hurt you. |
10:14:08 | FromGitter | <vinodvinu> Installation is the big hurdle and now i am doing it with choosenim. |
10:14:31 | FromGitter | <vinodvinu> We in windows expects everything as an exe file. |
10:14:56 | FromGitter | <vinodvinu> So we as programmers in windows, we like to upload everthing as exe also |
10:15:08 | FromGitter | <vinodvinu> Thats why i came to nim. |
10:15:35 | FromGitter | <vinodvinu> Because in Python, i need an extra program to make exe |
10:17:08 | FromGitter | <vinodvinu> The most easiest language in windows is vb.net but i hate framework dependancy. |
10:18:05 | TheLemonMan | I wholeheartedly agree, a single .exe is the best deployment solution for Windows (considering both platform and the average user base) |
10:18:06 | FromGitter | <vinodvinu> Then there is a lot of scripting langs and other programming langs but none of them are interesting |
10:18:58 | TheLemonMan | too many times I had to ship a small py file and a long list of instructions on how to run it |
10:19:30 | FromGitter | <vinodvinu> Ha ha |
10:20:26 | FromGitter | <vinodvinu> FBSL was a good scripting language in windows but it died. |
10:21:01 | copygirl | Is 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:47 | TheLemonMan | copygirl, 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:22 | copygirl | It mentions a DSL but can it use .schema.json too? |
10:22:31 | TheLemonMan | oh, _that_ json schema, I guess not |
10:23:13 | FromGitter | <kayabaNerve> TheLemonMan Are you LemonBoy on GH? |
10:23:30 | TheLemonMan | kayabaNerve, yep |
10:23:41 | FromGitter | <kayabaNerve> What's your OS |
10:24:07 | TheLemonMan | linux x64 |
10:24:33 | FromGitter | <kayabaNerve> Thanks for the validation. |
10:24:46 | TheLemonMan | you said you're on windows... can you get a better idea of where the crash happens using a debugger? |
10:24:54 | FromGitter | <vinodvinu> Oh you are the lemonby ! I have heard about the hard work you have done in latest nim release |
10:25:02 | FromGitter | <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:06 | TheLemonMan | (I guess you're asking about the threadvar Channel issue) |
10:25:09 | FromGitter | <vinodvinu> sorry "lemonboy" - typo |
10:25:10 | FromGitter | <kayabaNerve> Yeah |
10:26:13 | FromGitter | <kayabaNerve> Give me a sec |
10:26:34 | TheLemonMan | vinodvinu, we all worked hard in order to make Nim even more pleasant :) |
10:26:54 | FromGitter | <kayabaNerve> My main curiosity is the fact it doesn't even run the first echo |
10:26:58 | FromGitter | <yyyc514> why should code inside a macro generate compile errors if the macro isn’t emitting an AST? |
10:27:06 | FromGitter | <yyyc514> shouldn’t pretty much any syntax fly? |
10:27:39 | TheLemonMan | kayabaNerve, the threadvars are initialized in the init section |
10:28:00 | FromGitter | <yyyc514> i think the parser just really hates prefixed conditionals :) |
10:28:06 | FromGitter | <vinodvinu> @TheLemonMan, |
10:28:40 | FromGitter | <vinodvinu> You guys are amazing. You made programming an easy job |
10:29:19 | FromGitter | <kayabaNerve> ```code paste, see link``` ⏎ ⏎ GDB [https://gitter.im/nim-lang/Nim?at=5bc0777fe65a634336c65f03] |
10:29:47 | FromGitter | <yyyc514> yikes |
10:29:56 | FromGitter | <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:02 | TheLemonMan | kayabaNerve, get a backtrace with `bt` |
10:30:16 | FromGitter | <kayabaNerve> Why the hell does it not even print `echo` though? 0_0 Computers are weird. |
10:30:22 | FromGitter | <kayabaNerve> TLM: I do know that command. |
10:30:36 | FromGitter | <kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc077cb271506518dfbf17b] |
10:30:53 | FromGitter | <kayabaNerve> I didn't compile with --debugInfo or --debugger:native but can recompile if you want. |
10:34:25 | TheLemonMan | hmm, can you upload the generated C file somewhere? |
10:35:11 | FromGitter | <kayabaNerve> Gist or pastebin? |
10:35:14 | FromGitter | <kayabaNerve> Or some other? |
10:35:32 | TheLemonMan | everything but pastebin is fine |
10:36:00 | FromGitter | <kayabaNerve> https://pastebin.com/TQJSRBKj |
10:37:43 | FromGitter | <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:17 | Araq | TheLemonMan: are you familiar with dataflow analysis algorithms? |
10:40:33 | TheLemonMan | Araq, not really, I've only dabbled with CFA algorithms (and even then only with the kCFA family) |
10:41:00 | Araq | what's that, control flow analysis? |
10:41:51 | TheLemonMan | yep, it was in order to approximate the types in scheme programs |
10:43:24 | * | enthus1ast joined #nim |
10:44:56 | TheLemonMan | kayabaNerve, try compiling with -t:-g (don't know if --debugger:native does the same) |
10:45:21 | enthus1ast | what is your preferred way to enshure byte endianess when defining a network protocol? |
10:46:12 | * | dddddd joined #nim |
10:48:58 | enthus1ast | or 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:21 | FromGitter | <yyyc514> (https://files.gitter.im/nim-lang/Nim/Ezp0/carbon.png) |
10:50:23 | FromGitter | <yyyc514> thoughts on syntax? |
10:51:06 | enthus1ast | this will fail when one machine is big endian and the other is little endian right? |
10:51:20 | Araq | as an exercise in macros this is fine, yyyc514. |
10:51:39 | Araq | I'd never use it in production code though |
10:51:54 | TheLemonMan | enthus1ast, check out the endians module and make sure you convert all the numeric fields to either BE or LE |
10:51:56 | FromGitter | <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:18 | Araq | "unless" is just pointless sugar IMO |
10:52:19 | ryuo | enthus1ast: there's even a socket ABI for unsigned short/long for this purpose. |
10:52:29 | ryuo | enthus1ast: API* |
10:52:38 | FromGitter | <yyyc514> I’m spoiled by ruby’s plain english :) |
10:52:48 | Araq | plus I don't enjoy control flow that lies |
10:53:06 | Araq | clearly the condition needs to be evaluated before the corresponding action |
10:53:36 | ryuo | enthus1ast: htons, htonl, etc. |
10:53:39 | FromGitter | <yyyc514> i was just trying to think of a better work than given :) |
10:53:53 | FromGitter | <yyyc514> not argueing the merits of the approach, which obviously people can disagree on :) |
10:54:22 | ryuo | enthus1ast: 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:30 | ryuo | enthus1ast: this is how ELF format does it. |
10:54:45 | FromGitter | <yyyc514> when is also a reserved word |
10:54:52 | enthus1ast | so 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:59 | Araq | "buy an umbrella if it will rain tomorrow" |
10:55:05 | FromGitter | <alehander42> i think there was an interesting dbc lib https://github.com/Udiknedormin/NimContracts |
10:55:09 | ryuo | enthus1ast: something must, yes. |
10:55:14 | enthus1ast | ok |
10:55:16 | FromGitter | <alehander42> not the same as guards, but probably interesting for people interested in them |
10:55:24 | enthus1ast | thank you |
10:55:25 | ryuo | enthus1ast: how you handle it is up to you. |
10:55:43 | ryuo | enthus1ast: this applies not just to networks but also files. |
10:56:08 | ryuo | enthus1ast: amusingly though, single byte data chunks are immune to this issue. |
10:56:26 | enthus1ast | so i could just use strings everywhere? :) |
10:56:31 | FromGitter | <kayabaNerve> Is it objects or just ints? |
10:56:31 | FromGitter | <yyyc514> ah yeah this is neat |
10:56:54 | enthus1ast | objects |
10:57:54 | enthus1ast | its funny, i've naively written a lot of network programs withouth considering this |
10:58:00 | FromGitter | <kayabaNerve> TheLemonBoy ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc07e38271506518dfc1dda] |
11:00:00 | TheLemonMan | if we're both getting the same stdlib_system.c you're hitting the raiseOutOfMem handler |
11:01:35 | ryuo | enthus1ast: you could, i'm just saying some data is naturally immune. |
11:01:37 | FromGitter | <kayabaNerve> Need me to upload that? |
11:03:06 | FromGitter | <kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc07f691c100a4f2972b429] |
11:03:11 | FromGitter | <kayabaNerve> The last line in that is 1517 |
11:03:17 | enthus1ast | ok thank you for clearing this up |
11:05:04 | Araq | https://gist.github.com/Araq/6bb3b253c6ac6c0a27e61ae36d65f1d7 who can prove this algorithm correct? :P |
11:05:18 | FromGitter | <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:27 | Araq | and it likely isn't... |
11:06:00 | FromGitter | <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:14 | Araq | "for all paths ..." is such a hard condition to implement :P |
11:06:18 | * | PMunch quit (Ping timeout: 245 seconds) |
11:08:00 | TheLemonMan | kayabaNerve, maaaaaybe you're hitting the critical section before InitializeCriticalSection is called |
11:08:48 | FromGitter | <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:03 | FromGitter | <kayabaNerve> Oh. |
11:09:17 | FromGitter | <kayabaNerve> I lied. GDB gave slightly different output when it was just the var decl |
11:09:35 | FromGitter | <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:48 | TheLemonMan | I have no debugger nor 8-ball, that's my best guess by looking at the generated code and the backtrace |
11:11:32 | TheLemonMan | the 'maaaaaybe' was because of that, today I'm being misunderstood by everyone heh |
11:11:47 | FromGitter | <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:50 | FromGitter | <alehander42> @Araq is that the lastReadOf from the destructors proposal? |
11:12:58 | Araq | yes |
11:14:24 | FromGitter | <kaushalmodi> TheLemonMan: how would rustup update the PATH? |
11:14:41 | FromGitter | <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:47 | Araq | finish.exe does PATH updates on Windows, you can just steal the code. |
11:14:57 | FromGitter | <kaushalmodi> I have it installed and I don't remember it messing with my .bashrc or anything to update the PATH. |
11:15:13 | Araq | narimiran: fix them and add some timings so that we notice performance regressions |
11:15:16 | TheLemonMan | kaushalmodi, I've pasted a link to its source code |
11:15:22 | TheLemonMan | gtg |
11:15:24 | * | TheLemonMan quit (Quit: "It's now safe to turn off your computer.") |
11:15:30 | FromGitter | <kaushalmodi> PATH is a user config env var, no app should update it transparently. |
11:15:37 | Araq | that was the idea anyway, problem is, these benchmarks are not typical Nim code |
11:16:12 | Araq | kaushalmodi: installers ask about it before they go on and change it |
11:16:17 | FromGitter | <narimiran> hm, okay, i'll see what i can do (and how to measure those reliably) |
11:17:27 | Araq | it's probably a lost cause with the CIs and their unpredictable VMs |
11:17:43 | FromGitter | <kayabaNerve> TLM: I know :P Just joking a bit. |
11:18:12 | * | PMunch quit (Ping timeout: 244 seconds) |
11:18:21 | Araq | btw I need to tell you about my revolution in computing |
11:18:38 | Araq | PATH=/programs/*/bin |
11:19:01 | Araq | programs can stay in their own directory and no path modifications are required |
11:20:24 | FromGitter | <narimiran> yeah, that unpredictability is why i'm asking why do we even have those "tests" |
11:20:44 | FromGitter | <kaushalmodi> TheLemonMan: I didn't see a link. |
11:21:18 | Araq | but 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:36 | FromGitter | <alehander42> @kaushalmodi eh everything is "user configuration", let the program set my PATH or at least ask me to, thanks |
11:21:39 | Araq | this is all so fucked up... |
11:22:06 | FromGitter | <alehander42> what does usr bin have to do with version management |
11:23:29 | FromGitter | <kaushalmodi> @alehander42 what OS are you on? I think it's a norm on Windows to let apps update the PATH. |
11:23:52 | Araq | everything IMO. the package manager's job is mostly to manage this /usr/bin madness |
11:24:28 | Araq | it's true that it does much more than that but that was the primary motivation for its existance |
11:26:24 | FromGitter | <kayabaNerve> when AraqOS |
11:27:05 | FromGitter | <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:07 | FromGitter | <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:02 | Araq | sorry what? |
11:28:11 | * | platoff quit (Read error: Connection reset by peer) |
11:28:20 | * | platoff joined #nim |
11:29:04 | FromGitter | <alehander42> @Araq `if c.g[pc].sym == s:` i need a paper and pencil to follow the variables in this code .. |
11:30:17 | FromGitter | <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:38 | FromGitter | <vinodvinu> How to print the nim version ? I mean not in cmd. In our code |
11:30:42 | FromGitter | <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:01 | Araq | nah, tissues.nim is fine |
11:31:25 | Araq | and yeah, test cases named after issue numbers are usually tests nobody cares about :-) |
11:31:31 | Araq | (as long as they stay green, ofc) |
11:31:48 | Araq | echo system.NimVersion |
11:32:01 | FromGitter | <narimiran> ok, i'll push it then, thanks |
11:32:02 | FromGitter | <vinodvinu> Thanks Araq :) |
11:34:06 | Araq | alehander42: it becomes clear when you think about the mutability aspects |
11:34:40 | Araq | 'move b' needs to empty the 'b' afterwards but usually 'b' is not an lvalue |
11:35:48 | Araq | so the design is careful about not turning everything into an lvalue or 'var T' parameters |
11:42:42 | * | leorize joined #nim |
11:46:09 | FromGitter | <vinodvinu> How to change the nim compiler in VS Code ? any help ? |
11:46:24 | FromGitter | <vinodvinu> Currently it is 0.18 |
11:46:33 | FromGitter | <vinodvinu> But i want to use nim 0.19 |
11:46:41 | FromGitter | <narimiran> @vinodvinu did you install it via choosenim? |
11:47:02 | FromGitter | <vinodvinu> Yes. and my choosenim says that already switched to 0.19 |
11:47:40 | leorize | is it in your `PATH`? |
11:48:05 | FromGitter | <bung87> if you can build it https://github.com/bung87/vscode-nim |
11:49:12 | FromGitter | <bung87> (https://files.gitter.im/nim-lang/Nim/tDbf/Screen-Shot-2018-10-12-at-7.48.41-PM.png) |
11:49:29 | FromGitter | <vinodvinu> @leorize, Only nimble path is in PATH |
11:49:35 | FromGitter | <vinodvinu> C:\Users\TransLap_W10\.nimble\bin |
11:50:47 | FromGitter | <bung87> (https://files.gitter.im/nim-lang/Nim/Ka8b/Screen-Shot-2018-10-12-at-7.50.22-PM.png) |
11:50:56 | FromGitter | <bung87> will give you a switch |
11:51:57 | FromGitter | <vinodvinu> Since, english is not my first language, can you please elaborate it a little bit |
11:52:19 | FromGitter | <vinodvinu> I mean What to do step 1 and 2 and etc |
11:52:37 | FromGitter | <bung87> yeah not my native language though. |
11:53:06 | FromGitter | <bung87> a swich at vscode status bar -> click -> popup a menu for you choice. |
11:54:33 | FromGitter | <vinodvinu> I am confused |
11:54:52 | FromGitter | <vinodvinu> All i want to change the compiler |
11:55:04 | FromGitter | <vinodvinu> But code-runner is the extension |
11:55:05 | FromGitter | <bung87> I mean you build the extension by yourself |
11:55:51 | FromGitter | <vinodvinu> OMG So i can't change it in my current code-runner extension ? |
11:56:37 | FromGitter | <bung87> well, if you use the code-runner, I could say you have many choice do same work. |
11:56:56 | Araq | download 0.19 from the website, run finish.exe, done |
11:56:56 | FromGitter | <vinodvinu> Ok |
11:57:16 | Araq | uninstall 0.18 first |
11:57:30 | FromGitter | <vinodvinu> Its not programs list |
11:57:36 | FromGitter | <vinodvinu> Then how do i uninstall |
11:57:47 | FromGitter | <vinodvinu> I am completely struck |
11:57:50 | Araq | just delete the directory you've put it in |
11:58:29 | FromGitter | <vinodvinu> Ok, But i think PATH variable is the problem. |
11:59:30 | FromGitter | <bung87> em , you just need read the extension document. |
11:59:37 | FromGitter | <vinodvinu> Then what is the job of choosenim ? |
11:59:54 | Araq | it works well on Not-Windows I've been told |
11:59:56 | FromGitter | <vinodvinu> I told it to "choosenim stable" |
11:59:59 | FromGitter | <bung87> there’s Configuration section for runner |
12:00:12 | FromGitter | <vinodvinu> It says that it already switched |
12:00:19 | FromGitter | <bung87> `"php": "C:\\php\\php.exe",` |
12:00:22 | FromGitter | <vinodvinu> Switched what ? |
12:00:38 | Araq | choosenim doesn't set the PATH for you afaik |
12:01:01 | FromGitter | <vinodvinu> Ok, then what is it doing ? |
12:01:04 | FromGitter | <bung87> I cant follow you,`choosenim stable` does not make affect to extension. |
12:01:35 | FromGitter | <vinodvinu> Ok, @bung87 then what is the keyword to change the nim version in choosenim |
12:01:36 | FromGitter | <bung87> the extension know nothing about you command |
12:02:11 | FromGitter | <bung87> https://marketplace.visualstudio.com/items?itemName=formulahendry.code-runner |
12:02:17 | Araq | VSCode uses the PATH, if you changed the PATH, you likely have to restart it |
12:02:30 | FromGitter | <bung87> you just need read carefully Configuration section |
12:02:51 | FromGitter | <vinodvinu> @Araq OK. let me try |
12:03:30 | FromGitter | <bung87> it’s only depends on how the code-runner implemented. |
12:04:15 | FromGitter | <vinodvinu> I think PATH is the problem. Let me explain ; ⏎ I have only nimble path is in PATH |
12:04:40 | FromGitter | <vinodvinu> So i think i need to enter nim path also |
12:06:25 | FromGitter | <bung87> all extension do same work just need to know your exec path, whether by PATH or config file. |
12:08:35 | FromGitter | <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:45 | FromGitter | <vinodvinu> But nim path is not in PATH and still VS code is working with nim 0.18 |
12:09:39 | FromGitter | <bung87> well , that’s because all these extension trying to get nim.exe from PATH by default. |
12:10:42 | FromGitter | <bung87> that would make the extension work at startup,and provide config when you ready for chose a exe path. |
12:10:57 | FromGitter | <vinodvinu> C:\Nim in C\nim-0.19.0_x32\bin |
12:11:06 | FromGitter | <vinodvinu> Is it enough for the PATH |
12:12:23 | FromGitter | <bung87> if you have multiple version , it will use the first it get |
12:13:37 | FromGitter | <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:02 | FromGitter | <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:24 | FromGitter | <bung87> so you need read the extension document. that’s all. |
12:14:59 | FromGitter | <vinodvinu> At last success !!! |
12:15:07 | FromGitter | <vinodvinu> It printed 0.19.0 |
12:15:23 | FromGitter | <vinodvinu> Windows has 2 places for PATH variables |
12:15:35 | FromGitter | <vinodvinu> I just edited at one place only |
12:15:49 | FromGitter | <vinodvinu> Now i entered all placed where i see a PATH |
12:18:18 | FromGitter | <vinodvinu> Thank you @bung87 for your help. I will sure check your extension. |
12:18:39 | FromGitter | <vinodvinu> Hop you will help me to install and use it |
12:21:07 | FromGitter | <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:51 | TheLemonMan | kayabanerve, can you try this patch? https://gist.github.com/LemonBoy/ca5d03d0a8a2298fadf2022d4fc49fdb |
12:39:19 | TheLemonMan | kaushalmodi, 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:38 | Araq | narimiran, yeah |
14:08:16 | Araq | btw the algorithm is not enough, you also need to prove that the 'def x' dominates the 'use x' instruction... |
14:13:49 | FromGitter | <narimiran> thanks, will do it in part 3 :) |
14:25:36 | * | PrimHelios joined #nim |
14:32:54 | * | saintdevUe joined #nim |
14:33:12 | nolan_d | Has 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:30 | nolan_d | I.e. GC, what do you use: --gc:none? --gc:v2? |
14:35:13 | nolan_d | If 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:44 | nolan_d | Also, 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:24 | Araq | nolan_d: I only know some theory |
14:40:27 | * | saintdevUe quit (Remote host closed the connection) |
14:43:51 | nolan_d | type |
14:43:52 | nolan_d | Map = object |
14:43:52 | nolan_d | db: DbConn |
14:44:52 | nolan_d | I create that with `create(Map)`, and trying to set map.db in JS throws a segfault. |
14:45:15 | nolan_d | Am 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:45 | nolan_d | Like just make `Map` a `DbConn` on which I can define procs? |
14:49:15 | Araq | create(Map) is totally not required |
14:50:00 | FromGitter | <alehander42> you can define procs on DbConn itself |
14:51:22 | FromGitter | <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:30 | nolan_d | I'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:02 | nolan_d | And 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:03 | FromGitter | <zacharycarter> is there still work ongoing on the language server protocol implementation for Nim? |
14:58:43 | FromGitter | <kaushalmodi> @PMunch had started some work on it: https://github.com/PMunch/nimlsp |
14:59:04 | FromGitter | <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:04 | FromGitter | <alehander42> @nolan_d why do you need ptr Map ? |
15:00:13 | FromGitter | <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:35 | nolan_d | alehander42: 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:27 | Araq | well 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:38 | nolan_d | Yeah. 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:59 | FromGitter | <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:16 | nolan_d | So maybe there's something broken with allocating a pointer to an SQLite connection and trying to pass that back from JS. |
15:25:19 | nolan_d | I'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:20 | Araq | or: you use emscripten instead, wasm is vaporware |
15:43:56 | FromGitter | <zacharycarter> one issue I ran into w/ emscripten - and the jsbind library - is that event handlers become problematic with the GC |
15:44:10 | FromGitter | <zacharycarter> and maintaining references to them |
15:44:12 | * | cryptokiddS joined #nim |
15:44:32 | FromGitter | <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:02 | FromGitter | <kaushalmodi> leorize: I got openssl to compile on Travis!! |
15:45:20 | leorize | nice |
15:46:03 | * | cryptokiddS quit (K-Lined) |
15:46:11 | leorize | next 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:33 | nolan_d | zacharycarter: js-bind? |
15:48:57 | leorize | kaushalmodi: https://crosstool-ng.github.io/ |
15:49:08 | nolan_d | Araq: What do you mean? I was using Emscripten, at least, using it as the compiler toolchain from Nim. |
15:49:23 | leorize | kaushalmodi: for a potentally friction-less cross tool generation |
15:49:42 | leorize | will probably works better when you starts having to bring in complicated libraries |
15:50:13 | nolan_d | Does 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:42 | FromGitter | <iffy> Is there a builtin way to pop from the front of a sequence? |
15:53:07 | leorize | `s[1..^1]`? |
15:53:11 | FromGitter | <zacharycarter> nolan_d: https://github.com/yglukhov/jsbind |
15:53:23 | FromGitter | <iffy> leorize: will that remove the element? |
15:53:42 | leorize | you're taking a slice without the first element so... |
15:54:18 | * | larstobi joined #nim |
15:55:16 | FromGitter | <iffy> leorize: okay, so no proc that will remove the first element in place. I can handle that |
15:55:31 | FromGitter | <kaushalmodi> leorize: thanks, I have never heard of that (probably this is the very first time I got into binary packaging) |
15:55:34 | nolan_d | Oh, interesting. Does it only work with asm.js or can it work with wasm as well? |
15:55:37 | FromGitter | <kaushalmodi> I have noted that |
15:56:19 | FromGitter | <zacharycarter> nolan_d: I was using in a project that was targetting WASM via emscripten |
15:56:27 | leorize | iffy: There's `delete[T]()` if you want in-place |
15:56:40 | nolan_d | Hmm. |
15:56:46 | FromGitter | <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:56 | Araq | asm.js used to be the more mature toolchain, dunno about the present |
15:57:00 | FromGitter | <zacharycarter> mostly because the pointer to the handler needed to be refd by the GC |
15:57:09 | FromGitter | <zacharycarter> but it was impossible to unref it on the other side of things, once it was no longer needed |
15:58:16 | nolan_d | Yeah, 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:31 | FromGitter | <zacharycarter> why not just go with webview? |
15:58:33 | FromGitter | <zacharycarter> and Nim? |
15:58:41 | FromGitter | <zacharycarter> or CEF? |
15:59:04 | FromGitter | <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:10 | nolan_d | I'm trying to link against native libraries, specifically SpatiaLite. |
15:59:14 | FromGitter | <zacharycarter> I know you said you had issues passing pointers to the MySQL lib or something |
15:59:42 | nolan_d | If that's possible then I'm all for it. :) |
15:59:44 | FromGitter | <zacharycarter> interesting - I've never seen / heard of this lib before but it looks useful |
16:00:23 | FromGitter | <zacharycarter> I figured your hangup was more around the x-platform GUI stuff |
16:00:27 | FromGitter | <zacharycarter> and that's why you wanted electron |
16:00:41 | * | bobdox joined #nim |
16:01:45 | nolan_d | No. 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:25 | FromGitter | <zacharycarter> gotcha |
16:02:58 | FromGitter | <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:16 | nolan_d | And 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:22 | FromGitter | <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:25 | FromGitter | <zacharycarter> hrm |
16:03:29 | FromGitter | <zacharycarter> yeah that's definitely another complication |
16:04:11 | nolan_d | What is CEF? And is WebView an actual project, or just the idea of running the app inside a mobile WebView? |
16:04:26 | FromGitter | <zacharycarter> chromium embedded framework |
16:04:37 | FromGitter | <zacharycarter> https://github.com/zserge/webview |
16:06:58 | FromGitter | <kayabaNerve> CEF is the basis of Electron. WebView is a like CEF but with more quirks and less bloat. |
16:07:24 | nolan_d | Thanks. 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:04 | narimiran | this 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:56 | FromGitter | <kaushalmodi> yes |
16:09:00 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc0c71c271506518dfe84d9] |
16:10:09 | narimiran | now the big question: why CI doesn't mind? |
16:10:46 | FromGitter | <kaushalmodi> may be `g` is somehow getting initialized? |
16:11:08 | FromGitter | <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:30 | leorize | or maybe testament just compile but not run it |
16:16:58 | leorize | narimiran: ^ |
16:17:48 | * | enthus1ast joined #nim |
16:17:48 | narimiran | yeah, 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:29 | FromGitter | <zacharycarter> nolan_d: np - probably a sound approach |
16:27:48 | FromGitter | <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:28 | FromGitter | <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:49 | Araq | wow that's pretty cool |
16:28:51 | * | Trustable joined #nim |
16:29:03 | Araq | that means I can ship Nim binaries to Linux, right? |
16:29:17 | leorize | it's worth pointing out that `-DOPENSSL_NO_SECURE_MEMORY` is being used to build openssl... |
16:29:25 | leorize | hopefully no ill effects :P |
16:29:26 | FromGitter | <kaushalmodi> yes, I have made a note in the README |
16:29:58 | FromGitter | <kaushalmodi> let me raise that note to the top so as not to look like I am masking that |
16:30:20 | Araq | narimiran: https://github.com/nim-lang/Nim/pull/5664 please fix the tester merge conflict and merge this PR |
16:30:31 | FromGitter | <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:17 | narimiran | Araq: you sure that's the correct link? (sizeof-alignof) |
16:31:39 | Araq | yeah, krux02 made it green |
16:31:43 | FromGitter | <mratsim> “less bloat”, more like no bloat at all. webview is a couble bytes at most kB, while CEF/Electron is 200MB |
16:32:02 | narimiran | Araq: ok, will do it |
16:32:10 | Araq | thanks, you're awesome |
16:32:17 | narimiran | :D |
16:33:56 | FromGitter | <kaushalmodi> Araq: I think now choosenim can be statically compiled so that I can finally use it on RHEL 6.8 :P |
16:35:01 | FromGitter | <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:05 | leorize | kaushalmodi: btw https://github.com/kaushalmodi/hello_musl/blob/4e29b1533b3ac8f363d1b77cc49b00f074b20f08/config.nims#L66 |
16:35:16 | leorize | you're missing a `C` in `CC` |
16:35:28 | FromGitter | <kaushalmodi> hmm, but it works |
16:36:26 | FromGitter | <kaushalmodi> but I will fix it, thanks |
16:36:31 | FromGitter | <kaushalmodi> not sure why `C` works |
16:36:42 | leorize | it doesn't |
16:36:48 | leorize | https://travis-ci.org/kaushalmodi/hello_musl/builds/439863716#L618 |
16:37:12 | leorize | just happen that pcre use a subset of libc that's binary compatible between glibc and musl |
16:37:34 | FromGitter | <kaushalmodi> ah |
16:38:18 | leorize | and yea I'm aware of the libressl issue |
16:38:33 | leorize | turns out you've to add it below `#include <sys/syscall.h>` |
16:39:04 | FromGitter | <kaushalmodi> ok, that should be simple (I think).. simply refactor that sed cmd |
16:39:11 | narimiran | Araq: 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:23 | FromGitter | <kaushalmodi> leorize: but shouldn't configure that that undef? |
16:39:33 | Araq | tester.nim was moved, that's why |
16:39:44 | leorize | kaushalmodi: what do you mean? |
16:40:14 | FromGitter | <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:35 | leorize | the thing is... it only works if you add tests for it |
16:41:08 | leorize | I mean, no one would've thought `<linux/sysctl.h>` is not available on Linux, right? |
16:43:04 | FromGitter | <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:25 | FromGitter | <kaushalmodi> in one of the old runs, I just printed out all the .h files present in the travis /usr/include |
16:43:43 | leorize | that's a hack actually |
16:43:53 | FromGitter | <kaushalmodi> better than undef? |
16:43:57 | leorize | the correct way is to build a proper cross toolchain |
16:44:05 | leorize | in some way worse |
16:44:28 | FromGitter | <kaushalmodi> wait.. linus/sysctl.h is present: https://travis-ci.org/kaushalmodi/hello_musl/builds/440688916#L2447 |
16:44:47 | FromGitter | <kaushalmodi> I just need to add that `-idirafter` |
16:45:04 | leorize | yes, it is |
16:45:08 | leorize | doesn't mean it'll work |
16:45:26 | FromGitter | <kaushalmodi> hmm |
16:45:28 | leorize | back in the old kernels you've to patch the linux api headers to make it work with musl libc |
16:45:55 | leorize | pretty sure Ubuntu trusty is still using one of those old versions |
16:46:14 | leorize | that's why when you add `-idirafter` it doesn't work as you've shown me |
16:46:21 | leorize | it tries to include bits from glibc |
16:46:51 | FromGitter | <kaushalmodi> no, I never added -idirafter for libressl |
16:47:10 | FromGitter | <kaushalmodi> just added and committed to libressl branch.. fingers crossed |
16:48:51 | * | xet7 quit (Remote host closed the connection) |
16:49:18 | leorize | I think you should try to integrate crosstool-NG |
16:49:29 | leorize | perks: works even if your distro doesn't provides musl |
16:50:10 | FromGitter | <kaushalmodi> leorize: that didn't work. yeah, I'll have to just note crosstool-NG for now |
16:50:36 | leorize | actually, 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:18 | FromGitter | <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:40 | leorize | look at the log https://travis-ci.org/kaushalmodi/hello_musl/builds/440722014#L688 |
16:53:03 | leorize | can you tell what's missing? |
16:53:48 | leorize | that's because your commit placed that flag in the wrong place... |
16:53:55 | FromGitter | <kaushalmodi> argh.. yeah |
16:54:34 | * | endragor joined #nim |
16:54:36 | FromGitter | <kaushalmodi> *told you.. am burned out* thanks :) another try .. |
16:58:29 | FromGitter | <kaushalmodi> leorize: progress! |
16:58:40 | FromGitter | <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:05 | FromGitter | <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:12 | FromGitter | <kaushalmodi> may be I should rename the switches to `-d:openssl` and `-d:libressl` |
17:08:22 | FromGitter | <kaushalmodi> \* rename that one switch |
17:08:35 | leorize | congrats, now I won't touch your `config.nims` without a pole lol |
17:08:52 | FromGitter | <kaushalmodi> hehe |
17:21:12 | narimiran | Araq: 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:27 | Araq | hmm |
17:22:39 | * | omenar joined #nim |
17:23:32 | * | omenar quit (Remote host closed the connection) |
17:25:10 | narimiran | can 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:54 | narimiran | either 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:58 | narimiran | or, 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:23 | Araq | narimiran: 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:42 | FromGitter | <kaushalmodi> leorize: See https://github.com/kaushalmodi/hello_musl/blob/master/README.org |
18:04:52 | FromGitter | <kaushalmodi> I haven't been more proud of my config.nims :D |
18:05:33 | FromGitter | <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:01 | Araq | I would use 'let' for getEnv, not 'const' |
18:07:23 | Araq | currently it depends on murky compiler behaviour |
18:07:33 | FromGitter | <kaushalmodi> ok! |
18:07:47 | FromGitter | <kaushalmodi> but then everything else will need to become let |
18:08:12 | FromGitter | <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:16 | elrood | narimiran[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:35 | FromGitter | <kaushalmodi> leorize: interestingly the libressl binary built over travis works for me |
18:23:46 | FromGitter | <kaushalmodi> only when I build locally, it crashes instantly |
18:24:10 | FromGitter | <kaushalmodi> and running with `--debugger:native` gives nothing: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc0e6ca435c2a518e975aaa] |
18:24:41 | FromGitter | <kaushalmodi> so either libressl is not getting built correctly locally, or the nim compiled binary |
18:25:43 | FromGitter | <kaushalmodi> Araq: for history, if I build this binary using libressl lib, it build fine but instantly ends with "Killed" |
18:26:02 | FromGitter | <kaushalmodi> that doesn't happen with openssl built binary |
18:26:23 | FromGitter | <kaushalmodi> Is that any file I can provide from the cache to help debug this? |
18:26:28 | FromGitter | <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:22 | FromGitter | <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:27 | FromDiscord | <An unconspicuous looking friend> is this expected? https://gist.github.com/dawkot/4c76295f92ef064a861704ee93f61690 |
19:23:34 | * | omenar quit (Ping timeout: 272 seconds) |
19:25:25 | FromGitter | <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:52 | FromGitter | <timotheecour> that’s what triggered my forum post :) |
19:26:08 | FromGitter | <kaushalmodi> oh, just checked the forum post :) |
19:26:09 | FromGitter | <kaushalmodi> thanks |
19:26:35 | * | irc-5225225 joined #nim |
19:26:45 | * | Guest71257 joined #nim |
19:26:56 | FromGitter | <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:58 | FromGitter | <kaushalmodi> they have some "pedantic" test that fails that PR |
19:27:59 | FromGitter | <kaushalmodi> https://travis-ci.org/github/linguist/jobs/440777089#L1574 |
19:28:00 | * | omenar joined #nim |
19:28:20 | FromGitter | <kaushalmodi> may be just do alpha sort in that list |
19:28:32 | FromGitter | <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:28 | FromGitter | <yyyc514> *yawn* |
20:06:29 | FromGitter | <yyyc514> afternoon all |
20:08:52 | * | omenar quit (Remote host closed the connection) |
20:09:24 | * | omenar joined #nim |
20:10:53 | FromGitter | <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:23 | FromGitter | <kaushalmodi> I tried copying the dochack.js from Nim docs, but that always ends up with "no search results" |
20:12:19 | FromGitter | <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:00 | FromGitter | <timotheecour> CI recently broke all PRs: see https://github.com/nim-lang/Nim/issues/9339 |
20:39:59 | FromGitter | <mratsim> woot: https://github.com/nim-lang/Nim/commit/fcca59e415fe2f3ccbd5c4a977b65305e80f83e8 |
20:47:35 | * | aziz quit (Ping timeout: 276 seconds) |
20:53:47 | FromGitter | <alehander42> @iffy no problem I took a look today and I saw you fixed the dsl syntax |
20:53:49 | FromGitter | <alehander42> very nice |
20:54:03 | FromGitter | <alehander42> i had a different workaround in mind, but yours is even better |
20:55:17 | FromGitter | <alehander42> btw I am planning to maybe stream a bit tomorrow working on gara, trying for the first time to stream |
20:56:06 | FromGitter | <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:43 | FromGitter | <yyyc514> when comparing sequences does check want the order to be the same also? |
21:14:27 | FromGitter | <alehander42> i hope so |
21:14:35 | FromGitter | <yyyc514> lol |
21:14:44 | FromGitter | <yyyc514> yeah switching to an OrderedTable helped a lot :) |
21:15:03 | FromGitter | <alehander42> ah, I thought you are talking about seq |
21:15:17 | FromGitter | <yyyc514> yeah was using toSeq on an interator running against a table |
21:15:30 | FromGitter | <yyyc514> and the results were out of order from what was expected :) |
21:15:53 | FromGitter | <alehander42> yeah I guess you might need OrderedTable |
21:16:04 | FromGitter | <alehander42> i find myself using it more often these days |
21:16:54 | FromGitter | <yyyc514> hmmm, is there any Nim docset for dash? |
21:18:05 | FromGitter | <kaushalmodi> what is dash? |
21:20:04 | FromGitter | <yyyc514> https://kapeli.com/dash really nice API browser for Mac |
21:20:17 | FromGitter | <kaushalmodi> ah OK |
21:20:23 | FromGitter | <kaushalmodi> there is *similar* devdocs |
21:20:37 | FromGitter | <kaushalmodi> https://devdocs.io/nim/ |
21:21:11 | * | smt` quit (Ping timeout: 260 seconds) |
21:21:36 | FromGitter | <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:31 | FromGitter | <yyyc514> https://github.com/nim-lang/Nim/issues/1401 |
21:30:21 | FromGitter | <kaushalmodi> @yyyc514 which editor do you use? |
21:30:28 | FromGitter | <yyyc514> sublime |
21:30:49 | FromGitter | <kaushalmodi> ok, they might have a devdocs plugin |
21:30:53 | * | xace joined #nim |
21:31:31 | FromGitter | <kaushalmodi> otherwise it works in Emacs like this: https://scripter.co/accessing-devdocs-from-emacs/nim-devdocs.gif |
21:32:17 | FromGitter | <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:25 | FromGitter | <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:53 | FromGitter | <yyyc514> what would the idiomatic way to name a iterator for some type of object? |
21:33:25 | FromGitter | <yyyc514> iterms? |
21:35:12 | * | rmk0NE quit (Remote host closed the connection) |
21:35:42 | FromGitter | <kaushalmodi> I don't think `items` is idiomatic.. it's a special name |
21:36:34 | * | tzui joined #nim |
21:36:44 | FromGitter | <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:50 | FromGitter | <yyyc514> but i wasn’t sure what to name the iterator |
21:37:14 | * | tzui left #nim (#nim) |
21:38:09 | FromGitter | <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:28 | FromGitter | <yyyc514> ah, right :) |
21:39:34 | * | arecaceae quit (Remote host closed the connection) |
21:39:38 | FromGitter | <yyyc514> for is probasbly template or macro or something? |
21:39:53 | * | arecaceae joined #nim |
21:42:09 | FromGitter | <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:33 | FromGitter | <kaushalmodi> @Vindaar you have a good idea to implement when-let in Nim? |
21:49:38 | FromGitter | <kaushalmodi> may be add to nimy_lisp? |
21:51:19 | FromGitter | <kaushalmodi> I think that would need some heavy use of macros |
21:54:10 | FromGitter | <Vindaar> Hmm, have never used `when-let`. Need to look at what it does first :) |
21:54:20 | * | endragor joined #nim |
21:57:10 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc118b6271506518d01093c] |
21:58:14 | FromGitter | <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:24 | FromGitter | <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:25 | FromGitter | <kaushalmodi> hmm |
22:00:10 | * | aziz joined #nim |
22:00:24 | * | omenar quit (Remote host closed the connection) |
22:00:34 | FromGitter | <Vindaar> Yep, thought the same. But for most types a "nil" equivalent is easily definable |
22:01:02 | FromGitter | <Vindaar> Or one just keeps it to bools for a start |
22:03:18 | FromGitter | <kaushalmodi> I cannot even come with a psedo code.. |
22:03:46 | FromGitter | <Vindaar> not like I am a lot further than you, haha |
22:04:31 | FromGitter | <kaushalmodi> the idea is this: |
22:04:34 | FromGitter | <kaushalmodi> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5bc11a72c7bf7c366200059f] |
22:04:38 | FromGitter | <kaushalmodi> but it doesn't compile |
22:05:57 | * | aziz quit (Quit: Ex-Chat) |
22:06:13 | FromGitter | <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:42 | FromGitter | <Vindaar> it's a fun problem. I'll think about it! :) will head to bed soon though |
22:06:52 | FromGitter | <kaushalmodi> alright |
22:06:53 | FromGitter | <kaushalmodi> thanks |
22:07:04 | FromGitter | <Vindaar> no worries :) |
22:07:16 | elrood | yyyc514, 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:11 | FromGitter | <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:17 | FromGitter | <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:25 | FromGitter | <rayman22201> @kaushalmodi Hey, what's up? Sorry. I'm at work, wasn't able to respond earlier. |
22:59:39 | FromGitter | <kaushalmodi> Hey, not a problem. I was bugged by the search box not working on arbitrary nim projects |
22:59:51 | FromGitter | <rayman22201> interesting. I never tried doing that |
23:00:11 | FromGitter | <kaushalmodi> The box gets generated, but it is not functional |
23:00:32 | FromGitter | <rayman22201> can you see if any error happens in the javascript console? |
23:00:40 | FromGitter | <kaushalmodi> First of all, it expects the dochack.js, but there is none, so you get 404 |
23:01:02 | FromGitter | <rayman22201> Well, that is a problem. dochack.js will need to be generated. |
23:01:02 | FromGitter | <kaushalmodi> Then I copied it from Nim docs, then I get "no search results" |
23:01:29 | FromGitter | <rayman22201> I bet I know why! the search uses the index.html to generate it's results. |
23:01:43 | FromGitter | <rayman22201> do arbitrary nim projects generate an index.html file by default? |
23:01:50 | FromGitter | <kaushalmodi> Oh! |
23:02:08 | FromGitter | <kaushalmodi> See the search box of any project in wild to test this |
23:02:30 | FromGitter | <kaushalmodi> I recently saw the glob project docs by citycide |
23:02:45 | FromGitter | <kaushalmodi> Same issue (missing dochack.js) |
23:03:33 | FromGitter | <kaushalmodi> Would you have bandwidth to work up a flow to generate search index for any arbitrary nim doc generated HTML? |
23:03:35 | FromGitter | <rayman22201> Nim doc probably needs to be modified to compile dochack.js and move it to the correct folder |
23:03:57 | FromGitter | <rayman22201> but the other issue is that an index.html file needs to be generated. |
23:04:06 | FromGitter | <rayman22201> That is something Araq and I were discussing the other week |
23:04:32 | FromGitter | <rayman22201> I just need to get some time to do it. work and my personal life has been a bit busy lately :-/ |
23:05:14 | FromGitter | <kaushalmodi> No problem. I was just surprised seeing this wasn't working. Life first, code later. |
23:05:21 | FromGitter | <rayman22201> A separate "searchIndex" file should be generated separate from the main index file |
23:06:09 | FromGitter | <kaushalmodi> For single file docs, I rename then to index.html |
23:06:17 | FromGitter | <kaushalmodi> As that's the landing page itself |
23:06:30 | FromGitter | <kaushalmodi> Then the challenge is to generate the .idx for that. |
23:07:04 | FromGitter | <rayman22201> this is the page I'm referring to: https://nim-lang.org/docs/theindex.html |
23:07:34 | FromGitter | <kaushalmodi> Hmm, but do even small projects need that? |
23:07:45 | FromGitter | <kaushalmodi> See my small project: https://kaushalmodi.github.io/nimy_lisp/ |
23:08:15 | FromGitter | <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:30 | FromGitter | <rayman22201> It's only needed if you want the search box feature |
23:08:47 | FromGitter | <rayman22201> the search needs a database to search from. |
23:09:15 | FromGitter | <kaushalmodi> Right, but can that happen from a single page HTML? |
23:09:29 | FromGitter | <kaushalmodi> No thein |
23:09:57 | FromGitter | <rayman22201> You could embed the database into the HTML page. idk if that is a good idea though |
23:10:27 | FromGitter | <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:15 | FromGitter | <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:29 | FromGitter | <kaushalmodi> I mean, If you have just a single page HTML doc, generate a doc.idx and search.js |
23:13:57 | FromGitter | <kaushalmodi> So you will end up with 3 files with `nim doc foo.nim` |
23:14:07 | FromGitter | <rayman22201> yeah, that should be sufficient. |
23:14:36 | * | rockcavera quit (Remote host closed the connection) |
23:14:54 | FromGitter | <kaushalmodi> If the current dochack.js is generic, problem statement is "how to generate that .idx?" |
23:15:14 | FromGitter | <rayman22201> nim generates the idx files already? |
23:15:21 | FromGitter | <rayman22201> at least for the built in docs |
23:15:45 | FromGitter | <rayman22201> I assumed it generates them for all other docs as well. is that wrong? |
23:15:53 | FromGitter | <kaushalmodi> `nim doc foo.nim` doesn't do that |
23:16:27 | FromGitter | <rayman22201> interesting. Araq pointed me to the idx generation code a while back. let me go look |
23:19:22 | FromGitter | <rayman22201> So the rst generator makes idx files: https://github.com/nim-lang/Nim/blob/c404163bbf39d8d8311c516d6e89d531ffea151c/lib/packages/docutils/rstgen.nim#L151 |
23:19:50 | FromGitter | <rayman22201> let me "go up the stack" and see if you have to pass a flag or something to enable it |
23:22:40 | FromGitter | <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:58 | FromGitter | <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:49 | FromGitter | <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) |