<< 14-06-2019 >>

00:18:17*lritter quit (Ping timeout: 258 seconds)
00:18:57*lritter joined #nim
00:26:32*abm quit (Quit: Leaving)
00:32:55*jjido quit (Quit: Connection closed for inactivity)
00:49:30*lritter quit (Quit: Leaving)
00:58:24*vlad1777d quit (Ping timeout: 268 seconds)
01:32:07*dwdv quit (Ping timeout: 245 seconds)
01:57:16*vlad1777d joined #nim
02:12:13*deech joined #nim
02:30:08*rockcavera joined #nim
02:37:35*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
02:38:06*laaron joined #nim
02:40:03*laaron quit (Client Quit)
02:40:43*laaron joined #nim
02:50:44*kungtotte quit (Remote host closed the connection)
02:52:07*deech quit (Ping timeout: 245 seconds)
02:52:43*envoyt quit (Ping timeout: 248 seconds)
02:53:04*envoyt joined #nim
03:10:05*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
03:10:25*laaron joined #nim
03:20:22leorizeskrylar[m]: you make your own gtk/gdk bindings instead of using ngtk or gintro?
03:22:00*rayman22201 quit (*.net *.split)
03:22:00*uvegbot quit (*.net *.split)
03:22:01*planetis[m] quit (*.net *.split)
03:22:01*k0mpjut0r quit (*.net *.split)
03:22:01*snowolf_ quit (*.net *.split)
03:22:01*oprypin quit (*.net *.split)
03:22:01*enthus1ast quit (*.net *.split)
03:22:01*oz quit (*.net *.split)
03:22:01*Miguelngel[m] quit (*.net *.split)
03:22:01*gh0st[m] quit (*.net *.split)
03:22:02*beatmox quit (*.net *.split)
03:22:03*drewr quit (*.net *.split)
03:22:04*CcxWrk quit (*.net *.split)
03:22:04*sealmove quit (*.net *.split)
03:22:04*vegax87 quit (*.net *.split)
03:22:05*oculux quit (*.net *.split)
03:22:05*pydsigner quit (*.net *.split)
03:22:05*Kaivo quit (*.net *.split)
03:22:50*oculux joined #nim
03:23:29*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
03:26:24*CcxWrk joined #nim
03:26:33*laaron joined #nim
03:31:06*envoyt quit (Ping timeout: 258 seconds)
03:33:40*envoyt joined #nim
03:38:02*rayman22201 joined #nim
03:38:02*uvegbot joined #nim
03:38:02*planetis[m] joined #nim
03:38:02*k0mpjut0r joined #nim
03:38:02*snowolf_ joined #nim
03:38:02*oprypin joined #nim
03:38:02*enthus1ast joined #nim
03:38:02*oz joined #nim
03:38:02*Miguelngel[m] joined #nim
03:38:02*gh0st[m] joined #nim
03:38:02*beatmox joined #nim
03:38:47*drewr joined #nim
03:38:47*sealmove joined #nim
03:38:47*vegax87 joined #nim
03:38:47*pydsigner joined #nim
03:38:47*Kaivo joined #nim
03:40:16*envoyt quit (Ping timeout: 248 seconds)
03:40:34*envoyt joined #nim
03:43:38*dddddd quit (Remote host closed the connection)
03:45:04*sealmove quit (Quit: WeeChat 2.4)
04:03:41skrylar[m]leorize: when i was typing searches in to nimble gintro was the only gtk3 one i saw
04:03:53skrylar[m]and iirc that one is made by scraping gobject-introspection
04:06:26leorizeyea, so it works directly with whatever version of gtk3 you got installed
04:06:55skrylar[m]i just fished out the gdk/gtk headers and threw a python-lark parser at it
04:07:11leorizebut there's also this: https://github.com/StefanSalewski/oldgtk3
04:09:17leorizepersonally I like gintro more because it integrates directly with Nim's gc :p
04:09:25*theelous3 quit (Ping timeout: 246 seconds)
04:09:25*nsf joined #nim
04:11:08skrylar[m]i forget if windows event loops work without a window present
04:12:46skrylar[m]i have the append-only version of bmessages working in nim, next step is burying the app-level stuff in the clean api
04:13:11leorizenice :)
04:13:24leorizedoes your module support haiku also? :)
04:13:49skrylar[m]not exactly
04:14:41skrylar[m]currently message handlers have an extra parameter to handle those weird messages that want immediate synchronous replies in to a specific return bmessage; i dunno how haiku handles those, i suspect some form of behind the scenes copying.
04:15:03skrylar[m]otherwise you could replace most of the procs with importcpp's and it would probably work
04:15:49skrylar[m]well. haiku also uses a lot of subclassing to implement virtual methods, those were replaced with closures
04:16:19skrylar[m]so instead of subclassing a bhandler, you just set the `fmessage_received` closure on the `handler` ref object
04:17:13leorizesounds easy enough to reimplement for haiku
04:17:54leorizewell, I'll try once your package is ready for writing gui program :)
04:18:13*fjellfras joined #nim
04:18:16skrylar[m]the key/value store they use for messages still rustles my jimmies compared to sdl/allegro/gdk's unions, but i guess it has advantages
04:18:38skrylar[m]urho does it the be way too.. passes hash tables to event handlers.
04:21:30*envoyt quit (Ping timeout: 272 seconds)
04:21:49*envoyt joined #nim
04:21:58leorizekey/value store is ABI-independant afaict
04:22:03skrylar[m]some of the app kit has been pushed away at least for now. they have clipboards in there and its a bit hazy to implement those on other platforms (starts getting in to a combination of messing with X11/Wayland, shm files.. windows has DDE I guess)
04:22:47leorizejust that you can extend the APIs in the future without worrying about breaking older apps, I think
04:23:10skrylar[m]bmessages? yea. removes abi trouble among other things
04:24:07skrylar[m]well a bmessage also holds the specifier stack, which is used for scripting. so it carries the idea of "button 1 of window 3 of application" which exists in applescript and nowhere else [modern]
05:10:04*narimiran joined #nim
05:15:18*sealmove joined #nim
05:25:42*sealmove quit (Quit: WeeChat 2.5)
05:59:05*AndChat|624225 joined #nim
05:59:05*envoyt quit (Read error: Connection reset by peer)
06:07:03*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
06:08:22*AndChat|624225 quit (Ping timeout: 245 seconds)
06:08:31*laaron joined #nim
06:08:45*envoyt joined #nim
06:19:43*solitudesf joined #nim
06:28:14*PMunch joined #nim
06:28:41*Vladar joined #nim
06:28:50*mjanssen joined #nim
06:34:18*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
06:34:47*laaron joined #nim
06:48:03*envoyt quit (Ping timeout: 268 seconds)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:55*gmpreussner joined #nim
07:07:18*krux02 joined #nim
07:19:06*jjido joined #nim
07:31:27FromGitter<alehander42> btw Araq
07:31:56FromGitter<alehander42> newruntime: does the allocator own the memory-related functions
07:32:08FromGitter<alehander42> e.g. if my seq has a as allocator internally
07:32:18FromGitter<alehander42> does this a point to its own alloc free etc
07:32:31FromGitter<alehander42> what i mean is, can i write my own Allocator object
07:32:47FromGitter<alehander42> which replacecs them without fixing the compiler itself
07:33:03FromGitter<alehander42> and make my seq-s use it instead
07:33:09FromGitter<alehander42> e.g. FixedSizeBuffer
07:33:48FromGitter<alehander42> i know i can write my own alloc0 etc but this requires patching the compiler itself and
07:34:01FromGitter<alehander42> making them default for all kinds of types
07:34:33FromGitter<alehander42> (the last part is probably ok, but i wonder if i can replace the "global" allocator easily from userland)
07:35:15FromGitter<alehander42> @dom96 i thought about using and i think it is good
07:36:10FromGitter<alehander42> e.g. in web frameworks, you might write many functions which accept Requst or path: string etc and typing the type doesnt really offer anything to people that write those dsl-s for all their aps
07:36:12FromGitter<alehander42> apps
07:36:20FromGitter<alehander42> `using`
07:45:40Araqwell yes, a seq can have a different allocator, one that you provided
07:47:52FromGitter<mratsim> oh, is it supported now?
08:25:21AraqI think so...
08:31:22FromGitter<mratsim> how do you create a seq with custom allocator?
08:31:36FromGitter<mratsim> I don't see a `newSeq` overload
08:43:41*dwdv joined #nim
08:53:33*gangstacat quit (Ping timeout: 258 seconds)
09:13:44*abm joined #nim
09:16:24*couven92 joined #nim
09:24:07*laaron quit (Remote host closed the connection)
09:24:34*laaron joined #nim
09:38:55PMunchCurrently working with some PascalScript code and I can see a lot of the inspiration for Nim
09:38:59*gangstacat joined #nim
09:39:07PMunchAnd I have to say you managed to pick the good parts Araq
09:42:30AraqI know it's all the same to you but last time I checked Modula 3's and Ada's influence on Nim were bigger than Pascal's, it's all the same soup though :P
09:45:44PMunchOh yeah, I went to a couple Ada talks last FOSDEM. Definitely found it similar as well
09:46:13PMunchI've never used Modula 3, but looking at it it's syntactically fairly similar to Pascal
09:48:16PMunchUgh, I'm pretty sure it'd be faster to just write my own installer wizard thing that trying to use InnoSetup..
09:49:22Araqthat's why we have finish.exe now and no InnoSetup anymore
09:49:26Araq;-)
09:50:01Araqit's always the same, productivity is the result of *not* using tools.
09:55:39FromGitter<mratsim> I would try not to use command-line but I'm pretty sure my productivity would go down ;)
09:58:10*jjido quit (Quit: Connection closed for inactivity)
10:02:32*stefanos82 joined #nim
10:08:23*natrys joined #nim
10:14:28federico3"productivity is the result of *not* using tools" should be put in a frame in this times of proliferation of useless hipster devops tools
10:14:56PMunchMhm
10:15:18PMunchUnfortunately this is a product that has to be shipped to people of dubious technical abilities
10:15:32PMunchSo a graphical installer is nice to have
10:25:12lqdev[m]damn it, why does nimterop generate shittons of `_nimterop_*` files
10:25:42PMunchBut I'd prefer to just have a Nim library built on wNim that had some common functions for setting registry keys, installing services, embedding compressed files (and unpacking them), and a light system that wraps some of the UI logic to make next/prev/etc play nice in the installer
10:39:23AraqPMunch, nullsoft installer is a bit better
10:39:51Araqhttps://nsis.sourceforge.io/Main_Page
10:41:50PMunchYeah, the reason I'm using InnoSetup is because that's what they've been using for their other installers
10:42:00PMunchTurns out they aren't all that complicated..
10:42:22PMunchI just assumed someone here would know how to actually do stuff in InnoSetup since they used it
10:44:06*laaron- joined #nim
10:47:10*laaron quit (Remote host closed the connection)
10:47:46PMunchThese error messages are great "Error on line 302 in <file> column 5: Type mismatch"
10:47:52PMunchBetween which types?!
10:48:27PMunchBy the way, only thing on line 302 is the word "begin" -_-
11:07:34*fjellfras quit (Quit: Leaving)
11:07:58*lqdev[m] sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/TYwYXXhPacUpbxkxQgUIOHbc >
11:09:55lqdev[m]should I just bake in `-lasound -lpulse -ljack`?
11:12:20lqdev[m]yeah, seems to have worked
11:19:36FromDiscord_<rupansh> hey
11:19:44FromDiscord_<rupansh> can i make my program perform a task onexit
11:22:23AraqaddQuitProc
11:23:13FromDiscord_<rupansh> can you give an example
11:29:32livcdlike this? https://glot.io/snippets/fd5l78efm0
11:31:12FromDiscord_<rupansh> thanks!
11:37:42FromGitter<kaushalmodi> livcd:
11:43:24FromGitter<kaushalmodi> turns out I never typed the rest :P
11:43:37FromGitter<kaushalmodi> livcd: why do you import system?
11:43:54FromGitter<kaushalmodi> Also Nim Playground is there now :)
11:44:11FromGitter<kaushalmodi> http://ix.io/1LKX/nim
11:44:52FromGitter<kaushalmodi> Wrong link, I meant: https://play.nim-lang.org/index.html?ix=1LKX
11:47:20*envoyt joined #nim
11:48:43lqdev[m]shashlick: I'm getting two missing DLL errors from nimterop with a normal Nim installation on Windows (just ran .\finish.exe from the downloaded zip): libgcc_s_seh-1.dll, libstdc++-6.dll
11:48:45ZevvWhat's this?! https://play.nim-lang.org/index.html?ix=1LKB
11:49:28lqdev[m]some Linux journald
11:49:37Zevvoh it's glued to the ix pastebin
11:49:38Zevvha
11:51:02*theelous3 joined #nim
11:55:28*theelous3 quit (Ping timeout: 245 seconds)
11:55:42*lritter joined #nim
11:58:24federico3a kernel happily booting on an ARM
11:59:48ZevvI though playground was leaking stuff
12:02:05FromGitter<alehander42> Araq so do we just assign to the internal allocator
12:02:06FromGitter<alehander42> field
12:03:25FromGitter<alehander42> making an object with the core/allocators interface
12:04:03FromGitter<alehander42> ahh we use setLocalAllocator
12:04:08FromGitter<alehander42> @mratsim ^
12:04:19FromGitter<alehander42> / setSharedAllocator also
12:04:46FromGitter<mratsim> it's not in system.nim?
12:04:51FromGitter<alehander42> core / allocators
12:05:09FromGitter<mratsim> also if a library is using that does that contaminate everything??
12:06:00FromGitter<alehander42> i think so
12:06:18FromGitter<alehander42> i only care for osdev toys in this instance, so doesnt matter
12:06:25FromGitter<alehander42> but indeed, the other option is
12:06:39FromGitter<alehander42> to have your own constructor for e.g. seq-s or other type
12:06:45FromGitter<alehander42> which assigns a custom allocator
12:06:48FromGitter<alehander42> to its payload
12:06:52FromGitter<mratsim> that would be better
12:07:43FromGitter<alehander42> i see it used only for seq and str
12:08:41FromGitter<mratsim> for Arraymancer I'm currently using seq in the backend and I wanted to try a custom alloc for seqs, but it seems like I will write my own type from scratch
12:08:58FromGitter<alehander42> however it doesnt seem to use this for other allocation
12:09:38FromGitter<alehander42> so even if i write a custom allocator like that i wouldnt be able to make all objects use it ?
12:09:47FromGitter<alehander42> so still need to just patch alloc0
12:10:11FromGitter<alehander42> btw Araq
12:10:24FromGitter<alehander42> how does the compiler generate -Og for debugging
12:10:29FromGitter<alehander42> i looked in extccomp
12:10:34FromGitter<alehander42> and i cant see that anywhere
12:10:46*nsf quit (Quit: WeeChat 2.4)
12:11:00FromGitter<alehander42> debug for gcc is `debug: "",`
12:19:49*vlad1777d quit (Ping timeout: 268 seconds)
12:19:53Araqdefault nim.cfg
12:35:56*dddddd joined #nim
12:38:15PMunchZevv, haha yeah it has ix support
12:39:28PMunchI was really confused for a while while developing it as I tried to get an ix paste which was a Nim error message I had earlier and echo it out. I wondered how a Http get call would fail with a procedure in the time module, took me waaaay to long to figure out what was going on
12:40:02PMunchSo long I had started going through the sources for HttpClient in order to see where it was calling this time function!
12:41:34PMunchThe new frontend has support for tours as well: https://play.nim-lang.org/newfrontend#tour=https://uploads.peterme.net/article.html
12:41:49PMunchNow that 0.20.0 is out I can probably update so the new frontend is the default one
12:42:50FromGitter<mratsim> very nice
12:47:15*envoyt quit (Read error: Connection reset by peer)
12:48:04*envoyt joined #nim
12:57:50*Snircle joined #nim
12:59:12*mjanssen quit (Ping timeout: 245 seconds)
12:59:57*laaron- quit (Quit: ZNC 1.7.1 - https://znc.in)
12:59:58*mjanssen joined #nim
13:01:13*laaron joined #nim
13:09:06*Trustable joined #nim
13:14:13*narimiran quit (Remote host closed the connection)
13:20:28*envoyt quit (Read error: Connection reset by peer)
13:23:59*theelous3 joined #nim
13:31:14TrustableHi, the search function in the docs does not work. Is this already fixed? Details: https://nim-lang.org/docs/dochack.js gives 404 Not Found
13:33:55FromGitter<kaushalmodi> hmm, https://nim-lang.org/docs/dochack.js is loading fine for me (I disabled cache to verify that).. but I see that it's generated using Nim 0.19.6
13:34:27FromGitter<kaushalmodi> ```/* Generated by the Nim Compiler v0.19.6 */ ⏎ /* (c) 2018 Andreas Rumpf */``` [https://gitter.im/nim-lang/Nim?at=5d03a2624e8f972d371a3feb]
13:35:04FromGitter<kaushalmodi> Trustable: In the meanwhile can you check if search works on https://nim-lang.github.io/Nim/tut1.html ? (it's working for me)
13:35:34FromGitter<kaushalmodi> well, it's working for me on https://nim-lang.org/docs/lib.html too
13:36:21TrustableOn devel docs it works for me.
13:38:50FromGitter<kaushalmodi> I switched to Edge (which I never use) to test this and the search on stable docs worked for me there too
13:39:03FromGitter<kaushalmodi> do you want to Ctrl+F5 and try searching on stable docs again?
13:39:15FromGitter<kaushalmodi> (assuming that you are using Firefox/Chrome)
13:50:06*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
13:50:06lqdev[m]reminder for self: Nim `float` is a C `double`, not a C `float`
13:51:46*laaron joined #nim
13:52:16*PMunch quit (Remote host closed the connection)
13:52:34Zevvso, how did that bite you?
13:53:41lqdev[m]first time around, it was when I was using OpenGL. I set a VBO's type to GL_FLOAT and passed a seq[float] to glBufferSubData
13:54:07lqdev[m]this time what I did was I set the audio format in soundio to f32le, and wrote Nim `float`s into the audio buffer
13:54:53lqdev[m]the result sounded kind of like a zapper, and a particularly loud one. fortunately I had my speakers pretty quiet
13:55:38*sealmove joined #nim
13:56:11Zevvwhen interfacing with C, use the C types. cint, cfloat, cdouble, etc
13:56:17Zevvsimple as that :)
13:58:43lqdev[m]yeah, I always screw up on simple cases like this one, just because `cint`, `cfloat` etc. are not syntax highlighted lmao
13:58:50lqdev[m]that makes me forget about them
14:01:39Zevvwow that's a pretty bad reason not to use them :/
14:01:54Zevvand one of the reasons I never got into highlighting myself I guess :)
14:06:56sealmoveyou use pure white?
14:07:54Zevvpure green
14:08:02sealmove:D
14:08:45Zevvstarted green-on-black on the apple II, never left :)
14:09:10*couven92 quit (Quit: Client disconnecting)
14:09:39lqdev[m]wow
14:10:06lqdev[m]for me, code that is not highlighted is hard to read
14:10:35lqdev[m]I always associate shades of gray with temporary variables and whatnot
14:10:58lqdev[m]that's why I forget about cint, cfloat, cdouble, and all the others
14:13:12lqdev[m]well anyways, now that my soundio wrapper is finished, I guess I should work on the high-level audio interface itself
14:14:32ZevvI guess I'm afraid to get too dependend on highlighting. Layout is key for readability for me, but I guess these things are so very subjective it doesn't even make sense to talk about it.
14:15:39lqdev[m]sure, everyone has their own coding workflow and preferences :)
14:17:23shashlick@lqdev what's up
14:17:31shashlickWhere you seeing these files for nimterop
14:18:34lqdev[m]I see these files in the directory of any file I cCompile, and they are created everytime nimsuggest kicks in to suggest a thing
14:19:25lqdev[m]the content of one those files is the same as the content of the file I cCompile
14:19:32disruptekif you work from the command-line, this pager with syntax highlighting could be interesting to you: https://github.com/sharkdp/bat
14:24:20*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
14:24:44*laaron joined #nim
14:26:29*nsf joined #nim
14:29:24shashlick@lqdev it is generated if the C file name conflicts with another c file or Nim file in the project
14:29:31shashlickCause the o file gets overwritten
14:29:54*bobby quit (Read error: Connection reset by peer)
14:29:55shashlickNim vs c conflict was fixed in 0.20.0 but c vs c will still conflict
14:31:11shashlickMaybe I need a when not defined nimsuggest
15:02:31*mjanssen quit (Ping timeout: 246 seconds)
15:05:00*PMunch joined #nim
15:06:23*mjanssen joined #nim
15:06:57*Trustable quit (Remote host closed the connection)
15:14:39*PMunch quit (Remote host closed the connection)
15:15:59*BaldEagleX02 joined #nim
15:16:49*PMunch joined #nim
15:17:15*mjanssen quit (Ping timeout: 248 seconds)
15:20:19*mjanssen joined #nim
15:21:26*Senketsu quit (Remote host closed the connection)
15:22:05*Senketsu joined #nim
15:23:17*Senketsu quit (Client Quit)
15:23:36*solitudesf quit (Remote host closed the connection)
15:23:45*solitudesf joined #nim
15:27:27*avsej quit (Ping timeout: 252 seconds)
15:29:21*Senketsu joined #nim
15:46:58*PMunch quit (Remote host closed the connection)
15:47:39*Kaivo quit (Quit: WeeChat 2.4)
15:50:49lqdev[m]shashlick: when are you going to implement nested structs in nimterop? I'm trying to wrap dr_wav and seems like I'm stuck in yet another loophole, because of those stupid nested structs
15:51:12FromGitter<kaushalmodi> I am trying to refactor the nim-emacs-module package and am stumbling at this: https://play.nim-lang.org/index.html?ix=1LM7
15:51:32shashlick@lqdev, want to do some work today on nimterop but seems unlikely given my schedule
15:51:35FromGitter<kaushalmodi> > Error: identifier expected, but found '10'
15:51:42shashlicki think adding inline cOverride will solve many of your problems
15:51:53shashlicki have some ideas for it
15:54:37FromGitter<Vindaar> @kaushalmodi what do you expect the `maxArgs` argument to do in the template?
15:55:06Araqkaushalmodi: rename the 'maxArgs' in the proc header
15:55:49FromGitter<kaushalmodi> Araq: ok, let me try that
15:56:04FromGitter<kaushalmodi> @Vindaar I was actually stuck at a different problem: actual snippet: http://ix.io/1LM9
15:56:17FromGitter<kaushalmodi> that complained that `replace` couldn't be found
15:56:26FromGitter<kaushalmodi> even though I did `import strutils` at top
15:59:09FromGitter<kaushalmodi> hmm, `replace` works in here: https://play.nim-lang.org/index.html?ix=1LMc
16:00:44FromGitter<kaushalmodi> but with http://ix.io/1LMf, it gives: ⏎ ⏎ > emacs_module/helpers.nim(41, 17) Error: undeclared identifier: 'replace'
16:02:37FromGitter<Vindaar> hm, unfortunately I gotta go now. :/ you'll figure it out :)
16:02:48FromGitter<kaushalmodi> no problem
16:14:15*ftsf joined #nim
16:15:32ftsfhi, is there a way I can operate on a bunch of fields by name (known at compile time) eg.. for k in ["a","b","c","d"]: foo.k = 0 ?
16:16:38ftsfi can't figure out how to turn the string into an identifier to use as a fieldname
16:17:01Calinou<Zevv> wow that's a pretty bad reason not to use them :/
16:17:10Calinouthat reminds me of editors highlighting "int" but not "int32_t" or "int64_t"
16:20:03lqdev[m]ftsf: you can use dot operators (https://nim-lang.org/docs/manual_experimental.html#special-operators-dot-operators) and astToStr() to do just that
16:20:44lqdev[m]oh, you want it the other way aroud
16:20:46lqdev[m]give me a sec
16:21:27lqdev[m]@mratsim did this once, he might know the answer
16:28:24Araqsimple to do with a macro
16:30:04dom96ftsf: you can either create the AST nodes via newDotExpr, newIdentNode and some other proc that I don't remember the name of for assignments. Or you can use `quote` with a combination of these procs (you'll need to at least change the `k` into an ident node
16:31:35ftsfguess I better learn to macro =) I've so far only touched templates
16:46:11*nsf quit (Quit: WeeChat 2.4)
17:06:13ZevvCalinou: I'm not a nimsuggest user, but I guess that should allow hignlighting of user defidn types?
17:06:25Calinouthat's in C++ :)
17:06:32Calinouand it's up to the editor/IDE to highlight it correctly
17:07:00Zevvyeah, but isnt nimsuggest the intelligence between nim highlighting?
17:07:22Zevvs/between/behind/
17:10:29CalinouI believe nimsuggest only handles autocompletion
17:13:53*Tyresc joined #nim
17:16:25mjanssen/part
17:16:34*mjanssen left #nim (#nim)
17:18:03*Vladar quit (Remote host closed the connection)
17:18:55leorizenimsuggest can do a lot
17:19:06leorizeincl. highlighting :)
17:19:13leorizeif you use my nim.nvim plugin ofc ;)
17:24:29FromGitter<kaushalmodi> ftsf: here's my failed attempt: http://ix.io/1LME
17:24:49FromGitter<kaushalmodi> hopefully a macro expert can help out further with that
17:25:07ftsfyeah, i've got something similar so far, no luck yet
17:28:30ftsf\o/ got it!
17:28:41FromGitter<kaushalmodi> yay! please share :)
17:30:40ftsfhttps://gist.github.com/ftsf/ffb596c02672a24b9ea126858d0afa13
17:31:34FromGitter<kaushalmodi> cool! we were quite close in the solutions :)
17:32:44ftsfi don't really understand why the other one doesn't work, but oh well
17:35:16*shadowbane quit (Quit: Konversation terminated!)
17:38:48FromGitter<kaushalmodi> ftsf: thanks for sharing
17:38:51*shadowbane joined #nim
17:38:54FromGitter<kaushalmodi> I have this based off your work: https://play.nim-lang.org/index.html?ix=1LMJ
17:39:07FromGitter<kaushalmodi> I cannot make that for loop work in there: ^
17:39:54ftsfyeah i just tried to do similar with a loop and i can't get it to work
17:39:56FromGitter<kaushalmodi> uncommenting that for loop gives: ⏎ ⏎ > /usercode/in.nim(20, 14) template/generic instantiation of `assignField` from here ⏎ > /usercode/in.nim(5, 12) Error: attempting to call undeclared routine: 'field=' [https://gitter.im/nim-lang/Nim?at=5d03dbec6f0ec85ade09a166]
17:40:13ftsfrunning into exactly the same here =)
17:42:10ftsfa loop over fieldPairs works though
17:47:01ftsfhttps://play.nim-lang.org/index.html?ix=1LML
17:50:17FromGitter<kaushalmodi> ftsf: I have asked this on forum: https://forum.nim-lang.org/t/4935#30912
17:50:38ftsfthanks =)
18:01:41*natrys quit (Remote host closed the connection)
18:02:08FromGitter<JasperJenkins> You'll probably need to unroll the loop yourself like: https://play.nim-lang.org/index.html?ix=1LMQ
18:08:14FromGitter<kaushalmodi> @JasperJenkins do you have time to convert that to `quote do`?
18:08:35FromGitter<kaushalmodi> that way I can relate between the "raw macro" and quote do
18:17:16FromGitter<JasperJenkins> The only thing that I can see being converted to quote do is the newBlockStmt. The code is more introspective than constructive. I can update with a more commented version though.
18:21:07FromGitter<kaushalmodi> Thanks
18:33:14*jjido joined #nim
18:34:24FromGitter<JasperJenkins> https://play.nim-lang.org/index.html?ix=1LMY
18:58:31*vegax87 quit (Changing host)
18:58:31*vegax87 joined #nim
18:58:31*vegax87 quit (Changing host)
18:58:31*vegax87 joined #nim
19:03:21*nsf joined #nim
19:08:01*sealmove quit (Quit: WeeChat 2.5)
19:16:48*uvegbot quit (Ping timeout: 252 seconds)
19:28:12FromGitter<kaushalmodi> @JasperJenkins thanks!
19:28:17FromGitter<kaushalmodi> I am reading through it ..
19:28:57FromGitter<kaushalmodi> btw running that code with `--expandMacro:replaceField` works nice.. no need for the "Code after" echo :)
19:37:16*SquareHimself joined #nim
19:38:54SquareHimselfSo, I'm using the irc library to make an IRC bot and I'm having trouble. The bot is synchronous, but I want it to be able to launch an asynchronous loop that continues running forever beside the bot. Basically, the loop is grabbing data as it comes in and then calling the command to have the bot msg the data to the channel
19:39:02SquareHimselfBut I'm having no luck
19:39:10SquareHimselfOne second and I'll post the code... maybe you guys can help me
19:39:44SquareHimselfhttps://0x0.st/zjzV.nim
19:40:16SquareHimselfWhat am I doing wrong? The asynchronous procedure always blocks
19:41:28shashlickyou probably need to use threads
19:42:01SquareHimselfI tried that briefly. I'll do some reading. If you have any suggestions, they're welcome, also
19:42:58shashlickhere
19:43:03shashlickhere's an example - https://github.com/genotrance/feud/blob/master/plugins/remote.nim#L128
19:53:02*kapilp quit (Quit: Connection closed for inactivity)
19:57:06rayman22201dochack is 404ing on the 0.20 docs for me btw :-(
19:57:11rayman22201dochack.js
19:57:20SquareHimselfshashlick: Now it's just giving me trouble that my function is of no type
19:57:22SquareHimself:/
19:57:30SquareHimselfI'm confused with the whole threads thing.
19:57:45shashlicksnippet
19:57:48rayman22201@SquareHimself, asyncCheck just throws away the future, it doesn't do what I think you want
19:58:10SquareHimselfhttps://0x0.st/zji5.nim
19:58:22rayman22201I don't think you need threads, you just need to fix your async code
19:58:41shashlickirc poll isn't async is it?
19:59:04SquareHimselfWell this is the first time I'm ever doing something like this, and examples that are helpful to me are scarce at the moment, so I'm working pretty much from the documentation
19:59:23SquareHimselfAnd I'm confused at the moment :D
20:00:11rayman22201Dom's book is the best tutorial for async, but being a book, it doesn't seem widely read lol
20:00:51SquareHimselfIt seems like it should be simpler to start an asynchronous loop parallel to the main loop
20:01:34*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:02:36*kapilp joined #nim
20:04:23rayman22201waitFor lol
20:04:25rayman22201It's that simple
20:04:32SquareHimselfI tried waitFor...
20:04:35SquareHimselfIt waits.
20:04:39SquareHimself>.<
20:07:20rayman22201lol
20:07:32rayman22201You want to control the event loop is what you are saying
20:08:20rayman22201So, you either make your irc bot async, or you control the event loop yourself using the functions in asyncdispatch
20:08:21rayman22201https://nim-lang.org/docs/asyncdispatch.html
20:08:47SquareHimselfI don't think you're understanding...
20:13:31rayman22201is it Dom's irc client?
20:13:45rayman22201He has an example for you: https://github.com/nim-lang/irc/blob/master/tests/asyncclient.nim
20:14:01SquareHimselfI've tried it this way, also
20:14:07SquareHimselfIt still blocks
20:14:14rayman22201what is blocking?
20:14:31SquareHimselfEither one loop runs, or the other, but not both.
20:14:52SquareHimselfI'll try again
20:15:27rayman22201You usually only have one loop in async code, some I'm confused about what you are saying.
20:15:30leorizeasync is not threads, so two loops can't run at the same time :p
20:15:47SquareHimselfOkay, so that's the issue I'm having
20:17:20SquareHimselfSo here's what I have going on now... what am I doing wrong here? (error at the bottom) https://0x0.st/zjo8.nim
20:17:56SquareHimself(besides importing asyncdispatch still, lol
20:22:27shashlickhe is calling irc.poll() which blocks
20:25:45*JuanCarlos joined #nim
20:26:08*JuanCarlos is now known as Guest79604
20:26:23rayman22201http://ix.io/1LNC
20:27:33rayman22201no polling
20:29:17rayman22201he is not calling poll in the async version
20:30:31rayman22201https://github.com/nim-lang/irc/blob/master/src/irc.nim#L563
20:31:23FromGitter<jrfondren> got <type Thread[irc.Irc]
20:31:32FromGitter<jrfondren> ^that "type" means type. literally, you're passing a type.
20:31:33FromGitter<jrfondren> not a value.
20:31:41*Guest79604 is now known as juanim
20:31:46FromGitter<jrfondren> 42 is an int. you are not passing 42. you are passing 'int'.
20:33:50rayman22201no that's not what that means jrfonden. Irc is a type
20:33:53SquareHimselfOkay, rayman's async version works. Thanks for that.
20:33:59SquareHimselfI'll study this and see why.
20:34:21rayman22201https://github.com/nim-lang/irc/blob/master/src/irc.nim#L62
20:34:36FromGitter<jrfondren> yes, that's what it means. "Irc is a type" <-- what is this intended to refute?
20:35:06FromGitter<jrfondren> ` createThread(Thread[Irc], testasyncsleep, bot)` is the line it's complaining about.
20:35:34rayman22201first, this is an x, y problem. Because he didn't need threads at all. You are too focused on the error
20:35:45FromGitter<jrfondren> OK, so I'm right.
20:36:02SquareHimselfWell, rayman took it back to where I originally started before I even got here
20:36:05rayman22201second, you said "42 is an int. you are not passing 42. you are passing 'int'." which is not what he is doing
20:36:08SquareHimselfI was trying to do async, but I was doing it wrong
20:36:16FromGitter<jrfondren> That is an example, not literally what he's doing.
20:36:32rayman22201He was passing a type, you said he wasn't
20:36:38rayman22201you said he was passing an instance
20:36:41rayman22201which isn't true
20:36:41FromGitter<jrfondren> No, I said that he was passing a type.
20:36:46FromGitter<jrfondren> Christ, you're dumb. Stop talking to me.
20:37:04rayman22201He was just passing the wrong type
20:37:12rayman22201required type: var Thread[system.void]
20:37:20rayman22201it wanted system.void
20:37:35rayman22201why are you ad homium attacking me? That is uncessary
20:37:55FromGitter<jrfondren> It is necessary, because you are continuing to blather on while being completely wrong about what I said.
20:38:34rayman22201I'm dumb, yet I actually helped the guy solve is problem. And what you said was unclear and unhelpful.
20:38:35*vivus joined #nim
20:38:40FromGitter<jrfondren> when I say "^that "type" means type. literally, you're passing a type." and you say "He was passing a type, you said he wasn't", this is not a conversation I want to continue.
20:39:26rayman22201What is the point of what you are saying? What you said did not clarify the meaning of that error
20:39:58FromGitter<jrfondren> The point is that you are a moron. You are an idiot. You are drooling right now, rather than speaking. I have nothing but contempt for you.
20:41:22rayman22201Again. I was pointing out that I thought what you said was incorrect, and at the very least unhelpful to clarifying the issue, but you continue to just ad hominem attack me?
20:41:27SquareHimselfGuys, relax...
20:41:35SquareHimselfIt doesn't really matter.
20:42:24vivusooof I've never known jrfondren to use mean words like that.
20:42:27rayman22201Rudeness is a good way to help you get banned is all I'm saying... We are trying to be a helpful community here.
20:43:02rayman22201I fully admit that I may have misunderstood what jrfondren is saying. I'm asking him to clarify.
20:43:22FromGitter<jrfondren> I said "Christ you're dumb. Stop talking to me" and here you are "asking me to clarify".
20:43:41FromGitter<jrfondren> since gitter doesn't have an ignore feature, I'm going to ban myself from it.
20:45:11rayman22201pretty trivial thing to get so offended by, but you do what you have to do lol
20:48:25shashlickgosh
20:51:36Araqer...
20:52:23rayman22201sorry :/
20:52:40AraqI don't blame you
20:59:31*stefanos82 quit (Quit: Quitting for now...)
21:03:51SquareHimselfThanks again rayman22201. I was able to rewrite the rest of my bot and put the pieces together and get it working now
21:04:00SquareHimselfSorry about the trouble.
21:04:47rayman22201awesome. glad it worked. no worries. It wasn't your fault.
21:05:55rayman22201we need a better quick start guide for async in general I think. Maybe a good candidate for Tutorial 4 lol
21:09:56*abm quit (Ping timeout: 244 seconds)
21:10:29*c2V0a3U joined #nim
21:11:30*dGtlc3 joined #nim
21:11:37*c2V0a3U quit (Client Quit)
21:12:26juanimHi.
21:14:12rayman22201Hi 👋
21:14:13*nsf quit (Quit: WeeChat 2.4)
21:14:33*SquareHimself left #nim ("WeeChat 2.5")
21:23:11skrylar[m]@freenode_PMunch:matrix.org: inno is a good installer though
21:25:22skrylar[m]if i remember doing out of box stuff gets a little weird in inno (i think its still possible with pascalscripts? its been years) but it has the most straightforward "tell me your files, ok here's installer/uninstaller" and it handles "oh no stuff didn't install right." NSIS is .. well uh, it's *very* flexible but it does jack shit unless it's told to. (ex. Inno checksums extracted files iirc, nsis just blasts them and hopes
21:25:22skrylar[m]it worked)
21:29:13*leorize quit (Remote host closed the connection)
21:29:46*leorize joined #nim
21:39:43*vlad1777d joined #nim
21:44:58FromGitter<kaushalmodi> Araq:
21:46:46Araqwhat?
22:01:21FromGitter<JasperJenkins> If i have an `x: var T` param, `addr(x)` is a no-op and gives just `ptr T`. Yes?
22:03:12FromGitter<JasperJenkins> More specifically: can I rely on this for c callbacks.
22:03:22*I_Right_I joined #nim
22:04:37*lritter quit (Ping timeout: 245 seconds)
22:06:43*solitudesf quit (Ping timeout: 245 seconds)
22:07:00*Acid147 joined #nim
22:10:51*Acid147 quit (Client Quit)
22:11:02*Acid147 joined #nim
22:22:18*dwdv quit (Ping timeout: 268 seconds)
22:23:06*juanim quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
22:27:26*pyotr joined #nim
22:28:12pyotrHello there, I have a doubt about nim-javascript events.
22:32:32*pyotr quit (Remote host closed the connection)
23:00:30*abm joined #nim
23:03:51FromDiscord_<Finch> So I have a custom object, how can I get the size of a single instance of the object?
23:09:48*laaron quit (Remote host closed the connection)
23:10:18*laaron joined #nim
23:12:28FromDiscord_<Finch> I've created this pastebin with the definition of the object (Transposition) https://pastebin.com/D4VCNnzF
23:19:35rayman22201@Finch: something like this: http://ix.io/1LOz/nim
23:19:47rayman22201Nim has sizeof
23:20:01rayman22201but the ref in the type means you are getting the size of the pointer
23:20:35rayman22201if you split it out to the full Type and the alias to the Ref Type, you can get the correct size.
23:23:03FromDiscord_<Finch> Ah perfect exactly what I was looking for thank you!
23:23:41rayman22201np
23:25:25*krux02 quit (Remote host closed the connection)
23:28:43rayman22201@JasperJenkins, late reply, I'm not 100% sure, but I think for practical purposes you can just use var. (At least c2nim and nimterop seem to do it that way)
23:29:41*lf-araujo joined #nim
23:33:48rayman22201I found this old video and I just realized that I did not know what Araq looks like until now :-P https://www.youtube.com/watch?v=hwArqelfBBY
23:37:13*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
23:38:36*Acid147 quit (Remote host closed the connection)
23:41:28*laaron joined #nim
23:43:16*lf-araujo quit (Ping timeout: 258 seconds)