<< 15-10-2019 >>

00:09:41FromGitter<zacharycarter> shashlick: well a lot of the definitions are defined in c++ header files which nimterop has trouble importing
00:10:13FromGitter<zacharycarter> so I defined those manually which is fine - the function definitions that make up the API c2nim handles fine
00:11:47*zyklon joined #nim
00:12:01*qwertfisch quit (Ping timeout: 250 seconds)
00:12:41*qwertfisch joined #nim
00:13:30*theelous3 joined #nim
00:16:15*uvegbot quit (Ping timeout: 264 seconds)
00:45:17*luis_ quit (Ping timeout: 240 seconds)
01:14:31*junland quit (Quit: %ZNC Disconnected%)
01:16:51*junland joined #nim
01:46:26*theelous3 quit (Ping timeout: 240 seconds)
01:52:01*rockcavera quit (Remote host closed the connection)
02:05:37*rockcavera joined #nim
02:26:40*lritter joined #nim
02:36:34*leorize quit (Quit: WeeChat 2.5)
02:41:37*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
02:41:52*pbb joined #nim
02:48:24*lritter quit (Ping timeout: 268 seconds)
02:48:57*lritter joined #nim
03:10:52*NimBot joined #nim
03:38:24*chemist69 quit (Ping timeout: 246 seconds)
03:40:39*chemist69 joined #nim
04:10:40*Traviss__ joined #nim
04:13:38*traviss quit (Ping timeout: 245 seconds)
04:21:00FromDiscord<krab4t> so with npeg i have to build objects inside grammar code? i mean mix grammar rule and next line assign result like https://github.com/zevv/npeg#captures-1
04:38:40*nsf joined #nim
04:39:14FromGitter<gogolxdong> Any idea of how to make 1 notin b after exluding from its real subset a: โŽ โŽ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5da54d728e2e9a7c6bfd84ef]
04:58:46*sealmove quit (Quit: WeeChat 2.6)
05:35:55Zevvkrab4t: That's one way to do it. You can also let NPeg do the capturing for you into a AST or JSON tree.
05:42:22*narimiran joined #nim
05:55:38*solitudesf joined #nim
05:56:31FromGitter<zacharycarter> @gogolxdong I think you'd have to remove it from b as well
05:57:47FromGitter<zacharycarter> I'm guessing that `var b = a + {3}` creates a new hash set
05:58:47FromGitter<zacharycarter> https://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/collections/sets.nim#L391 - which is what `+` is equivalent to
06:01:43FromGitter<gogolxdong> yes, it could , assuming there is a deep level set structure, excl from each is unrealistic .It's easy if there is elements shallow copy or becoming ref type.
06:03:47*rockcavera quit (Remote host closed the connection)
06:07:09FromGitter<gogolxdong> new hash set is created on assigning like other value type in Nim. In this context, elements of sets better be ref type.Is is possible?
06:16:51*leorize joined #nim
06:27:00*PMunch joined #nim
06:33:36*vesper11- quit (Read error: Connection reset by peer)
06:36:48*vesper11 joined #nim
06:56:24FromGitter<zacharycarter> @gogolxdong I think you'd need to make a new implementation of set - set expects ordinal types it looks like
06:56:47FromGitter<zacharycarter> or hashset rather
07:00:00*gmpreussner_ quit (Quit: kthxbye)
07:03:44*krux02 joined #nim
07:04:38*gmpreussner joined #nim
07:09:51PMunchHmm, is Jester named Jester because Nim was named Nimrod?
07:10:12Araqmaybe
07:10:27PMunchMaybe?
07:14:56*livcd quit (Quit: Lost terminal)
07:20:11Araqask dom96
07:27:22*solitudesf quit (Ping timeout: 265 seconds)
07:31:09*floppydh joined #nim
07:39:08FromGitter<gogolxdong> Sets should have move semantics.
07:39:18*filcuc joined #nim
07:46:49*alexander92 joined #nim
07:56:18FromGitter<alehander42> araq
07:56:26FromGitter<alehander42> should we check for distinct ref types
07:56:30FromGitter<alehander42> or does it not make sense
07:56:39FromGitter<alehander42> as one needs to cast them to ref anyway?
07:57:29Araqfor me 'distinct' is about hiding implementation details. if I have a 'distinct ref' I might want to change that to a 'distinct ID' later on
07:57:43Araqand so there is no 'new' for 'distinct ref' and it works as designed
07:59:00PMunchBut what about https://github.com/nim-lang/Nim/issues/9566
07:59:46FromGitter<alehander42> ok
08:00:04PMunchOh wait, yeah I see you are discussing an issue created when krux02 was trying to solve that one..
08:01:41FromGitter<alehander42> yes it reminded me should i wonder about them in nil checking
08:03:06Araqoh for the nil checking you can do skipTypes(abstractInst) which covers tyDistinct
08:03:18Araqit's not your job to care about 'distinct' in this pass
08:03:25FromGitter<alehander42> ah but i wonder if its possible
08:03:30Araqlet the frontend handle it
08:03:30FromGitter<alehander42> to deref a distinct ref at all
08:03:38FromGitter<alehander42> i couldnt think how
08:03:39FromGitter<alehander42> without cast
08:03:44FromGitter<alehander42> which should turn it to ref anyway
08:03:46Araqit shouldn't be possible but it's not your job to enforce it
08:03:50FromGitter<alehander42> ok
08:03:53*gmpreussner_ joined #nim
08:03:55*livcd joined #nim
08:04:08*gmpreussner quit (Ping timeout: 276 seconds)
08:05:18PMunchHmm, there was a discussion on the forum I saw recently where someone created a "deref" macro. It would take a type declared as "type MyType = ref object" and get the un-named non-ref type to allow things like "type MyOtherType = distinct deref(MyType)" without having to create both the inner and outer type.
08:05:27PMunchMaybe that should be built in?
08:07:22*kungtotte quit (Read error: Connection reset by peer)
08:08:12AraqPMunch, I think krux02 had a really good solution for this via the new system.default(T)
08:08:36*Vladar joined #nim
08:09:20PMunchYeah the deref thing I'm thinking of used default
08:09:49PMunchI think it was something like default(T) and then grab the inner type from the getImpl or something like that.
08:11:14krux02template deref[T](arg: typedesc[ref T]): untyped = T
08:11:19krux02you mean that?
08:11:28krux02I think I called it unref
08:11:40krux02doesn't use default though
08:11:46*FromGitter quit (Read error: Connection reset by peer)
08:12:06*FromGitter joined #nim
08:12:32krux02it should be able to deref `MyType = ref object` as well
08:12:33PMunchThis is the one I was thinking of: https://forum.nim-lang.org/t/5343#33492
08:13:19PMunchBut yeah, I guess they do pretty much the same thing
08:21:33FromDiscord<krab4t> Zivv: i just don't get it how to assign every new ` section ` (in example grammar you linked before) into new object, i can't create new objects inside grammar
08:22:38FromDiscord<krab4t> i mean Zevv*
08:22:46PMunchhttps://play.nim-lang.org/#ix=1YI4
08:23:02PMunchYup, seems like unref and deref has the exact same result
08:25:57*Traviss__ quit (Ping timeout: 240 seconds)
08:28:08*traviss joined #nim
08:30:23FromDiscord<IJCSTAB> either "file.setPosition()" or "file.readData(buff.addr, 1)" are horrendously slow, am i doing something wrong? or is this process not supposed to be this slow? it's taking multiple seconds to read kilobytes of data
08:32:20*NimBot joined #nim
08:37:34Zevvkrab4t: sure you can: http://ix.io/1YId
08:38:23FromGitter<Vindaar> @narimiran: just checked nim basics on my kindle (converted to mobi with calibre). Conversion threw a bunch of warnings and errors, but the result looks fine. Code blocks, foot notes all look great. :)
08:38:40narimiranthanks for testing it @Vindaar!
08:39:07FromGitter<Vindaar> always glad to be of service ;)
08:40:59FromDiscord<krab4t> hm, i did almost the same, wait i forgot to create vars before grammar rip
08:41:37FromDiscord<IJCSTAB> for i in 0 .. <fileSize:
08:41:37FromDiscord<IJCSTAB> file.setPosition(i)
08:41:37FromDiscord<IJCSTAB> discard file.readData(buff.addr, 1)
08:41:37FromDiscord<IJCSTAB> outSeq.add(buff)
08:41:37FromDiscord<IJCSTAB>
08:41:38FromDiscord<IJCSTAB> pretty ugly code but i'm so confused as to why this takes nearly 3 seconds to read a 4MB file on an NVME SSD
08:42:07FromDiscord<IJCSTAB> doing the same thing runs substantially faster in Python
08:46:26lqdev[m]solution: read more data at a time
08:46:42lqdev[m]instead of reading 1 byte do it in batches of 1024 bytes
08:47:04lqdev[m]also, don't do file.setPosition like that
08:47:11lqdev[m]it's slow
08:47:27narimiran...and pre-allocate your `outSeq`: `var outSeq = newSeq[byte](filesize)`
08:47:33lqdev[m]just do readBuffer and you'll be fine
08:48:19PMunchAnd please, next time you want to send us code, don't paste it directly into Discord, use a paste service
08:48:55FromDiscord<IJCSTAB> sorry about that, but thanks for all the help
08:53:10*lqdev[a] joined #nim
08:53:20leorizedo we still not have a notice on the discord channel?
08:53:55*lqdev[a] quit (Read error: Connection reset by peer)
08:54:07*lqdev[a] joined #nim
08:54:09PMunchleorize, I think the idea was to find a bot like the gitter one that would do it automatically
08:54:48leorizewell that bot ain't coming overnight :/
08:54:50lqdev[a]a Discord bot API for Nim would be a good project
08:55:01leorizethere already is one iirc
08:55:25*lqdev[a] quit (Read error: Connection reset by peer)
08:56:11*lqdev[a] joined #nim
08:56:20*lqdev[a] quit (Remote host closed the connection)
08:56:48lqdev[m]I see
08:57:35lqdev[m]damn I'm so used to callbacks after using discord.js for so long
09:12:13alexander92what happens
09:12:22alexander92is it possible to somehow
09:12:23alexander92get _memmove_avx_unaligned_erms
09:14:38alexander92so what happens is
09:14:46alexander92i pass a openarray[byte]
09:19:59alexander92nvm
09:24:02*filcuc quit (Read error: Connection reset by peer)
09:26:57*dddddd quit (Remote host closed the connection)
09:32:39*ng0 joined #nim
09:38:25*NimBot joined #nim
09:42:38*filcuc joined #nim
10:07:57*alexander92 quit (Ping timeout: 240 seconds)
10:15:54FromDiscord<Chiqqum_Ngbata> Am I missing something here? https://pastebin.com/9RrYRgzZ
10:16:41FromDiscord<Chiqqum_Ngbata> Under what condition would this type not match
10:21:19FromDiscord<kodkuce> i think that bug probbaly but you need to ask some smarter then me
10:23:48*NimBot joined #nim
10:23:55*sealmove joined #nim
10:23:55*theelous3 joined #nim
10:25:11Araqmore likely: the error message is really bad and the calling conventions differ
10:25:19Araq.nimcall vs .closure
10:29:43*theelous3 quit (Read error: Connection reset by peer)
10:30:27FromDiscord<krab4t> any equivalent in nim to c++'s ` expr ? true : false `
10:30:30*alexander92 joined #nim
10:31:46*theelous3 joined #nim
10:32:23Araq (if expr: true else: false)
10:34:01*theelous3_ joined #nim
10:34:11sealmovehow can I make an alias of an array?
10:34:39Araq'alias' is ambiguous
10:35:22sealmovehttps://play.nim-lang.org/#ix=1YII
10:35:43Araqthere is a nimble package to do that...
10:36:02Araqand then there is: let d = unsafeAddr(...)
10:36:33sealmovehmm, I'll fiddle with unsafeAddr, see if it does the job, ty
10:37:52*theelous3 quit (Ping timeout: 264 seconds)
10:38:51Araqthere is also the "helper proc taking a 'var T' parameter" trick
10:38:52sealmovebtw Araq, I am confused as of how exactly `var` works in parameter list
10:39:22sealmovefor example I noticed when the type is a ref object, then I can modify it in a proc without `var` type anotation
10:48:19sealmovehmm, without `var`, it means I can't change the argument to point to a different object, but I can change the object it points to, like `T *const x` and unlike `const T *x` in C.
10:49:23sealmovewhat is the equivelant of `const T *x` in Nim?
10:54:07sealmove(being able to modify the argument so that it points to different object, but prohibiting modification of the object it points to)
10:54:49sealmoveis it possible?
10:56:44alexander92i was confused for that too for some time, i did put var everywhere
10:57:43alexander92and what is "const ref which cant be changed"
10:57:51alexander92const T *const x
10:57:53alexander92?
10:59:14sealmove`ref x` <=> `T *const x`
10:59:29sealmove`var ref x` <=> `T *x`
10:59:39sealmoveI think Nim only have semantics for these 2
10:59:39alexander92thank you!
10:59:45alexander92helpful mapping
10:59:48alexander92hm, but what is it in C?
11:00:01alexander92sorry, i meant
11:00:25*NimBot joined #nim
11:00:45sealmoveyes, `const T *const x` means you can't change the object it points to, neither the value of the object
11:00:54alexander92is it often used in C?
11:01:05sealmoveyes
11:01:08alexander92seems useful for some readonly cases
11:01:10alexander92ok
11:01:48sealmoveI guess `const T *x` is not used as often (not sure though)
11:01:53FromDiscord<krab4t> npeg throws out of range instead of just maybe 0 as value
11:02:02alexander92https://forum.nim-lang.org/t/4704
11:02:09alexander92wow, this is old
11:02:21alexander92oh no, i thought its 2008
11:02:23alexander92nvm :P
11:02:32sealmovelol
11:04:02sealmovealex nice, I think this thread hits the point
11:08:52alexander92it seems deep immutability is hard indeed
11:08:59alexander92but that c++ actually just does the symbol imm
11:09:22alexander92yeah basically repeating demotomohiro
11:11:39sealmovewow this thread is looooong
11:11:41sealmoveinteresting!
11:11:55Zevvkrab4t: are you trying to access captures that you didn't make? Your grammar has some optionals like the alpha on the colors or the optional operator (<=, >=) in various checks
11:17:05alexander92sealmovew
11:17:12FromDiscord<krab4t> yes these not existing captures
11:18:33alexander92sealmove look, i think they solve your question a bit
11:19:47sealmoveindeed, after reading through a bit, I realized C's solution (weak immutability) is not the only way to model things.
11:20:01Zevvkrab4t: check `capture.len` before accessing, so you can tell how many you did actually capture there. Maybe I should not throw there but return an empty string, I'm not sure yet
11:22:38sealmove"strong immutability cannot be achieved at compile time" "Strong immutability might be possible without any runtime check/cost by copying rust's ownership"
11:30:26sealmoveso strong immutability might not be ideal (almost certainly it can't be done without adding mental overhead to the programmer)
11:31:16sealmovebut having syntax for `const T *x` and `const T *const x` could be solved
11:33:30Araqwhat's the point in solving it? use 'x: T' in Nim for parameter passing
11:34:18Araq"give me a pointer to this data and I promise not to modify it" is backwards, don't use a pointer to begin with.
11:34:45alexander92but what if it is a recursive type
11:36:39sealmoveAraq: ok this is fair enough for `const T *const x`, not needed, but `const T *x` (being able to change the pointing but not the data) is useful, no?
11:37:47PMunchAraq, what is the correct way of loading some data at the begining of a Karax application? I want to load a list from the server and put it on the site as soon as it is ready.
11:38:42PMunchJust adding it to the body before the setRenderer call didn't really work
11:39:08PMunchIt completes after the renderer is done, so it won't show up until something changes
11:39:58Araqsealmove, how so?
11:40:49Araqit doesn't come up all that often, if it does, use 'var needMut = unsafeAddr(myParam)'
11:40:55PMunchNever mind, got around it with some logic in postRender
11:40:58Araqinside the proc
11:41:11AraqPMunch, ok, I don't have an answer
11:41:17PMunchBy the way, how does Karax know when a variable changes?
11:41:33sealmoveAraq: I see, makes sense now, thanks
11:41:35Araqit doesn't it redraws after an event
11:41:52PMunchAh okay, that's what I suspected
11:42:16*solitudesf joined #nim
11:42:44PMunchEssentially the same thing I did when I did my first test of genui. To make Gtk and Karax behave the same I added an updater to every callback for the Gtk code.
11:49:25*birdspider joined #nim
11:54:27FromDiscord<krab4t> Zevv: what Graph returns? single captured string or array of chars?
11:56:33*rockcavera joined #nim
11:56:39ZevvGraph returns nothing - it matches a printable character. >+Graph matches one or more ,and captures into a single string
11:58:56*ng0 quit (Quit: Alexa, when is the end of world?)
12:17:16sealmoveis array bound checking done at compile time/
12:17:18sealmove?
12:17:46alexander92but Araq this method still doesnt work
12:17:51alexander92for ref case object
12:18:03alexander92the t: T
12:18:36alexander92hm, or maybe it does
12:18:45alexander92you just need to pass a[] sorry nvm
12:19:01PMunchsealmove, no
12:19:29PMunchWell, if you do static numbers then yes
12:19:46PMunchSo var x: array[3, int]; x[10] = 42 will not compile
12:20:01sealmovehow to make it compile?
12:20:13PMunchBut for i in 0..5: x[i] = 42*i will compile and fail on runtime
12:20:20PMunchsealmove, what do you mean?
12:20:29sealmovebut i have x[i] and get Error: cannot evaluate at compile time: i
12:20:30PMunchMake a bigger array
12:20:45PMunchIs your x marked as {.compileTime.}?
12:20:56sealmoveno, and I have `var` everywhere
12:21:07PMunchSnippet?
12:21:52sealmovehttps://play.nim-lang.org/#ix=1YJ6
12:25:47*Kaivo joined #nim
12:28:01sealmoveI don't get the error message at all
12:28:19PMunchHmm, this is indeed pretty weird..
12:29:15sealmoveoh wait
12:30:00sealmovep[o] is wrong, it should be p.bytes[o], I am really sorry
12:30:03FromGitter<dumjyl> It's a indexing a tuple not array I think.
12:30:16sealmovedumjyl: yes indeed
12:30:58PMunchYeah this works: https://play.nim-lang.org/#ix=1YJa
12:31:19PMunchSo change the pointer you return to a pointer to something, then use that pointer
12:31:50PMunchThose error messages were weird though..
12:33:03PMunchYay, new playground feature! As soon as the Cloudflare cache updates you should see a "Nim version" picker at the top right
12:33:04sealmoveso plain with `ptr` it seems Nim can't inference the type
12:33:10PMunchI'll let you guess what it does :P
12:33:18sealmovenice!
12:33:38PMunchIt has all the tagged versions of Nim back to 0.13.0
12:33:51PMunchBut only the latest has the newly added Nimble packages
12:34:26PMunchsealmove, well yes, obviously it can't infer the type of something that's declared as simply a ptr..
12:34:38*a_chou joined #nim
12:34:42*a_chou quit (Remote host closed the connection)
12:34:45PMunchIf you don't want to repeat that tuple around though you can define it as a type
12:35:00sealmovegood idea, thx
12:35:04*a_chou joined #nim
12:35:07PMunchSomething like ElementData = tuple[bytes: array[K, byte], size: int]
12:35:28PMunchOr make an object of it
12:36:31*a_chou quit (Client Quit)
12:39:31sealmovewhat's the benefit of making an object opposed to plain alias?
12:42:13FromDiscord<juan_carlos> Oh the Playground has even more options ๐Ÿ’š
12:43:52PMunchjuan_carlos ๐ŸŽ‰
12:47:28sealmoveNim is really wonderful. It's pointless to state but I just feel the urge to say it!
12:48:45FromDiscord<ZeeQyu> Nice to see new features in the playground. However, the ui element to select nim version doesn't seem to appear in android 7.0 chrome.
12:48:45FromDiscord<ZeeQyu> https://cdn.discordapp.com/attachments/371759389889003532/633647445028372530/IMG_20191015_144641.png
12:50:20FromDiscord<ZeeQyu> Or is the compilation targen and nim version different things perhaps?
12:50:23FromDiscord<krab4t> > 74 tabs
12:50:51FromDiscord<ZeeQyu> Yeah, I've been keeping it light lately. 300 took so long to open.
12:51:17PMunchZeeQyu, it's probably just a caching thing
12:51:25FromDiscord<ZeeQyu> Alright
12:51:34PMunchIt's behind Cloudflare, I don't see it on play.nim-lang.org either
12:51:53PMunchBut I do see it when I circumvent Cloudflare, so it's coming soon :)
12:52:27FromDiscord<ZeeQyu> Fun fact, when you go from 99 to 100 tabs in mobile chrome, the number turns to a :) smiley
12:54:03FromDiscord<ZeeQyu> PMunch, why is 0.13 the cutoff? Did something fundamental change in that release? It seems I've seen it other places too, but I'm not sure.
12:54:16PMunchNim changed name from Nimrod
12:55:05PMunchSo it would require some extra hacks to work
12:55:11FromDiscord<krab4t> @ZeeQyu open 10 tabs full of gifs
12:55:25PMunchNow the script that runs things is the same, and it call the executable "nim"
12:55:58PMunchBut looking at your screenshot I can see the compilation target and the version selector having popped down a line..
12:56:20FromDiscord<Rika> another fun fact 100 incognito tabs has a \;\) afaik
12:56:22PMunchI guess I didn't test it at that low screen resolutions..
12:57:01FromDiscord<ZeeQyu> I see. Would it be as simple as to rename the executable after building?
12:57:14PMunchZeeQyu, what is the resolution of your screen by the way?
12:57:23PMunchZeeQyu, hmm possibly
12:58:36FromDiscord<ZeeQyu> My "about phone" says 1080x1920 but I'm guessing chrome emulates a smaller one. Don't know how to find out though. Huawei Honor 8 FRD-9 something
12:58:58FromDiscord<ZeeQyu> FRD-L09
12:59:23livcdPMunch: can i get intellij in playground ? :D
13:00:06FromDiscord<Rika> lmao
13:00:26FromDiscord<Rika> PMunch afaik sites scale by DPI not just resolution
13:00:32alexander92with some wasm builds
13:00:33alexander92maybe
13:01:12alexander92pmunch we can have a jsfiddle-like view for the javascript
13:01:13FromDiscord<ZeeQyu> If I choose "Desktop site", I get this, so I don't think it's a caching issue on my end.
13:01:13alexander92backend
13:01:13FromDiscord<ZeeQyu> https://cdn.discordapp.com/attachments/371759389889003532/633650583206887444/IMG_20191015_150007.png
13:01:21alexander92but probably no resources
13:01:47*Hideki_ quit (Remote host closed the connection)
13:02:21PMunchZeeQyu, yeah I'm looking into it right now
13:02:31PMunchlivcd, no..
13:02:48FromDiscord<Rika> is there even a decent intellij plugin for nim
13:02:53livcdPMunch: pretty please
13:03:02PMunchIf you can get nimlsp to compile on the JS target I'll look into integrating it with CodeMirror :P
13:03:28PMunchalexander92, jsfiddle-like?
13:03:46alexander92a very popular similar playground
13:03:48alexander92https://jsfiddle.net/
13:04:38FromDiscord<ZeeQyu> @Rika Working on it, actually. Don't have much free time, currently learning JetBrains's plugin API.
13:04:45FromDiscord<ZeeQyu> But I'll get there
13:04:53FromDiscord<Rika> youre making me excited
13:04:55FromDiscord<Rika> dont do this to me
13:04:56alexander92but its just a fun idea, people dont use it
13:05:04FromDiscord<ZeeQyu> I hoped I would.
13:05:07alexander92so often that we need that
13:07:57FromDiscord<ZeeQyu> I'm slightly scared I have to reimplement the lexing and parsing in their interface, and not be able to use nimsuggest. They have a particular structure in mind, which is great for when there's no external parser, don't get me wrong, but which is fairly locked down, and I have yet to figure out if there's a way around it.
13:11:28sealmoveis there a proc for reading from a file from a particular position? or I have to seek() and read() seperately?
13:20:48PMunchZeeQyu, when the cache for the playground stylesheet updates your issue should be fixed :)
13:21:29PMunchalexander92, I know what jsfiddle is, but what exactly did you want from it?
13:21:52PMunchOh, you wanted to see Nim output as JS on the website like HTML?
13:23:39FromDiscord<juan_carlos> Python users are celebrating they got 1 new operator, and I am like lol ๐Ÿ˜
13:25:05PMunchHaha, which operator?
13:25:20narimiran:=
13:25:32narimiranso called walrus operator
13:26:47PMunchHaha, interesting name
13:26:58PMunchWhat does it do?
13:27:11narimiranit makes half of pythonistas happy and the other half angry
13:27:14FromDiscord<juan_carlos> They kicked the creator of the lang out because of `:=`
13:27:32narimiran@juan_carlos how about not spreading fake news?
13:27:42FromDiscord<juan_carlos> Yes, some people really angry some people really happy over that operator.
13:28:28FromDiscord<juan_carlos> I mean not that, but it was one of the things that sums up, to it. The release literally has commits from him.
13:28:35livcdIs it the same like in Go ?
13:28:46FromDiscord<juan_carlos> Similar to Go.
13:29:20narimiranlivcd, PMunch: see here: https://docs.python.org/3.8/whatsnew/3.8.html#assignment-expressions
13:29:22PMunchWhat does it do in your code? :P
13:29:47PMunchAaah
13:30:31FromDiscord<juan_carlos> Right now no one should have it, but sure it breaks lit of parser, regexes, syntax highlight, etc.
13:32:58FromDiscord<juan_carlos> Theres linters made to ban the `:=`
13:33:03PMunchHmm, I'm getting a weird error from jesters..
13:33:11FromDiscord<juan_carlos> So I guess some people are not happy at all.
13:33:33PMunchIt says that it replies with 200 OK, but then it crashes
13:35:34PMunchhttp://ix.io/1YJA
13:36:40FromDiscord<juan_carlos> race on `/tmp/test`
13:37:07FromDiscord<juan_carlos> is a Docker?.
13:37:12PMunchNope
13:37:17PMunchWhat do you mean race=
13:37:24FromDiscord<juan_carlos> race condition on IO
13:37:42PMunchThe /tmp/test file is the executable Nim created..
13:39:13*stefantalpalaru joined #nim
13:39:19FromDiscord<juan_carlos> sleep 1 second after it writes it, and see if still does the same, maybe the OS has it open for some reason.
13:40:09PMunchThat is not the issue here, it's not trying to read or write to /tmp/test..
13:40:24PMunchnim c -r test.nim creates the file test
13:40:51PMunchThe error I'm guessing is from the socket that it tries to send the reply over
13:41:11PMunchThe other end get's an error that "Remote end closed connection without response"
13:42:42PMunchHuh, interestingly enough it works fine if I built jester with httpbeast and not the stdlib
13:42:55*asymptotically joined #nim
13:47:08sealmovehow do you replace a byte in a file?
13:47:15sealmovewrite() overrides the whole file
13:47:46FromDiscord<Rika> Guido wasn't kicked out, but it was similar. he felt pressure to step down afaik (dont quote me of course, all i got is hearsay)
13:52:07*letto quit (Read error: Connection reset by peer)
13:52:37*letto joined #nim
13:54:17ZevvJust wait until we overthrow Araq!
13:55:47Zevvsealmove: you should open the file with fmAppend probably
13:55:48FromDiscord<Rika> https://www.mail-archive.com/[email protected]/msg05628.html https://www.python.org/dev/peps/pep-0572/ got some sources
13:56:01Zevvhavent tested
13:57:42sealmovemm right
14:01:22Zevvif io.open lies on top op fopen(), fmWrite will truncate the file.
14:01:41*PMunch quit (Remote host closed the connection)
14:02:23FromDiscord<Rika> fmAppend then seek (im basing this from python experience, dont actually know if seek is the proc name in nim)
14:03:47lqdev[m]@Rika it's setPosition
14:03:51lqdev[m]for streams
14:07:36sealmoveand setFilePos for files
14:11:03*solitudesf quit (Ping timeout: 268 seconds)
14:14:16*dddddd joined #nim
14:16:58FromDiscord<Rika> really feel like seek is more concise but eh thats fine
14:18:50*solitudesf joined #nim
14:19:03Araqit's concise but the wrong word, there is no "search" involved
14:19:11Araqbut maybe it's just my English failing
14:19:20FromDiscord<krab4t> Zevv: i can't just simply ` parseEnum($1) ` with npeg? ` \strutils.nim(1244, 17) Error: cannot instantiate: 'T' `
14:20:36FromDiscord<krab4t> nvm im retarded https://nim-lang.org/docs/strutils.html#parseEnum%2Cstring
14:21:23FromDiscord<Rika> doesnt seek have two meanings?
14:21:46disruptekno, you're right, seek is the wrong word.
14:22:29FromDiscord<Rika> i guess other languages just modified the way people remember the meaning or something
14:23:22disruptekit's an anachronism from the era of audio-tape.
14:25:29Araqit's unix's motto -- "everything is badly named and won't be fixed"
14:27:53*solitudesf quit (Remote host closed the connection)
14:28:21*solitudesf joined #nim
14:28:44FromDiscord<Generic> hey, keep your wants from my 12bits uint8_t's!
14:28:55FromDiscord<Generic> *hands
14:29:32FromDiscord<Rika> you have the most generic username/avatar combo ive seen so far
14:30:00FromDiscord<Generic> I'm so bad at choosing usernames
14:30:06FromDiscord<Generic> that's why I have everywhere a different one
14:30:23disruptekah, i knew i knew you from somewhere.
14:30:26FromGitter<alehander42> PMunch yeah
14:30:28disruptekturns out, i know you from everywhere.
14:31:18FromDiscord<Generic> on IRC where mentions are without at I'm often mentioned by accident ๐Ÿ™‚
14:31:31*nsf quit (Quit: WeeChat 2.6)
14:32:15FromDiscord<Rika> i wonder what topics you're accidentally mentioned on *ehem*
14:35:40Zevvkrav4t: parseEnum[T]($1)
14:40:10FromDiscord<krab4t> Zevv: https://pastebin.com/raw/T6pyFxKd ๐Ÿ›Œ
14:42:02FromDiscord<krab4t> some crappy code
14:44:40Zevvwell, it works, right! :)
14:46:49Zevvproc parseBool(s:string): bool = s == "True"
14:46:52Zevvwould clean up a lot
14:47:19Zevvand one to make a Color()
14:47:20Zevvetc
14:50:28FromDiscord<krab4t> ๐Ÿ˜ฎ
14:51:29Araqwe do have parseBool, don't we?
14:59:20*floppydh quit (Quit: WeeChat 2.6)
15:07:42*nsf joined #nim
15:18:54FromDiscord<ZeeQyu> The new python operator is very pythonic. It's foreign and eccentric to people when first introduced, creates elegant code and is actually a really nifty idea when you get used to it, and makes very many people upset to the point of irrationality.
15:22:11FromDiscord<juan_carlos> The problem I see is that they dont add it into `__future__` then you basically break everything from `3.0` to `3.7`, thats the reason of the anti-walrus linters.
15:23:21*gangstacat quit (Quit: ฤœis!)
15:26:51*fredrik92 quit (Quit: Client disconnecting)
15:32:31*alexander92 quit (Read error: Connection reset by peer)
15:35:20*nif quit (Quit: ...)
15:35:31*nif joined #nim
15:35:58FromDiscord<Rika> didnt f-strings also break anything pre-3.6?
15:36:10FromDiscord<Rika> but everyone praises it (i do too)
15:36:19narimiran#nim-offtopic is that way โ€”>
15:36:38*NimBot joined #nim
15:38:57*gangstacat joined #nim
15:39:52FromDiscord<juan_carlos> `{.deprecated.}` and `{.experimental.}` seems better.
15:53:03FromDiscord<krptr> sorry to interrupt, mind someone explain what I'm doing wrong? https://play.nim-lang.org/#ix=1YKp
15:53:20FromDiscord<krptr> tried to find on google, but did not found anything ๐Ÿ˜ฆ
15:53:54*lritter quit (Ping timeout: 265 seconds)
15:55:53disruptekkrptr: there's no way for the compiler to infer the type because generics don't dispatch on return type.
15:57:17disruptekuse the second form, pass a type, etc. but that use of generics is discouraged, anyway -- if you have to use when, you're probably doing it wrong.
15:58:20*narimiran quit (Remote host closed the connection)
15:58:42FromDiscord<krptr> I used when to simplify the example, I was interested on return type dispatch
16:00:04FromDiscord<krptr> thanks anyway <disruptek>, just wondering if there was something that I was missing, just learning the lang, you know
16:01:06disruptekyep, i've been there. ๐Ÿ˜
16:01:27*narimiran joined #nim
16:23:37*sealmove quit (Quit: WeeChat 2.6)
16:34:38*nsf quit (Quit: WeeChat 2.6)
17:00:56FromDiscord<Rika> i'm completely baffled by nimPNG; anyone know either how to use nimPNG or an alternative?
17:02:30FromGitter<zetashift> the docs seem quite okay for such a library, what is the showstopper?
17:03:18FromGitter<zetashift> https://github.com/jrenner/nim-simplepng seems to be an alternative tho
17:05:05FromDiscord<Rika> zetashift: i cannot for the life of me understand how pixels should be read
17:07:11*alexander92 joined #nim
17:08:14FromGitter<zetashift> I don't know much about nimpng either but the readme might give a hint in: `pixels are stored as raw bytes using Nim's string as container`
17:08:50FromDiscord<Solitude> @Rika https://github.com/SolitudeSF/imageman plugging my lib, hoping you can understand it
17:09:19FromDiscord<Rika> ooh more formats, does it support PNG grayscale 4bit?
17:09:51FromDiscord<Solitude> it wraps stb_img, does it support it?
17:10:03FromDiscord<Solitude> *stb_image
17:11:01FromDiscord<Rika> stb image shows it can do 4bit but not what color modes
17:11:27FromDiscord<Solitude> im gonna put it in my todo list
17:11:33FromDiscord<Rika> okay it shows it can do grayscale
17:13:02FromDiscord<Rika> regarding nimpng: when i dump the whole contents of {image}.data (image is 2 by 2 picture), i get a whole lotta bytes
17:13:13FromDiscord<Rika> i feel like that its not supposed to give me that many
17:13:48FromDiscord<Rika> did image.data.len, got the number 250,000
17:14:21FromDiscord<Rika> whilst my image is 1,821 bytes large
17:14:45FromDiscord<Solitude> maybe it upconverts it to rgba
17:14:56FromDiscord<kodkuce> https://play.nim-lang.org/#ix=1YKM << am i a monogoloid or is it giving wrongfully 51 when there only 10 items in seq?
17:17:52FromGitter<iffy> I'm guessing GC_unref should be called from the same thread that GC_ref was called from?
17:18:53narimiran@kodkuce: this should give you a hint: https://play.nim-lang.org/#ix=1YKQ
17:20:22FromDiscord<Rika> tell us if you cant figure it out
17:26:10FromDiscord<Rika> realized that nimpng is giving me a few hundred bytes of \{i}, increments i, then gives me a few hundred bytes of that
17:26:33FromDiscord<Rika> ex: `\1\1\1\1\1...\1\1\2\2\2\2...\2\2...`
17:28:02*letto_ joined #nim
17:28:23*letto quit (Ping timeout: 268 seconds)
17:28:26FromDiscord<kodkuce> oh lol $ converted seq directly with all those @ , [
17:28:58FromDiscord<kodkuce> any way to make a string form seq of chars whitout for looping ?
17:29:22FromDiscord<exelotl> @Rika I've used nimPNG a little for converting images to/from raw NDS/GBA format
17:29:22FromDiscord<exelotl> Not sure if it's helpful to you but here's my code if you want an example of how it can be used https://gist.github.com/exelotl/daf271d8e86bf4eca3159e47c4e02fbf
17:29:50FromDiscord<Rika> it might be helpful because right now im just thinking nimpng is broken
17:30:13FromDiscord<Rika> @kodkuce seq.join("string separator")
17:30:20FromDiscord<Rika> import strutils first i thin
17:30:22FromDiscord<Rika> k**
17:33:37FromDiscord<exelotl> nimpng can be a bit weird, the functionality is there but it takes some digging and messing around to get it to do the right thing
17:34:02*birdspider quit (Remote host closed the connection)
17:34:06FromDiscord<Rika> okay
17:34:13FromDiscord<Rika> im a massive idiot
17:34:32FromDiscord<Rika> ive been loading an older image because i forgot to change the directory
17:34:37disruptekfew of us feel that way about you.
17:35:03FromDiscord<Rika> why so?
17:35:28disrupteki think most people respect your taste in programming language, for one.
17:36:26FromDiscord<Rika> okay, disclaimer that english is not my native language, "few of us feel that way" means "we don't think you are one" right?
17:36:45disruptekright.
17:37:13disruptekmost disagree that you're a massive idiot.
17:37:29FromDiscord<Rika> many thanks to everyone who tried helping
17:41:28FromDiscord<exelotl> that's was a kind thing to say disruptek, but I think it slightly missed the mark because rika just meant they had been an idiot in the moment x)
17:41:45FromDiscord<exelotl> *that
17:49:19FromGitter<zacharycarter> feels good to be employed again :D
17:52:52*solitudesf- joined #nim
17:56:08*solitudesf quit (Ping timeout: 268 seconds)
17:56:08*solitudesf- quit (Read error: Connection reset by peer)
18:01:00Zevvyeah dude youve been unemployed like, for ages
18:01:05Zevvturning into a hobo already
18:01:27Zevvwhat was it, two decades? two years? two months?
18:01:46*solitudesf joined #nim
18:03:44FromGitter<zacharycarter> lol
18:05:18FromGitter<alehander42> zachary get a job
18:05:39FromGitter<zacharycarter> :P I have one now, officially \o/
18:05:44FromGitter<alehander42> ah i want to go for some week
18:05:46FromGitter<alehander42> rest
18:05:58FromGitter<alehander42> where
18:06:01FromGitter<alehander42> are you going now
18:07:35FromGitter<zacharycarter> www.frogmind.com
18:08:33FromDiscord<kodkuce> @Rika was cooking eggs, ty
18:08:50FromGitter<alehander42> wow
18:08:53FromGitter<alehander42> still there
18:09:01FromGitter<alehander42> you are getting finnish
18:09:13FromGitter<alehander42> kodkuce you have eggs by panagurski in
18:09:15FromGitter<alehander42> serbia?
18:09:24FromGitter<alehander42> i wonder if we eat the same recipe
18:09:29FromGitter<zacharycarter> I know right? The Finns won't let me leave
18:09:33FromDiscord<kodkuce> panagurski?
18:11:38FromGitter<alehander42> well, we have those
18:11:42FromGitter<alehander42> wait
18:12:19FromGitter<alehander42> http://www.gotvetesmen.com/recipes/alphabet_list/index.php?alpabet_list=%D0%AF&id=235&name=Yaytsa-po-panagyurski
18:12:39FromGitter<alehander42> i feel they're very local, but maybe you have them there as well
18:13:06FromGitter<alehander42> @zacharycarter you need wood for fire now
18:13:10FromGitter<alehander42> its getting cold there
18:15:03*nif quit (Quit: ...)
18:15:12*nif joined #nim
18:15:34FromGitter<zacharycarter> yeah it is
18:18:12FromDiscord<kodkuce> newer tryed that will try it next time
18:18:42FromDiscord<kodkuce> newer thinked of mixing kiselo mleko with egg's is it good?
18:20:40FromDiscord<kodkuce> why i can wirte if myvar in [1,2,3] but cant write if myvar not in [1,2,3] ?
18:21:42*sealmove joined #nim
18:22:23*solitudesf- joined #nim
18:22:47sealmoveis `import some_example` equivelant to `import someExample`?
18:23:26Araqno.
18:23:27FromDiscord<kodkuce> hmm dont think so, but i am not 100%
18:24:00FromDiscord<kodkuce> how to write not in [1,2,3,4] ?
18:24:27FromDiscord<kodkuce> and hows magic going with new shared GC or runtime or that abandoned?
18:25:18*solitudesf quit (Ping timeout: 246 seconds)
18:25:37*UNIcodeX joined #nim
18:26:19*UNIcodeX quit (Max SendQ exceeded)
18:27:02*UNIcodeX joined #nim
18:27:45Araqnot at all, but I had vacation
18:28:09Araqwanted to make 'gctest' work with it (which is a stress test...)
18:28:47Araqbefore writing about how it works. unforunately it turned out my codegen patch isn't good enough and things need to be done differently
18:31:11FromDiscord<kodkuce> was just asking, no pressure ๐Ÿ™‚
18:33:07FromDiscord<kodkuce> Can i write if 5 not in [1,2,3,4] somehow, or syntax dosent exist for that ?
18:33:34*solitudesf- quit (Remote host closed the connection)
18:33:53*solitudesf joined #nim
18:35:05*filcuc quit (Ping timeout: 264 seconds)
18:35:53Zevv"notin"
18:35:54FromDiscord<kodkuce> solved it by puting not in front and wrapit all in brackets
18:35:58FromDiscord<kodkuce> oh
18:36:01FromDiscord<kodkuce> lol
18:36:10Zevvit has to do with precedence, it feels a bit hackish IMHO, but its just the way it is
18:40:34Araqno it has to do with "silly special case 2 token operators are silly"
18:42:12sealmoveis this project structure problematic?
18:42:14sealmovetui
18:42:16sealmoveโ”œโ”€โ”€ main.nim # this is the module supposed to be passed to compiler
18:42:18sealmoveโ””โ”€โ”€ tui.nim
18:43:00Araqa bit but with a main.nim.cfg it should be fine
18:45:42*nsf joined #nim
18:46:37sealmoveNever used the nim cfg dsl. Is it documented somewhere?
18:46:54sealmoveOr maybe I just look the implementation?
18:47:34FromGitter<awr1> i believe nims files are more encouraged now than the cfg dsl
18:47:38FromGitter<awr1> https://nim-lang.org/docs/nims.html
18:48:26FromGitter<awr1> i use nims for building currently
18:49:21FromGitter<awr1> https://forum.nim-lang.org/t/4329
18:49:58FromGitter<awr1> hmm
18:50:04sealmoveok, this is another interesting topic to dive in...
18:51:10FromGitter<awr1> you can combine both if you really want to.
19:01:58*sealmove quit (Quit: WeeChat 2.6)
19:05:40*UNIcodeX quit (Quit: Leaving)
19:20:44FromGitter<nixfreakz_twitter> anyone use the REPL inim ?
19:21:02FromGitter<nixfreakz_twitter> how do you clear out the buffer for variables ?
19:21:13FromGitter<nixfreakz_twitter> I think I'm saying that right
19:31:15*alexander92 quit (Read error: Connection reset by peer)
19:42:32*solitudesf quit (Remote host closed the connection)
19:42:52zedeusyou can't
19:42:57*solitudesf joined #nim
19:52:17FromGitter<nixfreakz_twitter> bummer ok
19:57:57*solitudesf- joined #nim
19:58:36FromGitter<nixfreakz_twitter> are forward declarations for proc still needed for 1.0 ?
20:00:17*solitudesf quit (Ping timeout: 240 seconds)
20:04:38FromDiscord<kodkuce> i thinked tehey are can fast check
20:05:36*luis_ joined #nim
20:05:41FromDiscord<kodkuce> yep think soo
20:05:43FromDiscord<kodkuce> https://play.nim-lang.org/#ix=1YLV
20:06:01*theelous3_ quit (Read error: Connection reset by peer)
20:06:13FromDiscord<kodkuce> tough i would like to not have to forward declare
20:15:33*leorize quit (Remote host closed the connection)
20:16:07*narimiran quit (Ping timeout: 268 seconds)
20:18:50*leorize joined #nim
20:19:10Zevvkodkuce: {.experimental: "codeReordering".}
20:22:03FromGitter<zacharycarter> is there a way to specify which compiler to use for the compile pragma?
20:22:20FromGitter<zacharycarter> or I guess it just uses the compiler that the source is being compiled with?\
20:22:23FromGitter<zacharycarter> that probably makes more sense
20:24:24FromGitter<zetashift> Why wouldn't it? Sounds weird to let vcc compile a part with gcc?
20:24:55FromGitter<zacharycarter> yeah
20:24:58FromGitter<zetashift> (I could also be understanding your intention wrong)
20:25:28FromGitter<zacharycarter> I just wasn't thinking clearly, I'm tired and should sleep :)
20:25:38*nsf quit (Quit: WeeChat 2.6)
20:33:08rayman22201@Araq, are you online atm?
20:35:37*luis_ quit (Ping timeout: 240 seconds)
20:39:32Zevvholidays
20:39:56rayman22201ah. damn
20:40:06Zevv19:16 #nim: < Araq> btw I'll be offline tomorrow until Tuesday
20:40:06rayman22201also late for you Europeans :-)
20:40:24Zevvyou're having quite a fight there
20:40:53rayman22201fight? or "lively academic discussion" :-P
20:41:11disruptekoh shoot, i've had my head down and now i'm missing another async duel?
20:41:28rayman22201I love to argue, I was on the debate team in high school lol. I could have been a lawyer lol
20:42:08rayman22201I don't think it's nearly as serious as the other one. I'm just a blabbermouth. I don't know how to be succinct :-P
20:42:33*eys joined #nim
20:43:40FromGitter<jquiterio> Hello here, Iโ€™m Jorge - new in nim lang
20:44:40FromGitter<jquiterio> I would like to conver an seq[int] into a JavaScript array ie: [1,2,3,4]
20:45:21FromGitter<jquiterio> But it has been a nightmare for me... someone could please help ?
20:47:40*eys quit (Remote host closed the connection)
20:48:58dom96!eval import json; echo(%(@[1,2,3,4]))
20:49:01NimBot[1,2,3,4]
20:49:04disruptekis it me or is #12431 pretty damned surprising?
20:49:39federico3should we have a wiki page under nim-lang for Vim? ping leorize
20:50:04federico3TIL: https://github.com/nim-lang/Nim/wiki/Editor-Support#vim
20:50:48*eys joined #nim
20:51:50*radsoc joined #nim
20:52:11FromGitter<jquiterio> Thanks @dom96 for quick response!
20:52:21*radsoc quit (Client Quit)
20:58:16*Vladar quit (Remote host closed the connection)
21:03:35rayman22201@disruptek, #12431 is weird but I get Araq's position I guess? I think it actually gets rewritten in the compiler pass into what Clyybber wrote. That might be the wrong thing to do though. :thinking:
21:07:37*solitudesf- quit (Ping timeout: 240 seconds)
21:08:29*asymptotically quit (Quit: Leaving)
21:27:13*clyybber joined #nim
21:33:39*clyybber quit (Read error: Connection reset by peer)
21:34:12*clyybber joined #nim
21:40:00federico3https://nim-lang.org/docs/unittest.html#fail.t should be rename. A fail() template should be used to fail the current test
21:48:21*stefantalpalaru quit (Quit: stefantalpalaru)
21:54:37FromDiscord<Kiloneie> Can anyone tell me if my new thumbnails are better than they were ? For YouTube
21:55:00FromDiscord<Kiloneie> i think i need to squeeze the new ones a bit more closer
22:03:11FromDiscord<juan_carlos> Which video?. Link?.
22:09:41*superbia joined #nim
22:11:45superbiaI want to store my objects in a data structure, but I want to know when appending a duplicate was rejected
22:12:13superbiawhich data structure should I look at, and also how does duplicate notification work?
22:13:51FromGitter<awr1> @zetashift a use case for multiple compilers: generating ISPC code from nim and compiling it seperately, see https://ispc.github.io/
22:15:01FromDiscord<Kiloneie> i changed all thumbnails
22:15:28FromDiscord<Kiloneie> but imma change them again tomorrow, too much empty space in the middle, upp the font ,top right and top left closer together.
22:27:01rayman22201@superbia you want to use set: https://nim-lang.org/docs/sets.html
22:36:44FromGitter<Varriount> @awr1 Wouldn't that require
22:44:28*Jjp137 quit (Quit: Leaving)
22:49:26*chemist69 quit (Ping timeout: 276 seconds)
23:03:55*Jjp137 joined #nim
23:04:31FromGitter<awr1> wouldn't that require what
23:06:40*eys quit (Quit: eys)
23:06:56*clyybber quit (Quit: Quit)
23:22:22FromDiscord<willyboar> @Kiloneie Nice job w/ the videos
23:23:47FromDiscord<willyboar> i think you need a website, nimcasts for example or something like this
23:27:28*actuallybatman joined #nim
23:29:26*krux02_ joined #nim
23:31:58*krux02 quit (Ping timeout: 245 seconds)