01:21:36 | arfy | hi. wehn it comes to wrappers for libraries, what's the general idiom? To have a thin wrapper, with types close to the C interface, or to provide sweetened syntax? |
01:25:04 | FromDiscord | <auxym> Personal preference I guess, but I prefer an idiomatic nim API hiding the unsafe C FFI stuff under it. I'd rather not have to deal with cstrings and ptrs |
01:25:57 | * | arfy nods. I'm currently looking into the nimbass package from nimble, and it seems to be an auto-generated wrapper with ninterop |
01:28:29 | FromDiscord | <auxym> Writing a nice idiomatic nim on top is likely a lot of manual work, yeah. If you want, you can write a wrapper over the stuff you're going to use in your project only |
01:30:56 | arfy | yeah. I might do that. I really just need a simple playFile function. but bass is the library I'm familiar with. |
01:30:58 | FromDiscord | <impbox [ftsf]> A nimmy wrapper is definitely nicer to use. But a c like wrapper is better than nothing |
01:39:06 | * | arfy wonders what's coming in nim 1.6. |
01:39:26 | FromDiscord | <leorize> nimble lock file |
02:39:51 | * | arkurious quit (Quit: Leaving) |
02:48:34 | FromDiscord | <cabboose> So I started using CPS after reading all the RFCs and what not on it; it's really fun to use and im pretty stoked; is there a timeline when they will complete the compiler support for generics though? |
02:49:03 | FromDiscord | <cabboose> This thing is a weapon and I'm surprised it's not very promoted or supported |
02:49:37 | * | oprypin quit (Ping timeout: 245 seconds) |
02:54:14 | arfy | oh dear. python people will be annoyed by this. |
02:54:15 | arfy | C:\Users\arfy3>pip search bass |
02:54:15 | arfy | ERROR: XMLRPC request failed [code: -32500] |
02:54:15 | arfy | RuntimeError: PyPI's XMLRPC API is currently disabled due to unmanageable load and will be deprecated in the near future. See https://status.python.org/ for more information. |
02:55:44 | FromDiscord | <cabboose> Excellent |
02:56:58 | * | rockcavera joined #nim |
02:56:59 | * | rockcavera quit (Changing host) |
02:56:59 | * | rockcavera joined #nim |
02:57:38 | arfy | nim. taking over the world, one language at a time. mwhahahahaha. |
03:10:58 | FromDiscord | <impbox [ftsf]> In reply to @cabboose "So I started using": I don't really understand it, but glad it's awesome. |
03:11:04 | * | oprypin joined #nim |
03:50:44 | FromDiscord | <gogolxdong (liuxiaodong)> Is there any known issues of showing svg with jester? |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.2.1) |
04:06:03 | * | nrds quit (*.net *.split) |
04:06:03 | * | perro quit (*.net *.split) |
04:06:05 | * | Yardanico quit (*.net *.split) |
04:06:05 | * | Ekho quit (*.net *.split) |
04:06:05 | * | greyrat quit (*.net *.split) |
04:06:05 | * | oz quit (*.net *.split) |
04:06:14 | * | Yardanico joined #nim |
04:06:15 | * | nrds joined #nim |
04:06:17 | * | perro joined #nim |
04:07:28 | * | ox joined #nim |
04:07:30 | * | greyrat joined #nim |
04:07:45 | * | supakeen joined #nim |
04:19:25 | * | NimBot joined #nim |
04:19:26 | * | aaaaaaaaaa joined #nim |
04:19:35 | * | mikko joined #nim |
04:19:38 | * | djanatyn joined #nim |
04:20:25 | * | Ekho joined #nim |
04:23:27 | * | arkanoid joined #nim |
04:25:05 | * | happycorsair[m] joined #nim |
04:25:35 | * | nixfreak_nim[m] joined #nim |
04:27:25 | FromDiscord | <impbox [ftsf]> showing svg is client side so as long as you can serve the file it should be no problem |
04:44:10 | * | rockcavera quit (Remote host closed the connection) |
05:12:01 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
05:30:38 | * | bkay quit (Quit: Leaving) |
05:32:33 | FromDiscord | <PsychoClay> how do i iterate over a sharedtable? |
06:14:07 | NimEventer | New thread by Doongjohn: Discard vs var _ {.global.} =, see https://forum.nim-lang.org/t/8417 |
06:41:41 | * | max22- joined #nim |
06:42:04 | * | jjido joined #nim |
06:44:10 | NimEventer | New thread by Alexeypetrushin: How to convert range types 'a'..'z'?, see https://forum.nim-lang.org/t/8418 |
07:28:48 | * | PMunch joined #nim |
08:06:50 | * | neurocyte joined #nim |
08:06:50 | * | neurocyte quit (Changing host) |
08:06:50 | * | neurocyte joined #nim |
08:17:49 | FromDiscord | <Varriount> @treeform Congrats on the Hacker News posts! |
08:19:52 | PMunch | Damn, two things on the front page at the same time, congrats! |
08:20:52 | arkanoid | damn, wow |
08:21:57 | arkanoid | should I wrap js types as "object" or "ref object" for ffi? |
08:22:28 | Zevv | treeform is on a roll, right |
08:28:38 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:34:43 | PMunch | Huh, I have to say nimPNG is a pretty neat library |
08:35:07 | PMunch | I just created a 255x255 image montage by simply copying the pixels around |
08:35:22 | PMunch | Tried to do the same with imagemagick but it just kept crashing |
08:39:14 | FromDiscord | <impbox [ftsf]> yeah, it's pretty rad |
08:39:35 | * | max22- quit (Quit: Leaving) |
08:40:29 | * | max22- joined #nim |
08:41:31 | PMunch | Now to just find a program that can actually open this 155648 x 98304 monstrosity :P |
09:07:01 | FromDiscord | <tandy> is there an md5 library for the javascript backend? |
09:11:17 | PMunch | Hmm, kinda hard to know if I managed to actually create the image properly when I don't have any program that will open it.. |
09:20:09 | FromDiscord | <Rika> Nothing can open something that large? |
09:20:16 | FromDiscord | <Rika> I’d imagine something could |
09:25:45 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3yJu |
09:30:11 | * | Gustavo6046 joined #nim |
09:31:09 | * | aaaaaaaaaa is now known as madprops |
09:31:09 | * | madprops quit (Changing host) |
09:31:09 | * | madprops joined #nim |
10:08:43 | NimEventer | New thread by Ul: How to get the next iterator value outside of the loop?, see https://forum.nim-lang.org/t/8419 |
10:13:00 | * | Vladar joined #nim |
10:15:05 | FromDiscord | <tandy> why was `nimble develop` behaviour changed? |
10:15:14 | FromDiscord | <tandy> its kinda anoying \:o( |
10:17:23 | FromDiscord | <Rika> What changed |
10:22:43 | * | robertmeta quit () |
10:23:00 | * | robertmeta joined #nim |
10:37:49 | FromDiscord | <tandy> im not sure, but i cant do nimble develop in a folder to use the local copy instead of git |
10:39:16 | * | oprypin quit (Ping timeout: 252 seconds) |
10:41:20 | FromDiscord | <Rika> ? |
10:41:32 | FromDiscord | <Rika> Go in the folder, then type only “nimble develop” |
10:43:50 | FromDiscord | <impbox [ftsf]> Yeah that changed in 1.6 according to the forum post |
10:46:31 | FromDiscord | <tandy> i cry |
10:59:52 | PMunch | Hmm, given a module like this: http://ix.io/3yJX/nim |
11:01:02 | PMunch | I can use it like you would expect from a second module: http://ix.io/3yK1/nim |
11:01:34 | PMunch | But `nim doc m1` just gives me `Exported = Test` which isn't all that helpful.. |
11:01:50 | FromDiscord | <Rika> I was about to ask what was wrong lol |
11:02:07 | * | pro joined #nim |
11:02:48 | PMunch | I mean I generate this code with a macro, so I could throw in a when defined(nimdoc) switch.. |
11:03:01 | PMunch | And replicate all the code there.. |
11:04:51 | * | pro quit (Client Quit) |
11:06:29 | Mister_Magister | hello i want to get time in two different timezones but i can't quite get around that :/ do you maybe have some snippet? |
11:18:19 | FromDiscord | <enthus1ast> Does this mean one has to commit every change?↵(@impbox [ftsf]) |
11:25:59 | Mister_Magister | screw that i just subtracted 6 hours :D |
11:28:10 | arkanoid | I'm wrapping a js lib with karax. I'm having success in calling functions and stuff, but I'm unsure how I should deal with linking css and js file. How would you do that? |
11:58:42 | FromDiscord | <Innokentiy Sokolov> <@&371760044473319454@Zynah who PMed me and tried to scam or compromise my Steam account with some bullshit he made up? |
11:59:15 | FromDiscord | <Innokentiy Sokolov> hi everyone) |
11:59:34 | FromDiscord | <Yardanico> done |
11:59:42 | FromDiscord | <Innokentiy Sokolov> thanks man! |
12:00:10 | * | oprypin joined #nim |
12:00:37 | FromDiscord | <enthus1ast> hi! |
12:00:37 | * | max22- quit (Remote host closed the connection) |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.2.1) |
12:06:30 | * | supakeen joined #nim |
12:08:41 | * | max22- joined #nim |
12:10:55 | NimEventer | New thread by Ggibson: How to build devel these days? (pre 1.6), see https://forum.nim-lang.org/t/8420 |
12:13:10 | FromDiscord | <Yardanico> can't answer rn, answer him that he needs to use csources_v1 and that build_all.sh clones that by itself :) |
12:31:32 | PMunch | @Yardanico, I answered him for you :) |
12:33:47 | * | rockcavera joined #nim |
12:33:47 | * | rockcavera quit (Changing host) |
12:33:47 | * | rockcavera joined #nim |
12:38:41 | * | maxime_ joined #nim |
12:40:18 | * | max22- quit (Ping timeout: 268 seconds) |
12:47:38 | FromDiscord | <tandy> https://news.ycombinator.com/item?id=28506220 |
12:47:43 | FromDiscord | <tandy> pixie is on hn |
12:47:55 | PMunch | @tandy, Genny is as well |
12:48:01 | PMunch | Or at least it was earlier today |
12:48:14 | FromDiscord | <tandy> was pixie made to support fidget2? |
12:54:19 | PMunch | Hmm, how would I add a comment to a type definition in a macro? |
12:55:00 | PMunch | I tried to add it to the nnkRecList, but while repr outputs it fine I get an error complaining about illformed AST |
12:55:40 | FromDiscord | <haxscramper> it is not possible to construct type definition with comments |
12:55:53 | FromDiscord | <haxscramper> the only toplevel entry with documentation comments that you can create is proc def |
12:56:27 | PMunch | But they can have comments in real code? |
12:57:00 | FromDiscord | <Gumber aka Zachary Carter> In reply to @Innokentiy Sokolov "<@&371760044473319454> could someone please": Hey, glad Yard helped you out, but in the future please provide a screenshot so we can confirm they're a spammer / scammer |
12:57:13 | FromDiscord | <haxscramper> yes, they can have comment in real code↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
12:57:19 | FromDiscord | <haxscramper> but `.comment` is not accessible in macros |
12:57:35 | FromDiscord | <haxscramper> and type/var definition comments are placed in `.comment` |
12:57:47 | FromDiscord | <haxscramper> and proc definitinos are not placed anywhere but parsed as `nnkCommentStmt` |
12:59:02 | PMunch | Hmm, well that's annoying.. |
13:01:47 | FromDiscord | <haxscramper> sent a long message, see http://ix.io/3yKB |
13:02:07 | * | kayabaNerve_ joined #nim |
13:02:19 | FromDiscord | <haxscramper> Maybe I should write RFC for `.comment`, because for those who do write documentation comments and do care about macros generating something usable this is needed |
13:02:44 | FromDiscord | <haxscramper> Otherwise we would end up waiting for several years in the end |
13:02:56 | FromDiscord | <haxscramper> And getting v2 AST structure that breaks all existing code |
13:03:12 | FromDiscord | <haxscramper> Maybe his opinion changed on that matter again since I last asked though |
13:03:44 | * | oprypin quit (Ping timeout: 268 seconds) |
13:04:03 | FromDiscord | <haxscramper> https://github.com/nim-lang/Nim/issues/8516 |
13:04:22 | * | kayabaNerve quit (Ping timeout: 252 seconds) |
13:04:45 | PMunch | In the meantime it's apparently possible to get .comment set by using parseStmt: http://ix.io/3yKC/nim |
13:04:52 | PMunch | It's a bit of a hack, but it works.. |
13:05:29 | FromDiscord | <haxscramper> yes, just kill me please |
13:05:45 | FromDiscord | <haxscramper> I can also `exec` nim compiler to `nim doc --json` |
13:05:54 | FromDiscord | <haxscramper> Same level of usability |
13:07:06 | PMunch | Slightly less of a hack: use quote do |
13:10:16 | FromDiscord | <haxscramper> `quote(field: int ##[ DOcumentation ]##)` ? |
13:10:40 | FromDiscord | <haxscramper> ` expected: ')', but got: 'DOcumentation '` |
13:11:35 | PMunch | This is what I'm using: http://ix.io/3yKF/Nim |
13:11:56 | PMunch | Seems to be impossible to get anything into that comment programatically though.. |
13:15:39 | * | oprypin joined #nim |
13:16:01 | * | rockcavera quit (Remote host closed the connection) |
13:16:35 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
13:18:42 | FromDiscord | <haxscramper> Well, having access to this would be extremely useful for all sorts of auto-codegen thigns |
13:19:05 | FromDiscord | <haxscramper> Though ideally toplevel entries should not be generated from macros, it makes things harder to figure out |
13:19:16 | FromDiscord | <haxscramper> But at the same time sometimes it is inevitable |
13:20:58 | FromDiscord | <Innokentiy Sokolov> In reply to @Gumber "Hey, glad Yard helped": Sure no problem! Can do this straight away - I can PM to any moderator with the screenshots - just knock-knock to me ) |
13:21:35 | * | arkurious joined #nim |
13:22:43 | FromDiscord | <Gumber aka Zachary Carter> It's all good |
13:22:53 | FromDiscord | <Gumber aka Zachary Carter> It's just nice to have proof before we click the b7 button |
13:24:04 | FromDiscord | <Rika> bseven? |
13:25:46 | FromDiscord | <Innokentiy Sokolov> In reply to @Gumber "It's just nice to": got it thanks! |
13:28:28 | FromDiscord | <Gumber aka Zachary Carter> In reply to @Rika "bseven?": B& |
13:28:45 | FromDiscord | <Gumber aka Zachary Carter> banned |
13:29:24 | FromDiscord | <Gumber aka Zachary Carter> https://www.urbandictionary.com/define.php?term=B7 |
13:29:59 | FromDiscord | <Gumber aka Zachary Carter> I don't even know why I started using it - I think I spent too much time on some stupid message board in my early twenties haha |
13:30:49 | FromDiscord | <Rika> b& is more understandable |
13:31:03 | nrds | <Prestige99> bampersand |
13:40:44 | * | oprypin quit (Ping timeout: 268 seconds) |
13:42:07 | PMunch | Apparently it goes: Banned > Band > B& > B7 |
13:42:25 | PMunch | I have & on the 6 key though.. |
13:43:03 | supakeen | scandinavian detected |
13:48:24 | PMunch | :D |
13:49:03 | PMunch | Damn, I'm trying to convert this massive montage image into something that feh can display (it doesn't like the PNG format it's in for some reason) |
13:49:15 | PMunch | Currently it's using 382Gb of cache.. |
13:49:36 | PMunch | The image is "only" 804Mb.. |
13:57:33 | FromDiscord | <tandy> does anyone know if karax supports async procs? |
13:57:53 | * | oprypin joined #nim |
13:59:03 | FromDiscord | <tandy> is kajax the only way to make api requests in the client browser? |
14:00:02 | * | ox is now known as oz |
14:11:19 | PMunch | tandy, well you can use the ajax call library directly |
14:11:34 | PMunch | Hmm, my doc comment hack doesn't appear to work for enums.. |
14:16:09 | PMunch | Hmm, can't I comment on a importc procedure? |
14:18:28 | * | PMunch quit (Quit: Leaving) |
14:18:58 | FromDiscord | <Yardanico> you can, just do it below the proc |
14:19:03 | FromDiscord | <tandy> the problem is i have some api bindings which i ported to the javascript backend so that I could use them in the browser with karax↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
14:19:04 | FromDiscord | <Yardanico> with indentation iirc |
14:20:49 | * | oprypin quit (Ping timeout: 268 seconds) |
14:30:17 | FromDiscord | <QueenFuckingAdrielle> does anyone have good example of type declaration, proc signature, and calling with multiple generic types? |
14:32:30 | * | oprypin joined #nim |
14:38:36 | FromDiscord | <cabboose> Trying out Elijahrs lockfreequeues; they fail to compile as a field of an object under orc but succeeds with refc gc |
14:38:48 | FromDiscord | <cabboose> rip |
14:38:55 | FromDiscord | <cabboose> sent a code paste, see https://play.nim-lang.org/#ix=3yL4 |
14:39:00 | FromDiscord | <Yardanico> In reply to @QueenFuckingAdrielle "does anyone have good": the tutorial probably? :) |
14:39:14 | FromDiscord | <cabboose> sent a code paste, see https://play.nim-lang.org/#ix=3yL5 |
14:39:41 | FromDiscord | <Yardanico> https://nim-lang.org/docs/tut1.html#procedures https://nim-lang.org/docs/tut1.html#advanced-types https://nim-lang.org/docs/tut2.html#generics |
14:48:34 | FromDiscord | <cabboose> you're my only hope \:') |
14:48:37 | FromDiscord | <cabboose> sent a code paste, see https://play.nim-lang.org/#ix=3yL8 |
14:50:15 | FromDiscord | <haxscramper> no, I don't know how to debug good-for-refc-bad-for-orc errors |
14:50:26 | FromDiscord | <haxscramper> You might've hit a bug |
14:50:38 | * | oprypin quit (Ping timeout: 268 seconds) |
14:50:41 | FromDiscord | <cabboose> rip |
14:50:42 | FromDiscord | <haxscramper> If you can minimize it you migth ask in #internals |
14:50:52 | FromDiscord | <haxscramper> Or on forum |
14:51:03 | FromDiscord | <cabboose> cheers |
14:51:35 | FromDiscord | <haxscramper> Yes, I've been in this situation as well, but I basically ended up with "requires refc" check |
14:51:49 | FromDiscord | <haxscramper> `when not <uses refc>: error` |
14:56:04 | FromDiscord | <cabboose> sent a code paste, see https://play.nim-lang.org/#ix=3yLb |
14:56:18 | FromDiscord | <leorize> looks minimal |
14:57:57 | FromDiscord | <leorize> one day auto minimization will be a reality |
14:58:27 | FromDiscord | <leorize> well it kinda is with disruptek's dust, the only issue is that it doesn't work \:p |
14:58:34 | FromDiscord | <cabboose> Going to try latest devel first or people will yell at me (still on 9/1 nightly) |
14:59:06 | FromDiscord | <cabboose> Yep still chopped |
14:59:17 | FromDiscord | <cabboose> I'll post to nim issues; cheers |
15:00:05 | FromDiscord | <leorize> we fixed cps for newer compilers so you can migrate up now \:p |
15:01:52 | * | oprypin joined #nim |
15:02:01 | FromDiscord | <cabboose> image.png https://media.discordapp.net/attachments/371759389889003532/886990105372426290/image.png |
15:02:01 | FromDiscord | <cabboose> I'm glad this is not a reality anymore |
15:02:02 | FromDiscord | <cabboose> thank you |
15:03:56 | * | eph joined #nim |
15:21:55 | FromDiscord | <enthus1ast> i'm trying to do a "distinct select" with ormin |
15:22:18 | FromDiscord | <enthus1ast> does one know how/if this is possible? |
15:22:49 | FromDiscord | <enthus1ast> or, can i insert sql literally into the generated query? |
15:24:17 | FromDiscord | <enthus1ast> i want to generate this sql\:`select DISTINCT checkName from checkruns;` |
15:24:21 | FromDiscord | <isd> Has anyone seen this kind of message before? https://media.discordapp.net/attachments/371759389889003532/886995722266894419/unknown.png |
15:25:19 | FromDiscord | <cabboose> You wouldnt happen to have the file opened accidentally in a editor or something? |
15:25:21 | FromDiscord | <isd> (edit) "Has anyone seen this kind of message before? ... https://media.discordapp.net/attachments/371759389889003532/886995722266894419/unknown.png" added "This was totally unexpected for me because I tried just to run https://rosettacode.org/wiki/Walk_a_directory/Non-recursively#Nim" |
15:28:13 | FromDiscord | <isd> indeed yes, thank you roboto @cabboose |
15:28:32 | FromDiscord | <cabboose> Meep morp |
15:38:18 | FromDiscord | <QueenFuckingAdrielle> In reply to @Yardanico "the tutorial probably? :)": lol i went through it 😛 just looking for myObject: [T, A] --> [int, float] |
15:38:24 | FromDiscord | <QueenFuckingAdrielle> i figured it out |
15:39:54 | FromDiscord | <cabboose> 💯🤟❤️ |
15:45:18 | * | oprypin quit (Ping timeout: 268 seconds) |
15:55:34 | * | oprypin joined #nim |
16:01:27 | NimEventer | New thread by Serge: How do you create a <div> with Nim dom? , see https://forum.nim-lang.org/t/8421 |
16:05:33 | * | tdc joined #nim |
16:06:02 | FromDiscord | <Rika> nimdom sounds like kingdom + nim |
16:08:00 | FromDiscord | <auxym> if I want to import a C function via `{.header., importc.}`, but the header requires that the `#include`ing file defines a bunch of `#defines` to configure it, what are my options? Use `{.emit.}` to set the defines? |
16:08:36 | FromDiscord | <haxscramper> `header: "#define AAA\n#include BBB"` |
16:08:38 | FromDiscord | <haxscramper> `header` can contain anything |
16:08:57 | FromDiscord | <haxscramper> But this won't be a 'configuration' |
16:09:02 | nrds | <Prestige99> impbox if you're here, I started looking into sdl and it's awesome. Thanks for the recommendation |
16:10:18 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3yLL |
16:10:48 | FromDiscord | <haxscramper> `.emit.` works very weirdly for this use case, since it is emitted once |
16:10:54 | FromDiscord | <haxscramper> But header might have to be included multiple times |
16:11:11 | FromDiscord | <auxym> Thanks, that's what I had in mind! |
16:11:58 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3yLM |
16:12:16 | FromDiscord | <auxym> emit might fit my use cas better though? I have to include {.header.} for a dozen or so functions from the same header (in the same file), but only need to set the defines once |
16:12:53 | FromDiscord | <haxscramper> it is not possible to guarantee emit placement |
16:13:17 | FromDiscord | <haxscramper> It might end up in the middle of some proc, instantiated once |
16:13:22 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3yLP |
16:13:51 | FromDiscord | <haxscramper> While you need `header` to be present in every single file where you use C library |
16:14:07 | FromDiscord | <haxscramper> Since nim generates undefined number of C files, you have to do it via header |
16:14:17 | FromDiscord | <enthus1ast> maybe you can define them with --passc |
16:14:22 | FromDiscord | <haxscramper> Maybe there is another workaround I'm not aware of |
16:14:48 | FromDiscord | <cabboose> Well no other human would have a chance of knowing it if you dont |
16:14:49 | FromDiscord | <haxscramper> Yes, this would work as well. `--passc:-DLIBMACRO=VALUE` |
16:14:57 | FromDiscord | <haxscramper> it is global |
16:15:15 | FromDiscord | <haxscramper> You can place all the necessary defined in the`{.passc:` section of your library |
16:15:24 | FromDiscord | <haxscramper> In this case configuration would be global |
16:15:39 | FromDiscord | <haxscramper> But that is not much different from directly using `header` |
16:21:04 | FromDiscord | <enthus1ast> (i know having to select stuff, then remove doublicates indicates a database design mistake... ) |
16:21:51 | FromDiscord | <cabboose> Man cps is fucking baller |
16:22:04 | FromDiscord | <cabboose> I wrote this; without using closures or anything |
16:22:12 | FromDiscord | <cabboose> sent a code paste, see https://play.nim-lang.org/#ix=3yLQ |
16:22:36 | FromDiscord | <cabboose> with that cwait I have it swapped to another thread and then back so i only do io bs on one thread |
16:22:39 | FromDiscord | <cabboose> so juicy |
16:23:13 | FromDiscord | <cabboose> and don't have to be concerned about doing a bunch of callbacks or anything like that |
16:23:37 | FromDiscord | <cabboose> devs pls bring generic support |
16:27:29 | FromDiscord | <auxym> @haxscramper @enthus1ast Global is indeed what I want (I think), so `{.passC.}` does seem like a good option. I'll run some tests |
16:31:35 | FromDiscord | <auxym> The nim docs (https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-header-pragma) don't seem to mention that you can put arbitrary text in `{.header.}`. The example only shows `{.header.: "<stdint.h>"}`, doesn't even have the `#include` |
16:33:06 | FromDiscord | <haxscramper> well |
16:33:19 | FromDiscord | <haxscramper> I can tell you what sanity levels I was on when I figured that out |
16:34:05 | FromDiscord | <haxscramper> But in general nim doc is missing some stuff like this, because otherwise it would mean enumerating all possible combinations of all pragmas |
16:34:13 | FromDiscord | <haxscramper> With examples |
16:34:40 | FromDiscord | <haxscramper> So basically no sane person is able to come up with use cases, so nobody ever thought about putting them in docs |
16:34:58 | FromDiscord | <haxscramper> Like when you might want to use `byref` instead of `bycopy` when wrapping C++ stuff |
16:38:37 | * | PMunch joined #nim |
16:41:10 | FromDiscord | <Yardanico> In reply to @cabboose "with that cwait I": wait but why are you using newAsyncHttpClient? |
16:41:27 | FromDiscord | <Yardanico> there won't be any difference from normal newHttpClient since cps is not really compatible with nim's async so you'll have to run it in another thread anyway |
16:41:38 | FromDiscord | <Yardanico> or write a proper cps-compatible http client |
16:42:00 | FromDiscord | <cabboose> It is being run in another thread |
16:42:28 | FromDiscord | <Yardanico> yes, so there's no difference between newAsyncHttpClient and newHttpClient |
16:42:33 | FromDiscord | <Yardanico> in fact newHttpClient will be better for you |
16:42:54 | FromDiscord | <cabboose> except I will have lots of queued requests wont I? |
16:42:57 | FromDiscord | <Yardanico> ? |
16:43:10 | FromDiscord | <cabboose> if a client request is big I don't want it to block |
16:43:16 | FromDiscord | <Yardanico> you still use async in that separate thread where you run newAsyncHttpClient or not? |
16:43:24 | FromDiscord | <cabboose> yea |
16:43:29 | FromDiscord | <Yardanico> can you show the code? |
16:44:00 | FromDiscord | <auxym> @haxscramper >I can tell you what sanity levels I was on when I figured that out Yeah, I can imagine D: |
16:44:12 | * | rockcavera joined #nim |
16:44:13 | * | rockcavera quit (Changing host) |
16:44:13 | * | rockcavera joined #nim |
16:44:23 | FromDiscord | <cabboose> gimme a sec |
16:48:16 | FromDiscord | <cabboose> https://github.com/shayanhabibi/cpslearning/blob/main/common.nim↵(@Yardanico) |
16:48:50 | FromDiscord | <Yardanico> interesting |
16:52:52 | * | maxime__ joined #nim |
16:55:51 | * | maxime_ quit (Ping timeout: 265 seconds) |
16:56:33 | FromDiscord | <dom96> What does cps buy you here? Why not just use async on its own? |
16:57:11 | FromDiscord | <cabboose> I guess I can scale it easier in my mind and the code just fits better for me in making sense of it |
16:57:32 | FromDiscord | <cabboose> I'm just playing with it atm; my original pharmacy project is written completely with async |
16:58:02 | FromDiscord | <cabboose> the ability to transfer these little stacks is pretty nifty though |
16:58:55 | FromDiscord | <cabboose> The cps will be more heavily used as I go deeper into it; I'm just learning to play around with it \:) |
16:59:14 | FromDiscord | <cabboose> it's fun! |
17:30:36 | * | oprypin quit (Read error: Connection reset by peer) |
17:30:38 | * | oprypin_ joined #nim |
17:35:33 | Zevv | so, what did you get running yet? |
17:39:29 | FromDiscord | <cabboose> Well... I... shut up... I am still playing with my feet here |
17:40:35 | * | oprypin_ quit (Quit: Bye) |
17:40:55 | * | oprypin joined #nim |
17:42:35 | * | PMunch quit (Quit: leaving) |
17:46:34 | * | Guest16 joined #nim |
18:00:14 | FromDiscord | <ismustachio> sent a long message, see http://ix.io/3yMd |
18:00:22 | madprops | so i found this https://forum.nim-lang.org/t/2742 |
18:01:03 | madprops | kind of a funny request |
18:01:49 | FromDiscord | <ismustachio> (edit) "http://ix.io/3yMd" => "http://ix.io/3yMg" |
18:02:25 | madprops | btw any library to read/write metadata on audio files? |
18:06:50 | FromDiscord | <Recruit_main707> @ismustachio a: ref Test1 is of type `ref ref object` because Test1 is implicitly a ref object already |
18:09:22 | * | notchris quit () |
18:09:36 | * | notchris joined #nim |
18:09:58 | FromDiscord | <cabboose> none off the top of the head; have you checked nimble?↵(<@709044657232936960_madprops=5b=49=52=43=5d>) |
18:12:39 | FromDiscord | <ismustachio> @Recruit_main707 thank you very much! |
19:04:02 | NimEventer | New thread by HerdingSheep: Beginer problem: Combine and alternate list, see https://forum.nim-lang.org/t/8422 |
19:09:59 | * | stkrdknmibalz joined #nim |
19:22:16 | * | leth joined #nim |
19:27:27 | * | Guest16 quit (Quit: Client closed) |
19:52:57 | FromDiscord | <jakkn> sent a code paste, see https://play.nim-lang.org/#ix=3yMI |
19:56:17 | NimEventer | New thread by Elcritch: How to create C defines from Nim?, see https://forum.nim-lang.org/t/8423 |
19:59:36 | * | stkrdknmibalz quit (Read error: Connection reset by peer) |
20:14:31 | * | Guest16 joined #nim |
20:14:56 | * | Guest16 left #nim (#nim) |
20:30:46 | * | maxime__ quit (Remote host closed the connection) |
20:38:18 | * | max22- joined #nim |
20:45:18 | FromDiscord | <Recruit_main707> @jakkn cstring is bascially a `char`, i assume c#'s string is a class which will have more stuff and you cant just pass it like that, try to find a way to turn c#'s strings into a `char` |
20:54:26 | * | supakeen quit (Remote host closed the connection) |
20:54:50 | * | supakeen joined #nim |
20:55:36 | FromDiscord | <Varriount> Zevv: Just an FYI, the bulk of the time spent compiling my SQL grammar isn't spent by NPeg, it's spent by the Nim compiler and C compiler. |
21:04:07 | FromDiscord | <tandy> when using var objects, do you need to return a var object? |
21:07:00 | FromDiscord | <Recruit_main707> you cant return var objects, var means the argument is variable, (implicitly a pointer) and you can edit it |
21:07:19 | * | Vladar quit (Quit: Leaving) |
21:07:28 | FromDiscord | <tandy> oh cool |
21:12:27 | FromDiscord | <Varriount> In reply to @Recruit_main707 "you cant return var": Well, you can have a "var" return type, but it isn't quite the same thing. |
21:31:46 | FromDiscord | <Varriount> sent a long message, see http://ix.io/3yN3 |
21:33:10 | FromDiscord | <tandy> dam \:(↵`Error: 'user' is of type <var User> which cannot be captured as it would violate memory safety, declared here:` |
21:33:43 | nrds | <Prestige99> I'm attempting to get this rendering example working for sdl2: https://github.com/treeform/pixie/blob/master/examples/realtime_sdl.nim but the screen doesn't seem to clear between frames. Anyone have experience with this lib? |
21:34:27 | FromDiscord | <Elegantbeef> I think the issue is that your textture isnt cleared every frame |
21:34:38 | nrds | <Prestige99> Ah good point |
21:34:39 | FromDiscord | <Varriount> In reply to @jakkn "hi, I'm a nim": Oh, and one that trips up people quite often: the Nim compiler automatically determines whether a procedure's parameter will be passed by pointer or by copy (by value). This is true even for procedures marked with a calling convention (`cdecl`, etc.). If you need a custom type to be passed a certain way, use the `byref` or `bycopy` pragmas. |
21:36:24 | * | tdc quit (Ping timeout: 268 seconds) |
21:37:44 | FromDiscord | <tandy> oo nice↵(@Varriount) |
21:38:38 | FromDiscord | <tandy> where is the documentation for this? |
21:40:01 | FromDiscord | <tandy> also how do u use multiple pragma at once? |
21:43:37 | FromDiscord | <tandy> this is it right? |
21:43:42 | FromDiscord | <tandy> sent a code paste, see https://paste.rs/4ka |
21:43:45 | * | supakeen quit (Remote host closed the connection) |
21:44:09 | * | supakeen joined #nim |
21:46:39 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3yNc |
21:47:11 | FromDiscord | <Recruit_main707> `{.pragma, anotherpragma.}` |
21:47:36 | FromDiscord | <tandy> ahh yes↵(@Recruit_main707) |
22:01:09 | FromDiscord | <tandy> hmm okay |
22:01:37 | FromDiscord | <tandy> so the issue occurs when the object is instantiated in one module, but edited in another |
22:14:24 | * | max22- quit (Quit: Leaving) |
22:15:22 | FromDiscord | <fae> whats the best way to disambiguate operators? e.g. I'm importing vmath, but i want to do just normal division between two floats using system./ |
22:18:48 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3yNl |
22:20:41 | FromDiscord | <Elegantbeef> But afaik vmath doesnt override `float / float` |
22:24:06 | FromDiscord | <fae> ah i was actually trying to divide a float by an int, but i just realized that system doesnt even support that either |
22:24:17 | FromDiscord | <fae> if i use two floats then vmaths generic procs dont interfere, thanks |
22:24:31 | FromDiscord | <Elegantbeef> If you want to support that `import std/leniantops` |
22:24:36 | FromDiscord | <Elegantbeef> Of spelled correctly 😛 |
22:25:15 | FromDiscord | <fae> but `system.\`/`\(a,b)` also works nicely |
22:25:28 | FromDiscord | <fae> (edit) "`system.\`/`\(a,b)`" => "`system./(a,b)`" |
22:25:54 | FromDiscord | <fae> i guess you cant escape backticks in single line code snippets huh |
22:26:10 | FromDiscord | <Elegantbeef> I think you can but idk how |
22:26:19 | FromDiscord | <Elegantbeef> Might be two graves |
22:38:18 | * | PersonMcGuy joined #nim |
22:42:23 | PersonMcGuy | Hello all, has anyone ever got the error: "cannot 'importc' variable at compile time; c_memmove" |
22:42:52 | PersonMcGuy | I was using the base58 library under stew and it was working fine, then all of sudden it started throwing this error |
22:42:55 | FromDiscord | <Elegantbeef> You're attempting to use a procedure which require C interop at compile time |
22:43:30 | FromDiscord | <Elegantbeef> You're attempting to use apart of it at compile time, so assigning a const or inside a `static:` |
22:44:14 | PersonMcGuy | But I had been using it fine with no problems with interop at all |
22:44:32 | FromDiscord | <Elegantbeef> Any link to your code? |
22:44:49 | PersonMcGuy | And I guess technically the errors is coming out of system.nim: 2232 |
22:45:51 | PersonMcGuy | Ah. Nevermind I just realized where I goofed. |
22:45:59 | FromDiscord | <Elegantbeef> you're building for JS? |
22:46:15 | FromDiscord | <Elegantbeef> Ah nvm that's not js |
22:46:15 | FromDiscord | <Elegantbeef> I've got superb reading skills |
22:46:26 | PersonMcGuy | I had it working with a var and I guess I copy and pasted the call on to a const |
22:48:01 | PersonMcGuy | Thanks again for the help as always. How have you been? I hope you're doing okay |
22:48:22 | FromDiscord | <Elegantbeef> Bashing my head into jsgen, so take that as my present state |
22:50:07 | PersonMcGuy | Huh, never seen that area before. Looks... involved. lol |
22:51:37 | FromDiscord | <Elegantbeef> Well it's taking Nim and ouputting it into a language with different semantics so it's "fun" to say the least |
22:52:08 | FromDiscord | <Elegantbeef> One of my bug fixes made an issue evident in the js gen so i have to fix that before making a PR |
22:52:43 | PersonMcGuy | How does it even handle dynamic typing? |
22:52:59 | FromDiscord | <Elegantbeef> It doesnt handle it |
22:53:02 | FromDiscord | <Elegantbeef> It handles it on the nim side and lets js do what it will |
22:53:45 | FromDiscord | <tandy> [Elegantbeef](https://matrix.to/#/@elegantbeef:matrix.org)\: since ur doing javascript stuff do u kno if its possible to pass a var object to a proc to update its values with js? |
22:53:58 | FromDiscord | <tandy> im going slightly mad with this issue |
22:54:07 | FromDiscord | <Elegantbeef> Why wouldnt it be |
22:54:15 | FromDiscord | <tandy> yeah.. |
22:54:19 | FromDiscord | <Elegantbeef> You were attempting to use a closure with a `var object` |
22:54:31 | FromDiscord | <Elegantbeef> As such nim's safety said "No" since the reference can outlive the closure |
22:54:54 | FromDiscord | <Elegantbeef> you can use a `ptr object` instead for the closure which should work on JS |
22:55:13 | FromDiscord | <Elegantbeef> But on C/C++ it might be unsafe as the closure can outlive the place of "borrowing" |
22:55:47 | FromDiscord | <tandy> hmmm |
22:56:09 | FromDiscord | <tandy> maybe that will fix it |
22:56:20 | FromDiscord | <Elegantbeef> Well it'll fix it but it's unsafe |
22:57:14 | FromDiscord | <tandy> i considered just using indexedDB to store the data that im passing around |
22:57:29 | FromDiscord | <tandy> is that the wiser approach? |
22:58:38 | FromDiscord | <Elegantbeef> you could also just use an `ref object` if you wanted |
22:58:50 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3yNr here's that unsafe behaviour |
22:59:45 | FromDiscord | <tandy> thats what i was doing before, but when i run `discard updateObject(object)` it doesnt actually store anything in `object` |
23:01:41 | FromDiscord | <tandy> scary |
23:16:26 | * | PersonMcGuy quit (Quit: Client closed) |
23:42:30 | * | leth quit (Quit: no reason) |