00:03:28 | * | rockcavera quit (Ping timeout: 252 seconds) |
00:03:58 | * | Schnouki quit (Ping timeout: 268 seconds) |
00:10:22 | FromDiscord | <Rika> In reply to @el__maco "by the way, I": yeah has been known for a whi;e |
00:23:33 | * | rockcavera joined #nim |
00:23:33 | * | rockcavera quit (Changing host) |
00:23:33 | * | rockcavera joined #nim |
00:25:54 | FromDiscord | <retkid> sent a code paste, see https://play.nim-lang.org/#ix=3ALx |
00:26:01 | FromDiscord | <retkid> i ported the dice_coefficient to nim because i couldn't fine one |
00:26:26 | FromDiscord | <retkid> (edit) |
00:26:36 | FromDiscord | <retkid> directly from the python because reading the java made me cry |
00:27:09 | FromDiscord | <retkid> 😢 https://media.discordapp.net/attachments/371759389889003532/894380077800914944/unknown.png |
00:36:59 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
00:51:28 | FromDiscord | <Rika> funny enough i would say the java one is closer to nim than the python one |
00:53:53 | FromDiscord | <Gumber> ugh Python |
00:53:59 | FromDiscord | <Gumber> :shudders: |
00:55:54 | FromDiscord | <Gumber> having to use Python gives me a headache |
00:58:56 | * | rockcavera quit (Remote host closed the connection) |
00:59:19 | * | rockcavera joined #nim |
00:59:19 | * | rockcavera quit (Changing host) |
00:59:19 | * | rockcavera joined #nim |
01:18:59 | FromDiscord | <Jakes1403> What is the most commonly used SDL2 wrapper for Nim?↵And which one would support web? Ty! |
01:19:41 | FromDiscord | <Elegantbeef> https://github.com/Vladar4/sdl2_nim#attention this one following this attention |
01:19:44 | nrds | <R2D299> itHub: 7"Wrapper of the SDL 2 library for the Nim language." |
01:20:50 | FromDiscord | <impbox [ftsf]> @Jakes1403 can totally build it for web with emscripten |
01:21:06 | FromDiscord | <Elegantbeef> I still say use nico for what you're doing |
01:21:37 | FromDiscord | <impbox [ftsf]> i dunno what you're doing but using nico is good |
01:22:07 | FromDiscord | <Elegantbeef> They're looking for a library to display their chip-8 emulator's graphics |
01:22:36 | FromDiscord | <Elegantbeef> Given what nico offers to me it seems sensible to use for this |
01:23:19 | FromDiscord | <impbox [ftsf]> bribes? |
01:23:50 | FromDiscord | <Elegantbeef> Nico gives bribes? |
01:24:00 | FromDiscord | <Elegantbeef> Where's my money biatch |
01:26:30 | FromDiscord | <Jakes1403> Nico seems to be specialized for gaming |
01:26:50 | FromDiscord | <impbox [ftsf]> you could say the same for SDL, but you can use them for non game things |
01:26:58 | FromDiscord | <impbox [ftsf]> I've made non-game software in nico |
01:27:08 | FromDiscord | <impbox [ftsf]> eg. nimsynth |
01:27:24 | FromDiscord | <impbox [ftsf]> https://www.youtube.com/watch?v=kHomZLUE6As&t=602s |
01:27:28 | nrds | <R2D299> outube: 7"NimSynth building a synth with low level components" |
01:27:39 | FromDiscord | <Elegantbeef> You can mostly use nico like a sdl2 abstraction |
01:28:09 | FromDiscord | <Elegantbeef> setup a draw/update proc, and use `pset` like you'd do on sdl2 |
01:29:02 | FromDiscord | <Elegantbeef> But yea you can just use sdl2 and disregard me |
01:30:10 | FromDiscord | <Jakes1403> If I run into a situation where, lets say I need to implement something that emulates a sound chip, would I be able to implement custom audio stuff with it? Like modify sound buffers directly? |
01:32:03 | FromDiscord | <acek7> does nico only do retro hardware emulation |
01:32:22 | FromDiscord | <Elegantbeef> Nico doesnt do emulation |
01:32:40 | FromDiscord | <acek7> well emulation was the wrong word to use my bad |
01:33:04 | FromDiscord | <Elegantbeef> It's a purposely software limited library |
01:33:56 | FromDiscord | <Elegantbeef> I dont know if you can jake, impbox would certainly know better |
01:43:37 | * | arkurious quit (Quit: Leaving) |
02:14:54 | FromDiscord | <impbox [ftsf]> Nico let's you do custom audio easily |
02:15:31 | FromDiscord | <impbox [ftsf]> It does audio mixing of channels and a channel can have a custom audio callback |
02:15:48 | FromDiscord | <impbox [ftsf]> Or do music streaming, or sfx playback or built in synth |
02:16:24 | FromDiscord | <impbox [ftsf]> And since nico is open source you can easily add new features if you need them |
02:16:46 | FromDiscord | <impbox [ftsf]> But it's pretty flexible out of the box |
02:29:22 | * | User11 joined #nim |
02:35:30 | FromDiscord | <NullCode> is it possible to break out of a `when` statement |
02:35:45 | FromDiscord | <NullCode> I'm trying break but "`Error: invalid control flow: break`" |
02:35:52 | FromDiscord | <NullCode> i think ill use discard now |
02:36:12 | FromDiscord | <Elegantbeef> when doesnt make scopes |
02:36:20 | FromDiscord | <Elegantbeef> One of the great features of it |
02:37:39 | FromDiscord | <NullCode> I'm sorry but i have no idea what a scope is/does |
02:38:08 | FromDiscord | <Elegantbeef> Ever heard of "local scope"? That's the scope i'm talking about |
02:38:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ALW |
02:38:58 | FromDiscord | <Elegantbeef> When doesnt create a new scope, so you'd need to use `block scopeName` and `break scopeName` |
02:39:19 | FromDiscord | <NullCode> In reply to @Elegantbeef "Ever heard of "local": local variables? |
02:39:40 | FromDiscord | <Elegantbeef> Local variables are variables that are locally scoped |
02:41:02 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#modules-scope-rules |
02:41:07 | FromDiscord | <NullCode> In reply to @Elegantbeef "Local variables are variables": ok it makes sense now |
02:41:09 | FromDiscord | <NullCode> thank you |
02:41:39 | FromDiscord | <NullCode> i see |
02:41:46 | FromDiscord | <NullCode> so a when statement doesn't make this scope |
02:41:57 | FromDiscord | <Elegantbeef> Indeed |
02:43:10 | User11 | Hello, could I post some code and get guidance on this channel? |
02:43:27 | FromDiscord | <Elegantbeef> Most certainly |
02:43:42 | FromDiscord | <Elegantbeef> Idealy use https://play.nim-lang.org/ |
02:47:22 | User11 | okay here it is.. |
02:47:22 | User11 | https://pastebin.com/BHsHdtPi |
02:48:36 | User11 | I'm trying to load a zipfile into memory and do things with it using libcurl... |
02:50:07 | User11 | I used the code example from here https://github.com/Araq/libcurl with one modification |
02:50:09 | nrds | <R2D299> itHub: 7"Nim wrapper for libcurl." |
02:50:45 | FromDiscord | <Elegantbeef> Well the `cast[string](buffer)` isnt right |
02:51:06 | FromDiscord | <Elegantbeef> buffer is a cstring casting it to string is not correct |
02:51:38 | FromDiscord | <Elegantbeef> `cstring` is a `char` string is a pointer with size and capacity |
02:51:59 | FromDiscord | <Elegantbeef> guess i should say `ptr char` instead of `char` |
02:52:18 | FromDiscord | <Elegantbeef> Also writing to the zip file like that probably will not work |
02:52:30 | User11 | OK it takes me a while to type this out but you seems to know where the problem is |
02:52:46 | FromDiscord | <Elegantbeef> I suggest using Zippy https://github.com/guzba/zippy to modify the zip |
02:52:48 | nrds | <R2D299> itHub: 7"Pure Nim implementation of deflate, zlib, gzip and zip." |
02:56:13 | User11 | I couldnt figure out how to use openArray[byte] so I used string type to concatenate the buffer to the webData |
02:57:21 | FromDiscord | <Elegantbeef> casting `cstring` to `string` is just wrong, they're not the same data so bad things will happen |
02:57:52 | FromDiscord | <Elegantbeef> `cast` in nim isnt a type conversion it's a type reinterpretation, which means the data stays the same but the type system says "It's now X" |
02:58:15 | FromDiscord | <Elegantbeef> `buffer.string` is probably what you want, but there is a `&=` for `string &= cstring` |
02:59:36 | User11 | Yes this brings me to this issue https://github.com/Araq/libcurl/issues/4 |
03:00:55 | User11 | That is why I switched to string concatenation with a range parameter |
03:02:01 | User11 | How could I do the same with cstring ? To concat a cstring into a string variable? |
03:03:05 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3AM4 probably the most sound method |
03:03:18 | FromDiscord | <Elegantbeef> Idk if `size` is the size of the buffer or if `count` is |
03:04:29 | User11 | aha that makes more sense |
03:05:50 | User11 | the size is the size of 1 unit of data, and the count is how many, I think |
03:06:20 | User11 | so the real size is "size * count" |
03:06:23 | FromDiscord | <Elegantbeef> ah then replace size with `size count` where i used size of course |
03:06:41 | FromDiscord | <Elegantbeef> ah i see you actually understand what's going on 😛 |
03:06:51 | User11 | ok I'll try it out |
03:06:55 | User11 | Thank you |
03:07:04 | FromDiscord | <Elegantbeef> That Zip stuff is still questionable though |
03:07:17 | FromDiscord | <Elegantbeef> Since iirc the header stores the information to files/entires |
03:09:16 | User11 | I'll look up how to use Zippy if it still doesnt work. I have options now before I wasn't sure what was going on |
03:10:13 | User11 | TY :)) |
03:11:21 | FromDiscord | <Elegantbeef> No problem happy to help |
03:41:15 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
03:41:42 | * | Gustavo6046 joined #nim |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:31 | * | supakeen joined #nim |
04:47:40 | * | rockcavera quit (Remote host closed the connection) |
05:30:26 | * | pch__ is now known as kinkinkijkin |
06:36:50 | * | PMunch joined #nim |
06:40:27 | * | naquad quit (Remote host closed the connection) |
06:43:58 | * | jjido joined #nim |
06:51:04 | * | PMunch quit (Quit: Leaving) |
06:55:29 | * | PMunch joined #nim |
07:14:27 | * | max22- joined #nim |
07:29:24 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
07:50:22 | Amun-Ra | how can I check backend type (c/cpp/objc) compile time? |
07:51:46 | * | jjido joined #nim |
07:53:31 | FromDiscord | <xflywind> !eval import std/compilesettings; static: echo querySetting(backend) |
07:53:33 | NimBot | <no output> |
07:53:49 | FromDiscord | <Rika> it doesnt post compile time output |
07:54:07 | FromDiscord | <xflywind> !eval import std/compilesettings; const s = querySetting(backend); echo s |
07:54:09 | NimBot | c |
07:54:38 | FromDiscord | <xflywind> In reply to @Amun-Ra "how can I check": ^ |
07:54:50 | FromDiscord | <xflywind> In reply to @Rika "it doesnt post compile": I forgot |
07:57:13 | Amun-Ra | xflywind: that's it, thank you |
07:57:33 | FromDiscord | <xflywind> no problem |
08:20:13 | NimEventer | New thread by Jorjun_arch: Is the Browser the Platform?, see https://forum.nim-lang.org/t/8477 |
08:32:35 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:08:15 | * | jjido joined #nim |
09:27:42 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
10:41:24 | * | pro joined #nim |
10:42:36 | * | pro quit (Client Quit) |
10:56:04 | * | Vladar joined #nim |
11:25:18 | * | jjido joined #nim |
11:25:19 | * | jjido quit (Client Quit) |
11:42:36 | * | crem quit (Ping timeout: 245 seconds) |
11:42:55 | * | crem joined #nim |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:32 | * | supakeen joined #nim |
12:16:18 | * | rockcavera joined #nim |
12:16:18 | * | rockcavera quit (Changing host) |
12:16:18 | * | rockcavera joined #nim |
12:19:24 | * | pro joined #nim |
12:37:36 | PMunch | Hmm, maybe I should do a little bit of streaming for Hacktober |
12:39:01 | pro | maybe :) |
12:54:56 | * | pro quit (Quit: WeeChat 3.3) |
13:02:01 | * | kayabaNerve_ joined #nim |
13:03:37 | * | TechAspirer joined #nim |
13:04:28 | * | kayabaNerve quit (Ping timeout: 252 seconds) |
13:04:35 | * | arkurious joined #nim |
13:06:26 | * | kayabaNerve_ quit (Ping timeout: 260 seconds) |
13:23:44 | * | PMunch quit (Quit: Leaving) |
13:25:20 | FromDiscord | <Marvel> hi, i am trying to use nimyaml and output my yaml file but i am just getting no output. how do i fix this?↵↵nim file: https://play.nim-lang.org/#ix=3AOm (the example from the nimyaml documentation) |
13:29:49 | * | PMunch joined #nim |
13:32:49 | * | max22- quit (Ping timeout: 268 seconds) |
13:32:56 | * | KainAlive joined #nim |
13:34:53 | FromDiscord | <Gumber> You're not sending anything to stdout... |
13:35:07 | * | KainAlive quit (Client Quit) |
13:35:11 | FromDiscord | <Marvel> what should i send? |
13:35:14 | FromDiscord | <Marvel> `s`? |
13:40:13 | FromDiscord | <Gumber> You're code doesn't make sense |
13:40:44 | FromDiscord | <Rika> ill take a look as well |
13:40:59 | FromDiscord | <Rika> gumber i think they mean "output" as in file output |
13:41:56 | FromDiscord | <Rika> ah |
13:42:10 | FromDiscord | <Rika> marvel, isnt an empty array in yaml just an empty file |
13:42:15 | FromDiscord | <Rika> thats why |
13:42:20 | FromDiscord | <Rika> your seq is empty |
13:42:35 | FromDiscord | <tandy> can nimdoc generate docs for javascript backend? |
13:42:49 | FromDiscord | <haxscramper> nim doc can generate docs for any backend |
13:43:03 | FromDiscord | <haxscramper> or do you have some specific thing that is hidden under `when defined(js)`? |
13:43:22 | FromDiscord | <tandy> hmm no, but i have an `import dom` which causes nim doc to fail i think |
13:43:25 | FromDiscord | <haxscramper> In this case you can probably use `-d:js` or `--backend:js` when `nim doc` |
13:43:35 | FromDiscord | <haxscramper> What is the error message? |
13:43:36 | FromDiscord | <tandy> oh cool |
13:43:51 | FromDiscord | <haxscramper> And you can hide some code from nim doc using `when no defined(nimdoc)` |
13:44:10 | FromDiscord | <Rika> is there anyone other than status employees that use `nim-serialization`? are there any issues with it? about to write some code, just want to know if youve encountered issues |
13:44:30 | FromDiscord | <Gumber> Sorry I'm at the doctor |
13:45:12 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3AOq |
13:45:25 | FromDiscord | <tandy> i tried doing that, but then of course the code fails without the import |
13:46:40 | FromDiscord | <Marvel> In reply to @Rika "marvel, isnt an empty": no the yaml file isn't empty |
13:46:50 | FromDiscord | <haxscramper> https://github.com/nim-lang/Nim/blob/version-1-4/lib/js/dom.nim#L13 |
13:46:52 | FromDiscord | <Rika> oh you're loading& |
13:46:54 | FromDiscord | <haxscramper> it has a typo in check |
13:46:58 | FromDiscord | <haxscramper> `Nimdoc` |
13:47:01 | FromDiscord | <haxscramper> should be `nimdoc` |
13:47:13 | FromDiscord | <haxscramper> Run with `-d:Nimdoc` |
13:47:18 | FromDiscord | <Marvel> sent a code paste, see https://play.nim-lang.org/#ix=3AOr |
13:47:31 | * | def- quit (Quit: -) |
13:47:38 | FromDiscord | <tandy> oof, but im running devel? |
13:47:45 | FromDiscord | <tandy> i dont see the typo there |
13:47:52 | * | PMunch quit (Quit: Leaving) |
13:48:18 | FromDiscord | <haxscramper> image.png https://media.discordapp.net/attachments/371759389889003532/894581701123117106/image.png |
13:48:20 | FromDiscord | <haxscramper> SHould be `nimdoc` |
13:48:20 | * | def- joined #nim |
13:48:30 | FromDiscord | <haxscramper> qah |
13:48:30 | FromDiscord | <tandy> yea, i switched branch to devel on that file |
13:48:31 | FromDiscord | <haxscramper> devel |
13:48:48 | FromDiscord | <haxscramper> aff |
13:48:55 | FromDiscord | <haxscramper> there is no nimdoc check even |
13:49:08 | FromDiscord | <tandy> this is if i add `-d:js` |
13:49:10 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3AOv |
13:49:17 | FromDiscord | <haxscramper> well, then I don't know, probably @xflywind is typing some magic fix |
13:49:26 | FromDiscord | <xflywind> `defined` is style-insensitive |
13:49:29 | FromDiscord | <haxscramper> but I have no idea |
13:49:48 | FromDiscord | <haxscramper> `nimdoc` != `Nimdoc` even with style insensetivity |
13:50:27 | FromDiscord | <xflywind> well, I was wrong. the first char is case insensitive. |
13:50:34 | FromDiscord | <xflywind> try `nim doc -b:js`? |
13:51:04 | FromDiscord | <tandy> woo |
13:51:07 | FromDiscord | <tandy> that works |
13:51:24 | FromDiscord | <tandy> didnt know -b was a thing |
13:51:25 | FromDiscord | <haxscramper> does `--backend:js` not work? |
13:51:44 | FromDiscord | <tandy> i didnt try --backend oops |
13:51:45 | FromDiscord | <haxscramper> oh well |
13:51:46 | FromDiscord | <haxscramper> `-b` is the same as `--backend` |
13:51:53 | FromDiscord | <tandy> that works tho |
13:53:02 | FromDiscord | <tandy> where is nim doc docs? |
13:53:15 | * | max22- joined #nim |
13:53:23 | FromDiscord | <haxscramper> `htmldocs` or `--outdir:<your directory>` |
13:53:28 | FromDiscord | <tandy> https://nim-lang.org/docs/docgen.html |
13:53:41 | FromDiscord | <tandy> ty ahha |
13:56:18 | FromDiscord | <Gumber> But uh the problem is you're just loading your file into a stream and then deserializing it into a seq |
13:56:33 | FromDiscord | <Gumber> You never print the stream or the sequence |
13:57:03 | FromDiscord | <Gumber> @Marvel |
13:57:15 | FromDiscord | <Gumber> This is why I said your code makes no sense |
13:57:18 | FromDiscord | <Marvel> so what should i print? |
13:57:25 | * | neurocyte013288 joined #nim |
13:57:25 | * | neurocyte013288 quit (Changing host) |
13:57:25 | * | neurocyte013288 joined #nim |
13:57:27 | FromDiscord | <Marvel> sorry i am new to nim |
13:57:42 | FromDiscord | <Gumber> You need to understand what you're doing first.... |
13:57:48 | FromDiscord | <Marvel> ooooh wiat |
13:57:52 | FromDiscord | <Marvel> (edit) "wiat" => "wait" |
13:57:54 | FromDiscord | <Marvel> i got it |
13:57:57 | FromDiscord | <Marvel> ok ok |
13:58:29 | FromDiscord | <Marvel> so the `load` function takes the yaml contents from file `s` and puts it into seq `personList` so if i echo `personList` i get the contents of the fiel |
13:58:31 | FromDiscord | <Marvel> (edit) "fiel" => "file" |
13:58:38 | FromDiscord | <Gumber> You're not doing what you think you're trying to do.... |
13:58:52 | FromDiscord | <Gumber> You're just trying to load a YAML file into memory and print it, correct? |
13:59:07 | FromDiscord | <Marvel> at first |
13:59:10 | FromDiscord | <Gumber> No |
13:59:22 | FromDiscord | <Marvel> eventually i need to save it into a variable and use it as an api token |
13:59:24 | FromDiscord | <Gumber> You get a sequence of people objects |
13:59:36 | FromDiscord | <Gumber> Deserialization |
13:59:52 | FromDiscord | <Gumber> You take the yaml representation of the people list |
14:00:21 | FromDiscord | <Gumber> And you deserialize it into a sequence of people objects |
14:00:32 | FromDiscord | <Gumber> If you want to print them out you can use echo |
14:00:35 | * | neurocyte013288 quit (Client Quit) |
14:00:48 | FromDiscord | <Gumber> Or echo repr if they are ref objects |
14:01:04 | FromDiscord | <Gumber> Use echo ref if you want to print the entire sequence |
14:01:38 | FromDiscord | <Gumber> Sorry I'm on the doctor's table waiting for them to come back in |
14:01:44 | FromDiscord | <Marvel> lol its alr |
14:01:57 | FromDiscord | <Marvel> In reply to @Gumber "Use echo ref if": wdym 'ref'? |
14:02:03 | FromDiscord | <Gumber> Reference |
14:02:12 | FromDiscord | <Gumber> You should read the Nim manual |
14:02:20 | FromDiscord | <Gumber> It explains these things |
14:02:35 | FromDiscord | <Gumber> Well not nimyaml |
14:02:41 | FromDiscord | <Gumber> But ref objects |
14:03:06 | FromDiscord | <Marvel> no i understand ref |
14:03:15 | FromDiscord | <Marvel> i have a large programming background |
14:03:19 | FromDiscord | <Marvel> im just new to nim |
14:03:26 | FromDiscord | <Gumber> Okay |
14:03:56 | FromDiscord | <Marvel> thanks so much for you're help |
14:04:03 | FromDiscord | <Marvel> im sorry im so stupid lol |
14:04:04 | FromDiscord | <Gumber> Np |
14:04:21 | FromDiscord | <Gumber> You're probably not stupid and no need to apologize |
14:04:36 | FromDiscord | <Gumber> I can't say for certain haha, I don't know you personally |
14:04:42 | FromDiscord | <Marvel> lmao thanks |
14:04:49 | FromDiscord | <Gumber> 👍 |
14:06:19 | * | neurocyte013288 joined #nim |
14:06:19 | * | neurocyte013288 quit (Changing host) |
14:06:19 | * | neurocyte013288 joined #nim |
14:14:22 | * | Zevv quit (Ping timeout: 250 seconds) |
14:37:26 | * | User11 quit (Ping timeout: 260 seconds) |
14:44:29 | * | jjido joined #nim |
15:51:03 | FromDiscord | <Goel> sent a code paste, see https://paste.rs/9OT |
15:52:05 | FromDiscord | <Rika> inc doesnt mean "add one" |
15:52:10 | FromDiscord | <Rika> well |
15:52:17 | FromDiscord | <Rika> afaik? |
15:52:54 | FromDiscord | <Rika> okay |
15:52:59 | FromDiscord | <Rika> it does mean add one but it's not well defined on floats |
15:53:08 | FromDiscord | <Goel> I can understand that inc() needs ordinal type and n is float. I can accept it. But why i can do n += 1? 1 is not cosidered int in this case? I though i had to do n += 1.0 |
15:53:17 | FromDiscord | <Rika> rather not all floats would return a different value when you add one |
15:53:49 | FromDiscord | <Rika> `1` is a literal and can be coerced into a float |
15:54:50 | krux02 | Goel, if you remove `inc` from your knowledge and your codebase, you won't miss anything. |
15:55:31 | nrds | <Prestige99> Yeah I just avoid `inc` |
15:55:38 | nrds | <Prestige99> seems odd to me |
15:56:09 | krux02 | I think it was introduced for enums, but iterators work much better here. |
15:56:20 | FromDiscord | <Goel> Really? Actually i've been using += for long time, then reading some code i read a lot of inc() and i though was a good idea as of style to change into it... |
15:56:48 | krux02 | I've been on both sides |
15:56:56 | krux02 | you can safely ignore inc |
15:57:03 | FromDiscord | <Rika> In reply to @Goel "Really? Actually i've been": prolly just used because people recommended it |
15:57:15 | FromDiscord | <Rika> yes it can be ignored, it's just another += |
15:57:31 | krux02 | but it is also not bad to have just inc instead of `+=`, you should just pick one and ignore the other |
15:57:38 | krux02 | and I prefer `+=` |
15:58:01 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
15:59:40 | FromDiscord | <Rika> well personally i use one or the other depending on context but yeah |
16:10:28 | * | neurocyte013288 quit (Quit: The Lounge - https://thelounge.chat) |
16:12:17 | * | neurocyte013288 joined #nim |
16:12:17 | * | neurocyte013288 quit (Changing host) |
16:12:17 | * | neurocyte013288 joined #nim |
16:24:35 | * | Zevv joined #nim |
17:26:59 | * | neurocyte013288 quit (Ping timeout: 245 seconds) |
17:37:46 | * | rockcavera quit (Ping timeout: 252 seconds) |
17:44:36 | * | jjido joined #nim |
17:51:49 | * | nixfreak_nim[m]1 quit (Ping timeout: 268 seconds) |
17:52:08 | * | nixfreak_nim[m]1 joined #nim |
18:04:16 | * | Gustavo6046 quit (Ping timeout: 245 seconds) |
18:04:52 | * | Gustavo6046 joined #nim |
18:08:29 | FromDiscord | <Hamid Bluri> hey - is there any async wrapper for `osproc` module? |
18:10:43 | FromDiscord | <Hamid Bluri> or any suggestion how to implement it? |
18:10:47 | FromDiscord | <Hamid Bluri> (edit) "or any suggestion ... how" added "on" |
18:14:51 | * | max22- quit (Ping timeout: 268 seconds) |
18:31:25 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
18:35:00 | FromDiscord | <haxscramper> https://github.com/cheatfate/asynctools |
18:35:03 | nrds | <R2D299> itHub: 7"Various asynchronous tools for Nim language" |
18:37:54 | FromDiscord | <iffy (Matt Haggard)> How can I pass a string by reference instead of copying? |
18:38:38 | FromDiscord | <iffy (Matt Haggard)> In other words, I have a `string` and I've made a proc that wants a `ref string`. Am I doing it wrong? |
18:38:59 | FromDiscord | <Yardanico> In reply to @iffy (Matt Haggard) "In other words, I": why do you want a ref of it? |
18:39:05 | FromDiscord | <Yardanico> to modify? then use `var string` in argument |
18:39:18 | FromDiscord | <iffy (Matt Haggard)> I want the speed of avoiding a copy. Oh, duh... |
18:39:24 | FromDiscord | <iffy (Matt Haggard)> Thinking too hard |
18:41:02 | * | rockcavera joined #nim |
18:41:02 | * | rockcavera quit (Changing host) |
18:41:02 | * | rockcavera joined #nim |
18:41:59 | * | vicfred joined #nim |
18:42:44 | FromDiscord | <haxscramper> you don't need to be concerned with that when passing arguments to functions |
18:42:49 | FromDiscord | <haxscramper> nim optimizes that |
18:52:08 | * | nixfreak_nim[m]1 quit (Ping timeout: 250 seconds) |
18:54:37 | * | nixfreak_nim[m]1 joined #nim |
18:56:09 | * | max22- joined #nim |
18:56:42 | * | max22- quit (Remote host closed the connection) |
18:57:27 | * | max22- joined #nim |
19:06:25 | * | Vladar quit (Quit: Leaving) |
19:07:15 | * | jjido joined #nim |
19:20:10 | FromDiscord | <treeform> In reply to @iffy (Matt Haggard) "In other words, I": I don't think that would speed things, but do profile it, you never know. |
19:20:17 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
19:20:50 | FromDiscord | <treeform> I had speed success in passing using `var string` even when I am not modifying it. |
19:21:31 | FromDiscord | <treeform> I used `hottie` to see that there was a ton of string copying |
19:21:44 | FromDiscord | <treeform> nim could figure out that I don't mutate the string |
19:21:54 | FromDiscord | <treeform> so it just made everything var string which made mutation ok |
19:22:03 | FromDiscord | <treeform> and it just passed stuff without string copies |
19:22:11 | FromDiscord | <treeform> even though no mutation where there |
19:22:47 | FromDiscord | <treeform> this var string made a difference: https://github.com/treeform/globby/blob/master/src/globby.nim#L34 |
19:23:01 | FromDiscord | <treeform> I `hottie` and `bency` it and it was good. |
19:26:51 | FromDiscord | <Hamid Bluri> In reply to @treeform "I `hottie` and `bency`": ben[ch]y you mean? |
19:27:03 | FromDiscord | <treeform> sorry yes |
19:57:37 | * | nixfreak_nim[m]1 quit (Ping timeout: 268 seconds) |
19:57:59 | * | nixfreak_nim[m]1 joined #nim |
19:59:16 | * | neurocyte013288 joined #nim |
19:59:16 | * | neurocyte013288 quit (Changing host) |
19:59:16 | * | neurocyte013288 joined #nim |
19:59:23 | * | neurocyte013288 quit (Client Quit) |
20:03:06 | * | jjido joined #nim |
20:06:55 | * | neurocyte013288 joined #nim |
20:06:55 | * | neurocyte013288 quit (Changing host) |
20:06:55 | * | neurocyte013288 joined #nim |
20:11:43 | FromDiscord | <iffy (Matt Haggard)> hmmm, why does `nimble install hottie` not work? |
20:19:45 | FromDiscord | <Elegantbeef> What does it error with? |
20:21:24 | FromDiscord | <iffy (Matt Haggard)> " Error\: Package not found." |
20:21:43 | FromDiscord | <iffy (Matt Haggard)> Is it because I'm on macOS and hottie isn't supported for macOS? |
20:21:49 | FromDiscord | <Elegantbeef> Seems like your nimble package list isnt upgrading |
20:21:55 | FromDiscord | <Elegantbeef> You can always install it using the git url |
20:22:31 | FromDiscord | <Yardanico> In reply to @iffy (Matt Haggard) "hmmm, why does `nimble": It's because it's not in Nimble :D |
20:22:49 | FromDiscord | <Yardanico> ah nvm it is |
20:22:53 | FromDiscord | <Yardanico> scratch my previous message |
20:23:35 | FromDiscord | <treeform> In reply to @iffy (Matt Haggard) "Is it because I'm": hottie is not supported on macOS |
20:25:39 | FromDiscord | <Elegantbeef> It is |
20:27:14 | * | neurocyte013288 quit (Quit: The Lounge - https://thelounge.chat) |
21:07:19 | FromDiscord | <Elegantbeef> @geekrelief\: i have to ask, have you taken a look at nimscripter v2 yet? |
21:23:29 | FromDiscord | <geekrelief> In reply to @Elegantbeef "<@109484839480107008>\: i have to": Yeah I just tried it out a bit last night. |
21:24:22 | FromDiscord | <geekrelief> It's been a while since I last looked at it. It was only a cursory glance just to see if things were working. |
21:25:28 | FromDiscord | <geekrelief> It feels nicer compared to last time I checked. I'm looking forward to see how this works out with TM. |
21:29:13 | FromDiscord | <Elegantbeef> Yea, i'm much happier with the API as it is, odd what a year of making macros/writting code can do 😀 |
21:29:30 | FromDiscord | <Elegantbeef> Honestly thinks the fancy to/fromVm macros were purely from fixing the compiler |
21:29:56 | FromDiscord | <geekrelief> In reply to @Elegantbeef "Yea, i'm much happier": Definitely, the first time I tried nimscripter, I couldn't figure how to make it work with nim devel. :p |
21:29:58 | FromDiscord | <geekrelief> (edit) ":p" => "😄" |
21:31:51 | FromDiscord | <geekrelief> Hopefully, I want to dive into the nimscripter source more once I get my TM bindings further along. There's gotta be a way to make the bindings from to nim to nims smoother. |
21:32:16 | FromDiscord | <geekrelief> (edit) removed "Hopefully," |
21:33:22 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3AQQ |
21:33:50 | FromDiscord | <geekrelief> Creating that wrapping seems tedious. |
21:33:59 | FromDiscord | <Elegantbeef> Yep having the compiler as a dependancy with nimble does nothing but cause issues |
21:36:12 | FromDiscord | <Elegantbeef> Well the issue is typeclasses/generics, but it's doable |
21:37:31 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3AQR |
21:38:24 | FromDiscord | <Elegantbeef> Typeclasses are a bitch though, so i have to think on it a bit |
21:38:38 | FromDiscord | <Elegantbeef> The one idea is a bunch of try excepts on parsing, but that's shit for obvious reasons |
21:38:43 | FromDiscord | <geekrelief> In reply to @Elegantbeef "Well the issue is": Can you elaborate on why typeclasses/generics are tedious to deal with? I haven't used much of either, but then again I'm going to be dealing with a C binding. |
21:38:58 | FromDiscord | <Elegantbeef> Generics will not be supported as it's just unfeasible |
21:39:07 | FromDiscord | <Elegantbeef> typeclasses can be, so i will offer it |
21:41:31 | FromDiscord | <Elegantbeef> Ideally we can export an entire module to a script, but we'll see 😀 |
21:41:57 | FromDiscord | <geekrelief> That would be sweet! |
21:42:19 | FromDiscord | <Elegantbeef> Well you cannot overload on nimscript for VM procs |
21:42:22 | FromDiscord | <Elegantbeef> So you have to figure out the proc to call from parsing |
21:42:43 | FromDiscord | <Elegantbeef> Or export a bunch of aliases that call mangled names |
21:43:26 | FromDiscord | <geekrelief> In reply to @Elegantbeef "Or export a bunch": For my purposes, that's ok. What happens if you try overloading? |
21:43:42 | FromDiscord | <Elegantbeef> square for instance has `int or float` for every parameter, so that means you need every combination of type classes |
21:43:42 | FromDiscord | <Elegantbeef> so `int, int, int, int` `int, int, int, float` `int, int, float, int` .... |
21:44:08 | FromDiscord | <Elegantbeef> So one side will make the nimscript bloated, the otherside will make interop more costly with try excepts for flow control |
21:44:39 | FromDiscord | <Elegantbeef> Generics are just impossible to support due to needing to have a nim generic instantiated |
21:45:04 | FromDiscord | <Elegantbeef> Since generics instantiate procs when called, and you dont know what type the nimscript is sending you, you just cannot use generics |
21:45:27 | FromDiscord | <Elegantbeef> Typeclasses will work purely due to the fact you know the limited allowed types so can generate code to support them |
21:45:39 | FromDiscord | <Elegantbeef> composite type classes like `seq` will not work either for the same reason as generics |
21:46:18 | FromDiscord | <Elegantbeef> Well you cannot overload VM procs, there is a single `someProcName` for the nimscript side solution it involves emitting all permutations of the proc then calling a mangled version internally |
21:46:53 | FromDiscord | <Elegantbeef> so you might have `squareintintintint` or something similar emitted by nimscripter so when you do `square(10, 10, 10, 10)` it calls that one |
21:47:26 | FromDiscord | <Elegantbeef> But if you did `square(10d, 10d, 10fint, 10int)` it'd call `squarefloatfloatintint` |
21:47:55 | FromDiscord | <Elegantbeef> Probably better to just use `gensym` for the naming |
21:47:57 | FromDiscord | <Elegantbeef> But you get the point |
21:48:07 | FromDiscord | <Elegantbeef> Each permutation needs it's own generated nimscript side proc |
21:49:22 | FromDiscord | <geekrelief> I wonder if that's going to be a real issue in practice. |
21:49:43 | FromDiscord | <Elegantbeef> Well i'm going to walk dogs now, so will be back to talk more in a bit if you have any more ideas/concerns |
21:49:52 | FromDiscord | <geekrelief> alright thx! |
21:50:55 | FromDiscord | <Elegantbeef> It'll be 100% hidden either way |
21:51:14 | FromDiscord | <Elegantbeef> So it's a non issue for users, just implementation issues |
22:01:02 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:02:08 | FromDiscord | <geekrelief> In reply to @Elegantbeef "Well you cannot overload": So I just answered my own question. I was wondering what would happen if you attempt to overload: Overloading on parameter types we get output to the console about mismatched types, but overloading on argument count I got unexpected behavior. Why is the circle growing?! https://media.discordapp.net/attachments/371759389889003532/894705973724348466/dYCBallUFf.mp4 |
22:14:06 | FromDiscord | <geekrelief> I guess we can deal with different argument counts with default parameters. |
22:26:22 | nrds | <Prestige99> In a c lib I'm wrapping there are checks like `#if CP_USE_DOUBLES` How should I go about wrapping that? |
22:26:50 | nrds | <Prestige99> atm it appears to be falsey so I had to declare a type with cfloat instead of cdouble |
22:26:51 | FromDiscord | <impbox [ftsf]> Sounds like it's an option |
22:26:59 | FromDiscord | <impbox [ftsf]> Probably with a define |
22:27:15 | FromDiscord | <impbox [ftsf]> The user of the library can use whether they want doubles or floats |
22:27:33 | FromDiscord | <impbox [ftsf]> Assuming CP is the library |
22:27:37 | nrds | <Prestige99> hm yeah I found #if defined(__LP64__) && __LP64__ |
22:27:44 | * | stkrdknmibalz joined #nim |
22:27:53 | nrds | <Prestige99> that determines CP_USE_DOUBLES |
22:28:03 | FromDiscord | <impbox [ftsf]> `when defined(useDoubles)` |
22:28:15 | FromDiscord | <impbox [ftsf]> Yeah i dunno then |
22:29:08 | FromDiscord | <impbox [ftsf]> Instead of using cfloat or cdouble you probably want to use a type that is defined to one of those depending on that |
22:30:11 | nrds | <Prestige99> hmm yeah maybe |
22:30:21 | FromDiscord | <impbox [ftsf]> when defined (useDoubles): type creal = cfloat↵else: type creal = cfloat32 |
22:34:49 | FromDiscord | <Elegantbeef> @geekrelief\: yea parameter count overloading works fine it's type overloading that's an issue |
22:35:21 | FromDiscord | <Elegantbeef> Going to work on the module wide exporting now |
22:36:13 | FromDiscord | <geekrelief> In reply to @Elegantbeef "Going to work on": I was just looking at the source. Is there a reason `nimscripter` doesn't export `expose`? |
22:36:58 | FromDiscord | <Elegantbeef> Other than me being a dullard, nope |
22:44:44 | FromDiscord | <Elegantbeef> So seems there isnt presently a way to get the module body from a macro |
22:51:37 | FromDiscord | <geekrelief> In reply to @Elegantbeef "So seems there isnt": Just throwing this out there, can we read the module file and use the compiler to parse it? |
23:03:45 | * | max22- quit (Remote host closed the connection) |
23:05:41 | FromDiscord | <Elegantbeef> This is a shame really, cause i dont even see a way in the compiler to do that |
23:06:09 | FromDiscord | <geekrelief> sent a code paste, see https://play.nim-lang.org/#ix=3AR8 |
23:06:10 | FromDiscord | <geekrelief> but I get an importc error |
23:06:24 | FromDiscord | <geekrelief> C:\Nim\compiler\options.nim(547, 22) Error: cannot 'importc' variable at compile time; stderr |
23:06:42 | FromDiscord | <Elegantbeef> Yea that's not the right way around this problem |
23:07:12 | FromDiscord | <Elegantbeef> On top of it you're going to get symbols that dont match the ones in the cache |
23:08:12 | FromDiscord | <Elegantbeef> The proper solution is to patch the compiler so `skModule`s return their sem'd AST but they dont seem to store that so it's a pipedream |
23:08:22 | FromDiscord | <geekrelief> yeah don't listen to me, I barely have an inkling of what I'm talking about. I was inspired by looking at nimterop's code 😄 |
23:08:25 | FromDiscord | <Elegantbeef> It might be possible to get the symbols they expose though, which might make it possible |
23:08:52 | FromDiscord | <Elegantbeef> It's fine, just looking at the compiler to see if we can gracefully add this |
23:15:33 | FromDiscord | <Elegantbeef> Well i do not see how so i guess we'll have to settle for the tedious impl until |
23:34:27 | FromDiscord | <impbox [ftsf]> _is sad push can't be used for this, seems perfect_ |
23:36:51 | FromDiscord | <Elegantbeef> It may be possible i guess, idk i'd prefer just `exportToNimscript(module, nimscriptModuleName)` |
23:37:32 | NimEventer | New post on r/nim by hayden_suse: Nim Windows Containers, see https://reddit.com/r/nim/comments/q1ibtl/nim_windows_containers/ |
23:38:33 | FromDiscord | <impbox [ftsf]> yeah i guess that'd be rad too |
23:38:48 | FromDiscord | <impbox [ftsf]> time to hack the compiler |
23:39:36 | FromDiscord | <Elegantbeef> Well i did see if there is a way for us to get exported symbols from a module easily, if so we can make a new VM op |
23:44:22 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3ARe |
23:54:41 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |