<< 17-01-2019 >>

00:16:49FromGitter<zacharycarter> rayman22201: yeah - I played around with that snippet in the playground and couldn't get anything to compile
00:18:27FromGitter<timotheecour> see my reply here https://gist.github.com/rayman22201/92f28f0c1d9ccbc5a36fe04c2132c49e#gistcomment-2811762
00:19:00FromGitter<zacharycarter> ahhh
00:19:22rayman22201weird. I tried casting and it didn't work for me.
00:19:59FromGitter<timotheecour> maybe u also missed the other change (`(also changed BBLeaf[K,V] = ref object of BBTree to BBLeaf[K,V] = ref object of BBTree[K,V])`)
00:23:02rayman22201@timotheecour, yup. You are right. I totally missed that
00:23:11rayman22201I feel less crazy now. Thank you
00:24:16FromGitter<timotheecour> sure; but please file a bug about the err msg, `Error: cannot instantiate: ‘BBTree’` should instead give more type context/diagnostic that the compiler already knows about
00:25:09FromGitter<timotheecour> err msgs shd not be puzzling but give as much info as needed to fix problem wo inserting `echo` over your code, when feasible
00:26:04rayman22201That's a fair point
00:33:23*leorize joined #nim
00:35:30FromGitter<timotheecour> found an even better way for upcast instead of `cast`, see my EDIT here https://gist.github.com/rayman22201/92f28f0c1d9ccbc5a36fe04c2132c49e#gistcomment-2811762
00:38:21rayman22201They need to branch based on which subtype it is, `if cur of BBNode2`, to get the exact behavior they want. But other than that, yeah, that's it I think.
00:45:58*Snircle quit (Read error: Connection reset by peer)
00:47:01*Snircle joined #nim
00:49:56rayman22201https://github.com/nim-lang/Nim/issues/10342 @timotheecour
01:03:33*Tyresc quit (Quit: WeeChat 2.4-dev)
01:06:09*noonien quit (Quit: Connection closed for inactivity)
01:08:22*skellock joined #nim
01:15:39shashlickare there any known issues if you use a config.nims as well as a main.nims
01:23:05*zachk quit (Quit: Leaving)
01:36:21FromGitter<timotheecour> not that i know, please file bug!
01:39:50shashlickSeems like a bug with 0.19.2
01:40:01shashlickDevel and 0.19.0 work fine
01:40:09FromGitter<timotheecour> then don’t file a bug :)
01:40:11shashlickCheck out nimterop nonimgen branch
01:40:39FromGitter<timotheecour> (devel should really be top priority for bug reports, due to limited resources in ppl willing to fix bugs)
01:41:18shashlickWell our stable shouldn't be broken either
01:44:28FromGitter<timotheecour> well if u do file a bug we need a new label: `fixed_in_devel` for proper triage; but again, limited resources; the same would apply to all bugs we’re fixing in devel that are not backported
01:45:42FromGitter<timotheecour> (and the answer is not as simple as “all bug fixes go to stable” since some bug fixes rely/assume features that are not yet in stable; in any case, it’s more work)
01:46:28skellocknim is amazing... ya'll are doing fantastic work!
01:46:38*xet7 quit (Quit: Leaving)
01:46:41*ryukoposting joined #nim
01:47:16FromGitter<timotheecour> PR’s super welcome too! some are tagged as `easy`
01:47:33shashlickI agree, besides I'm still wondering what is broken
01:47:37FromGitter<timotheecour> (some issues)
01:48:00shashlickAnyway, the regex fix is also still blocking me
01:48:30FromGitter<timotheecour> the fix i did got merged 2 hr ago
01:48:35FromGitter<timotheecour> still not workin?
01:48:43shashlickWell nimble only pulls latest tag
01:48:50shashlickSo till nitely tags it
01:49:01Tangerdom96: Watched that stream you did last year on adding !eval to nimbot. Very interesting watch!
01:49:23FromGitter<timotheecour> @shashlick then u shd bug nitely so he adds a new patch tag
01:49:32shashlickYep will do
01:49:41FromGitter<timotheecour> (which should always happen after each bug fix i guess?)
01:50:11shashlickBut I'm close to making nimterop free of nimgen and install time bumbling with nimble
01:50:44FromGitter<timotheecour> wow i’m missing whole context here:)
01:50:52FromGitter<timotheecour> what’s time bumbling
01:51:32shashlickNimble doesn't like nimgen doing stuff in before install
01:51:36shashlickBunch of issues there
01:52:01shashlickTry installing nimterop today, it probably will fail somewhere
01:54:44FromGitter<timotheecour> just did => `Success: nimterop installed successfully.`
01:57:29FromGitter<timotheecour> (even from a fresh repo; note that i’ve `nimble develop` nim-regex w the applied fix; not sure whether that was ur issue)
02:00:00*oculux quit (Ping timeout: 258 seconds)
02:01:01*oculux joined #nim
02:03:28shashlickUninstall tree-sitter and sub projects too
02:03:43shashlickAt least nimarchive breaks completely
02:03:44FromGitter<timotheecour> ah ya suspected it was smthg like that
02:07:07FromGitter<timotheecour> instead of `Uninstall tree-sitter and sub projects too` (which is a pain to do for anyone), i used: `export NIMBLE_DIR=$HOME/.nimble_fake2` `nimble install nimterop` and ya it now fails: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c3fe34b95e17b4525633d3d]
02:08:37FromGitter<timotheecour> actually, re-running `nimble install nimterop` gives: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c3fe3a58318994524004481]
02:08:58FromGitter<timotheecour> reminds me of issue wrt reproducible builds...
02:11:59shashlickOh ya c2nim compatiblity issues just make it harder
02:18:36*fanta7531 joined #nim
02:19:11*xace quit (Ping timeout: 268 seconds)
02:20:06*cspar_ joined #nim
02:20:19*cspar quit (Ping timeout: 246 seconds)
02:21:25*xace joined #nim
02:23:24*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
02:32:37*fanta7531 quit (Quit: ...)
02:36:02*dddddd quit (Ping timeout: 258 seconds)
02:39:12*craigger joined #nim
02:40:07*MightyJoe joined #nim
02:41:08*TongirMan joined #nim
02:41:23*xace quit (Ping timeout: 268 seconds)
02:42:36*xace joined #nim
02:46:15*Tongir quit (*.net *.split)
02:46:15*cyraxjoe quit (*.net *.split)
02:46:15*craigger_ quit (*.net *.split)
02:46:15*Calinou quit (*.net *.split)
02:47:37*Calinou joined #nim
02:48:38shashlickWell if nothing else, I used nimterop to wrap tree-sitter which I then used to build nimterop
02:48:51shashlickSo life's good
02:49:01shashlickNothing like bootstrapping
02:49:03rayman22201bootstrapping ftw
02:49:19FromGitter<timotheecour> and dogfooding!
02:49:56*banc quit (Ping timeout: 246 seconds)
02:50:06*dddddd joined #nim
02:52:00*banc joined #nim
02:55:27*cspar_ quit (Ping timeout: 240 seconds)
02:59:58*cspar joined #nim
03:00:34*banc quit (Quit: Bye)
03:08:28*fanta7531 joined #nim
03:16:20*banc joined #nim
03:32:04*skellock quit (Ping timeout: 272 seconds)
03:39:29shashlick@timotheecour: it is nims specific issue - https://github.com/nim-lang/Nim/issues/10344
03:42:28*dddddd quit (Remote host closed the connection)
03:44:22*lritter quit (Ping timeout: 244 seconds)
03:45:00*lritter joined #nim
04:07:01FromGitter<m4d3bug> How can I deposit json data with single quotes into the mysql or mariadb in the Nim?
04:11:47leorizethe db_* modules can properly escape query automatically
04:12:08leorizeyou'd want to checkout the db_mysql module
04:26:15*kapil____ joined #nim
04:42:02*nsf joined #nim
04:48:32*skellock joined #nim
04:55:12*skellock quit (Ping timeout: 268 seconds)
05:07:56*leorize quit (Quit: WeeChat 2.3)
05:53:04*narimiran joined #nim
05:53:13*narimiran quit (Remote host closed the connection)
05:54:35*narimiran joined #nim
06:01:12*leorize joined #nim
06:08:41rayman22201@timotheecour, we are going to get that bug report closed just on the basis of off topic arguing and bikeshedding...
06:55:34*BigEpsilon joined #nim
06:56:03*absolutejam quit (Ping timeout: 244 seconds)
07:03:34FromGitter<m4d3bug> @leorize i mean write into the mysql
07:05:06*kapil____ quit (Quit: Connection closed for inactivity)
07:30:31*skellock joined #nim
07:34:20*kapil____ joined #nim
07:35:53*skellock quit (Ping timeout: 245 seconds)
07:52:33*lritter quit (Ping timeout: 245 seconds)
08:00:00*gmpreussner quit (Quit: kthxbye)
08:03:27*absolutejam joined #nim
08:04:40*gmpreussner joined #nim
08:07:02Zevv"...experience the best of araq4k: Chat with other fans! Capture your favorite moments!" \o/
08:12:12*fanta7531 quit (Quit: ...)
08:14:25absolutejamis there a short-hand for n to end in a slice?
08:14:38narimiran[n .. ^1]
08:14:53absolutejamahah great, thanks
08:15:00absolutejamI was using .high but I can't do that when I'm method chaining
08:15:06absolutejamwithout saving it as a separate var
08:15:17TangerAnybody know of any benchmarks showing how slow system.readChar is compared to system.readChars?
08:20:43Araqit's terrible, don't use it
08:20:57Araqin fact, use lexbase.nim
08:21:07Araqthe only true way to do IO (TM) :P
08:33:59*Vladar joined #nim
08:46:36absolutejamI must say, I'm really impressed with the vscode extension for nim
08:47:01absolutejamit's like magic when it picks up a definition in another file
08:47:02*qwertesser is now known as qwertfisch
08:47:13absolutejamor the nim parser - whatever performs the wizardry
08:58:11absolutejamSay I have type A and type B which is descended from type A
08:58:18absolutejamI can add them both to a seq with no issue
08:58:46absolutejambut if I create a table[string, TypeA] I get an assignment error when assigning type b to it
08:58:49absolutejamis this correct?
08:59:15narimiranshow us some code
09:00:54absolutejamhttps://hastebin.com/opidupezim.nim
09:01:26absolutejamAlso, anyone else able to get my verification link resent on the forum, please?
09:02:54absolutejamactually, it's failing for a seq example now, but I tested this yesterday...
09:03:43absolutejamoh, it works with ref objects
09:05:12narimiranas for forum verification, dom96 is your man
09:06:23narimiranhmmm, it seems i can delete you forum account
09:06:46narimiran(but i cannot send you verification link)
09:06:47ZevvCould anyone who knows about CI take a peek at my failed build? Works ok for me on 3 different architectures, but travis chokes with a funny error: PR 10338
09:06:51absolutejamthat's fine
09:06:56absolutejamif I can recreate
09:07:52narimiranabsolutejam: if you tell me to delete it (i don't know the consequences and if this will make possible to create a new account then), i'll do it. otherwise, i'm not touching that button :)
09:08:21absolutejamyeah, go for it
09:08:26absolutejamcan't be any worse...right?
09:08:33Zevv(famous last words)
09:08:36narimiranha, "You cannot delete this user." :D
09:08:36*floppydh joined #nim
09:09:36narimiranZevv: you have the same error both on travis and appveyor, right?
09:10:45narimiranZevv: try to do this locally: `./koch temp -d:release` (this will create `bin/nim_temp`), then run your file with `bin/nim_temp c lib/pure/bitops.nim`
09:12:15ZevvYes but no but yes but: the CIs aren't even able to build the Nim compiler, right?
09:12:30ZevvI tried the above, without any issues locally
09:14:09narimiranyeah, true
09:26:00TongirManAraq, haha, thanks for the lexbase recommendation. So if I wanted to process and evaluate stdin character by character, I would just create a new BaseLexer and open a stream of stdin with buffer size 1?
09:28:50*Vladar quit (Remote host closed the connection)
09:29:11*Vladar joined #nim
09:32:05*BigEpsilon quit (Ping timeout: 268 seconds)
09:33:43*BigEpsilon joined #nim
09:35:32Araqer, I don't think that can work. Don't evaluate stdin character by character.
09:41:07*PMunch joined #nim
09:41:20*floppydh quit (Ping timeout: 268 seconds)
09:43:14*floppydh joined #nim
09:43:24TongirManI'm writing a shell with the termios module, I would think that character by character evaluation would be pretty handy for that
09:43:37TongirManTo catch control codes and the like
09:44:02TongirManOr have things like vi-mode
09:45:53absolutejamhave you seen nim-prompt?
09:45:56Araqthen readChar cannot ever be your bottleneck
09:46:18absolutejamalso, there's another one that has some vi support (IIRC) but I went with nim-prompt because it was a bit more feature rich
09:51:50FromGitter<timotheecour> @araq regarding readChar performance, this may be related: https://github.com/nim-lang/Nim/issues/9975 `osproc: using `readLine` to read stdout of a program is > 100 times slower than in other languages #9975`
09:52:21FromGitter<timotheecour> I don’t think it’s that hard to fix though, the current implementation is a bit naive
09:52:41Araqbe my guest, I touch these things only when I'm drunk.
09:52:52Araqand I don't drink.
10:04:08FromGitter<putao88> How to convert "@[1,2,3]" to seq?
10:04:40PMunchputao88, that is a seq..
10:04:41Zevvit is already
10:04:43TongirManHaha
10:04:50FromGitter<timotheecour> no it’s a string
10:04:53FromGitter<timotheecour> he’s asking a valid qq
10:04:54Zevvowwww
10:04:56Zevv:)
10:05:15PMunchOh, I thought he just quoted it for us :P
10:05:15Zevvtrick question, eh?
10:05:15TongirManabsolutejam: Thanks, will check out nim-prompt
10:06:27PMunchmacros.parseExpr then
10:06:37FromGitter<timotheecour> @putao88 maybe send a PR to add this to parseutils?
10:06:46FromGitter<timotheecour> parseExpr would only work at CT
10:06:52Araqno way. use scanf
10:06:58PMunchHe never specified runtime :)
10:07:11Araqor scanp. Or give us a real parser DSL. :-/
10:07:19AraqWhy don't we have that? It sucks.
10:07:31PMunchWe have multiple don't we?
10:08:11FromGitter<timotheecour> to be clear, `scanf` doesn’t already support `How to convert "@[1,2,3]" to seq?` out of the box does it
10:08:51AraqPMunch: not complete parser generators.
10:09:25narimiransing with me: 1335 open issues on the wall, 1335 open issues on the wall, ask one question on irc, 1336 open issues on the wall....
10:09:56FromGitter<putao88> so,how to convert "@[1,2,3]" to seq?
10:10:13PMunchDepends on what you're actually trying to do
10:10:30PMunchAnd how flexible you need it to be
10:11:39FromGitter<timotheecour> the hacky way is easy to write but won’t be robust; the clean way is w a proper DSL or parser generator
10:13:18PMunchAraq, what about lilt: lilt.readthedocs.io/en/latest/
10:13:23narimiranand the real question is: how did you arrive to string that looks like that? maybe this could be fixed on some previous step
10:15:40FromGitter<timotheecour> oh and there’s a 3d way which is to reuse compiler api, see tests/compilerapi/tcompilerapi.nim (and adapt that for seq) , it’d work at runtime, but would likely be slow (but, would work with more complex expressions)
10:16:53Araqit's not that slow, but it would eat much memory
10:17:10*dddddd joined #nim
10:17:14FromGitter<timotheecour> @narimiran no there r real use cases for what he’s asking (parsing strings into custom types)
10:17:24AraqPMunch: never really looked at it. :-) but Parser* = proc(text: string): LiltValue could be improved
10:17:44Araqand Node uses 'kind*: string'
10:18:17FromGitter<timotheecour> araq can pegs.nim be used for that?
10:18:25Araqthere is no need for any of that, you have a DSL, you compile it to what you would have written by hand.
10:19:12PMunchEh, fair point
10:19:28PMunchI was just blown away by how well documented it was :P
10:19:59Araqyeah we should help this guy instead of rolling our own
10:21:14Araqtimotheecour: pegs is too old, I wrote it before I understood Nim.
10:21:44*Vladar quit (Remote host closed the connection)
10:21:51FromGitter<alehander42> @putao88 does this string only have seq of integers always?
10:22:10PMunchThe problem with having a DSL that is supposed to end with something that is like what you would have written by hand is that you need to supply all the map to/parse to type information yourself..
10:23:04PMunchI guess this could be helped by having more generic `parse` or `to` procedures like @timotheecour have suggested on GitHub
10:23:28AraqIMO we have 3 DSLs here, not one.
10:23:42PMunchHuh?
10:23:47FromGitter<alehander42> if so, you can just `echo input[2 .. ^2].split(',').mapIt(it.strip.parseInt)`
10:23:48Araq1 for some lexim / re2c like lexer generation.
10:24:20Araq1 DSL for parser generation that mostly does the recursive decent LL type stuff
10:24:32*platoff joined #nim
10:24:39FromGitter<alehander42> @putao88 ^ if it's a seq of integers: you might need to tweak the `@[` .. `]` handling ⏎ ⏎ if it's a more general seq you need to basically write/use a parser
10:24:45Araq1 DSL for tree construction.
10:26:00Araqand if you use 'case ref objects' for the tree, it's probably wrong, the tree construction should use the techniques from my packedjson package
10:26:05PMunchHmm, yeah I guess a segmented approach like that could work
10:26:32FromGitter<alehander42> Araq: and would packedjson-like tree work at all on e.g. the JavaScript backend
10:26:38PMunchWould be possible to make drop in replacements as well in that case
10:26:58PMunchI never got packed-json to work for jsonschema, but I'm not quite sure why
10:26:59Araqalehander42: it doesn't contain unsafe code, works out of the box with JS
10:27:27Araq(well I never tested, but in theory there is no problem...)
10:27:30FromGitter<alehander42> PMunch: i've always imagined a specific dsl which hints in the grammar how the final tree should look, but it requires careful design
10:27:49FromGitter<alehander42> the good thing about it is that you can generate parsers in many languages from such a specification
10:27:53Araqrule: action pairs are still unbeatable
10:28:06Araqand the 'action's are language specific.
10:28:32FromGitter<alehander42> the bad thing is it needs to be more general/or to support custom actions which makes it a little bit harder to make it lang-independent
10:28:37AraqI don't want a "general", language agnostic parse tree, but ymmv.
10:29:12FromGitter<alehander42> but not too much: one can have langagnostic actions(maybe not very optimized) in a limited dsl(or subset of a lang) which can be easily compiled for every target language
10:29:39FromGitter<alehander42> Araq: yeah, i had this idea before i started using nim
10:30:01Araqpackedtree construction should be so cheap that you don't have to avoid the tree construction, maybe this fact can simplify the design, not sure
10:30:49FromGitter<alehander42> but i do find it annoying that i can't just generate a dumb parser in every lang from a very simple spec
10:31:31FromGitter<alehander42> Araq:having separate dsl-s is also nice
10:31:44AraqI find "dump parsers" annoying.
10:31:54Araqer *dumb
10:32:22FromGitter<alehander42> my initial idea was that each node will have named subnodes (e.g. left, right, op etc ) ⏎ but these days i think pattern matching/indexing is good enough and in this case the tree can be constructed more easily
10:33:01PMunchI'm curious what you imagine these DSLs looking like Araq. If you wouldn't mind could you type out a rough example (just a couple of lines or something)
10:33:11Araqand also, don't make the parser produce "errors".
10:33:24AraqOr Optionals. Or exceptions.
10:33:39FromGitter<alehander42> Araq: in longterm that's true, but when i just make toy languages/prototypes/experiments i dont care how performant my parser is
10:33:41PMunchWhat is it supposed to do then?
10:33:41AraqInstead embed it into the AST with an error kind node.
10:33:43FromGitter<putao88> @alehander42 That's the approach I'm using now
10:33:55PMunchAraq, ah right, that makes sense
10:34:37Araqalehander42: well it's code generation, do it once and benefit from the optimizations everywhere.
10:34:48FromGitter<putao88> I just don't feel very intelligent
10:34:52FromGitter<alehander42> well, one can still config it to raise on the first error: sometimes people dont need error recovery
10:35:57FromGitter<alehander42> Araq: yeah, algorithmitically you can generate efficient data structures/code, i meant it might not generate lang-specific optimizations
10:36:19PMunchputao88, for your simple case: http://ix.io/1ywB/Nim
10:36:30PMunchNot generic in any way though..
10:36:48FromGitter<alehander42> @PMunch you can it.strip.parseInt directly
10:37:10PMunchalehander42 oh yeah that's true
10:37:27PMunchI had it as two maps initially. But strip doesn't like to be put in a map since it has optional arguments
10:37:30FromGitter<alehander42> @putao88 but from where is this string coming? is another nim program generating it?
10:37:34PMunchI have an issue open for that
10:37:41FromGitter<alehander42> @PMunch i almost never use `map`
10:38:06PMunchI almost never use either `map` nor `mapIt` :P
10:40:36FromGitter<alehander42> yeah, i should try to use high order methods more often these days
10:41:44FromGitter<putao88> A string is stored in the database and can be parsed out using getValue, but the data retrieved with the getAllRows method fails to be parsed using parseJson
10:42:16FromGitter<gogolxdong> She wrote a stringified seq `$seq[int]` to mysql, parseJson can process the value returned by getValue but cannot process the one from getAllRows.
10:43:04FromGitter<gogolxdong> the same field .
10:44:15FromGitter<alehander42> ahh, well parsing nim expressions in general on runtime doesnt seem too optimal currently
10:44:31FromGitter<alehander42> if one doesnt use the compiler api
10:44:48FromGitter<alehander42> maybe for now you can store a json string of your values?
10:44:57FromGitter<alehander42> if you're using parseJson
10:45:39PMunchYeah, best would be to either store it as JSON or a simple comma-separated value (or whichever character you prefer).
10:46:30PMunchOr of course store it directly in a table in MySQL, but that might not always be optimal
10:47:37FromGitter<alehander42> btw PMunch , what was the topic of your fosdem talk
10:48:30PMunch"Metaprogramming in Nim"
10:48:53Zevvin 15 minutes?!
10:49:06narimiranhe talks really really fast :P D
10:49:27PMunchIt's going to be a quick introduction to Nim, then a few words on what metaprogramming is, and then an overview of how it works in Nim with some examples.
10:49:45PMunchZevv, I used to be an auctioneer
10:50:00FromGitter<gogolxdong> only you attend FOSDEM this year?
10:50:32PMunchJust kidding, but I think it should be doable. It's not going to be a super deep thing, just to wet peoples appetites on how much cool stuff they can do in Nim :)
10:52:04PMunchI felt like a lot of the people I talked to last year about Nim seemed to like it, but didn't have that one thing that sparked them to try it. So I'm going to pique their interest with one of the "coolest" features, and then they can discover all the other neat aspect for themselves :)
10:52:29PMunchgogolxdong, well a lot of people are going, but Nim won't have an official booth like last year unfortunately..
10:52:57FromGitter<alehander42> nice
10:53:25FromGitter<gogolxdong> why not?
10:53:26PMunchWhich is a bit sad as I won't have anywhere to send people who might be interested in learning more about Nim..
10:53:39FromGitter<alehander42> yeah , metaprogramming is cool: i hope you show some `typed` aspects too, as this is maybe more atypical for some metaprogramming systems
10:53:42FromGitter<alehander42> macro* systems
10:53:50FromGitter<gogolxdong> I remember it had last year.
10:54:06PMunchHuh, apparently we have two Nim related talks: fosdem.org/2019/schedule/event/nimbus/
10:54:18PMunchalehander42, what do you mean?
10:54:43PMunchforum.nim-lang.org/t/4324#27011
10:55:16PMunchI definitely think we should do a semi-official meetup at least. Preferably after the talk so I can direct people there :)
10:55:23FromGitter<alehander42> well, usually macro systems operate on the AST, but loading/manipulating types is not so common (i think?)
10:55:54PMunchalehander42, example?
11:05:07FromGitter<alehander42> i mean that nim macros can operate on semantic information : `typed`, `getType`
11:05:22FromGitter<alehander42> e.g. rust macros can't do that (afaik)
11:05:47FromGitter<alehander42> but e.g. crystal macros also access some type information, so maybe not so rare
11:14:19FromGitter<gogolxdong> FOSDEM lauched on 2 & 3 Feburary, why do you use `was`, @alehander42
11:15:25FromGitter<alehander42> @gogolxdong it just sounded correct in my head to say it like that, no idea :D
11:15:47absolutejamI'd love for the talks to get recorded :D
11:16:17PMunchThey are :)
11:16:25FromGitter<gogolxdong> I thought it happened.
11:16:28PMunchEven streamed live
11:17:44PMunchwww.youtube.com/user/fosdemtalks
11:17:57absolutejamall of em?
11:17:59absolutejamsweet.
11:18:10PMunchYup, every single one
11:18:12FromGitter<alehander42> they have pretty good organization
11:21:06*BigEpsilon quit (Ping timeout: 244 seconds)
11:27:09*fanta7531 joined #nim
11:27:36absolutejamso, howcome I can have different descendent types in a seq when they are ref types and not just objects?
11:29:45*vegai left #nim (#nim)
11:30:13FromGitter<mratsim> Are you asking how or how come? :P
11:30:34FromGitter<mratsim> Your refs are probably using inheritance and share the same base type
11:30:48absolutejamyeah, they are
11:31:00FromGitter<mratsim> so at compile-time they are the same type
11:31:09absolutejamoh
11:31:24absolutejambut if I don't use a ref, I get an error when trying to assign inherited objects to a seq
11:31:29absolutejamis that normal?
11:31:49FromGitter<mratsim> inherited non-ref objects are "Here be dragons"
11:32:07FromGitter<mratsim> basically they must have the same size, otherwise you will have issues
11:32:08absolutejamELI5, I like it
11:32:15absolutejamfair enough
11:32:28FromGitter<mratsim> I asked to remove them or hide them but well
11:32:36*skellock joined #nim
11:32:40*stefanos82 joined #nim
11:32:48FromGitter<mratsim> for example Exceptions are using inherited non-ref, but they all have no fields so same size
11:32:57FromGitter<timotheecour> @araq generic parser: see https://github.com/nim-lang/Nim/pull/10346/files ⏎ see unittest: ⏎ ⏎ > doAssert parseseq[seq[int ("@[ @[1,2], @[3], @[]]") == @[ @[1,2], @[3], @[]] [https://gitter.im/nim-lang/Nim?at=5c4067e9f780a1521f247ab8]
11:33:39FromGitter<mratsim> A seq will allocate space to hold data of the compile-time size
11:33:59FromGitter<mratsim> a ref object is basically just a pointer to the actual data, so always same size
11:34:13absolutejammakes sense
11:37:08*skellock quit (Ping timeout: 245 seconds)
11:37:51Araqmratim: we fixed them instead. Maybe dragons are left.
11:43:42narimirandid anything change in nimsuggest recently?
11:44:00narimirani.e. it seems like i'm having some kind of memory leak
11:47:46Araqit's always been leaking.
11:47:52AraqPMunch: https://gist.github.com/Araq/daf3e6aa4dde850bfe9cddcb7e0edee7
11:48:33narimirani never noticed this much of a leak before
11:52:38FromGitter<alehander42> ha i also had something like `*^` but called it `join`
11:53:08PMunchHmm, interesting Araq. But what was the third one you talked about?
11:53:42Araqin this proposal I merged it with DSL 2
11:54:20Araqotherwise it would pretty much be the standard sum type, except its implementation would be totally different
11:54:22PMunchAh okay, that's what I thought
11:55:02*Vladar joined #nim
11:56:20Araqalehander42: there is also ^+
11:56:30Araqfor the "at least one" variant
11:56:45AraqI made a typo, in Nim's grammar these are ^+ and ^*
11:57:57FromGitter<alehander42> hm, I found i rarely need that: usually one wants the typical "join/split"-like behavior
11:58:03FromGitter<alehander42> e.g. args, params, elements etc
11:59:05Araqinteresting to note that BNFs need all sort of additional non-standard notations for convenience whereas the "non declarative" stuff can use the power of a PL to avoid duplicated subexpressions
11:59:29Araqin the end imperative programming always wins. :P
11:59:44*BigEpsilon joined #nim
11:59:52FromGitter<alehander42> yeah, good thing people write regular expressions with code
12:01:07FromGitter<alehander42> it's sad that there aren't just 3-4 powerful grammar notations available, all kinds of tools would benefit from easily parsing various sources
12:01:27FromGitter<alehander42> which is hard when definitions are so imperative
12:06:13Araqwhich regular expressions? The ones that can be mapped to SAT with backrefs?
12:07:12Araqor the ones that you cannot group into logical things via whitespace. They are all terrible.
12:08:18*nsf quit (Quit: WeeChat 2.3)
12:10:20Araqand which BNFs, the ones where left recursion is not supported or the ones where left recursion is faster. Or the ones with reduce-reduce conflicts?
12:10:30FromGitter<zacharycarter> https://twitter.com/chandlerc1024/status/1085496978702663680
12:14:38FromGitter<alehander42> Araq: i also dont like overusing regular expressions, but if I need to match an actual regular language, they're great
12:15:05FromGitter<alehander42> they might have some differences, but 80% of what people usually use is the same, no need to strawman
12:15:20Araqthe theory behind them is great, the syntax is at best mediocre
12:15:30FromGitter<alehander42> maybe
12:15:33FromGitter<alehander42> but its 10x better
12:15:42FromGitter<alehander42> than having 5 competing syntaxes in popular usage
12:16:14FromGitter<alehander42> of course, parsing and grammars are more general, so just one standard cant cut it all
12:16:33FromGitter<alehander42> but in today's world every language/lib and project define their own way to do it
12:16:42Araqit's worse than that IMO. the syntax is heavily tied to algorithmic aspects
12:17:09Araqlike, if you allow backrefs, it becomes NP complete.
12:17:42FromGitter<alehander42> e.g. if i want to develop a tool that plays with the syntax trees of codebases written in e.g. 15 most popular languages
12:17:43Araqand if you allow sub captures you cannot produce a DFA.
12:17:51FromGitter<alehander42> i need to basically go and ** myself
12:17:53Araq(the last one is a secret)
12:18:36FromGitter<alehander42> Araq: this is all true, but a lot of those are not actually reg languages
12:18:41FromGitter<alehander42> they are hacks
12:18:51FromGitter<alehander42> on top of the regexp stuff
12:19:16FromGitter<alehander42> the backrefs at least
12:20:09*xet7 joined #nim
12:21:34FromGitter<alehander42> but my point is one can have both: one can have custom optimized notations/implementations of parser AND also a relativaly standard way to generate them: ⏎ ⏎ this gives you quick prototyping ⏎ two implementations, so easier to catch bugs/fuzztest ⏎ standartized way to produce ast-s for some tools [https://gitter.im/nim-lang/Nim?at=5c40734ddab15872ceab1969]
12:22:11FromGitter<alehander42> you can have lang-agnostic ast-based grep-like tools/replacement/10 more things
12:22:16Araqwe are not even close to a "relatively standard way"
12:22:26*couven92 joined #nim
12:22:32AraqPEGs tried to fix regexes fwiw
12:24:07FromGitter<alehander42> well, what's wrong with PEG
12:24:36couven92Uhm... I am having auth problems with GitHub right now... Is it just me? Pull fails using HTTPS and took a whole minute (on University internet) over SSH... :O
12:25:16Araqit kinda sucks for stuff like '[' .* ']'
12:38:11FromGitter<timotheecour> @araq is there a parseString that works w triple quotes and other kinds of quotes?
12:38:30FromGitter<timotheecour> that’s the biggest stuff missing in https://github.com/nim-lang/Nim/pull/10346
12:38:55*abm joined #nim
12:39:24*zachcarter quit (Ping timeout: 250 seconds)
12:44:58*enow joined #nim
12:52:11*nuxdie joined #nim
12:55:53*BigEpsilon quit (Ping timeout: 245 seconds)
12:56:46FromGitter<dom96> Love how you guys went from "need to parse a seq with ints" to "we need a new parser generator!"
12:56:54shashlickIs there a way to run the CT code of one module and wait for completion before spawning/proceeding to other files?
12:57:38FromGitter<dom96> Shashlick: don't think so
12:57:44FromGitter<mratsim> if it's something that is exported it should run first
12:58:05FromGitter<mratsim> if you want to generate some kind of text files at compile-time you would need a two-stage compilation pipeline
12:59:09shashlickmratsim: any suggestions on how to do that
12:59:25*BigEpsilon joined #nim
12:59:54shashlickI'm trying to do this during nimble install
13:00:08FromGitter<mratsim> I use nimble scripting: https://github.com/numforge/agent-smith/blob/master/agent_smith.nimble#L34-L41
13:00:10shashlickAnd avoid before install
13:00:31FromGitter<mratsim> build_ale builds a shared library
13:00:37FromGitter<mratsim> and then I can build the wrapper
13:00:45FromGitter<mratsim> (which is not in the script)
13:00:56FromGitter<mratsim> the files are here
13:01:06FromGitter<mratsim> 1) ale_build, 2. ale_wrap
13:04:06shashlickBut can you do this while your library is being installed
13:04:15shashlickBy nimble
13:06:32shashlickOr do you need to manually run the build_ale task
13:11:40FromGitter<mratsim> nimble install can call build_ale task
13:11:57FromGitter<mratsim> or you can make it a function and call it in nimble install
13:13:08FromGitter<mratsim> ah, maybe you can't overrid nimble install like nimble test
13:13:23shashlickThat goes back to using before install which hasn't worked in some scenarios
13:14:05Araqit's one of these days...
13:14:08shashlickIn fact now I need it in before build
13:14:22FromGitter<mratsim> but AFAIK before_install is only a Travis hook, not an official nimble hook right?
13:14:27Araqnothing beats Boehm on gcbench.nim
13:14:58Araqnot even my memory regions. A sad day
13:16:43Araqprobably I'm measuring something different
13:18:44Araqah this benchmark is bullshit and I'm measuring the number of mmap() calls...
13:18:50FromGitter<mratsim> lol
13:20:56FromGitter<kaushalmodi> @timotheecour You seem to be onto something good with that `parse` library :)
13:21:14FromGitter<kaushalmodi> Does this mean it will simplify the last "string" row in here: https://scripter.co/notes/nim/#representing-one-type-in-another
13:22:02FromGitter<dom96> shashlick: please don't back around nimble, fix/implement what you need in nimble instead
13:23:39*Vladar quit (Remote host closed the connection)
13:23:47shashlickWill try dom96
13:26:45*skellock joined #nim
13:29:11shashlickBut want to make nimterop a regular old hybrid package
13:30:44FromGitter<alehander42> @kaushalmodi very nice docs there!
13:31:16*skellock quit (Ping timeout: 268 seconds)
13:31:40FromGitter<kaushalmodi> thanks! :)
13:35:12FromGitter<kaushalmodi> @alehander42 Skim through the topics of your interest in there and feel free to report errors/misunderstandings
13:35:44*BigEpsilon quit (Ping timeout: 250 seconds)
13:37:12FromGitter<kaushalmodi> Sometimes I don't understand why certain things are how they are and I make up my own theory to explain myself. An example: search for "home-grown theory" towards the bottom of https://scripter.co/notes/nim/#int-types section
13:40:10FromGitter<mratsim> you can explain it by, conversion with precision loss should be explicit
13:40:53FromGitter<kaushalmodi> what was confusing was that earlier I thought that int and int64 were the same on 64-bit systems
13:41:04FromGitter<mratsim> and int doesn't convert to int64 implicitly because if you compile the code on 32-bit platform, int is not int64
13:41:06FromGitter<kaushalmodi> but looks like int64 kind of has an higher edge than int
13:41:40FromGitter<kaushalmodi> ah ..
13:41:46FromGitter<kaushalmodi> make sense
13:41:54FromGitter<mratsim> sorry int64 doesn't convert to int
13:45:01FromGitter<kaushalmodi> does it mean that I should be able to assign int to int32 and vice version on 32-bit systems?
13:46:36FromGitter<kaushalmodi> .. or may be not, because then `varInt32 = varInt` kind of code won't compile on 64-bit systems, right?
13:48:26*vlad1777d joined #nim
13:50:55FromGitter<mratsim> the check is done at compile-time and doesn't depend on your int32/int64 I think
13:51:31FromGitter<mratsim> the size yes, but I don't think the semantic checking of type conversion checks the size
13:51:48*itschin joined #nim
13:52:08*itschin left #nim (#nim)
14:00:53*cspar quit (Ping timeout: 246 seconds)
14:06:46*cspar joined #nim
14:12:06absolutejammratsim you said at compile time, child objects are the same type as parent objects
14:12:14absolutejamdoes this affect them in any way?
14:12:33absolutejamtheir fields and procs are all applicable still?
14:14:53*skellock joined #nim
14:18:19absolutejamfrom testing, it looks like it's forcing them into the parent class type
14:28:26leorizeabsolutejam: if you want runtime dispatch you'd have to use method
14:30:50*hwallann joined #nim
14:31:44*Erik_ joined #nim
14:32:23absolutejamuhhh
14:32:33absolutejamYeah, I tried to understand what that meant from the dos
14:32:35absolutejamdocs
14:33:04absolutejamso, a method is used when you're utilising inheritance
14:33:16absolutejamto target the right type of object
14:33:24absolutejambut a proc defaults to the base object
14:33:54leorizenot exactly
14:35:01leorizeyou can call a proc to a derived object and it would still work as expected
14:36:33absolutejamcan I explain what I'm trying to do and see if it's possible?
14:36:39leorizesure
14:37:04absolutejamlet me try whip an example together actually
14:37:09absolutejammy working code is a bit convoluted
14:37:58*cspar quit (Ping timeout: 245 seconds)
14:42:33ZevvIs there a variant of repr with slightly cleaner output? I'd like to dump readable versions of serialized/deserialized objects to a log file, and repr is noisy with pointers and newlines. Json does'nt work for me because it does not know about things like uint8
14:42:52leorizemake your own `$`?
14:43:30leorizerepr is a debugging tool, I don't think you should use that for logging
14:44:10Zevvthe logs are for debugging :)
14:44:20ZevvYeah i'm making my own `$` now, fieldPairs et al
14:49:51*krux02 joined #nim
14:50:01absolutejamhttps://hastebin.com/azobewuqat.pl
14:50:38absolutejamMaybe I'm approaching this all wrong, coming from no computer science knowledge and only really using dynamic languages
14:51:42absolutejamin that example, by declaring Container.foo and Container.bar as seq[MyBaseObj], the fields from their actual clases (Foo & Bar) are stripped
14:51:51leorizemethod should fit your use case
14:52:21*Erik_ quit (Quit: Page closed)
14:52:54leorizeI'll spin up an example for you
14:54:27absolutejamthanks
14:57:29leorizeabsolutejam: http://ix.io/1yxa/nim
15:00:35narimiranbtw, just a few days ago we had the same question and a similar example as a solution — we should have this better documented
15:01:33leorizeyea, I'll leave that to you narimiran ;)
15:01:43narimiranhaha, too much on my plate :)
15:02:01FromGitter<kaushalmodi> leorize: do you blog?
15:02:13FromGitter<kaushalmodi> if so, you can do a brief write-up on `method`
15:02:25FromGitter<kaushalmodi> I've seen it being mentioned here few times, but have never used it
15:02:27narimiranbut i think all this is already written *somewhere* (i know i found it before), it just needs to be brought to some official/visible/known place
15:02:40leorizeI don't do blogs, sorry :P
15:03:11leorizeI never actually used methods, just guessed from experience, so I'm not the best to write about that :)
15:04:44*BigEpsilon joined #nim
15:05:10FromGitter<kaushalmodi> going through https://nim-lang.github.io/Nim/manual.html#multiminusmethods, I need to first understand what static/dynamic dispatches are .. hmm
15:05:19FromGitter<kaushalmodi> adding to my need-to-understand list
15:05:49narimiran@kaushalmodi rewrite leorize's example to use procs, and you'll get the idea
15:06:01absolutejamah right
15:06:08absolutejambut I _have_ to use a method for that right?
15:06:27absolutejamLike, I was trying x.name
15:06:36absolutejamand that b0rked
15:06:47absolutejambut writing a method to return x.name for Foo worked
15:06:51leorizekaushalmodi: my understanding of this is basically: static = picked by the compiler based on overloading, dynamic = picked at runtime based on rtti
15:07:14FromGitter<kaushalmodi> sorry, rtti?
15:07:14leorizeabsolutejam: yep, that's the idea
15:07:27leorizeruntime type information
15:07:43absolutejamYeah, there was an example of methods, but I just didn't understand the underlying concept
15:07:46FromGitter<kaushalmodi> narimiran: thanks, I'll do that, for now, adding these snippet links to my notes
15:07:56FromGitter<kaushalmodi> leorize: thanks
15:08:04absolutejama lot of the docs assumes some prior knowledge
15:08:22absolutejamAnd I don't want to dumb down the docs too much, but at the same time, it's caught me out
15:08:36absolutejams/it's/it/
15:08:48absolutejam(not that that's hard)
15:10:08leorizeyea, I only know about the method stuff thanks to some experience with objfpc
15:11:03narimiran@mratsim was it you posting a nice example showcasing differences between methods and procs? (i can't find it on irclogs)
15:11:38FromGitter<mratsim> only perf examples
15:12:10absolutejamjust need type filed acces via [] and i'll be happy now ;)
15:12:42leorizethat's certainly possible :)
15:12:58Zevvwatch out when using methods and generics: https://github.com/nim-lang/Nim/issues/10038
15:13:27narimiranabsolutejam: see how that is done in stdlib
15:13:52absolutejamthere was a macro example on the forums, but it didn't work for me and I'm not quite at metaprogramming level yet haha
15:13:54absolutejammelted my brain
15:17:14narimiran(ignore my previous message, i mis-read what you're doing :))
15:19:05shashlickgot it working! nimterop now is 100% free of nimgen, c2nim and other big dependencies
15:19:13narimiranshashlick: woooooooooooo
15:19:30FromGitter<gogolxdong> what can nimterop do?
15:19:45FromGitter<gogolxdong> saw it many times.
15:19:53narimirannow it is unstoppable! it can do anything it wants :P
15:19:56shashlickit installs tree-sitter and other C dependencies during nimble install using itself
15:20:08shashlick@gogolxdong - it is a combination of c2nim and nimgen
15:20:18shashlickbasically wrapping C libraries seamlessly
15:20:23shashlickhttps://github.com/genotrance/nimterop
15:21:07shashlicknow it should get much easier to simply require nimterop in nimble followed by import and cImport
15:21:47FromGitter<gogolxdong> without *.cfg file?
15:23:02shashlickyep
15:23:05FromGitter<gogolxdong> then it can replace c2nim and nimgen completely
15:23:10shashlickthat's the goal
15:23:35shashlickso simply get the C lib sources and use cCompile() and cImport() and point to .c and .h files
15:24:12shashlicksee https://github.com/genotrance/nimterop/blob/master/tests/tmath.nim for an example
15:24:16FromGitter<gogolxdong> include cpp?
15:24:47shashlicknot yet added CPP support
15:25:12FromGitter<gogolxdong> cool
15:25:22shashlickwant to get C support solid and also ensure it works seamlessly in Nim
15:25:44ZevvAn does it need treesitter itself, or is this somehow generated using treesitter?
15:26:33shashlickcheck out https://ci.appveyor.com/project/genotrance/nimterop/build/job/xhidbusadw0q3i8u#L502 for the Nim wrapper generated for math.h
15:26:50Zevvwow
15:26:52shashlickit does use tree-sitter to parse the C/C++ code
15:27:35ZevvNow do WebKit :)
15:27:37narimiranshashlick: offtopic, but about you idea to use SO for questions: take a look at the forum and the most recent stuff.... ;)
15:27:58*stefanos82 quit (Read error: Connection reset by peer)
15:28:30shashlickNim is amazing really - has made this possible in around 2 months
15:28:41shashlickplus works cross-platform with minimal effort
15:29:13shashlickZevv - it might just work - just enable recursion and it will process all #include files inline
15:29:25shashlickbut is webkit C or C++?
15:29:30Zevv++ :(
15:29:40*Zevv can wait :)
15:29:57shashlickwell, we can do 98% of ImageMagick
15:30:01*stefanos82 joined #nim
15:30:03shashlickgot libjpeg working
15:30:20shashlickmore we run thru this, the more stable it can become
15:30:27Zevvimpressive stuff
15:30:40shashlicki'll be converting all existing nimgen wrapper projects into nimterop eventually
15:30:48shashlickbut best to prioritize new ones
15:30:50Zevvparsing C (and C++!) is not for the faint of heart
15:31:16stefanos82Araq: the latest HEAD managed to crash my system (Debian testing 64-bit, fully updated) during ./koch tests all
15:31:18*vlad1777d quit (Ping timeout: 245 seconds)
15:32:18*spymasterd[m] quit (Ping timeout: 250 seconds)
15:32:21*toofly[m] quit (Ping timeout: 252 seconds)
15:32:25shashlicknarimiran: didn't see anything after dom96's response - will reply after I see some more inputs
15:32:34*TheKing[m] quit (Ping timeout: 252 seconds)
15:32:42*zielmicha[m] quit (Ping timeout: 252 seconds)
15:32:43*macsek1911[m] quit (Ping timeout: 252 seconds)
15:32:51shashlickZevv: that's the thing, that is completely handled by tree-sitter
15:32:55*jugash[m] quit (Ping timeout: 252 seconds)
15:32:56*sendell[m] quit (Ping timeout: 264 seconds)
15:32:58*dyce[m] quit (Ping timeout: 252 seconds)
15:33:12*hohlerde quit (Ping timeout: 250 seconds)
15:33:13*xylef quit (Ping timeout: 250 seconds)
15:33:15*Miguelngel[m] quit (Ping timeout: 250 seconds)
15:33:15*ee7[m] quit (Ping timeout: 250 seconds)
15:33:18*TheManiac[m] quit (Ping timeout: 260 seconds)
15:33:19*k0mpjut0r quit (Ping timeout: 260 seconds)
15:33:19*serialdev[m] quit (Ping timeout: 260 seconds)
15:33:19*isaac[m] quit (Ping timeout: 252 seconds)
15:33:21*yglukhov[m] quit (Ping timeout: 252 seconds)
15:33:22*GitterIntegratio quit (Ping timeout: 252 seconds)
15:33:23*petersjt014[m] quit (Ping timeout: 252 seconds)
15:33:23*narimiran[m] quit (Ping timeout: 252 seconds)
15:33:23*exothermic[m] quit (Ping timeout: 252 seconds)
15:33:23*endes[m] quit (Ping timeout: 252 seconds)
15:33:26narimiranshashlick: i didn't mean in that thread, but just to look at the recent threads/questions. lot of material for SO :)
15:33:27*pqflx3[m] quit (Ping timeout: 252 seconds)
15:33:28*Demos[m] quit (Ping timeout: 252 seconds)
15:33:32*Connor[m] quit (Ping timeout: 264 seconds)
15:33:40*sg-james[m] quit (Ping timeout: 264 seconds)
15:33:40*xomachine[m] quit (Ping timeout: 264 seconds)
15:33:41*ArchieT[m] quit (Ping timeout: 264 seconds)
15:33:51shashlickwhat I did was created an engine to search the tree-sitter generated AST for patterns and map known patterns into Nim
15:34:00shashlicknarimiran - I see, ya
15:34:01Zevvyeah, just reading up
15:34:06*hohlerde joined #nim
15:34:22*macsek1911[m] joined #nim
15:34:24*zielmicha[m] joined #nim
15:34:27Zevvshashlick: http://paste.ubuntu.com/p/8G25whdry9/, nimble install fails for me in step 1
15:34:40*sendell[m] joined #nim
15:34:52*GitterIntegratio joined #nim
15:35:09shashlickZevv - looks like its still pulling the old version
15:35:18*TheKing[m] joined #nim
15:35:38ZevvSomething I can do about that, or is that a problem on the other side?
15:36:06shashlicknot sure if nimble has cached it already or something
15:36:08*yglukhov[m] joined #nim
15:36:08*dyce[m] joined #nim
15:36:10shashlickcause github is up to date
15:36:13*isaac[m] joined #nim
15:36:26ZevvI started with a rm -rf ~/.nimble - so no history here
15:36:32shashlickI need to update the readme looks like
15:36:32*Connor[m] joined #nim
15:36:38shashlickjust do nimble install nimterop
15:36:41*ArchieT[m] joined #nim
15:36:45shashlickdon't need to install treesitter anymore
15:37:06*sg-james[m] joined #nim
15:37:06*xomachine[m] joined #nim
15:37:18Zevvsame error :(
15:37:31*k0mpjut0r joined #nim
15:37:32*exothermic[m] joined #nim
15:37:34*narimiran[m] joined #nim
15:38:11*Demos[m] joined #nim
15:38:19*toofly[m] joined #nim
15:38:26*endes[m] joined #nim
15:39:26*nsf joined #nim
15:39:36shashlickare you still installing treesitter?
15:39:36*petersjt014[m] joined #nim
15:39:58Zevvnope, only doing the nimble install, from a clean system
15:40:32*Miguelngel[m] joined #nim
15:41:04*ee7[m] joined #nim
15:41:04*TheManiac[m] joined #nim
15:41:05*serialdev[m] joined #nim
15:41:34*spymasterd[m] joined #nim
15:42:06shashlickcan you share the output - i do see one issue which i'm working on
15:42:29*pqflx3[m] joined #nim
15:42:34ZevvOutput is in the paste above. I'll build a clean nim 0.19.2 and retry, maybe something is messed up in my compiler somehow
15:42:55*jugash[m] joined #nim
15:43:23*xylef joined #nim
15:46:25Zevvstill no luck: http://paste.ubuntu.com/p/t6PF7PbHnD/
15:46:30Zevvcannot open: inc/treesitter/src/runtime/stack.c
15:46:40shashlickya i'm fixing that one
15:46:42Zevvok
15:46:46shashlickgit clone + local install works
15:46:51shashlickbut something to do with paths
15:46:53Zevvwill try
15:47:55Zevvworked. README still says "installWithDeps", though
15:48:34shashlickrefresh?
15:50:05Zevvshould I file issues for problemns nimpterop runs into? for example zlib: Error: undeclared identifier: 'voidpf'
15:50:16shashlickyes absolutely
15:50:25Zevvwill do!
15:50:42shashlickok i think i fixed the nimble install nimterop issue
15:51:00Zevvso, where does tree-sitter now live? I don't have a local install of that, is it included in nimterop?
15:51:18shashlickduring install, tree-sitter code is pulled into the repo and compiled in
15:51:29shashlickit isn't put in the install dir though
15:51:51shashlickthere's just the static wrapper files in ~/.nimble/pkgs/nimterop-0.1.0/nimterop/treesitter
15:52:06Zevvbut where does the actual the C parser end up?
15:52:20shashlickit is built into a binary called toast
15:52:28Zevvaah, there it is toast
15:52:33shashlickso if ~/.nimble/bin is in your path, you can run toast -h
15:52:37Zevvtoast: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=cfb83f9946a0428987eceb62124571c6e231ae33, not stripped
15:52:49shashlickso you can use it in the traditional fashion like c2nim
15:53:02shashlickor use the cimport module to pull stuff into your nim code directly
15:53:17shashlickit calls toast behind the scenes
15:53:22Zevvah and toast prints s expressions of asts
15:53:43Zevvwhich nimterop parses back in, right
15:53:56shashlickya so you can spit out the gcc preprocessed output with -p, the tree-sitter ast with -a or the nim output with -n
15:54:24shashlickyou can also recurse into #include files with -r
15:55:50ZevvI'm trying to build a mental graph of what comes from where when and goes where when - almost there
15:56:05Zevv./toast -pnr /usr/include/zlib.h \o/
15:56:27shashlickwhat happens? 😉
15:56:38ZevvI get a bunch of nim code, that almost compiles
15:57:47ZevvFeeding it GL.h - stressssstest!
15:59:55*PMunch quit (Remote host closed the connection)
16:00:04*Snircle joined #nim
16:02:23ZevvgTypeMap: "ptrdiff_t": "ByteAddress"
16:02:29Zevvva_list is harder
16:03:21Zevvlau5.1 API compiles!
16:03:36shashlickam looking at the zlib.h bugs
16:04:40Zevvgreat stuff this, shashlick!
16:08:23shashlickthanks Zevv 🙂
16:10:50shashlickyou probably want to skip the -r for zlib.h - it is pulling in random stuff
16:12:07shashlicksince zlib.h is in the standard location, there's no way to filter out includes from standard files
16:12:18shashlickyou only want zconf.h and zlib.h so probably just import those two
16:13:22*Trustable joined #nim
16:15:07*skellock quit (Ping timeout: 240 seconds)
16:17:35Zevvso what is the typical use case here - intsalling nimterop and then using it for binding what you need in your code, or is it ment to generate bindings that do not need nimterop as a dependency?
16:18:01shashlickyou can do both
16:18:12shashlickfor nimterop itself, i had to do the latter for tree-sitter
16:18:22shashlicksince i need tree-sitter to build in the first place
16:18:30shashlickbut as a consumer you could do either
16:18:46Zevver, did you bootstrap nimterop with nimterop?
16:18:58shashlicksome people like seeing the wrapper, others like the zig approach where it just does it internally
16:19:12shashlickya - i generated the tree-sitter wrapper with toast
16:19:29shashlickbut that older toast I built with tree-sitter wrapped by nimgen+c2nim
16:19:55Zevvah that makes sense
16:20:00shashlickhttps://github.com/genotrance/nimterop/tree/master/nimterop/treesitter
16:20:08Zevvselfhosting and bootstrapping always hurts my brain
16:20:27shashlicki honestly prefer the former approach since I want it to be seamless but didn't have much choice here 😄
16:20:41shashlickbut it is a nice showcase for both
16:21:33Zevvwell, time to include /usr/src/linux/include and start working on kernel mode Nim
16:26:22ZevvI guess you need a list of reserved identifiers to rwrite
16:26:39Zevvopenssl has struct fields called "object", for example
16:28:20Zevvor thLpt" in libpng
16:28:27Zevvsorry, "ptr" in libpng
16:28:53shashlickalready have that covered I think
16:29:52Zevvif conversion fails the error messages of toast go to stdout instead of stderr
16:30:08Zevvah cool
16:31:00shashlickpushed some fixes for C data types
16:31:36shashlicki think i have everything covered except va_list and internal_state
16:33:05Zevvwow, ogg and vorbis just go
16:33:21Zevvthings like callbacks are handled as well?
16:34:03shashlicknot sure - it handles func pointers in typedefs
16:34:07shashlickit might work
16:35:33Zevvcooking and kids first, playing more later. thanks!
16:36:16shashlickcool thanks for trying it out
16:39:38*absolutejam quit (Ping timeout: 245 seconds)
16:48:35*skellock joined #nim
16:49:38*Snircle quit (Ping timeout: 245 seconds)
16:49:55*BigEpsilon quit (Ping timeout: 268 seconds)
16:51:25shashlickis staticWalkDir() not available at compile time?
16:56:24FromGitter<mratsim> should be renamed to fakeStaticWalkDir then
16:56:27FromGitter<mratsim> :P
16:58:03shashlickdoesn't work 😞
16:58:04shashlickhttps://github.com/nim-lang/Nim/blob/devel/compiler/vmops.nim#L119
17:02:54*ng0 joined #nim
17:05:23*sknebel is now known as wow
17:05:28*wow is now known as sknebel
17:08:50*skellock quit (Ping timeout: 246 seconds)
17:22:07*aguspiza joined #nim
17:22:11*Snircle joined #nim
17:26:10Araqstefanos82: yeah? it doesn't crash the CIs though
17:26:18*darithorn joined #nim
17:26:46stefanos82Araq: I re-run it and it seems like there's a memory leak somewhere between the "macros" tests
17:26:59stefanos82it consumed all of my RAM and made my entire system unstable
17:27:46stefanos82before I run the second time, I had to close all of my applications while keeping conky open for surveillance
17:28:17stefanos82as soon as I hit the macros tests, boom; it jumped for 1.2GB memory consumption to nearly 8GB
17:28:23stefanos82thus, the system freeze
17:28:45stefanos82I left it open to finish the tests and after 10 minutes, it returned back to normal
17:29:05stefanos82but when you have other applications open and run the tests, it crashes
17:32:14Araqhmmm
17:46:15narimiranfederico3: @kaushalmodi updated his scripter notes, and Planet Nim again shows his whole "blog" (is is more like page than blog, IMO).
17:46:49federico3the whole article or all the articles in the blog?
17:47:35FromGitter<metasyn> hi nimsters~ is there a pattern / good way to hide or redirect stdout while running tests? for example, I have an error that is printed and a larger number of negative test cases, but it looks really messy when looking at the test output (since the errors are expected, and i don't need to see the output to assert they're correctly failing)
17:48:26federico3https://scripter.co/tags/nim/atom.xml narimiran: the blog itself is puttitng whole articles in the rss/atom feed instead of summaries
17:49:03federico3https://scripter.co/tags/nim/index.xml <-- inside the description block
17:51:16narimiran@kaushalmodi can you fix ^, because it makes Planet Nim unreadable?
17:53:30FromGitter<kaushalmodi> narimiran: oops
17:53:36FromGitter<kaushalmodi> let me remove notes from that feed
17:53:48federico3it might also break some readers by putting escaped html in the feed
17:53:49narimiranthat's certainly the easiest fix :)
17:53:55federico3according to https://validator.w3.org/feed/check.cgi
17:56:11FromGitter<kaushalmodi> Can the planet truncate the feed from each post to first 200 words or so and make the reader jump to the full article if interested?
17:56:42FromGitter<kaushalmodi> In any case, updating my blog template to allow ignoring certain posts from being added to the feed; might take a bit
17:57:15FromDiscord_<++x;> Hi.
17:57:51FromGitter<brentp> anyone know of a graph library for nim that has, e.g. lowest-common-ancestor and shortest-path functionality?
18:17:50Zevvnot that I know of. I happened to be looking for that for the Advent of Code contests, but didn't find any
18:25:38*craigger quit (Quit: bye)
18:25:52*craigger joined #nim
18:26:32FromGitter<kaushalmodi> narimiran, federico3: my feed should be good now
18:26:43narimirangreat, thanks :)
18:28:16Zevvshashlick: something keeps pulling ing "ptr int* = clong" if I recurse, how can I see where this originates?
18:29:16shashlickyou can get the preprocessor output with -p and guess positin
18:29:38shashlickI saw that too on recurse
18:29:56shashlickon zlib, but didn't see the need for recurse with zlib
18:30:08ZevvI know, but I see it with others as well
18:30:17shashlickits from the standard lib somewhere
18:30:19Zevvrecursive is lazy, would be nice if that "just works", ideally
18:30:23shashlicka bug in nimterop though
18:30:26Zevvyeah I figured but I can't find where
18:30:51Zevvsometimes gcc -E returns non-zero, but I don't see an error message
18:31:10ZevvOh I do, it was hidden in the noise. #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags!
18:31:11shashlickit should spit out the entire output
18:31:13Zevvthat's pretty clear
18:31:52shashlicki need a better way to show the error in preprocessing, that's for sure
18:32:05Zevvsplit stdout/stderr also
18:32:29shashlickright now i'm dealing with not having walkDir
18:32:30Zevvalso help output should go to stderr, convention
18:32:42Zevvbut that's in cligen
18:33:31ZevvSIGSEGV! :)
18:35:05*kapil____ quit (Quit: Connection closed for inactivity)
18:35:25*nsf quit (Quit: WeeChat 2.3)
18:38:35Zevvtypedef long int __intptr_t;
18:38:43Zevvthat's the culprit making the ptr int
18:39:16shashlicki see how it could be breaking us
18:39:42Zevvwhy is that? are the heuristics on names with 'ptr' or something like that?
18:40:03*floppydh quit (Quit: WeeChat 2.3)
18:40:13Zevvyes, there are :)
18:40:16shashlicki am replacing [u]intptr_t with ptr int
18:40:29Zevvyeah, I see
18:40:55shashlickthanks for opening the issues, will make it easier to track and fix
18:41:04ZevvI'll add this one
18:43:44ZevvHaha, float128
18:43:50ZevvThat was just deprecated last week from Nim :)
18:44:16*gmpreussner quit (Ping timeout: 250 seconds)
18:44:51*gmpreussner joined #nim
18:49:20*enow quit (Quit: Lost terminal)
19:21:32*zachk joined #nim
19:28:03*enow joined #nim
19:55:09FromGitter<kaushalmodi> federico3: How does the Nim planet update? Does it run via cron everyday?
19:56:07FromGitter<kaushalmodi> I have removed the long notes from the feed, and am just waiting for that to reflect on https://planet.nim-lang.org/
19:58:33*zachk quit (Changing host)
19:58:33*zachk joined #nim
20:02:08*fanta7531 quit (Quit: ...)
20:03:39*skellock joined #nim
20:04:06*absolutejam joined #nim
20:13:20federico3@kaushalmodi: yep, give it some time
20:26:06*vlad1777d joined #nim
20:26:57*druonysus quit (Quit: druonysus)
20:36:11*platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:37:37*zachcarter joined #nim
20:44:47*narimiran quit (Ping timeout: 244 seconds)
20:49:09FromGitter<Varriount> Zevv: Why was it deprecated?
20:53:28absolutejamdom96: you alive? :)
20:59:49Zevvnonstandard
21:01:24Zevvcpus do float64 and sometimes float80, but 128 has to fallback to sw on most platforms anyway
21:05:12FromGitter<zacharycarter> I just want to say - the improvements to Nim's explanation of errors is well observed by me, and continues to impress me
21:05:57FromGitter<zacharycarter> so thank you to everyone who is working on this - `Error: a case selecting discriminator 'kind' with value 'vkBoat' appears in the object construction, but the field(s) 'nCars' are in conflict with this value.` - I don't have any examples to compare this with previous iterations on-hand, but I can assure this is worlds better than what I first encountered when working with variant types in Nim.
21:06:40FromGitter<zacharycarter> I also just shared several paragraphs with co-workers about algebraic data types / sum types and how Nim utilizes enumerations to model them, in an effort to explain how enums have different implementations / effects
21:07:00FromGitter<zacharycarter> and pointed this error message improvement out to anyone that read - hopefully they appreciate the clarity as well, I think this is a superb trend
21:07:18*Trustable quit (Remote host closed the connection)
21:07:22FromGitter<zacharycarter> and addresses (IMO) one of the most major issues that people have complained about re: Nim for the years I have been following it
21:08:15ZevvWhat do you refer to by "several paragraphs [...] about algebraic data types / sum types and how Nim utilizes enumerations to model them"
21:08:38Zevvor was that your own writings?
21:08:41FromGitter<zacharycarter> the initial question I fielded was in regards to enumerations in TypeScript
21:09:01FromGitter<zacharycarter> it was my own writing - I put together a very contrived example of using sum types to model different types of transportation
21:09:25FromGitter<zacharycarter> and how with a discriminator - you could have different fields for each mode of transport
21:09:53FromGitter<zacharycarter> just to make the point to my co-worker, that every language flexes enumerations in different ways / has a different idea about how they should be leveraged and used
21:10:08FromGitter<zacharycarter> I think he was expecting me to be an expert on TS enumerations because I use enumerations elsewhere
21:10:09*skellock quit (Ping timeout: 268 seconds)
21:19:05FromGitter<alehander42> the way ts does adt is a bit weird
21:19:09FromGitter<alehander42> i always forget it
21:19:17FromGitter<alehander42> something with interfaces + tag
21:19:18FromGitter<alehander42> and `|`
21:27:53*oculux quit (Quit: blah)
21:28:56*oculux joined #nim
21:36:27*aguspiza quit (Ping timeout: 258 seconds)
21:45:02*skellock joined #nim
21:47:31*dom96_w joined #nim
21:47:55dom96_wabsolutejam: I certainly hope I am :)
21:50:44*zachcart1r joined #nim
21:51:04absolutejamwahey! great news :P
21:51:14absolutejamany chance you can please resend activation email for forums?
21:53:19*zachcarter quit (Ping timeout: 258 seconds)
21:53:20*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:58:30*skellock quit (Ping timeout: 272 seconds)
22:01:42FromGitter<brentp> I get a "recursive dependency" error on this:
22:01:49FromGitter<brentp> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c40fb4c1cb70a372af5e8d4]
22:01:55FromGitter<brentp> how can I make that work?
22:09:13FromGitter<brentp> for now, I just did:
22:09:18FromGitter<brentp> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c40fd0ecb47ec30005d9f9e]
22:18:26rayman22201@brentp Iterators currently don't support recursion iirc. Sorry.
22:19:12FromGitter<brentp> seems not. this works for me anyway.
22:19:19*dom96_w joined #nim
22:22:52FromGitter<deech> Is there any interest in adding a `{.noDefaultInitiaze.}` pragma or the like for variables I don't want to be initialized by default along with a compiler error if the user does not supply an initial argument?
22:24:11*zachcarter joined #nim
22:27:05*zachcart1r quit (Ping timeout: 244 seconds)
22:30:18*dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:32:32rayman22201@deech, in what context are you referring to? There is already a noinit pragma... https://nim-lang.org/docs/manual.html#statements-and-expressions-var-statement
22:38:50rayman22201I'm poking around the compiler internals, and using the ```typeToString``` function. This function returns 'ChildType:ObjectType'. how do I get just the 'ChildType' part without the ':ObjectType'... without the obvious string splitting answers lol. The right way, using the PType.
22:39:41FromGitter<deech> Had no idea that existed. Thanks!
22:40:13rayman22201👍 glad I could help
22:42:09rayman22201anybody with knowledge of the compiler internals awake?
22:44:41*rockcavera quit (Remote host closed the connection)
22:45:46*dom96_w joined #nim
22:46:27*dom96_w quit (Client Quit)
23:28:54*absolutejam quit (Ping timeout: 268 seconds)
23:31:58FromGitter<timotheecour> not sure i can help but shoot
23:33:03FromGitter<zacharycarter> if anyone has any recommendations regarding mini ITX builds focused on gaming - or general desktop builds focused on gaming - please see my messages in off-topic
23:33:51FromGitter<zacharycarter> I need to build / acquire a new machine - but I honestly don't have time to put in the research for a unique build - I'd be satisfied with something that works well for others and meets my needs.
23:36:34*sagax quit (Quit: Konversation terminated!)
23:39:24*leorize quit (Quit: WeeChat 2.3)
23:41:33rayman22201I got it... I think, lol. Thanks anyway.
23:48:07*krux02 quit (Remote host closed the connection)
23:49:31FromDiscord_<exelotl> is there a way to do backtick interpolation with strings in templates?
23:49:50FromDiscord_<exelotl> template incbin(name:untyped) = var name {.importc:"`name`_bin", header:"`name`_bin.h".}: cstring
23:50:53FromDiscord_<exelotl> I wanted to do something like this but it literally generates ``` #include "`name`_bin.h" ```
23:55:04FromGitter<zacharycarter> exelotl: I think I've faced this challenge before
23:55:13*skellock joined #nim
23:55:16FromGitter<zacharycarter> but... not with the C target - with the JS target
23:55:22FromGitter<zacharycarter> and using backticks for string interpolation :)
23:55:42FromGitter<zacharycarter> let me try to figure out how I solved it - it wasn't at all ideal and it was plenty messy
23:56:07FromDiscord_<exelotl> I see people doing it with the emit pragma.. but only for that
23:56:32FromGitter<zacharycarter> heh - you can see the hackiness here - https://github.com/zacharycarter/litz/blob/master/src/litz.nim#L108
23:56:37FromGitter<zacharycarter> it's terrible...
23:56:55FromDiscord_<exelotl> oof xD
23:57:02FromGitter<zacharycarter> I think importcpp was the key though - it allowed for more flexible import pragmas than importc
23:57:15FromGitter<zacharycarter> but `eval` made it all work
23:57:22FromGitter<zacharycarter> which wasn't ideal at all
23:58:10rayman22201You could do it with a macro instead. Still more code, but maybe more "nim" like, or at least cleaner
23:58:38FromDiscord_<exelotl> yeah I think I'm gonna go the macro route
23:58:45FromGitter<zacharycarter> probably best
23:59:23*skellock quit (Ping timeout: 246 seconds)