<< 28-06-2019 >>

00:01:17FromGitter<kayabaNerve> ... mySeq.del(0) ruins the order?
00:01:53FromGitter<kayabaNerve> Damn. I have some code to update.
00:14:55*stefanos82 quit (Quit: Quitting for now...)
00:49:51*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
01:07:13*mal`` quit (Ping timeout: 248 seconds)
01:10:17*gangstacat joined #nim
01:15:43*mal`` joined #nim
01:31:09*deech_ quit (Remote host closed the connection)
01:31:27*deech_ joined #nim
01:33:39*deech_ quit (Remote host closed the connection)
01:33:47*Voltist joined #nim
01:33:59*deech_ joined #nim
01:44:46*Tyresc quit (Quit: WeeChat 2.5-dev)
01:50:28*deech__ joined #nim
01:53:34*deech_ quit (Ping timeout: 272 seconds)
02:17:25*oculux quit (Ping timeout: 246 seconds)
02:21:18*oculux joined #nim
02:38:11*dddddd quit (Remote host closed the connection)
02:41:09*Voltist quit (Remote host closed the connection)
02:44:51*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
02:45:13*theelous3_ joined #nim
02:45:46*laaron joined #nim
04:19:12FromGitter<zacharycarter> It's late - but congrats on 0.20.0 & RC1
04:19:15FromGitter<zacharycarter> !!!
04:40:10*theelous3_ quit (Ping timeout: 252 seconds)
04:40:45*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
04:41:02*laaron joined #nim
04:42:00*nsf joined #nim
05:35:59*athens joined #nim
05:39:49*brakmic joined #nim
05:40:26*narimiran joined #nim
05:43:55*brakmic_ joined #nim
05:47:13*brakmic quit (Ping timeout: 248 seconds)
06:08:37FromGitter<rokups> del vs delete is terrible and confusing api design :(
06:09:53Zevvagree
06:12:44*laaron quit (Remote host closed the connection)
06:13:33*laaron joined #nim
06:15:37*PMunch_ is now known as PMunch
06:20:12*brakmic_ quit (Read error: Connection reset by peer)
06:20:37*brakmic joined #nim
06:21:31*brakmic quit (Read error: Connection reset by peer)
06:21:38*brakmic_ joined #nim
06:27:10*disruptek quit (Ping timeout: 272 seconds)
06:27:16leorizeI think I found some weird compiler quirks
06:27:59leorizeso currently https://github.com/nim-lang/Nim/pull/11605 is failling
06:28:18leorizebut it will work again if you apply this patch: http://ix.io/1MYJ/diff
06:28:22leorizeand I don't know why
06:29:21*disruptek joined #nim
06:29:33leorizeAraq: ^ any possible pointers?
06:34:21*solitudesf joined #nim
06:52:24*GitterIntegrati4 quit (Read error: Connection reset by peer)
06:52:26*k0mpjut0r quit (Write error: Connection reset by peer)
06:52:26*Miguelngel[m] quit (Remote host closed the connection)
06:52:26*gh0st[m] quit (Read error: Connection reset by peer)
06:52:28*planetis[m] quit (Read error: Connection reset by peer)
06:52:28*mattisme quit (Read error: Connection reset by peer)
06:52:30*Connor[m] quit (Remote host closed the connection)
06:52:31*zeroDotTwenty[m] quit (Remote host closed the connection)
06:52:34*lqdev[m] quit (Write error: Connection reset by peer)
06:52:34*BitPuffin quit (Write error: Connection reset by peer)
06:52:38*meff[m] quit (Write error: Connection reset by peer)
06:52:42*TheManiac[m] quit (Write error: Connection reset by peer)
06:52:46*narimiran[m] quit (Read error: Connection reset by peer)
06:52:47*leorize[m] quit (Remote host closed the connection)
06:52:49*LeonardoMariscal quit (Remote host closed the connection)
06:52:49*nergal[m] quit (Write error: Connection reset by peer)
06:52:50*macsek1911[m] quit (Remote host closed the connection)
06:52:51*yglukhov[m] quit (Write error: Connection reset by peer)
06:52:52*zielmicha[m]1 quit (Write error: Connection reset by peer)
06:52:52*skrylar[m] quit (Write error: Connection reset by peer)
06:52:52*spymasterd[m] quit (Write error: Connection reset by peer)
06:52:52*Manny8888 quit (Write error: Connection reset by peer)
06:52:55*isaac[m]1 quit (Write error: Connection reset by peer)
06:52:56*cfv[m] quit (Remote host closed the connection)
06:52:56*Demos[m] quit (Remote host closed the connection)
06:52:56*xomachine[m] quit (Remote host closed the connection)
06:53:27*Trustable joined #nim
06:53:34*dddddd joined #nim
06:53:49*purebadger joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:19*athens quit (Quit: Leaving)
07:00:46*krux02 joined #nim
07:00:52*Connor[m] joined #nim
07:04:48*gmpreussner joined #nim
07:21:45*Demos[m] joined #nim
07:21:45*BitPuffin joined #nim
07:21:45*Manny8888 joined #nim
07:21:45*GitterIntegratio joined #nim
07:21:46*gh0st[m] joined #nim
07:21:46*isaac[m] joined #nim
07:21:46*k0mpjut0r joined #nim
07:21:46*lqdev[m] joined #nim
07:21:46*leorize[m] joined #nim
07:21:46*mattisme joined #nim
07:21:46*nergal[m]1 joined #nim
07:21:52*macsek1911[m] joined #nim
07:21:52*cfv[m] joined #nim
07:21:52*Miguelngel[m] joined #nim
07:21:52*spymasterd[m] joined #nim
07:21:53*zielmicha[m]1 joined #nim
07:21:53*planetis[m] joined #nim
07:21:53*skrylar[m] joined #nim
07:21:54*LeonardoMariscal joined #nim
07:21:54*narimiran[m] joined #nim
07:21:54*TheManiac[m] joined #nim
07:21:54*yglukhov[m] joined #nim
07:21:55*xomachine[m] joined #nim
07:21:55*meff[m] joined #nim
07:21:58*zeroDotTwenty[m] joined #nim
07:23:23*nsf quit (Quit: WeeChat 2.4)
07:23:56Zevv*
07:38:51PMunch*
07:39:19narimiran**
07:39:43FromGitter<alehander42> ^
07:39:55FromGitter<alehander42> pascal style
07:41:45FromGitter<alehander42> btw guys do you have examples of easy to reproduce gc bugs in nim
07:41:58FromGitter<alehander42> or just small programs that stress the gc
07:42:05FromGitter<alehander42> e.g. making it do a lot of allocations and deallocations
07:45:14Araqthe issue tracker has a GC tag
07:45:23Araqand we have tests/gc
07:47:00FromGitter<alehander42> thank you
07:47:02*tjmac joined #nim
07:47:20FromGitter<alehander42> what do you use typically to debug those gc leaks
07:47:37FromGitter<alehander42> valgrind? gdb? just logging?
07:48:08FromGitter<alehander42> or a combo
07:48:45*Vladar joined #nim
07:48:46*dwdv joined #nim
07:53:58PMunchHmm, where there some precedence rule changes around `==`?
07:55:23PMunchI'm sure that `if some("Hello")?.find('l') == 2` used to work (using my existential operator for options)
07:55:39PMunchBut now it complains that find only takes a character
07:56:15FromGitter<alehander42> what does dumpTree show?
07:56:46PMunchGood question
07:57:06PMunchBy the way if some("Hello")?.find('l').`==`(2) works fine
08:00:00PMunchhttp://ix.io/1MYY
08:02:22AraqPMunch, nothing changed, it's something else
08:02:39PMunchHmm
08:03:10FromGitter<alehander42> ?. has
08:03:12FromGitter<alehander42> higher precedence
08:03:31AraqI told you about this gotcha but you weren't listening, I think.
08:03:38FromGitter<alehander42> some("Hello") ?. (find('l') == 2)
08:03:44FromGitter<alehander42> it seems
08:03:56Araqyup
08:04:16FromGitter<alehander42> is this true for all custom operators
08:04:16PMunchAraq, you were?
08:08:49PMunchI'm guessing I can't control precedence somehow?
08:09:11Araqhttps://www.twitch.tv/araq4k
08:10:21FromGitter<alehander42> it became offline for me
08:10:35FromGitter<alehander42> hm error on my end
08:10:40FromGitter<alehander42> nvm
08:16:49livcdAre you streaming ?
08:17:40FromDiscord_<djazz> it's live
08:19:26FromDiscord_<djazz> Araq: who is they other guy talking?
08:19:29FromDiscord_<djazz> the*
08:19:32livcdnarimiran
08:19:49FromGitter<alehander42> isnt it krux02
08:19:53narimiranit's me
08:20:00FromDiscord_<djazz> 😃
08:20:05FromGitter<alehander42> wow
08:20:05livcdkrux02 sounds like Araq so no
08:29:52*dddddd quit (Ping timeout: 268 seconds)
08:33:58FromDiscord_<djazz> re:linting, in JavaScript i use StandardJS (which uses eslint) and it has a ton of rules https://standardjs.com/rules.html @Araq @alehander42
08:36:39FromDiscord_<djazz> it is very strict
08:36:48FromDiscord_<djazz> but having some nim linter would be nice
08:36:57FromDiscord_<djazz> will try nimpretty someday
08:38:41*dddddd joined #nim
08:39:26*floppydh joined #nim
08:48:27*hoijui joined #nim
08:51:26*Vladar quit (Remote host closed the connection)
08:51:52FromGitter<wsdjeg> does nim has mail list? for example Google group?
08:56:03FromDiscord_<djazz> What is a tainted string? I found https://nim-lang.org/docs/system.html#TaintedString but clicking the link in "see taint mode for details" leads nowhere.
08:58:45narimiranhttps://nim-lang.org/docs/manual_experimental.html#taint-mode
09:03:52FromDiscord_<djazz> ah, thanks! So my custom readstring proc for a stream should return a TaintedString like readStr etc.
09:04:52FromDiscord_<djazz> (I needed a custom one to read strings written by .NET's BinaryWriter
09:04:56FromDiscord_<djazz> )
09:07:58PMunchHmm, is it possible to define a procedure that takes an argument that can be converted.
09:08:16PMunchLike you can do with varargs[theType, convertProc]
09:11:32PMunchHmm, wut: http://ix.io/1MZd
09:12:28*Vladar joined #nim
09:13:52PMunchOh, that was confusing.. I was missing the return type and `=`
09:14:13*ikan-keli_ quit (Ping timeout: 245 seconds)
09:15:23*ikan-keli_ joined #nim
09:25:44*Trustable quit (Remote host closed the connection)
09:30:52FromGitter<alehander42> djazz i can try to adapt a cop of https://github.com/metacraft-labs/fast-rubocop for nim to see if it works
09:30:59FromGitter<alehander42> basically i thought i can plug different parsers
09:31:07FromGitter<alehander42> and reuse similar logic for different languages
09:31:27FromGitter<alehander42> (of course a real linter would be its own lib maybe)
09:32:34FromDiscord_<djazz> yep, or look at https://eslint.org/
09:32:41FromDiscord_<djazz> great documentation on how it works too
09:33:25*Trustable joined #nim
09:37:24FromGitter<alehander42> thank you!
09:37:28FromGitter<alehander42> i will look at it more
09:37:35FromGitter<alehander42> it looks good yes <3
09:40:17FromDiscord_<djazz> https://eslint.org/docs/developer-guide/
09:45:51*dddddd quit (Remote host closed the connection)
09:49:12FromDiscord_<djazz> nim has bitwise ops like and, or, xor, shr, shl. are there something in nim similar to other langs that have bitwise assignments? |=, &=, >>=, <<=, ^=
09:49:52Araqimport bitops
09:50:01Araqit offers setBit() etc
09:51:42Araqx |= (1 << N) is actually pretty obscure for 'setBit'
09:52:07AraqNim's inofficial motto is "Copying bad design is not good design."
09:52:20FromGitter<arnetheduck> Araq, any thoughts or change in stance on `func` in the std lib? I've run into several candidates lately for func-ification so they can be called from other funcs
09:53:42FromDiscord_<djazz> hmm, not sure how setBit is used
09:55:17FromDiscord_<djazz> can I make `v = v shr 7` simpler?
09:55:52FromDiscord_<djazz> in other languages that would be `v <<= 7`
09:56:35FromDiscord_<djazz> Maybe something similar to `inc`
09:58:26Araqdjazz, if you find a good short name for it. I dunno. 'v = v shr 7' is fine
09:59:00Araqtemplate shrip(a, b) = a = a shr b # "inplace shr"
09:59:25Araqshrip v, 7
10:00:47FromDiscord_<djazz> aha
10:00:55FromDiscord_<djazz> `cast[byte](v)` just trims of the excess bits and sets the type right?
10:01:04Araqit's so easy to introduce your own helpers, don't bother us :P
10:01:10FromDiscord_<djazz> yeah
10:01:30Araqyeah, well 'cast' is always a bitwise reinterpretation of the data
10:01:42FromDiscord_<djazz> was just checking if there was something existing
10:02:04*FromDiscord_ <djazz> my 1 week with nim is not much in comparison ;)
10:02:11FromGitter<alehander42> i cant pass var to threads
10:02:12FromGitter<alehander42> right
10:02:42FromGitter<alehander42> var arg
10:02:45FromDiscord_<djazz> fixed the celeste code, but havent been able to test it on the RPi yet. Excited 😄
10:03:03FromDiscord_<djazz> will try port the texture packer to nim too
10:12:14*hoijui quit (Quit: Leaving)
10:17:34Zevvdjazz: template `shl`(x, n) = x = x shl n
10:18:56AraqZevv, doesn't work well because 'shl' is a keyword
10:19:11Zevv`shl`(a, 7)
10:19:16Zevvit stinks indeed but it works
10:20:15Zevvtemplate `<<=`(x, n) = x = x shl n
10:20:16Zevv :)
10:22:47FromGitter<rokups> on the topic of offensive nim practices - i made these for myself as well https://gist.github.com/046f76646dbd96e4ae127293265c3191
10:32:09*abm joined #nim
10:34:16Araqarnetheduck: meh. it would be a set of massive PRs
10:34:43Araqand I would need to use debugEcho everywhere.
10:35:36FromGitter<arnetheduck> well, the std lib is due for a massive set of pr's anyway if you want to keep it relevant.. since you can't call a non-func from a func, it means that most of the std lib is useless when you're after the guarantees afforded by nosideeffect
10:36:29AraqI can call a noSideEffect proc from a func
10:39:38*purebadger quit (Ping timeout: 245 seconds)
10:41:16FromGitter<wsdjeg> does nim has Google groups?
10:41:19*stefanos82 joined #nim
10:41:43lqdev[m]shouldn't it be called shrIn?
10:42:13lqdev[m]according to NEP1, an -In suffix should be added to in-place operations
10:42:18vegaiwhat, func isn't used in stdlib?
10:42:27vegaidoesn't sound like a difficult PR
10:42:53vegaimore like mechanical and rerunning the unit tests a lot
10:43:33vegaishouldn't a thing like that be of very high importance to do before 1.0
10:43:54vegais/thing/chore/
10:43:57*purebadger joined #nim
10:56:51FromDiscord_<djazz> `s/proc/func/g`
11:00:59FromGitter<arnetheduck> Araq, yes, but noSideEffect is not maintained across the stdlib either
11:02:53FromGitter<arnetheduck> and inferred things are not that useful.. when I'm reading the proc prototypes I want to know up fron that I can rely on them being nosideeffect and that it was the intent of the developer to make them so, so they don't come back and pull the rug from under my feet..
11:04:09FromGitter<arnetheduck> stuff being `proc` tells me that the API is either broken or might become broken in the future and the author didn't want to exclude the possibility
11:05:30FromGitter<danielecook> How do you detect whether stdin is available?
11:05:54FromGitter<danielecook> I've seen this `getFileInfo(stdin).id.file==37` but it doesn't seem to work
11:07:41FromGitter<danielecook> Would you go off the file id / device? id: (device: 0, file: -364440485)
11:23:51FromGitter<danielecook> `isatty` also presents issue when I run the binary on an HPC...presumably someting to do with it being non-interactive
11:25:55*laaron- joined #nim
11:29:32*laaron quit (Ping timeout: 260 seconds)
11:45:10FromGitter<alehander42> i agree that it should be possible to call a lot of stuff from func
11:45:44leorize[m]detect if stdin is available? what do you mean?
11:45:46FromGitter<alehander42> about debugecho, one can always have a simpler alias
11:46:05FromGitter<alehander42> or even redefine echo = debugecho in debug mode araq
11:46:09narimiranprintf, as in func :P
11:48:00FromGitter<danielecook> If you are writing a CLI application and you pass something in from a pipe, how do you detect there is incoming data from stdin?
11:48:05FromGitter<danielecook> What is the best way of doing so?
11:48:38FromGitter<danielecook> e.g. `echo "this is piped in" | nim_cli_app` should operate differently than `nim_cli_app`
11:49:05FromGitter<kaushalmodi> @danielecook isatty has worked well for me.. maybe it needs a bug report.. hopefully someone else using HPC can help you out
11:49:09FromGitter<kaushalmodi> https://scripter.co/nim-check-if-stdin-stdout-are-associated-with-terminal-or-pipe/#nim
11:56:04Araqarnetheduck: meh, ok, you win.
11:56:12Araqfunc the stdlib
11:56:42FromGitter<arnetheduck> no, you win :) you'll have a more beautiful std lib with fewer bug reports eventually :)
11:58:59FromDiscord_<djazz> better stdlib +1
11:59:47Araqmore beautiful, ok, fewer bugs, unlikely. most effects don't pull in their weight and don't find enough bugs. but I've argued about this before and got no support in removing the effect system.
12:02:53federico3IMO we should encourage using it more
12:03:36Araqon the other hand the lock levels are still super cool and are waiting for their chance once Nim is better at sharing memory
12:03:48narimiranon that note, opinions about `echo` becoming what `debugEcho` is now?
12:05:56FromGitter<arnetheduck> nah, that would be sad. the whole point is that you develop `func`'s with a slightly different mindset where there are more guarantees by compiler and type system working in unison.. if you find yourself relying too much on `echo` in such an environment, it's a bit of smell
12:06:03*Snircle joined #nim
12:06:42FromGitter<kaushalmodi> narimiran: that would make most of funcs to actually have side effects (on stdout)
12:06:52AraqI would even go so far and say there should be an --echo:off switch
12:06:54lqdev[m]please just don't turn Nim into another functional PL thank you
12:07:02FromGitter<kaushalmodi> I think people should know the implication of using debugEcho in a func
12:07:18Araqfor me 'echo' is debug-only, for CLI you should use stdout.write
12:07:35FromGitter<kaushalmodi> Araq: aren't they the same?
12:07:46Araqfor the JS target we map 'echo' to console.log
12:07:53federico3Araq: that's really not clear in the documentation. Most code uses echo
12:08:05Araqfederico3: I know
12:08:40Araqkaushalmodi: debugEcho and echo have the same implementation but echo has a side-effect and debugEcho hasn't
12:08:44FromGitter<kaushalmodi> It all begins with the canonical `echo "hello world" ` :P
12:08:51FromGitter<kaushalmodi> Araq: I know
12:09:15FromGitter<kaushalmodi> But using debugEcho, one is more thoughtful of that sideeffect
12:09:34federico3reinventing logging :(
12:10:23Araq;-)
12:14:33*purebadger quit (Quit: WeeChat 2.5)
12:24:31FromGitter<arnetheduck> logging is also a side effect
12:26:33*Trustable quit (Remote host closed the connection)
12:27:19FromGitter<alehander42> lqdev[m]: we're far from functional
12:27:43FromGitter<alehander42> this is more about side effects: people can still choose not to use it
12:28:19FromGitter<rokups> i wonder how many libs on nimble actually use siedeeffects
12:28:35FromGitter<alehander42> yaml!
12:28:36FromGitter<alehander42> i think
12:29:02FromGitter<rokups> your way of saying "only one"? :trollface:
12:29:07FromGitter<alehander42> well with func i think more will come
12:29:50FromGitter<rokups> do you have some writeup what this `func` will be?
12:30:07narimiran"will be"? it already is
12:30:14FromGitter<alehander42> yeah maybe not popularized
12:30:23narimiranfunc == proc {.noSideEffect.}
12:30:26FromGitter<arnetheduck> you can keep on using side-effect-free code in your side-effect-ful code.. it's just the other way around that doesn't work.
12:30:27*FromGitter * rokups is looking into manual
12:30:30FromGitter<rokups> ohh
12:31:45FromGitter<arnetheduck> narimaran, that's not true unfortunately.. it's similar but not transparent (the equivalence is superficial and doesn't carry over to all cases - for example they're separate ast types)
12:32:35FromDiscord_<djazz> funky!
12:32:57FromGitter<alehander42> what are cases where they differ
12:36:20FromGitter<arnetheduck> anywhere in the compiler where there's a `n.kind == nkProc` :) mostly overload resolution, generics, corner cases, stuff like that.. I started funcifying some parts of `system.nim` but stopped when the state of the compiler became apparent.. will try again, but with slightly more peripheral code to begin with, too many issues otherwise. I suspect lots of macro code will be broken as well.
12:37:52*ikan-keli_2 joined #nim
12:37:53*ikan-keli_ quit (Ping timeout: 248 seconds)
12:39:42FromGitter<arnetheduck> the good news is that there's a lot of stuff which shouldn't be broken , which isn't really used in any of those contexts directly.. func
12:41:02FromGitter<arnetheduck> they usually form consistent and sound building blocks that you glue together afterwards, which is also why you often don't need to `echo` around them..
12:42:26*envoyt joined #nim
12:44:49FromGitter<alehander42> agree, also a bit easier to test
12:45:09FromGitter<alehander42> and optimize? i guess
12:45:42lqdev[m]I'm not getting line info in a stack trace entry, something wrong on my side?
12:46:09lqdev[m]ah, it was --opt:speed
12:46:24lqdev[m]I suppose I don't need it now, as -Og is the default
12:47:43FromGitter<arnetheduck> optimizer.. well yeah, though it's enough that the compiler can deduce it. `func` places a hard boundary making the compilers life easier perhaps (this is true in C, less so in nim which fully recompiles everything all the time)
13:01:45Zevvwhat happens if the programmer lies or is mistaking about noSideEffect, UB?
13:03:38narimiranZevv: https://play.nim-lang.org/#ix=1N0l
13:06:24Zevvso this is guarenteed to be inferred at compile time?
13:06:31Zevvthen why should I use 'func' anyway?
13:06:53*natrys joined #nim
13:08:32narimiranhttps://play.nim-lang.org/#ix=1N0n
13:08:43*floppydh quit (Quit: WeeChat 2.5)
13:08:55narimiranbtw, PMunch, playground doesn't highlight `func` :P
13:12:37Zevvnarimiran: https://play.nim-lang.org/#ix=1N0n But why is it not inferred here that setSome() has side effects
13:12:45ZevvI lied here, but noone cares
13:12:54narimiranZevv: wrong link
13:13:11narimiranclick on 'share to ix', before sharing url
13:13:22Zevvow wait. http://ix.io/1N0p/nim
13:13:53FromGitter<kaushalmodi> Zevv: when you click on "share to ix", it updates the playground link in the address bar too
13:14:01Zevvyeah I know now :)
13:14:06FromGitter<kaushalmodi> ok :)
13:15:03narimiranouch
13:15:11leorize[m]Zevv: side effects in Nim is not the fp kind of side effects
13:15:49leorize[m]also tricking the compiler is possible, the implementation of assert does that :p
13:16:13Zevvyeah, explicitly tricking is ok. But I'm modifying state, which is kind of the definition of side effects
13:16:39Zevvow wait, "This means that the proc/iterator only changes locations that are reachable from its parameters"
13:17:58Zevvknowing this, I'll have to change my behaviour and start using 'func' everywhere unless 'proc' is needed; similar to the basic rule for 'let' vs 'var'
13:19:51narimiranthat's what i did in my personal projects
13:20:11narimiraneverything is func/let, unless it can't be
13:23:46Zevvwell, it seems I have a good progamming style, I just did a global search s/proc /func /g replace for all my files, and all still works.
13:24:43PMunchnarimiran, should be fixed as soon as the cache refreshes :)
13:28:00Zevvleorize[m]: noSidEffects is cool, but it is slightly confusing that the semantics are different from other languages. Let's add {.noReallyNoSideEffects.} as well!
13:29:52FromDiscord_<djazz> fun when you get an error like this, looks like the nim I use was built on Travis! `/Users/travis/build/nim-lang/nightlies/nim/e7471cebae2a404f3e4239f199f5a0c422484aac/lib/system/fatal.nim(39) sysFatal`
13:30:15FromDiscord_<djazz> this is stable nim from choosenim
13:30:17FromDiscord_<djazz> 😄
13:30:29FromDiscord_<djazz> again with that full path..
13:31:31FromDiscord_<djazz> got it nim secret: `import os; normalizePath ""`
13:32:03FromDiscord_<djazz> (actual error: `Error: unhandled exception: index 27 not in 0 .. 26 [IndexError]`)
13:34:59FromDiscord_<djazz> Shouldnät normalizePAth convert backlashes on mac/Linux?
13:35:13FromDiscord_<djazz> is there a proc for that?
13:35:39FromDiscord_<djazz> "Returns a normalized path for the current OS."
13:35:54FromGitter<kaushalmodi> djazz: you mean convert `"foo\bar"` to `"foo/bar"`?
13:36:23FromGitter<kaushalmodi> 1) `"foo\\bar"` to `"foo/bar"`
13:36:41*envoyt quit (Read error: Connection reset by peer)
13:37:02*envoyt joined #nim
13:37:22leorize[m]Zevv: that's called {.pure.}, which we don't have :p
13:38:18FromDiscord_<djazz> kaushalmodi: yes
13:38:41FromGitter<kaushalmodi> not sure if this answers your case, but `"foo/bar"` works on windows too
13:38:42FromDiscord_<djazz> strutils.replace(p, "\\", "/") should be done automatically, no?
13:38:56narimirandjazz: do you always have these "index is one too high" problems? :D (it was happening yesterday on your stream also, IIRC)
13:38:57FromDiscord_<djazz> ah, discord ate one \\
13:39:05FromGitter<kaushalmodi> I even like: ⏎ ⏎ ```from os import `/` ⏎ echo "abc" / "def"``` [https://gitter.im/nim-lang/Nim?at=5d1618792be6a2404dde3fd9]
13:39:12leorize[m]@djazz what if the user have \ in their file name? :p
13:39:14FromDiscord_<djazz> narimiran: that was a completely different issue XD
13:39:38FromGitter<kaushalmodi> leorize: such users will learn some lesson :P
13:39:40narimiranbut i remember seeing "N+1 is not in 0 .. N range" :D
13:40:10FromDiscord_<djazz> leorize[m]: well yeah, you're right, \\ is a valid character in a filename
13:40:25*dddddd joined #nim
13:41:23leorize[m]I usually add some backslash in the filename if I want to irritate windows users :p
13:49:15PMunchHmm, is it possible to call something from a macro that's not exported?
13:49:17FromGitter<danielecook> @kaushalmodi yeah I tried out the options on that site no luck
13:49:26FromGitter<danielecook> isatty works locally but not in non-interactive mode
13:49:33FromDiscord_<djazz> yep, those pesky windows users! using backslahes in paths
13:53:02FromGitter<kaushalmodi> @danielecook May be if you can provide a recipe to show that bug and create a bug report. What do you mean by non-interactive mode? Can that can be created locally?
13:53:37*stefanos82 quit (Quit: Quitting for now...)
13:53:40FromGitter<kaushalmodi> btw that site is my blog :)
13:53:56*lritter joined #nim
13:58:02FromGitter<danielecook> @kaushalmodi oh haha ok cool
13:58:08FromGitter<danielecook> Ok Let me see if I can recreate it
13:58:21FromGitter<danielecook> One way might be to execute in screen or similar...i'll experiment with that
13:58:38PMunchI basically want to import the options module and my optionsutils module in a safeoptions module and hide get and unsafeGet from options
14:04:06FromDiscord_<djazz> how do I assign a value to multiple variables?
14:04:13FromDiscord_<djazz> I have tried r = g = b = x
14:04:19FromDiscord_<djazz> r, g, b = x
14:04:29FromDiscord_<djazz> the last one is mentioned in Tut 1
14:05:10Zevvassignment != initialisation
14:05:54FromGitter<juancarlospaco> Hi
14:07:22FromDiscord_<djazz> I guess it only works with var/let
14:07:35FromDiscord_<djazz> "var x, y = 3 # assigns 3 to the variables `x` and `y`"
14:08:39leorizePMunch: use bindSym
14:09:27FromDiscord_<kodkuce> hmm if i have Class1 and it has Class2 and Class2 has variables v1,v2,v3,v4... do i have for to put * for every variable, i thnked its enought i puted it on Class2 itself but am getting unacessable if i dont put on each var
14:09:39FromDiscord_<kodkuce> hmm if i have Class1 and it has Class2 and Class2 has variables v1,v2,v3,v4... do i have for to put * for every variable, i thnked its enought i puted it on Class2 itself but am getting unacessable if i dont put on each var, that normal behavior
14:09:50leorizeplease avoid editing on discord
14:09:56narimiranhey kodkuce/poopBot! long time no see :)
14:10:01FromGitter<mratsim> yes you have to export every field you want public
14:10:09PMunchleorize, bindSym?
14:11:10leorizeyea, once you bound the symbol you can have the macro generate calls for it without the need of it being exported
14:11:24leorizeunless I misunderstood what you are trying to do
14:14:54PMunchWell, I have a module optionsutils. It imports options and has macros that uses isSome and unsafeGet in a defined way to create a safe pattern for accessing option values. I now want to create a safeoptions module that exposes the Options type, along with only the safe pattern macros from optionsutils, and the safe parts of options.
14:15:47PMunchSo what I want to do is hide stuff from options, but export some stuff
14:15:59PMunchBut still allow the macro to call the hidden stuff
14:16:58leorizethen just bindSym what you need
14:17:20leorizeas long as stuff don't get in the `export` line, you'll be fine
14:18:00leorizeimport the entire `options` module, then `export` for operations you want to expose
14:18:21leorizefor the macro to generates call to those unexported procs, bindSym them
14:18:45leorizefor templates, `bind` should be enough
14:21:10*clyybber joined #nim
14:21:26PMunchHmm, how do I export a type?
14:21:38PMunchexport Option doesn't seem to work..
14:22:33leorizepretty sure you can `export except`, no?
14:23:54FromDiscord_<kodkuce> sorry for editing in discord i alwes frogot 😦 , hi narimiran my psu died so i ordered new one, then it worked for 2 days then PC died again then i went to PC service they changed my eprom chip and now it works
14:24:17PMunchHmm, I get undeclared identifier: 'Option' when i use import options; export Option in my safeoptions file
14:25:04leorizehmm, just tried on the playground and it's not yelling at me
14:25:33PMunchLink?
14:25:44leorizehttps://play.nim-lang.org/#ix=1N0H
14:26:24PMunchAh yeah, that works fine. But importing from that doesn't work..
14:26:44leorizepossible bug then?
14:27:10PMunchHmm, could be..
14:27:12leorizefor now you can do this I guess: https://play.nim-lang.org/#ix=1N0I
14:28:02PMunchUgh, I'm an idiot..
14:28:11PMunchForgot I was working in a Nim module
14:28:16PMunchAnd I forgot to re-install it..
14:28:41leorizenimble develop
14:30:44PMunchHmm, bindSym doesn't seem to work..
14:31:05*envoyt quit (Ping timeout: 258 seconds)
14:31:14*hoijui joined #nim
14:31:32*envoyt joined #nim
14:32:28leorizePMunch: https://nim-lang.github.io/Nim/manual.html#macros-bindsym
14:34:22PMunchHmm, maybe it's an issue with quote do:
14:34:44PMunchI tried to let x = bindSym"isSome" and then use `x` in my quote statement
14:35:09leorizepossibly
14:36:02PMunchHmm, looking at the macro output it does appear as Sym "isSome"
14:40:02PMunchOh well
14:40:04*PMunch quit (Remote host closed the connection)
14:53:19*envoyt quit (Ping timeout: 258 seconds)
14:55:26*envoyt joined #nim
15:00:29*dwdv quit (Quit: quit)
15:25:02*brakmic_ quit (Ping timeout: 245 seconds)
15:26:01*brakmic_ joined #nim
15:29:14FromGitter<alehander42> huh i guess it makes sense
15:29:16FromGitter<alehander42> for func
15:29:21FromGitter<alehander42> but still a bit weird
15:29:31FromGitter<alehander42> so this means it can have far reaching effects
15:29:40FromGitter<alehander42> and change e.g. my global variables
15:30:06FromGitter<alehander42> @arnetheduck one optimization can be that you can automemoize some pure functions
15:30:24FromGitter<alehander42> but i am not sure if this is done a lot: maybe if a hint is given or for small inputs
15:30:36FromGitter<alehander42> <3
15:30:38FromGitter<alehander42> ops
15:30:42FromGitter<alehander42> you can lose memory
15:31:31FromGitter<arnetheduck> loop invariant hoisting is pretty common, ie you move constant expressions out of loops, something you can only do with pure functions
15:32:03FromGitter<arnetheduck> constant, in the sense of constant for the loop duration
15:32:20FromGitter<alehander42> yeah
15:32:36FromGitter<alehander42> but global?
15:35:23FromGitter<arnetheduck> not really, unless the variables passed in are constant
15:35:56FromGitter<arnetheduck> so basically, it could replace `sin(20)` with the resulting float
15:36:02FromGitter<alehander42> yeaah my point was
15:36:07FromGitter<alehander42> that you can have a runtime table
15:36:12FromGitter<alehander42> but its better to use a
15:36:14FromGitter<alehander42> pragma for that indeed
15:36:18FromGitter<alehander42> so its obvious in the code
15:36:19*tjmac left #nim ("-bye")
15:36:20FromGitter<alehander42> the payoff
15:36:37FromGitter<alehander42> tradeoff*
15:41:50FromGitter<arnetheduck> don't think compilers will be smart enough to do that automagically at least :)
15:42:20*theelous3 joined #nim
15:48:46*laaron joined #nim
15:49:00*laaron- quit (Remote host closed the connection)
15:50:04FromGitter<alehander42> well: i see a func(int8), i say : ok lets create a table FUNC_RESULTS and patch it to cache stuff there (or to directly check the table) if the code size of the func is big enough so we know that it might be slower than accessing a table
15:50:27FromGitter<alehander42> but yeah its a choice thats best left to the user
16:10:09*deech__ quit (Ping timeout: 248 seconds)
16:32:30*nsf joined #nim
16:38:08*Trustable joined #nim
16:40:01*vlad1777d__ quit (Ping timeout: 248 seconds)
16:42:57*hoijui quit (Ping timeout: 245 seconds)
16:52:14*vlad1777d__ joined #nim
16:57:58*vlad1777d__ quit (Ping timeout: 245 seconds)
16:59:03*vlad1777d__ joined #nim
17:11:35*narimiran quit (Remote host closed the connection)
17:31:36*abm quit (Quit: Leaving)
17:42:06*deech__ joined #nim
17:51:54*hoijui joined #nim
18:02:20*ehmry quit (Remote host closed the connection)
18:03:22leorizewhat is the preferred way to create cli interfaces?
18:03:34leorizelast time I check there's docopt and cligen
18:03:45solitudesfcligen
18:05:13solitudesfdocopt parses help string at startup so it bloats binary size at slows startup.
18:05:17solitudesf*and
18:08:46FromGitter<kaushalmodi> +1 for cligen
18:09:35leorizeI could write a parser generator for docopt...
18:10:04FromGitter<arnetheduck> lol I'm impressed if you've come so far that parsing the command line is truly the performance bottleneck in your application
18:10:19leorizeI'm wondering if I could have as much the ability to customize the help string with cligen than docopt
18:10:36leorize@arnetheduck: docopt uses nim-regex which is super slow :p
18:11:14*mrgaturus joined #nim
18:12:19FromGitter<arnetheduck> that's quite the achievement then, if you manage to make parsing ~200 chars perceptively slow
18:13:21solitudesfin the program i was testing it, docopt added 10ms startup time and ~100kb binary size.
18:13:48solitudesfits not much for a single launch, but it can add up depending on usage.
18:14:02FromGitter<arnetheduck> for the record, I've got nothing against cligen, perf just doesn't seem like the first option I'd judge it on, unless the options are really terribly bad
18:14:11FromGitter<arnetheduck> release build?
18:14:30leorizethe Nim way is for docopt to be a macro that generates a parser :)
18:14:49*stefanos82 joined #nim
18:16:02FromGitter<arnetheduck> ah yes, I guess you have a point there, macros are an easy way to make things extremely bloated and terribly bad
18:24:01*mrgaturus quit (Remote host closed the connection)
18:41:43*sealmove joined #nim
18:48:10*krux02 quit (Remote host closed the connection)
19:03:48*hoijui quit (Ping timeout: 245 seconds)
19:04:07*nsf quit (Quit: WeeChat 2.4)
19:09:56*zargot joined #nim
19:11:33federico3meh
19:16:56*zargot quit (Quit: leaving)
19:18:28*ehmry joined #nim
19:43:52*Snircle quit (Read error: Connection reset by peer)
19:44:44*Snircle joined #nim
19:50:58FromDiscord_<Erik> What is the easiest way to convert an (ASCII) string to uppercase?
19:52:10Araqstrutils.toUpper
19:52:19Araqstrutils.toUpperAscii
20:03:25FromDiscord_<Erik> Thanks, somehow I missed that 🤔
20:23:14ZevvWhat is the nim term for an "automatic variable" living on the stack?
20:26:52lqdev[m]what's an automatic variable?
20:27:09Zevva variable or object living on the stack
20:27:24Zevvit's C speak
20:27:34clyybberZevv: Why would nim have an extra name for that?
20:27:36Zevvbut I don't see it in the Nim manual, so I wondered if there was an actual name for it in nimland
20:27:58clyybberI don't think so
20:28:01lqdev[m]I think we just call it "variable"
20:28:09Zevvmake sense
20:28:12lqdev[m]for objects living on the heap we call them "ref objects"
20:28:54Zevvyeah, but 'objects' is abigious here. a ref int is not a ref object, or is it
20:29:34lqdev[m]you can just call them "refs" if you want to be more generic
20:29:41Zevvright, thanks
20:30:00lqdev[m]but what monster allocates an int on the heap anyway
20:31:18FromGitter<alehander42> so auto variables are local variables but in smaller scopes?
20:32:56Zevvscope can be more limited, but the most important is that auto variables go away autoamticcaly as the call stack unwinds
20:33:16FromGitter<alehander42> but this is true for local
20:33:56ZevvSure, but there is no rule saying that locals should be allocated on a stack.
20:33:57FromGitter<alehander42> or you mean that int* a = malloc.. can't be possibly automatic
20:34:02FromGitter<alehander42> i see
20:34:14Zevvin scripting languages like python, even locals live in the heap
20:34:14FromGitter<alehander42> so those locals that are allocated on stack
20:34:25FromGitter<alehander42> "allocated"
20:34:26Zevvrught
20:34:37FromGitter<alehander42> btw if you
20:34:50FromGitter<alehander42> debug and want to see the previous values of such variables
20:34:52Zevvthat's because of the C runtime legacy. Even the C standard does not speak of stacks and heaps - it just happens to be a convenient way to implement that
20:35:00FromGitter<alehander42> would you expect to see only the values in the current call
20:35:06FromGitter<alehander42> or in all the calls
20:35:11FromGitter<alehander42> of the given function
20:35:53ZevvI don't quite get your question. But when a function returns, it just abandons its locals. They stay behind outside the current stack.
20:35:54FromGitter<alehander42> (i am interested in what people see as "history" of the values of a variable/expression)
20:36:00*Trustable quit (Remote host closed the connection)
20:36:16ZevvYou could fire up your debugger and look outside the current stack, and find the old data from some time ago.
20:36:30ZevvBut as soon as your code will start going 'deeper' that part will be overwritten
20:37:09FromGitter<alehander42> eh you have reverse debuggers
20:37:15FromGitter<alehander42> e.g. rr
20:37:27FromGitter<alehander42> you can put a reverse watchpoint for example
20:37:37ZevvI'm doing a writup of memory management in Nim - basically explaining stacks, heaps, where stuff is stored - what does a string or a seq really look like, what happens if you grow a string, stuff like that.
20:38:10FromGitter<alehander42> awesome: are you going to include the difference between nim1 and nim2 strings/seq-s
20:38:16FromGitter<alehander42> or is it off-topic
20:38:28FromGitter<alehander42> (gc and new-runtime nim)
20:38:52Zevvit's in my todos, but it does not really matter for most of these things.
20:44:55*sealmove quit (Quit: WeeChat 2.5)
20:47:37*nsf joined #nim
21:00:55*al_ joined #nim
21:00:57FromDiscord_<djazz> Yay, with a script I wrote in Nim, I made Celeste playable on a Raspberry Pi 3 (the script shrinks the texture sizes) https://twitter.com/daniel_hede/status/1144711813495439360
21:02:56*al_ quit (Client Quit)
21:08:00*brakmic_ quit ()
21:11:11FromDiscord_<lmariscal> I'm readin the nep1 but there's no guide for nim file naming
21:11:19clyybberAraq: When I make it insert a `=destroy` in place of a wasMoved, the =destroy call causes a SIGSEV
21:11:28FromDiscord_<lmariscal> should I go with camelCase, PascalCase or snake_case?
21:11:33FromDiscord_<lmariscal> stb seams to combine some of them
21:11:38FromDiscord_<lmariscal> std*
21:12:20clyybbermanually replacing the call to eqdestroy in the C code with "colontmpD_.p = NULL; colontmpD_.len = 0;" fixes the segfault
21:12:27FromGitter<alehander42> snake_case
21:19:33Araqclyybber: hmm what's the involved type?
21:19:58clyybberIts a string
21:20:23Zevvalehander42: first draft: http://zevv.nl/div/nim-memory.html
21:20:55Zevvfeedback appreciated. Not sure if I'm starting at a too high or too low level.
21:21:12FromDiscord_<djazz> https://www.twitch.tv/daniel_hede/
21:21:17clyybberIt also works when I replace the destroy implentation in ccgexprs with "if ($1.p && $1.p->allocator) { $1.p = NULL; $1.len = 0; }"
21:21:36Zevvin the end it should be able to explain things like https://forum.nim-lang.org/t/4850#30396
21:26:44Araqclyybber: that means you have a double free, ask valgrind
21:27:44federico3any way to format strigs using a dynamic formatter (as: stored in a variable)?
21:29:04*nsf quit (Quit: WeeChat 2.4)
21:31:19*lf-araujo joined #nim
21:35:03*solitudesf quit (Ping timeout: 258 seconds)
21:48:41*PMunch joined #nim
21:56:00Zevvprintf :)
21:57:16federico3with variable replacing tho...
21:57:30federico3it's quite limiting not having something like this in the stdlib
22:00:33*clyybber quit (Quit: WeeChat 2.5)
22:05:19FromGitter<alehander42> $1 $2
22:05:37FromGitter<alehander42> and "$1" % [variable]
22:05:39FromGitter<alehander42> iirc
22:08:17FromGitter<alehander42> Zevv after all its good to point out that local variables can have
22:08:38FromGitter<alehander42> yeah nvm
22:08:57FromGitter<alehander42> btw when do they get optimized in a register?
22:09:07FromGitter<alehander42> i think it happens in some -O levels
22:16:22rayman22201@Zevv, I love the styling on your blog :-)
22:20:19PMunchZevv, which is your blog?
22:20:42xacePMunch: linked a few lines above: http://zevv.nl/div/nim-memory.html
22:20:43rayman222012:20 PM <Zevv> alehander42: first draft: http://zevv.nl/div/nim-memory.html
22:20:50rayman22201beat me to it
22:21:18PMunchAh, just logged on. First line from Zevv I saw was "printf :)"
22:21:32rayman22201The article is good. It reads like my "introduction to computer architecture" class from college lol
22:21:49PMunchOoh cool, I've been meaning to write that exact article!
22:23:50federico3alehander42 - I'm trying to use fmt with staticRead at least
22:26:03FromGitter<alehander42> static vars or const variables?
22:26:32*Vladar quit (Remote host closed the connection)
22:26:49FromGitter<alehander42> for the formatter
22:27:22FromGitter<alehander42> not really sure what you want to do: if its dynamic, like changing on runtime it cant probably work on ct
22:29:04FromDiscord_<treeform> @djazz did you make Celeste originally? Is it an open source project? Is it written in nim?
22:29:46*disruptek quit (Ping timeout: 268 seconds)
22:32:32FromDiscord_<treeform> Zevv, my feed back: `repr(x)` explanation seems to be out of place in the "Memory organization in Nim" section.
22:33:10*disruptek joined #nim
22:35:57FromDiscord_<djazz> @treeform no, no and no. I made a script in nim that patches the textures so it works on a raspberry pi
22:52:15PMunchWhat was wrong with the original textures?
22:52:25PMunchToo large to load onto the GPU?
22:55:43*natrys quit (Quit: natrys)
22:57:44*envoyt quit (Ping timeout: 244 seconds)
23:02:59FromDiscord_<djazz> yep
23:05:17PMunchWhat is the maximum texture size on the RPi?
23:05:23PMunchProbably depends on the model I guess
23:05:24FromDiscord_<djazz> 2048x2048
23:05:37PMunchHuh, that's pretty reasonable
23:05:38FromDiscord_<djazz> celeste uses 4096x4096 and some other sizes
23:05:46PMunchAaah, right
23:05:55FromDiscord_<djazz> so i extract all sprites, repack to smaller atlases
23:06:01PMunchI remember doing games for phones and couldn't go above 512x512
23:06:01FromDiscord_<djazz> works actually
23:06:10FromDiscord_<djazz> played through first chapter on stream ^^
23:06:14FromDiscord_<djazz> yeah
23:06:19PMunchYeah, if it loads on run-time that should work fine :)
23:25:08PMunchOh joy, best part of writing a library, documentation!
23:31:10*PMunch quit (Remote host closed the connection)
23:33:13shashlick_I now have a basic implementation of shared string and shared seq to use across threads
23:33:47shashlick_Still lots of work to do but curious who would be interested in checking it out
23:47:58Araqshashlick_: I can take a quick look
23:48:04Araqbut I should be sleeping
23:48:27*stefanos82 quit (Quit: Quitting for now...)
23:53:51shashlick_I need to get it into github - ya it's really late for you