00:03:38 | FromDiscord | <leorize> @auxym\: you on arch linux? |
00:03:50 | FromDiscord | <auxym> ...yes |
00:04:07 | FromDiscord | <auxym> well, manjaro, but yes |
00:04:20 | FromDiscord | <leorize> blame their maintainer for modifying compile flags when they don't understand it |
00:04:42 | FromDiscord | <leorize> you just have to edit /etc/nim/nim.cfg to change the cflags |
00:04:58 | FromDiscord | <auxym> maintainers of the nim package? |
00:05:33 | FromDiscord | <auxym> alright. Or I'll use choosenim I guess. thanks a lot for the info |
00:05:42 | FromDiscord | <leorize> yea, if you look at the pkgbuild, it overrides the default with whatever was the cflags at makepkg time |
00:06:15 | FromDiscord | <auxym> wow. any idea if anyone filed a bug? Otherwise I might look into it |
00:06:26 | * | lucerne quit (Quit: Ping timeout (120 seconds)) |
00:06:53 | FromDiscord | <leorize> I think I saw one before, but not sure |
00:07:24 | * | lucerne joined #nim |
00:17:26 | FromDiscord | <leorize> https://bugs.archlinux.org/task/67092 |
00:21:57 | FromDiscord | <auxym> good find, my search didnt turn it up |
00:23:45 | * | Pyautogui quit (Quit: Connection closed) |
01:01:37 | nrds | <Prestige99> would `=destroy` be called on a ref object if it were assigned to `nil`? |
01:01:44 | nrds | <Prestige99> or is it only scoping |
01:04:16 | FromDiscord | <Elegantbeef> I believe it's any destruction, make a test and use orc/arc to see π |
01:19:46 | * | arkurious quit (Quit: Leaving) |
01:29:06 | * | neurocyte6 joined #nim |
01:29:06 | * | neurocyte6 quit (Changing host) |
01:29:06 | * | neurocyte6 joined #nim |
01:30:29 | FromDiscord | <gogolxdong (liuxiaodong)> Does nim-eth include evm? |
01:31:11 | * | neurocyte quit (Ping timeout: 268 seconds) |
01:31:11 | * | neurocyte6 is now known as neurocyte |
01:33:35 | nrds | <Prestige99> Hm if it does @Elegantbeef it'd be very useful for c libs |
01:33:46 | nrds | <Prestige99> looking at sdl_mixer atm |
01:33:54 | nrds | <Prestige99> Have to free loaded audio files |
01:36:23 | FromDiscord | <impbox [ftsf]> ergh sdl_mixer is terrible |
01:36:27 | FromDiscord | <impbox [ftsf]> wish they'd kill that library |
01:36:36 | FromDiscord | <impbox [ftsf]> better off just using sdl audio and mixing yourself |
01:36:38 | nrds | <Prestige99> Should I be using something else? |
01:36:42 | nrds | <Prestige99> :o |
01:37:15 | nrds | <Prestige99> I've been learning and setting up sdl mixer for the last ~hour lol |
01:38:26 | FromDiscord | <impbox [ftsf]> maybe it's fine if your requirements are really basic |
01:38:45 | FromDiscord | <Gumber aka Zachary Carter> you could check out SoLoud |
01:38:57 | FromDiscord | <Elegantbeef> soloud, openal, ... |
01:39:00 | nrds | <Prestige99> Just playing sfx and music for games, nothing fancy (yet?) |
01:39:02 | FromDiscord | <Gumber aka Zachary Carter> https://github.com/jarikomppa/soloud |
01:39:05 | nrds | <R2D299> itHub: 7"Free, easy, portable audio engine for games" |
01:39:29 | FromDiscord | <Gumber aka Zachary Carter> I had problems with SoLoud several years ago when I was working on Frag |
01:39:36 | FromDiscord | <Gumber aka Zachary Carter> but tmk the author has done a ton of work on it since then |
01:39:40 | FromDiscord | <Elegantbeef> Seems prestige yea it's only scope based afaik |
01:39:40 | FromDiscord | <Varriount> _notes that no-one mentions Allegro_ |
01:39:55 | FromDiscord | <Gumber aka Zachary Carter> so I'm sure the situation has improved quite a bit - it was already a good library when I picked it up |
01:39:57 | FromDiscord | <Gumber aka Zachary Carter> Allegro is good |
01:40:09 | nrds | <Prestige99> Ah that's unfortunate Beef, could've been very useful lol |
01:40:28 | nrds | <Prestige99> SoLoud looks pretty neat |
01:40:35 | FromDiscord | <impbox [ftsf]> Allegro, i haven't heard of that for years |
01:40:43 | FromDiscord | <impbox [ftsf]> I liked it back in the day |
01:41:11 | FromDiscord | <Varriount> My college game development course used it. |
01:41:58 | FromDiscord | <Gumber aka Zachary Carter> I wrote like five lines of code for my game today before my covid made me want to go lay down and take a nap lol |
01:42:09 | FromDiscord | <Varriount> π¦ |
01:42:16 | FromDiscord | <Gumber aka Zachary Carter> I'm almost over it I think but my god it's annoying how long it's lasting - been almost a week now since I started feeling crappy |
01:42:45 | FromDiscord | <Gumber aka Zachary Carter> tried to take a hot shower this evening and had to sit down on the bench in the shower because I was having trouble breathing and getting dizzy lol |
01:43:18 | nrds | <Prestige99> 'If you're planning to make a multi-million budgeted console game, this library is (probably) not for you' well I guess SoLoud is out :P |
01:43:24 | FromDiscord | <impbox [ftsf]> maybe i'll split out nico's audio mixer to a separate module |
01:43:29 | nrds | <Prestige99> jk lol but I'll probably stick with sdl for now |
01:43:39 | nrds | <Prestige99> What are you using for audio in nico? |
01:43:42 | FromDiscord | <Gumber aka Zachary Carter> yeah I mean SoLoud might very well be over / under kill |
01:43:46 | FromDiscord | <impbox [ftsf]> sdl2 |
01:43:50 | FromDiscord | <impbox [ftsf]> but not sdl_mixer |
01:43:53 | nrds | <Prestige99> ah |
01:44:05 | FromDiscord | <Gumber aka Zachary Carter> there's also - https://github.com/yglukhov/sound |
01:44:08 | nrds | <R2D299> itHub: 7"Cross-platform sound mixer library" |
01:44:12 | FromDiscord | <Gumber aka Zachary Carter> and uh I guess - https://github.com/treeform/slappy |
01:44:15 | nrds | <R2D299> itHub: 7"3d sound api for nim." |
01:44:17 | FromDiscord | <Gumber aka Zachary Carter> I've only used `sound` before |
01:44:50 | nrds | <Prestige99> I'm making a little wrapper for sdl mixer to make the api simple for my engine, we'll see how it goes |
01:44:56 | nrds | <Prestige99> could always change it I suppose |
01:45:14 | FromDiscord | <auxym> `arm-none-eabi/bin/ld: cannot find -ldl` ring a bell for anyone? Nim is adding `-ldl` to linker args, I'm trying to cross compile for ARM using arm-none-eabi-gcc (maybe @PMunch ?) |
01:47:06 | FromDiscord | <Gumber aka Zachary Carter> the only time I ever cross compiled anything for ARM for Nim was for this project -https://github.com/fragworks/frag-android/blob/master/Dockerfile |
01:47:27 | FromDiscord | <Gumber aka Zachary Carter> and uh, I don't believe I was using `arm-none-eabi-gcc` |
01:47:59 | FromDiscord | <auxym> yeah arm-none-eabi-gcc is for bare metal MCUs, no linux |
01:48:49 | FromDiscord | <Gumber aka Zachary Carter> gotcha |
01:49:00 | FromDiscord | <auxym> pretty sure I don't want `-ldl` (something to do with dynamic linking, correct?), but not sure why nim is adding it |
01:49:04 | FromDiscord | <Gumber aka Zachary Carter> yeah |
01:49:16 | FromDiscord | <Anuke> In reply to @Gumber "I had problems with": I've been using Soloud for a while now and it still has some pretty major bugs |
01:49:18 | FromDiscord | <Elegantbeef> Prestige something like this may work for if you dont have multiple references to an object https://play.nim-lang.org/#ix=3z1a |
01:50:09 | FromDiscord | <Varriount> Prestige: If you're willing to give a flat-rate portion of revenue for any commercial game, you could use https://fmod.com |
01:50:34 | FromDiscord | <Elegantbeef> Obviously for best experience of the GC hooks use orc/arc |
01:51:02 | nrds | <Prestige99> Probably not @Varriount but thanks for the link |
01:52:32 | FromDiscord | <Gumber aka Zachary Carter> In reply to @auxym "pretty sure I don't": maybe cause of - https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L109-L127? |
01:52:34 | FromDiscord | <Gumber aka Zachary Carter> (edit) "https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L109-L127?" => "https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L109-L127 ?" |
01:53:08 | FromDiscord | <Gumber aka Zachary Carter> can probably override those in your own `nim.cfg` |
01:53:11 | FromDiscord | <Gumber aka Zachary Carter> sorry |
01:53:15 | FromDiscord | <Gumber aka Zachary Carter> `config.nims` is what I meant |
01:53:19 | FromDiscord | <auxym> yes, probably, I'm thinking I have to override `gcc.options.linker` in my nim.cfg |
01:53:23 | FromDiscord | <Gumber aka Zachary Carter> yeah exactly |
01:53:26 | FromDiscord | <impbox [ftsf]> Prestige, what are you making? |
01:53:47 | nrds | <Prestige99> Just a simple 2d game engine, for fun |
01:53:48 | FromDiscord | <auxym> I'm wondering though why `@if unix` is hit? bug? |
01:53:56 | nrds | <Prestige99> Trying to get it ready to participate in game jams |
01:54:02 | FromDiscord | <impbox [ftsf]> cool, those are fun =) |
01:54:18 | nrds | <Prestige99> Yeah - I've only done one (with Godot) but I had a lot of fun |
01:56:08 | FromDiscord | <Gumber aka Zachary Carter> In reply to @auxym "I'm wondering though why": I'm trying to figure out where `unix` is defined |
01:56:10 | FromDiscord | <impbox [ftsf]> more nim game jammers =) |
01:56:18 | FromDiscord | <impbox [ftsf]> LD49 coming up soon |
01:56:34 | nrds | <Prestige99> oh how soon? I haven't thought about it |
01:56:40 | nrds | <Prestige99> I just started on this engine lol |
01:56:48 | FromDiscord | <impbox [ftsf]> oct 2-5 |
01:57:05 | FromDiscord | <Anuke> wonder if I'll have my framework functional again by the time ld49 comes up |
01:57:09 | nrds | <Prestige99> hm yeah I don't think this'll be ready unless I really grind away at it |
01:57:40 | FromDiscord | <impbox [ftsf]> just use whichever bits work at the time |
01:57:57 | FromDiscord | <Gumber aka Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=3z1d |
01:58:10 | FromDiscord | <Gumber aka Zachary Carter> I guess those are the operating systems that are considered unix |
01:58:47 | FromDiscord | <auxym> In reply to @Gumber "I'm trying to figure": FYI overriding `gcc.options.linker` with `-static` does get rid of the error. Getting a whole crapton of linker errors now (https://pastebin.com/90feh27T), but that'll be for another time, getting tired. |
01:58:48 | FromDiscord | <impbox [ftsf]> usually i use jams as an excuse to add new features to my framework |
01:59:05 | nrds | <Prestige99> That's my plan as well :) |
01:59:05 | FromDiscord | <auxym> sent a code paste, see https://play.nim-lang.org/#ix=3z1e |
02:01:44 | FromDiscord | <Gumber aka Zachary Carter> huh... |
02:01:51 | FromDiscord | <Gumber aka Zachary Carter> yeah this is out of my realm of expertise I think |
02:02:02 | FromDiscord | <Gumber aka Zachary Carter> I haven't tried to do much with SBCs / MBCs and bare metal |
02:02:07 | FromDiscord | <impbox [ftsf]> `--os:none` ? |
02:03:37 | FromDiscord | <auxym> `Error: unknown OS: 'none'. Available options are: DOS, Windows, OS2, Linux, MorphOS, SkyOS, Solaris, Irix, NetBSD, FreeBSD, OpenBSD, DragonFly, AIX, PalmOS, QNX, Amiga, Atari, Netware, MacOS, MacOSX, iOS, Haiku, Android, VxWorks, Genode, JS, NimVM, Standalone, NintendoSwitch, FreeRTOS, Any` π |
02:04:21 | FromDiscord | <impbox [ftsf]> sorry |
02:04:32 | FromDiscord | <impbox [ftsf]> @auxym are you importing a package that'd trying to link something? |
02:04:47 | FromDiscord | <impbox [ftsf]> other than -ldl is it passing any other -l arguments? |
02:04:57 | FromDiscord | <impbox [ftsf]> actually no that won't tell you nm |
02:04:58 | FromDiscord | <auxym> nah, really just trying to get a "hello world" trivial thing going |
02:05:40 | FromDiscord | <auxym> The root seems to be that Nim, or the default nim.cfg, seems to consider os:any as unix |
02:05:57 | FromDiscord | <impbox [ftsf]> when you build it should tell you which config files are used |
02:06:05 | FromDiscord | <impbox [ftsf]> check those config files for linker options being passed |
02:06:30 | FromDiscord | <impbox [ftsf]> i've encountered distros putting weird stuff in /etc/nim/ config files |
02:11:39 | FromDiscord | <auxym> Yeah, I did have an issue with the /etc/nim/nim.cfg file on arch, I cp'd the file from nim git in there |
02:13:12 | FromDiscord | <impbox [ftsf]> nothing about -ldl in there? |
02:14:07 | FromDiscord | <auxym> only this https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L109-L127 which is under `@if unix`, so it seems that nim considers any as unix |
02:41:44 | * | stkrdknmibalz joined #nim |
02:50:10 | FromDiscord | <cabboose> sent a code paste, see https://play.nim-lang.org/#ix=3z1j |
03:24:29 | FromDiscord | <cabboose> Ok if I make a distinct int and shove it inside of an Atomic |
03:24:35 | FromDiscord | <cabboose> can I still use fetchAdd etc |
03:24:49 | FromDiscord | <cabboose> or will I have to define/borrow the procedures for arithmetic |
03:32:46 | FromDiscord | <cabboose> If I cast a uint32 to uint16 will it truncate the top 16 bits for me? or is it safer to apply a mask first |
03:33:44 | FromDiscord | <impbox [ftsf]> it'll just be looking at the first 16 bits |
03:33:50 | FromDiscord | <cabboose> huzzah |
03:34:13 | FromDiscord | <Elegantbeef> Cast is a bit reintepretation so it matches from the first bit to the end of the new type |
03:34:38 | FromDiscord | <Elegantbeef> So casting a large value from a small type is very very dangerous π |
03:34:55 | FromDiscord | <impbox [ftsf]> surprise data! |
03:34:57 | FromDiscord | <cabboose> Yeah that's the idea though |
03:35:10 | FromDiscord | <impbox [ftsf]> casting from a larger type to smaller type should be safe |
03:35:14 | FromDiscord | <cabboose> it's either that or apply a mask to get the first 16 bits anyway |
03:35:15 | FromDiscord | <impbox [ftsf]> at least for uints |
03:35:26 | FromDiscord | <cabboose> yeah no sign stored |
03:35:29 | FromDiscord | <cabboose> surely right |
03:35:44 | FromDiscord | <Elegantbeef> Well it's always safe large -\> small just a question of if the data modified is sensible |
03:35:55 | FromDiscord | <impbox [ftsf]> yep, depends how you then use that data whether it's safe |
03:36:14 | FromDiscord | <impbox [ftsf]> but uints will be less surprising |
03:36:27 | FromDiscord | <cabboose> It's pretty well controlled; it won't exceed the high(uint16) |
03:36:43 | FromDiscord | <cabboose> it's just an atomic counter, but it's storing two counts within one 32 bit uint |
03:36:52 | FromDiscord | <Elegantbeef> Well it cannot exceed |
03:37:30 | FromDiscord | <Elegantbeef> `cast[uint16](321321u32)` is only the first 16 bits `uint16(321321u32)` is a type conversion and runs a procedure to convert |
03:37:37 | FromDiscord | <cabboose> ah |
03:37:39 | FromDiscord | <Elegantbeef> the former will not error the latter will |
03:37:48 | FromDiscord | <cabboose> Yep yep the former is what I need |
03:37:53 | FromDiscord | <cabboose> coolio |
03:37:54 | FromDiscord | <cabboose> cheers |
03:38:03 | FromDiscord | <Elegantbeef> cast is a type system thing of saying "This is now X" |
03:39:07 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3z1q |
03:39:10 | FromDiscord | <impbox [ftsf]> if you wanna split it into 2 uint16s |
03:40:35 | FromDiscord | <cabboose> and if I want to add to the high 16 in the Atomic uint32 i'd add 1 shl 16? or 1 shl 15 |
03:40:51 | FromDiscord | <impbox [ftsf]> you don't need to bother if you use the array method above |
03:41:02 | FromDiscord | <cabboose> the Atomic though |
03:41:09 | FromDiscord | <cabboose> won't be able to do fetch adds that way |
03:42:11 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3z1s |
03:42:25 | FromDiscord | <impbox [ftsf]> (edit) "https://play.nim-lang.org/#ix=3z1s" => "https://play.nim-lang.org/#ix=3z1t" |
03:42:58 | FromDiscord | <cabboose> that's not wrapped in atomic operations though right? |
03:42:59 | FromDiscord | <impbox [ftsf]> now the split is a uint16 "view" of the uint32 |
03:43:06 | FromDiscord | <impbox [ftsf]> inc is atomic? |
03:43:24 | FromDiscord | <cabboose> but I mean data would be Atomic[uint32] |
03:43:35 | FromDiscord | <cabboose> can I do the cast etc? |
03:43:35 | FromDiscord | <cabboose> cool |
03:43:40 | FromDiscord | <cabboose> I had no idea |
03:43:40 | FromDiscord | <impbox [ftsf]> ok, i'm not familiar with Atomic type |
03:43:41 | FromDiscord | <cabboose> lol |
03:43:50 | FromDiscord | <Elegantbeef> Yea you should be able to do the cast |
03:43:51 | FromDiscord | <cabboose> rip |
03:44:04 | FromDiscord | <cabboose> Aw sick |
03:44:07 | FromDiscord | <Elegantbeef> since the first/only field is `T` |
03:45:02 | FromDiscord | <cabboose> I see; I guess I'm used to locks and thinking that that memory is somehow protected, but it's not really then. It's just the Atomic[T] provides access to guaranteed atomic procedures right? |
03:45:03 | FromDiscord | <cabboose> otherwise it's all the same shit |
03:45:20 | FromDiscord | <Elegantbeef> I do not know i'm only giving answers on the type/cast safety |
03:45:34 | FromDiscord | <impbox [ftsf]> if you cast then you'll be circumventing the type safety checks |
03:45:48 | FromDiscord | <impbox [ftsf]> so if Atomic is doing special stuff it'll be bypassing them |
03:47:06 | FromDiscord | <impbox [ftsf]> trying to look up nim atomics https://en.wikipedia.org/wiki/Nuclear_Instrumentation_Module |
03:47:09 | FromDiscord | <cabboose> Hmmm. Guess there's no way to know without throwing a threads at it |
03:47:09 | FromDiscord | <cabboose> mratsim would actually be a good source |
03:47:25 | FromDiscord | <impbox [ftsf]> or just try it and see |
03:47:26 | FromDiscord | <cabboose> hahahaha |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2.1) |
04:06:31 | * | supakeen joined #nim |
04:10:53 | FromDiscord | <codic> ah yes, the nuclear instrumentation module |
04:11:10 | FromDiscord | <codic> absolutely perfect nim atomics |
04:19:28 | * | rockcavera quit (Remote host closed the connection) |
04:57:20 | FromDiscord | <gogolxdong (liuxiaodong)> Is startdust opensourced? |
04:57:46 | * | crem quit (Ping timeout: 268 seconds) |
05:12:49 | arfy | today's random question. how does one convert a single character string to a char? I think variable[0] would be one way. |
05:13:07 | FromDiscord | <impbox [ftsf]> that should be fine |
05:13:21 | FromDiscord | <impbox [ftsf]> if you're sure it has one character in it |
05:13:31 | FromDiscord | <impbox [ftsf]> and it's ascii |
05:14:38 | arfy | a char in nim is the same as a char in c. uint8_t |
05:15:07 | FromDiscord | <Elegantbeef> a char in nim is a type safe uint8 practically yes |
05:18:56 | FromDiscord | <impbox [ftsf]> is there something like tmpfile(3) in nim? |
05:19:17 | FromDiscord | <impbox [ftsf]> or mkstemp |
05:19:54 | FromDiscord | <Elegantbeef> Could use a memory mapped file? |
05:20:39 | FromDiscord | <Elegantbeef> Quite possibly those two functions are wrapped in one of the hidden unix/posix libraries |
05:21:16 | FromDiscord | <impbox [ftsf]> hmm seems like there's std/tempfiles |
05:21:19 | FromDiscord | <impbox [ftsf]> in devel maybe |
05:21:20 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/posix.html#mkstemp%2Ccstring |
05:21:36 | * | sagax joined #nim |
05:21:41 | FromDiscord | <Elegantbeef> Indeed |
05:21:50 | FromDiscord | <Elegantbeef> https://nim-lang.github.io/Nim/tempfiles.html devel docs to the rescue! |
05:22:10 | FromDiscord | <impbox [ftsf]> i guess i'll use the posix stuff for now |
05:22:50 | FromDiscord | <Elegantbeef> There are even nicer APIs in `posix_utils` |
05:23:21 | FromDiscord | <impbox [ftsf]> oh good, the posix ones are ugly with cstring |
05:26:56 | FromDiscord | <impbox [ftsf]> dang, of course, doesn't work on windows shakes fist |
05:27:06 | FromDiscord | <Elegantbeef> Ah that was a given due to `posix` |
05:27:44 | FromDiscord | <Rika> who needs windows |
05:27:45 | FromDiscord | <Rika> smh |
05:27:47 | FromDiscord | <Elegantbeef> Memory mapped file might be the easiest |
05:27:59 | FromDiscord | <Elegantbeef> They're pretty good to look outside |
05:28:30 | FromDiscord | <impbox [ftsf]> figured windows would have implemented posix by now =p |
05:29:23 | FromDiscord | <Elegantbeef> There is a tempfile package in nimble |
05:32:34 | FromDiscord | <impbox [ftsf]> \o/ that works |
05:42:50 | FromDiscord | <impbox [ftsf]> hmm `execProcess("foo.exe", args = [tmpFilename], options={poEchoCommand, poUsePath})` -> `foo.exe C:\Users\user\AppData\Local\Temp\tmpmDcEG4UO.foo` |
05:43:02 | FromDiscord | <impbox [ftsf]> unforuntately it doesn't quote the filename |
05:43:08 | FromDiscord | <impbox [ftsf]> but if i add quotes myself it quotes the quotes |
05:47:42 | FromDiscord | <Rika> i believe for that file name, quotes are not needed |
05:48:00 | FromDiscord | <impbox [ftsf]> they are for the \ s |
05:48:23 | FromDiscord | <Elegantbeef> Did you try single or double quotes? |
05:48:28 | FromDiscord | <impbox [ftsf]> double |
05:48:57 | FromDiscord | <impbox [ftsf]> will try single |
05:49:01 | FromDiscord | <Rika> when you run it, does the filename appear fucked in the application? i dont recall windows needing quotes |
05:49:12 | FromDiscord | <Elegantbeef> You know if nim just calls `$(arg)` it'd show double quotes |
05:49:41 | FromDiscord | <Elegantbeef> Saying that as in "ya know i just thought" |
05:50:07 | FromDiscord | <impbox [ftsf]> foo.exe returns `C:UsersuserAppDataLocalTemptmpCHqXkp8C.foo: No such file or directory` |
05:50:13 | FromDiscord | <impbox [ftsf]> when it's not quoted |
05:50:48 | FromDiscord | <cabboose> prefix the string with r |
05:50:54 | FromDiscord | <cabboose> r for raw dogging |
05:51:02 | FromDiscord | <impbox [ftsf]> single quotes seems to work |
05:51:08 | FromDiscord | <impbox [ftsf]> doesn't get double escaped |
05:51:10 | FromDiscord | <Elegantbeef> The args are passed to `quoteShell` so i imagine it shouldnt be needed |
05:51:59 | FromDiscord | <Elegantbeef> `let needQuote = {' ', '\t'} in s or s.len == 0` |
05:52:19 | FromDiscord | <Elegantbeef> That explains why it's' not quoting |
05:56:55 | FromDiscord | <Elegantbeef> Eh it's been fixed! https://github.com/nim-lang/Nim/issues/18670 |
05:57:31 | FromDiscord | <impbox [ftsf]> whoa |
06:02:41 | * | blackbeard420 quit (Quit: ZNC 1.8.2 - https://znc.in) |
06:11:12 | * | blackbeard420 joined #nim |
06:11:49 | FromDiscord | <cabboose> image.png https://media.discordapp.net/attachments/371759389889003532/887943839082504212/image.png |
06:11:52 | FromDiscord | <cabboose> am I missing something |
06:11:54 | FromDiscord | <cabboose> because in C6 |
06:12:01 | FromDiscord | <cabboose> aren't they just obliterating the value |
06:12:09 | FromDiscord | <cabboose> since they've shifted a uint16 by 16 bits to the left... |
06:12:27 | FromDiscord | <cabboose> I think they cooked their pseudocode |
06:12:48 | FromDiscord | <cabboose> oh wait |
06:12:49 | FromDiscord | <cabboose> I get it |
06:12:50 | FromDiscord | <cabboose> nvrm |
06:12:53 | FromDiscord | <cabboose> fuck |
06:13:02 | FromDiscord | <cabboose> v is a uint32 |
06:13:16 | FromDiscord | <cabboose> so i should cast finalcount to uint32 first |
06:13:20 | FromDiscord | <cabboose> rip |
06:13:40 | FromDiscord | <Elegantbeef> well convert |
06:13:41 | FromDiscord | <cabboose> I AM CONVERTING |
06:13:42 | FromDiscord | <cabboose> ;\_; |
06:14:00 | FromDiscord | <Elegantbeef> Sorry but in Nim cast != conversion so i get a bit nervous hearing casting π |
06:14:13 | FromDiscord | <Rika> cab did u even sleep |
06:14:19 | FromDiscord | <cabboose> Oh; no I am casting |
06:14:20 | FromDiscord | <cabboose> I am cast lord |
06:14:26 | FromDiscord | <cabboose> I did rika; it was beautiful |
06:14:37 | FromDiscord | <cabboose> I am just losing my mental state |
06:14:39 | FromDiscord | <cabboose> \<3 |
06:14:39 | FromDiscord | <Rika> its not obvious with how ur behaving |
06:14:55 | FromDiscord | <cabboose> this is me rika; just love me for who I am |
06:14:57 | FromDiscord | <Elegantbeef> this is just cabboose in my experience |
06:30:49 | * | crem joined #nim |
06:39:07 | FromDiscord | <impbox [ftsf]> trying to use dimscord to post messages on a timer rather than in response to users, has anyone done this? |
06:40:46 | FromDiscord | <Elegantbeef> Do you still need the messageCreate event handler? |
06:41:16 | FromDiscord | <impbox [ftsf]> probably not |
06:41:43 | FromDiscord | <Elegantbeef> Well eitherway you can probably have an async started from in `onReady` that loops and sends the message |
06:41:54 | FromDiscord | <Elegantbeef> async loop\ |
06:42:10 | FromDiscord | <impbox [ftsf]> hmmm /me has to lern to async |
06:43:12 | FromDiscord | <Elegantbeef> Well i dont know async much either, but if you just ping rika they're all about async π |
06:43:28 | FromDiscord | <cabboose> use cps |
06:43:34 | FromDiscord | <Elegantbeef> I knew you were going to say that |
06:43:48 | FromDiscord | <impbox [ftsf]> copy paste style, yeah i do that |
06:43:53 | FromDiscord | <cabboose> xxx |
06:43:59 | FromDiscord | <cabboose> hahahaha rip |
06:44:01 | FromDiscord | <impbox [ftsf]> (edit) "copy paste style," => "Copy Paste from Stackoverflow ," |
06:44:06 | FromDiscord | <Elegantbeef> continuation passing style \:D |
06:44:25 | FromDiscord | <impbox [ftsf]> yeah i know, i don't get that shit yet |
06:44:36 | FromDiscord | <impbox [ftsf]> just gimme while true and sleep =p |
06:44:42 | FromDiscord | <Elegantbeef> I dont much myself either |
06:44:43 | FromDiscord | <Rika> Itβs almost as effortless as normal async so |
06:44:58 | FromDiscord | <cabboose> https://github.com/shayanhabibi/cpslearning/blob/main/cpsdrive.nim |
06:44:59 | FromDiscord | <Elegantbeef> Yea but impbox and I dont do async |
06:45:12 | FromDiscord | <Rika> Is that yours can |
06:45:15 | FromDiscord | <Rika> Cab |
06:45:22 | FromDiscord | <cabboose> yis |
06:45:39 | FromDiscord | <Rika> Just think of βawaitβ as βswitch to another threadβ |
06:45:49 | FromDiscord | <Rika> If you donβt have await, nothing will switch |
06:46:02 | FromDiscord | <cabboose> except you have to poll it eventually |
06:46:16 | FromDiscord | <cabboose> I mean that is unavoidable |
06:46:23 | FromDiscord | <Rika> It will come back to your thread after what you awaited completes |
06:46:37 | FromDiscord | <Rika> The delay can be short or long depending on what else is running |
06:46:38 | FromDiscord | <cabboose> oh is this your dimscord thing? |
06:47:09 | FromDiscord | <impbox [ftsf]> trying to make dimscord post a daily message |
06:47:12 | FromDiscord | <Elegantbeef> Is rika really explaining async? π |
06:47:39 | FromDiscord | <Rika> It depends on your level of async knowledge |
06:47:46 | FromDiscord | <Rika> Itβs hard to tell |
06:47:46 | FromDiscord | <cabboose> wait is dimscord yours Rika? |
06:47:50 | FromDiscord | <Rika> No |
06:47:58 | FromDiscord | <cabboose> Because async isn't run on another thread |
06:48:02 | FromDiscord | <cabboose> and you have to eventually call poll |
06:48:04 | FromDiscord | <Rika> I say thread but |
06:48:05 | FromDiscord | <cabboose> or do a run forever |
06:48:06 | FromDiscord | <cabboose> or something |
06:48:09 | FromDiscord | <Rika> I donβt mean literal thread |
06:48:10 | FromDiscord | <cabboose> or waitFor |
06:48:24 | FromDiscord | <Rika> I know |
06:48:27 | FromDiscord | <Rika> Iβm not stupid |
06:48:31 | FromDiscord | <cabboose> I know |
06:48:34 | FromDiscord | <cabboose> but this is my segway |
06:48:37 | FromDiscord | <cabboose> into advertisement |
06:48:40 | FromDiscord | <cabboose> here at CPS |
06:48:47 | FromDiscord | <Rika> Go away |
06:48:55 | FromDiscord | <cabboose> π |
06:48:56 | FromDiscord | <Rika> Advertisement bad |
06:49:14 | FromDiscord | <Elegantbeef> Wait rika said go, they want us to use Go |
06:49:26 | FromDiscord | <Elegantbeef> See you i'm going to use one of the most terribly designed languages imo |
06:49:43 | FromDiscord | <cabboose> Isn't that a oriental board game |
06:49:48 | FromDiscord | <Rika> Good, you deserve it |
06:49:48 | FromDiscord | <cabboose> surely its not a language |
06:49:59 | FromDiscord | <Rika> I canβt tell if cab is joking or not |
06:52:39 | FromDiscord | <cabboose> Good |
06:53:01 | FromDiscord | <cabboose> But seriously; it's also a board game right? |
06:53:10 | FromDiscord | <Rika> Yes I know the board game |
06:55:42 | FromDiscord | <impbox [ftsf]> nim? |
06:55:50 | FromDiscord | <gogolxdong (liuxiaodong)> How to pass parameter for web3 contract constructor? |
06:59:18 | * | PMunch joined #nim |
07:02:57 | * | tdc joined #nim |
07:22:42 | * | Vladar joined #nim |
07:23:56 | * | max22- joined #nim |
07:25:33 | * | pro joined #nim |
07:27:40 | * | pro quit (Client Quit) |
07:42:11 | * | darwillim86d quit (Quit: Connection closed for inactivity) |
07:50:38 | FromDiscord | <impbox [ftsf]> so with async, i can do `discard await doThing()` can i do `await doThing() andThen doAnotherThing()` ? |
07:52:33 | FromDiscord | <dom96> You just call the second procedure with await after the first |
07:54:40 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3z29 |
07:54:59 | FromDiscord | <impbox [ftsf]> _goes and reads your book_ |
07:55:30 | FromDiscord | <dom96> Yeah |
07:55:35 | FromDiscord | <impbox [ftsf]> awesome, thanks! |
07:57:06 | FromDiscord | <dom96> In reply to @impbox "trying to use dimscord": Iβm on mobile but Iβve got a StardustAnnouncer repo on GitHub which does this |
07:57:21 | FromDiscord | <impbox [ftsf]> i've figured it out thanks! =) |
07:57:35 | FromDiscord | <impbox [ftsf]> running a while true: in onReady did the trick |
07:58:17 | FromDiscord | <dom96> Cool |
08:05:57 | * | federico3 quit (Ping timeout: 245 seconds) |
08:11:21 | PMunch | Hmm, there is no newfangled way of calling a macro given a NimNode right? |
08:21:09 | * | max22- quit (Quit: Leaving) |
08:21:49 | FromDiscord | <Elegantbeef> What do you mean? |
08:22:22 | FromDiscord | <cabboose> [planetis](https://matrix.to/#/@planetis:matrix.org)\: I was told you can maybe help me with something |
08:23:02 | FromDiscord | <cabboose> I need a passover read of the algorithms and comments in this if you have a spare moment |
08:23:16 | FromDiscord | <cabboose> https://github.com/shayanhabibi/loony |
08:23:19 | nrds | <R2D299> itHub: 7"Experimenting to make a high throughput MPMC lock-free queue based on a paper by Giersch, Nolte et al." |
08:24:30 | FromDiscord | <gogolxdong (liuxiaodong)> https://stardust.dev/play/ |
08:29:20 | NimEventer | New thread by Hoijui: How to download at compile-time?, see https://forum.nim-lang.org/t/8430 |
08:34:19 | FromDiscord | <planetis> @cabboose whats up? |
08:34:48 | FromDiscord | <planetis> note iam quite a noob myslef |
08:35:15 | FromDiscord | <cabboose> Disruptek said you might be interested in it |
08:36:40 | FromDiscord | <planetis> sure |
08:37:30 | FromDiscord | <planetis> what are the banned boys up to? |
08:38:03 | FromDiscord | <cabboose> Something about haemorrhoids |
08:39:27 | FromDiscord | <planetis> ahahahha |
08:40:41 | FromDiscord | <cabboose> Shit already noticed L97 on queue.nim hasnβt been updated with the procedure for allocating the node |
08:40:47 | FromDiscord | <cabboose> maybe thatβs whatβs corking me |
08:41:11 | FromDiscord | <planetis> 2022? |
08:41:16 | FromDiscord | <cabboose> and L109 lol |
08:41:16 | FromDiscord | <cabboose> yep |
08:41:40 | FromDiscord | <cabboose> Itβs been published online but the journal is yet to be published in paperback |
08:41:41 | FromDiscord | <cabboose> thats the date of paperback publication |
08:43:16 | FromDiscord | <planetis> ok thx |
08:49:41 | FromDiscord | <planetis> was it by any chance already ported to other languages as well? (with sources opensourced that is) |
08:49:52 | FromDiscord | <cabboose> c++ |
08:49:56 | FromDiscord | <cabboose> linked in the readme |
08:50:04 | FromDiscord | <cabboose> but as for ports to other languages I don' |
08:50:06 | FromDiscord | <cabboose> t believe so |
08:50:12 | PMunch | @ElegantBeef, I meant getting a piece of my NimNode tree that I know will return a value that I want if called. I want to call it |
08:50:26 | FromDiscord | <cabboose> it's only a couple months old |
08:50:32 | PMunch | Normally I would write one macro parsing the input and then rewriting it to be a new macro call |
08:52:43 | FromDiscord | <Elegantbeef> Seems like that's the only way if i understand rightly |
08:53:04 | FromDiscord | <Elegantbeef> Given you want to evaulate a tree |
08:53:46 | PMunch | It has been the only way of doing it, I was just wondering if someone had made a new cool way of doing it |
08:54:54 | FromDiscord | <Elegantbeef> id have to ask if you bindsym the outer macro so you dont need to export it π |
08:55:24 | PMunch | Huh? |
08:57:32 | FromDiscord | <Elegantbeef> Something like this https://play.nim-lang.org/#ix=3z2j |
08:59:25 | FromDiscord | <Elegantbeef> it allows you do this chained macro emitting without exporting all the macros used if that's a something you care about |
09:00:59 | PMunch | Isn't that done automatically |
09:01:05 | FromDiscord | <cabboose> After reaching operation on L237 on queue.nim it SIGSEVS |
09:01:37 | FromDiscord | <Elegantbeef> It's done automatically if you use quote do or similar i guess |
09:02:27 | PMunch | Ah right |
09:04:52 | FromDiscord | <cabboose> ok L70 and L71 are actually supposed to change the value of prev from the caller |
09:05:00 | FromDiscord | <cabboose> so I guess I should use a template? |
09:05:12 | FromDiscord | <cabboose> or pass the prev as a variable to be changed? |
09:05:18 | FromDiscord | <cabboose> on node.nim |
09:05:47 | FromDiscord | <cabboose> that doesnt make sense to me lol |
09:11:58 | * | max22- joined #nim |
09:22:15 | * | max22- quit (Remote host closed the connection) |
09:23:03 | * | max22- joined #nim |
09:39:05 | * | Vladar quit (Quit: Leaving) |
09:43:52 | * | max22- quit (Remote host closed the connection) |
09:44:37 | * | max22- joined #nim |
09:51:24 | FromDiscord | <cabboose> The enqueue operation consistently skips an index of like 133 and when the dequeue operation arrives at the index it dies |
09:51:40 | FromDiscord | <cabboose> This game sucks |
09:52:41 | * | max22- quit (Remote host closed the connection) |
09:54:28 | * | max22- joined #nim |
09:54:46 | * | max22- quit (Remote host closed the connection) |
10:12:33 | * | max22- joined #nim |
10:14:31 | FromDiscord | <enthus1ast> which function to use to get a aproximation of a float? 95.90000000000001 -\> 95.9 |
10:14:49 | FromDiscord | <Rika> In string form? |
10:14:56 | FromDiscord | <enthus1ast> yeah |
10:15:04 | FromDiscord | <Rika> I donβt remember but there is a flag to enable dragon box |
10:15:13 | FromDiscord | <enthus1ast> in 1.4.8? |
10:15:22 | FromDiscord | <Rika> Not sure |
10:15:24 | FromDiscord | <Rika> Probably devel only |
10:15:49 | FromDiscord | <enthus1ast> mh ok then I'll quickly roll my own |
10:15:56 | FromDiscord | <enthus1ast> thanks @Rika |
10:28:01 | FromDiscord | <hmmm> holla :3 |
10:28:41 | FromDiscord | <hmmm> I just made a toy app on wnim and it worked like a charm |
10:28:52 | FromDiscord | <hmmm> where is the wnim guy I want to congratulate |
10:37:41 | arfy | ugh. that moment when you're happily working on your app, but have run into a roadblock. |
10:38:57 | FromDiscord | <hmmm> there is no roadblock nimchat can't help you with |
10:39:01 | FromDiscord | <enthus1ast> what is your roadblock |
10:39:24 | arfy | :) |
10:44:49 | arfy | what's the place to paste code here? |
10:45:38 | FromDiscord | <enthus1ast> https://play.nim-lang.org/ |
10:45:43 | FromDiscord | <enthus1ast> "Share to ix" |
10:46:48 | * | PMunch quit (Ping timeout: 268 seconds) |
10:49:53 | arfy | ok. so, I have a list... sorry, sequence of strings like this. @["option 1", "option 2"]. the program prints out those optoins like this. 1. option 1. 2. option 2. youthen select from those options. obviously these options can be dynamically generated. so, how to map from that list of options to the corresponding responses from the keyboard. |
10:51:54 | arfy | I thought of doing. of "1" .. $options.len in a case statement but not sure that works. |
10:58:51 | FromDiscord | <enthus1ast> https://play.nim-lang.org/#ix=3z2L |
11:00:14 | FromDiscord | <enthus1ast> must make it nice, can still crash when int is not parsable |
11:00:52 | arfy | why... didn't I think of that? *slaps head* parseInt directly on the result of stdin.readLine() |
11:02:40 | arfy | actually, Can I apply this to the illwill library, for non-blocking keyboard input? |
11:04:30 | * | Vladar joined #nim |
11:04:57 | FromDiscord | <enthus1ast> sure why not |
11:05:28 | FromDiscord | <enthus1ast> have a look at my widgets for illwill, maybe you find something usefull\: https://github.com/enthus1ast/illwillWidgets |
11:05:31 | nrds | <R2D299> itHub: 7"mouse enabled widgets for illwill" |
11:05:40 | arfy | neat. |
11:06:51 | * | PMunch joined #nim |
11:09:09 | FromDiscord | <enthus1ast> and some examples of bigger apps i build with illwill\:β΅https://github.com/enthus1ast/mukβ΅https://github.com/enthus1ast/trainingThing |
11:10:18 | * | neurocyte quit (Quit: The Lounge - https://thelounge.chat) |
11:12:34 | * | PMunch quit (Remote host closed the connection) |
11:14:22 | * | neurocyte joined #nim |
11:14:22 | * | neurocyte quit (Changing host) |
11:14:22 | * | neurocyte joined #nim |
11:19:36 | FromDiscord | <@hjarausch_gitlab-5fa43a7bd73408> building Nim devel on Termux \: how to set linker options? Linking the new koch fails since Termux/Android needs an additional `-landroid-glob` flag.β΅How can I specify this since nim is invoked with `--skipUserCfg`.β΅Many thanks for hint, Helmut |
11:21:43 | NimEventer | New thread by R3c: Call Nim code from C (linking errors), see https://forum.nim-lang.org/t/8431 |
11:22:26 | arfy | wo. I just performed some black magic. parseInt($chr(ord(Key.One))) |
11:26:49 | FromDiscord | <Rika> βordβ already returns an integer doesnβt it? |
11:27:29 | * | PMunch joined #nim |
11:28:15 | * | rockcavera joined #nim |
11:28:15 | * | rockcavera quit (Changing host) |
11:28:15 | * | rockcavera joined #nim |
11:29:51 | arfy | it does, but I want to return 1, the label of the key, not 49, the ascii value of the key |
11:29:52 | arfy | etc |
11:31:14 | arfy | oo. this is nicer. parseInt($Key.One.ord.chr) |
11:31:37 | FromDiscord | <Rika> Muh performance |
11:32:17 | PMunch | .ord.chr? |
11:32:18 | FromDiscord | <haxscramper> can't you just add offset and convert it to int again/ |
11:32:41 | arfy | that would work too |
11:32:57 | FromDiscord | <Rika> In reply to @haxscramper "can't you just add": Or just subtract the offset from the integer |
11:33:54 | arfy | meow. tired |
11:34:03 | arfy | been coding on and off most of the day |
11:34:05 | * | PMunch quit (Quit: Leaving) |
11:38:53 | arfy | thans for the offset suggestion. that looks far nicer. (Key.One.ord)-49 |
11:39:14 | arfy | returns index 0 for the list of options. |
11:44:45 | * | PMunch joined #nim |
11:49:29 | FromDiscord | <Goel> sent a code paste, see https://play.nim-lang.org/#ix=3z2S |
11:49:47 | arfy | right. flopping over. gn |
11:49:58 | FromDiscord | <Goel> (edit) "https://play.nim-lang.org/#ix=3z2S" => "https://play.nim-lang.org/#ix=3z2T" |
11:50:17 | FromDiscord | <Goel> (edit) "https://play.nim-lang.org/#ix=3z2T" => "https://play.nim-lang.org/#ix=3z2U" |
11:59:22 | * | federico3 joined #nim |
12:00:17 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3z2Y |
12:00:55 | FromDiscord | <Goel> It doesn't work on my case, i don't know why, if i do it it tells me "need to be used or discarded" But nevermind, not a big deadl |
12:00:59 | FromDiscord | <Goel> (edit) "deadl" => "deal" |
12:01:08 | FromDiscord | <Rika> No |
12:01:18 | FromDiscord | <Rika> You have to reassign |
12:02:06 | * | rockcavera quit (Remote host closed the connection) |
12:02:40 | FromDiscord | <Goel> yeah but thats gonna be long too, so in the end i just go for the full long-inline once and thats it. I was just wondering if it was possible to do something like:β΅`round(curZoom -= zoomFactor, 1) |
12:02:44 | FromDiscord | <Goel> (edit) "1)" => "1)`" |
12:03:52 | * | PMunch quit (Quit: Leaving) |
12:04:01 | FromDiscord | <Rika> No |
12:04:13 | FromDiscord | <Rika> That would still need a reassign |
12:04:23 | FromDiscord | <Rika> Round doesnβt take in a variable value |
12:04:34 | FromDiscord | <Rika> Rather it can but it wonβt mutate |
12:05:15 | * | max22- quit (Ping timeout: 260 seconds) |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.2.1) |
12:06:31 | * | supakeen joined #nim |
12:06:45 | * | PMunch joined #nim |
12:25:40 | * | arkurious joined #nim |
12:30:01 | * | neurocyte quit (Quit: The Lounge - https://thelounge.chat) |
12:34:07 | * | neurocyte joined #nim |
12:34:07 | * | neurocyte quit (Changing host) |
12:34:07 | * | neurocyte joined #nim |
12:35:56 | arkanoid | I'm finding ffi in JavaScript surprisingly easy. At the same time I feel the lack of existing js wrappers |
12:37:40 | * | Gustavo6046 quit (Ping timeout: 240 seconds) |
12:42:14 | FromDiscord | <tandy> do you have a git link i could look at? i think that would help me with some stuffβ΅(<@709044657232936960_arkanoid=5b=49=52=43=5d>) |
12:42:28 | * | Gustavo6046 joined #nim |
12:52:02 | FromDiscord | <cabboose> this is silly, I can't use any of the manual memory allocation procs with the alignment pragma |
12:57:30 | * | pro joined #nim |
13:05:06 | FromDiscord | <cabboose> mofos there are aligned allocation procs in the source that isn't exported |
13:05:11 | FromDiscord | <cabboose> why |
13:05:13 | FromDiscord | <cabboose> whyyyyy |
13:12:47 | FromDiscord | <planetis> Well even if it was |
13:13:31 | FromDiscord | <planetis> It still holds a global lock |
13:14:17 | FromDiscord | <planetis> You can pbl do the alignment yourself though |
13:17:29 | * | PMunch quit (Quit: Leaving) |
13:20:07 | * | PMunch joined #nim |
13:26:44 | * | pro quit (Quit: WeeChat 3.2) |
13:37:43 | FromDiscord | <cabboose> What holds a global lock? |
13:38:05 | FromDiscord | <cabboose> I exported those procs and the queue actually works because it has aligned reserved memory |
13:38:13 | FromDiscord | <cabboose> which begs the question why they aren't available in the first place |
13:38:37 | FromDiscord | <cabboose> or using align pragma isn't smarter, like when it's used on a pointer variable |
13:47:16 | FromDiscord | <dom96> arkanoid: time for a js2nim π |
13:47:34 | arkanoid | Is it a thing? |
13:47:57 | FromDiscord | <planetis> the allocator, whereas the reference implementation uses mimalloc |
13:48:07 | arkanoid | ts2nim would be easier, probably |
13:49:00 | FromDiscord | <cabboose> ahyi |
13:49:23 | * | max22- joined #nim |
13:49:31 | FromDiscord | <dom96> don't think it's a thing |
13:49:35 | FromDiscord | <dom96> but sounds like a fun project |
13:49:56 | arkanoid | Not sure where to start. Probably tree sitter |
13:52:28 | FromDiscord | <planetis> they arent public api cause of reasons. https://github.com/nim-lang/Nim/pull/18609 |
13:54:08 | FromDiscord | <cabboose> I'll have to implement it locally for the library then |
13:54:36 | FromDiscord | <cabboose> The storage system doesnt work without aligned pointers |
13:54:53 | FromDiscord | <cabboose> cant manually allocate memory with alignment |
13:55:08 | FromDiscord | <cabboose> and the slots eventually get reallocated in every other circumstance |
13:55:53 | FromDiscord | <cabboose> Is there a risk or is it just a matter of ensuring people don't make it too crazy |
14:04:05 | NimEventer | New thread by HJarausch: Building Nim Devel on Termux (Android), see https://forum.nim-lang.org/t/8432 |
14:05:05 | * | PMunch quit (Quit: Leaving) |
14:33:14 | FromDiscord | <planetis> btw i would move to a bounded implementation https://github.com/rigtorp/MPMCQueue |
14:33:17 | nrds | <R2D299> itHub: 7"A bounded multi-producer multi-consumer concurrent queue written in C++11" |
14:34:26 | FromDiscord | <planetis> reclaiming the memory in this setting is very hard to do |
14:35:07 | FromDiscord | <planetis> bounded seems like a better choice, since i dont want to allocate all the time, just once |
14:36:19 | FromDiscord | <planetis> that algorithm is not lock-free for the consumer part |
14:36:49 | FromDiscord | <planetis> better yet use a spsc queue for each thread |
14:48:16 | FromDiscord | <cabboose> The algorithm provides a pretty safe reclamation though no? |
14:48:49 | FromDiscord | <cabboose> I mean; i'd rather really grind this out, a lock-free multiple consumer is exactly what I'm aiming for |
14:49:01 | FromDiscord | <cabboose> I want continuations shooting out of every hole at speed |
15:09:41 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
15:17:47 | * | Guest5552 joined #nim |
15:21:22 | * | Guest5552 quit (Client Quit) |
16:02:14 | * | asd quit (Ping timeout: 265 seconds) |
16:03:55 | * | asd joined #nim |
16:10:36 | FromDiscord | <planetis> maybe... last time I spent a week porting a new mpsc queue and then I tested it with tsan and it was complaining. Other people run into the same errors as well. |
16:10:45 | FromDiscord | <planetis> ime its a gamble |
16:13:57 | FromDiscord | <cabboose> eugh |
16:21:05 | FromDiscord | <reilly> Can someone provide me an example of how to use an image in Karax? |
16:25:05 | * | stkrdknmibalz joined #nim |
16:27:53 | Zevv | I have a queue of events that are implemented as enums; different event types have an enum variant, some have data. Now i'd like to register callbacks that get called when events of a certain kind are popped off the queue, but I can't seem to find how to refer to a certain "kind" of the enum without making a complete instance of that enum. I can statically match, but I need some kind of run time discriminant. |
16:27:59 | Zevv | Is there a way to do this, or did I pick the wrong representation? |
16:28:36 | Zevv | oh dang |
16:28:40 | Zevv | this is totally the wrong channel |
16:28:46 | Zevv | because I am doing rust today |
16:41:09 | FromDiscord | <Gumber aka Zachary Carter> gross |
16:42:49 | FromDiscord | <reilly> Nevermind, I figured it out. |
16:45:41 | FromDiscord | <Gumber aka Zachary Carter> In reply to @Zevv "this is totally the": wrong server homie π |
16:46:20 | Zevv | nah proper server, wrong channel. stuff is bridged all over the place these days, i'm just on IRC |
16:46:26 | Zevv | how is the zach these days |
16:46:38 | FromDiscord | <Gumber aka Zachary Carter> oh yeah true |
16:46:59 | FromDiscord | <Gumber aka Zachary Carter> I'm good thanks! Just getting over my second bout of COVID, how have you been? |
16:49:18 | Zevv | all over the place. I recently quit at activevideo, I was sooo done with the bureaucracy and layers of management |
16:49:30 | Zevv | but now I ended up doing rust. from the fire into the flames, as they say |
16:51:56 | FromDiscord | <Rika> hows rust |
16:51:58 | FromDiscord | <Gumber aka Zachary Carter> oh wow |
16:52:17 | FromDiscord | <Gumber aka Zachary Carter> sorry to hear about that, but I'm glad you found something else that interests you π |
16:53:10 | FromDiscord | <Gumber aka Zachary Carter> I'm out of the games industry now, went back in for a bit and now I'm doing Elixir (and Nim if the opportunity arises - it was already approved) |
16:53:40 | FromDiscord | <Gumber aka Zachary Carter> been there since July - doesn't seem like it though... time flies... |
16:54:26 | FromDiscord | <Gumber aka Zachary Carter> and yeah... how is Rust? |
16:54:37 | FromDiscord | <Gumber aka Zachary Carter> I mean I already know, but your opinion would be cool to hear too π |
17:02:54 | Zevv | I prefer elixir :) |
17:03:15 | FromDiscord | <Gumber aka Zachary Carter> haha me too π |
17:03:25 | Zevv | I was honestly wondering how long it takes the average developer to stop shouting at their computer in rage when getting started with rust |
17:03:34 | FromDiscord | <Gumber aka Zachary Carter> months I think |
17:03:41 | Zevv | I get what they are trying to do and all, I really do. But it just is /so/ painful |
17:03:43 | FromDiscord | <Gumber aka Zachary Carter> borrow checker is a bitch |
17:03:48 | FromDiscord | <Gumber aka Zachary Carter> yaup |
17:04:20 | FromDiscord | <Gumber aka Zachary Carter> I don't get the game studios that are like full on embracing Rust like Embark |
17:04:22 | Zevv | I'm trying to do these basic simple things for embedded. I have one single instance of a thing. In normal language that would just live somewhere statically and be a singleton |
17:04:27 | Zevv | but no no in rust we don't do singletons. |
17:04:49 | FromDiscord | <Gumber aka Zachary Carter> I mean they have some really talented and smart people there - but... it just seems like they're using Rust because it is popular and hyped, not necessarily because of its technical merits |
17:05:10 | FromDiscord | <Gumber aka Zachary Carter> heh, yeah all those lovely "zero-cost abstractions" |
17:05:25 | Zevv | I see the merits for some systems; when you're juggling with tons of dynamic data and don't want GCing, it can prbly do a nice job and all |
17:05:32 | Zevv | It's a better C. sure. |
17:05:39 | FromDiscord | <Rika> zero cost in performance massive cost in dev time π |
17:05:41 | FromDiscord | <Gumber aka Zachary Carter> yeah but so is Zig |
17:05:48 | Zevv | Right. |
17:05:52 | FromDiscord | <Gumber aka Zachary Carter> and I don't know if it's a bettter C |
17:05:55 | FromDiscord | <Gumber aka Zachary Carter> (edit) "bettter" => "better" |
17:05:56 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=3z4F |
17:05:57 | Zevv | And so is Nim, even. |
17:06:02 | FromDiscord | <Gumber aka Zachary Carter> safer sure, but better I dunno that's arguable |
17:06:13 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3z4G |
17:06:19 | Zevv | well, the thing is, on this deep embedded stuff I hardly do any memory management at all |
17:06:29 | FromDiscord | <Gumber aka Zachary Carter> yeah |
17:06:35 | Zevv | stuff just lives somewhere and you ref it. done. 99% of my bugs are not related to stuff rust would prevent |
17:06:42 | Zevv | but hey, $customer wants rust because it's a good show |
17:06:53 | Zevv | they pay me to do the work, they pay me to learn rust. who am i to complain |
17:06:53 | FromDiscord | <Gumber aka Zachary Carter> the whole single allocator thing I never got |
17:07:00 | FromDiscord | <Gumber aka Zachary Carter> yeah - I think it's a good deal |
17:07:10 | FromDiscord | <Gumber aka Zachary Carter> never hurts to broaden your knowledge and get paid for it at the same time, that's for damn sure |
17:07:24 | Zevv | I advised against it, so I can always reach out with a fat "told ya so" one day |
17:07:37 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=3z4H |
17:07:45 | FromDiscord | <Gumber aka Zachary Carter> π |
17:07:49 | FromDiscord | <Gumber aka Zachary Carter> smart move |
17:08:41 | Zevv | The rust embedded book tells me to do it like this |
17:08:42 | Zevv | MY_GPIO.borrow(cs).borrow().as_ref().unwrap().odr.modify(|_, w| w.odr1().set_bit()); |
17:08:45 | Zevv | I am /not/ making this up |
17:08:57 | FromDiscord | <Rika> you have to use normal `proc(): ...` syntax for multiline i believe? |
17:08:58 | Zevv | this is the alternative for the C 'MY_GPIO.set_bit()' |
17:09:02 | FromDiscord | <leorize> fwsgonzo#9652\: `proc (iter: iterator(): Token): string = return ""`β΅(@fwsgonzo) |
17:09:07 | FromDiscord | <Rika> yup |
17:09:28 | FromDiscord | <fwsgonzo> many thanks π |
17:09:34 | FromDiscord | <Rika> In reply to @Zevv "MY_GPIO.borrow(cs).borrow().as_ref().unwrap().odr.m": how fun |
17:09:38 | FromDiscord | <Rika> that is one hell of a line |
17:09:43 | FromDiscord | <Gumber aka Zachary Carter> yeah kill me |
17:10:00 | FromDiscord | <leorize> alternatively `sugar.()` exists, too |
17:10:01 | FromDiscord | <Rika> do you think rust programmers are human |
17:10:12 | Zevv | I'm not sure, I never met one in real life |
17:10:16 | Zevv | I'm on my own in this project |
17:10:22 | FromDiscord | <fwsgonzo> they are more human than me as a C++ programmer |
17:10:36 | FromDiscord | <Gumber aka Zachary Carter> I mean C++ is sane if you don't use C++17 or 20 |
17:10:37 | Zevv | It makes me wonder if this is some kind of self inflicted masochism to show of ones smarts |
17:10:46 | Zevv | or if people honestly think this is a good idea all the way down |
17:11:05 | Zevv | but the same goes for elixir of course. That pure functional state juggling is silly as hell as well |
17:11:11 | FromDiscord | <Gumber aka Zachary Carter> yeah |
17:11:21 | FromDiscord | <Gumber aka Zachary Carter> well take anything to an extreme and you end up with this kind of stuff |
17:11:26 | Zevv | right |
17:11:46 | FromDiscord | <Gumber aka Zachary Carter> I mean games are not operating system kernels or missile defense systems |
17:11:50 | Zevv | and for elixir I see why this is - it's collateral damage, the price you pay for the share-nothing threading model |
17:11:56 | FromDiscord | <Gumber aka Zachary Carter> or software powering critical infrastructure |
17:12:19 | Zevv | nasa went to the moon on C |
17:12:27 | FromDiscord | <Gumber aka Zachary Carter> so I don't get the whole everything must be safe philosophy in that context, but in other contexts I do |
17:12:28 | FromDiscord | <Gumber aka Zachary Carter> and forth |
17:12:32 | Zevv | right |
17:13:18 | FromDiscord | <Gumber aka Zachary Carter> people just buy into stuff with too much hype and not even speculation |
17:13:28 | FromDiscord | <Gumber aka Zachary Carter> especially young people - I was like that when I was young and not jaded |
17:13:29 | Zevv | well, rust is prbly here too stay, right |
17:13:35 | FromDiscord | <Gumber aka Zachary Carter> I probably would have been a huge rust fanboi like ten years ago |
17:13:37 | Zevv | but I miss the golang pragmatism |
17:13:56 | FromDiscord | <Gumber aka Zachary Carter> yeah for sure, I mean it is popular for a reason, but I think it's a bit over hyped / praised |
17:14:04 | FromDiscord | <Gumber aka Zachary Carter> yeah golang was just a bit too pragmatic haha |
17:14:09 | FromDiscord | <Gumber aka Zachary Carter> or is I guess |
17:14:22 | Zevv | I should visit Zig, it's the last one on my list |
17:14:34 | FromDiscord | <Gumber aka Zachary Carter> zig is awesome |
17:14:36 | FromDiscord | <Gumber aka Zachary Carter> especially zigcc |
17:14:38 | Zevv | I'm still sticking with nim for some reason |
17:14:55 | Zevv | although it smells in the back alleys and blows up in my face every time I try to do something interesting |
17:14:56 | FromDiscord | <Gumber aka Zachary Carter> yeah same - I've touched all three and Nim is still my goto, although I do really like Zig |
17:15:00 | FromDiscord | <Gumber aka Zachary Carter> and I think a Zig backend for Nim would be amazing |
17:15:16 | FromDiscord | <Gumber aka Zachary Carter> once Zig matures ab it |
17:15:20 | FromDiscord | <Gumber aka Zachary Carter> (edit) "ab it" => "a bit more" |
17:16:15 | Zevv | anyway, I did some nice outings over the last year. I rewrote npeg in elixir in 1 day, which was pretty cool. I did some hefty lifting in golang for $customer, and now getting my hands dirty with rust |
17:16:25 | Zevv | that's pretty impressive for someone my age, right |
17:17:08 | FromDiscord | <Rika> i want a mix of zig and nim ngl |
17:17:15 | FromDiscord | <Rika> would be funky |
17:17:19 | FromDiscord | <Rika> funky monkey |
17:17:38 | FromDiscord | <Rika> In reply to @Zevv "anyway, I did some": that sounds impressive yes |
17:18:17 | FromDiscord | <Gumber aka Zachary Carter> yeah I think so |
17:27:38 | FromDiscord | <Gumber aka Zachary Carter> Doing games as a hobby again is really refreshing, just being able to work on my own pace on things that interest me instead of working on stuff I'm directed to work on is nice again |
17:27:55 | Zevv | yeah, never forget that |
17:28:00 | FromDiscord | <Gumber aka Zachary Carter> I always bought into that whole, do what you love and it's not work thing but it's so not true... I think it only applies if you're your own boss and get to make your own decisions on what you want to work on |
17:28:02 | Zevv | coding for work != coding for yourself |
17:28:06 | FromDiscord | <Gumber aka Zachary Carter> yeah |
17:28:24 | Zevv | and I'm so fucking spoiled as a mercenary. I just pick the jobs I like and go away when I'm bored |
17:28:49 | FromDiscord | <Gumber aka Zachary Carter> really enjoying game dev again and my project is really coming along - got all of the network plumbing code going, working on the renderer now, already prototyped a ton of stuff in previous iterations of the project |
17:29:10 | FromDiscord | <Gumber aka Zachary Carter> in the next six months or so I should actually have something playable |
17:29:15 | FromDiscord | <Gumber aka Zachary Carter> yeah that's pretty sweet |
17:29:39 | Zevv | well, show early and show often, right |
17:29:43 | Zevv | even if it's not playable yet |
17:30:03 | FromDiscord | <Gumber aka Zachary Carter> although even my day job stuff isn't bad - I mean it's not the most interesting work in the world but the company mission is cool and programming in Elixir is nice |
17:30:04 | Zevv | the problem I always see with solo game development is that coding and artwork are two so totally different things |
17:30:19 | FromDiscord | <Gumber aka Zachary Carter> yeah - I mean once I have stuff to show, the network stuff isn't really cool to see |
17:30:35 | FromDiscord | <Gumber aka Zachary Carter> yeah I mean I'm going 3d since I suck at art and 3d is much easier to get by with than 2d if that's the case I think |
17:30:45 | FromDiscord | <Gumber aka Zachary Carter> (edit) "if" => "when" |
17:31:21 | FromDiscord | <Gumber aka Zachary Carter> but my first prototype will just use primitives I think |
17:31:46 | FromDiscord | <Gumber aka Zachary Carter> and probably some models from blendswap with mixamo animations π It's just a prototype to get interest from potential artists anyway |
17:32:07 | FromDiscord | <Gumber aka Zachary Carter> already have some folks I've worked with in the past that have expressed interest in working with me on it once I'm ready for their help |
17:35:59 | Zevv | that's nice |
17:37:01 | FromDiscord | <Gumber aka Zachary Carter> Yeah! Anyway, I'll shut up and let people talk about Nim now π |
18:02:07 | FromDiscord | <reilly> How can I loop over all states of an enum? |
18:05:29 | Zevv | for i in T.low..T.high: |
18:06:26 | Zevv | given your enum has no gaps |
18:07:36 | FromDiscord | <Rika> enums need more love.. |
18:08:38 | Zevv | don't we all |
18:09:16 | FromDiscord | <reilly> In reply to @Zevv "for i in T.low..T.high:": Looks like that works, sweet. |
18:10:23 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=3z50 |
18:10:45 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3z51 |
18:17:10 | FromDiscord | <reilly> Alright, here's a question that's a little out-of-the-box:β΅Given that I'm looping over an enum, can I call a procedure called `do<EnumName>()`? |
18:17:34 | FromDiscord | <reilly> So, if the enum is `SomeEnum` at the moment, call a proc called `doSomeEnum()`. |
18:17:48 | FromDiscord | <Rika> use generics? |
18:17:57 | FromDiscord | <Rika> do[T: enum]()... |
18:18:02 | FromDiscord | <Rika> do[SomeEnum]() |
18:18:18 | FromDiscord | <Rika> do[GenericParameterContainingType]() |
18:18:26 | FromDiscord | <Rika> enum, not type |
18:18:42 | FromDiscord | <Rika> or do you mean enum value? |
18:18:50 | FromDiscord | <Rika> in which case no |
18:18:51 | FromDiscord | <reilly> No, I think that works... |
18:21:33 | FromDiscord | <reilly> Actually, no, because I don't need the enum type, I need the specific enum. |
18:21:53 | FromDiscord | <reilly> Is that what you mean by enum value? |
18:22:37 | FromDiscord | <reilly> I initially thought you meant value as in `Option1 = "asdf"` |
18:24:52 | FromDiscord | <Rika> enum values are runtime unless forced in static context |
18:25:18 | FromDiscord | <Rika> procedure call "generation" is compiletime only |
18:25:27 | FromDiscord | <Rika> please elaborate more on what you want |
18:25:31 | FromDiscord | <Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=3z56 |
18:25:54 | FromDiscord | <Rika> oh you want a macro that generates handler? |
18:26:05 | FromDiscord | <Rika> i dont have one but i feel like someone here has made one at least |
18:27:27 | * | tdc quit (Ping timeout: 268 seconds) |
18:27:54 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3z58 |
18:28:41 | FromDiscord | <Rika> macro |
18:28:45 | FromDiscord | <Rika> no other way around it |
18:29:02 | FromDiscord | <reilly> I already knew that much... I just don't know how to write macros. |
18:29:18 | FromDiscord | <reilly> It goes completely over my head. |
18:29:21 | FromDiscord | <Rika> do you want the handler one? or the one you sent? they are different logically |
18:29:38 | FromDiscord | <Rika> actually i just realised it is 3 am |
18:29:50 | FromDiscord | <Rika> hope beef is awake and can answer you lmfao |
18:29:59 | FromDiscord | <Rika> i shall pass away temporarily |
18:30:04 | FromDiscord | <reilly> Yeah, don't worry about it. It's not a big deal, more of a party trick than anything else. |
18:30:20 | FromDiscord | <Rika> maybe you can make this your guide to learning macros |
18:32:51 | NimEventer | New thread by Ingo: Db_sqlite prepared statement, see https://forum.nim-lang.org/t/8433 |
18:36:19 | FromDiscord | <reilly> sent a code paste, see https://play.nim-lang.org/#ix=3z5b |
18:36:59 | FromDiscord | <Rika> nope thats not where you start |
18:37:05 | FromDiscord | <Rika> the loop has to bee in the macro |
18:37:14 | FromDiscord | <Rika> otherwise the loop is runtime and you get what you just got |
19:23:33 | * | PMunch joined #nim |
19:54:28 | * | supakeen quit (Remote host closed the connection) |
19:54:51 | * | supakeen joined #nim |
20:09:10 | * | Gustavo6046 quit (Ping timeout: 240 seconds) |
20:11:11 | * | Gustavo6046 joined #nim |
20:15:52 | nrds | <Prestige99> Is there a way to pass a function call to a macro? E.g. I want to do myMacro(foo(123)) but I don't want foo(123) evaluated and passed in as a value, I want the macro to be able to invoke foo(123) |
20:17:05 | FromDiscord | <planetis> you need a typed macro then call getTypeImpl on x and loop over the enum type's ast |
20:21:04 | NimEventer | New question by SlightlyKosumi: How to force a COM AddIn to be loaded?, see https://stackoverflow.com/questions/69214702/how-to-force-a-com-addin-to-be-loaded |
20:30:33 | nrds | <Prestige99> https://play.nim-lang.org/#ix=3z5F <-- an example |
20:30:41 | nrds | <Prestige99> maybe @Elegantbeef would know |
20:33:16 | nrds | <Prestige99> (or know if it's possible) |
20:38:41 | * | Vladar quit (Quit: Leaving) |
20:54:53 | * | PMunch quit (Quit: leaving) |
20:58:16 | FromDiscord | <Varriount> Zevv:, NASA went to space with Forth too. |
20:59:01 | FromDiscord | <Varriount> Zevv: Idea - Could NPeg be used to pattern match and process ASTs from a Nim macro? |
21:00:34 | FromDiscord | <Varriount> Prestige: I believe the macro should do that by default, as long as the type of the macro's parameter isn't static |
21:02:43 | FromDiscord | <ynfle (ynfle)> @Prestige can't you just pass the arguments to foo to the macro as well? like `@foo, 123` |
21:03:29 | FromDiscord | <ynfle (ynfle)> sent a code paste, see https://play.nim-lang.org/#ix=3z5M |
21:03:33 | FromDiscord | <ynfle (ynfle)> And parse the untyped AST like that |
21:04:22 | Zevv | varriount: well, no. Npeg takes a seq[T] as input, not a tree |
21:20:05 | nrds | <Prestige99> sure but I'm trying to avoid that if I can @ynfle |
21:22:35 | * | max22- quit (Quit: Leaving) |
21:36:04 | FromDiscord | <Elegantbeef> Prestige you have to make the parameter `typed` |
21:37:14 | FromDiscord | <Varriount> Zevv: Hm, true. Hypothetically, do you think something like tree traversal and validation could be implemented as a (viable) PEG-like DSL? |
21:37:23 | FromDiscord | <Varriount> (edit) "(viable)" => "(useful)" |
21:37:48 | FromDiscord | <Elegantbeef> Something like this prestige https://play.nim-lang.org/#ix=3z5P |
21:38:22 | FromDiscord | <Varriount> Woah, that's... interesting. Typing a SED subtitution pattern into Discord performs an edit on the previous message. |
21:38:35 | nrds | <Prestige99> oh that's neat. New feature? |
21:39:19 | FromDiscord | <Varriount> Or a hidden one. |
21:39:32 | FromDiscord | <Varriount> (edit) "hidden" => "secret" |
21:39:38 | FromDiscord | <Elegantbeef> It's secret |
21:39:38 | FromDiscord | <Varriount> O_o |
21:39:45 | FromDiscord | <ynfle (ynfle)> @Beef, you don't need the outer brackets, and `typed` can be `untyped` |
21:39:45 | nrds | <Prestige99> @Elegantbeef thanks btw |
21:40:16 | FromDiscord | <Elegantbeef> Typed can be untyped but it's better if it's typed since the symbol is looked up so you can do stuff with it if you wish |
21:40:29 | FromDiscord | <Elegantbeef> Instead of emitting `0.0` you can do `default(returnT)` |
21:41:05 | FromDiscord | <Elegantbeef> otherwise you have to use `typeof(`foo`)` and have 0 introspection |
21:41:32 | FromDiscord | <Elegantbeef> Like since it's typed you can check if it can raise and if not error |
21:41:37 | nrds | <Prestige99> Yeah I still need to figure out how to make this macro |
21:43:14 | Zevv | Varriount: I don't know. The theory behind PEG is pretty strong, pages full of math scribbles and all that shit |
21:43:45 | Zevv | I dont understand jack about the theory, so I have no clue if this could somehow map to parsing an AST |
21:44:57 | Zevv | my hunch is that it /could/ work though; the grammar is basically a recursive tree itself, and it typically already parses recursive things |
21:45:06 | nrds | <Prestige99> so using `foo` in the macro actually runs the proc... interesting |
21:45:14 | nrds | <Prestige99> instead of foo() |
21:45:15 | Zevv | because this seq[T] you feed it already contains tree-like things. |
21:45:29 | FromDiscord | <Elegantbeef> Well you're emitting the call |
21:45:30 | FromDiscord | <Elegantbeef> vs calling the symbol |
21:45:45 | FromDiscord | <Elegantbeef> the backticks in the quote emit the code you passed |
21:45:49 | nrds | <Prestige99> ah okay |
21:46:17 | nrds | <Prestige99> last thing is, I need to get the type `foo` returns so I can use default(theType) |
21:47:37 | nrds | <Prestige99> or can I just use default(typeof(`foo`)) here, seems to work |
21:49:09 | FromDiscord | <Elegantbeef> You could |
21:49:10 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3z5S |
21:49:16 | FromDiscord | <Elegantbeef> Is a good reference impl |
21:49:26 | FromDiscord | <Elegantbeef> Might not work with generics but i'll leave that to you to implement π |
21:50:18 | nrds | <Prestige99> oh you just used impl.params[0] instead? Any benefit there? |
21:50:34 | nrds | <Prestige99> maybe less overhead |
21:50:40 | FromDiscord | <Elegantbeef> Nah |
21:51:00 | FromDiscord | <Elegantbeef> It's the same thing really, just one will say `typeOf(foo(args))` if it ever errors vs `yourReturnType` |
21:52:23 | FromDiscord | <Elegantbeef> Atleast i think it will |
21:52:32 | FromDiscord | <Elegantbeef> Unlikely it'll error but yea |
21:52:58 | FromDiscord | <Elegantbeef> Mostly just did that + the raise lists stuff to show why you'd want to use `typed` |
21:53:04 | FromDiscord | <Elegantbeef> Just to really annoy ynfle π |
21:53:18 | nrds | <Prestige99> ah |
21:58:47 | FromDiscord | <Elegantbeef> Also why so lame and using `@` when you could use `?` |
21:58:54 | nrds | <Prestige99> https://play.nim-lang.org/#ix=3z5V I think this is good enough for my use |
21:59:08 | nrds | <Prestige99> like ?(foo(123)) ? idk looks weird to me |
21:59:20 | nrds | <Prestige99> maybe shouldn't use @ though |
21:59:26 | FromDiscord | <Elegantbeef> But but... you dont get a CT error when using it stupidly |
21:59:48 | nrds | <Prestige99> oh? |
22:00:03 | nrds | <Prestige99> Because of the check you did for raises? |
22:00:10 | FromDiscord | <Elegantbeef> Yea |
22:05:26 | FromDiscord | <Elegantbeef> I mean it's purely up to you but here's that in action π https://play.nim-lang.org/#ix=3z61 |
22:05:30 | nrds | <Prestige99> that error proc is neat |
22:05:45 | FromDiscord | <Elegantbeef> Notice it errors at line 32 |
22:06:08 | FromDiscord | <Elegantbeef> Yea it's nice part of macros to give useful error messages CPS uses it a lot |
22:06:08 | nrds | <Prestige99> oh that's cool |
22:07:09 | nrds | <Prestige99> holy crap that's actually cooler than I thought, the error popping up in my editor lol |
22:07:26 | nrds | <Prestige99> https://i.imgur.com/hJ7ooZM.png |
22:07:37 | nrds | <Prestige99> I need to play with macros more |
22:07:57 | FromDiscord | <Elegantbeef> Yea it's the reason i use it, it actually handles errors properly |
22:09:12 | FromDiscord | <Elegantbeef> Feel free to steal my macro and expand it though, since like i said i dont think it works on generics |
22:09:24 | FromDiscord | <Elegantbeef> It might work on them didnt test |
22:09:25 | nrds | <Prestige99> Sure I'll keep at it |
22:09:35 | nrds | <Prestige99> Thanks π |
22:33:49 | * | [R] quit (Ping timeout: 252 seconds) |
22:41:26 | * | [R] joined #nim |
23:28:20 | FromDiscord | <Varriount> Zevv: A tree structure can be flattened to a sequence structure by traversing the tree depth-first, and inserting marker symbols when descending and ascending a node. |
23:32:10 | * | Gustavo6046 quit (Ping timeout: 252 seconds) |
23:32:49 | * | Gustavo6046 joined #nim |
23:38:54 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
23:41:18 | FromDiscord | <Beans.> sent a code paste, see https://play.nim-lang.org/#ix=3z6e |
23:41:33 | FromDiscord | <Beans.> (edit) "https://play.nim-lang.org/#ix=3z6e" => "https://paste.rs/cg2" |
23:41:35 | * | Gustavo6046 joined #nim |
23:43:01 | FromDiscord | <Elegantbeef> should be `initTable[string, seq[float]()` |
23:43:07 | FromDiscord | <Elegantbeef> Otherwise you're just getting the procedure |
23:44:14 | FromDiscord | <Beans.> π€¦ββοΈ |
23:44:15 | FromDiscord | <Beans.> You're right |
23:44:39 | FromDiscord | <Beans.> Dumb mistake lol |
23:50:59 | FromDiscord | <Yardanico> In reply to @Beans. "Dumb mistake lol": also you can shorten your code by 1 line by assigning directly to `result` :) |
23:53:28 | FromDiscord | <Elegantbeef> by one line? you mean you can make it one line \:P |
23:53:41 | FromDiscord | <Elegantbeef> `result["temperatures"] = @[]` |
23:53:49 | FromDiscord | <Yardanico> ah yeah, forgot that initTable isn't needed any longer |
23:54:03 | FromDiscord | <Yardanico> but @ElegantBeef you missed something |
23:54:07 | FromDiscord | <Yardanico> " # parse json data from api and deserialize into 'temps' seq" |
23:54:11 | FromDiscord | <Yardanico> so it still won't be 1 line :) |
23:54:41 | FromDiscord | <Elegantbeef> Oh |
23:54:42 | FromDiscord | <Elegantbeef> Indeed |
23:55:01 | FromDiscord | <Elegantbeef> Though it might be a simple parse function π |