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:50 | skrylar[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:23 | leorize[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:12 | rayman22201 | No... I keep saying that I will try it and I keep forgetting *embarrassed* |
03:21:07 | * | lritter joined #nim |
03:24:32 | rayman22201 | I got the Araq lecture to use a real editor with a mouse. So maybe I need to switch to vscode lol 😜 |
03:28:48 | leorize | use nim.nvim :) |
03:29:00 | leorize | far superior than whatever vscode plugin can give you |
03:29:14 | leorize | then if you need all those fancy vscode stuff just install more plugins :) |
03:39:21 | rayman22201 | I agree with you... Araq has a different opinion lol |
03:43:42 | * | arecaceae quit (Remote host closed the connection) |
03:43:54 | shashlick | @leorize - your plugin is neovim only right? not vim? |
03:44:01 | * | arecaceae joined #nim |
03:46:18 | leorize | shashlick: yea |
03:46:27 | FromGitter | <eptification> but does Araq use a vertical mouse ? |
03:47:05 | leorize | with some effort it could run on vim8, but I'm not going to volunteer that :p |
04:00:03 | rayman22201 | Idk about Araq but I use a vertical mouse. I like it a lot 😁 |
04:00:54 | shashlick | well, it's coming along - https://github.com/genotrance/shared/ |
04:01:03 | shashlick | docs for seq are in place |
04:01:16 | shashlick | needs more work and real world usage but feedback appreciated |
04:03:00 | shashlick | i 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:26 | shashlick | i'd have used neovim + nvim.nim but have been using feud 100% for the last few months |
04:03:39 | rayman22201 | feud is very cool. I have nothing against it |
04:06:05 | rayman22201 | I 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:15 | shashlick | feels 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:33 | shashlick | and nimterop too which has a lot of pending work |
04:06:53 | shashlick | i also need to migrate some nimgen projects into nimterop where possible |
04:07:24 | shashlick | @rayman22201 - that is my use case too - when i need to get stuff working on my linux machines |
04:07:47 | shashlick | i plan on making that piece easier - your editor should make it easier to edit remotely |
04:07:57 | shashlick | there's many existing options so adding support shouldn't be hard |
04:08:41 | shashlick | are you on win/lin or osx for primary driver? |
04:09:12 | rayman22201 | linux in a windows virtual box lol |
04:10:02 | shashlick | oh ya, your stream today |
04:10:09 | rayman22201 | I'm required to have Windows for certain work things, even though most of the development is linux based. |
04:10:58 | shashlick | is it viable to run your editor on windows and edit remotely on the linux system? |
04:11:38 | rayman22201 | For most things yes, I'm just too lazy to set it up lol |
04:11:52 | rayman22201 | I prefer a linux terminal anyway |
04:12:00 | shashlick | part of my goal is also to make the terminal part of the editor |
04:12:36 | shashlick | so while you are in a windows GUI app, you could run any remote command seamlessly |
04:12:43 | rayman22201 | having attempted to work on a terminal when I tried to help with allacrity, I have to say, good luck lol |
04:13:03 | shashlick | but i'm quite a ways from there - i still have a cmd window or putty session open all the time |
04:13:44 | shashlick | that's the part i'm still wondering about - is it worth it or not - perhaps have an embedded putty or something |
04:14:01 | rayman22201 | In theory, it sounds great, Emacs has this feature, but I never got it work very seamlessly. It always ended up acting weird |
04:14:27 | shashlick | ya i have my doubts on that for sure |
04:14:53 | shashlick | right now, feud can run commands and pull content into the GUI |
04:14:56 | rayman22201 | The neovim terminal works pretty well, but at that point, you are already in neovim lol |
04:15:08 | shashlick | but that's a far call from a full CLI |
04:15:16 | rayman22201 | yes |
04:15:36 | shashlick | anyway, lots of other things to do to make the editing experience complete |
04:15:39 | shashlick | the list is long 🙂 |
04:15:44 | rayman22201 | Why can't you use channels for feud again? |
04:16:16 | shashlick | i can but i'm averse to creating some dumb protocol to exchange data |
04:16:31 | rayman22201 | I just wonder about all the hoops for sharedSeq, and it's still got some efficiency issues.... Channels work for Go :-P |
04:16:59 | shashlick | well, that's the thing, if it works then efficiency can be brought over time |
04:17:11 | rayman22201 | same for channels |
04:17:52 | shashlick | so my use case has two threads - the monitor thread which checks for source code changes and rebuilds dlls |
04:18:00 | shashlick | it then notifies the main thread to reload |
04:18:05 | shashlick | so it is simple |
04:18:26 | shashlick | but 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:14 | shashlick | no doubt the seqs and strings are already a scheme, but using json or some other random scheme seems annoying |
04:19:30 | shashlick | perhaps there's a good way to use channels but i've not found anything yet |
04:19:38 | rayman22201 | what? Nim channels, like go channels can copy binary data? |
04:19:43 | rayman22201 | you don't need to serialize anything |
04:20:14 | shashlick | ya 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:40 | rayman22201 | Channels are typed? |
04:20:44 | rayman22201 | https://nim-lang.github.io/Nim/channels.html |
04:20:57 | rayman22201 | you just send a variant type |
04:21:03 | rayman22201 | or have two channels, one for each type |
04:22:11 | rayman22201 | that 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:37 | shashlick | so effectively, if i have a table of stuff, i'd have to send the entire table back and forth |
04:24:31 | rayman22201 | true, but you would have to do that anyway. |
04:25:20 | shashlick | in what case? |
04:25:46 | rayman22201 | Well, I take that back, but I'm sure that is a good design? |
04:26:33 | rayman22201 | I 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:23 | shashlick | so again you'd have some protocol or scheme to tell the thread to put and get |
04:27:54 | rayman22201 | protocol = a function that returns a channel or a FlowVar lol |
04:29:27 | rayman22201 | there 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:55 | rayman22201 | but the parallelism has to be very high for the overhead to be worth it. |
04:31:02 | shashlick | okay i guess i should read up more about channels but i really like the idea of shared memory |
04:31:22 | shashlick | anyway, this is v0.1 so hope it can get better over time |
04:31:57 | rayman22201 | most traditional programmers do lol. But shared memory is so much harder to deal with lol |
04:32:25 | shashlick | i agree, at least i'll learn something even if it is a fool's errand |
04:33:02 | rayman22201 | That's true |
04:34:52 | rayman22201 | :-D |
04:35:46 | * | dddddd quit (Remote host closed the connection) |
04:36:08 | shashlick | the current implementation is lazy - i'm converting to a regular seq, doing the op and then copying back to the SharedSeq |
04:36:41 | shashlick | but that can be improved by only reallocating the specific change when needed |
04:37:01 | shashlick | also there's only 1 global lock, in theory every SharedSeq instance could have its own lock |
04:37:22 | shashlick | so there are ways to make it a bit faster |
04:37:54 | shashlick | i plan on doing some perf tests to see what's the cost compared to a standard seq |
04:38:07 | rayman22201 | yeah. 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:15 | rayman22201 | *but will get you* |
04:39:30 | shashlick | well, 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:42 | shashlick | so ya, with some real comparisons, we can see how far this can go |
04:39:54 | shashlick | it is pure nim so very fast to iterate and improve things |
04:40:21 | rayman22201 | also true. And your plugin system is very nice |
04:42:17 | shashlick | thanks |
04:42:38 | shashlick | feedback very appreciated since it works for me but definitely interested in making it better |
04:42:41 | rayman22201 | (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:47 | shashlick | it should be easy to strip it out of feud and make it a lib |
04:43:25 | skrylar[m] | do wasn't experimental before though |
04:43:40 | shashlick | well, 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:51 | shashlick | cause my plugin system did not so never know where it can do more |
04:43:52 | skrylar[m] | i used to use it for some stuff; it was nice for event handlers :\ |
04:44:36 | skrylar[m] | `foo.on_click do: <some stuff>` reads nicer than `foo.on_click = proc() = <...>` imho |
04:46:05 | rayman22201 | @skrylar wat?? HCR = Hot Code Reload |
04:47:05 | rayman22201 | sorry. maybe I don't understand the example. |
04:48:35 | skrylar[m] | no they were talking about `do` notation just a little while ago |
04:48:53 | skrylar[m] | unfortunately matrix/irc sucks at replying to things |
04:49:08 | rayman22201 | oh, I see lol |
04:50:22 | shashlick | initial simple benchmark - SharedSeq[string] is 2500 times slower than seq[string] for add and pop |
04:51:10 | FromGitter | <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:35 | rayman22201 | yikes! Well those benchmarks can only get better from here lol! |
04:53:02 | skrylar[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:07 | shashlick | yep but that's not bad considering how much i copy right now - i was thinking it would be 10000x or 100000x |
04:53:32 | shashlick | anyway, will sleep now, have a flight in 6 hours |
04:53:55 | rayman22201 | gn @shashlick and safe flight! |
04:54:22 | rayman22201 | @eptification: I know the feeling about the tuning rabbit hole! |
04:54:23 | shashlick | @rayman22201 - appreciate all and any other insights |
04:54:40 | rayman22201 | do less copies :-P |
04:56:26 | shashlick | Deal |
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:14 | FromGitter | <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:40 | lqdev[m] | fmRead is rb afaik |
07:48:46 | FromGitter | <zacharycarter> okay cool - thanks |
07:55:14 | FromGitter | <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:46 | FromDiscord_ | <Skaruts> what's the best way to import a whole folder of nim scripts? |
08:31:26 | lqdev[m] | what do you mean by 'Nim scripts'? |
08:31:32 | FromDiscord_ | <Skaruts> nim files |
08:31:37 | lqdev[m] | ah |
08:31:54 | FromDiscord_ | <Skaruts> for example a ui folder with all sorts of ui elements in many files |
08:32:19 | lqdev[m] | then you have no other option but to import each file using `import ui/[button, textbox, ...]` |
08:32:28 | FromDiscord_ | <Skaruts> bad example, since I wouldn't want to import all of those, but... |
08:32:42 | FromDiscord_ | <Skaruts> hmm |
08:33:00 | lqdev[m] | you can also create a `ui/prelude` file which you then include in your other source files (`include ui/prelude`) |
08:33:10 | lqdev[m] | this file should contain all the imports |
08:33:18 | FromDiscord_ | <Skaruts> and export them all |
08:33:47 | lqdev[m] | you mustn't export when you're creating an include file |
08:34:08 | lqdev[m] | `include` literally includes another source file in your current source file |
08:34:09 | FromDiscord_ | <Skaruts> oh, include |
08:34:22 | FromDiscord_ | <Skaruts> didn't know about it |
08:34:43 | FromDiscord_ | <Skaruts> oh that probably what I want |
08:34:50 | narimiran | probably it isn't ;) |
08:35:16 | * | Elronnd joined #nim |
08:35:17 | * | Elronnd left #nim (#nim) |
08:35:23 | lqdev[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:10 | FromGitter | <zacharycarter> ooph - this is ugly... |
08:37:44 | FromGitter | <zacharycarter> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d29985854d3383937fb2e11] |
08:38:48 | FromGitter | <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:39 | FromGitter | <zacharycarter> maybe the first cast is unnecessary - I don't know |
08:43:11 | salewski | Admins, someone has just pushed an unauthorized copy of an older forum post of me again to the forum: |
08:43:14 | salewski | https://forum.nim-lang.org/t/5009 |
08:43:26 | salewski | https://forum.nim-lang.org/t/4742#29575 |
08:43:46 | salewski | I assume really bad intent, so I suggest deleting it. |
08:44:10 | FromGitter | <zacharycarter> I guess you're popular since apparently this has happened more than once :P |
08:44:36 | * | ng0 joined #nim |
08:45:17 | narimiran | salewski: hmm, could it be a new way for spammers to post? |
08:45:41 | FromGitter | <alehander42> btw why isnt ix working for bigger content |
08:45:55 | narimiran | salewski: i marked it as a spam |
08:46:20 | salewski | Yes, they may later insert the spam content. |
08:46:41 | salewski | It is strange. Bye. |
08:46:51 | * | salewski quit (Quit: WeeChat 2.4) |
08:50:36 | FromGitter | <zacharycarter> and then I find - https://github.com/Skrylar/skdds/blob/master/skdds.nim |
08:50:47 | FromGitter | <zacharycarter> guess I should have searched first |
08:51:39 | skrylar[m] | :F |
08:51:53 | FromGitter | <alehander42> oh ix.io is good |
08:52:22 | FromGitter | <zacharycarter> skrylar[m] - thanks :D |
08:52:31 | FromGitter | <zacharycarter> want a PR for updating it to the latest Nim? |
08:52:33 | skrylar[m] | wonder if that still works |
08:52:43 | FromGitter | <zacharycarter> it doesn't - but I'm going to fix it so it does :) |
08:54:01 | skrylar[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:21 | FromGitter | <zacharycarter> well - this was last updated 2 years ago? |
08:54:31 | FromGitter | <zacharycarter> and it looks like there are about five or six errors |
08:56:03 | * | clyybber joined #nim |
08:56:28 | skrylar[m] | "invalid enum order" what a useless error |
08:56:58 | FromGitter | <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:22 | FromGitter | <zacharycarter> but that has been around for a while now I think |
08:57:47 | skrylar[m] | yes they have been inspired by andrei's take on D programming |
08:58:31 | * | jjido joined #nim |
08:58:55 | FromGitter | <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:58 | FromGitter | <zacharycarter> but I'm guessing that's not easy |
08:59:06 | skrylar[m] | it would be nice if the compiler just obeyed |
08:59:33 | skrylar[m] | it's really not a logic or syntax error, it's a pedandic one |
08:59:39 | FromGitter | <zacharycarter> true |
09:03:35 | skrylar[m] | well i pushed one that compiles now |
09:05:00 | FromGitter | <zacharycarter> thanks! |
09:05:04 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
09:05:09 | skrylar[m] | the tests fail tho |
09:07:28 | skrylar[m] | oh. |
09:07:42 | skrylar[m] | make_fourcc doesn't work in 0.20 for some reason |
09:09:46 | FromGitter | <zacharycarter> I think maybe there was a change to `shl` and `shr` |
09:10:46 | skrylar[m] | ok. its fixed. enjoy |
09:10:52 | FromGitter | <zacharycarter> thank you! |
09:12:15 | skrylar[m] | i think they were in the right sort order but the encoder was shifting on 8bits now instead of 32 |
09:12:34 | skrylar[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:54 | skrylar[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:23 | skrylar[m] | the stcc patents finally died, although on newer hardware theres etc1 and etc2 which are fully opne |
09:15:29 | FromGitter | <zacharycarter> I'm not sure either |
09:16:10 | * | shomodj joined #nim |
09:16:24 | skrylar[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:15 | skrylar[m] | https://stackoverflow.com/questions/9341608/container-format-for-etc1-textures |
09:18:24 | * | shomodj quit (Client Quit) |
09:19:27 | skrylar[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:08 | clyybber | zacharycarter: Do you want to use DXT compression with bgfx? |
09:23:58 | FromGitter | <zacharycarter> I don't think bgfx supports DXT compression |
09:24:14 | FromGitter | <zacharycarter> it does support ETC1, 2, 2A, 2A1 |
09:24:21 | skrylar[m] | it does if your gpu does lol |
09:24:34 | skrylar[m] | bgfx barely does much more than shuttle it off to directx or opengl |
09:24:43 | FromGitter | <zacharycarter> maybe just the tool doesn't |
09:24:52 | FromGitter | <zacharycarter> his texture compression tool |
09:25:18 | skrylar[m] | tbh i haven't profiled to see how dxt compares with etc |
09:26:02 | clyybber | BC7 is superior to DXT1,3,5 in all aspects, so if possible I would go with BC7 |
09:27:20 | FromGitter | <zacharycarter> thanks for the protip |
09:28:43 | clyybber | Uncompressed: https://i.imgur.com/EQUS2hB.png DXT1: https://i.imgur.com/VJItUkY.png BC7: https://i.imgur.com/XgKriCV.png |
09:28:56 | clyybber | thats a comparison I found on the skyrim modding subreddit |
09:31:38 | skrylar[m] | there also aren't many comparisons between dxt/bc and etc/eac |
09:33:08 | FromGitter | <zacharycarter> hmm |
09:34:16 | FromGitter | <zacharycarter> I see examples of folks using bc* on github with the texture compression tool so I'll just go with that |
09:34:29 | FromGitter | <zacharycarter> as you suggested |
09:34:53 | skrylar[m] | it really just depends on how many potatos need to run your code heh |
09:34:58 | FromGitter | <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:20 | FromGitter | <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:56 | clyybber | sounds like fun |
09:46:57 | clyybber | bbl |
09:46:58 | * | clyybber quit (Quit: WeeChat 2.5) |
09:56:49 | * | actuallybatman quit (Ping timeout: 248 seconds) |
09:56:53 | FromGitter | <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:03 | FromDiscord_ | <Skaruts> can I ask the compiler to instead of compiling, to give me a list of a bunch of errors at once? |
10:20:54 | leorize | nim check |
10:21:23 | FromDiscord_ | <Skaruts> nice, thanks |
10:22:07 | FromDiscord_ | <Skaruts> btw, is there a way to ignore specific warnings? (not all warnings) |
10:23:42 | leorize | --warning[WarningTag]:off |
10:24:03 | leorize | or in your config.nims: warning("WarningTag", false) |
10:24:37 | FromDiscord_ | <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:56 | clyybber | Araq: How can I generate a simple nil assignment in liftdestructors ownedRefOp ? |
12:09:20 | clyybber | So that we set the ref to nil in a move |
12:09:56 | clyybber | is there some builtin I could use for that? Or a PNode which is a nil literal? |
12:10:11 | * | absolutejam3 joined #nim |
12:11:45 | FromDiscord_ | <Sporgity> I ran a nim file and it didn't show the out put, but it shows the debug instead. |
12:11:52 | FromDiscord_ | <Sporgity> I ran a nim file and it didn't show the output, but it shows the debug instead. |
12:12:07 | FromDiscord_ | <Sporgity> the debug says it was successful |
12:12:48 | clyybber | Paste the output to hastebin or some other pastebin and post it here |
12:13:42 | FromDiscord_ | <Sporgity> the code or the debug? |
12:23:13 | clyybber | the "debug" |
12:23:26 | clyybber | or both, if you can |
12:23:45 | FromDiscord_ | <Sporgity> Okay |
12:23:55 | * | Snircle joined #nim |
12:23:58 | FromDiscord_ | <Sporgity> give me sec |
12:27:49 | FromDiscord_ | <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:11 | clyybber | ah, yeah hastebin is down since a few days, I forgot |
12:39:36 | clyybber | Sporgity: When you run 'nim c' the compiler creates a new file, an executable. Run that. |
12:39:47 | clyybber | Nim is not an interpreted language like python |
12:40:18 | clyybber | But you can do `nim c -r` to compile and run it. |
12:40:25 | clyybber | Which 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:54 | FromGitter | <zacharycarter> I think I'm going to write a `.ktx` loader when I get home - seems pretty damn simple to do so |
13:16:07 | FromGitter | <zacharycarter> then I can take my dds files and compress them with BC7 to ktx |
13:16:13 | FromGitter | <zacharycarter> as well as every other image type |
13:19:48 | * | solitudesf- joined #nim |
13:20:26 | clyybber | dds 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:24 | FromGitter | <zacharycarter> yeah |
13:52:06 | * | nuggetsauce joined #nim |
14:04:45 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
14:07:33 | Araq | clyybber: newNode(nkNilLit) |
14:07:43 | Araq | there is no shortcut really |
14:08:33 | * | absolutejam3 quit (Ping timeout: 248 seconds) |
14:25:26 | disruptek | i'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:54 | dom96 | disruptek, oh? What are you working on? |
14:30:16 | * | sniffdtek joined #nim |
14:31:57 | disruptek | the poc is a search tool for ebay, but the real product will unify ebay/amazon/walmart product databases. |
14:32:58 | disruptek | the 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:12 | disruptek | https://auctionhero.io/ |
14:34:49 | dom96 | interesting |
14:36:00 | disruptek | yeah, 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:56 | dom96 | you should do some coding instead of staring at IRC ;) |
14:37:15 | disruptek | yeah, i'm thinking about how i want to attack this stuff. ;-) |
14:37:58 | dom96 | I'm working on a little IO game which I hope I can monetize. Scaling it is an interesting challenge |
14:38:15 | disruptek | what's an IO game? |
14:39:08 | dom96 | A browser game that's typically played in a world with 100+ players. For example agar.io and slither.io |
14:40:57 | disruptek | what are the details? |
14:41:56 | dom96 | Not willing to share too many yet, it's more remniscient of agar.io than slither.io though :) |
14:42:20 | disruptek | you're really gonna make me look that stuff up, huh? |
14:43:04 | dom96 | Yes, 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:02 | disruptek | where is the money? |
14:46:08 | * | sschwarzer joined #nim |
14:46:49 | sschwarzer | Hi, has anyone else problems with https://forum.nim-lang.org ? I get a gateway timeout. |
14:47:05 | sschwarzer | error 504 |
14:48:45 | dom96 | works for me |
14:49:31 | sschwarzer | dom96: Trying ... yes, for me it also works (again) |
14:50:54 | disruptek | so you don't know how to monetize it and you can't share the scaling challenge? |
14:51:37 | dom96 | disruptek, erm, that's a bit accusatory |
14:52:10 | disruptek | well, i'm not sure why you brought it up if you don't want to talk about it. :-P |
14:52:53 | dom96 | If you try out agar.io I'm sure you'll figure it out :) |
14:53:00 | dom96 | Gotta go, see you later |
14:54:50 | disruptek | i 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:33 | clyybber | Araq: Thanks, I now found that too. Is it better to do newNodeIT(nkNilLit, c.info, x.typ) ? |
15:03:34 | FromDiscord_ | <++x;> Oi |
15:03:57 | FromDiscord_ | <++x;> Long time no see |
15:04:56 | * | sschwarzer quit (Quit: leaving) |
15:07:51 | disruptek | aww sup dawg |
15:22:20 | clyybber | disruptek: sounds a tad bit dystopian |
15:22:58 | clyybber | you play along as a small startup, and then google snake comes along to eat you.. lol |
15:23:23 | clyybber | the dystopian part is that theres ads everywhere |
15:23:35 | disruptek | hey, it's hard to monetize something that is available for free elsewhere. trust me on this. ;-) |
15:24:14 | disruptek | project c.a.r.s. sold billboard ads in their gameworld. i almost bought one for my Porsche shop. |
15:24:47 | disruptek | it 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:14 | clyybber | Araq: 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:58 | clyybber | Araq: A owned parameter is treated like a sink param right? |
16:50:15 | clyybber | Or should be |
16:57:41 | * | nuggetsauce quit (Read error: Connection reset by peer) |
17:03:37 | lqdev[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:19 | disruptek | comment all the things! |
17:05:51 | Zevv | <!-- /* what */ // no problem -> |
17:09:12 | * | sniffdtek quit (Read error: Connection reset by peer) |
17:09:43 | * | sniffdtek joined #nim |
17:18:47 | Zevv | what's nimBetterRun? |
17:35:42 | * | PMunch joined #nim |
17:58:41 | Zevv | Araq hacking a new feature and muttering "This better run.." while waiting for the compile? |
18:08:09 | clyybber | Zevv: Its so that you dont recompile when nothing changed and you do nim c =r |
18:08:15 | clyybber | s/=r/-r |
18:23:47 | clyybber | Araq: So owned is also pass by address |
18:31:32 | * | solitudesf- quit (Quit: Leaving) |
18:32:01 | * | solitudesf joined #nim |
18:41:37 | Araq | clyybber: 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:10 | rayman22201 | so 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:49 | Zevv | is that my fault? 0229dfd1997ef9a2229c144a875fe51db206fdcd |
19:54:06 | Zevv | nope, I guess a s.checkFd() call is missing in registerEvent |
19:54:21 | rayman22201 | checkFD is not doing what it is supposed to |
19:54:23 | rayman22201 | https://github.com/nim-lang/Nim/blob/devel/lib/pure/ioselects/ioselectors_epoll.nim#L81 |
19:54:45 | rayman22201 | or do I need to add checkFd() to the registerEvent proc? |
19:55:08 | Zevv | I guess it is missing there. |
19:55:36 | rayman22201 | neat. This is why tests are good :-P |
19:55:46 | rayman22201 | I will add that to the PR |
19:56:44 | Zevv | The original PR limiting the set to 1024 was mine because "hello world" ate 400MB of memory to allocate all possible fd's |
19:58:00 | rayman22201 | That makes sense lol. Just need to make sure the code to expand the set is in all the right places |
19:58:59 | Zevv | I didn't add the checkFd calls, those were already there. But it seems this one was missing |
19:59:35 | rayman22201 | I'm not blaming you! I think your lower limit exposed an existing bug. Which is a good thing! |
19:59:41 | rayman22201 | :-D |
19:59:55 | rayman22201 | too many "!!!!" I have had too much caffeine I guess lol |
20:00:49 | MH026 | been weaning myself off caffeine the past few days, a sloth has more energy than I do |
20:01:51 | rayman22201 | You are a better person than I am. I love coffee so much that I grow coffee plants in my garden :-P |
20:02:07 | Zevv | rayman22201: but the change in fd set size is over half a year old - not sure why this was only triggered now |
20:02:18 | MH026 | rayman22201: that sounds awesome actually |
20:02:35 | Zevv | I'm dutch: we're legally allowed to smoke coffee |
20:02:45 | rayman22201 | lol |
20:02:51 | MH026 | most "coffeeshops" are closing here though |
20:03:02 | Zevv | where is 'here'? |
20:03:06 | MH026 | Arnhem |
20:03:45 | Zevv | well, how many do you need - a handful serves a city |
20:03:59 | MH026 | We had 3 in 1 street haha |
20:04:30 | Zevv | that might be a bit of overkill yes |
20:04:42 | rayman22201 | @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:47 | FromGitter | <alehander42> disruptek |
20:04:51 | FromGitter | <alehander42> awesome what web stack? |
20:04:58 | Zevv | rayman22201: ok, good you found it now then, thanks |
20:05:00 | FromGitter | <alehander42> is this why your write your own stuff |
20:05:07 | FromGitter | <alehander42> i am writing my own nim web framework |
20:05:19 | FromGitter | <alehander42> but very slowly and currently its mostly pipelining existing libs |
20:06:00 | rayman22201 | There 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:40 | Zevv | ah, that explains. And why is that? |
20:06:48 | FromGitter | <alehander42> it will be just a side project |
20:07:06 | rayman22201 | That is how FlowVar integrates into asyncdispatch. |
20:07:15 | Zevv | ah its finally happening! |
20:07:29 | rayman22201 | yeah! We streamed it live and everything lol |
20:07:32 | disruptek | what web stack? |
20:07:36 | rayman22201 | it was the goofiest stream ever lol |
20:07:43 | * | Senketsu quit (Quit: WeeChat 2.5) |
20:07:51 | rayman22201 | https://github.com/nim-lang/Nim/pull/11724 |
20:08:23 | rayman22201 | long time coming. I'm very excited :-) |
20:08:27 | Zevv | so, what's the fd? A pipe on unix, and on win? |
20:08:33 | rayman22201 | We can finally start to eat Golangs lunch :-P |
20:09:11 | * | Senketsu joined #nim |
20:10:25 | rayman22201 | The windows IOCP thing I think? Araq knows more than I do. I'm not super familiar with the win apis |
20:10:57 | Zevv | sweet stuff. I'll see if I can reuse some of that to finally make the async DNS work and portable |
20:11:34 | rayman22201 | this thing: https://docs.microsoft.com/en-us/windows/win32/api/winsock2/nf-winsock2-select |
20:11:47 | rayman22201 | that 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:29 | disruptek | alehander42: 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:56 | disruptek | but 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:26 | FromGitter | <eptification> @MH026 are you cold turkey or weaning? Im down to 600mg from 800mg |
20:17:32 | Zevv | oi, this AsyncEvent has always been there! Why did I not ever see that |
20:18:17 | disruptek | have any of you seen ryukoposting any time recently? |
20:19:05 | Zevv | no, *long* time not |
20:19:41 | MH026 | eptification: 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:04 | Zevv | disruptek: https://gitlab.com/ryukoposting :( |
20:20:41 | disruptek | this is why i like to write my own stuff. :-( |
20:21:43 | rayman22201 | @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:07 | Zevv | rayman22201: well, duh :) |
20:22:21 | rayman22201 | lol |
20:22:29 | Zevv | this final commit is so trivial, makes you wonder why this was never there |
20:22:32 | FromGitter | <eptification> no coffee. i would cold turkey but i dont have a free weekend to just sleep off the slothitis |
20:22:53 | rayman22201 | yeah.... It really makes adding to asyncdispatch much easier! |
20:24:38 | Zevv | disruptek: ryukoposting dropped out from one day to the next, and now his latest project on github is ECG firmware :/ |
20:25:28 | disruptek | well; i'm in a bind over his aws bindings. :-( |
20:25:37 | disruptek | ty for the analysis, though. |
20:25:46 | rayman22201 | cool. I added `checkFd`, and now I run out of FD's on my machine when running the test locally lol |
20:26:03 | Zevv | "1024 fds should be enough for everyone" |
20:26:32 | rayman22201 | lmao. Unless you are trying to spawn 5000 thread tasks, and each one attempts to get a unique fd :-P |
20:27:42 | rayman22201 | thoughts on how to fix this @araq, @dom96, @Zevv, anybody else? |
20:27:57 | Zevv | I'm first trying to see what the underlying mechanism is |
20:28:05 | rayman22201 | I can increase the max fd ulimit on my system, but that is a hack |
20:28:20 | rayman22201 | and won't help the CI |
20:28:42 | Zevv | eating an fd for each thread is not nice indeed |
20:28:48 | Araq | stop poking me |
20:28:53 | Araq | I'm away |
20:29:03 | rayman22201 | ok. sorry |
20:29:15 | * | rayman22201 is only kind of sorry |
20:30:30 | rayman22201 | maybe there should be some machinery for recycling fds in AsyncDispatch? |
20:30:49 | rayman22201 | that would make it more efficient in general, but it might be complicated... |
20:32:20 | Zevv | well, 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:26 | Zevv | which is basically a pipe or a socket |
20:32:28 | * | sagax joined #nim |
20:32:34 | rayman22201 | yup |
20:33:11 | Zevv | and 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:45 | rayman22201 | we could multiplex the platform pipe/socket onto multiple "nim pipes/sockets" |
20:34:38 | rayman22201 | exactly. idk what the best level of multiplexing is... also another layer of abstraction, :-/ |
20:34:53 | Zevv | I guess the first occurance of newSelectEvent() should create a single socket/pipe/whatever |
20:35:07 | Zevv | and then create an unique resource for each consecutive call |
20:35:44 | Zevv | unique id, that is |
20:35:45 | rayman22201 | I don't think 1 os socket : infinite nim sockets is a good ratio. |
20:35:53 | rayman22201 | socket == fd |
20:36:11 | rayman22201 | maybe 1 so socket : 10 nim fds? |
20:36:18 | rayman22201 | maybe a tunable parameter? |
20:36:45 | Zevv | not sure. triggering is pretty cheap, as it is only writing a few bytes into the pipe |
20:37:09 | Zevv | the receiving end is single threaded anyway |
20:37:13 | rayman22201 | the socket will bottleneck eventually. |
20:37:31 | rayman22201 | but if we only do this for asyncEvent, we can probably get far, you are right. |
20:37:51 | rayman22201 | I guess other events that have "real" socket handles, like network or file IO don't matter here. |
20:38:17 | Zevv | 5 mins, brb |
20:38:28 | rayman22201 | np |
20:40:27 | * | jeyr joined #nim |
20:41:01 | Zevv | so, 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:38 | Zevv | meaning having only one SelectEvent (socket/pipe) should be no problem |
20:42:07 | Zevv | worst 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:41 | rayman22201 | I 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:50 | Zevv | nope, pipes are 4K on unix |
20:43:14 | Zevv | oh no sorry |
20:43:23 | rayman22201 | that's old old kernels I think |
20:44:01 | Zevv | no, I was confusing atomic writes because of page size. |
20:44:06 | Zevv | 64K is right |
20:44:21 | rayman22201 | yeah, it's 4 pages these days :-) |
20:44:34 | rayman22201 | and windows apparently copied linux here |
20:44:37 | Zevv | it's configurable even |
20:44:42 | rayman22201 | from my quick googling anyway |
20:45:20 | Zevv | the send/trigger end is trivial |
20:45:24 | rayman22201 | there 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:31 | Zevv | but the receiving end is harder |
20:45:36 | rayman22201 | yeah, the demux |
20:47:10 | rayman22201 | really 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:31 | Zevv | it's already partly there. The selectInto() normally only does the polling |
20:47:37 | rayman22201 | on a high level. not too hard. *famous last words* |
20:47:44 | Zevv | but it sees the fd is an event, and does the read in the select already |
20:47:50 | Zevv | ignoring the data |
20:47:53 | Zevv | its int64 btw |
20:48:05 | rayman22201 | can we make it uint32? |
20:48:19 | rayman22201 | just to squeeze more efficiency :-P |
20:48:22 | Zevv | Why is it not even a single byte, if nobody cares about the data? |
20:48:28 | rayman22201 | good question |
20:48:29 | rayman22201 | lol |
20:49:07 | rayman22201 | I think uint16 is too small, but uint32 is plenty of unique id numbers. |
20:49:13 | rayman22201 | and still very efficient |
20:49:24 | rayman22201 | we just modify the read to not ignore the data. |
20:49:26 | Zevv | *famous last words* |
20:50:44 | Zevv | I'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:16 | rayman22201 | there probably is none. It will need to be written. |
20:51:49 | rayman22201 | I 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:49 | Zevv | no, 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:57 | rayman22201 | oh. 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:18 | Zevv | no, check line 243 in ioselectors_poll() |
20:53:33 | Zevv | that's the read handling the data put in there by trigger() |
20:54:16 | Zevv | what does "if Event.User in pkey.events:" mean |
20:55:10 | rayman22201 | no idea |
21:00:45 | Zevv | ok, 'User' is a flag set on fds which are used for events |
21:00:52 | Zevv | so that all makes sense |
21:01:30 | * | Senketsu joined #nim |
21:03:20 | rayman22201 | ah. yeah. ok. So there you go. most of the machinery is already there |
21:03:47 | * | laaron- joined #nim |
21:04:11 | rayman22201 | The demux code can go right there (and in similar places in all the other platform specific poll files) |
21:04:26 | Zevv | so 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:22 | Zevv | pipe-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:53 | rayman22201 | I 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:18 | Zevv | problem: newSelectEvent has no relation to the Selector |
21:07:39 | rayman22201 | I don't think we need to move all the rfd/wrd code out of SelectEventImpl |
21:08:05 | Zevv | well, it is possible to just have the same fd in all these things, but that would be silly |
21:08:40 | Zevv | registerEvent 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:40 | rayman22201 | hrmmm. ok |
21:09:59 | rayman22201 | where is the Event enum defined |
21:10:20 | Zevv | the typical place to keep this pair of fds is inside the selector object itself, but thats not passed to newSelectEvent |
21:11:33 | rayman22201 | maybe we set it in registerEvent? |
21:12:06 | Zevv | or add the selector as an argument to newSelectEvent - in the stdlib noone else seems to use this at least |
21:12:15 | sschwarzer | I 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:33 | Zevv | oh right registerEvent has it |
21:12:37 | rayman22201 | In 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:18 | Zevv | where is this current and probably only active event loop to be found then? |
21:13:53 | rayman22201 | it's literally a global variable. That's how "runForever" and "waitUnti" knows which event loop to wait for |
21:14:10 | Zevv | yeah of course, I just realized |
21:14:18 | Zevv | but that's in the async layer, not in the selectors layer |
21:14:32 | Zevv | that just happens to have one selector instance |
21:15:20 | Zevv | I haven't seen it happen often in real life, but it could be practical to have multipel selectors |
21:15:36 | Zevv | high performance serverse might mix async and threads, handling a pool of fds per thread |
21:15:42 | rayman22201 | true. It comes down to, is "AsyncEvent" a high level or level api? |
21:15:51 | * | jjido joined #nim |
21:15:54 | rayman22201 | I completely agree. I could see instances of multiple event loops |
21:16:06 | rayman22201 | Especially now that async and flowvar are compatible |
21:16:08 | Zevv | but anyway, registerEvent has the info. |
21:16:10 | rayman22201 | specially |
21:16:36 | rayman22201 | yeah. registerEvent is probably good enough for now |
21:16:41 | Zevv | so registerEvent will do the pipe() on the first run |
21:16:58 | rayman22201 | yeah. |
21:17:57 | sschwarzer | My first Nim program (apart from "Nim Basics" exercises) ... https://bitbucket.org/sschwarzer/vppdiff/src/default/vppdiff.nim :) |
21:18:05 | sschwarzer | There's still lots to do |
21:18:55 | Zevv | wow you'r hight on comments :) |
21:19:19 | rayman22201 | lol. I was about to say the same thing. Good job with all the comments lol |
21:19:40 | rayman22201 | you haven't reached the "lazy" stage of your programming career yet :-P |
21:20:00 | sschwarzer | Zevv: 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:12 | sschwarzer | Thanks for the compliments. |
21:20:12 | * | Senketsu quit (Quit: WeeChat 2.5) |
21:20:27 | rayman22201 | so @Zevv, this asyncEvent change feels like a seperate PR... |
21:20:33 | sschwarzer | rayman: I had to maintain enough code to value comments. :-) |
21:20:44 | MH026 | making things easier for your future self? lmao what is this |
21:20:47 | Zevv | rayman22201: sure, its a job an sich |
21:21:20 | rayman22201 | "a job an sich" ? |
21:21:28 | clyybber | its a job by itself |
21:21:29 | Zevv | it's a whole separate job |
21:21:32 | Zevv | right |
21:22:06 | Zevv | I'd say we do a proof of concept in only one of the implementations though |
21:22:16 | clyybber | bbl |
21:22:17 | * | clyybber quit (Quit: WeeChat 2.5) |
21:22:19 | sschwarzer | rayman: 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:22 | rayman22201 | lol. sorry. I'm an American who has 0 experience with German |
21:22:40 | sschwarzer | rayman: seems to be a Germanism ;) |
21:23:10 | rayman22201 | oh? I have limited experience with those as well lol |
21:23:48 | Zevv | hm registerEvent's task is now only to setup the global pipe for events. it has nothing specific for the event itself left |
21:24:03 | sschwarzer | rayman: 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:21 | Zevv | I must admit it was kind of on purpose :) |
21:24:35 | rayman22201 | just make fun of the stupid American. I see :-P |
21:25:04 | rayman22201 | I have read Nietzsche, but only translations :-) |
21:25:16 | Zevv | Well, I haven't so you're waaay ahead of me |
21:25:27 | sschwarzer | Zevv ;-) |
21:25:51 | rayman22201 | He is hard to read lol. I don't recommend it |
21:26:03 | rayman22201 | maybe it's easier in the native text lol |
21:27:19 | rayman22201 | registerEvent 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:58 | Zevv | yeah, I ended up there as well, because the unique id can't be assigned in newEvent |
21:28:03 | Zevv | due to lack of ref to selector |
21:28:06 | * | brakmic joined #nim |
21:29:23 | rayman22201 | actually. 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:39 | Zevv | true |
21:30:06 | Zevv | so newSelectEvent* does only the allocation of the object now, which holds nothing but an id |
21:30:12 | Zevv | which is not yet known at that time. |
21:31:36 | rayman22201 | correct. |
21:31:51 | rayman22201 | Is that weird? |
21:31:57 | Zevv | very |
21:32:07 | Zevv | it's called legacy or heritage, I think |
21:32:18 | rayman22201 | Should newAsyncEvent and registerAsyncEvent be merged? |
21:32:25 | rayman22201 | lol |
21:32:29 | Zevv | I would say yes |
21:32:43 | Zevv | I now move it all into register becasue new does not have the ref |
21:33:30 | rayman22201 | that makes more sense anyway. I would prefer this api |
21:34:26 | FromGitter | <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:40 | Zevv | You 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:53 | Zevv | assembly is not good at capturing the programmers' intentions |
21:36:56 | FromGitter | <eptification> hah i've also wondered how many languages were just too early (hardware not strong/cheap enough -> logic languages, apl) |
21:37:21 | rayman22201 | @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:43 | FromGitter | <eptification> this is what happens when you taper off coffee @MH026 rabbit holing becomes easier |
21:38:06 | FromGitter | <eptification> attentional free fall is more apt descriptor than rabbit hole |
21:38:15 | rayman22201 | lol |
21:39:39 | MH026 | loss of energy and loss of focus is a dangerous combo, you are 50 tabs deep into some irrelevant thing in no time |
21:40:15 | rayman22201 | @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:32 | sschwarzer | What's "rabbit holing" in this context? |
21:41:50 | rayman22201 | then 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:06 | Zevv | rayman22201: yeah, but how to fake it? |
21:42:10 | Zevv | putting the id in the fd is nasty |
21:42:23 | rayman22201 | that's my question. is it nasty? |
21:42:28 | rayman22201 | will it break other things? |
21:42:32 | Zevv | make it a variant type instead |
21:42:46 | rayman22201 | make readykey a varianttype? |
21:42:56 | Zevv | that should not break the API |
21:43:15 | Zevv | in case of user events noone will ever care about the fd, as it is managed by the implementation |
21:43:43 | rayman22201 | hrmmm. ok. That is more safe. |
21:44:47 | Zevv | hm here I am refactoring ioselectors_poll, but of course linux uses the _epoll by default |
21:45:20 | rayman22201 | The implementation is similar. epoll is more efficient, but the same ideas apply |
21:45:33 | Zevv | yeah, but I was already implementing |
21:45:43 | Zevv | trigger() also misses reference to the selector |
21:46:11 | Zevv | so register() needs to make a copy of the fds into the SelectEvent so that trigger knows where to send to |
21:46:14 | Zevv | bah |
21:47:13 | rayman22201 | unless you make the single fd a global on the asyncDispatch object :-P |
21:47:21 | Zevv | bah |
21:47:50 | Zevv | a bit less bay: register can put a ref to the selector in the event |
21:47:54 | Zevv | s/bay/bah/ |
21:48:37 | rayman22201 | https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L1098 |
21:49:03 | Zevv | bah |
21:49:07 | rayman22201 | lol |
21:49:41 | FromGitter | <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:03 | rayman22201 | I'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:05 | Zevv | pff I read up on dino poop when I was 8! |
21:50:06 | sschwarzer | eptification: *lol* |
21:50:22 | Zevv | rayman22201: better to keep a ref to the selector itself inside the event |
21:51:26 | sschwarzer | To 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:55 | Cadey | how easy is it to integrate nimscript into a program? |
21:52:12 | * | Senketsu joined #nim |
21:52:24 | rayman22201 | I disagree. Since the globalDispatcher has the only reference to the selector currently, it breaks the separation of concerns |
21:54:36 | Zevv | But isn't a SelectEvent tied to a Selector? |
21:54:55 | rayman22201 | no, it's tied to a dispatcher |
21:55:02 | rayman22201 | and a dispatcher is tied to a single selector |
21:55:11 | Zevv | no, the event fds of the pipe go in the selector |
21:55:23 | Zevv | not in the dispatcher. I'm running test code here without a dispatcher |
21:56:14 | rayman22201 | I just realized we are talking about two different thigns |
21:56:15 | rayman22201 | things |
21:56:32 | rayman22201 | I am talking about `asyncEvent` and you are talking about `selectorEvent` |
21:56:52 | rayman22201 | `SelectEvent` I mean |
21:58:13 | rayman22201 | oh wait, they are the same thing: https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L1096 |
21:58:34 | rayman22201 | ok. so it is important to note that selectEvent and AsyncEvent api's need to mirror each other then |
21:59:57 | rayman22201 | I 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:04 | rayman22201 | are you implementing this already @Zevv? |
22:01:11 | * | solitudesf quit (Ping timeout: 258 seconds) |
22:01:18 | Zevv | kind of |
22:01:22 | Zevv | to see where it breaks |
22:01:25 | Zevv | first I will go sleep |
22:01:37 | sschwarzer | Zevv: Good night! |
22:01:44 | rayman22201 | lol. Ok. I need to eat lunch, and take a break myself |
22:01:49 | rayman22201 | gn @Zevv |
22:02:01 | sschwarzer | Zevv: me too :) |
22:02:03 | Zevv | I'll drop you a diff when I got something. Thanks so far have a good lunch! |
22:02:12 | rayman22201 | I was going to start implementing, but if you are already doing it, I will wait |
22:02:24 | rayman22201 | awesome. 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:30 | FromGitter | <zacharycarter> well - the ktx experiment did not go so well |
22:23:56 | FromGitter | <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:21 | FromGitter | <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:20 | FromGitter | <eptification> ] |