00:00:01 | * | junland quit (Quit: %ZNC Disconnected%) |
00:01:42 | * | junland joined #nim |
00:03:51 | * | krux02 quit (Remote host closed the connection) |
00:09:03 | FromDiscord | <ikrima> sent a long message, see https://discordapp.com/channels/371759389889003530/371759389889003532/721516513076445281 |
00:10:19 | FromDiscord | <ikrima> (edit) |
00:10:54 | FromDiscord | <ikrima> (edit) |
00:13:01 | FromDiscord | <ikrima> if helpful, here's an example using the dsl & what it gets transformed into: https://gist.github.com/ikrima/87f2bd1599c66bfc4aeed181a1981fc4 |
00:15:25 | * | MightyJoe quit (Ping timeout: 246 seconds) |
00:15:40 | * | cyraxjoe joined #nim |
00:25:31 | * | fredrikhr quit (Ping timeout: 260 seconds) |
00:39:21 | * | aenesidemus_ joined #nim |
00:40:16 | * | aenesidemus quit (Ping timeout: 246 seconds) |
00:41:22 | zedeus | https://github.com/krux02/opengl-sandbox |
00:41:25 | zedeus | maybe this can help you? |
00:53:01 | * | oddp quit (Ping timeout: 258 seconds) |
00:58:09 | FromDiscord | <ikrima> @Zedeu follow-up: would this be "idiomatic/sane" nim code? ↵since i'm using this exercise for evaluating nim itself, i don't want to misjudge it |
00:58:52 | FromDiscord | <ikrima> @Zedeus[IRC]#0000 ↵follow-up: would this be "idiomatic/sane" nim code? ↵since i'm using this exercise for evaluating nim itself, i don't want to misjudge it |
01:00:09 | FromDiscord | <ikrima> (repo still useful regardless, just good to know if i'm looking at "bad/hacky" nim code or not) |
01:00:39 | zedeus | mostly yeah, but it could be better. it's very heavy on macros and krux likes verbose variable names, besides that it seems fine |
01:01:07 | zedeus | (macros are very relevant here, not saying it should use less of them) |
01:20:20 | * | cyraxjoe quit (Quit: I'm out!) |
01:22:54 | * | cyraxjoe joined #nim |
01:29:43 | * | opal quit (Ping timeout: 240 seconds) |
01:45:38 | * | opal joined #nim |
01:59:47 | * | chemist69 quit (Ping timeout: 260 seconds) |
02:01:34 | * | chemist69 joined #nim |
02:24:03 | * | opal quit (Ping timeout: 240 seconds) |
02:24:49 | * | nikita_ joined #nim |
02:27:22 | * | nikita` quit (Ping timeout: 246 seconds) |
02:39:45 | * | opal joined #nim |
02:46:11 | * | monok joined #nim |
02:48:58 | * | mono quit (Ping timeout: 265 seconds) |
02:54:56 | * | muffindrake quit (Ping timeout: 256 seconds) |
02:57:00 | * | muffindrake joined #nim |
03:08:11 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
03:31:34 | disruptek | i wanna write a lib that gives you a really nim-natural object share across dbus. |
03:32:35 | disruptek | it takes the jason encoder/decoder and implements a version for dbus types. |
03:34:38 | FromDiscord | <Rika> jason? as in json? why json |
03:35:22 | disruptek | not json, jason. it'll be a similar version, but dbus and not json. |
03:35:31 | disruptek | !repo disruptek/jason |
03:35:32 | disbot | https://github.com/disruptek/jason -- 9jason: 11JSON done right 15 5⭐ 0🍴 |
03:35:45 | disruptek | !repo disruptek/deebus |
03:35:46 | disbot | https://github.com/disruptek/deebus -- 9deebus: 11simple sugar over dbus 15 0⭐ 0🍴 |
03:36:19 | disruptek | if the object isn't supported natively, we can just use frosty to serialize it. |
03:36:28 | disruptek | !repo disruptek/frosty |
03:36:29 | disbot | https://github.com/disruptek/frosty -- 9frosty: 11marshal native Nim objects via streams, sockets 15 6⭐ 0🍴 |
03:37:12 | FromDiscord | <Zed> When were those emojis added? |
03:37:19 | FromDiscord | <Zed> i love it |
03:37:29 | disruptek | they've always been there. |
03:37:46 | FromDiscord | <Zed> huh, i've never noticed |
03:37:50 | disruptek | that's the source of the "cutlery" joke. |
03:38:24 | FromDiscord | <Zed> ? |
03:38:40 | disruptek | it's the number of forks. |
03:39:05 | disruptek | what else? |
03:39:55 | disruptek | ~araq |
03:39:55 | disbot | araq: 11👑 the powers that He 👑 -- disruptek |
03:40:25 | disruptek | ~Araq is 👑Andreas "What Else?" Rumpf👑 |
03:40:26 | disbot | Araq: 11👑Andreas "What Else?" Rumpf👑 |
03:40:53 | disruptek | ~Rika |
03:40:54 | disbot | Rika: 11a footnote |
03:41:02 | disruptek | a mere footnote. |
03:41:13 | disruptek | ~zedeus |
03:41:14 | disbot | no footnotes for `zedeus`. 🙁 |
03:41:22 | disruptek | ~zedeus is the nitter.net guy |
03:41:22 | disbot | zedeus: 11the nitter.net guy |
03:42:16 | FromDiscord | <Zed> lol |
03:42:22 | zedeus | nice. |
03:42:30 | disruptek | zedeus: give me a project in your project. i'd like to help specifically. |
03:43:22 | disruptek | i will stream work on it at least one day a week. |
03:43:24 | zedeus | you wanna work on nitter? |
03:43:33 | disruptek | why not? is it done? |
03:43:43 | zedeus | lots of work to be done |
03:43:46 | zedeus | hmm |
03:44:14 | zedeus | I think the two most wanted features right now are embeds and an API |
03:44:29 | disruptek | what are embeds? |
03:44:37 | FromDiscord | <Zed> how many people are using nitter?, zedus |
03:44:39 | zedeus | showing tweets on other sites using nitter |
03:44:52 | disruptek | ah, that would be useful from a marketing perspective. |
03:45:04 | zedeus | I'm not sure, I'd guess about 60k |
03:45:14 | zedeus | last we checked nginx logs it was 15k unique visitors per day |
03:45:20 | FromDiscord | <Zed> damn, that's alot |
03:45:21 | disruptek | i guess it should probably be as close to the way twitter works as possible, right? |
03:45:26 | FromDiscord | <Zed> good job |
03:45:31 | disruptek | except, y'know, private. |
03:45:33 | zedeus | quite close, yeah |
03:45:55 | zedeus | the main problem is how to make them, there's no obvious UI element yet |
03:46:03 | zedeus | so we need to add tweet dropdowns, like twitter has |
03:46:07 | disruptek | i would say the embeds are no-brainer more important, right? |
03:46:16 | disruptek | much larger audience. developers will wait, too. |
03:46:23 | zedeus | yeah, I agree |
03:46:30 | disruptek | and it's not like developers cannot implement the api if they need it fast. |
03:46:36 | zedeus | the browser extensions that redirect you can swap out twitter iframes too |
03:47:06 | disruptek | i'm not sure i know what that means. |
03:47:09 | disruptek | why would i want that? |
03:47:20 | zedeus | to avoid loading things from twitter |
03:47:30 | zedeus | remember, we don't want twitter to know about us |
03:47:45 | zedeus | "us" being the people that want to use nitter |
03:47:48 | disruptek | who makes the browser extensions? |
03:47:58 | zedeus | https://github.com/zedeus/nitter/wiki/Extensions |
03:48:11 | disruptek | oh, this works now? |
03:48:13 | zedeus | yep |
03:48:34 | disruptek | okay, but the embed is designed for non-nitter users, right? |
03:49:10 | disruptek | this is like a business card; it is likely the first introduction you have of your product. |
03:49:17 | zedeus | sort of, it's to show tweets on your site without breaking the privacy of your visitors |
03:49:23 | disruptek | right. |
03:49:34 | disruptek | so there's a massive opportunity there. |
03:49:35 | zedeus | and y'know, nitter is much lighter |
03:49:50 | zedeus | and faster, in most cases |
03:50:11 | zedeus | loading a profile/timeline only takes 300 ms in most cases, vs twitter's 1.3-1.7 seconds |
03:50:15 | disruptek | people want this because it's better than the alternative and unassailably no worse. |
03:50:37 | zedeus | yeah, especially now that they removed the old UI forcing people to use the new dreadful one that seemingly most people hate |
03:50:55 | disruptek | do you run js? |
03:51:12 | zedeus | none, except an opt-in script for supporting infinite scroll |
03:51:23 | zedeus | and video playback, but I'm working on that |
03:51:34 | disruptek | html5 covers video, no? |
03:51:51 | disruptek | i have a friend that made an html5 player. |
03:52:03 | zedeus | yeah, but twitter by default serves .ts files in a m3u8 file, requires hls.js to play. turns out those sneaky bastards actually have mp4 versions though, so that's why I was working on the zero-copy proxying |
03:52:41 | disruptek | why don't you just use their api? |
03:53:33 | zedeus | I do, sort of |
03:53:53 | disruptek | just certain calls, or...? |
03:53:56 | zedeus | you see, now they removed the old UI, I had to start from scratch on a big part of the code |
03:54:04 | zedeus | https://github.com/zedeus/nitter/pull/169 |
03:54:04 | disbot | ➥ Nitter v2 |
03:54:10 | zedeus | it's all json now |
03:54:29 | zedeus | on that note - if you have some big improvements for how the json parsing/deserialization code is written, please work on it |
03:54:52 | disruptek | i just have an obstacle. |
03:54:53 | zedeus | but note that I'm not interested in 30 temporary data types for easy deserialization code |
03:55:10 | disruptek | i dunno what that means. |
03:55:59 | disruptek | the idea is that jason is implemented via concepts. the concept of a string is a thing that can rendered as be a quoted string. |
03:56:19 | disruptek | s/be/is/ |
03:56:19 | FromDiscord | <Elegant Beef> No i'm not you are |
03:56:50 | zedeus | https://github.com/zedeus/nitter/blob/master/src/parser.nim |
03:56:53 | disruptek | i'm just having an issue with the macro that creates variant objects. |
03:57:07 | zedeus | this is pretty manual json parsing, which is fine but not ideal, I guess |
03:58:11 | disruptek | seems fine to me. is it slow? can you rely on the types? |
03:58:26 | zedeus | it's blazing fast, the parsing and rendering overhead is about 1 ms |
03:58:46 | disruptek | why work on it? |
03:58:57 | zedeus | I like clean code that's easy to extend later |
03:59:06 | zedeus | not necessary |
03:59:11 | disruptek | i can't see how it forwards the immediate goal. |
03:59:27 | zedeus | it doesn't, was just a note since you've worked on a bunch of json stuff |
03:59:36 | zedeus | another project you can work on is a new redis library that doesn't suck |
03:59:53 | zedeus | preferably by generating the API and having some nice templates |
04:00:07 | disruptek | what i think would be worth doing, and i know you don't, is supporting decompression in the web client. |
04:00:26 | disruptek | you might be surprised how much faster everything becomes. |
04:00:43 | zedeus | oh that is done now using nginx |
04:00:55 | disruptek | oh nice. |
04:00:57 | zedeus | gzip (and brotli when I get around to enable it) |
04:01:12 | disruptek | that's really good. |
04:01:18 | disruptek | what kind of affect did it have on speed? |
04:01:32 | zedeus | minor, since the majority of time is waiting for twitter to respond |
04:01:50 | zedeus | nitter is fast now though, really fast |
04:01:55 | zedeus | about 2-4x as fast as before v2 |
04:02:08 | disruptek | is there anything slow? |
04:02:18 | zedeus | nothing we can do anything about |
04:03:02 | disruptek | okay, i'll look at redis. its been ages since i used it, anyway. 👍 |
04:03:14 | zedeus | in redis_cache (which contains rather poor code) you can see my current usage of it |
04:03:28 | zedeus | I use frosty and snappy for compression and de/serialization |
04:03:34 | disruptek | is there anything useful that's missing? |
04:03:41 | disruptek | you use frosty? |
04:03:44 | zedeus | yep |
04:03:49 | disruptek | and it works? |
04:03:52 | zedeus | indeed it does. |
04:03:57 | disruptek | holy shit. |
04:04:00 | disruptek | i don't even use it. |
04:04:07 | zedeus | I can't use the socket feature since it needs to be compressed first |
04:04:22 | disruptek | what does that have to do with it? |
04:04:43 | zedeus | well, my current usage is this `compress(freeze(data))` |
04:04:48 | disruptek | frosty really works? |
04:04:54 | zedeus | yeah, I was surprised too |
04:05:06 | disruptek | does it even pass tests? |
04:05:18 | zedeus | define tests |
04:05:34 | disruptek | oh, frosty is the one that's broken right now. |
04:05:37 | disruptek | blocking me. |
04:05:53 | zedeus | I'm not using #head, don't worry |
04:06:01 | disruptek | cannot create a case object after reading the discriminator from the stream via a macro. |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:03 | zedeus | if I do, it doesn't work |
04:06:10 | zedeus | ah I don't use case objects |
04:06:12 | disruptek | oh, head is broken? |
04:06:23 | zedeus | sort of, there's a missing nimble package in marshmellow |
04:06:33 | zedeus | erh, marshmellow doesn't have a .nimble |
04:06:36 | * | supakeen joined #nim |
04:06:39 | disruptek | oh muffins |
04:06:51 | disruptek | we don't use it yet i don't think. |
04:06:54 | zedeus | yeah forgot, haven't looked at it recently |
04:07:31 | zedeus | I optimized the hell out of nitter's memory usage recently |
04:07:44 | zedeus | nitter.net with its tens of thousands of daily users only uses 100 MB |
04:07:49 | disruptek | nice. |
04:07:55 | zedeus | could be better, but I'll take it for now |
04:08:07 | zedeus | it remains at 65 MB for hours till rush hour comes around |
04:08:21 | disruptek | i'm looking forward to optimizing gram. |
04:08:32 | disruptek | lots ideas for stuff to try. |
04:08:40 | zedeus | optimizing stuff is fun |
04:08:40 | disruptek | i'm surprised how large intsets are in memory. |
04:09:00 | zedeus | are they? |
04:09:03 | FromDiscord | <Rika> i dont understand what nitters for IMO |
04:09:13 | disruptek | yeah, i think they are. |
04:09:17 | zedeus | nitter is for using twitter without actually using twitter |
04:09:27 | FromDiscord | <Rika> IMO -> tbh, me brains not workin |
04:09:29 | disruptek | so that twitter cannot follow you. |
04:09:34 | zedeus | your reasons for doing that may vary, but the main reason is privacy |
04:10:01 | zedeus | now that the good UI has been removed, you may also want to use it if you want a better web client |
04:10:16 | zedeus | if your bandwidth is limited, that's another reason to use nitter, since it's much lighter and faster |
04:10:39 | zedeus | there are also conveniences, like a search tab on profiles and unrestricted access to the media tab, amongst other things |
04:10:49 | FromDiscord | <Rika> i'd use it if i could combine people's twitter pages or whatever theyre called |
04:10:55 | zedeus | you can do that |
04:11:00 | zedeus | nitter.net/elonmusk,spacex,nasa |
04:11:01 | FromDiscord | <Rika> oh, how |
04:11:34 | zedeus | the limit is ~25 due to search query restrictions, still working on solving that problem. |
04:11:47 | FromDiscord | <Rika> oh i see, 25 doesnt sound too bad of a limit |
04:12:04 | zedeus | it's decent, but far lower than the number of accounts people usually follow |
04:12:28 | zedeus | you can also browse twitter lists too, so you could make a list that mirrors the people you follow |
04:12:36 | zedeus | example: https://nitter.net/NASA/lists/Astronauts |
04:13:05 | zedeus | oh, disruptek there is another small thing you can work on |
04:13:16 | FromDiscord | <Rika> > it's decent, but far lower than the number of accounts people usually follow↵Zedeus: *sweats* i uh have over a thousand by now i think |
04:13:22 | disruptek | yeah? |
04:13:25 | zedeus | https://github.com/zedeus/nitter/blob/master/src/tokens.nim |
04:13:30 | disruptek | over a thousand what? |
04:13:45 | zedeus | my uh, "token pool" here is designed in a specific way but the usage of it is subpar |
04:14:18 | FromDiscord | <Rika> disruptek: follows lol |
04:14:29 | disruptek | what does that mean? |
04:14:35 | FromDiscord | <Rika> people i follow |
04:14:40 | zedeus | each token has a rate limit that we can keep track of, twitter sends us back the new number after every request. you must not use the token after this number reaches 0, other wise you get rate limited. after 15 minutes, you can use it again, but after a couple hours the token expires fully |
04:14:40 | FromDiscord | <Rika> people i want to see tweets of |
04:14:47 | FromDiscord | <Rika> or are you talking to zed now |
04:15:25 | disruptek | i was talking to you both. |
04:15:34 | disruptek | zedeus: sounds fun. |
04:15:53 | zedeus | I use a seq to store the tokens, using it as a queue. when getting a token for use, I pop a token off the seq, check if it's usable, and if so I return that to the caller, otherwise I put it back in the back of the seq - unless it has expired |
04:16:18 | zedeus | this leads to tokens being unavailable for ~300 ms at a time will requests run, requiring a fairly large token pool |
04:16:24 | zedeus | while* |
04:16:46 | zedeus | if tokens instead could be shared without being removed from the seq, that might help, but I haven't spent time trying to solve that yet |
04:16:55 | FromDiscord | <Rika> if you never access the middle of the seq, do you really need to use a seq? |
04:17:10 | disruptek | why don't you just use a deque or a ring buffer? |
04:17:14 | zedeus | yes, they're popped from the top and returned to the back |
04:17:20 | zedeus | well I could, it doesn't make a difference |
04:17:22 | FromDiscord | <Rika> yeah what dis said |
04:17:44 | disruptek | does the amount of time you want to delay vary with the token? |
04:17:56 | disruptek | i would think that all tokens are equally servicable. |
04:18:35 | FromDiscord | <Rika> it would make sense that hte delay would be constant |
04:18:37 | zedeus | nono, let me explain. we pop a token from the seq, use it in a http request, then return it to the seq. the request takes ~300 ms |
04:18:49 | disruptek | so what? |
04:18:55 | FromDiscord | <Rika> uh |
04:19:01 | zedeus | during that 300 ms it cannot be used in other requests, that's the issue |
04:19:03 | * | aenesidemus_ quit (Read error: Connection reset by peer) |
04:19:12 | zedeus | getting new tokens is rate limited as well, this is why it matters |
04:19:13 | disruptek | how many tokens are you allowed to have at once? |
04:19:17 | FromDiscord | <Rika> make a datatype that you can do a `get()` then internally the next get will be on the next token |
04:19:25 | zedeus | I think about 187 every 15 minutes |
04:19:44 | disruptek | okay, well i think this is a data-structure problem. |
04:19:44 | zedeus | each token has a rate limit of 187, so a theoretical max of 35k requests every 15 minutes |
04:19:48 | zedeus | jindeed |
04:20:04 | disruptek | cool, this is a good one for the stream, too. |
04:20:11 | zedeus | awesome |
04:20:11 | FromDiscord | <Rika> its an interesting one, at least to me 😛 |
04:20:21 | disruptek | yeah, it'll be really fun to play with. |
04:20:34 | zedeus | let me know if you need further explanations, this whole deal has been complicated and I've spent hundreds of hours working on nitter |
04:20:53 | zedeus | at this point, I'm pretty sure I know more about twitter than most developers at twitter |
04:20:55 | disruptek | sure, i know how it is. |
04:21:03 | disruptek | i'm just amazed that frosty works. |
04:21:10 | zedeus | not that I want to, I hate twitter almost as much as I hate web development |
04:21:17 | zedeus | good job on frosty, it's cool |
04:21:43 | disruptek | thanks, i'm close to being able to thaw json. |
04:21:52 | aeverr | thats a lot of checks |
04:21:53 | aeverr | oops |
04:21:57 | disruptek | just has a weird error that i don't understand. |
04:21:59 | aeverr | sorry, wrong channel |
04:22:12 | disruptek | /home/adavidoff/nims/nightly/lib/pure/streams.nim(394, 14) Error: invalid type: 'void' in this context: 'proc (s: Stream, result: var void){.gcsafe, locks: 0.}' for proc |
04:22:19 | zedeus | huh |
04:22:44 | zedeus | could it be because of nrvo? |
04:23:00 | FromDiscord | <Rika> looks like it would be because of nrvo |
04:23:00 | disruptek | it's possible. |
04:23:17 | zedeus | I don't know if the transformation is literally applied like that, and at that stage, but that's my idea |
04:23:40 | disruptek | i have to dig into it, but i've been hacking at this mangling thing. |
04:24:10 | zedeus | no rush |
04:24:18 | disruptek | it's a mess, but i have to put it away. seems like the only solution is whole-program analysis. |
04:24:38 | zedeus | oh also, about what nitter is for |
04:24:39 | disruptek | well, it might be the easiest solution, anyway. |
04:24:41 | zedeus | https://github.com/ciderpunx/twitrssme |
04:24:47 | zedeus | this no longer works, had lots of users |
04:24:52 | zedeus | nitter has rss feeds |
04:24:58 | zedeus | https://github.com/twintproject/twint |
04:24:59 | disruptek | ah, neet. |
04:25:05 | disruptek | neat, too. |
04:25:10 | zedeus | this no longer works, over 5k stars and I see it mentioned quite often |
04:25:18 | zedeus | nitter can fill the gap of these |
04:25:53 | disruptek | hmm, cool. |
04:25:59 | FromDiscord | <Rika> time to advertise |
04:26:05 | zedeus | the twint developer has said he doesn't have time to work on it, and the twitrss guy is very inactive |
04:26:07 | disruptek | any idea what the benefit to caching would be? |
04:26:56 | zedeus | we already cache profile ids, photo rails, lists, and rss feeds |
04:27:24 | disruptek | so you just can't cache the timeline? |
04:27:25 | zedeus | not doing so would make nitter more than twice as slow, waste tokens, and probably start hitting rate limits |
04:27:54 | zedeus | the timeline could be cached, but most timeline traffic is rss which is cached, and I'm not sure how often timelines are revisited within a 5-10 minute frame |
04:28:14 | disruptek | i'm thinking users may share follows. |
04:28:49 | zedeus | certain popular timelines likely get visited a lot, but I have no idea |
04:29:11 | disruptek | that's where i was going with asking about benefit of caching. |
04:29:15 | zedeus | an interesting problem could be doing some runtime analysis using redis, then doing dynamic caching |
04:29:33 | zedeus | ie. cache timelines that get visited very often |
04:29:46 | disruptek | can't redis handle ttl? |
04:30:12 | zedeus | sure, but we don't want to waste memory caching timelines that don't get visited more than once during that ttl |
04:30:27 | zedeus | people run nitter on arm devices, dammit |
04:30:43 | disruptek | the memory can get evicted. |
04:30:57 | disruptek | if it's visited more frequently, the cache will get hit. |
04:31:00 | zedeus | you have very limited control over what can get evicted |
04:31:03 | disruptek | it will always get hot, as it should. |
04:31:14 | disruptek | really? |
04:31:27 | zedeus | well not _very_ limited, but it's not exactly granular |
04:31:50 | zedeus | anyway, this isn't a problem right now, nitter's traffic doesn't cause a problem with rate limits yet |
04:31:53 | disruptek | you can choose the unix time stuff expires at in an O(1) op afaict. |
04:32:04 | disruptek | okay. |
04:32:24 | disruptek | so better token handling and what else? |
04:32:50 | zedeus | for now there's token handling, redis library, embeds |
04:32:58 | disruptek | oh right. |
04:33:04 | zedeus | some refactoring/cleanup if you feel like it, the types could use some work |
04:33:26 | disruptek | embeds seem the most important. |
04:33:34 | zedeus | yep |
04:33:42 | zedeus | it has been wanted for a long time, nitter is getting old |
04:33:56 | disruptek | do you know how to do it? |
04:33:59 | zedeus | I started the project over in april last year |
04:34:06 | zedeus | sort of, something about iframes |
04:34:27 | zedeus | but again, the main obstacle is tweet dropdowns |
04:34:31 | disruptek | i guess it cannot be difficult for obvious reasons. |
04:35:51 | zedeus | but yeah generally there's lots of things to work on, just look at the issues |
04:37:22 | zedeus | https://github.com/zedeus/nitter/issues/134 |
04:37:23 | disbot | ➥ quoted replies button |
04:37:33 | zedeus | see my reply here for why embeds haven't happened yet lol |
04:37:42 | zedeus | again it's not difficult to do, it just has to be done first |
04:37:52 | disruptek | ~features |
04:37:53 | disbot | features: 11begin in the unfortunate state of /unimplemented/ -- disruptek |
04:37:57 | zedeus | indeed |
04:38:28 | disruptek | okay, i'll start tomorrow. 👍 |
04:38:56 | shashlick | Conan turned out to have some big holes |
04:39:15 | disruptek | how so? |
04:39:17 | shashlick | Builds for osx are built on 10.14 so older osx complain |
04:39:58 | shashlick | Windows builds are done with visual studio and the static libs don't link with mingw |
04:40:29 | zedeus | oh also with dropdowns we can add a nice "Archive" button, the functionality of which should be obvious. |
04:40:29 | disruptek | these sound like teething problems. |
04:40:53 | leorize[m] | shashlick: have you tried my osx builds? |
04:41:25 | zedeus | I'm planning to support decentralized twitter archives, requesting deleted tweets from whitelisted nitter instances and such |
04:42:03 | zedeus | at least two twitter engineers have looked at nitter so far and they love the project |
04:43:13 | FromDiscord | <Rika> holy shit damn |
04:43:18 | shashlick | @leorize nope, unfortunately my Nim time is effectively down to an hour a week |
04:43:52 | zedeus | eventually you will be able to login with your twitter account on nitter, but you know what they say about features |
04:44:00 | shashlick | That's after adding up ten random sessions of coding |
04:44:33 | shashlick | I'd have done better to add http://binarybuilds.org support first |
04:44:50 | zedeus | wrong url? I can't load it |
04:46:13 | shashlick | https://binarybuilder.org/ |
04:47:39 | zedeus | damn, that's neat |
04:52:01 | shashlick | Yep Julia has taken the whole wrapper thing real seriously |
04:53:51 | disruptek | why does it build binaries sequentially instead of all at the same time? |
04:54:01 | zedeus | cores are finite |
04:54:07 | shashlick | Check this out - https://github.com/JuliaBinaryWrappers/ |
04:54:18 | disruptek | you could hardly come up with a more parallelizable process. |
04:54:51 | disruptek | interesting. |
04:55:17 | disruptek | seems like we should use this, right? |
04:55:26 | zedeus | I'm not sure I get it |
04:55:36 | shashlick | I'm planning on adding support to pull binaries from there |
04:55:45 | disruptek | you give it build instructions and it extrapolates to support more platforms. |
04:55:50 | disruptek | you can tweak any such script. |
04:55:56 | zedeus | but wrappers? |
04:56:02 | disruptek | what about them? |
04:56:16 | zedeus | how does that relate to crosscompilation? |
04:56:19 | disruptek | people that use nimph don't necessarily /need/ to build it. |
04:56:40 | disruptek | that's how tests can work better. |
04:57:07 | shashlick | Or libarchive when you are using nimarchive |
04:57:50 | shashlick | @kdheepak already wrote Nim code to download from there so should be easier than Conan |
04:59:33 | zedeus | wait.. so it's for downloading (or compiling) library binaries, it's not for generating language bindings to them, or does it do both? |
04:59:41 | shashlick | https://github.com/kdheepak/binary-builder-downloader |
04:59:53 | shashlick | That just builds the binaries |
05:00:44 | zedeus | https://github.com/JuliaBinaryWrappers/FFMPEG_jll.jl |
05:00:47 | zedeus | what's all this about then? |
05:04:40 | shashlick | Yep you can then import them into Julia |
05:04:59 | shashlick | They have some wrapping process as well, still looking for the details on that |
05:06:58 | * | dddddd quit (Ping timeout: 246 seconds) |
05:07:33 | shashlick | https://github.com/JuliaInterop |
05:14:07 | * | Senny quit (Ping timeout: 272 seconds) |
05:14:11 | * | silvernode joined #nim |
05:17:11 | zedeus | disruptek: there's #nitter btw, we can talk there tomorrow |
05:27:39 | * | gangstacat quit (Quit: Ĝis!) |
05:42:16 | * | solitudesf joined #nim |
05:44:03 | silvernode | How come when I return getch() in a proc, it tells me it is of type char and has to be discarded? |
05:45:15 | FromDiscord | <Rika> what do you mean |
05:45:28 | FromDiscord | <Rika> what is the proc's return type |
05:47:26 | silvernode | https://play.nim-lang.org/#ix=2p8Y |
05:47:57 | FromDiscord | <Rika> it compiles just fine |
05:48:21 | FromDiscord | <Rika> if you use it, you need to do `discard ask_question()` or use the result |
05:49:45 | silvernode | yeah I wasn't using it, I ended up echoing it and that was considered using it Figured it out right before you replied |
05:49:47 | silvernode | thanks |
05:50:05 | silvernode | not echo but rather made a var |
06:00:47 | * | bung joined #nim |
06:02:07 | * | marnix joined #nim |
06:05:35 | * | Vladar joined #nim |
06:08:32 | * | vikfret joined #nim |
06:18:44 | * | marnix quit (Ping timeout: 265 seconds) |
06:22:06 | * | fredrikhr joined #nim |
06:27:10 | FromDiscord | <Rika> \:( jester doesnt compile on devel |
06:36:37 | * | marnix joined #nim |
06:41:58 | * | marnix quit (Ping timeout: 260 seconds) |
06:44:20 | Prestige | Trying to understand refs a bit better - I have an OrderedTableRef in ObjectA that I provide to ObjectB. If ObjectA updates that table, shouldn't ObjectB see the changes? |
06:45:47 | Prestige | oh it does, good |
06:52:37 | FromDiscord | <Rika> voltist: you made inumon the library right? |
07:14:32 | * | marnix joined #nim |
07:17:52 | * | cyraxjoe quit (Ping timeout: 246 seconds) |
07:18:28 | * | cyraxjoe joined #nim |
07:20:30 | * | Cthalupa quit (Ping timeout: 272 seconds) |
07:21:24 | * | Cthalupa joined #nim |
07:25:55 | * | cyraxjoe quit (Ping timeout: 265 seconds) |
07:26:18 | * | cyraxjoe joined #nim |
07:28:10 | * | solitudesf quit (Ping timeout: 260 seconds) |
07:55:51 | FromDiscord | <Elegant Beef> Prestige what languages have you programmed in? |
07:56:46 | Prestige | quite a few I guess - started with Java, learned C#, javascript, typescript, python, a little c.. tried a few like rust, go, kotlin |
07:56:58 | Prestige | wasnt a fan of ruby |
07:56:59 | FromDiscord | <Elegant Beef> Ah then references are like Java/C# classes |
07:57:32 | Prestige | yeah I thought my ref wasn't being updated for some reason but I literally just forgot to change the variable I was calling lol |
07:57:37 | FromDiscord | <Elegant Beef> Ah |
07:59:01 | FromDiscord | <Elegant Beef> Do you need a reference table? |
07:59:37 | FromDiscord | <Elegant Beef> Im going to guess probably no, but idk what you're doing |
08:01:02 | Prestige | I finished that chunk of code, I think I'm good |
08:01:08 | Prestige | Need to clean up some of this code though |
08:01:38 | Prestige | was just implementing these little indicators in my status bar to show if a tag has a window on it: https://0x0.st/iWNN.png |
08:41:51 | * | D_ quit (Ping timeout: 272 seconds) |
08:44:41 | * | D_ joined #nim |
08:48:57 | * | kenran joined #nim |
08:50:30 | * | Vladar quit (Quit: Leaving) |
09:04:27 | * | drewr quit (Ping timeout: 260 seconds) |
09:05:54 | * | drewr joined #nim |
09:09:48 | * | solitudesf joined #nim |
09:11:28 | * | fredrikhr quit (Read error: Connection reset by peer) |
09:11:48 | * | tdc joined #nim |
09:11:53 | * | fredrikhr joined #nim |
09:21:13 | * | marnix quit (Ping timeout: 264 seconds) |
09:23:52 | * | oddp joined #nim |
09:26:01 | * | silvernode quit (Ping timeout: 264 seconds) |
09:30:10 | * | nikita_ quit (Quit: leaving) |
09:41:24 | * | fredrikhr quit (Quit: Client Disconnecting) |
09:52:01 | * | krux02 joined #nim |
09:55:15 | FromDiscord | <wiremoons> Hi - can anyone recommend a document or article on how to start writing tests for Nim programs? I have seen info in `assert` and `doAssert`, noticed there is a `unittest` module - but that says to use `testament` - but no links to what that is that I can see. Sorry if I am missing the obvious! |
09:59:31 | Zevv | No testament needed. |
10:00:05 | Zevv | You can import unittest and just do tests there. It does not do much, but provides handy tools for nice output and expected execptions and stuff like that |
10:00:30 | Zevv | you can just run your code as a normal nim program, no testament needed |
10:00:41 | Zevv | Top level you define a 'suite', then your 'tests' blocks below that |
10:01:32 | krux02 | wiremoons: The easiest way to define tests for a module is to write a section at the end of your file: when isMainModule: |
10:01:59 | krux02 | in this section you call your private functions with asserts to expected results. |
10:02:18 | krux02 | run your module, and you get your test results. |
10:02:43 | krux02 | This is not yet automated testing, but it gets you started. |
10:05:45 | * | D_ quit (Quit: No Ping reply in 180 seconds.) |
10:06:40 | * | D_ joined #nim |
10:10:12 | FromDiscord | <wiremoons> OK - thanks for the suggestions 👍 |
10:26:10 | * | pangey joined #nim |
10:29:34 | * | kenran quit (Ping timeout: 240 seconds) |
10:57:53 | Prestige | Is issue #6 being worked on? (Cyclic imports) |
10:58:15 | Prestige | Or is there some way around that issue |
11:01:17 | FromDiscord | <Rika> reorder your imports basically |
11:01:33 | FromDiscord | <Rika> theres a certain way to order them but its hard to elaborate on |
11:01:37 | FromDiscord | <Rika> i think its touched on in the manua |
11:01:38 | FromDiscord | <Rika> , |
11:01:38 | FromDiscord | <Rika> l |
11:02:26 | Prestige | Yeah, was looking it over.. seems weird |
11:05:08 | * | NimBot joined #nim |
11:14:54 | * | nikita` joined #nim |
11:19:50 | FromDiscord | <Shucks> Im running into a `recursive module dependency` is there a way to define a variable with a global object type without defining the specific object? |
11:21:30 | FromDiscord | <Shucks> like `var MyVar: object` |
11:25:00 | FromDiscord | <flywind> @wiremoons If you can tolerate some bugs in `testament`, you can look at this simple introduction to `testament`. 🤣 ↵https://dev.to/xflywind/how-to-use-testament-in-nim-1l0h |
11:26:57 | * | Vladar joined #nim |
11:29:05 | krux02 | Shucks: define your type first, then you can define your global variable. |
11:29:30 | krux02 | Nim doesn't allow forward declarations of types sadly. |
11:29:55 | krux02 | to break the recursive module dependency, it helps to have one module that declares all the types. |
11:30:00 | krux02 | without functions |
11:32:04 | FromDiscord | <wiremoons> Thanks @flywind - I will take a look 🙂 |
11:34:09 | FromDiscord | <flywind> np |
11:34:14 | krux02 | You should not use testament in your own projects. It is an internal testing tool designed to test the Nim programming language with many testing the nim compiler feauters specific feautures. |
11:37:19 | FromDiscord | <Shucks> > Shucks: define your type first, then you can define your global variable.↵@krux02[IRC]#0000 yea the issue I got is that the type is from a file which needs my global variable aswell |
11:37:27 | FromDiscord | <Shucks> > to break the recursive module dependency, it helps to have one module that declares all the types.↵@krux02[IRC]#0000 Gonna do that then |
11:39:08 | Yardanico | we also have https://nim-lang.org/docs/manual_experimental.html#package-level-objects but I didn't see it used in real code at all :P |
11:40:10 | * | WilhelmVonWeiner quit (Ping timeout: 272 seconds) |
11:48:16 | * | letto quit (Quit: Konversation terminated!) |
11:49:13 | FromDiscord | <Rika> well its still in experimental |
11:49:19 | Yardanico | sooo? :) |
11:49:30 | Yardanico | code reordering is experimental too but I've seen it used a few times |
11:49:34 | Yardanico | concepts are "experimental" too |
11:50:12 | FromDiscord | <Rika> its the first time ive seen it in this document even |
11:50:20 | Yardanico | it's been here for a long while |
11:50:21 | FromDiscord | <Rika> reordering and concepts have been there for longer |
11:50:25 | Yardanico | well yes |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:14 | * | letto joined #nim |
12:06:34 | * | supakeen joined #nim |
12:11:34 | * | lritter joined #nim |
12:25:44 | * | waleee-cl joined #nim |
12:28:28 | * | abm joined #nim |
12:41:04 | * | dddddd joined #nim |
13:18:02 | * | haxscramper joined #nim |
13:19:44 | FromDiscord | <Shucks> what are the correct debug parameters for gdb? I've added a lot crazy stuff to the nim.cfg and it just doesnt feels correct lol. ```-d:debug↵--debugger:gdb↵--linedir:on↵--debuginfo``` |
13:26:17 | FromDiscord | <Rika> --debugger:native ? |
13:34:49 | haxscramper | How to distingush between different global procs using `typeof`? I want to do this: `when declared(toPStr) and (toPStr is proc(a: int): string {.nimcall.})`, but it fails if I define more than one proc with the same name. |
13:36:37 | FromDiscord | <Rika> what are the 2(or more) procs' signatures? |
13:36:43 | haxscramper | Here is test code: `https://play.nim-lang.org/#ix=2paH` - commenting second `toPStr` makes check valid. It compiles both ways, just doesn't work as I want it to. |
13:36:54 | FromDiscord | <Rika> you can define 2 procs w/ same name only if the 2 procs have different argument arity and types |
13:36:59 | FromDiscord | <Rika> not return type |
13:37:23 | FromDiscord | <Rika> huh |
13:38:33 | * | Senny joined #nim |
13:40:08 | FromDiscord | <Shucks> > --debugger:native ?↵@Rika Thanks. Debugging nim seems quite hard. VSCode with gdb doesn't shows me any variables and stuff |
13:50:00 | * | chemist69 quit (Ping timeout: 256 seconds) |
13:51:01 | * | chemist69 joined #nim |
13:56:57 | haxscramper | Writing proc that accepts proc work - the one with correct signature is used. Assigning `let t = toPStr` gives compilation error `invalid type: 'None' for let`. Having only regular and generic procs defined leads to the same error - `https://play.nim-lang.org/#ix=2paK`. Is there are some way of selecting an overloaded proc or I just have to go with `when(compiles(...))`? |
14:00:02 | haxscramper | How expensive is `when(compiles(...))` by the way? I'm writing a pretty-printer for objects - which means it will trigger quite often during compilation (dozens of times at least, even more if printing lots of different types). |
14:06:14 | Zevv | haxscramper: safest is to measure I guess. Just do it a million times and divide by a million to know how long it takes :) |
14:09:15 | * | marnix joined #nim |
14:32:15 | disruptek | haxscramper: it's super cheap. |
14:33:43 | * | kenran joined #nim |
14:45:25 | haxscramper | I actually tested it on one million `compiles` checks (34mb of text) - results are: `Hint: 1037839 lines; 107.292s; 1.963GiB peakmem;`. Which means about `0.0002` seconds per check. Script to generate test case: `https://play.nim-lang.org/#ix=2pb6`. |
14:58:40 | * | PMunch joined #nim |
14:59:42 | disruptek | neat; that seems cheap enough. |
15:00:41 | disruptek | ~compiles is tested it on one million `compiles` checks (34mb of text) - results are: `Hint: 1037839 lines; 107.292s; 1.963GiB peakmem;`. Which means about `0.0002` seconds per check. Script to generate test case: `https://play.nim-lang.org/#ix=2pb6`. |
15:00:42 | disbot | compiles: 11tested it on one million `compiles` checks (34mb of text) - results are: `Hint: 1037839 lines; 107.292s; 1.963GiB peakmem;`. Which means about `0.0002` seconds per check. Script to generate test case: `https://play.nim-lang.org/#ix=2pb6`. |
15:04:27 | FromDiscord | <Shucks> Just found out that i had a 64bit version of gdb in path and my project is build in 32bit |
15:04:33 | FromDiscord | <Shucks> seems to work fine now |
15:08:54 | * | nerthus quit (Remote host closed the connection) |
15:09:08 | * | nerthus joined #nim |
15:19:24 | Zevv | PMunch: What was this compile you were running for a month? |
15:20:06 | disruptek | dude. it's like a proc that takes 308 million arguments. |
15:20:31 | PMunch | Zevv, it's still running :P |
15:20:37 | Zevv | right. I made a little test to see how #args scales to compile time ,but it seems to be nicely linear |
15:20:55 | disruptek | only 307 million seconds to go. |
15:20:58 | PMunch | That's what I expected |
15:21:14 | PMunch | I can always run the one with all 5 letter combinations again and see how long that takes |
15:21:33 | PMunch | Timing that by 26 should tell me how long this should take |
15:21:41 | disruptek | just think of all the heat generators we could make. |
15:21:58 | disruptek | and here pmunch is wasting energy on arguments. |
15:22:06 | PMunch | :P |
15:22:22 | disruptek | FOR SHAME |
15:24:06 | Zevv | I have a little proc taking 'n' ints and echoing them all |
15:24:20 | Zevv | compiling that for n = 100000 takes 2 seconds |
15:24:33 | Zevv | (26**6) * 2.0/100000 is only 6000 seconds |
15:24:38 | FromDiscord | <Rika> 100k is nothing compared to 308 million |
15:24:45 | Zevv | ^^ |
15:24:56 | disruptek | it's weird how that works. |
15:25:14 | Zevv | 100k and 308 million is not that far apart |
15:25:18 | FromDiscord | <Rika> i think its linear in smaller perspectives |
15:25:25 | FromDiscord | <Rika> how a circle looks linear when zoomed in |
15:25:43 | disruptek | ants have a narrower field of vision. |
15:26:30 | Zevv | oh waait something interesting is happening at 120k |
15:26:34 | Zevv | suddenly it blows up |
15:26:50 | Zevv | it kind of halts |
15:27:03 | disruptek | memory churn. |
15:27:10 | Zevv | probably |
15:27:16 | Zevv | restarting from 120k onwards |
15:27:39 | Zevv | yeah just exhaustion |
15:28:50 | Zevv | but no longer linear |
15:30:04 | disruptek | did you hear? someone is actually using frosty and it works. |
15:31:53 | Zevv | what be frosty |
15:32:05 | disruptek | !repo frosty |
15:32:06 | disbot | https://github.com/disruptek/frosty -- 9frosty: 11marshal native Nim objects via streams, sockets 15 6⭐ 0🍴 |
15:32:34 | disruptek | simple recursive freeze/thaw. |
15:32:48 | Zevv | "Frosty can handle cyclic data structures," \o/ |
15:32:51 | Zevv | you did it |
15:32:53 | Zevv | good boy! |
15:33:16 | disruptek | oh, yeah. i think it's still the way i said it was. |
15:33:20 | Zevv | I do wonder how you plan to do cyclic data structures of infinite size though |
15:33:44 | disruptek | araq showed me how to turn a recursive operation into a fsm. |
15:34:08 | Zevv | but still, where do you plan to store this infinite size list of things you already serialized |
15:34:29 | * | silvernode joined #nim |
15:34:39 | disruptek | they don't make infinites like they used to. |
15:34:44 | disruptek | they make 'em better. |
15:34:49 | Zevv | I just explained my kid today how you can put up an infinite amount of people in a hotel with an infinite amounut of rooms occupied by an infinite amount of people |
15:34:53 | Zevv | too bad he didn't want to listen |
15:34:57 | disruptek | you can get them small and grow them. |
15:35:18 | Zevv | how many infinites are you allowed to grow at home in the US these days then |
15:35:30 | disruptek | it's pretty much infinite. |
15:36:25 | disruptek | !last disruptek |
15:36:26 | disbot | disruptek spoke in 12#nim 54 seconds ago 12https://irclogs.nim-lang.org/14-06-2020.html#15:35:30 |
15:38:08 | Zevv | lucky you |
15:38:16 | Zevv | here in the netherlands stuff is much more regulated. |
15:38:30 | disruptek | it's weird how that works. |
15:38:38 | Zevv | one infinite stuffed under your car seat and you're done for |
15:39:03 | disruptek | they cancelled LivePD here. |
15:39:18 | Zevv | ha |
15:39:57 | Zevv | We just Zol |
15:40:59 | zedeus | sup |
15:41:12 | disruptek | what is up my man. |
15:43:00 | zedeus | I found an old twitter API reference pdf created by disassemblying the twitter app, that lets you do a bunch of stuff the new API doesn't allow without authorization |
15:43:10 | zedeus | with this nitter can support more stuff |
15:43:22 | disruptek | wow |
15:43:35 | zedeus | however they have separate rate limits, but use the same tokens, so I may have to revise how that works |
15:43:50 | disruptek | neat. |
15:44:44 | zedeus | dropdowns are important btw, they will allow for plenty of features |
15:44:45 | disruptek | we can just balance tokens between each side. |
15:45:43 | zedeus | we can do a mumble call and talk about nitter's internals if you want |
15:46:19 | disruptek | yeah, turns out i broke mumble and obs when i rebuilt qt. |
15:46:33 | zedeus | joys of using source-based distros, huh |
15:46:57 | disruptek | i love it, i really wouldn't want to fly any other way. |
15:47:28 | disruptek | i guess i just don't understand the guarantees of other sytems. |
15:48:34 | zedeus | things are unlikely to break, and if they do you won't have to wait a few hours for qt to rebiuld |
15:48:46 | disruptek | a few hours? |
15:48:55 | zedeus | depends on your cpu of course, but qt is no small project |
15:51:48 | disruptek | www-client/ungoogled-chromium: 58′44″ average for 53 merges |
15:51:55 | disruptek | dev-qt/qtgui: 2′05″ average for 19 merges |
15:52:18 | zedeus | fair. maybe you just need to rebuild mumble? |
15:52:20 | disruptek | is two minutes a long time for a process i can run in the background or even automate? |
15:52:26 | * | adnan338 joined #nim |
15:52:31 | disruptek | i'm just asking. |
15:52:38 | disruptek | am i the idiot here? |
15:52:41 | solitudesf | ccache is cheating |
15:52:44 | adnan338 | Hi, is this how I should be using locks? https://play.nim-lang.org/#ix=2pbu |
15:52:51 | disruptek | gtfo there's no such thing as cheating. |
15:52:57 | zedeus | lol |
15:53:10 | disruptek | THIS IS SPARTA |
15:53:26 | zedeus | https://github.com/zedeus/nitter/issues/189 |
15:53:27 | disbot | ➥ Support Unix Domain Sockets |
15:53:38 | zedeus | hmm, do you know what he wants? can we do it? |
15:53:53 | disruptek | yeah, it's like what swayipc does. |
15:54:28 | zedeus | I assume that would be separate from jester |
15:54:52 | disruptek | it would make interesting api-using apps easier for x-lang development, i guess. |
15:55:16 | disruptek | is this a linux-only app? |
15:55:47 | zedeus | it might run on windows but I don't know, or care |
15:55:56 | disruptek | okay. |
15:57:04 | zedeus | are you going to fix your mumble today? |
15:57:14 | disruptek | yeah, probably. |
16:01:10 | * | haxscramper quit (Remote host closed the connection) |
16:01:14 | disruptek | seems like making it work with jester would be ideal. |
16:01:18 | disruptek | maybe we can pr jester. |
16:04:53 | FromGitter | <kdheepak> Currently the binary-builder-downloader code downloads binaries and related metadata in parallel as well! nim makes it easy to do that. |
16:05:21 | FromGitter | <kdheepak> I haven't looked into conan support yet, but I'm interested in adding conan and conda support. |
16:05:50 | zedeus | perhaps, I consider it low priority though since it doesn't really offer a significant benefit over using tcp, and it's local only which isn't the main use case for nitter |
16:06:07 | disruptek | makes sense. |
16:09:42 | * | chemist69 quit (Ping timeout: 260 seconds) |
16:10:02 | * | kitech1- quit (Quit: ZNC 1.7.5 - https://znc.in) |
16:10:35 | * | chemist69 joined #nim |
16:10:44 | * | kitech1 joined #nim |
16:12:47 | * | bung quit (Quit: Lost terminal) |
16:16:36 | * | PMunch quit (Quit: leaving) |
16:18:46 | * | marnix quit (Ping timeout: 258 seconds) |
16:35:25 | * | abm quit (Read error: Connection reset by peer) |
16:38:58 | disruptek | what's the relationship between when a token expires and your software? |
16:39:54 | zedeus | if the expired token is used, you get an error |
16:40:04 | * | kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in) |
16:40:20 | zedeus | how long it takes to expire i'm not 100% sure, but it appears to be a couple hours |
16:41:08 | disruptek | what's the impact of getting the error upon use of an expired token? |
16:41:12 | * | kitech1 joined #nim |
16:41:54 | zedeus | having to redo the request - wasted time |
16:42:08 | disruptek | okay, but nitter does the right thing, right? |
16:42:16 | zedeus | yeah, it discards expired tokens before use |
16:42:33 | disruptek | right, but i mean a failure is pretty cheap, especially if it's for testing purposes. |
16:42:48 | disruptek | i'm just trying to understand if there are any hidden costs like it could break all your keys, etc. |
16:43:10 | zedeus | nah, twitter's token rules are very stupid |
16:43:37 | disruptek | so currently you just do something to check the pool every few minutes? |
16:44:11 | disruptek | what's the limit of token requests? |
16:46:05 | zedeus | not quite. when we want a token we go through the token pool till we get a usable one, or fetch a new one if none are available. a loop is running every two seconds that checks whether some minimum amount of tokens are available for use. this is done to prevent having to fetch tons of tokens during bursts |
16:46:27 | disruptek | right. |
16:46:47 | disruptek | each token can be used 187 times, though, right? |
16:46:56 | zedeus | i'm still not sure about the rate limit for getting tokens, it doesn't exactly give you a number. you fetch twitter.com and either it contains a token, or it doesn't |
16:47:02 | zedeus | yeah, 187 times every 15 minutes |
16:47:20 | disruptek | so when the token is >15mins old, you toss it. |
16:47:27 | disruptek | or if it has been used 187 times. |
16:47:46 | zedeus | nah, when it's 15 mins old the limit is reset |
16:48:08 | disruptek | so each token is a thread. |
16:48:11 | zedeus | if it has been used 187 times, we put it back in the pool for later |
16:48:47 | * | ftsf quit (Ping timeout: 260 seconds) |
16:48:47 | disruptek | do you have to guess what constitutes a use or does twitter tell you the current usage number? |
16:49:21 | zedeus | the number is returned in the headers |
16:49:41 | disruptek | nice. |
16:50:45 | * | kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in) |
16:51:07 | * | kitech1 joined #nim |
16:52:19 | FromDiscord | <dom96> Aren't you worried Twitter will shut this down? 🙂 |
16:52:26 | zedeus | nope |
16:52:40 | zedeus | if they shut it down, their site will stop working :) |
16:53:22 | FromDiscord | <dom96> Hrm, but they could surely change the mechanism completely and quite suddenly, no? |
16:53:35 | zedeus | oh, they did, but I just followed along |
16:53:43 | zedeus | https://github.com/zedeus/nitter/pull/169 |
16:53:44 | disbot | ➥ Nitter v2 |
16:53:51 | FromDiscord | <dom96> fun |
16:53:57 | zedeus | besides, their ancient APIs are still available, they hate breaking backwards compat |
16:54:12 | zedeus | json fields deprecated in 2010 are still included |
16:56:05 | FromDiscord | <dom96> Nice. If I haven't said it already, amazing job 🙂 |
16:56:34 | * | Senny quit (Ping timeout: 240 seconds) |
16:56:42 | FromDiscord | <exelotl> yeah nitter is great :D |
16:58:37 | * | Kaivo quit (Quit: WeeChat 2.8) |
16:59:47 | zedeus | thanks! |
17:00:40 | disruptek | does fetching a token count as a use? ie. do they start with 0 uses or 1 use? |
17:00:52 | zedeus | 0 |
17:17:21 | shashlick | @kdheepak I've already built Conan support - you can leverage that |
17:18:01 | shashlick | https://github.com/nimterop/nimterop/blob/conan/nimterop/conan.nim |
17:19:20 | stefantalpalaru | I have finally documented this collection of ugly hacks: https://github.com/status-im/nimbus-build-system |
17:20:14 | shashlick | I'm going to leverage your code for binary builder support |
17:20:43 | shashlick | Ideally your code can be used at compile time |
17:22:44 | shashlick | What does conda support buy for Nim? |
17:40:43 | disruptek | i registered the domain nim.fan last night. 🥰 |
17:42:23 | FromDiscord | <dom96> For some reason that reminded me of Gradha's blog which is filled with K-pop fandom https://gradha.github.io/index.html |
17:42:50 | zedeus | disruptek: you better make it a giant fan with a spinning nim crown |
17:43:00 | disruptek | very sharp pointy bits. |
17:45:29 | disruptek | also nim.ninja |
17:45:36 | disruptek | 👑.🥷 |
17:46:39 | supakeen | disruptek: going to make it into a blog planet? ;) |
17:46:49 | disruptek | what's a blog planet? |
17:47:04 | supakeen | it's an old thing where many blogs would be aggregated about the same subject |
17:47:14 | disruptek | weird. |
17:47:16 | * | azed joined #nim |
17:47:19 | supakeen | so you used to have planet.mozilla.org for all the mozilla contributor blogs and stuff |
17:47:35 | disruptek | what a strange concept. |
17:48:15 | zedeus | https://planet.emacslife.com/ |
17:48:17 | zedeus | another example |
17:51:13 | dom96 | https://planet.nim-lang.org/ |
17:51:23 | dom96 | We already have one :) |
17:51:38 | disruptek | wtf |
17:53:25 | supakeen | rip |
18:02:44 | * | azed quit (Quit: WeeChat 2.8) |
18:05:48 | disruptek | zedeus: how many tokens do you run on the server? |
18:07:00 | zedeus | the minimal is set to 20 in the config, but it might be more. last time I checked it was around 50, but I had two nitter instances running at the time |
18:07:23 | disruptek | is there a literal limit? |
18:07:40 | zedeus | theoretically yes, but I haven't calculated it yet |
18:07:57 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
18:08:15 | zedeus | it requires knowing the exact rate limit for getting tokens, and when/how they expire |
18:08:52 | disruptek | but you don't know that limit, right? |
18:09:21 | zedeus | correct. if we assume 100 tokens can be fetched every 15 minutes, and they expire after 2 hours, that's a max of 800 at any given time |
18:10:05 | disruptek | oh, the 15min limit isn't on the tokens themselves, it's on the number that you will fetch? |
18:11:12 | zedeus | the rate limit per token resets every 15 minutes. the rate limit for fetching tokens I'm unsure about, but I think it also resets every 15 minutes |
18:11:31 | disruptek | okay, neat. |
18:13:27 | zedeus | http://ix.io/2pc5 |
18:13:27 | FromDiscord | <Rika> calling a proc that returns a closure counts as a global? |
18:13:47 | zedeus | this gives you some interesting info, but I don't know if any of these relate to the tokens retrieved by simply fetching twitter.com |
18:14:19 | zedeus | that is, I don't know if the mechanism by which you retrieve tokens that way is counted in this list |
18:14:40 | * | silvernode_ joined #nim |
18:14:46 | * | silvernode quit (Quit: Konversation terminated!) |
18:15:12 | * | silvernode_ quit (Client Quit) |
18:15:20 | disruptek | neat. |
18:15:34 | * | silvernode_ joined #nim |
18:15:42 | * | silvernode_ quit (Client Quit) |
18:15:57 | zedeus | here's the old api pdf I mentioned http://seriot.ch/resources/abusing_twitter_api/twitter_api.pdf |
18:16:08 | zedeus | many of them still work, only requiring a guest token |
18:24:18 | disruptek | lol nice. |
18:24:29 | disruptek | i wonder if there's a swagger for this. |
18:24:54 | disruptek | seems like yes. |
18:25:30 | FromDiscord | <Rika> how do i make an immutable (set on compiletime) variable that's accessible in all threads? |
18:27:48 | disruptek | how is it a variable if it's compile-time immutable? |
18:27:59 | disruptek | you mean like var .compileTime? |
18:28:01 | FromDiscord | <Rika> well, i dont know what else to call it |
18:28:07 | disruptek | a constant? |
18:28:14 | FromDiscord | <Rika> `let smth = static:` is what i do |
18:28:21 | disruptek | why? |
18:28:36 | Yardanico | @Rika const smth = static: ? |
18:28:42 | FromDiscord | <Rika> i dont know really, it just works, i dont know if its what i intend it to do |
18:28:52 | disruptek | const smth = "something static" |
18:29:02 | FromDiscord | <Rika> its a table[table[string, string]] |
18:29:08 | disruptek | so what? |
18:29:16 | FromDiscord | <Rika> ill try it |
18:29:23 | disruptek | cool, dawg. |
18:29:35 | FromDiscord | <Rika> nice |
18:33:35 | FromDiscord | <Rika> is my # of threads limited by how many logical cores my machine has? |
18:33:41 | disruptek | nah. |
18:33:55 | disruptek | a practical limit is tens of thousands. |
18:34:06 | FromDiscord | <Rika> huh, jester is only doing the # of logical cores then |
18:34:10 | Yardanico | yes |
18:34:19 | FromDiscord | <Rika> yes what |
18:34:20 | Yardanico | because usually it doesn't benefit if you make tens of thousands of threads |
18:34:41 | disruptek | depends on the architecture. |
18:34:55 | FromDiscord | <Rika> i mean, 10s of thousands i do not need |
18:35:01 | FromDiscord | <Rika> 2 is too little, though |
18:35:02 | disruptek | don't be greedy. |
18:35:05 | zedeus | you only have X cores, having more threads than that doesn't magically result in more work being done |
18:35:19 | Yardanico | @Rika well why not just amount of logical cores you have? |
18:35:20 | zedeus | depends on the workload of course |
18:35:36 | disruptek | no, but it requires that the dispatcher handle scheduling instead of letting the os do it. |
18:35:39 | Yardanico | https://nim-lang.org/docs/osproc.html#countProcessors |
18:36:05 | FromDiscord | <Rika> @Yardanico I've only 2 logical cores |
18:36:10 | Yardanico | soo? |
18:36:25 | FromDiscord | <Rika> Tis a vps, requests are kinda slow :( |
18:36:26 | Yardanico | if you do CPU work then using more than 2 won't make a big difference in most cases |
18:36:37 | zedeus | firing up more threads will not make it faster |
18:36:40 | Yardanico | oh, with jester and httpbeast? strange |
18:36:44 | Yardanico | remember, httpbeast is async |
18:36:45 | FromDiscord | <Rika> I'll figure it out |
18:36:49 | Yardanico | optionally threaded async |
18:36:59 | zedeus | using httpbeast latency increases 4x with threads enabled |
18:37:04 | FromDiscord | <Rika> Hmm |
18:37:16 | zedeus | threads are for throughput, not latency |
18:37:28 | FromDiscord | <Rika> Hmm |
18:38:08 | zedeus | I benchmarked it yesterday when fixing a bug that imo made httpbeast completely unusable in production |
18:38:22 | disruptek | another one? |
18:38:32 | zedeus | nah, just crosstalk |
18:38:37 | disruptek | ah. |
18:38:55 | disruptek | i honestly don't think any of this stuff is production ready. |
18:39:04 | zedeus | you don't want your data to get sent to the next guy in line just because you disconnect early |
18:39:21 | Yardanico | disruptek: it's the best we have, no need to be so pessimistic :) |
18:39:26 | disruptek | could be useful; it's like caching. |
18:39:30 | zedeus | hah |
18:43:25 | FromDiscord | <Rika> oh, also with jester, i get `ERROR Could not send response: Operation now in progress`, dunno why but i suspect i'm being stupid and am doing something horribly wrong |
18:51:47 | * | tane joined #nim |
19:00:22 | leorize[m] | `-d:useStdLib` |
19:00:25 | leorize[m] | pass that |
19:00:31 | leorize[m] | make jester uses asynchttpserver |
19:00:33 | * | luis_ joined #nim |
19:01:32 | leorize[m] | httpbeast is designed for benchmark and IMO should never be used by anyone as the default. |
19:02:41 | luis_ | Hi all, if I want to create a command line tool in which I can pass output from one commad into it in a bash pipe... should I be using readLine? |
19:03:12 | Yardanico | luis_: maybe it's better to look into https://nim-lang.org/docs/osproc.html ? |
19:03:13 | leorize[m] | that works |
19:03:25 | luis_ | many thanks |
19:03:29 | * | bung joined #nim |
19:08:03 | FromDiscord | <Rika> leorize: then it is odd that jester uses it by default, is it not? |
19:08:24 | leorize[m] | well benchmarks benchmark the default |
19:09:08 | leorize[m] | it's a way to make jester ranks higher in benchmark since httpbeast is much faster than asynchttpserver (I think, never benchmarked) |
19:09:18 | zedeus | it is |
19:09:21 | leorize[m] | don't quote me on that though, I'm not jester's author |
19:11:38 | leorize[m] | iirc the forum uses asynchttpserver, so I have trust in that it'll work properly |
19:12:25 | zedeus | 4 cores with httpbeast I get ~150k req/s, while asynchttpserver is about 44k req/s |
19:12:45 | zedeus | that's using jester, without you can get a bit faster |
19:13:15 | FromDiscord | <willyboar> whip is getting almost the same with plain httpbeast |
19:13:40 | FromDiscord | <willyboar> from what the author of web framework benchmark told me |
19:13:43 | zedeus | with httpbeast alone i can reach 200k |
19:13:51 | FromDiscord | <willyboar> yes |
19:13:52 | FromDiscord | <Rika> huuuh... now i'm getting bad file descriptor on my vps but not on my desktop |
19:14:01 | FromDiscord | <willyboar> whip gets almost 185k |
19:14:16 | zedeus | hah, you need jester#head to fix that, dom hasn't made release with my fix in it :) |
19:14:58 | FromDiscord | <willyboar> rosencrantz gets almost 30k with asynchttp |
19:16:50 | FromDiscord | <willyboar> i would love to see how rosencrantz would go with httpbeast support |
19:18:40 | Zevv | disruptek: I'm giving up on the continuation stuff for now |
19:19:52 | Zevv | I've got too much going on |
19:25:13 | * | vicfred joined #nim |
19:41:42 | FromDiscord | <willyboar> I get this error in my app when compiling with arc |
19:41:56 | FromDiscord | <willyboar> ``` /Users/nikos/.nimble/pkgs/parsetoml-0.5.0/parsetoml.nim(1898, 5) Error: undeclared identifier: 'deepCopy' ``` |
19:42:23 | Zevv | yeah, it's not lying |
19:42:27 | Zevv | there is no deepCopy for arc |
19:42:48 | FromDiscord | <willyboar> yes it works with boehm |
19:43:41 | FromDiscord | <willyboar> thank you |
19:45:42 | Zevv | wow I just noticed my mqtt lib suddenly has a broker as well |
19:45:52 | Zevv | that's what you get from giving full repo permissions to strangers I guess |
19:53:55 | luis_ | Yardanico: it should be the readBuffer from io? I am aiming at reading text passed in a bash pipe into my nim program. |
19:54:50 | luis_ | something like echo "text" | program.nim |
20:05:46 | * | NimBot joined #nim |
20:12:38 | Prestige | Wish there was a decent way to deal with circular deps. I can solve it by putting everything in a single file but, that kind of sucks doing |
20:12:59 | Yardanico | did you try https://nim-lang.org/docs/manual_experimental.html#package-level-objects ?:P |
20:14:59 | Prestige | Hmm sounds a little hacky but let's see if it works |
20:16:46 | * | kenran quit (Ping timeout: 256 seconds) |
20:24:22 | Prestige | Okay I think I don't understand this setup, can't get it to compile: https://play.nim-lang.org/#ix=2pcH |
20:24:49 | * | tdc quit (Ping timeout: 264 seconds) |
20:28:41 | * | nerthus quit (Remote host closed the connection) |
20:31:46 | * | luis_ quit (Ping timeout: 256 seconds) |
20:43:30 | * | bung quit (Quit: Lost terminal) |
20:50:37 | * | Senny joined #nim |
20:59:37 | * | Cthalupa quit (Ping timeout: 264 seconds) |
21:00:52 | * | waleee-cl joined #nim |
21:01:55 | * | Cthalupa joined #nim |
21:11:57 | leorize[m] | Prestige: it works in the nimble package scope |
21:12:02 | leorize[m] | those two files has to be in a nimble package |
21:12:28 | Prestige | oh it has to be the name of the nimble package? okay |
21:12:32 | leorize[m] | actually only `a` has to be in a nimble package :P |
21:12:55 | * | adnan338 quit (Ping timeout: 260 seconds) |
21:15:13 | * | solitudesf quit (Ping timeout: 264 seconds) |
21:16:12 | * | aeverr quit (Ping timeout: 256 seconds) |
21:27:12 | * | PMunch joined #nim |
21:34:35 | * | Trustable joined #nim |
21:38:00 | * | unihernandez22 joined #nim |
22:04:04 | * | tane quit (Quit: Leaving) |
22:05:49 | * | PMunch quit (Ping timeout: 246 seconds) |
22:07:59 | * | unihernandez22 quit (Ping timeout: 245 seconds) |
22:15:51 | FromGitter | <ynfle> Is there a `parseStmt` version that isn't `compileTime` just for parsing? |
22:31:52 | * | PMunch joined #nim |
22:38:13 | Prestige | Okay, Nimdow is finally in it's beta release: https://github.com/avahe-kellenberger/nimdow just finished up the status bar |
22:40:57 | * | Vladar quit (Quit: Leaving) |
23:02:31 | PMunch | Nice! |
23:04:08 | Prestige | Thanks! |
23:05:23 | * | rockcavera joined #nim |
23:11:36 | * | lritter quit (Quit: Leaving) |
23:45:11 | PMunch | Nice Reddit post by the way :) |
23:48:12 | Prestige | Thanks - I'm planning on doing a video about the release on my channel (and showing the features, how to set it up, etc) |
23:48:27 | PMunch | That'd be cool |
23:48:32 | * | oddp quit (Ping timeout: 265 seconds) |
23:49:07 | PMunch | Oh, well time for bed |
23:49:08 | * | PMunch quit (Quit: leaving) |
23:53:17 | * | oddp joined #nim |
23:56:06 | * | ftsf joined #nim |
23:57:00 | * | Trustable quit (Remote host closed the connection) |