00:01:20 | ryukoposting | (update on GC_ref extravaganza: maybe I should just not be lazy and redesign my audio buffer queueing) |
00:02:02 | * | Jesin joined #nim |
00:03:00 | wgetch | well thanks again for the help. finally parsed this binary format that eluded me for months :P |
00:03:12 | leorize[m] | looks like the 1.2 release bought a lot of newcomers here :) |
00:03:15 | ryukoposting | nice |
00:03:33 | ryukoposting | and every single one wants to know how to turn an array of bytes into a string |
00:03:53 | wgetch | ^_^ |
00:04:16 | IWSnim | But wow I'm glad I've found this lang. After doing the same in rust and in C this is a real breath of fresh air |
00:05:06 | IWSnim | So thanks for the answers guys :) |
00:05:22 | FromDiscord | <Rika> what was wrong with rust or C??? |
00:05:30 | ryukoposting | for sure, there's always someone here to help |
00:05:53 | IWSnim | Nothing really wrong with them, it just didn't click like this has |
00:06:19 | ryukoposting | C is very good at a certain set of tasks that it was designed to do, and it's pretty terrible at everything else |
00:06:37 | FromDiscord | <Rika> C is good if the programmer is π |
00:06:51 | ryukoposting | C is my job lol |
00:07:43 | IWSnim | my primary lang is PHP (ducks), but I am loathe to do anything that involves sockets or bit-heavy things like protocol emulation in it |
00:07:55 | FromDiscord | <Rika> quack |
00:07:58 | Demos[m] | I hear modern PHP is a pretty nifty language |
00:08:13 | IWSnim | Yea, it's gotten a *lot* better in the past few years |
00:08:29 | FromDiscord | <Rika> companies are stubborn to update though arent they lol |
00:08:30 | ryukoposting | for a long time it was the constant subject of ridicule |
00:08:37 | IWSnim | sadly lots of the world is still running on ancient versions and there's so much "bad idea tutorials" out there |
00:08:51 | IWSnim | like the first tutorials you find for forms + mysql are like |
00:08:56 | leorize[m] | nim used to have a php backend fwiw :p |
00:09:00 | * | whaletechno joined #nim |
00:09:30 | ryukoposting | it's like how junior car journalists pick on the pontiac aztek, it's an easy target. PHP was every new hacker news member's punching bag |
00:09:38 | Demos[m] | hmm. I almost always learn a new language by reading the manual cover-to-cover (some exceptions like c++) |
00:10:02 | IWSnim | INSERT INTO users (name, password) VALUES (" . $_POST['name'] . ", " . $_POST['password'] . ")"; |
00:10:05 | IWSnim | or something |
00:10:06 | Demos[m] | and kinda fortran, unfortinately the manual is written in standardese and there are no resources for really learning modern fortran other then its standard |
00:10:09 | FromDiscord | <Rika> `PHP was every new hacker news member's punching bag` i fear for nim |
00:10:18 | IWSnim | and that's obviuosly horrific |
00:10:24 | IWSnim | but that's the state of PHP tutorials. |
00:10:39 | ryukoposting | nim will never be that, too fringe |
00:10:41 | IWSnim | That or you go straight to laravel or Symfony and quickly explode your DB due to lazy loading ORMs |
00:10:47 | Demos[m] | fun fact. I wrote a nim module that let you write that but always extracted the subs to paramaterized queries |
00:11:02 | leorize[m] | you can read c++ spec cover to cover if you're crazy enough |
00:11:09 | Demos[m] | oh, I know |
00:11:16 | FromDiscord | <Rika> `nim will never be that, too fringe` not sure if good or not |
00:11:21 | Demos[m] | (my dayjob is a c++ standard library implementer) |
00:12:19 | IWSnim | Yea, I got my toy projects. I'm super excited to play around with raw sockets and implement IS-IS or something |
00:12:43 | IWSnim | this looks perfect for small stuff like that |
00:13:42 | Demos[m] | grrr I don't like IS-IS |
00:13:55 | Demos[m] | and not just because it's the most unfortinately named protocol out there |
00:14:12 | IWSnim | CLNS got ya down? |
00:15:05 | Demos[m] | prefer OSPF3 |
00:15:17 | Demos[m] | since open implementations are a little better |
00:15:49 | IWSnim | Yea can't argue there |
00:16:04 | IWSnim | I've always used quagga + BGP if I needed an appliance to peer with the network though |
00:16:07 | IWSnim | like Anycast dns or whatever. |
00:16:43 | IWSnim | haven't tried opsfd or whatever else is there in Zebra? etc |
00:20:09 | ryukoposting | if I have a global non-ref object, is that safe for another thread to stick its fingers into, provided I handle synchronization right? |
00:30:55 | leorize[m] | yes, as long as the gc is not involved, you're fine |
00:37:22 | ryukoposting | pray to the nim gods that I've finally found a way to make this stupid thing not segfault |
00:38:47 | ryukoposting | okay, loop 2, no explosion yet |
00:48:20 | * | pbb quit (Ping timeout: 265 seconds) |
00:48:36 | * | pbb joined #nim |
00:53:46 | * | krux02_ is now known as krux02 |
00:58:24 | * | Zectbumo quit (Remote host closed the connection) |
00:59:44 | * | dwdv quit (Ping timeout: 256 seconds) |
01:13:17 | * | dongbei joined #nim |
01:13:20 | dongbei | hi |
01:13:25 | dongbei | i was just wondering why they get so much praise. To me they only seem like a way to make a domain specific syntax but don't do anything super important over anything that functional programming concepts can accomplish. Hopefully someone can explain how my point of view is flawed. I don't mean to start a fight btw, just lost. |
01:13:36 | dongbei | i have a question about macros and why they're important. |
01:13:44 | dongbei | out of order, please excuse me |
01:14:25 | dongbei | i'm still not grasping the importance of macros so I'd like some help |
01:20:53 | * | chemist69 quit (Ping timeout: 265 seconds) |
01:22:40 | * | chemist69 joined #nim |
01:22:56 | dongbei | hi chemist |
01:24:39 | leorize | dongbei: so for starters, it let you write your own features without explicit compiler support :) |
01:25:06 | leorize | a big feature that's the prime example of this is Nim's async-await system |
01:25:25 | leorize | implemented completely using macros, no special casing in the compiler was used, at all |
01:26:36 | leorize | this also bring up the possibility of creating nice syntax and efficient code at the same time |
01:26:41 | leorize | !repo weave |
01:26:42 | disbot | https://github.com/mratsim/weave -- 9weave: 11A state-of-the-art multithreading runtime: message-passing based, fast, scalable, ultra-low overhead 15 134β 8π΄ |
01:27:40 | leorize | and if you're used to functional programming things such as pattern matching, we got you covered |
01:27:41 | leorize | !repo gara |
01:27:42 | disbot | https://github.com/alehander92/gara -- 9gara: 11 15 63β 5π΄ |
01:27:50 | FromDiscord | <Bawbby> quick q: how do i pass --threads:on for compile flags with nimble? |
01:29:45 | dongbei | leorize: thank you, I'm reading about those projects right now |
01:29:51 | leorize | @Bawbby: add it to your config.nims file |
01:31:38 | FromDiscord | <Bawbby> never used a config.nims before, how would I do that? |
01:32:00 | leorize | make a file named config.nims in your project |
01:32:11 | leorize | then add --threads:on in there |
01:33:00 | leorize | the syntax of this file is nimscript |
01:33:10 | leorize | https://nim-lang.org/docs/nims.html |
01:33:16 | leorize | you can read more over here |
01:33:30 | FromDiscord | <Bawbby> alright, I'll take a look at that, thanks. |
01:36:51 | FromDiscord | <KingDarBoja> Oh, TF2 engineer is here! |
01:41:15 | * | cjb` joined #nim |
01:41:33 | ryukoposting | FINALLY audio queueing works, explosion-free |
01:41:36 | disruptek | use .cfg instead, please. |
01:41:50 | * | cjb quit (Ping timeout: 250 seconds) |
01:47:57 | * | cjb` quit (Quit: ERC (IRC client for Emacs 26.3)) |
01:49:43 | * | dongbei quit (Ping timeout: 265 seconds) |
01:51:26 | * | krux02 quit (Remote host closed the connection) |
01:52:14 | FromDiscord | <KingDarBoja> https://play.nim-lang.org/#ix=2gNh |
01:52:51 | FromDiscord | <KingDarBoja> Trying to pass a generic procedure to some type procedure but getting the error on the playground (which is the same I got locally on some different setup) |
01:53:22 | FromDiscord | <KingDarBoja> The procedure argument will be different procedures with different return types |
01:53:47 | FromDiscord | <KingDarBoja> But those return values will be used by the generic one to perform the same operation |
01:54:42 | FromDiscord | <KingDarBoja> Forgive me if I didn't make it understandable π |
01:54:51 | * | dongbei joined #nim |
01:57:44 | leorize | KingDarBoja: here you go: https://play.nim-lang.org/#ix=2gNj |
01:58:21 | leorize | to pass generic params with UFCS, use `[:T]` |
02:01:46 | FromDiscord | <KingDarBoja> UFCS? |
02:02:03 | FromDiscord | <Rika> TIL |
02:02:13 | FromDiscord | <Rika> nice, been trying to figure out how to do that for so long |
02:02:18 | leorize[m] | method call syntax |
02:02:25 | FromDiscord | <Rika> why the weird syntax though? |
02:02:32 | * | ryukoposting quit (Quit: Leaving) |
02:03:01 | * | ryan_ joined #nim |
02:03:13 | * | ryan_ is now known as number_two |
02:03:20 | leorize[m] | to not be ambiguous w index addressing |
02:03:43 | * | FromDiscord <KingDarBoja> Uniform Function Call Syntax (UFCS) |
02:03:51 | number_two | Hey all, congrats on 1.2! |
02:05:53 | FromDiscord | <KingDarBoja> Replaced the `:int` by `:Student` (and did the same on my local code) and got pretty much same error |
02:05:57 | FromDiscord | <KingDarBoja> "type mismatch: got <Classroom, int literal(9), proc (self: Classroom): int{.noSideEffect, gcsafe, locks: 0.}>" |
02:06:11 | FromDiscord | <KingDarBoja> But expected this -> "proc (self: Classroom, someParam: int, a: proc (self: Classroom): Student{.closure.}): seq[Student]{.noSideEffect, gcsafe, locks: 0.}" |
02:06:41 | FromDiscord | <KingDarBoja> I dont see the difference... |
02:08:32 | * | dongbei quit (Ping timeout: 258 seconds) |
02:10:40 | * | ryan_ joined #nim |
02:10:46 | * | ryan_ is now known as tanger |
02:12:59 | * | number_two quit (Ping timeout: 256 seconds) |
02:18:14 | * | dongbei joined #nim |
02:22:39 | * | dongbei quit (Ping timeout: 250 seconds) |
02:23:04 | leorize | KingDarBoja: int vs Student |
02:27:06 | * | endragor joined #nim |
02:34:21 | * | muffindrake quit (Ping timeout: 265 seconds) |
02:36:08 | * | dongbei joined #nim |
02:36:17 | disruptek | ~news |
02:36:18 | disbot | news: 11the #nim-news channel has a Nim news feed of updates to pull requests, issues, and packages. -- disruptek |
02:36:31 | * | muffindrake joined #nim |
02:46:04 | disruptek | supakeen: thanks for that pr. |
02:57:04 | FromDiscord | <Rika> @KingDarBoja your proc that your passing returns an int, when it expects a Student |
02:57:18 | * | dongbei quit (Read error: Connection reset by peer) |
02:59:22 | * | a_chou joined #nim |
03:00:29 | * | a_chou quit (Client Quit) |
03:01:16 | * | a_chou joined #nim |
03:02:58 | * | a_chou quit (Client Quit) |
03:03:55 | FromDiscord | <KingDarBoja> π€¦ββοΈ |
03:03:59 | FromDiscord | <KingDarBoja> You're right |
03:06:25 | * | drewr quit (Ping timeout: 240 seconds) |
03:09:26 | * | endragor quit (Remote host closed the connection) |
03:09:53 | * | endragor joined #nim |
03:10:30 | * | endragor quit (Remote host closed the connection) |
03:10:39 | * | endragor joined #nim |
03:16:37 | FromDiscord | <Rika> lmaoooo |
03:22:12 | * | chemist69 quit (Ping timeout: 265 seconds) |
03:23:08 | * | chemist69 joined #nim |
03:24:45 | * | Zectbumo joined #nim |
03:26:30 | FromGitter | <eliezedeck> https://play.nim-lang.org/#ix=2gL9 β @dom96 @Araq : all versions of Nim is affected by this bug, not just latest or 1.x ... I would say this is a *priority bug* (unless there is a define or something that I should use instead), and I'm wondering how this got past the 1.x ... I mean it's not uncommon to have multiple await on a single future value. I'm currently writing a program that does exactly this, and it's |
03:26:30 | FromGitter | ... basically broken because only the last await will be triggered. @dom96 as per your suggestion, where in the source code should I go in order to patch this? I should be able to send a PR, hopefully. |
03:27:01 | * | Tlongir joined #nim |
03:30:03 | * | tanger quit (Ping timeout: 256 seconds) |
03:34:10 | FromDiscord | <KingDarBoja> But still doing that on my code (the local one) yields something similar, I do better check again to see if I am missing something |
03:36:24 | FromDiscord | <KingDarBoja> I think it is because I am trying to get the value of the passed procedure into the sequence, perhaps? https://play.nim-lang.org/#ix=2gNF |
03:39:01 | FromDiscord | <Rika> one moment, ill look into it |
03:40:01 | FromDiscord | <Rika> humbleSample returns a seq[proc], not a seq[T], i think you didnt call the proc is why |
03:40:20 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=2gNG here @KingDarBoja |
03:41:42 | FromGitter | <ksandvik_gitlab> It it deliberate that nim source files with a dash, like foo-thing.nim is considered a module? |
03:42:47 | FromDiscord | <KingDarBoja> Oh... |
03:43:05 | FromDiscord | <KingDarBoja> I thought the procedure was being called as soon as the parameter refering to that was called |
03:56:11 | FromGitter | <eliezedeck> @dom96 @Araq so I posted a bug report about it: https://github.com/nim-lang/Nim/issues/13889 |
03:56:13 | disbot | β₯ Critical: 1 completed Future, multiple await: Only 1 await will be awakened (the last one) ; snippet at 12https://play.nim-lang.org/#ix=2gNK |
03:59:26 | FromGitter | <eliezedeck> @ksandvik_gitlab I believe so ... it seems a bit limiting too from my point of view, but I haven't written big modules yet to be hindered by it so far ... largest file I wrote so far is about 500 lines of code, I'm just beginning to use Nim now after years of not using it |
04:00:03 | FromGitter | <eliezedeck> I think, every file is a module ... or, at least, that's how I feel |
04:00:17 | FromGitter | <ksandvik_gitlab> OK, just an interesting gotcha using a '-' in a file name. |
04:00:40 | FromGitter | <eliezedeck> simply because every-file has its own context, not visible to other files, unless exported ... to me, that's a module |
04:01:35 | FromGitter | <ksandvik_gitlab> I like Nim's module system as it's not over-engineered, usually you just want a path wherefrom to import and annotate vars or functions with a *. |
04:02:41 | FromGitter | <eliezedeck> in the old days, I believe it was a convention (I might be wrong) to not use any dash or underscore for file names ... like, asyncdispatch, not async-dispatch; I suppose that is still the case nowadays |
04:02:50 | FromGitter | <eliezedeck> indeed, it's simple and convenient |
04:03:24 | FromGitter | <ksandvik_gitlab> I like something to separate meaning in file names but I could live with this. |
04:03:37 | * | xace quit (Ping timeout: 250 seconds) |
04:06:02 | * | supakeen quit (Quit: WeeChat 1.9.1) |
04:06:38 | * | supakeen joined #nim |
04:08:34 | leorize | @ksandvik_gitlab: module name must be a valid identifier |
04:09:04 | leorize | the restriction can be lifted, but no one really pressed it so it's there :p |
04:16:20 | FromGitter | <ksandvik_gitlab> OK, was just interesting to see that the warning was mentioned with a single .nim file with no modules, but if every file is basically a module then it makes sense. |
04:17:07 | * | uu91 quit (Ping timeout: 260 seconds) |
04:18:09 | FromDiscord | <Rika> i like how nims modules are super straightforward |
04:18:25 | FromDiscord | <Rika> breath of fresh air from something like pythons system |
04:23:24 | * | uu91 joined #nim |
04:31:03 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
04:31:50 | * | nsf joined #nim |
04:48:32 | * | dongbei joined #nim |
04:52:06 | * | rockcavera quit (Remote host closed the connection) |
05:04:19 | FromDiscord | <KingDarBoja> Good night everyone, π |
05:11:28 | FromDiscord | <Rika> gn |
05:14:58 | * | narimiran joined #nim |
05:21:05 | * | Pixeye joined #nim |
05:36:25 | * | dongbei_ joined #nim |
05:39:06 | * | dongbei quit (Ping timeout: 256 seconds) |
05:41:18 | * | dongbei_ quit (Ping timeout: 256 seconds) |
05:41:31 | * | dongbei joined #nim |
05:46:16 | * | andinus joined #nim |
05:46:30 | * | xace joined #nim |
05:58:36 | supakeen | Good morning :) |
06:03:47 | * | PMunch joined #nim |
06:05:33 | FromDiscord | <Rika> good morning |
06:05:59 | FromGitter | <eliezedeck> good morning :) |
06:19:03 | * | leorize quit (Ping timeout: 240 seconds) |
06:20:52 | * | uu91 quit (Ping timeout: 265 seconds) |
06:21:20 | * | leorize joined #nim |
06:22:19 | * | dddddd quit (Ping timeout: 256 seconds) |
06:23:23 | * | uu91 joined #nim |
06:24:23 | * | uu91 quit (Read error: Connection reset by peer) |
06:24:38 | * | uu91 joined #nim |
06:25:41 | * | kenran joined #nim |
06:31:43 | FromDiscord | <Benumbed> oh my god, whoever added dark mode to the docs by default, I am your biggest fan |
06:31:46 | FromDiscord | <Benumbed> my eyes love you |
06:32:15 | FromDiscord | <Rika> it was added on release of 1.2 |
06:32:29 | FromGitter | <eliezedeck> indeed |
06:33:16 | FromDiscord | <Benumbed> I know it was added in 1.2, but someone had to make that decision and fix the docs to do it |
06:33:39 | FromDiscord | <Benumbed> And I wanted to express my appreciation to that person, whomever they are |
06:33:53 | FromDiscord | <Rika> devel docs were like that before 1.0.4 afaik |
06:41:25 | * | arecaceae quit (Remote host closed the connection) |
06:41:51 | * | arecaceae joined #nim |
06:59:50 | * | solitudesf joined #nim |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:04:44 | * | gmpreussner joined #nim |
07:27:33 | * | dongbei quit (Quit: leaving) |
07:37:44 | * | wowi42 joined #nim |
07:41:07 | * | Vladar joined #nim |
07:41:19 | * | hax-scramper quit (Read error: Connection reset by peer) |
07:41:42 | * | hax-scramper joined #nim |
07:44:09 | * | voltist joined #nim |
07:46:17 | * | hax-scramper quit (Ping timeout: 260 seconds) |
07:46:36 | * | hax-scramper joined #nim |
07:48:46 | voltist | Is there a proc/macro in the standard library that takes a string and a series of arguments, then executes the proc of that name with those args? |
07:50:47 | FromDiscord | <Rika> no, but a macro is doable |
07:51:24 | voltist | Ok I might give it a go |
07:57:45 | * | hax-scramper quit (Ping timeout: 258 seconds) |
07:58:18 | * | hax-scramper joined #nim |
08:00:16 | FromDiscord | <Rika> https://play.nim-lang.org/#ix=2gOj how would i go by this more elegantly? |
08:01:01 | FromDiscord | <Rika> `current.hitObject is HitObject` but can be `of AnySubtype` |
08:03:09 | axion | That is a good case for `case` |
08:03:21 | FromDiscord | <Rika> can you even case this? |
08:03:50 | FromDiscord | <Rika> also youre not on mumble today |
08:04:32 | axion | Nope, and won't be |
08:04:38 | FromGitter | <Vindaar> @voltist: I fixed a lot of things yesterday and it should work for you now. I haven't merged the PR yet, but will probably do it later today. I added the neural spike plots as recipes here: β https://github.com/Vindaar/ggplotnim/blob/arraymancerBackend/recipes.org#creating-a-neural-spike-plot-in-ggplotnim |
08:05:49 | voltist | V1ndaar: I'm getting an error now about there not being a data scale for setting ticks or something? I will be at my computer in a bit if you want specifics |
08:05:51 | leorize | @Rika: use a method |
08:07:07 | FromGitter | <Vindaar> @voltist: Did you pull the current changes from the branch? |
08:07:22 | FromGitter | <Vindaar> That error usually means that your x or y axis has no data |
08:07:38 | FromGitter | <Vindaar> which could of course be a bug |
08:08:16 | FromDiscord | <Rika> leorize: all but Circle are fields, Circle's the only one that's a proc |
08:08:33 | FromDiscord | <Rika> hmm |
08:08:34 | FromDiscord | <Rika> okay |
08:09:30 | FromGitter | <Vindaar> @voltist: and btw why do you write my name with a 1 instead of i? And if possible add an `@` before my name, because otherwise it doesn't show up as a ping on gitter |
08:18:34 | * | hax-scramper quit (Read error: Connection reset by peer) |
08:18:48 | * | hax-scramper joined #nim |
08:20:07 | FromDiscord | <Benumbed> Um, has anyone else had problems with httpclient and HTTP 204 responses? |
08:20:26 | FromDiscord | <Benumbed> When I get one, the client just hangs indefinitely |
08:20:28 | FromDiscord | <Rika> what's the issue exactly |
08:20:40 | FromDiscord | <Benumbed> I just said what it was ^ π |
08:21:04 | FromDiscord | <Rika> yeah, that was sent before i saw the 2nd mesasge |
08:21:05 | FromDiscord | <Benumbed> Extend hands, recieve HTTP 204, and hang |
08:22:36 | FromGitter | <Vindaar> oh and @axion if you wondered why I asked about your name a few weeks ago, look for instance at: β https://github.com/Vindaar/ggplotnim/blob/arraymancerBackend/recipes.org#tell-me-an-axion-story-without-telling-it-to-me-story |
08:25:42 | FromDiscord | <Benumbed> I think the client's expecting to read body data when it can't, because I left a process running and it eventually fell through |
08:32:16 | FromDiscord | <Benumbed> Yep, found it |
08:32:56 | FromDiscord | <Benumbed> It's trying to `recvFull` on a connection that won't give it any data |
08:38:45 | FromDiscord | <exelotl> @Benumbed I believe it was Yewpad who added the dark theme, but I can't see them on discord now |
08:46:48 | voltist | @Vindaar Ah my fonts must be weird because it looks like a 1 to me |
08:51:53 | * | dwdv joined #nim |
08:54:39 | FromDiscord | <Benumbed> Well I just had to hack the stdlib of my Nim install to get things working again, that's a first π |
08:55:03 | FromDiscord | <Rika> you can submit the fix as a pr to nim's code |
08:55:19 | FromDiscord | <Benumbed> Yeah, I know |
08:55:36 | FromDiscord | <Benumbed> I already dropped a ticket that shows the fix, but I won't submit a PR without a test |
08:55:48 | FromDiscord | <Benumbed> which means pulling the repo and figuring out all the contributor stuff |
08:56:01 | FromDiscord | <Benumbed> Which I will do eventually, but not tonight |
08:58:18 | FromGitter | <Vindaar> @voltist: haha, no worries |
08:58:28 | FromDiscord | <Benumbed> Hmmm it appears httpclient has no tests |
08:58:32 | FromDiscord | <Benumbed> not that I can find anyway... |
08:59:15 | * | aEverr joined #nim |
09:04:16 | FromDiscord | <Benumbed> NM I'm an idiot |
09:04:42 | FromDiscord | <Benumbed> Ok well, now that I've found everything I'll do something about this tomorrow |
09:12:29 | voltist | @Vindaar Nah still getting that error "A data scale is required to calculate tick positions!" |
09:18:24 | FromGitter | <Vindaar> can you post a paste of the ggplot call and the output of your input DF? |
09:23:28 | FromGitter | <Vindaar> by output of the DF I mean just printing the DF of course |
09:23:45 | voltist | Yeah I will in a moment. Could the problem be caused by all the data points being identical? Eg, only one x value and y value across them |
09:24:03 | FromGitter | <Vindaar> oh, that's a good point indeed |
09:24:13 | voltist | Oh wait no one of them is different |
09:24:17 | voltist | So it can't be that |
09:24:44 | FromGitter | <Vindaar> but that could have indeed been a possible explanation, because in that case min == max, which might run into trouble somewhere |
09:26:00 | voltist | @Vindaar: Code and DF https://pastebin.com/YxUrqULT |
09:26:52 | * | Tlongir is now known as the_fool |
09:27:01 | FromGitter | <Vindaar> thanks, give me a minute |
09:27:16 | voltist | Of course there is only one neuron (rows on the x axis) in this data |
09:27:28 | voltist | *rows along the X axis |
09:28:52 | FromGitter | <Vindaar> yep, that I think is the problem |
09:29:13 | voltist | Oh? |
09:31:07 | FromGitter | <Vindaar> oh |
09:31:22 | FromGitter | <Vindaar> I was just typing up what the bug is, when I noticed that your `ylim` call is `ylim(1, -1)` |
09:31:54 | FromGitter | <Vindaar> The signature is `func ylim*[T, U: SomeNumber](low: T, high: U, outsideRange = ""): Theme` |
09:32:03 | FromGitter | <Vindaar> that's why it gets confused |
09:32:17 | voltist | Ah |
09:32:25 | FromGitter | <Vindaar> I could of course determine the min and max value by comparing low and high |
09:33:18 | voltist | Unfortunately the problem persists when that is changed to `ylim(-1, 1)` |
09:33:36 | FromGitter | <Vindaar> yeah, I had a bug in my recreation of your code, haha |
09:33:42 | FromGitter | <Vindaar> the point still stands though |
09:34:19 | FromGitter | <Vindaar> the problem now is that indeed it cannot determine a data scale, because neurons is 0 everywhere. There is bug though, namely that the call to `ylim` should override that scale |
09:34:29 | FromGitter | <Vindaar> Should be an easy fix |
09:35:17 | FromGitter | <Vindaar> without the ylim call the y scale is not well defined, since it doesn't have a range deducible from the data. β Well, it does, but only if one takes into account `ymin`, `ymax`, which we should, but don't right now for some reason. That's bug number 2 |
09:35:23 | FromGitter | <Vindaar> bug number 2 I was aware of though |
09:35:35 | FromGitter | <Vindaar> (that's the comment already mentioned behind the ylim call) |
09:35:45 | voltist | I also had the ymin and ymax in the geom_linerange the wrong way round (1 in min and -1 in max), but changing that doesn't fix it either |
09:35:58 | FromGitter | <Vindaar> I'll fix both |
09:36:12 | FromGitter | <Vindaar> I'll let you know once I'm done. Shouldn't take long |
09:36:34 | voltist | Cool |
09:40:41 | * | liblq-dev joined #nim |
09:43:05 | dom96 | eliezedeck: FWIW I and many others have written large async programs without running into this bug, so I wouldn't call it "critical" |
09:43:30 | dom96 | It's not common that you create a global future and then await it in an async proc |
09:47:26 | FromGitter | <eliezedeck> Well, I don't agree that "it's not common" ... and it's critical because it had fundamentally incorrect behavior for such a trivial thing ... critical also because it is already taken for granted that a future when complete must yield its value/error |
09:47:52 | FromGitter | <eliezedeck> just to give you an idea: |
09:48:55 | dom96 | async has been in Nim for many years now |
09:49:00 | dom96 | if it was common we would have seen this bug |
09:49:05 | dom96 | someone else would have reported it |
09:49:29 | dom96 | it's quite likely that what you want to implement is typically implemented differently by everyone that used async await |
09:50:54 | FromDiscord | <clyybber> well, he encountered it and it was critical there |
09:51:03 | FromGitter | <eliezedeck> I'm creating a GraphQL client right now, it is supposed to be always trying to reconnect, and it should be transparent to its user whether the client is connected or not ... so: the client is allowed to send any GraphQL query they want, it's just not going to be executed until there is connectivity. So, there will be several queries `await`ing one single future (when the client is connected). β Now, tell me: how |
09:51:03 | FromGitter | ... uncommon is that kind of scenario ... sure, it is debatable, but *what's important is correctness, not that it's common or not* |
09:51:11 | FromDiscord | <clyybber> yeah |
09:52:32 | FromDiscord | <Rika> i agree that how common something is done does not mean it is not to be considered, thats like disregarding edgecases because theyre just edgecases |
09:52:43 | dom96 | I'm not saying we should disregard it |
09:52:50 | dom96 | I am just responding to eliezedeck's comments above |
09:53:03 | dom96 | where they were speculating about how this could have gone past 1.0 |
09:53:14 | FromGitter | <eliezedeck> @Rika I couldn't say it better myself |
09:54:31 | supakeen | @eliziedeck be careful with that, if a connection gets lost you could end up queuing a *lot* of requests that will all suddenly go through :) |
09:54:42 | supakeen | I'd think about thundering herds and backpressure. |
09:54:44 | FromGitter | <eliezedeck> @dom96 I don't know how you would implement this above scenario yourself if you were on my shoes, but I sure am not going to do a lot of `sleepAsync` just to poll something |
09:54:49 | supakeen | Or at least those are terms to look at :) |
09:54:51 | Araq | "(I don't trust the Nim CI nowadays)." FUD machine |
09:54:58 | Araq | the CI is better than ever before |
09:56:00 | dom96 | eliezedeck: I don't think I ever ran into a case where a client should always be trying to reconnect, you're either connected or not, if you're not connected and you want a response why not reconnect then? Why do you need to constantly be reconnecting? |
09:56:15 | FromGitter | <eliezedeck> @supakeen ... it is a native GraphQL client, for mobile device ... so, it will be coupled with a Flutter app; so, yes, I'll try to be careful not to queue many requests, thanks |
09:57:10 | dom96 | If you have something like an IRC client, which implements reconnection logic then you are always asking for data from the server using `recv` |
09:57:17 | dom96 | `recv` returns "" and you know to reconnect |
09:57:36 | dom96 | if you have something like HTTP, you call `get`, if the HTTP client has a connection open it reuses it |
09:57:38 | dom96 | if not it reconnects |
09:58:09 | FromGitter | <eliezedeck> @dom96 I'm not really good at explaining, sorry ... it's a GraphQL library (client might be misleading) ... it's using Websocket also, not POST requests ... so, it needs to be connected before it can send any GraphQL query |
09:58:13 | * | sentreen_ joined #nim |
09:58:34 | dom96 | eliezedeck: it's exactly the same when it comes to Websockets |
09:59:01 | FromGitter | <eliezedeck> right, and the goal is: Flutter app shouldn't care about it |
09:59:12 | supakeen | Araq: Is there some sort of coverage report or such to easily counter that type of FUD? |
09:59:20 | supakeen | Or did they mean something else. |
09:59:50 | FromGitter | <eliezedeck> it will just queue a bunch of string to execute (the query) ... the library will try to reconnect on its own, and at the same time, it will queue queries to be executed as soon as the library is connected |
10:00:36 | FromDiscord | <Rika> and i think what dom is saying is that the logic for reconnecting can be written into the library |
10:00:41 | dom96 | eliezedeck: I'll be honest: it sounds to me like the mechanism you've fixed is not necessary, but until I see the code it's hard to say for certain. |
10:00:41 | FromDiscord | <Rika> and he doesnt see the issue i dont think |
10:01:18 | dom96 | supakeen, Araq: every other PR I see shows the CI failing for unrelated reasons, how can I trust that? |
10:01:31 | FromGitter | <eliezedeck> @Rika it IS in the library |
10:01:46 | FromDiscord | <clyybber> dom96: > it sounds to me like the mechanism you've fixed is not necessary |
10:01:52 | FromDiscord | <clyybber> Do you mean the fix is not necessary? |
10:02:05 | dom96 | No. I mean eliezedeck's use case doesn't call for it |
10:02:13 | dom96 | And it's certainly not "critical" |
10:02:25 | dom96 | since there are alternative ways to achieve it |
10:02:29 | FromGitter | <eliezedeck> @dom96 :) well, let's agree to disagree |
10:02:58 | dom96 | Sure :) |
10:03:14 | dom96 | I want it to be fixed anyway, I'm slightly concerned about what it might break but I suppose we'll find out :) |
10:03:47 | * | krux02 joined #nim |
10:04:01 | FromGitter | <Vindaar> @voltist: ok, I pushed the fix now. β You would right now still run into trouble if you only set e.g. `yMin`, but not `yMax`, since all neurons would be `0` still and the resulting data scale would end up just taking into account `yMin`. I still need to come up with a more reliable way to allow scales of (0, 0) |
10:05:43 | FromGitter | <Vindaar> also the `ylim` does not matter in this case after all, since the bug came from the post processing phase, where the theme (which is what `ylim` is part of), plays no part. It's a thing I need to think about whether that is required. I rather have to avoid calling `calcTickLocations` in the post processing phase when the scale is invalid. But anyways, that's just internal details :) |
10:05:46 | FromGitter | <eliezedeck> let's think about those people who see Twitter post, and they say, "well... Nim v1.2.0 ... let me try that" ... oh, they are Golang programmers, used to writing codes that are awaiting on a single channel, and they end-up awaiting on a single future in Nim ... then they bang their head on the wall and they think... "well... this Nim thing is pretty unstable" β I find beauty and value in Nim, and other people should |
10:05:46 | FromGitter | ... see it too ... but trivial bugs like these are *critical* in that they drive out adopters |
10:05:59 | FromGitter | <eliezedeck> @dom96 I believe we do have tests right? |
10:06:10 | FromDiscord | <clyybber> yeah we do |
10:06:14 | dom96 | yes, but not for this issue specifically |
10:06:15 | voltist | Ok I'll give it a go shortly |
10:06:17 | FromDiscord | <clyybber> and I agree that its critical in this case |
10:06:51 | FromGitter | <eliezedeck> in any case, it's a PR, I trust you can assert its quality, and you're free to do whatever you want |
10:07:07 | FromDiscord | <clyybber> eliezedeck: Can you split the PR up? |
10:07:09 | * | tane joined #nim |
10:07:29 | dom96 | Okay, let's stop. Arguing about whether it's critical or not is a waste of time. We'll be merging it, that's all that matters |
10:07:34 | voltist | Hmmm, who would have thought that doing 30 million regex searches would take a long time... |
10:07:35 | dom96 | we can even back port to 1.0.x |
10:07:47 | FromDiscord | <clyybber> We should, yeah |
10:07:53 | FromGitter | <alehander92> :) |
10:07:54 | FromGitter | <alehander92> morrning |
10:07:55 | FromGitter | <eliezedeck> @dom96 well, you could probably use the code in the actual bug report (https://github.com/nim-lang/Nim/issues/13889) |
10:07:56 | disbot | β₯ Critical: 1 completed Future, multiple await: Only 1 await will be awakened (the last one) ; snippet at 12https://play.nim-lang.org/#ix=2gNK |
10:08:10 | dom96 | yes, but I want you to add it as part of your PR :) |
10:08:11 | FromDiscord | <clyybber> alehander92: Morning |
10:08:49 | FromDiscord | <clyybber> eliezedeck: If you are ok with it, I can create a PR with a testcase included for you (if its too much of a hassle for you) |
10:08:55 | FromGitter | <Vindaar> @mratsim sweet, even the search works! :) |
10:09:42 | FromGitter | <eliezedeck> @dom96 thank you! much appreciated |
10:09:50 | FromGitter | <eliezedeck> @Clyybber no problem |
10:10:36 | FromGitter | <eliezedeck> all I care is that Nim also has super correct behavior ... not really the PR |
10:14:36 | * | PMunch quit (Ping timeout: 258 seconds) |
10:15:03 | * | PMunch joined #nim |
10:17:53 | FromGitter | <Vindaar> @voltist: ups, I messed up an if condition. Your example should work (that's what I used to test), but other stuff broke.. |
10:18:12 | voltist | Aww snap |
10:19:21 | * | Sixte joined #nim |
10:19:57 | * | Sixte left #nim (#nim) |
10:20:20 | FromGitter | <Vindaar> pushed the fix for the fix ;) |
10:20:38 | FromGitter | <Vindaar> wasn't anything complicated, just me being stupid |
10:21:15 | * | Tlongir joined #nim |
10:25:10 | voltist | @Vindaar I'll give it a test tomorrow as I'm having technical issues and i'd much rather have a break this evening. Thanks for all your help though! |
10:25:26 | * | the_fool quit (Ping timeout: 265 seconds) |
10:25:40 | FromGitter | <Vindaar> @voltist: no worries and you're welcome! Thank you for playing beta tester! |
10:25:45 | FromGitter | <Vindaar> enjoy your evening! |
10:28:47 | * | andinus quit (Quit: ERC (IRC client for Emacs 26.3)) |
10:31:11 | * | voltist quit (Quit: Leaving) |
10:37:17 | krux02 | Araq: your reviews of my PRs are just worthless. |
10:42:02 | FromDiscord | <clyybber> krux02: The repr change is unrelated right? |
10:47:58 | FromDiscord | <clyybber> @timotheecour, dom96: Should we really have both `defined(macos)` and `defined(macosx)` ? |
10:48:27 | dom96 | context? |
10:50:55 | FromDiscord | <clyybber> https://github.com/nim-lang/Nim/pull/13892 |
10:50:55 | disbot | β₯ [TODO] openDefaultBrowser now works on OSX |
10:51:15 | FromDiscord | <clyybber> This line: https://github.com/nim-lang/Nim/pull/13892/files#diff-6d2a31accaa1994357340dccfeb4ba53R24 |
10:51:15 | disbot | β₯ [TODO] openDefaultBrowser now works on OSX |
10:51:24 | * | Zectbumo quit (Remote host closed the connection) |
10:52:15 | krux02 | clyybber: If you have a very long sing expresiong ast and print it with repr, the output is ugly. I didn't fix repr, instead I postprocessed the output of repr to make it look good for this single use case. |
10:52:29 | krux02 | The postprocessing can be removed after repre works for my use case well |
10:53:12 | krux02 | my postprocessing eats all whitepace and reintroduces whitepsace bast on () positions |
10:54:07 | FromDiscord | <clyybber> Yeah, but it doesn't really belong into the PR |
10:54:13 | FromDiscord | <clyybber> I guess thats why Araq complained |
10:54:49 | krux02 | Araq just complained because he just wants to shit on MY PRs without actually looking into what I accomplished. |
10:55:44 | krux02 | Otherwise he could have provided constructive criticism, which he did not do. |
10:56:34 | FromGitter | <eliezedeck> @Clyybber @dom96 thanks for the merge ... sorry about the mixed PR, it was a really stupid thing on my part |
10:57:36 | FromDiscord | <clyybber> Hey np. Its not merged yet but I opened https://github.com/nim-lang/Nim/pull/13896 and am waiting for the tests |
10:57:37 | disbot | β₯ Fix #13889 with testcase |
10:59:46 | FromGitter | <eliezedeck> oh, ok |
11:02:38 | FromGitter | <eliezedeck> @Clyybber it might be better to reduce the `sleepAsync` to lower number, I'd say 10 milliseconds each should enough, so, at the minimum it will have a runtime of 20 ms |
11:03:46 | FromGitter | <eliezedeck> I'm worried 3 seconds total runtime for the test I wrote might be just too much, given the fact that we're likely to have hundreds even thousands of test to automate each time |
11:04:03 | dom96 | please avoid sleepAsync if you can |
11:04:07 | dom96 | it makes tests flaky |
11:04:52 | FromGitter | <eliezedeck> so, how would one have a delay in an async proc? that's the only one I know |
11:04:54 | FromDiscord | <clyybber> Yeah, the test is 3 seconds long now, but then its also less flaky |
11:05:05 | FromDiscord | <clyybber> I'm not sure how I would do it without the sleepAsync |
11:06:44 | FromDiscord | <clyybber> dom96: Any idea? |
11:07:28 | dom96 | just do sleepAsync(1) |
11:07:33 | FromGitter | <eliezedeck> I'm wondering, how are the tests done? I'm not sure how sleepAsync is making tests flaky ... unless there are thousands of system threads all fighting for CPU cores at a given moment, may be |
11:07:36 | dom96 | I think you just need to yield |
11:08:13 | FromGitter | <eliezedeck> yeap, sleepAsync(1) works |
11:08:49 | supakeen | Some asynchronous frameworks often offer a `await checkpoint()` or such as a macro for `await sleepAsync(0)` just to yield control back. |
11:09:32 | FromDiscord | <clyybber> dom96: So I would just change sleepAsync(1500) to sleepAsync(1) ? |
11:09:55 | FromGitter | <eliezedeck> or may be, the test system's scheduler has been tuned to very large granularity ... the highest I found so far is 10 ms, and it was on a MIPS router ... |
11:10:35 | FromGitter | <eliezedeck> @Clyybber that worked for me |
11:10:54 | FromGitter | <eliezedeck> and so is `sleepAsync(0)` |
11:12:32 | FromDiscord | <clyybber> But doesn't that mean that it will fail if it takes longer than 1 ms |
11:12:33 | FromDiscord | <clyybber> ? |
11:13:15 | FromGitter | <eliezedeck> @supakeen so, I suppose that's `sleepAsync(0)` for Nim, right? |
11:14:23 | supakeen | @eliezedeck I won't say I'm familiar enough with Nim's async system to say 'yes'. I'd assume so but you know what they say about assumptions :) |
11:15:02 | FromDiscord | <clyybber> Whats the first sleepAsync for btw? |
11:15:30 | FromGitter | <eliezedeck> @Clyybber please use `sleepAsync(0)` ... first sleepAsync can be removed ... |
11:15:48 | FromDiscord | <clyybber> I don't want to use sleepAsync(0) |
11:15:51 | FromGitter | <eliezedeck> the example was meant to simulate a christian belief, in Nim :) |
11:15:55 | FromDiscord | <clyybber> As I don't want the test to get flaky |
11:16:05 | FromDiscord | <clyybber> eliezedeck: lol |
11:16:06 | FromGitter | <eliezedeck> so, the first sleepAsync is like the savior's delay |
11:16:22 | FromGitter | <eliezedeck> the second one is just so to see who have been saved |
11:16:34 | FromDiscord | <clyybber> Yeah, and the test checks the output |
11:16:36 | FromGitter | <alehander92> @eliezedeck imaginative! |
11:17:42 | FromGitter | <eliezedeck> right ... well, Nim is inspiring |
11:17:53 | FromDiscord | <clyybber> ok, chronos is waiting 100 ms |
11:18:04 | FromDiscord | <clyybber> So I'll be doing that too. |
11:18:32 | FromGitter | <eliezedeck> @Clyybber I think the timing is really not important |
11:18:41 | FromGitter | <eliezedeck> 0 will not be flaky |
11:18:52 | FromDiscord | <clyybber> But it won't print the messages? |
11:19:03 | FromDiscord | <clyybber> Right? |
11:19:11 | FromGitter | <eliezedeck> it will |
11:20:11 | FromDiscord | <clyybber> Ok, I'll leave it at 50 then |
11:20:59 | FromGitter | <eliezedeck> the await sleepAsync will not return unless it has been given back control ... and control won't be back unless all previous callbacks have been processed (all 3 believers have been saved) ... well, who am I? I'm a beginner in Nim ... but that would be how other event loops act, at least, those that I have seen |
11:21:37 | FromDiscord | <clyybber> I see |
11:21:45 | FromDiscord | <clyybber> Thanks! |
11:22:24 | FromGitter | <eliezedeck> man, it's been a while since I wrote event loops manually in C ... my mind is rusted ... but it's ok, because we just take it for granted and just use Nim or the likes nowadays |
11:22:52 | FromGitter | <eliezedeck> thank You! |
11:25:00 | * | liblq-dev quit (Quit: WeeChat 2.7.1) |
11:27:26 | FromGitter | <eliezedeck> ... |
11:27:39 | FromGitter | <eliezedeck> question: do we have a cancellable timer? |
11:28:08 | FromGitter | <eliezedeck> or, in another way: can we cancel `sleepAsync` *efficiently* (not just let it timeout) |
11:30:22 | FromGitter | <alehander92> @eliezedeck God is inspiring :) |
11:30:41 | FromGitter | <alehander92> clyybber is there a way to control explicitly those yields |
11:30:55 | FromGitter | <eliezedeck> @alehander92 very true |
11:31:12 | FromGitter | <alehander92> :)) |
11:33:22 | FromDiscord | <clyybber> alehander92: Which yields? |
11:33:35 | FromDiscord | <clyybber> Ah, those. I dunno :p |
11:33:56 | FromGitter | <alehander92> the event loop giving control back etc, the seconds thing seems a bit not ideal |
11:34:13 | FromDiscord | <clyybber> Yeah, but the test doesn't depend on it so its fine |
11:34:13 | FromGitter | <alehander92> not a big deal |
11:39:54 | * | liblq-dev joined #nim |
11:48:01 | FromGitter | <eliezedeck> without the sleepAsync after the completion, the proc will exit immediately, thus: waitFor() will exit as well, and so, the callback had to chance to execute, hence: nothing will be printed |
11:48:19 | FromGitter | <eliezedeck> *had no chance |
11:50:36 | * | dddddd joined #nim |
11:50:57 | FromGitter | <alehander92> yeah i wondered if there is a way to just wait for "n" callbacks executed or something |
11:51:05 | FromGitter | <alehander92> but this actually doesnt make a lot of sense maybe |
11:51:12 | FromGitter | <alehander92> as you test that they are executed at all |
11:51:29 | FromGitter | <eliezedeck> there is, but it would make the test file more complex |
11:52:15 | FromGitter | <eliezedeck> we could also store the futures, and check them one by one if they have `.finished` |
11:52:51 | FromGitter | <eliezedeck> but I strongly believe that the current test is not flaky |
12:06:01 | * | supakeen quit (Quit: WeeChat 1.9.1) |
12:06:44 | * | supakeen joined #nim |
12:08:25 | dom96 | eliezedeck: no way to cancel timers right now |
12:08:43 | * | abm joined #nim |
12:09:00 | * | sleepyqt joined #nim |
12:11:57 | * | lbart joined #nim |
12:18:29 | * | Guest19582 quit (Ping timeout: 250 seconds) |
12:20:08 | * | dadada joined #nim |
12:20:31 | * | dadada is now known as Guest29531 |
12:32:20 | * | arecaceae quit (Remote host closed the connection) |
12:32:44 | * | arecaceae joined #nim |
12:34:13 | FromGitter | <eliezedeck> ok, thanks |
12:37:02 | * | rockcavera joined #nim |
13:04:45 | FromGitter | <alehander92> ook |
13:05:46 | PMunch | Damn, running some stuff with gc:arc and seeing some serious memory and time improvements! |
13:08:25 | PMunch | From 4.52s, 1.32Gb down to 3.14s, 1.08Gb |
13:09:16 | PMunch | And I just realised I need to seriously optimise this algorithm for it to be useful for me.. |
13:11:42 | * | dsrw joined #nim |
13:14:04 | * | lritter joined #nim |
13:20:22 | FromGitter | <kaushalmodi> @Vindaar Your ggplotnim recipes and the plots in them are music to my eyes :) I do not understand many of the plots, but I am amazed that ggplotnim can create those. Awesome work! |
13:21:00 | FromGitter | <Vindaar> @kaushalmodi you mean like plotting a periodic table? :D β Thanks, really appreciated :) |
13:21:19 | * | natrys joined #nim |
13:21:21 | FromGitter | <kaushalmodi> hehe yep, also those neural spike plot you mentioned above |
13:21:56 | PMunch | Hmm, am I missing something here or should `for x in y.toHashSet: echo x` never print duplicates? |
13:23:03 | FromGitter | <Vindaar> Hehe yes. But to be fair, the majority of the praise has to go to Leland Wilkinson for thinking up the grammar of graphics concept and Hadley Wickham for expanding it and building ggplot2 :) |
13:24:34 | PMunch | http://ix.io/2gPl |
13:25:00 | PMunch | On the left is the trees I have in a sequence, on the right is the hash of the node. |
13:25:10 | PMunch | The hash set doesn't seem to remove the duplicates.. |
13:30:06 | FromGitter | <kaushalmodi> PMunch: I vaguely remember issues opened by @timotheecour on the topic of hash and duplicates keys, somewhere in last 1-2 months |
13:30:31 | PMunch | Am I doing something wrong here? Or is the hashset module just completely broken? https://play.nim-lang.org/#ix=2gPm |
13:30:39 | PMunch | Hmm |
13:31:13 | FromGitter | <kaushalmodi> .. may be it was tables: https://github.com/nim-lang/Nim/issues/13499 |
13:31:15 | disbot | β₯ `==` incorrect for tables with repeated keys ; snippet at 12https://play.nim-lang.org/#ix=2gPo |
13:32:20 | FromGitter | <Vindaar> yeah, I also only remember the issue with using `add`. Hash collisions of course might happen, but seem unlikely for a small set. Also the iterator over a HashSet surely should still only contain one such hash, since in case of a collision information on hash insertion should be lost, no? |
13:34:09 | PMunch | Yeah, I mean isn't the whole point of a set to only have one of each thing? |
13:34:19 | FromGitter | <Vindaar> I agree |
13:34:49 | narimiran | PMunch: print `combinations` |
13:35:03 | FromGitter | <kaushalmodi> That's what I thought too, but given that duplicates are supported, I am not sure I know enough to comment on that |
13:35:21 | narimiran | oooops, disregard, i haven't seen it correctly |
13:35:50 | PMunch | kaushalmodi, they are supported for HashTables, which is fine |
13:36:02 | PMunch | But HashSet shouldn't ever have duplicates.. |
13:39:49 | narimiran | PMunch: `echo combinations[3] == combinations[^1]` gives `false` |
13:40:02 | narimiran | sorry, that's `^3` |
13:40:49 | narimiran | same for `echo hash(combinations[3]) == hash(combinations[^1])` |
13:41:34 | * | NimBot joined #nim |
13:42:12 | PMunch | Okay, adding == that uses hash works |
13:45:49 | * | uu91 quit (Read error: Connection reset by peer) |
13:46:38 | * | uu91 joined #nim |
13:46:55 | PMunch | Okay, that fixed most of my performance issues :) |
13:47:03 | PMunch | By removing all the duplicates |
13:48:39 | * | uu91 quit (Read error: Connection reset by peer) |
13:48:50 | PMunch | Man, the memoize package is really nice |
13:49:04 | * | uu91 joined #nim |
13:49:05 | PMunch | 6.7s -> 0.4s |
13:49:14 | PMunch | By adding a single pragma to my function :) |
13:49:19 | * | uu91 quit (Read error: Connection reset by peer) |
13:49:40 | PMunch | RAM usage also dropped from 22Mb to 12Mb |
13:49:40 | * | uu91 joined #nim |
13:50:47 | supakeen | I was wondering re: consistency. Is there a preferred thing between `x == nil`, `x.isNil', `isNil(x)` etc in stdlib? |
13:51:04 | PMunch | isNil is the preferred way |
13:51:17 | narimiran | PMunch: nice numbers there! |
13:51:23 | PMunch | I personally like `x.isNil` |
13:51:25 | supakeen | Then my next PR with general asynchttpserver cleanup/features will rewrite them to isNil :) |
13:51:34 | shashlick | I need to get nimterop working with arc as well |
13:51:36 | PMunch | But that's just because I find it easier to read |
13:51:46 | PMunch | Then again I use postfix for pretty much anything |
13:51:49 | shashlick | Hopefully it will speed up toast |
13:52:06 | supakeen | It's fine currently it's quite literally `if x != nil` and then 2 lines down `if not x.isNil()` :) |
13:52:14 | Araq | supakeen: use != nil please |
13:52:20 | supakeen | Araq: Ah. |
13:52:31 | Araq | isNil could be deprecated, it's pointless |
13:52:32 | PMunch | After adding in memoize and HashSet gc:arc is actually slower |
13:52:48 | PMunch | Oh really? I was told once that the preferred thing was to use isNil |
13:53:00 | Araq | yes |
13:53:08 | Araq | it used to be the other way round :P |
13:53:20 | PMunch | Ah :P |
13:53:29 | Araq | but now that seqs and strings cannot be nil anymore 'isNil' should be removed |
13:53:40 | PMunch | Wasn't that because it wasn't 100% clear that nil should be kept? |
13:53:52 | PMunch | Why was isNil better for those? |
13:54:06 | Araq | it was better for seqs because |
13:54:11 | PMunch | I'm loving the seqs and strings can't be nil thing by the way |
13:54:15 | shashlick | What about ref objects - I use isNil for PNode |
13:54:36 | Araq | PMunch: the == for seqs is lifted from the elements' == |
13:55:07 | Araq | that's problematic if the element type lacks the == |
13:55:13 | PMunch | shashlick use cast[Option[ref MyType]](myObject).isSome :P |
13:55:20 | PMunch | Aaah |
13:55:29 | Araq | shashlick: use != nil for refs |
13:55:59 | shashlick | Ok |
13:56:38 | PMunch | I'm curious if a converter that casts nilable things to options would be practical |
13:56:45 | PMunch | When using optionsutils for example |
13:56:58 | FromGitter | <alehander92> but so much code uses .isNil |
13:57:01 | PMunch | Then you could use ?. for example on nilable types |
13:57:17 | FromGitter | <alehander92> one really needs to provide nim rewriting tool for deprecations like that |
13:58:21 | FromGitter | <alehander92> look at ast => find dot/call nodes with isNil => turn to arg != nil nodes => nimpretty render |
13:58:24 | FromDiscord | <Recruit_main707> is there an easy way of converting a json node into an object? |
13:58:48 | FromGitter | <alehander92> a.to(Type) |
13:59:17 | Araq | alehander92: well a single isNil template in system.nim doesn't kill us |
13:59:23 | FromDiscord | <Recruit_main707> cool, and... will it work if my type has some fields which are other types?? |
13:59:28 | Araq | but currently it's even a magic, silly |
14:00:14 | FromGitter | <alehander92> Araq yeah, less builtins is good |
14:00:32 | FromGitter | <alehander92> Recruit_main707 well .. all your fields have types :D |
14:00:51 | FromDiscord | <Recruit_main707> but, my own types :p |
14:00:57 | FromGitter | <alehander92> it doesnt matter |
14:01:01 | FromGitter | <alehander92> yes, it should work recursively .. maybe it has limitations with case objects not sure |
14:01:13 | FromDiscord | <Recruit_main707> i will try i guess |
14:01:32 | FromDiscord | <Recruit_main707> thanks, and sorry for interrupting the conversation |
14:01:41 | FromGitter | <alehander92> if the types can be reasonably mapped to json, it should work |
14:01:52 | FromGitter | <alehander92> no interruption |
14:04:38 | * | Vladar quit (Quit: Leaving) |
14:08:52 | FromDiscord | <clyybber> does it still *need* to be magic? |
14:09:37 | * | endragor quit (Remote host closed the connection) |
14:10:30 | FromGitter | <alehander92> i feel that many things can be not special anymore |
14:10:54 | Araq | clyybber: nah and it hurts DrNim |
14:11:00 | Araq | more special cases to consider |
14:11:56 | FromGitter | <alehander92> e.g. in system/jssys many things seem to be possible with just nim code not so much `asm` |
14:12:17 | FromDiscord | <clyybber> Araq: Ok, I'll make a PR to unmagic it |
14:13:05 | shashlick | Best to do that early in devel cycle and see who all break |
14:14:59 | shashlick | Araq: did you see the arc related issue I commented on? |
14:15:25 | Araq | no arc development will continue tomorrow, today is DrNim day |
14:15:41 | shashlick | https://github.com/liquid600pgm/euwren/issues/17#issuecomment-609573188 |
14:15:43 | disbot | β₯ Build fails when using --gc:arc. ; snippet at 12https://play.nim-lang.org/#ix=2gPy |
14:15:43 | * | kungtotte quit (Read error: Connection reset by peer) |
14:16:10 | shashlick | No worries |
14:16:40 | shashlick | I plan on porting to arc for nimterop so wanted to understand how to deal with such issues |
14:16:40 | * | kungtotte joined #nim |
14:19:15 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
14:21:07 | Araq | shashlick: well a stacktrace would be helpful, use 'koch temp' |
14:23:54 | * | natrys quit (Quit: natrys) |
14:24:15 | companion_cube | Araq: https://nim-lang.org/docs/destructors.html <-- is nim getting closer to rust? (not meant to be a loaded question) |
14:24:45 | FromDiscord | <clyybber> Araq: Ok to merge https://github.com/nim-lang/Nim/pull/13896 ? |
14:24:46 | disbot | β₯ Fix #13889 with testcase |
14:25:06 | FromDiscord | <clyybber> companion_cube: Yes, in some ways |
14:25:33 | companion_cube | interesting how D seems to follow the same path |
14:25:50 | * | liblq-dev quit (Ping timeout: 265 seconds) |
14:26:43 | shashlick | Araq: I've attached it to that issue, should help when you get to see it |
14:27:11 | Araq | companion_cube: yeah, it's definitely getting closer |
14:27:26 | Araq | we're also getting some borrow checking |
14:29:14 | companion_cube | with lifetime variables and everything? |
14:29:21 | companion_cube | seems like a very complicated thing to do |
14:32:13 | Araq | well it's simplified |
14:33:02 | Araq | you can only borrow from a location that is derived from the first formal parameter |
14:33:58 | Araq | seems to work out for every example I ever wanted to be able to express |
14:34:44 | companion_cube | do you prevent the variable from being mutated while there's a borrow? |
14:35:00 | companion_cube | seems to me you keep some runtime checks (which is valid, it's simpler than full on rust semantics) |
14:36:17 | * | waleee-cl joined #nim |
14:39:02 | Araq | companion_cube: it depends on the mutation, I think. resizing is much more harmful than mutation |
14:39:18 | Araq | no runtime checks are planned for it |
14:39:43 | companion_cube | also, case types, when you borrow a field and change the tag |
14:39:46 | companion_cube | as you were saying earlier |
14:40:00 | Araq | true |
14:42:18 | Araq | but Nim is well prepared, consider that you can pass a 'seq' to 'var openArray' (no resizing possible) or to a 'var seq' (resizing possible) |
14:42:45 | companion_cube | ah nice indeed |
14:42:54 | companion_cube | `var openArray` is like `&mut [β¦]` in rust then |
14:43:11 | FromGitter | <rishavs> quick question on tables, how would I define a type for tables? β β ```code paste, see link``` β β Here I want to define a custom table type., where the key is an id and the value is a room. But I am not able to find what should be the correct way to declare this type [https://gitter.im/nim-lang/Nim?at=5e8b3ffef87c5956a23e5cbb] |
14:44:58 | * | Lord_Nightmare joined #nim |
14:47:13 | Araq | the way you did it is fine |
14:48:01 | PMunch | Found a use for `isNil`, when defining a `==` operator |
14:48:19 | FromGitter | <rishavs> Thanks Araq. |
14:51:12 | Araq | PMunch: you can simply use system.`==` to avoid the infinite recursion |
14:51:20 | PMunch | True |
14:51:33 | PMunch | `isNil` looks nicer though |
14:51:52 | Araq | good point |
14:52:38 | Araq | template isNil(x: typed): bool = system.`==`(x, nil) # prevent endless recursions in clients |
14:54:22 | * | liblq-dev joined #nim |
14:55:42 | * | endragor joined #nim |
14:56:27 | disruptek | we support repr for runtime now? |
14:58:23 | Araq | --gc:arc does support repr but uses a different implementation |
14:58:55 | disruptek | okay. |
15:02:43 | FromDiscord | <kraptor> noob question: varargs pragma doesn't enforce a parameter when binding against C/C++, this conforms with varargs.h but not stdarg.h, therefore having linking errors on CPP but not C... is this intended behavior? |
15:05:10 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
15:06:27 | * | Lord_Nightmare joined #nim |
15:07:42 | Araq | kind of, but we map .varargs to '...' so both ways are supported |
15:08:03 | Araq | you need to specify the first parameter separately though |
15:08:20 | Araq | proc printf(fmt: cstring) {.varargs.} |
15:09:49 | * | PMunch quit (Ping timeout: 265 seconds) |
15:13:47 | FromDiscord | <kraptor> aham, what I found is in cpp + stdarg.h, that va_list requires always at least one value, but from nim side, you can call without value, therefore failing while linking... |
15:14:02 | disruptek | Araq: shouldn't =destroy have a sfUsed? |
15:15:04 | Araq | er ... yeah |
15:15:46 | disruptek | hmm, okay. i will fix that too. |
15:22:15 | * | PMunch joined #nim |
15:25:16 | disruptek | krux02: can i have your .ctags please? |
15:25:54 | krux02 | yes |
15:26:41 | krux02 | http://ix.io/2gPY |
15:26:59 | krux02 | I just realized I don't have the = in the regex. |
15:27:18 | * | lbart quit (Ping timeout: 256 seconds) |
15:27:30 | disruptek | =? |
15:27:37 | * | lbart joined #nim |
15:28:21 | FromDiscord | <Recruit_main707> @Araq: packedjson should probably include the normal json `to` function |
15:28:47 | krux02 | yes I think I said it in the stream |
15:29:10 | krux02 | you get false positives on forward declarations if the regex doesn't required the = sign |
15:29:49 | krux02 | but on the other hand if the proc declaration is really complicated with multiple lines and temple/macro expressions for the types, you might miss out on the declaration of you do include the = in the regex. |
15:30:05 | krux02 | there is a tradeoff, but the regex works really very well for Nim. |
15:30:54 | disruptek | oh, gotcha. |
15:30:59 | * | kenran quit (Ping timeout: 260 seconds) |
15:31:03 | disruptek | thanks. |
15:32:25 | Araq | Recruit_main707: PRs are always welcome |
15:41:48 | disruptek | krux02: it seems no better, unfortunately. |
15:42:33 | leorize | Araq: looking at the SSL issue, fixing it would mean to bump Nim's openssl requirement to 1.1 |
15:42:53 | leorize | because openssl developers doesn't care about backward compatibility |
15:44:00 | leorize | do we wanna bump the requirement or should I try to do it without having to bump the requirement? |
15:44:46 | Araq | bump the requirement, on windows we ship the DLLs we need and Unix users are happy to constantly babysit everything |
15:45:04 | * | nsf quit (Quit: WeeChat 2.7) |
15:45:34 | krux02 | disruptek, what is no better? |
15:45:43 | disruptek | tags. |
15:45:47 | disruptek | couldn't make it work. |
15:45:54 | disruptek | very spotty performance. |
15:45:56 | krux02 | for me they work very well. |
15:46:01 | krux02 | interesting |
15:46:04 | krux02 | they are instant for me |
15:46:16 | disruptek | i will show you onstream sometime. |
15:46:27 | krux02 | sorry the script you have, it generates emacs TAGS file, you should remove the -e flag |
15:46:48 | disruptek | yeah, that didn't help me. |
15:46:56 | disruptek | i did use your script, though. |
15:47:51 | * | pbb_ joined #nim |
15:47:53 | dom96 | leorize: add a define like -d:insecureOpenSSL to get the best of both worlds |
15:48:13 | * | pbb quit (Ping timeout: 272 seconds) |
15:49:00 | * | endragor quit (Remote host closed the connection) |
15:49:35 | leorize | sure |
15:55:32 | * | endragor joined #nim |
15:59:56 | * | Trustable joined #nim |
15:59:59 | shashlick | i'm still getting SIGSEGV: Illegal storage access in some builds of nimterop - no stack trace, works fine when run through gdb |
16:00:10 | * | hax-scramper quit (Ping timeout: 256 seconds) |
16:00:19 | disruptek | yeah, i run all my arc projects in gdb. |
16:00:22 | disruptek | only way to fly. |
16:00:37 | shashlick | this isn't even arc - just regular gc |
16:00:37 | * | hax-scramper joined #nim |
16:00:45 | shashlick | and has been reported on 1.0.6 |
16:02:42 | disruptek | wut |
16:02:47 | disruptek | nimterop? 0.4.4? |
16:03:17 | shashlick | has been reported yes |
16:03:25 | disruptek | whoa. |
16:03:50 | shashlick | https://github.com/genotrance/nimarchive/issues/10 |
16:03:51 | disbot | β₯ SIGSEGV Nim 1.2+ |
16:03:58 | shashlick | went away when toast was recompiled |
16:04:06 | shashlick | is failing randomly in my CI runs |
16:04:32 | * | endragor quit (Remote host closed the connection) |
16:05:01 | disruptek | might explain some of my issues. |
16:05:36 | shashlick | but are you recompiling toast? |
16:06:11 | disruptek | it's one way i solve this problem, yes. |
16:09:26 | shashlick | okay |
16:13:56 | * | endragor joined #nim |
16:16:54 | shashlick | yep - restarted that job and it passed now |
16:35:57 | * | endragor quit (Remote host closed the connection) |
16:36:36 | * | endragor joined #nim |
16:38:08 | * | dsrw quit (Read error: Connection reset by peer) |
16:43:00 | * | endragor quit (Remote host closed the connection) |
16:43:01 | FromDiscord | <gour> hello, would it be feasible to write back-end for desktop app in Nim as python extension and hen write front-end in e.g. wxpython call Nim-extensions? |
16:45:12 | FromGitter | <zetashift> @gour this might help you: https://github.com/Pebaz/nimporter |
16:45:31 | * | sentreen_ quit (Ping timeout: 265 seconds) |
16:46:34 | FromDiscord | <kodkuce> karax has no support for websockets right? |
16:47:15 | FromDiscord | <gour> thanks! |
16:47:40 | FromDiscord | <gour> other option would be to do everything in Nim, but not sure what is the state of wxnim... |
16:48:44 | leorize | kodkuce: karax is just for ui, use a websocket lib for websockets |
16:48:45 | FromGitter | <zetashift> friendly ping to @PMunch I think he worked a fair bit on it |
16:49:03 | PMunch | Worked a fair bit on what? |
16:49:06 | leorize | wxnim |
16:49:09 | PMunch | Oh wxnim |
16:49:19 | PMunch | Yeah I wrote genui and fixed up some bits and pieces |
16:49:59 | PMunch | wxnim should work just fine, not sure why you'd want to drag Python into this.. |
16:50:53 | FromDiscord | <gour> PMunch: well, wxpython is actively supported...there are several gui-options for nim, but not sure if any is production-ready? |
16:51:12 | leorize | I'd say gintro and wxnim are the more solid ones |
16:51:20 | leorize | the rest are incomplete |
16:51:33 | FromDiscord | <gour> PMunch do you still have interest for wwnim? |
16:52:09 | FromDiscord | <gour> @leorize how much of wx is covered (approx.)? |
16:52:30 | FromDiscord | <gour> PMunch do you still have interest for wxnim? |
16:52:53 | leorize | only PMunch can answer that :P |
16:53:05 | PMunch | wxnim is essentially just a wrapper for wxWidgets, so it doesn't really require much maintenance. Only thing it could need is a couple helpers here and there to make it easier to use in Nim, but with genui I haven't really found any of those pain points. |
16:53:05 | leorize | but afaict, fairly complete |
16:53:06 | FromDiscord | <kodkuce> leorize: i can use websocket lib for backend but dont think i can use it for fronted UI cuz dont think it supports js |
16:53:15 | leorize | !repo websockets |
16:53:18 | disbot | https://github.com/niv/websocket.nim -- 9websocket.nim: 11websockets for nim 15 79β 25π΄ 7& 6 more... |
16:53:40 | PMunch | Sorry, I was writing that. I do still have an interest in wxnim, and I make sure that it keeps working on new releases. |
16:53:53 | FromDiscord | <gour> @leorize gi ntro is gtk3, right? i t wo uld be ok for linux, bu t to deliver multi-platform, i believe wx is better option |
16:53:59 | PMunch | It's also automatically generated from the wxWidgets sources, so it's got close to 100% coverage |
16:54:10 | leorize | @kodkuce: you gotta use native js apis |
16:54:18 | leorize | it's easy to wrap them so you'll be fine |
16:54:23 | FromDiscord | <gour> @leorize gintro is gtk3, right? it would be ok for linux, but to deliver multi-platform, i believe wx is better option |
16:54:27 | livcd | someone please do sciter bindings already |
16:54:32 | livcd | :D |
16:54:56 | FromDiscord | <gour> PMunch: that's good to hear. thank you! |
16:55:12 | PMunch | livcd, you mean like these? https://github.com/sciter-sdk/nsciter |
16:55:48 | livcd | yeah but these do not work |
16:56:47 | PMunch | I'm sure he'd accept a PR to fix them :) |
16:57:55 | livcd | i am too stupid for that :-( |
16:58:07 | livcd | trust me i tried |
16:59:00 | PMunch | Haha |
17:02:21 | FromDiscord | <gour> is ST (with vim emulation) still considered viable option to write Nim code or majority of folks moved to vscode? |
17:02:36 | leorize | sublime? |
17:02:43 | FromDiscord | <gour> yes |
17:02:52 | leorize | well there's still a fair amount of users using it |
17:03:15 | leorize | currently neovim and vscode are the more well supported ones though |
17:03:24 | FromDiscord | <gour> ST4 is improving auto-completion etc. |
17:03:28 | PMunch | Should still work fine with nimlsp though :) |
17:04:07 | FromDiscord | <gour> PMunch: ST package for Nim uses nim-lsp? |
17:04:18 | PMunch | Don't think so |
17:04:21 | FromDiscord | <gour> ST community is working on st-lsp plugin |
17:04:22 | FromGitter | <zetashift> talking about nimlsp could you take a look at this PR :P: https://github.com/PMunch/nimlsp/pull/41 |
17:04:24 | disbot | β₯ Add emacs for setting up |
17:05:09 | PMunch | Ah, I can merge it. But I have no idea if those instructions work or not :P |
17:05:27 | FromDiscord | <gour> here is it: https://github.com/sublimelsp/LSP |
17:05:33 | shashlick | is it fair to say that {.header.} and {.dynlib.} cannot coexist |
17:05:40 | shashlick | with {.importc.} |
17:05:48 | * | zacharycarter joined #nim |
17:05:48 | Araq | shashlick: yes |
17:05:52 | shashlick | cool |
17:05:57 | PMunch | Yeah I know, that's the one I used when I was testing LSP in Sublime |
17:06:44 | leorize | fun, SSL_CTX_set_min_proto_version is an actual function in libressl, but a macro in openssl |
17:06:53 | zacharycarter | Hi shashlick: quick question - doesn't look like the `cCompile` mode parameter accepts objc. Is this a limitation or just an oversight? |
17:07:06 | zacharycarter | I'm inquiring about nimterop - sorry for not making that clear |
17:08:16 | shashlick | oversight i guess - never tried it and don't even know if it works |
17:09:03 | shashlick | if you can make a PR, will gladly accept |
17:09:40 | zacharycarter | Okay thanks - I guess I'm not quite sure what it does - it says it recursively searches for c / cpp files - but what I really want to have happen is for the objc compiler backend to be used |
17:09:48 | zacharycarter | I'll try to figure out a way to make it happen - thanks for the clarification |
17:11:28 | shashlick | cCompile is to create {.compile.} calls for c/c++ files |
17:11:46 | shashlick | if you want to use a different backend, can be done with your `nim objc` call itself right? |
17:13:08 | * | gour joined #nim |
17:13:17 | zacharycarter | Well I do want to create a compile pragma (I think) but I want to use the objc backend - even if I try calling `nim objc`, things still don't work. I'll play around with this more - clearly I'm not doing something correctly. |
17:13:48 | shashlick | backend used is determined by how you call nim up front on the wrapper |
17:14:53 | shashlick | {.compile.} calls the correct gcc/g++/??? depending on the file type |
17:14:58 | shashlick | that's determined by Nim itself |
17:15:04 | * | arecaceae quit (Remote host closed the connection) |
17:15:32 | * | arecaceae joined #nim |
17:16:53 | zacharycarter | ah it may just be because I'm not doing `{.passC:"-objc-arc".} |
17:18:47 | FromGitter | <alehander92> kodkuce it does iirc |
17:18:50 | FromGitter | <alehander92> i think i used it |
17:23:49 | shashlick | what are valid objc file extensions? |
17:24:17 | zacharycarter | m, mm and h - m is objc mm is objcpp and h for header files |
17:24:34 | zacharycarter | I was able to get it to work - I just didn't have objc arc support explicitly enabled |
17:24:37 | shashlick | https://nimterop.github.io/nimterop/cimport.html#cCompile.m%2C%2Cstring%2Cstring |
17:25:11 | shashlick | https://github.com/nimterop/nimterop/blob/master/nimterop/cimport.nim#L527 |
17:25:18 | shashlick | I can add objc search to cCompile if there's interst |
17:26:02 | zacharycarter | eh I guess I just was thinking that mode did something else - so maybe don't bother unless someone else asks for it :P |
17:26:10 | zacharycarter | you probably have way more important things to do |
17:26:30 | shashlick | sure and given it will be untested |
17:26:37 | zacharycarter | yeah that too |
17:28:24 | shashlick | another question - today nimterop pulls in tree-sitter-c and tree-sitter-cpp but I only use cpp mode to parse both types of headers |
17:28:39 | shashlick | of course c++ is not really supported but i'm wondering if I can remove tree-sitter-c altogether |
17:29:26 | shashlick | from a wrapping perspective, do c headers have stuff in them that are invalid c++ |
17:29:54 | shashlick | i haven't seen any issues raised around this and nimterop has used cpp mode as the default since the beginning |
17:30:40 | * | rockcavera quit (Read error: Connection reset by peer) |
17:30:50 | shashlick | https://github.com/tree-sitter/tree-sitter-c/issues/15 is some additional context - appreciate some feedback |
17:30:51 | disbot | β₯ Question: use tree-sitter-cpp all the time? |
17:30:59 | * | rockcavera joined #nim |
17:31:09 | * | rockcavera quit (Changing host) |
17:31:09 | * | rockcavera joined #nim |
17:32:23 | * | ryukoposting joined #nim |
17:34:28 | disruptek | shashlick: what does it buy you? |
17:37:18 | shashlick | one less package to pull, build and compile in |
17:37:28 | shashlick | completely unused |
17:37:39 | disruptek | i would leave it in. |
17:38:08 | shashlick | comment it out? until it might be useful some day? |
17:38:19 | ryukoposting | shashlick, you are the guy who develops feud, right? or is genotrance a different guy |
17:38:28 | shashlick | same |
17:38:35 | ryukoposting | ok cool, just double checking |
17:38:57 | ryukoposting | making sure you're the right one to piss and moan to when stuff doesn't work |
17:39:20 | shashlick | yep π |
17:39:35 | ryukoposting | this thing is really cool though, props for cooking up such an elegant design |
17:40:24 | * | endragor joined #nim |
17:41:02 | * | PMunch quit (Quit: leaving) |
17:41:33 | shashlick | glad to hear that |
17:42:01 | shashlick | but before you get too deep into the feud plugin system, i'd recommend reading up the updated system in http://github.com/genotrance/plugins |
17:42:51 | ryukoposting | I've hardly touched it, feud as-is is already 95% of what I need |
17:44:20 | ryukoposting | My plan is to distribute a "project manager" program based on nigui that'll have a button for "open script file," which will open feud then use that socket thing to open the script file in the new feud instance |
17:44:54 | shashlick | why not just add a project.nim plugin and it can manage projects for you |
17:45:08 | shashlick | then users can run feud and say openproject xyz |
17:45:13 | * | endragor quit (Ping timeout: 250 seconds) |
17:45:23 | ryukoposting | ooooooh man, I should look into this plugin thing lol |
17:45:33 | shashlick | you can add callbacks for loadproject, saveproject, etc as simple procs |
17:46:16 | ryukoposting | so, how does one add a plugin to feud? or is that a question that will be answered once I dig into this plugins package? |
17:47:17 | shashlick | you can start by adding a new feudCallback to an existing plugin and doing something int here |
17:47:51 | shashlick | adding a new plugin is simply adding a new x.nim to the plugins/server directory and making sure it has feudPluginLoad section |
17:47:59 | shashlick | see any of the plugins in that dir |
17:48:20 | ryukoposting | will I need to rebuild feud to add a plugin? |
17:48:28 | shashlick | this should help understand the system - https://genotrance.github.io/plugins/api.html |
17:48:36 | shashlick | no feud will build it for you on startup |
17:48:45 | shashlick | and if it is edited, feud will unload, rebuild and load it back |
17:49:02 | ryukoposting | that's pretty sweet |
17:49:10 | shashlick | you need to be careful with the objects you create and fill out the right load/unload event callbacks |
17:49:20 | zacharycarter | does the plugin system you write for feud work with the arc gc shashlick? |
17:49:34 | shashlick | not yet z, haven't tested it |
17:49:45 | zacharycarter | hopefully I can be your guinea pig |
17:49:48 | shashlick | but genotrance/plugins works across all OS |
17:49:52 | zacharycarter | niceeee |
17:50:01 | shashlick | unlike feud which is mainly tested on windows |
17:50:05 | shashlick | so you can definitely build on it |
17:50:39 | shashlick | note that the plugins system does need boehm today |
17:50:49 | shashlick | so getting it to work with arc is crucial |
17:51:02 | ryukoposting | I hope that, as a general rule, if a program works in the current runtime, it will work fine in arc as well. |
17:51:28 | ryukoposting | Chroma may be an exception since it's dealing with a multithreaded C library at a fairly low level. |
17:51:39 | shashlick | that's the hope but there might be some modifications needed, i don't have first hand experience |
17:53:37 | * | rockcavera quit (Read error: Connection reset by peer) |
17:53:59 | * | rockcavera joined #nim |
17:53:59 | * | rockcavera quit (Changing host) |
17:53:59 | * | rockcavera joined #nim |
17:56:23 | FromGitter | <brentp> what's the simplest way to add auth to a jester app? even a single user, single password specified on command-line. |
17:58:58 | Araq | ryukoposting: there are differences but once we fixed even more bugs porting code is easy enough |
17:59:13 | companion_cube | is there info on how `object` is compiled? a struct + a typeinfo field? |
17:59:33 | leorize | a struct, but don't depend on that |
17:59:46 | leorize | the typeinfo field only exists if dynamic dispatch is used iirc |
18:00:32 | leorize | in general you should never count on Nim `object` ABI |
18:00:53 | companion_cube | oh for sure, I'm wondering about the overhead and layout |
18:01:24 | Araq | if you don't use 'of ...' there is no type field and it's a C struct |
18:01:55 | companion_cube | oh ok, I thought you'd have to use `tuple` for that. cool. |
18:02:00 | * | natrys joined #nim |
18:02:10 | companion_cube | and if there's no `ref object` it's a value type? |
18:02:56 | Araq | yes |
18:03:49 | companion_cube | makes a lot of sense, thanks. |
18:03:58 | companion_cube | (interesting too how crystal has similar choices) |
18:05:41 | FromDiscord | <Yewpad> @Benumbed I plan on doing more design stuff regarding the docs. Glad you like the dark theme. π |
18:05:51 | * | matti_ joined #nim |
18:07:16 | * | nikita`_ joined #nim |
18:07:36 | * | vqrs_ joined #nim |
18:07:41 | * | blueberrypie7 joined #nim |
18:07:59 | * | rockcavera quit (Remote host closed the connection) |
18:08:02 | FromDiscord | <Recruit_main707> dom96: how can i uninstall choosenim? |
18:08:05 | * | matti quit (Ping timeout: 246 seconds) |
18:08:05 | * | vqrs quit (Ping timeout: 246 seconds) |
18:08:05 | * | nikita` quit (Ping timeout: 246 seconds) |
18:08:05 | * | koltrast quit (Remote host closed the connection) |
18:08:05 | * | blueberrypie quit (Quit: Ping timeout (120 seconds)) |
18:08:08 | * | nikita`_ is now known as nikita` |
18:08:09 | * | koltrast_ joined #nim |
18:08:55 | FromGitter | <zetashift> remove the binary? |
18:09:14 | * | ryukoposting quit (Quit: Leaving) |
18:09:15 | * | Vladar joined #nim |
18:09:26 | FromDiscord | <clyybber> @Yewpad cool to hear! |
18:09:31 | shashlick | Delete $HOME/.choosenim |
18:09:33 | FromDiscord | <clyybber> looking forward to it |
18:09:41 | shashlick | But all toolchains go with that |
18:09:57 | shashlick | So copy what you need |
18:11:39 | FromDiscord | <Yewpad> Don't know whether or not the design changes will be implemented in the default Nim doc gen or I'll make a custom doc gen. Reason for this is that the default Nim doc gen is so messed up that... I don't know. I can't even find words for it. π But the design changes focus on readability and structure. The coloring probably stays the same. |
18:11:46 | FromDiscord | <Yewpad> @clyybber |
18:12:02 | FromDiscord | <clyybber> ah ok |
18:12:39 | FromDiscord | <Yewpad> Something like a OFL (Open Font License) font that is more easy on the eyes etc. |
18:13:51 | * | pbb_ quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
18:15:01 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
18:15:31 | FromDiscord | <Yewpad> I figured that it would be better to just make a custom CSS file people can drop in their directories. I think the custom doc gen is a bit far fetched and unnecessary. |
18:17:01 | FromDiscord | <Benumbed> Nice, good to hear @Yewpad π |
18:17:13 | FromDiscord | <exelotl> @Yewpad oh you're alive! Discord app wouldn't let me @ you for some reason earlier :/ |
18:17:44 | FromDiscord | <exelotl> Glad you're thinking about big structural changes, I think the docgen really needs it |
18:18:00 | FromDiscord | <Yewpad> No no, it's not your or Discord's fault. I re-joined the Discord after I left because of some heated discussions. |
18:18:14 | FromDiscord | <exelotl> Ah I see |
18:18:35 | FromDiscord | <Benumbed> It would be nice to have the manual and stdlib available as PDFs, so a custom docgen could@have itβs uses too if it supported multiple renderers |
18:19:14 | FromGitter | <awr1> hello all |
18:19:32 | FromGitter | <zetashift> hiya |
18:19:57 | FromDiscord | <Yewpad> Hm. So a custom doc gen !could! be beneficial, that's for sure. Because there's this one golden rule: "Never change a running system" and I don't want to delay any other development process in Nim's repository. And yeah, custom render frontends. |
18:20:16 | * | pbb joined #nim |
18:20:45 | FromGitter | <awr1> nim doc gen can output json, can't it? |
18:21:01 | FromDiscord | <Yewpad> And after some battle testing, the new docgen could be integrated by Nim |
18:21:04 | FromGitter | <awr1> perhaps you can develop your own site frontend for docgen |
18:21:13 | FromDiscord | <Yewpad> awr1: Don't know for sure |
18:21:33 | FromGitter | <awr1> https://nim-lang.org/docs/docgen.html |
18:22:17 | FromDiscord | <Yewpad> Hm, that is actually really nice. |
18:24:20 | FromDiscord | <Benumbed> Hmm json to reST and MD would pretty much open up the world in terms of output |
18:25:13 | FromDiscord | <Yewpad> Yeah I think a transformer could be way more better than actually touching the docgen itself. TBH I don't wanna lay hands on the docgen. Hell no |
18:25:29 | FromDiscord | <Benumbed> Donβt blame you at all haha |
18:26:16 | FromDiscord | <Benumbed> Ok back to work with me, while I still have work... :/ |
18:26:23 | FromDiscord | <Yewpad> π |
18:28:11 | Araq | just touch the docgen, there is nothing to be afraid of |
18:28:37 | * | waleee-cl joined #nim |
18:28:40 | Araq | I looked at it a minute ago, apparently it's source code |
18:28:47 | disruptek | wut |
18:29:44 | FromDiscord | <Yewpad> I feel like if anybody touches the docgen, everything falls apart. Like you would accidently bring your Domino imperium to collapse. π |
18:29:56 | * | hax-scramper quit (Ping timeout: 256 seconds) |
18:30:06 | Araq | feelings are overrated |
18:30:24 | disruptek | especially your feelings, yewpad. |
18:30:33 | * | rockcavera joined #nim |
18:30:49 | * | FromDiscord <Yewpad> Let's see if I can get his stream to crash |
18:30:50 | FromDiscord | <Benumbed> Thatβs not what Star Wars taught us!! |
18:31:09 | FromDiscord | <exelotl> I was thinking of making a proposal for custom headings for the existing docgen. As opposed to the predefined "Types", "Procedures", "Iterators" sections, which aren't the most human-friendly categorisation |
18:31:51 | * | hax-scramper joined #nim |
18:32:49 | FromDiscord | <Yewpad> With pragmas? Like `{.doccat: "Parsing".}` or `{.doccat: "Encoding".}`? (doccat = doc category) |
18:33:37 | FromDiscord | <exelotl> Maybe! Or with some custom rst directive |
18:33:42 | * | Pixeye quit (Ping timeout: 258 seconds) |
18:38:49 | FromDiscord | <Yewpad> araq: The problem with docgen is that if you make any changes to it that could cause problems, people aren't gonna be pleased. I had planned structural and even more design-specific changes. And the thing is: It is hard to please everybody. That's why I think working on a new docgen somewhere else is more practical. Otherwise, I think, we would have to build in a flags and conditions so people can do switcheroo between behavior A and B. If t |
18:39:37 | FromGitter | <eliezedeck> With `httpclient`, is it possible to send a `multipart/related ` POST request? |
18:39:53 | FromGitter | <eliezedeck> I suppose the default mode would be `multipart/form-data` |
18:39:58 | FromDiscord | <Yewpad> brb, shop will close in 20 minutes |
18:40:02 | * | gour_ joined #nim |
18:43:32 | * | gour quit (Ping timeout: 256 seconds) |
18:44:23 | FromGitter | <eliezedeck> @Araq now comes the need for a `bodyStream` for HTTP requests :/ |
18:45:26 | Araq | PR please |
18:47:18 | * | inv2004 joined #nim |
18:48:43 | FromDiscord | <Yewpad> |
18:48:43 | FromDiscord | <Yewpad> https://cdn.discordapp.com/attachments/371759389889003532/696793526381314108/20200406_204751.jpg |
18:48:48 | FromDiscord | <Yewpad> For fuck sake |
18:49:25 | FromDiscord | <Yewpad> "2m safety distance" my ass lol |
18:49:35 | FromGitter | <eliezedeck> lol |
18:49:52 | FromGitter | <eliezedeck> @Araq I'll try ... again, this is *all new* to me |
18:50:24 | * | gour_ is now known as gour |
18:54:42 | * | hax-scramper quit (Ping timeout: 256 seconds) |
18:54:50 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
18:55:30 | * | hax-scramper joined #nim |
18:55:31 | * | pbb joined #nim |
19:00:18 | * | dddddd quit (Ping timeout: 256 seconds) |
19:00:36 | krux02 | Yewpad: I have the idea in my head to allow module scoped macros that allow you to post process en intire module. With this you could write an documentation emitter as a macro. |
19:02:01 | inv2004 | Did anyone trying websockets with deflate compression? |
19:02:11 | inv2004 | ... tried ... |
19:06:42 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
19:07:43 | stefantalpalaru | Did something change in the object AST on 32-bit platforms? |
19:08:28 | * | pbb joined #nim |
19:09:37 | zacharycarter | https://gist.github.com/zacharycarter/0e97b0e88ec04ce957b3649c7fcb5f24 |
19:09:48 | zacharycarter | I'm getting an error trying to access an array on devel |
19:09:54 | zacharycarter | an element in an array rather |
19:11:23 | * | Vladar quit (Quit: Leaving) |
19:12:49 | zacharycarter | not really sure why... |
19:16:25 | zacharycarter | oh I think I know why |
19:17:02 | zacharycarter | nevermind :/ |
19:17:45 | * | Trustable quit (Read error: Connection reset by peer) |
19:18:34 | FromGitter | <eliezedeck> when contributing changes to the standard library, how can I make the compilation faster? like only compile the changes I recently made, not build everything all over again, and of course, exclude stuffs like `nimble` and `nimsuggest` from the build |
19:19:05 | disruptek | lemme know if you figure it out; i'm supposed to be adding that feature. |
19:19:33 | * | Trustable joined #nim |
19:20:12 | FromGitter | <eliezedeck> @Araq any pointers? ^ |
19:23:07 | leorize | that's by default? |
19:23:31 | FromGitter | <eliezedeck> @leorize doesn't seem to be the case |
19:23:32 | leorize | change whatever in the stdlib, then just compile a test file to see if it works |
19:24:13 | leorize | all the nim code will be processed again, but the C code will only be recompiled when any nim code changed |
19:24:18 | FromGitter | <eliezedeck> oh, right, so I don't really have to recompile the compiler for that ... |
19:24:27 | leorize | lol |
19:24:29 | FromGitter | <eliezedeck> stupid me |
19:25:39 | FromGitter | <eliezedeck> thanks @leorize :D |
19:25:52 | FromGitter | <eliezedeck> good night everyone :) |
19:33:21 | * | filcuc joined #nim |
19:43:52 | * | filcuc quit (Ping timeout: 265 seconds) |
19:44:47 | * | filcuc joined #nim |
19:50:18 | inv2004 | Q: how to extract last version of the package from nimble? I see --ver, but it does not help to show something about ver |
19:52:41 | stefantalpalaru | Any known problems with uint64 on 32-bit platforms in Nim-1.2.0? |
19:52:53 | leorize | no |
19:53:00 | leorize | did you found something? |
19:53:47 | stefantalpalaru | A weird heap corruption, but I don't know yet where it comes from: https://github.com/status-im/nim-beacon-chain/pull/829 |
19:53:48 | disbot | β₯ Bump modules to deal with the Nim 1.2 upgrade |
19:54:12 | stefantalpalaru | The "slot" field is a "distinct uint64" type. |
20:01:18 | * | liblq-dev quit (Quit: WeeChat 2.7.1) |
20:06:06 | * | filcuc quit (Ping timeout: 256 seconds) |
20:13:59 | * | inv2004 quit (Quit: Leaving) |
20:25:42 | stefantalpalaru | I got a small reproducibleprogram for you: https://github.com/nim-lang/Nim/issues/13902 |
20:25:45 | disbot | β₯ "distinct uint64" type corruption on 32-bit, when using {.borrow.} operators ; snippet at 12https://play.nim-lang.org/#ix=2h0c |
20:28:11 | leorize | stefantalpalaru: try -d:nimEmulateOverflowChecks |
20:28:45 | stefantalpalaru | No change. |
20:29:37 | stefantalpalaru | It does not look like a uint wrap-around, because that resulting value keeps changing from one run to another. |
20:31:25 | leorize | I'm using an older version of devel and these pass |
20:31:32 | leorize | 6e0c06f50e0450522b32a1bad23a3d2a4e36e9f9 |
20:31:41 | leorize | let me try to update this |
20:31:54 | stefantalpalaru | Time for a Git bisection? |
20:37:44 | zacharycarter | shashlick: is it possible to have nimterop define an enum as consts instead? There are some array member properties defined on types in the C code I'm binding to, and in the C code, the size of the arrays reference an enum |
20:38:13 | * | Zectbumo joined #nim |
20:38:21 | zacharycarter | this creates problems when using `[]` and `[]=` so I tried using cOverride and cSkypSymbol but then the arrays don't have a size in the generated Nim code from nimterop |
20:38:46 | leorize | nimterop always define enum as consts iirc |
20:38:54 | zacharycarter | hmmm |
20:38:58 | FromGitter | <zetashift> what are you up to zacharycarter? :O |
20:39:08 | zacharycarter | Hi zetashift! Working on sokol bindings right now |
20:39:19 | leorize | zacharycarter: they will be distinct cint though, so you gotta convert them back to cint |
20:39:26 | zacharycarter | hmmm |
20:40:25 | * | narimiran quit (Ping timeout: 265 seconds) |
20:41:15 | shashlick | can you post a gist to explain? |
20:41:21 | zacharycarter | sure |
20:43:32 | shashlick | also which enum - if it isn't being converted, might not be recognized by the old algorithm |
20:45:43 | * | leorize quit (Ping timeout: 240 seconds) |
20:46:33 | zacharycarter | I guess it's being defined as a const but then being coerced to another type that's declared using `defineEnum` as leorize described |
20:46:42 | zacharycarter | but I'll throw together that gist |
20:48:02 | shashlick | you might just need to implement a converter for that to work |
20:48:21 | zacharycarter | let me give that a shot |
20:49:50 | shashlick | as long as the enums are converted correctly |
20:50:08 | shashlick | check out nimterop/types.nim for the default converters for enums |
20:50:34 | zacharycarter | thanks will do |
20:53:37 | * | dddddd joined #nim |
20:55:48 | * | moerm joined #nim |
20:55:58 | moerm | Hello everyone |
21:05:07 | * | solitudesf quit (Ping timeout: 258 seconds) |
21:10:24 | * | Jesin quit (Quit: Leaving) |
21:16:06 | FromGitter | <alehander92> :)) |
21:16:58 | * | Jesin joined #nim |
21:29:22 | * | leorize joined #nim |
21:32:04 | * | filcuc joined #nim |
21:33:12 | * | sacredfrog quit (Quit: ZNC 1.7.5 - https://znc.in) |
21:34:52 | dom96 | lol whoever came up with this crazy openssl backwards compat mechanism |
21:35:01 | dom96 | There is a bug in here somewhere that's causing stack corruptions |
21:38:02 | * | sacredfrog joined #nim |
21:45:53 | Araq | hi moerm, I decided to build the SA on the "structured programming" aspects for version 1 |
21:47:34 | disruptek | holy shit it works |
21:50:10 | leorize | you cracked ic? |
21:53:42 | disruptek | i'm so bad at this. |
21:53:45 | * | Trustable quit (Remote host closed the connection) |
21:57:23 | * | filcuc quit (Ping timeout: 260 seconds) |
22:09:05 | dom96 | Someone want to help me find a corruption? |
22:09:15 | dom96 | Could use a second pair of eyes on the implementation here: https://github.com/nim-lang/Nim/blame/devel/lib/wrappers/openssl.nim#L327 |
22:10:35 | dom96 | #13903 |
22:10:38 | disbot | https://github.com/nim-lang/Nim/issues/13903 -- 3openssl wrapper corrupts stack on OpenSSL 1.1.1f + Android ; snippet at 12https://play.nim-lang.org/#ix=2h0G |
22:11:30 | moerm | Araq Hi ;) oops, sorry was largely away ... |
22:12:21 | * | gour quit (Remote host closed the connection) |
22:14:44 | leorize | dom96: it's simple, just look loadPSSLMethod implementation |
22:15:06 | leorize | it doesn't account for both method being nil |
22:15:11 | dom96 | yes |
22:15:13 | dom96 | I fixed that |
22:15:20 | * | iws joined #nim |
22:15:24 | leorize | the reason we need such stupid fix is because openssl is a living hell :p |
22:15:28 | dom96 | Noticed it too, didn't solve the problem after fixing |
22:15:59 | * | IWSnim quit (Quit: leaving) |
22:16:24 | dom96 | I stepped through it in GDB and it ends up in some unknown function, which suggests to me a stack corruption |
22:16:27 | leorize | dom96: https://github.com/nim-lang/Nim/blame/devel/lib/wrappers/openssl.nim#L285 |
22:17:00 | dom96 | I also tried to use sslModule first instead of thisModule. |
22:17:15 | leorize | this is super hacky |
22:17:24 | dom96 | I agree |
22:17:41 | leorize | but again we don't have any better choices here... |
22:17:55 | dom96 | we do actually |
22:18:14 | dom96 | but there are drawbacks |
22:18:23 | dom96 | which for some might be too much |
22:19:05 | dom96 | but we should at least give users the ability to statically tell the wrapper to link against a particular openssl version |
22:19:32 | dom96 | to be honest, I wonder if at this point the old API that this wrapper implements is even supported by OpenSSL |
22:19:52 | leorize | it's still "supported" |
22:20:07 | leorize | openssl just use C macros to redirect people to the newer symbols |
22:20:19 | leorize | but they don't care about the ABI |
22:21:16 | zacharycarter | hmm still having trouble with this enum array accessor issue - I tried writing a converter from my distinct int type that nimterop generated to int - but it doesn't seem to be getting called |
22:21:51 | zacharycarter | so I'm still not sure how to access these C arrays that use an enum value to specify their size |
22:22:03 | leorize | dom96: directly linking with openssl seems to be the only way out here |
22:22:30 | dom96 | leorize: yeah, that's what I'm using as a workaround |
22:22:36 | dom96 | had to modify the source code though :( |
22:22:58 | leorize | why? |
22:23:18 | leorize | if you use --dynlibOverride:ssl it should disable all of those hacks |
22:23:25 | dom96 | yeah, but then I cannot dynamically link |
22:23:33 | dom96 | I still want to link with my .so |
22:23:39 | leorize | you can, just use --passL |
22:23:57 | leorize | --dynlibOverride just tell Nim to not do the dlopen() dance |
22:24:05 | leorize | you can decide to link however after |
22:24:13 | dom96 | oh really |
22:24:15 | dom96 | til |
22:24:16 | dom96 | How? |
22:24:56 | leorize | --passL:"-lssl" or --passL:"/path/to/lib.so" |
22:25:44 | dom96 | Doesn't -lssl statically link? |
22:25:57 | leorize | only if you add '-static' |
22:26:27 | dom96 | hm, but then I need to grab the header files into my Android project |
22:26:28 | dom96 | meh |
22:26:39 | leorize | you don't need the headers lol |
22:27:50 | leorize | you just need the .so |
22:28:03 | leorize | the wrapper acts as your header already |
22:28:34 | leorize | if you ship the .so next to the binary, throw in `--passL:'-rpath,$ORIGIN'` <- yes, that's a literal dollar |
22:28:50 | leorize | it will tell the runtime linker to look at the current directory for .so files |
22:29:07 | dom96 | or I can just do what I'm doing now and reuse Nim's dynlib mechanism |
22:29:19 | dom96 | it's 11:30pm and I spent too much time faffing with this already :) |
22:30:41 | * | tane quit (Quit: Leaving) |
22:30:48 | iws | Is there some easy way to convert a uint8 to a signed int8? |
22:31:05 | leorize | iws: int8(your_uint8_here) |
22:31:23 | disruptek | they want an /easy/ way. |
22:31:29 | iws | I tried that actually. |
22:32:01 | iws | |
22:32:02 | iws | zoey@luna:~$ ./test |
22:32:02 | iws | /home/zoey/test.nim(2) test |
22:32:02 | iws | /home/zoey/bin/nim-1.2.0/lib/system/fatal.nim(49) sysFatal |
22:32:02 | iws | Error: unhandled exception: value out of range: 250 notin -128 .. 127 [RangeError] |
22:32:05 | iws | zoey@luna:~$ cat test.nim |
22:32:07 | iws | let u = 0xFA'u8 |
22:32:10 | iws | let x = int8(u) |
22:32:12 | iws | echo x |
22:32:15 | iws | |
22:32:16 | leorize | iws: well what are you expecting? :P |
22:32:17 | iws | I did try to read the docus :) |
22:32:22 | leorize | also don't paste |
22:32:27 | iws | oh, my appologies |
22:32:43 | leorize | if you want bit-reinterpretation then use `cast` |
22:32:51 | leorize | cast[int8](value here) |
22:33:31 | leorize | conversion like above will be subjected to bounds checking |
22:33:40 | iws | Ah, I'd seen that in the source for toUnsigned template |
22:33:45 | iws | I'll flip it around and see how it goes |
22:35:11 | iws | oh, yea, sure enough, I should have tried that first, but I figured there was a reason not to since it wasn't in the bitops lib |
22:35:14 | iws | thank you |
22:35:49 | * | natrys quit (Quit: natrys) |
22:46:59 | shashlick | @zacharycarter gist? |
22:47:13 | shashlick | Or some test code |
23:10:58 | * | moerm_ joined #nim |
23:11:31 | * | moerm quit (Read error: Connection reset by peer) |
23:13:27 | * | zacharycarter quit (Ping timeout: 260 seconds) |
23:23:47 | * | dwdv quit (Ping timeout: 265 seconds) |
23:28:46 | FromDiscord | <KingDarBoja> Hi all |
23:29:33 | FromDiscord | <Rika> hello |
23:29:43 | FromDiscord | <KingDarBoja> β€οΈ |
23:30:11 | * | rockcavera quit (Read error: Connection reset by peer) |
23:31:30 | * | moerm__ joined #nim |
23:32:10 | * | rockcavera joined #nim |
23:32:11 | * | rockcavera quit (Changing host) |
23:32:11 | * | rockcavera joined #nim |
23:34:04 | FromDiscord | <Rika> has anyone implemented a skip list in nim? |
23:35:12 | * | moerm_ quit (Ping timeout: 265 seconds) |
23:37:33 | moerm__ | cu and have a good time everyone |
23:37:37 | * | moerm__ quit (Quit: Leaving) |
23:38:43 | FromDiscord | <konsumlamm> whats the point of `|`? |
23:39:01 | * | zacharycarter joined #nim |
23:39:53 | leorize | konsumlamm: for creating type classes |
23:40:45 | FromDiscord | <konsumlamm> hmm, so that you can write multiple conditions in one line? |
23:41:50 | leorize | no, for smt like this: `proc foo(i: int | uint)` |
23:42:28 | FromDiscord | <konsumlamm> huh |
23:42:35 | FromDiscord | <konsumlamm> is it a builtin then? |
23:42:53 | FromDiscord | <konsumlamm> because its definition is just discard |
23:42:59 | * | krux02_ joined #nim |
23:44:23 | leorize | yea |
23:45:00 | FromDiscord | <konsumlamm> ah, ok |
23:45:52 | * | krux02 quit (Ping timeout: 260 seconds) |
23:47:18 | FromDiscord | <konsumlamm> i experimented a bit with it and it seems like the first time you assign something it chooses the type, is that right? |
23:47:42 | leorize | yea |
23:47:50 | FromDiscord | <konsumlamm> kk |
23:48:03 | leorize | it's generics with constraints |
23:49:36 | zacharycarter | https://imgur.com/a/WwGz3Hs - got sokol working with nimterop |
23:50:48 | FromDiscord | <Rika> cant you use `or` isntead of `|` too? |
23:51:53 | FromDiscord | <KingDarBoja> U can |
23:52:14 | FromDiscord | <KingDarBoja> At least I have seen it working the same |