<< 13-07-2019 >>

00:09:39*dwdv quit (Quit: quit)
00:34:19*mal`` quit (Quit: Leaving)
00:39:17*mal`` joined #nim
00:51:41*dwdv joined #nim
01:00:40*go|dfish quit (Ping timeout: 246 seconds)
01:15:32*go|dfish joined #nim
01:21:17*go|dfish quit (Ping timeout: 245 seconds)
01:25:50skrylar[m]since people kept asking about it, i fixed up nfltk for 0.20
01:28:32*Snircle quit (Quit: Textual IRC Client: www.textualapp.com)
01:35:12*go|dfish joined #nim
01:50:19*rockcavera joined #nim
02:45:21*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
02:45:49*laaron joined #nim
02:48:52*leorize quit (Ping timeout: 260 seconds)
02:49:42*leorize joined #nim
03:16:23leorize[m]rayman22201: I see that you're using neovim, have you tried my nim.nvim plugin? :)
03:20:03*lritter quit (Ping timeout: 245 seconds)
03:20:12rayman22201No... I keep saying that I will try it and I keep forgetting *embarrassed*
03:21:07*lritter joined #nim
03:24:32rayman22201I got the Araq lecture to use a real editor with a mouse. So maybe I need to switch to vscode lol 😜
03:28:48leorizeuse nim.nvim :)
03:29:00leorizefar superior than whatever vscode plugin can give you
03:29:14leorizethen if you need all those fancy vscode stuff just install more plugins :)
03:39:21rayman22201I agree with you... Araq has a different opinion lol
03:43:42*arecaceae quit (Remote host closed the connection)
03:43:54shashlick@leorize - your plugin is neovim only right? not vim?
03:44:01*arecaceae joined #nim
03:46:18leorizeshashlick: yea
03:46:27FromGitter<eptification> but does Araq use a vertical mouse ?
03:47:05leorizewith some effort it could run on vim8, but I'm not going to volunteer that :p
04:00:03rayman22201Idk about Araq but I use a vertical mouse. I like it a lot 😁
04:00:54shashlickwell, it's coming along - https://github.com/genotrance/shared/
04:01:03shashlickdocs for seq are in place
04:01:16shashlickneeds more work and real world usage but feedback appreciated
04:03:00shashlicki am a CLI guy but CLIs don't do well for GUI work - refresh rates and all, so i'm happy with the text editor i'm working on which is a GUI app but heavily CLI driven
04:03:26shashlicki'd have used neovim + nvim.nim but have been using feud 100% for the last few months
04:03:39rayman22201feud is very cool. I have nothing against it
04:06:05rayman22201I use neovim / vim because I have to ssh into places where that is the only option for work stuff. It's easier to just stick with it for everything I do.
04:06:15shashlickfeels like i'm getting close to getting this shared lib done and can go back to improving feud which has been stuck for last several weeks
04:06:33shashlickand nimterop too which has a lot of pending work
04:06:53shashlicki also need to migrate some nimgen projects into nimterop where possible
04:07:24shashlick@rayman22201 - that is my use case too - when i need to get stuff working on my linux machines
04:07:47shashlicki plan on making that piece easier - your editor should make it easier to edit remotely
04:07:57shashlickthere's many existing options so adding support shouldn't be hard
04:08:41shashlickare you on win/lin or osx for primary driver?
04:09:12rayman22201linux in a windows virtual box lol
04:10:02shashlickoh ya, your stream today
04:10:09rayman22201I'm required to have Windows for certain work things, even though most of the development is linux based.
04:10:58shashlickis it viable to run your editor on windows and edit remotely on the linux system?
04:11:38rayman22201For most things yes, I'm just too lazy to set it up lol
04:11:52rayman22201I prefer a linux terminal anyway
04:12:00shashlickpart of my goal is also to make the terminal part of the editor
04:12:36shashlickso while you are in a windows GUI app, you could run any remote command seamlessly
04:12:43rayman22201having attempted to work on a terminal when I tried to help with allacrity, I have to say, good luck lol
04:13:03shashlickbut i'm quite a ways from there - i still have a cmd window or putty session open all the time
04:13:44shashlickthat's the part i'm still wondering about - is it worth it or not - perhaps have an embedded putty or something
04:14:01rayman22201In theory, it sounds great, Emacs has this feature, but I never got it work very seamlessly. It always ended up acting weird
04:14:27shashlickya i have my doubts on that for sure
04:14:53shashlickright now, feud can run commands and pull content into the GUI
04:14:56rayman22201The neovim terminal works pretty well, but at that point, you are already in neovim lol
04:15:08shashlickbut that's a far call from a full CLI
04:15:16rayman22201yes
04:15:36shashlickanyway, lots of other things to do to make the editing experience complete
04:15:39shashlickthe list is long 🙂
04:15:44rayman22201Why can't you use channels for feud again?
04:16:16shashlicki can but i'm averse to creating some dumb protocol to exchange data
04:16:31rayman22201I just wonder about all the hoops for sharedSeq, and it's still got some efficiency issues.... Channels work for Go :-P
04:16:59shashlickwell, that's the thing, if it works then efficiency can be brought over time
04:17:11rayman22201same for channels
04:17:52shashlickso my use case has two threads - the monitor thread which checks for source code changes and rebuilds dlls
04:18:00shashlickit then notifies the main thread to reload
04:18:05shashlickso it is simple
04:18:26shashlickbut where i have a few seqs and strings to interact, with channels, i'll have to come up with some communication pattern between both threads
04:19:14shashlickno doubt the seqs and strings are already a scheme, but using json or some other random scheme seems annoying
04:19:30shashlickperhaps there's a good way to use channels but i've not found anything yet
04:19:38rayman22201what? Nim channels, like go channels can copy binary data?
04:19:43rayman22201you don't need to serialize anything
04:20:14shashlickya you can but the sender can send different things at different times, so you need some metadata for the receiver to know what was sent
04:20:40rayman22201Channels are typed?
04:20:44rayman22201https://nim-lang.github.io/Nim/channels.html
04:20:57rayman22201you just send a variant type
04:21:03rayman22201or have two channels, one for each type
04:22:11rayman22201that being said. I have an idea for a way more efficient version of channels that I want to make (based on me reading about how Go channels work.)
04:23:37shashlickso effectively, if i have a table of stuff, i'd have to send the entire table back and forth
04:24:31rayman22201true, but you would have to do that anyway.
04:25:20shashlickin what case?
04:25:46rayman22201Well, I take that back, but I'm sure that is a good design?
04:26:33rayman22201I would do it erlang style and have one thread in charge of the table, and just have other threads communicate with the "table thread" to get data in and out.
04:26:49*lritter quit (Ping timeout: 246 seconds)
04:27:23shashlickso again you'd have some protocol or scheme to tell the thread to put and get
04:27:54rayman22201protocol = a function that returns a channel or a FlowVar lol
04:29:27rayman22201there are cases where a parallel table is useful (a database table which may have many threads doing a parallel query / sort for example)
04:29:55rayman22201but the parallelism has to be very high for the overhead to be worth it.
04:31:02shashlickokay i guess i should read up more about channels but i really like the idea of shared memory
04:31:22shashlickanyway, this is v0.1 so hope it can get better over time
04:31:57rayman22201most traditional programmers do lol. But shared memory is so much harder to deal with lol
04:32:25shashlicki agree, at least i'll learn something even if it is a fool's errand
04:33:02rayman22201That's true
04:34:52rayman22201:-D
04:35:46*dddddd quit (Remote host closed the connection)
04:36:08shashlickthe current implementation is lazy - i'm converting to a regular seq, doing the op and then copying back to the SharedSeq
04:36:41shashlickbut that can be improved by only reallocating the specific change when needed
04:37:01shashlickalso there's only 1 global lock, in theory every SharedSeq instance could have its own lock
04:37:22shashlickso there are ways to make it a bit faster
04:37:54shashlicki plan on doing some perf tests to see what's the cost compared to a standard seq
04:38:07rayman22201yeah. Those are two big improvements I could see. The reallocation is probably going to be the biggest bang for your buck if there are only a few threads. The global lock is crap, will get you pretty far for small numbers of threads.
04:38:15rayman22201*but will get you*
04:39:30shashlickwell, it is one lock for all instances so that's a big price to pay - two threads cannot even work on different objects together
04:39:42shashlickso ya, with some real comparisons, we can see how far this can go
04:39:54shashlickit is pure nim so very fast to iterate and improve things
04:40:21rayman22201also true. And your plugin system is very nice
04:42:17shashlickthanks
04:42:38shashlickfeedback very appreciated since it works for me but definitely interested in making it better
04:42:41rayman22201(also wondering if your plugin system could be merged into HCR or supersede it b/c it has other advantages that you mentioned yesterday, and is better maintained :-P)
04:42:47shashlickit should be easy to strip it out of feud and make it a lib
04:43:25skrylar[m]do wasn't experimental before though
04:43:40shashlickwell, i don't understand the HCR implementation (haven't spent enough time honestly) but i wonder if it needed any nim compiler/stdlib changes
04:43:51shashlickcause my plugin system did not so never know where it can do more
04:43:52skrylar[m]i used to use it for some stuff; it was nice for event handlers :\
04:44:36skrylar[m]`foo.on_click do: <some stuff>` reads nicer than `foo.on_click = proc() = <...>` imho
04:46:05rayman22201@skrylar wat?? HCR = Hot Code Reload
04:47:05rayman22201sorry. maybe I don't understand the example.
04:48:35skrylar[m]no they were talking about `do` notation just a little while ago
04:48:53skrylar[m]unfortunately matrix/irc sucks at replying to things
04:49:08rayman22201oh, I see lol
04:50:22shashlickinitial simple benchmark - SharedSeq[string] is 2500 times slower than seq[string] for add and pop
04:51:10FromGitter<eptification> @rayman22201 i'd use yakuake and nvim 24/7 but I fall into the tuning rabbit hole too often. so just vscode for now
04:51:35rayman22201yikes! Well those benchmarks can only get better from here lol!
04:53:02skrylar[m]it should be sad that vscode is taken from atom which is meant to be hacked on but you're using it explicitly because tuning it sucks so hard you won't do it
04:53:07shashlickyep but that's not bad considering how much i copy right now - i was thinking it would be 10000x or 100000x
04:53:32shashlickanyway, will sleep now, have a flight in 6 hours
04:53:55rayman22201gn @shashlick and safe flight!
04:54:22rayman22201@eptification: I know the feeling about the tuning rabbit hole!
04:54:23shashlick@rayman22201 - appreciate all and any other insights
04:54:40rayman22201do less copies :-P
04:56:26shashlickDeal
05:48:18*Senketsu quit (Quit: WeeChat 2.5)
05:50:46*solitudesf joined #nim
05:51:06*absolutejam3 joined #nim
05:52:23*Senketsu joined #nim
05:54:43*Senketsu quit (Client Quit)
06:09:38*nsf joined #nim
06:13:55*Vladar joined #nim
06:19:46*Senketsu joined #nim
06:29:25*Senketsu quit (Quit: WeeChat 2.5)
06:32:41*narimiran joined #nim
06:34:38*solitudesf quit (Ping timeout: 245 seconds)
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:36*gmpreussner joined #nim
07:10:47*arecaceae quit (Remote host closed the connection)
07:11:06*arecaceae joined #nim
07:25:26*absolutejam3 quit (Ping timeout: 244 seconds)
07:42:49*jjido joined #nim
07:44:14FromGitter<zacharycarter> when opening files - is there an equivalent to `rb` in Nim or do you just use `fmRead` for binary files as well?
07:44:40lqdev[m]fmRead is rb afaik
07:48:46FromGitter<zacharycarter> okay cool - thanks
07:55:14FromGitter<zacharycarter> writing a DDS loading proc :)
08:03:37*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:17:56*jjido joined #nim
08:30:46FromDiscord_<Skaruts> what's the best way to import a whole folder of nim scripts?
08:31:26lqdev[m]what do you mean by 'Nim scripts'?
08:31:32FromDiscord_<Skaruts> nim files
08:31:37lqdev[m]ah
08:31:54FromDiscord_<Skaruts> for example a ui folder with all sorts of ui elements in many files
08:32:19lqdev[m]then you have no other option but to import each file using `import ui/[button, textbox, ...]`
08:32:28FromDiscord_<Skaruts> bad example, since I wouldn't want to import all of those, but...
08:32:42FromDiscord_<Skaruts> hmm
08:33:00lqdev[m]you can also create a `ui/prelude` file which you then include in your other source files (`include ui/prelude`)
08:33:10lqdev[m]this file should contain all the imports
08:33:18FromDiscord_<Skaruts> and export them all
08:33:47lqdev[m]you mustn't export when you're creating an include file
08:34:08lqdev[m]`include` literally includes another source file in your current source file
08:34:09FromDiscord_<Skaruts> oh, include
08:34:22FromDiscord_<Skaruts> didn't know about it
08:34:43FromDiscord_<Skaruts> oh that probably what I want
08:34:50narimiranprobably it isn't ;)
08:35:16*Elronnd joined #nim
08:35:17*Elronnd left #nim (#nim)
08:35:23lqdev[m]but yeah, unfortunately Nim doesn't support importing all files from a folder in one go. you have to specify them individually
08:36:53*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:37:10FromGitter<zacharycarter> ooph - this is ugly...
08:37:44FromGitter<zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d29985854d3383937fb2e11]
08:38:48FromGitter<zacharycarter> but my unchecked array is defined as `ptr UncheckedArray[uint16]` - and I need an unchecked char array
08:39:12*salewski joined #nim
08:39:39FromGitter<zacharycarter> maybe the first cast is unnecessary - I don't know
08:43:11salewskiAdmins, someone has just pushed an unauthorized copy of an older forum post of me again to the forum:
08:43:14salewskihttps://forum.nim-lang.org/t/5009
08:43:26salewskihttps://forum.nim-lang.org/t/4742#29575
08:43:46salewskiI assume really bad intent, so I suggest deleting it.
08:44:10FromGitter<zacharycarter> I guess you're popular since apparently this has happened more than once :P
08:44:36*ng0 joined #nim
08:45:17narimiransalewski: hmm, could it be a new way for spammers to post?
08:45:41FromGitter<alehander42> btw why isnt ix working for bigger content
08:45:55narimiransalewski: i marked it as a spam
08:46:20salewskiYes, they may later insert the spam content.
08:46:41salewskiIt is strange. Bye.
08:46:51*salewski quit (Quit: WeeChat 2.4)
08:50:36FromGitter<zacharycarter> and then I find - https://github.com/Skrylar/skdds/blob/master/skdds.nim
08:50:47FromGitter<zacharycarter> guess I should have searched first
08:51:39skrylar[m]:F
08:51:53FromGitter<alehander42> oh ix.io is good
08:52:22FromGitter<zacharycarter> skrylar[m] - thanks :D
08:52:31FromGitter<zacharycarter> want a PR for updating it to the latest Nim?
08:52:33skrylar[m]wonder if that still works
08:52:43FromGitter<zacharycarter> it doesn't - but I'm going to fix it so it does :)
08:54:01skrylar[m]it sounded like most of the "and now you have to rewrite all your code" changes were out of the way now
08:54:21FromGitter<zacharycarter> well - this was last updated 2 years ago?
08:54:31FromGitter<zacharycarter> and it looks like there are about five or six errors
08:56:03*clyybber joined #nim
08:56:28skrylar[m]"invalid enum order" what a useless error
08:56:58FromGitter<zacharycarter> yeah - that error does stink... and if I comment out all the entries but two - I get that error regardless of how I order them
08:57:22FromGitter<zacharycarter> but that has been around for a while now I think
08:57:47skrylar[m]yes they have been inspired by andrei's take on D programming
08:58:31*jjido joined #nim
08:58:55FromGitter<zacharycarter> it would be nice if it would give you the elements that are out of order and what order they should be in
08:58:58FromGitter<zacharycarter> but I'm guessing that's not easy
08:59:06skrylar[m]it would be nice if the compiler just obeyed
08:59:33skrylar[m]it's really not a logic or syntax error, it's a pedandic one
08:59:39FromGitter<zacharycarter> true
09:03:35skrylar[m]well i pushed one that compiles now
09:05:00FromGitter<zacharycarter> thanks!
09:05:04*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:05:09skrylar[m]the tests fail tho
09:07:28skrylar[m]oh.
09:07:42skrylar[m]make_fourcc doesn't work in 0.20 for some reason
09:09:46FromGitter<zacharycarter> I think maybe there was a change to `shl` and `shr`
09:10:46skrylar[m]ok. its fixed. enjoy
09:10:52FromGitter<zacharycarter> thank you!
09:12:15skrylar[m]i think they were in the right sort order but the encoder was shifting on 8bits now instead of 32
09:12:34skrylar[m]but the enum is gone and its just a distinct type which works more or less the same for what a fourcc code is anyway
09:13:17*brakmic joined #nim
09:13:54skrylar[m]I don't recall if DDS will hold any old compressed format; I seem to remember it doesn't hold the ericsson ones?
09:14:23skrylar[m]the stcc patents finally died, although on newer hardware theres etc1 and etc2 which are fully opne
09:15:29FromGitter<zacharycarter> I'm not sure either
09:16:10*shomodj joined #nim
09:16:24skrylar[m]reading the code again, yes you could store etc in there but it would be a custom fourcc and none of the tools would recognize it
09:18:15skrylar[m]https://stackoverflow.com/questions/9341608/container-format-for-etc1-textures
09:18:24*shomodj quit (Client Quit)
09:19:27skrylar[m]it looks like kronos has their own version of dds now too https://www.khronos.org/opengles/sdk/tools/KTX/
09:22:03*lf-araujo joined #nim
09:22:08clyybberzacharycarter: Do you want to use DXT compression with bgfx?
09:23:58FromGitter<zacharycarter> I don't think bgfx supports DXT compression
09:24:14FromGitter<zacharycarter> it does support ETC1, 2, 2A, 2A1
09:24:21skrylar[m]it does if your gpu does lol
09:24:34skrylar[m]bgfx barely does much more than shuttle it off to directx or opengl
09:24:43FromGitter<zacharycarter> maybe just the tool doesn't
09:24:52FromGitter<zacharycarter> his texture compression tool
09:25:18skrylar[m]tbh i haven't profiled to see how dxt compares with etc
09:26:02clyybberBC7 is superior to DXT1,3,5 in all aspects, so if possible I would go with BC7
09:27:20FromGitter<zacharycarter> thanks for the protip
09:28:43clyybberUncompressed: https://i.imgur.com/EQUS2hB.png DXT1: https://i.imgur.com/VJItUkY.png BC7: https://i.imgur.com/XgKriCV.png
09:28:56clyybberthats a comparison I found on the skyrim modding subreddit
09:31:38skrylar[m]there also aren't many comparisons between dxt/bc and etc/eac
09:33:08FromGitter<zacharycarter> hmm
09:34:16FromGitter<zacharycarter> I see examples of folks using bc* on github with the texture compression tool so I'll just go with that
09:34:29FromGitter<zacharycarter> as you suggested
09:34:53skrylar[m]it really just depends on how many potatos need to run your code heh
09:34:58FromGitter<zacharycarter> gotta run for now - lunch with a friend and then gotta go to the office to resolve binary file merge conflicts that other people made - joy
09:35:20FromGitter<zacharycarter> which just means re-doing everything inside unity
09:38:48*brakmic quit (Read error: Connection reset by peer)
09:38:58*brakmic joined #nim
09:39:26*brakmic quit (Client Quit)
09:39:47*brakmic joined #nim
09:46:56clyybbersounds like fun
09:46:57clyybberbbl
09:46:58*clyybber quit (Quit: WeeChat 2.5)
09:56:49*actuallybatman quit (Ping timeout: 248 seconds)
09:56:53FromGitter<mratsim> so making flowvars compatible with Async was just renaming finished to finito? https://github.com/nim-lang/Nim/pull/11724
09:58:42*oreganos joined #nim
10:01:23*oreganos quit (Client Quit)
10:12:51*lf-araujo quit (Remote host closed the connection)
10:17:31*Trustable joined #nim
10:20:03FromDiscord_<Skaruts> can I ask the compiler to instead of compiling, to give me a list of a bunch of errors at once?
10:20:54leorizenim check
10:21:23FromDiscord_<Skaruts> nice, thanks
10:22:07FromDiscord_<Skaruts> btw, is there a way to ignore specific warnings? (not all warnings)
10:23:42leorize--warning[WarningTag]:off
10:24:03leorizeor in your config.nims: warning("WarningTag", false)
10:24:37FromDiscord_<Skaruts> thanks
10:57:24*clyybber joined #nim
11:21:37*couven92 joined #nim
11:26:41*Trustable quit (Remote host closed the connection)
11:34:37*dddddd joined #nim
11:51:36*leorize quit (Ping timeout: 260 seconds)
11:52:55*solitudesf joined #nim
11:53:05*narimiran quit (Ping timeout: 248 seconds)
11:55:05*leorize joined #nim
12:02:29*stefanos82 joined #nim
12:07:56clyybberAraq: How can I generate a simple nil assignment in liftdestructors ownedRefOp ?
12:09:20clyybberSo that we set the ref to nil in a move
12:09:56clyybberis there some builtin I could use for that? Or a PNode which is a nil literal?
12:10:11*absolutejam3 joined #nim
12:11:45FromDiscord_<Sporgity> I ran a nim file and it didn't show the out put, but it shows the debug instead.
12:11:52FromDiscord_<Sporgity> I ran a nim file and it didn't show the output, but it shows the debug instead.
12:12:07FromDiscord_<Sporgity> the debug says it was successful
12:12:48clyybberPaste the output to hastebin or some other pastebin and post it here
12:13:42FromDiscord_<Sporgity> the code or the debug?
12:23:13clyybberthe "debug"
12:23:26clyybberor both, if you can
12:23:45FromDiscord_<Sporgity> Okay
12:23:55*Snircle joined #nim
12:23:58FromDiscord_<Sporgity> give me sec
12:27:49FromDiscord_<Sporgity> here https://paste.ofcode.org/Apb3ZLsSkqm4tbKwKN7ynm (I couldn't find the hastebin website. I went to hastebin.com, but there was a gateway timeout)
12:36:45*lf-araujo joined #nim
12:38:11clyybberah, yeah hastebin is down since a few days, I forgot
12:39:36clyybberSporgity: When you run 'nim c' the compiler creates a new file, an executable. Run that.
12:39:47clyybberNim is not an interpreted language like python
12:40:18clyybberBut you can do `nim c -r` to compile and run it.
12:40:25clyybberWhich is probably what you want
12:48:37*lf-araujo left #nim (#nim)
12:49:29*jjido joined #nim
12:59:23*nsf quit (Quit: WeeChat 2.4)
13:15:54FromGitter<zacharycarter> I think I'm going to write a `.ktx` loader when I get home - seems pretty damn simple to do so
13:16:07FromGitter<zacharycarter> then I can take my dds files and compress them with BC7 to ktx
13:16:13FromGitter<zacharycarter> as well as every other image type
13:19:48*solitudesf- joined #nim
13:20:26clyybberdds supports BC7 too, afaik. But I guess KTX is a more open standard ?
13:22:28*solitudesf quit (Ping timeout: 272 seconds)
13:22:34*Snircle left #nim ("Textual IRC Client: www.textualapp.com")
13:27:10*narimiran joined #nim
13:34:22*shomodj joined #nim
13:35:20*shomodj quit (Client Quit)
13:37:24FromGitter<zacharycarter> yeah
13:52:06*nuggetsauce joined #nim
14:04:45*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:07:33Araqclyybber: newNode(nkNilLit)
14:07:43Araqthere is no shortcut really
14:08:33*absolutejam3 quit (Ping timeout: 248 seconds)
14:25:26disrupteki'm streaming my startup development. probably going to take it a little more seriously once y combinator's startup school starts, but for now i will work on streaming tools and some smaller pieces of code to get a feel for it.
14:27:54dom96disruptek, oh? What are you working on?
14:30:16*sniffdtek joined #nim
14:31:57disruptekthe poc is a search tool for ebay, but the real product will unify ebay/amazon/walmart product databases.
14:32:58disruptekthe poc knows what you've seen and discarded, so it can show you just the newest matches to your search. the new product also asks you the most useful questions to narrow your results.
14:34:12disruptekhttps://auctionhero.io/
14:34:49dom96interesting
14:36:00disruptekyeah, the highlevel ideal is to use semantic data to not just understand the products, but to be able to relate them and contrast them in the same ways the user does.
14:36:56dom96you should do some coding instead of staring at IRC ;)
14:37:15disruptekyeah, i'm thinking about how i want to attack this stuff. ;-)
14:37:58dom96I'm working on a little IO game which I hope I can monetize. Scaling it is an interesting challenge
14:38:15disruptekwhat's an IO game?
14:39:08dom96A browser game that's typically played in a world with 100+ players. For example agar.io and slither.io
14:40:57disruptekwhat are the details?
14:41:56dom96Not willing to share too many yet, it's more remniscient of agar.io than slither.io though :)
14:42:20disruptekyou're really gonna make me look that stuff up, huh?
14:43:04dom96Yes, there is no way I can get close to a good explanation when you can just try it and see exactly what it is
14:45:02disruptekwhere is the money?
14:46:08*sschwarzer joined #nim
14:46:49sschwarzerHi, has anyone else problems with https://forum.nim-lang.org ? I get a gateway timeout.
14:47:05sschwarzererror 504
14:48:45dom96works for me
14:49:31sschwarzerdom96: Trying ... yes, for me it also works (again)
14:50:54disruptekso you don't know how to monetize it and you can't share the scaling challenge?
14:51:37dom96disruptek, erm, that's a bit accusatory
14:52:10disruptekwell, i'm not sure why you brought it up if you don't want to talk about it. :-P
14:52:53dom96If you try out agar.io I'm sure you'll figure it out :)
14:53:00dom96Gotta go, see you later
14:54:50disrupteki would make the snakes somehow represent product logos, or perhaps that flash a logo when they eat. or it paints the floor with the logo. but, i don't see any scaling issues with the thing. if you want p2p infinite playspaces, there are lots of solutions.
14:57:06*uvegbot joined #nim
14:58:33*zyklon quit (Ping timeout: 244 seconds)
14:58:33clyybberAraq: Thanks, I now found that too. Is it better to do newNodeIT(nkNilLit, c.info, x.typ) ?
15:03:34FromDiscord_<++x;> Oi
15:03:57FromDiscord_<++x;> Long time no see
15:04:56*sschwarzer quit (Quit: leaving)
15:07:51disruptekaww sup dawg
15:22:20clyybberdisruptek: sounds a tad bit dystopian
15:22:58clyybberyou play along as a small startup, and then google snake comes along to eat you.. lol
15:23:23clyybberthe dystopian part is that theres ads everywhere
15:23:35disruptekhey, it's hard to monetize something that is available for free elsewhere. trust me on this. ;-)
15:24:14disruptekproject c.a.r.s. sold billboard ads in their gameworld. i almost bought one for my Porsche shop.
15:24:47disruptekit was only about $1700 iirc, but i forget how many billboards that woulda bought.
15:53:54*lritter joined #nim
15:57:33*actuallybatman joined #nim
15:58:14*abm joined #nim
16:02:11*brakmic quit (Read error: Connection reset by peer)
16:04:07*brakmic joined #nim
16:04:24*brakmic quit (Client Quit)
16:04:45*brakmic joined #nim
16:05:23*brakmic quit (Client Quit)
16:05:48*brakmic joined #nim
16:06:55*couven92 quit (Quit: Client disconnecting)
16:07:48*brakmic quit (Client Quit)
16:08:18*brakmic joined #nim
16:09:29*nsf joined #nim
16:36:14clyybberAraq: Haha, I get '[FATAL] dangling references exist' with nim c and 'free(): double free detected in tcache 2' with nim cpp
16:46:25*Kaivo quit (Quit: WeeChat 2.5)
16:49:58clyybberAraq: A owned parameter is treated like a sink param right?
16:50:15clyybberOr should be
16:57:41*nuggetsauce quit (Read error: Connection reset by peer)
17:03:37lqdev[m]oh my fucking god http://www.ecma-international.org/ecma-262/6.0/#sec-html-like-comments who thought this was a good idea
17:04:19disruptekcomment all the things!
17:05:51Zevv<!-- /* what */ // no problem ->
17:09:12*sniffdtek quit (Read error: Connection reset by peer)
17:09:43*sniffdtek joined #nim
17:18:47Zevvwhat's nimBetterRun?
17:35:42*PMunch joined #nim
17:58:41ZevvAraq hacking a new feature and muttering "This better run.." while waiting for the compile?
18:08:09clyybberZevv: Its so that you dont recompile when nothing changed and you do nim c =r
18:08:15clyybbers/=r/-r
18:23:47clyybberAraq: So owned is also pass by address
18:31:32*solitudesf- quit (Quit: Leaving)
18:32:01*solitudesf joined #nim
18:41:37Araqclyybber: yeah
18:41:41*sniffdtek quit (Remote host closed the connection)
18:42:03*sniffdtek joined #nim
18:46:07*Senketsu joined #nim
18:59:36*absolutejam3 joined #nim
19:02:40*Perkol joined #nim
19:21:32*brakmic quit (Read error: Connection reset by peer)
19:21:38*brakmic_ joined #nim
19:29:14*Perkol quit (Quit: Leaving)
19:29:49*MH026 joined #nim
19:48:10rayman22201so the FlowVar PR failed b/c we can't have more than 1024 async FD's? https://travis-ci.org/nim-lang/Nim/jobs/558149705#L5256
19:51:49Zevvis that my fault? 0229dfd1997ef9a2229c144a875fe51db206fdcd
19:54:06Zevvnope, I guess a s.checkFd() call is missing in registerEvent
19:54:21rayman22201checkFD is not doing what it is supposed to
19:54:23rayman22201https://github.com/nim-lang/Nim/blob/devel/lib/pure/ioselects/ioselectors_epoll.nim#L81
19:54:45rayman22201or do I need to add checkFd() to the registerEvent proc?
19:55:08ZevvI guess it is missing there.
19:55:36rayman22201neat. This is why tests are good :-P
19:55:46rayman22201I will add that to the PR
19:56:44ZevvThe original PR limiting the set to 1024 was mine because "hello world" ate 400MB of memory to allocate all possible fd's
19:58:00rayman22201That makes sense lol. Just need to make sure the code to expand the set is in all the right places
19:58:59ZevvI didn't add the checkFd calls, those were already there. But it seems this one was missing
19:59:35rayman22201I'm not blaming you! I think your lower limit exposed an existing bug. Which is a good thing!
19:59:41rayman22201:-D
19:59:55rayman22201too many "!!!!" I have had too much caffeine I guess lol
20:00:49MH026been weaning myself off caffeine the past few days, a sloth has more energy than I do
20:01:51rayman22201You are a better person than I am. I love coffee so much that I grow coffee plants in my garden :-P
20:02:07Zevvrayman22201: but the change in fd set size is over half a year old - not sure why this was only triggered now
20:02:18MH026rayman22201: that sounds awesome actually
20:02:35ZevvI'm dutch: we're legally allowed to smoke coffee
20:02:45rayman22201lol
20:02:51MH026most "coffeeshops" are closing here though
20:03:02Zevvwhere is 'here'?
20:03:06MH026Arnhem
20:03:45Zevvwell, how many do you need - a handful serves a city
20:03:59MH026We had 3 in 1 street haha
20:04:30Zevvthat might be a bit of overkill yes
20:04:42rayman22201@Zevv I'm not surprised the bug didn't show up earlier. It isn't common to make that many FD's, and is probably no test for it in the test suite (until now that is.)
20:04:47FromGitter<alehander42> disruptek
20:04:51FromGitter<alehander42> awesome what web stack?
20:04:58Zevvrayman22201: ok, good you found it now then, thanks
20:05:00FromGitter<alehander42> is this why your write your own stuff
20:05:07FromGitter<alehander42> i am writing my own nim web framework
20:05:19FromGitter<alehander42> but very slowly and currently its mostly pipelining existing libs
20:06:00rayman22201There is probably an optimization here to re-use fds, since they will be used much more often now that spawn creates a new fd every time it is called.
20:06:40Zevvah, that explains. And why is that?
20:06:48FromGitter<alehander42> it will be just a side project
20:07:06rayman22201That is how FlowVar integrates into asyncdispatch.
20:07:15Zevvah its finally happening!
20:07:29rayman22201yeah! We streamed it live and everything lol
20:07:32disruptekwhat web stack?
20:07:36rayman22201it was the goofiest stream ever lol
20:07:43*Senketsu quit (Quit: WeeChat 2.5)
20:07:51rayman22201https://github.com/nim-lang/Nim/pull/11724
20:08:23rayman22201long time coming. I'm very excited :-)
20:08:27Zevvso, what's the fd? A pipe on unix, and on win?
20:08:33rayman22201We can finally start to eat Golangs lunch :-P
20:09:11*Senketsu joined #nim
20:10:25rayman22201The windows IOCP thing I think? Araq knows more than I do. I'm not super familiar with the win apis
20:10:57Zevvsweet stuff. I'll see if I can reuse some of that to finally make the async DNS work and portable
20:11:34rayman22201this thing: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-select
20:11:47rayman22201that would be super cool @Zevv :-)
20:12:38*Senketsu quit (Client Quit)
20:13:31*Senketsu joined #nim
20:13:53*Jesin quit (Quit: Leaving)
20:14:01*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
20:14:23*laaron joined #nim
20:14:29disruptekalehander42: oh, what stack am i using? it's old, something i put together in 2014. js-based, no nim underneath. i need aws appsync, so i am gonna have to have a js component hanging out to talk to their rtdb.
20:14:56disruptekbut i don't mind entertaining switching the rest of it to nim if it buys me something... ;-)
20:16:14*sagax quit (Quit: Konversation terminated!)
20:16:26FromGitter<eptification> @MH026 are you cold turkey or weaning? Im down to 600mg from 800mg
20:17:32Zevvoi, this AsyncEvent has always been there! Why did I not ever see that
20:18:17disruptekhave any of you seen ryukoposting any time recently?
20:19:05Zevvno, *long* time not
20:19:41MH026eptification: you take caffeine as capsules? And I tried cold turkey but I cant last through the day if I do :'(
20:20:01*Jesin joined #nim
20:20:04Zevvdisruptek: https://gitlab.com/ryukoposting :(
20:20:41disruptekthis is why i like to write my own stuff. :-(
20:21:43rayman22201@Zevv, I thought I remember @Dom96 or somebody saying that AsyncEvent wasn't there from the very beginning but it was added quite a while ago, because there needed to be a better api for hooking generic events into asyncdispatch...
20:22:07Zevvrayman22201: well, duh :)
20:22:21rayman22201lol
20:22:29Zevvthis final commit is so trivial, makes you wonder why this was never there
20:22:32FromGitter<eptification> no coffee. i would cold turkey but i dont have a free weekend to just sleep off the slothitis
20:22:53rayman22201yeah.... It really makes adding to asyncdispatch much easier!
20:24:38Zevvdisruptek: ryukoposting dropped out from one day to the next, and now his latest project on github is ECG firmware :/
20:25:28disruptekwell; i'm in a bind over his aws bindings. :-(
20:25:37disruptekty for the analysis, though.
20:25:46rayman22201cool. I added `checkFd`, and now I run out of FD's on my machine when running the test locally lol
20:26:03Zevv"1024 fds should be enough for everyone"
20:26:32rayman22201lmao. Unless you are trying to spawn 5000 thread tasks, and each one attempts to get a unique fd :-P
20:27:42rayman22201thoughts on how to fix this @araq, @dom96, @Zevv, anybody else?
20:27:57ZevvI'm first trying to see what the underlying mechanism is
20:28:05rayman22201I can increase the max fd ulimit on my system, but that is a hack
20:28:20rayman22201and won't help the CI
20:28:42Zevveating an fd for each thread is not nice indeed
20:28:48Araqstop poking me
20:28:53AraqI'm away
20:29:03rayman22201ok. sorry
20:29:15*rayman22201 is only kind of sorry
20:30:30rayman22201maybe there should be some machinery for recycling fds in AsyncDispatch?
20:30:49rayman22201that would make it more efficient in general, but it might be complicated...
20:32:20Zevvwell, there needs to be a way to make events distinct. I just took a little peek at the code, but it seems the underlyng ioselector code adds an os-specific thingy to pass an event to the selector
20:32:26Zevvwhich is basically a pipe or a socket
20:32:28*sagax joined #nim
20:32:34rayman22201yup
20:33:11Zevvand then if it triggers, something is put in. But of course you could have one pipe and use it for an infinite amount of different triggers by using the actual data that is put in the pipe
20:33:45rayman22201we could multiplex the platform pipe/socket onto multiple "nim pipes/sockets"
20:34:38rayman22201exactly. idk what the best level of multiplexing is... also another layer of abstraction, :-/
20:34:53ZevvI guess the first occurance of newSelectEvent() should create a single socket/pipe/whatever
20:35:07Zevvand then create an unique resource for each consecutive call
20:35:44Zevvunique id, that is
20:35:45rayman22201I don't think 1 os socket : infinite nim sockets is a good ratio.
20:35:53rayman22201socket == fd
20:36:11rayman22201maybe 1 so socket : 10 nim fds?
20:36:18rayman22201maybe a tunable parameter?
20:36:45Zevvnot sure. triggering is pretty cheap, as it is only writing a few bytes into the pipe
20:37:09Zevvthe receiving end is single threaded anyway
20:37:13rayman22201the socket will bottleneck eventually.
20:37:31rayman22201but if we only do this for asyncEvent, we can probably get far, you are right.
20:37:51rayman22201I guess other events that have "real" socket handles, like network or file IO don't matter here.
20:38:17Zevv5 mins, brb
20:38:28rayman22201np
20:40:27*jeyr joined #nim
20:41:01Zevvso, async is always handled by one thread only, as there is only one event queue
20:41:22*NimBot joined #nim
20:41:26*Vladar quit (Remote host closed the connection)
20:41:38Zevvmeaning having only one SelectEvent (socket/pipe) should be no problem
20:42:07Zevvworst that can happen is that the write end blocks when the read end is congested
20:42:38*narimiran quit (Ping timeout: 272 seconds)
20:42:41rayman22201I looked up the buffer size for a socket/pipe on linux and windows. It's 64kb. That's a lot of 32bit ints before we hit a limit.
20:42:50Zevvnope, pipes are 4K on unix
20:43:14Zevvoh no sorry
20:43:23rayman22201that's old old kernels I think
20:44:01Zevvno, I was confusing atomic writes because of page size.
20:44:06Zevv64K is right
20:44:21rayman22201yeah, it's 4 pages these days :-)
20:44:34rayman22201and windows apparently copied linux here
20:44:37Zevvit's configurable even
20:44:42rayman22201from my quick googling anyway
20:45:20Zevvthe send/trigger end is trivial
20:45:24rayman22201there will be some overhead from the de-multiplexing, but overall, I think you are right. Just using a single socket is the way to go.
20:45:31Zevvbut the receiving end is harder
20:45:36rayman22201yeah, the demux
20:47:10rayman22201really though, it's just "send the unit32 nim fd id". Then on the other end have a master signal handler that does: "read the uint32, find the matching signal handler, and fire it"
20:47:31Zevvit's already partly there. The selectInto() normally only does the polling
20:47:37rayman22201on a high level. not too hard. *famous last words*
20:47:44Zevvbut it sees the fd is an event, and does the read in the select already
20:47:50Zevvignoring the data
20:47:53Zevvits int64 btw
20:48:05rayman22201can we make it uint32?
20:48:19rayman22201just to squeeze more efficiency :-P
20:48:22ZevvWhy is it not even a single byte, if nobody cares about the data?
20:48:28rayman22201good question
20:48:29rayman22201lol
20:49:07rayman22201I think uint16 is too small, but uint32 is plenty of unique id numbers.
20:49:13rayman22201and still very efficient
20:49:24rayman22201we just modify the read to not ignore the data.
20:49:26Zevv*famous last words*
20:50:44ZevvI'm looking into the _poll flavour, but I don't see the logic yet how it knows it is a selectEvent and it should read the data
20:51:16rayman22201there probably is none. It will need to be written.
20:51:49rayman22201I just had to double check, but pipes are thread safe. *sigh*.... This is going to be used in a multithreaded context now :-P
20:51:49Zevvno, right now already: it should not read an int64 from any pipes, only from the ones put in by newSelectEvent. But how does it know that
20:52:14*jeyr quit (Quit: jeyr)
20:52:43*Senketsu quit (Quit: WeeChat 2.5)
20:52:57rayman22201oh. I think I know. It never does any read period. It passes the fd to the complete callback, which can then read from the fd.
20:53:18Zevvno, check line 243 in ioselectors_poll()
20:53:33Zevvthat's the read handling the data put in there by trigger()
20:54:16Zevvwhat does "if Event.User in pkey.events:" mean
20:55:10rayman22201no idea
21:00:45Zevvok, 'User' is a flag set on fds which are used for events
21:00:52Zevvso that all makes sense
21:01:30*Senketsu joined #nim
21:03:20rayman22201ah. yeah. ok. So there you go. most of the machinery is already there
21:03:47*laaron- joined #nim
21:04:11rayman22201The demux code can go right there (and in similar places in all the other platform specific poll files)
21:04:26Zevvso the event rfd/wrd move out of the SelectEventImpl and into the selector itself, and SelectEventImpl gets an unique ID instead
21:04:45*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
21:05:22Zevvpipe-to-self is also a common solution for safely handling signals in async stuff - not sure if anything is in place for that in Nim
21:06:53rayman22201I like the uniqe ID solution better because it's more general. Pipe to self is the unique ID solution with a single ID
21:07:18Zevvproblem: newSelectEvent has no relation to the Selector
21:07:39rayman22201I don't think we need to move all the rfd/wrd code out of SelectEventImpl
21:08:05Zevvwell, it is possible to just have the same fd in all these things, but that would be silly
21:08:40ZevvregisterEvent will need different semantics as well, if all events share the same fd
21:08:41*sschwarzer joined #nim
21:09:38*brakmic_ quit (Ping timeout: 245 seconds)
21:09:40rayman22201hrmmm. ok
21:09:59rayman22201where is the Event enum defined
21:10:20Zevvthe typical place to keep this pair of fds is inside the selector object itself, but thats not passed to newSelectEvent
21:11:33rayman22201maybe we set it in registerEvent?
21:12:06Zevvor add the selector as an argument to newSelectEvent - in the stdlib noone else seems to use this at least
21:12:15sschwarzerI just noticed that Bitbucket allows to select Nim as the programming language for a repository but doesn't have syntax highlighting for Nim. :-/
21:12:33Zevvoh right registerEvent has it
21:12:37rayman22201In the stream we were talking about how registerEvent is kind of weird anyway. It arguably shouldn't exist and addEvent should just add the event to the current (and probably only) active event loop
21:12:58*shomodj joined #nim
21:13:18Zevvwhere is this current and probably only active event loop to be found then?
21:13:53rayman22201it's literally a global variable. That's how "runForever" and "waitUnti" knows which event loop to wait for
21:14:10Zevvyeah of course, I just realized
21:14:18Zevvbut that's in the async layer, not in the selectors layer
21:14:32Zevvthat just happens to have one selector instance
21:15:20ZevvI haven't seen it happen often in real life, but it could be practical to have multipel selectors
21:15:36Zevvhigh performance serverse might mix async and threads, handling a pool of fds per thread
21:15:42rayman22201true. It comes down to, is "AsyncEvent" a high level or level api?
21:15:51*jjido joined #nim
21:15:54rayman22201I completely agree. I could see instances of multiple event loops
21:16:06rayman22201Especially now that async and flowvar are compatible
21:16:08Zevvbut anyway, registerEvent has the info.
21:16:10rayman22201specially
21:16:36rayman22201yeah. registerEvent is probably good enough for now
21:16:41Zevvso registerEvent will do the pipe() on the first run
21:16:58rayman22201yeah.
21:17:57sschwarzerMy first Nim program (apart from "Nim Basics" exercises) ... https://bitbucket.org/sschwarzer/vppdiff/src/default/vppdiff.nim :)
21:18:05sschwarzerThere's still lots to do
21:18:55Zevvwow you'r hight on comments :)
21:19:19rayman22201lol. I was about to say the same thing. Good job with all the comments lol
21:19:40rayman22201you haven't reached the "lazy" stage of your programming career yet :-P
21:20:00sschwarzerZevv: Yes, I find comments very important. Usually this helps a lot when returning to the code later. Not even mentioning for people new to the code. :-)
21:20:12sschwarzerThanks for the compliments.
21:20:12*Senketsu quit (Quit: WeeChat 2.5)
21:20:27rayman22201so @Zevv, this asyncEvent change feels like a seperate PR...
21:20:33sschwarzerrayman: I had to maintain enough code to value comments. :-)
21:20:44MH026making things easier for your future self? lmao what is this
21:20:47Zevvrayman22201: sure, its a job an sich
21:21:20rayman22201"a job an sich" ?
21:21:28clyybberits a job by itself
21:21:29Zevvit's a whole separate job
21:21:32Zevvright
21:22:06ZevvI'd say we do a proof of concept in only one of the implementations though
21:22:16clyybberbbl
21:22:17*clyybber quit (Quit: WeeChat 2.5)
21:22:19sschwarzerrayman: Regarding reaching the lazy stage. I hope that never happens, and I think it's unlikely. I'm programming since around 1984, and the last 19 years professionally. :)
21:22:22rayman22201lol. sorry. I'm an American who has 0 experience with German
21:22:40sschwarzerrayman: seems to be a Germanism ;)
21:23:10rayman22201oh? I have limited experience with those as well lol
21:23:48Zevvhm registerEvent's task is now only to setup the global pipe for events. it has nothing specific for the event itself left
21:24:03sschwarzerrayman: I've never seen "an sich" creep into an English conversation though. ;-) So if I wasn't German, I'd be as surprised as you.
21:24:21ZevvI must admit it was kind of on purpose :)
21:24:35rayman22201just make fun of the stupid American. I see :-P
21:25:04rayman22201I have read Nietzsche, but only translations :-)
21:25:16ZevvWell, I haven't so you're waaay ahead of me
21:25:27sschwarzerZevv ;-)
21:25:51rayman22201He is hard to read lol. I don't recommend it
21:26:03rayman22201maybe it's easier in the native text lol
21:27:19rayman22201registerEvent can be modified to hand out the unique IDs, and register those IDs with the underlying selector impl.
21:27:46*abm quit (Quit: Leaving)
21:27:58Zevvyeah, I ended up there as well, because the unique id can't be assigned in newEvent
21:28:03Zevvdue to lack of ref to selector
21:28:06*brakmic joined #nim
21:29:23rayman22201actually. It doesn't need to do the last part. It needs to register the unique IDs with the high level selector interface, and the underlying impl just needs to return the id from the read call.
21:29:39Zevvtrue
21:30:06Zevvso newSelectEvent* does only the allocation of the object now, which holds nothing but an id
21:30:12Zevvwhich is not yet known at that time.
21:31:36rayman22201correct.
21:31:51rayman22201Is that weird?
21:31:57Zevvvery
21:32:07Zevvit's called legacy or heritage, I think
21:32:18rayman22201Should newAsyncEvent and registerAsyncEvent be merged?
21:32:25rayman22201lol
21:32:29ZevvI would say yes
21:32:43ZevvI now move it all into register becasue new does not have the ref
21:33:30rayman22201that makes more sense anyway. I would prefer this api
21:34:26FromGitter<eptification> @rayman22201 ive always wondered about that. irl if you translate (say english to chinese) some of the context gets lost, in programming languages is the same also true ?
21:35:02*nsf quit (Quit: WeeChat 2.4)
21:35:40ZevvYou can lose or gain semenatics. Move from Nim to assembly - you can write the exact same program, but the source has less *meaning* to it
21:35:53Zevvassembly is not good at capturing the programmers' intentions
21:36:56FromGitter<eptification> hah i've also wondered how many languages were just too early (hardware not strong/cheap enough -> logic languages, apl)
21:37:21rayman22201@eptification. Yes. what @Zevv said. exactly. People often try to naively translate languages like Java to Go or Java to C# and end up with very bad inefficiencies or memory leaks because the most efficient patterns are different.
21:37:43FromGitter<eptification> this is what happens when you taper off coffee @MH026 rabbit holing becomes easier
21:38:06FromGitter<eptification> attentional free fall is more apt descriptor than rabbit hole
21:38:15rayman22201lol
21:39:39MH026loss of energy and loss of focus is a dangerous combo, you are 50 tabs deep into some irrelevant thing in no time
21:40:15rayman22201@Zevv what do you think of having the selector impl returning a "fake" readykey with the uniqueID instead of a read fd in the `Event.user` case. looking here: https://github.com/nim-lang/Nim/blob/devel/lib/pure/ioselects/ioselectors_poll.nim#L237
21:40:32sschwarzerWhat's "rabbit holing" in this context?
21:41:50rayman22201then the abstract selector (which just gets an array of readykey objects) doesn't need to do any extra work. It thinks it's a real fd that is ready to read.
21:42:06Zevvrayman22201: yeah, but how to fake it?
21:42:10Zevvputting the id in the fd is nasty
21:42:23rayman22201that's my question. is it nasty?
21:42:28rayman22201will it break other things?
21:42:32Zevvmake it a variant type instead
21:42:46rayman22201make readykey a varianttype?
21:42:56Zevvthat should not break the API
21:43:15Zevvin case of user events noone will ever care about the fd, as it is managed by the implementation
21:43:43rayman22201hrmmm. ok. That is more safe.
21:44:47Zevvhm here I am refactoring ioselectors_poll, but of course linux uses the _epoll by default
21:45:20rayman22201The implementation is similar. epoll is more efficient, but the same ideas apply
21:45:33Zevvyeah, but I was already implementing
21:45:43Zevvtrigger() also misses reference to the selector
21:46:11Zevvso register() needs to make a copy of the fds into the SelectEvent so that trigger knows where to send to
21:46:14Zevvbah
21:47:13rayman22201unless you make the single fd a global on the asyncDispatch object :-P
21:47:21Zevvbah
21:47:50Zevva bit less bay: register can put a ref to the selector in the event
21:47:54Zevvs/bay/bah/
21:48:37rayman22201https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L1098
21:49:03Zevvbah
21:49:07rayman22201lol
21:49:41FromGitter<eptification> @sschwarzer rabbit-holing is when you start out writing nim at 7 pm, decide to look up compilers on wikipedia and end up reading what dinosaur poop looks like at 5 am
21:50:03rayman22201I'm ok with the event carrying both an fd and a unique ID. (and knowing the fd will be the same for every event)
21:50:05Zevvpff I read up on dino poop when I was 8!
21:50:06sschwarzereptification: *lol*
21:50:22Zevvrayman22201: better to keep a ref to the selector itself inside the event
21:51:26sschwarzerTo some extent I enjoyed working on the Nim code, but I feel a break would be good. But I noticed several times that I'm quite intrigued by Nim, so that I read a lot about it all over the place. :)
21:51:55Cadeyhow easy is it to integrate nimscript into a program?
21:52:12*Senketsu joined #nim
21:52:24rayman22201I disagree. Since the globalDispatcher has the only reference to the selector currently, it breaks the separation of concerns
21:54:36ZevvBut isn't a SelectEvent tied to a Selector?
21:54:55rayman22201no, it's tied to a dispatcher
21:55:02rayman22201and a dispatcher is tied to a single selector
21:55:11Zevvno, the event fds of the pipe go in the selector
21:55:23Zevvnot in the dispatcher. I'm running test code here without a dispatcher
21:56:14rayman22201I just realized we are talking about two different thigns
21:56:15rayman22201things
21:56:32rayman22201I am talking about `asyncEvent` and you are talking about `selectorEvent`
21:56:52rayman22201`SelectEvent` I mean
21:58:13rayman22201oh wait, they are the same thing: https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L1096
21:58:34rayman22201ok. so it is important to note that selectEvent and AsyncEvent api's need to mirror each other then
21:59:57rayman22201I understand what you are saying now. The SelectEvent is tied to the Selector, because it's unique ID is only valid for that Selector.
22:00:04*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:01:04rayman22201are you implementing this already @Zevv?
22:01:11*solitudesf quit (Ping timeout: 258 seconds)
22:01:18Zevvkind of
22:01:22Zevvto see where it breaks
22:01:25Zevvfirst I will go sleep
22:01:37sschwarzerZevv: Good night!
22:01:44rayman22201lol. Ok. I need to eat lunch, and take a break myself
22:01:49rayman22201gn @Zevv
22:02:01sschwarzerZevv: me too :)
22:02:03ZevvI'll drop you a diff when I got something. Thanks so far have a good lunch!
22:02:12rayman22201I was going to start implementing, but if you are already doing it, I will wait
22:02:24rayman22201awesome. Thanks <3
22:02:50*sschwarzer quit (Quit: leaving)
22:04:26*Senketsu quit (Quit: WeeChat 2.5)
22:07:17*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:08:01*shomodj joined #nim
22:08:15*Senketsu joined #nim
22:23:06*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:23:30FromGitter<zacharycarter> well - the ktx experiment did not go so well
22:23:56FromGitter<zacharycarter> I wanted to be able to load and then save a ktx file - so I tried loading one and then writing code to save it back based on some C code in raylib
22:24:21FromGitter<zacharycarter> the images I saved back didn't load in any viewer - so I guess I'm going to go with skrylar's skdds code as I trust him more than I trust the author of raylib
22:35:21*Senketsu quit (Quit: WeeChat 2.5)
22:47:18*jjido joined #nim
22:48:36*Senketsu joined #nim
22:51:24*Senketsu quit (Client Quit)
22:54:49*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
23:15:20*brakmic quit ()
23:22:10*absolutejam3 quit (Ping timeout: 268 seconds)
23:22:20FromGitter<eptification> ]