00:12:17 | * | gmaggior quit (Quit: Leaving) |
00:27:28 | * | a_chou quit (Ping timeout: 258 seconds) |
00:32:45 | * | Tanger joined #nim |
00:39:48 | * | a_chou joined #nim |
00:40:46 | * | abm quit (Read error: Connection reset by peer) |
00:42:26 | * | Tlangir joined #nim |
00:44:48 | * | Tanger quit (Ping timeout: 260 seconds) |
00:50:06 | FromDiscord | <ThothLoki> is there any software out there that has been written in nim that is being used professionally? |
00:50:23 | FromDiscord | <19> hello, stupid question: im binding to a dll it compiles nicely but it says `could not import: Win32LoadXInput` when i run the exe |
00:52:06 | FromDiscord | <Nisha (LGBTQ+)> Is that the dll? |
00:52:27 | FromDiscord | <Nisha (LGBTQ+)> @19 |
00:52:50 | FromDiscord | <19> thats the name of the c function |
00:52:58 | FromDiscord | <Nisha (LGBTQ+)> Oh alright |
00:53:08 | FromDiscord | <19> nim bind:↵```proc win32loadxinput(){. importc:"Win32LoadXInput", dynlib:"win32_njin.dll" .}```↵compiler command:↵```cl ..\code\win32_njin.cpp user32.lib gdi32.lib -Zi /LD /link /EXPORT:Win32LoadXInput``` |
00:53:16 | FromDiscord | <Nisha (LGBTQ+)> Hm |
00:53:38 | FromDiscord | <Nisha (LGBTQ+)> Try putting the dll inside of the same folder that the exe is is just to check something please |
00:54:18 | FromDiscord | <19> it worked |
00:54:25 | FromDiscord | <19> thank you @Nisha (LGBTQ+) |
00:54:39 | FromDiscord | <Nisha (LGBTQ+)> No worries! |
00:55:58 | FromDiscord | <19> @ThothLoki there are some banks that use Nim |
00:56:11 | disruptek | which? |
00:57:46 | FromDiscord | <Rika> wtf? banks using nim? |
00:57:48 | FromDiscord | <Rika> that sounds insane |
00:57:57 | FromDiscord | <Rika> considering the shit i hear about banks and programming |
00:57:57 | FromDiscord | <ThothLoki> what do they use it for? |
00:58:59 | disruptek | there's unicredit i guess. |
01:00:10 | FromDiscord | <exelotl> I wonder what's the overlap between the banks that use Nim and the banks that just got exposed for illegal activity |
01:00:18 | FromDiscord | <ThothLoki> ok, so if i wanted to do a for loop to loop through a list, how would i do it?↵`let drives = (r"C:", r"F:", r"J:")`↵this is my list |
01:00:21 | FromDiscord | <ThothLoki> i am stumped |
01:00:25 | FromDiscord | <ThothLoki> i keep fucking it up |
01:00:53 | * | kenran joined #nim |
01:01:02 | FromDiscord | <exelotl> You probably want to use a seq or array instead of a tuple |
01:01:10 | FromDiscord | <Rika> that is not a list |
01:01:42 | FromDiscord | <ThothLoki> ok, i am coming from python, so these will be different |
01:01:59 | FromDiscord | <Rika> no, its the same in python |
01:03:45 | FromDiscord | <ThothLoki> i did a seq |
01:04:17 | FromDiscord | <ThothLoki> i saw i used ( ) instead of [ ] |
01:04:20 | FromDiscord | <ThothLoki> oops |
01:04:31 | FromDiscord | <ThothLoki> stupid laptop not being able to see in the dark |
01:05:21 | Prestige | Any recommendations for tui libs? Just found illwill, looks decent |
01:06:08 | * | kenran quit (Ping timeout: 272 seconds) |
01:06:20 | FromDiscord | <slonik_az> +1 to illwill |
01:06:41 | FromDiscord | <ThothLoki> awesome., thanks @exelotl and @Rika got it to work |
01:06:46 | FromDiscord | <ThothLoki> stupid fingers |
01:07:43 | FromDiscord | <Rika> illwill is a good choice if you already know how to use imgui |
01:07:55 | FromDiscord | <Rika> though it has less widgets than imgui |
01:07:58 | FromDiscord | <Rika> if you care about that |
01:08:22 | Prestige | never used it |
01:09:22 | FromDiscord | <ThothLoki> terminal "gui" huh? |
01:09:31 | * | a_chou quit (Quit: a_chou) |
01:09:41 | Prestige | terminal ui |
01:13:09 | Prestige | hm so are there no predefined widgets? Was hoping for a couple, but I could make my own I suppose |
01:14:01 | FromDiscord | <Rika> there are essentailly none but you can prolly gut the demo for some |
01:27:32 | Prestige | Going to be some work, will have fun playing with it |
01:31:00 | FromDiscord | <ThothLoki> does nim have a messagebox ui where you dont need a 3rd party gui library |
01:31:28 | * | apahl quit (Ping timeout: 244 seconds) |
01:33:22 | * | oculux quit (Ping timeout: 256 seconds) |
01:33:41 | * | apahl joined #nim |
01:39:11 | FromDiscord | <juan_carlos> You can hack one with terminal module. :P |
01:42:54 | disruptek | bentley and i were just talking about how criminally difficult iteration is. |
01:48:26 | Prestige | ? |
02:09:09 | * | lritter quit (Ping timeout: 260 seconds) |
02:21:17 | disruptek | ~bentley |
02:21:18 | disbot | bentley: 11https://imgur.com/gallery/yEXiWWG -- disruptek |
02:21:18 | disbot | bentley: 11a good boy |
02:21:34 | disruptek | c'mon, everyone knows bentley. |
02:28:15 | FromDiscord | <19> thats a nice dawg |
02:28:42 | Prestige | more curious about the iteration comment |
02:29:26 | disruptek | i know, right? |
02:29:55 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
02:30:17 | FromDiscord | <19> i have a main function in C where it does some funky win32 stuff. what is a nice way to inject nim code into that function? |
02:31:00 | FromDiscord | <19> callbacks? |
02:32:08 | Prestige | injecting nim code into c? :o |
02:33:02 | FromDiscord | <19> maybe i phrased it wrong |
02:34:19 | FromDiscord | <19> just need a way to call nim functions from that function, it basically has a game loop. |
02:34:46 | FromDiscord | <19> or should i break it down into smaller functions and move the loop to nim? |
02:35:16 | FromDiscord | <19> sorry just thinking out loud here |
02:35:18 | FromDiscord | <Antacon> you can wrap the funky C function in Nim, maybe? |
02:35:26 | FromDiscord | <Antacon> https://nim-lang.org/docs/backends.html#nim-code-calling-the-backend-c-invocation-example |
02:37:08 | FromDiscord | <19> thanks for the cool link. im already calling the C func from nim. but i want to add stuff to it's body and not just call it. |
02:37:24 | disruptek | just exportc your shit and call it from c. |
02:38:27 | FromDiscord | <19> i just noticed the exportc, didnt know it existed. thanks guys |
02:39:03 | FromDiscord | <19> damn that's cool |
02:49:45 | * | rockcavera joined #nim |
03:01:43 | * | kenran joined #nim |
03:05:59 | * | bunbunbunbunny joined #nim |
03:08:14 | bunbunbunbunny | 3/wc |
03:08:15 | * | bunbunbunbunny left #nim (#nim) |
03:09:15 | * | oculux joined #nim |
03:14:29 | * | a_chou joined #nim |
03:28:15 | disruptek | church. |
03:28:36 | FromDiscord | <flywind> What's the use of `{.gcsafe.}`? It prevents global variables from be copying by thread-local? Is is just an optimization strategy. It is hard for me to learn `gcsafe` even after reading Nim manual. |
03:30:16 | * | a_chou quit (Quit: a_chou) |
03:33:07 | * | apahl quit (Ping timeout: 260 seconds) |
03:33:26 | FromDiscord | <acek7> whats up |
03:33:57 | * | apahl joined #nim |
03:35:09 | disruptek | it's a guard that you opt out of, basically. flywind ^ |
03:35:34 | FromDiscord | <acek7> disruptek |
03:36:05 | disruptek | dude. |
03:36:15 | FromDiscord | <acek7> are you my dad |
03:36:34 | disruptek | prestige: it will be illwill? or fidget? |
03:37:02 | disruptek | acek7; depends on who your mom is, son. |
03:38:09 | FromDiscord | <acek7> whats your main use for nim |
03:38:54 | disruptek | !repo nakabonne/ali |
03:38:55 | disbot | https://github.com/nakabonne/ali -- 9ali: 11Generate HTTP load and plot the results in real-time 15 167⭐ 4🍴 7& 1 more... |
03:39:53 | FromDiscord | <acek7> what made you want to make this |
03:40:13 | disruptek | i mainly use nim to escape a skillset that might earn the stable income i desperately need to support you anf the many other siblings i have yet to meet. |
03:40:38 | disruptek | i didn't make it, junior. |
03:40:50 | FromDiscord | <acek7> damn dad that blows |
03:41:35 | disruptek | nah; i think you'll like your sisters if your mom is any ibdication. |
03:41:55 | FromDiscord | <acek7> lmao |
03:42:09 | FromDiscord | <acek7> you really like the go language |
03:42:40 | disruptek | is that a question? |
03:42:55 | FromDiscord | <acek7> no i think its a statement |
03:42:56 | FromDiscord | <Elegant Beef> That's not disruptek |
03:43:08 | FromDiscord | <acek7> imposter |
03:44:02 | disruptek | not enough douchebag? |
03:44:13 | Prestige | disruptek: illwill, want it to be tui |
03:44:25 | disruptek | i'm not a fan of go. |
03:44:43 | disruptek | the domain is nim.fan. go.fan was taken. |
03:46:04 | FromDiscord | <acek7> was gonna say man |
03:46:16 | FromDiscord | <acek7> you in the wrong place |
03:47:24 | * | thomasross quit (Ping timeout: 260 seconds) |
03:57:06 | FromGitter | <matrixbot> `Jaypatelani` Hello all. |
03:57:24 | FromDiscord | <Elegant Beef> Hello |
03:58:38 | FromDiscord | <acek7> sup dude |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:38 | * | rockcavera quit (Remote host closed the connection) |
04:06:39 | * | supakeen joined #nim |
04:09:10 | FromGitter | <awr1> hello |
04:09:39 | FromDiscord | <Rika> hello |
04:10:08 | FromGitter | <matrixbot> `Jaypatelani` This is official room? |
04:10:13 | FromGitter | <awr1> yes |
04:10:25 | FromGitter | <matrixbot> `Jaypatelani` Thanks for confirmation :) |
04:15:15 | FromGitter | <awr1> is @alehander92 in here? i just wanted to say i've been using zerofunctional for a while now and i think it is an absolutely superb library |
04:17:20 | FromDiscord | <Elegant Beef> They're around occasionally so they might see that |
04:27:05 | * | narimiran joined #nim |
05:39:46 | * | solitudesf joined #nim |
05:56:37 | * | apahl quit (Ping timeout: 260 seconds) |
06:04:32 | * | apahl joined #nim |
06:20:51 | alehander92 | i am here |
06:21:00 | alehander92 | thanks! but credits to michael72 |
06:21:20 | alehander92 | he really did a lot of good stuff to make it stable and extensible and quallity, i mostly started the project |
06:24:47 | * | PMunch joined #nim |
06:31:29 | FromGitter | <awr1> i extend my thanks to him as well, then! i prefer it to sequtils lol |
06:33:02 | alehander92 | we should see if something even better can be done |
06:33:07 | alehander92 | these days |
06:34:36 | FromGitter | <awr1> what did you have in mind? |
06:34:55 | alehander92 | well, maybe first class views |
06:35:08 | alehander92 | might help with that as mratsim said |
06:35:34 | alehander92 | because it might be easier to chain operations while reusing |
06:35:38 | alehander92 | the same underlying data |
06:42:15 | * | kungtotte quit (Read error: Connection reset by peer) |
06:43:11 | alehander92 | what do you guys think of |
06:43:15 | alehander92 | `...` in ruby 3 |
06:43:47 | alehander92 | it forwards args i think there was an idea to somehow think of a solution for that in nim (a version of it is from ruby 2.7 tho) |
06:44:50 | * | kungtotte joined #nim |
06:44:59 | * | shad0w_ joined #nim |
06:59:34 | * | Vladar joined #nim |
07:01:07 | PMunch | alehander92, how does it work? |
07:10:10 | FromDiscord | <zetashift> And what does it do haha, it's hard to google `ruby 3 ...` |
07:11:19 | PMunch | Yeah that's what I found out as well :P |
07:23:28 | FromDiscord | <Rika> think its ruby 3 destructuring |
07:23:35 | FromDiscord | <Rika> no |
07:23:36 | FromDiscord | <Rika> idk |
07:23:58 | FromDiscord | <Rika> `In Ruby the ... operator denotes a half-open range, i.e. that includes the start value but not the end value` |
07:24:12 | FromDiscord | <Rika> ? |
07:27:14 | PMunch | So ..< in Nim.. |
07:27:49 | FromDiscord | <Rika> im confused |
07:28:01 | FromDiscord | <Rika> theyre talking about something in arguments |
07:28:36 | FromDiscord | <Rika> ```↵Alternatively, if you do not need compatibility with Ruby 2.6 or prior and you don’t alter any arguments, you can use the new delegation syntax (...) that is introduced in Ruby 2.7.↵``` |
07:28:37 | FromDiscord | <Rika> ??? |
07:28:52 | FromDiscord | <Rika> oh, it forwards args to another function |
07:29:03 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=2ygB |
07:31:18 | * | NimBot joined #nim |
07:32:07 | PMunch | Oh, so it just forwards all arguments from the function to a sub-function |
07:33:30 | FromDiscord | <zetashift> oh that could be nice |
07:33:40 | FromDiscord | <zetashift> I haven't had any problems like that tbh |
07:34:07 | FromDiscord | <zetashift> Is there a Nim bencode parser? |
07:34:55 | FromDiscord | <Elegant Beef> there is this https://github.com/FedericoCeratto/nim-bencode |
07:36:02 | FromDiscord | <zetashift> huh weird that didn't pop up on Github |
07:36:48 | FromDiscord | <Elegant Beef> I'm weird and check nimble first 😄 |
07:47:49 | FromDiscord | <zetashift> I was following nim days, day 2 and stumbled on some code haha |
07:57:12 | * | krux02 joined #nim |
07:57:13 | FromDiscord | <Avatarfighter> What is up everyone |
07:57:56 | Araq | async orc is leak and crash free (to the best of my knowledge) |
07:58:52 | Araq | and it supports the old marshal.nim and deepcopy, it's 100% compatible to Nim v1 |
08:00:31 | FromDiscord | <Rika> nice |
08:00:34 | FromDiscord | <Rika> congrats |
08:01:13 | FromDiscord | <flywind> If I use arc/orc, is still `gcsafe` necessary? |
08:02:02 | Araq | yeah it is, I wrote an RFC how to remove .gcsafe from Nim |
08:02:26 | Araq | was rather unsuccessful ... |
08:03:01 | Araq | https://github.com/nim-lang/RFCs/issues/142 |
08:03:03 | disbot | ➥ Proposal to remove the `.gcsafe` effect from Nim ; snippet at 12https://play.nim-lang.org/#ix=26qX |
08:03:30 | FromDiscord | <flywind> Oh, I see. It is a pity. |
08:04:49 | * | Zectbumo joined #nim |
08:05:55 | Araq | flywind: well write down your arguments/experiences please (add it to the RFC) |
08:07:21 | FromDiscord | <flywind> Ok, I will. I don't know how to use `gcsafe` and how dangerous it is. |
08:07:23 | FromDiscord | <flywind> https://github.com/planety/prologue/blob/443b2aa23564b9c4248e7a7e079c526364968326/src/prologue/middlewares/sessions/redissession.nim#L56 |
08:17:41 | Araq | to see if it really is, add assert isMainThread() inside the .gcsafe block |
08:17:56 | Araq | probably we don't have isMainThread though :D |
08:22:30 | FromDiscord | <flywind> I just use the variables in closure environments, and it will be copied in every threads, is it still dangerous? |
08:22:45 | FromDiscord | <flywind> in refc |
08:23:19 | Araq | closure environments are the number one for data races |
08:25:57 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
08:26:30 | FromDiscord | <flywind> https://play.nim-lang.org/#ix=2ygI |
08:26:52 | FromDiscord | <flywind> Well, my framework just does something like this. |
08:27:37 | FromDiscord | <flywind> (edit) 'https://play.nim-lang.org/#ix=2ygI' => 'https://play.nim-lang.org/#ix=2ygJ' |
08:29:38 | Araq | your snippet is safe |
08:31:32 | FromDiscord | <flywind> Thanks! |
08:37:18 | PMunch | I really feel there should be a built-in way to do string -> seq[char|uint8] |
08:37:29 | PMunch | These casts just feels so dirty |
08:41:50 | FromDiscord | <Elegant Beef> Clearly just leave it as a string but when accessing from it convert to and ord 😛 |
08:44:17 | PMunch | Well I wanted to concatenate some string data onto a sequence of bytes |
08:44:58 | PMunch | Because Wireshark has a "copy escaped string" feature, and I had built part of my query as a Nim sequence :P |
08:45:20 | PMunch | http://ix.io/2ygN <- is there a better way of reading everything from a socket? |
08:45:37 | PMunch | I guess UDP doesn't have a concept of everything.. |
08:45:54 | FromDiscord | <Elegant Beef> Couldnt you use a string stream? |
08:46:18 | PMunch | Well I need the final product to be a sequence |
08:46:24 | PMunch | And there is no SequenceStream |
08:46:34 | PMunch | In fact we miss all kinds of streams.. |
08:47:22 | PMunch | Should also have SocketStream: https://github.com/PMunch/binaryparse/issues/6 |
08:47:23 | disbot | ➥ How to use a socket as input |
08:49:00 | FromDiscord | <acek7> how is everyone |
08:49:10 | Araq | yeah I never understood why dom96 didn't *start out* with socket streams |
08:52:23 | PMunch | I mean setPosition is a potential issue |
08:52:40 | PMunch | I guess it could just throw an error if you try to go backwards though.. |
09:04:11 | * | arecacea1 quit (Remote host closed the connection) |
09:04:35 | * | arecacea1 joined #nim |
09:07:16 | disruptek | i've been going backwards for years; the errors don't help. |
09:09:53 | Araq | PMunch, you can buffer it but it would be bad for when you've lots of data |
09:10:03 | PMunch | Exactly |
09:10:15 | Araq | https://github.com/nim-lang/RFCs/issues/104#issuecomment-694767095 we have a winner. |
09:10:15 | disbot | ➥ Nim's mascot proposal |
09:10:23 | Araq | my daugther likes this one best |
09:11:50 | FromDiscord | <Elegant Beef> I now wanna see an animation with a bigger crown that falls over it's face and it fights with to take off 😄 |
09:15:33 | PMunch | #badgercrew https://uploads.peterme.net/nim-mascot-head.png |
09:18:49 | FromDiscord | <flywind> Is it better to mark all procs in redis.nim as `gcsafe` or `nosideEffect` (or `func`)? https://github.com/nim-lang/redis/blob/master/src/redis.nim |
09:19:42 | FromDiscord | <Elegant Beef> Pmunch i still cant take that seriously |
09:20:32 | FromDiscord | <flywind> (edit) 'all' => 'some' |
09:25:05 | * | Vladar quit (Quit: Leaving) |
09:26:59 | PMunch | @Elegant, what part about that says joking to you! |
09:27:50 | FromDiscord | <dom96> Araq: looks awesome, but is that image original? |
09:31:13 | Araq | I don't know :-) |
09:32:36 | FromDiscord | <Rika> its not |
09:32:44 | FromDiscord | <Rika> seems to be a stock photo |
09:33:13 | FromDiscord | <Rika> https://www.dreamstime.com/isolated-cute-hand-drawn-lion-crown-isolated-cute-hand-drawn-lion-crown-king-animal-scandinavian-style-baby-image160855113 |
09:38:17 | * | apahl quit (Ping timeout: 260 seconds) |
09:39:06 | Oddmonger | i think i have missed something in arrays… can i assign their members in a for loop ? |
09:39:16 | * | Trustable joined #nim |
09:39:17 | Oddmonger | like: for light in light_array: |
09:39:26 | Oddmonger | light.color.alpha = 0 |
09:39:40 | Oddmonger | it seems that i cannot assign this way |
09:39:49 | * | apahl joined #nim |
09:40:01 | Oddmonger | may i need to ref light_array ? |
09:40:45 | FromDiscord | <haxscramper> Use `for item in mitems(light_array)` to iterate over mutable elements |
09:40:49 | FromDiscord | <Vindaar> ^ |
09:41:27 | Oddmonger | thank you |
09:42:07 | FromDiscord | <exelotl> > stock photo↵aw dangit |
09:42:59 | * | sagax joined #nim |
09:43:56 | Araq | yeah that's bad |
09:58:24 | * | sealmove joined #nim |
09:58:40 | sealmove | hey what's up with that nimwc? |
10:01:35 | * | PMunch quit (Quit: leaving) |
10:02:39 | * | PMunch joined #nim |
10:05:25 | sealmove | seems fancy :D |
10:07:05 | FromDiscord | <haxscramper> How can I convert body of `nnkAccQuoted` to node? For things like `ident("..")` I just get list of identifiers, not the body itself |
10:07:25 | FromDiscord | <haxscramper> For example https://play.nim-lang.org/#ix=2yh9 |
10:07:29 | * | Zectbumo quit (Remote host closed the connection) |
10:08:15 | FromDiscord | <haxscramper> And I can't even convert it to string `parseExpr` it |
10:16:31 | FromDiscord | <lqdev> use repr |
10:18:21 | FromDiscord | <Clyybber> @haxscramper Do you want the result to be "Ident "hello""? |
10:20:56 | FromDiscord | <haxscramper> Yes, I expected to see `(Call (Ident "ident") (StrLit "hello"))` inside quoted part |
10:23:23 | FromDiscord | <haxscramper> > use repr↵@lqdev https://play.nim-lang.org/#ix=2yhc same result - I put in `` `ident("213")` `` and get `` `ident ( 213 )` `` as result |
10:26:37 | FromDiscord | <Clyybber> @haxscramper Why do you expect to get that? Its invalid code. |
10:27:06 | FromDiscord | <Clyybber> But I understand the use case, it would allow to use inline-expressions inside `` for quote |
10:28:41 | FromDiscord | <Clyybber> @flywind Is there any reason you specify so much in the testament spec of your test PRs? |
10:31:42 | FromDiscord | <shashlick> Araq: do you think https://github.com/nim-lang/Nim/issues/15202 is also fixed? I'll try in a few hours but curious on that one. |
10:31:43 | disbot | ➥ --gc:arc segfaults if dll modifies object owned by main executable ; snippet at 12https://play.nim-lang.org/#ix=2xUj |
10:37:07 | * | letto quit (Quit: Konversation terminated!) |
10:39:51 | Oddmonger | is it ok to cast a cstring to string, for a case ? |
10:40:13 | Oddmonger | case cast[string](payload.param_name): … |
10:40:24 | FromDiscord | <lqdev> nope |
10:40:29 | FromDiscord | <lqdev> you need to do `$myCstring` |
10:40:32 | * | letto joined #nim |
10:40:36 | FromDiscord | <lqdev> if it's null-terminated |
10:40:43 | Oddmonger | oh |
10:41:02 | Oddmonger | thank you |
10:45:03 | FromDiscord | <flywind> @Clyybber no, just for future changes easily. |
10:48:03 | Araq | shashlick: there never was such a bug as far as I'm concerned, your config setup was to blame |
10:54:37 | FromDiscord | <Clyybber> @flywind I think its better to not overspecify, so that we can change defaults easily |
10:56:15 | FromDiscord | <Clyybber> And to keep it more simple |
10:59:23 | FromDiscord | <flywind> Ok, I agree with you. |
11:04:22 | Yardanico | lol, didn't expect this https://github.com/Yardanico/posthog-nim/issues/1 |
11:04:23 | disbot | ➥ PostHog Team Appreciation |
11:04:27 | Yardanico | wrote that small library a few months ago |
11:08:51 | FromDiscord | <Vindaar> that's pretty nice of them! |
11:14:36 | Yardanico | they gave me a $25 coupon for https://merch.posthog.com/ and also said "Also, I have a personal interest in supporting the Nim community. " :P |
11:15:16 | FromDiscord | <lqdev> nice |
11:17:17 | FromDiscord | <Vindaar> now they just need to replace python under "Designed for your stack" here https://posthog.com/ and we're golden! |
11:17:33 | FromDiscord | <Vindaar> *by nim of course, haha |
11:18:34 | FromDiscord | <ShalokShalom> Is Nim's func already purely functional? |
11:18:43 | Yardanico | well, not really |
11:18:50 | Yardanico | depends on what you mean by that |
11:18:59 | Yardanico | there's a new feature in devel - strictFuncs - which gives you deep immutability in funcs |
11:19:10 | Yardanico | but even then you can always explicitly state "var MyType" and modify stuff in funcs |
11:19:59 | FromDiscord | <flywind> http://nim-lang.github.io/Nim/manual_experimental.html#strict-funcs |
11:20:36 | Yardanico | exactly |
11:23:12 | * | oculux quit (Ping timeout: 256 seconds) |
11:26:00 | * | pyrobitz joined #nim |
11:32:45 | * | superbia1 joined #nim |
11:35:25 | * | superbia quit (Ping timeout: 240 seconds) |
11:43:58 | * | superbia1 is now known as superbia |
11:49:51 | * | oculux joined #nim |
12:04:24 | FromDiscord | <dom96> ooh, post hog looks like a nice google analytics alternative |
12:04:27 | * | rockcavera joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:38 | * | supakeen joined #nim |
12:12:12 | * | waleee-cl joined #nim |
12:15:25 | Araq | dom96: please review https://github.com/nim-lang/Nim/pull/15336 |
12:15:26 | disbot | ➥ fix #15333 |
12:23:21 | FromDiscord | <lqdev> /home/daknus/Coding/Nim/rapid/src/rapid/game/tilemap.nim(205, 53) Error: cannot instantiate Tilemap↵got: <type T: TilemapTile, type FlatTileContainer[FlatTilemap.T]>↵but expected: <T: TilemapTile, C: TileContainer> |
12:23:24 | FromDiscord | <lqdev> this is odd |
12:24:35 | FromDiscord | <lqdev> so i have two concepts |
12:24:41 | FromDiscord | <lqdev> `TilemapTile` and `TileContainer` |
12:24:47 | FromDiscord | <lqdev> defined here https://github.com/liquid600pgm/rapid/blob/master/src/rapid/game/tilemap.nim#L11 |
12:25:05 | FromDiscord | <lqdev> and then i have a `Tilemap[T: TilemapTile, C: TileContainer]` |
12:25:20 | * | shad0w_ quit (Read error: Connection reset by peer) |
12:25:27 | FromDiscord | <lqdev> and i get the above error when trying to instantiate Tilemap |
12:26:01 | FromDiscord | <lqdev> any ideas? |
12:26:09 | FromDiscord | <lqdev> attaching .explain to my concepts doesn't work |
12:26:41 | * | shad0w_ joined #nim |
12:29:33 | Araq | I think the syntax is |
12:29:43 | Araq | type T {.explain.} = concept ... |
12:31:37 | FromDiscord | <lqdev> that doesn't work either |
12:31:42 | FromDiscord | <Clyybber> @lqdev FlatTileContainer doesn't have a isSolid |
12:31:53 | FromDiscord | <lqdev> T must have it |
12:31:59 | FromDiscord | <Clyybber> ah |
12:32:04 | * | superbia quit (Ping timeout: 246 seconds) |
12:32:49 | * | superbia joined #nim |
12:35:33 | * | Kaivo quit (Quit: WeeChat 2.9) |
12:53:54 | FromDiscord | <lqdev> so, any ideas? |
13:20:10 | * | sealmove quit (Ping timeout: 272 seconds) |
13:29:48 | Yardanico | Araq: so 1.4 will have refc by default, but the release after 1.4 will have orc? |
13:31:18 | narimiran | Yardanico: ORC as a default will come later |
13:31:21 | Yardanico | okay |
13:32:05 | * | clyybber joined #nim |
13:32:13 | Araq | Yardanico: I brought up changing the default to markAndSweep but that would just be more friction |
13:33:04 | * | pyrobitz quit (Remote host closed the connection) |
13:34:02 | narimiran | Yardanico: are you alluding that https://forum.nim-lang.org/t/6549#42774 might be confusing? |
13:34:24 | Yardanico | no? i was referring to the comment in the unifying GCs RFC |
13:34:30 | narimiran | ok |
13:34:52 | * | Kaivo joined #nim |
13:35:20 | Yardanico | we need to advertise orc heavier so people actually test it on 1.4 :) |
13:35:40 | Yardanico | even as a hint maybe? |
13:35:57 | Araq | Yardanico: I need a break, we should release 1.4.0 this week and then 1.4.2 later with more ORC fixes |
13:36:01 | * | synshroud quit (Quit: ZNC 1.7.5 - https://znc.in) |
13:36:07 | Yardanico | it's okay, I understand |
13:36:15 | FromDiscord | <Vindaar> for what it's worth I did try arraymancer and ggplotnim again after the latest changes yesterday and unfortunately still a no go 😦 |
13:36:23 | Yardanico | arraymancer needs nodestroy changes |
13:36:26 | Yardanico | at the very least |
13:36:55 | Araq | Vindaar: it's not always our fault, people do strange things with Nim's inner workings |
13:36:59 | * | muffindrake joined #nim |
13:37:09 | Yardanico | when not defined(gcOrc): {.hint: "Current default GC (refc) is getting phased out, please test your code with --gc:orc".} |
13:37:11 | Yardanico | or something like that |
13:37:16 | Yardanico | it would be pretty annoying though |
13:37:56 | FromDiscord | <Vindaar> @Araq: oh, I'm not necessarily saying it's your fault! |
13:37:59 | Araq | if we had a working version system 1.4 would be 2.0 |
13:39:01 | Yardanico | I still need to track a few more issues with ORC - NiGui crash in some examples and nimly SIGSEGV in one of its tests |
13:43:05 | FromDiscord | <Clyybber> Araq: Should we enable valgrind for those async tests? |
13:43:31 | Araq | try it, was green for me. I fear the CI overheads |
13:43:39 | Araq | as valgrind is so slow... |
13:46:13 | clyybber | I think if we disable --track-origins it should be a lot faster |
13:47:26 | Araq | there are also clang sanitizer options |
13:47:46 | Araq | and the gcc copycats |
13:47:52 | Yardanico | so would it make sense to add that hint about refc being phased out or not? |
13:48:01 | PMunch | Is there a prettier way of doing this? https://play.nim-lang.org/#ix=2yic |
13:48:26 | Yardanico | PMunch: oh I see that you read the reddit post too |
13:48:44 | PMunch | Haha, guilty as charged :P |
13:48:55 | FromDiscord | <Rika> what reddit post |
13:48:57 | Yardanico | I just feel like people shouldn't try to port Python code like that 1:1 to Python |
13:49:00 | Yardanico | to NIm* |
13:49:09 | PMunch | @Rika: https://www.reddit.com/r/nim/comments/ix09y5/can_an_iterator_iterate_an_iterator/ |
13:49:13 | Yardanico | @Rika nim subreddit |
13:49:57 | PMunch | Yardanico, tbf they didn't ask for a 1:1, they just asked if it was possible |
13:50:22 | FromDiscord | <Rika> pmunch https://play.nim-lang.org/#ix=2yid |
13:51:29 | PMunch | Wait, why is that `items` iterator even needed then? |
13:51:39 | FromDiscord | <Rika> i dont know with you |
13:51:41 | Araq | Yardanico: too early, 1.4 *adds* --gc:orc and then 1.6 should phase out cruft |
13:52:21 | PMunch | Oh it isn't actually: https://play.nim-lang.org/#ix=2yie |
13:52:24 | FromDiscord | <Rika> because you need to add parentheses to the closure iterators when using for loop |
13:52:30 | FromDiscord | <Rika> otherwise its not |
13:52:37 | PMunch | I swear I tried that.. |
13:52:47 | FromDiscord | <Rika> hmmmmm |
13:52:58 | PMunch | But you're right |
13:54:20 | PMunch | Bit annoying though that this doesn't work: https://play.nim-lang.org/#ix=2yig |
13:55:05 | FromDiscord | <Rika> because items is inline |
13:55:22 | FromDiscord | <Rika> are closure iterators really that slow |
13:55:22 | PMunch | Ah |
13:55:29 | PMunch | What da you mean? |
13:55:52 | FromDiscord | <Rika> i keep on hearing yall nim devs saying closure( iterator)s are slow |
13:56:15 | PMunch | They're not that slow AFAIK |
14:00:13 | * | superbia1 joined #nim |
14:00:42 | * | superbia quit (Ping timeout: 272 seconds) |
14:02:53 | Araq | they are slower than they should be |
14:04:15 | Oddmonger | can «string» be used as a module name with Nim ? |
14:04:33 | Yardanico | yes |
14:04:36 | Oddmonger | i use a lib which contains a string.nim, with a «toU64» proc inside |
14:05:05 | Oddmonger | and even when including string, «toU64» is refused at compilation |
14:05:08 | * | Tlangir quit (Ping timeout: 272 seconds) |
14:05:21 | Yardanico | well, give us the error |
14:05:24 | Araq | you probably need to write system.string for the type then |
14:05:28 | Yardanico | ah right |
14:05:33 | Araq | better give your modules sane names |
14:05:43 | Oddmonger | it's not a system.string function |
14:06:12 | * | clyybber quit (Quit: WeeChat 2.9) |
14:06:12 | Oddmonger | it's defined inside the string.nim of the API i'm using |
14:06:22 | Yardanico | well, give us the error |
14:06:28 | Yardanico | and code maybe |
14:06:34 | Araq | better name it tanga.nim |
14:06:50 | Oddmonger | the error is : Error: undeclared identifier: 'toU64' |
14:07:02 | Yardanico | well, can you show the definition of toU64? |
14:07:17 | Oddmonger | of course |
14:07:17 | FromDiscord | <Rika> araq: why "tanga.nim"? |
14:07:21 | Oddmonger | proc toU64*(zString: cstring; pu64OutValue: ptr orxU64; |
14:07:27 | Oddmonger | pzRemaining: cstringArray): orxSTATUS {.inline, cdecl.} = |
14:07:49 | supakeen | Rika: because a tanga is a string. |
14:08:01 | * | PMunch facepalms |
14:08:21 | Oddmonger | and my call: var CRC:orxU64 = toU64( texture.getName( payload.ano_orxShader_127.pstValue), addr CRC ) |
14:08:23 | FromDiscord | <Rika> :? |
14:08:51 | Yardanico | Oddmonger: but your toU64 proc has 3 arguments |
14:08:53 | Yardanico | and you call it with two |
14:09:00 | Oddmonger | ah |
14:09:06 | Oddmonger | you got a point /o\ |
14:09:13 | Yardanico | that's why you should look at the whole error log |
14:09:16 | Yardanico | not just at the error message line |
14:09:45 | Oddmonger | yes |
14:09:55 | Yardanico | it should tell you that it tried to match toU64 |
14:10:02 | Yardanico | but the call didn't have enough arguments |
14:11:49 | Oddmonger | http://ix.io/2yim |
14:12:16 | Yardanico | try with "nim" |
14:12:43 | Oddmonger | with nim ? |
14:13:01 | Yardanico | nim c -r |
14:13:01 | Yardanico | etc |
14:13:11 | Yardanico | ah wait you did this with nim already |
14:13:21 | Yardanico | well then I don't know, maybe you forgot to export it or something |
14:13:30 | Yardanico | are you sure that you import string in S12_lighting.nim ? |
14:13:48 | Oddmonger | yes |
14:14:05 | Oddmonger | import norx, norx/[incl, config, viewport, obj, input, keyboard, mouse, clock, math, vector, render, event, anim, camera, display, memory, string, hashTable, shader] |
14:14:40 | Yardanico | well idk then, I need code to reproduce the same issue so I can then help :P |
14:15:15 | Oddmonger | well all code is public, but you'll neet norx too, and maybe it's a little too much to ask to you :) |
14:15:22 | Yardanico | well it's okay, but a bit later |
14:15:24 | Oddmonger | but thank you for the help :) |
14:15:41 | Yardanico | well well well well |
14:15:44 | Yardanico | wellllllllll |
14:20:19 | FromDiscord | <haxscramper> Has anyone tried using cling (c++ code interpreter) for nim codegen? Is it possible to convert new nim code to C++ on the fly or I need whole program before I can generate something? |
14:22:44 | * | superbia1 is now known as superbia |
14:25:49 | FromDiscord | <shashlick> Need to bump nimble for 1.4 |
14:39:18 | FromGitter | <Knaque> How can I tell a Nimble binary to compile with certain flags, namely `-d:ssl`? |
14:40:09 | FromDiscord | <shashlick> You mean nimble build? Or the project in general |
14:40:38 | FromDiscord | <shashlick> You can use a nim.cfg file or even the new {.define.} pragma |
14:43:25 | FromGitter | <Knaque> Did it with the nim.cfg. On a tangentially related note, does Nim have documentation for its pragmas? If so, I've never seen it. |
14:43:42 | FromDiscord | <shashlick> ~manual |
14:43:42 | disbot | manual: 11the Nim Manual is https://nim-lang.org/docs/manual.html |
14:44:25 | FromGitter | <Knaque> Huh, guess I've just only ever looked at The Index. |
14:44:38 | Yardanico | @Knaque -d:ssl can be done in the config, yes |
14:44:48 | Yardanico | but don't forget that -d:release and -d:danger can only be used from command line |
14:45:31 | Yardanico | and if you would've liked to provide -d:ssl through command line as well, it's something like |
14:45:34 | Yardanico | nimble build -d:ssl |
14:46:09 | FromGitter | <Knaque> I plan on publishing this to Nimble, so I would imagine that nim.cfg would cover all my bases. |
14:54:09 | * | hnOsmium0001 joined #nim |
14:56:27 | * | apahl quit (Ping timeout: 240 seconds) |
14:57:00 | FromDiscord | <shashlick> nim.cfg is only used by the project when it is compiled as the top level |
14:57:12 | FromDiscord | <shashlick> not if it is a library - in that case, the consuming project has to set the defines |
14:58:37 | * | apahl joined #nim |
15:20:34 | FromDiscord | <krisppurg> where do I locate my find my pkgs directory in nimble? |
15:21:29 | FromDiscord | <Vindaar> they are located in `~/.nimble/pkgs`. but for each package you can just run `nimble path <name>` |
15:22:50 | * | synshroud joined #nim |
15:23:02 | FromDiscord | <krisppurg> thank you |
15:31:47 | * | Vladar joined #nim |
15:33:12 | * | PMunch quit (Quit: leaving) |
15:43:18 | * | kenran quit (Ping timeout: 256 seconds) |
15:47:50 | disruptek | the bastardfish rides again. |
15:49:04 | krux02 | haxscramper: Regarding cling. The Probles isn't that the generated code doesn't work with cling, the problem is the nim compiler infrastructure isn't made for live updates. Generating for cling would be comparable to generating to js, you compile to c++ and then interpret the generated c++. That doesn't provide you the "advantage" of an interpreted language. |
15:52:01 | disruptek | shashlick: that's not true. nim.cfg is used when it is in a parent. |
15:52:46 | krux02 | I went to use git submodules and nim.cfg over nimble. |
15:54:10 | disruptek | yeah; i'm sold on submodules. they are super fast and will work great with nimph. |
15:55:41 | FromDiscord | <shashlick> I cannot be bought |
15:58:42 | FromDiscord | <UNIcodeX> I'm getting an "Attempt to read from nil?" message when trying to serve static files with Prologue. Anyone know what's up with that? |
15:59:44 | FromDiscord | <UNIcodeX> (edit) 'I'm getting an "Attempt to read from nil?" message when trying to serve static files with Prologue. Anyone know what's up with that? ... ' => 'I'm getting an "Attempt to read from nil?" message when trying to serve static files with Prologue. Anyone know what's up with that?staticDirs is set to `[env.get("staticDir"]` which is `staticDir=/static` and all files are under that.' |
15:59:53 | FromDiscord | <UNIcodeX> (edit) '`[env.get("staticDir"]`' => '`[env.get("staticDir")]`' |
16:02:02 | disruptek | shashlick: it's just a matter of time. |
16:04:21 | disruptek | rika: you should mess with cps. |
16:05:45 | FromDiscord | <alehander42> ? |
16:05:52 | FromDiscord | <alehander42> i plan on using discord |
16:05:55 | FromDiscord | <alehander42> to stream a bit |
16:06:04 | FromDiscord | <alehander42> has someone done this |
16:06:55 | FromDiscord | <Clyybber> sure, its pretty easy |
16:10:14 | * | shad0w__ joined #nim |
16:10:30 | * | gmaggior joined #nim |
16:11:52 | * | shad0w_ quit (Ping timeout: 246 seconds) |
16:11:53 | * | shad0w__ is now known as shad0w_ |
16:26:01 | * | Vladar quit (Quit: Leaving) |
16:26:18 | * | a_chou joined #nim |
16:26:49 | * | thomasross joined #nim |
16:39:03 | * | kenran joined #nim |
16:43:07 | FromDiscord | <InventorMatt> i am trying to create a macro for easily converting xml into objects but I am getting a weird error and I'm not sure what it means https://play.nim-lang.org/#ix=2yje |
16:43:13 | FromDiscord | <InventorMatt> any help would be appreciated |
16:44:44 | * | kenran quit (Ping timeout: 272 seconds) |
16:47:25 | FromDiscord | <Vindaar> @InventorMatt https://play.nim-lang.org/#ix=2yjg |
16:47:47 | FromDiscord | <Vindaar> quote needs to receive valide NimNodes |
16:47:55 | FromDiscord | <Vindaar> *valid |
16:48:17 | Zevv | interestingly enough, "valide" is a valid word in dutch, meaning - guess what - "valid" |
16:48:54 | FromDiscord | <Vindaar> haha, it is a German word as well |
16:49:09 | FromDiscord | <InventorMatt> awesome, that works. thanks so much |
16:49:17 | FromDiscord | <Vindaar> 🙂 |
16:50:40 | * | Vladar joined #nim |
16:54:34 | FromDiscord | <acek7> this whole xbox buying bethesda things really got me hyped |
16:58:27 | * | jacereda joined #nim |
17:00:15 | Prestige | think it's a good thing? |
17:03:15 | Zevv | Sure, Fallout 76 will serve them right |
17:07:31 | FromDiscord | <acek7> i think so |
17:07:44 | FromDiscord | <acek7> the board members didnt care anymore and i guess trumps brother that died owned a stake in it |
17:08:04 | FromDiscord | <acek7> and i dont think phil spencer can do them wrong |
17:10:26 | Prestige | I just worry after banjo threeie was borked |
17:17:43 | alehander92 | maybe 1 hour work |
17:17:44 | alehander92 | today |
17:17:46 | alehander92 | on alias stuff |
17:17:52 | alehander92 | now some tests run fine |
17:17:58 | alehander92 | i'll take a look at adding a bit more |
17:18:06 | alehander92 | do we have .. ref sets ? |
17:19:27 | FromDiscord | <acek7> maybe im just dumb but im having a hard time learning some of this beginner stuff of nim |
17:20:25 | Prestige | have any questions? |
17:21:26 | FromDiscord | <acek7> i think having a simple cheatsheet with like the common terms/syntax etc and their meanings and functionality would help me wrap my head around some stuff more |
17:21:49 | FromDiscord | <acek7> i always have struggled reading documentation and nims is kinda unfriendly |
17:21:50 | narimiran | do you have experience in some other language? |
17:22:27 | FromDiscord | <acek7> mainly just some basics in python |
17:22:42 | FromDiscord | <acek7> ive never built any complicated programs or anything though. Just done simple stuff |
17:23:48 | narimiran | maybe this helps: https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers |
17:23:50 | voidpi | acek7: this book is being very helpful to me http://ssalewski.de/nimprogramming.html#_arrays_and_sequences |
17:23:56 | Oddmonger | is it possible to have profiles with a .nim.cfg ? |
17:23:57 | Prestige | https://narimiran.github.io/nim-basics/ is good too |
17:24:14 | Oddmonger | like a debug profile, a release profile… |
17:24:24 | narimiran | Prestige: thanks for not having to promote myself :) |
17:24:50 | Prestige | yw haha |
17:31:29 | FromDiscord | <acek7> i feel kinda silly because its taken me kinda long to get where i am with programming ya know understanding a few of the basics. but nim seems pretty similar to python with a lot of the functionality and speed and such of the c languages and that seems like a good thing to learn as well. |
17:35:19 | alehander92 | Araq |
17:35:35 | alehander92 | i use ref sets in my data structure to represent the disjoint ones |
17:35:51 | alehander92 | did you use handles & seq-s instead in varpartitions |
17:36:06 | alehander92 | because they are a bit more obvious, no hidden ref links? |
17:43:08 | FromDiscord | <lqdev> maybe someone more knowledgable is online, so let me ask my question from before one more time↵i'm having a bit of an issue with concepts and generics, for some strange reason i cannot instantiate `Tilemap[FlatTileContainer[T]]` (definitions here https://github.com/liquid600pgm/rapid/blob/master/src/rapid/game/tilemap.nim#L10). concept diagnostics via .explain don't seem to work, it just throws an error "cannot instantiate Tilemap" |
17:43:32 | FromDiscord | <lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2yjx |
17:48:51 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
17:49:33 | FromDiscord | <lqdev> Oddmonger: wdym? |
17:49:36 | Prestige | @acek7 it's okay to learn slowly if you keep learning. It's taken me a lot of time, too |
17:51:45 | Oddmonger | lqdev : is it possible to have a .nim.cfg with conditions ? For exemple, having debuginfo set or not |
17:52:22 | FromDiscord | <lqdev> Oddmonger: sure. https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L55 |
17:53:05 | Oddmonger | nice ! Thank you ! |
18:00:56 | FromDiscord | <shashlick> Araq: I tested #15202 again with the latest devel and it still segfaults - why is it an issue with my config? |
18:00:57 | disbot | https://github.com/nim-lang/Nim/issues/15202 -- 3--gc:arc segfaults if dll modifies object owned by main executable ; snippet at 12https://play.nim-lang.org/#ix=2xUj |
18:06:28 | * | opal joined #nim |
18:09:01 | FromDiscord | <shashlick> using `-d:useMalloc` helps pass the test, without it, my program segfaults - I've updated the issue |
18:20:51 | FromDiscord | <exelotl> Yooo I just figured out a really cool optimisation that can help with matrices in GBA dev |
18:20:56 | FromDiscord | <exelotl> https://play.nim-lang.org/#ix=2yjJ |
18:22:30 | FromDiscord | <exelotl> Using term rewriting macros to allow `a = b` where `a` and `b` are different types, without the cost of calling a converter on `b` |
18:23:28 | solitudesf | cool |
18:28:43 | * | shad0w_ quit (Remote host closed the connection) |
18:36:25 | * | a_chou quit (Ping timeout: 246 seconds) |
18:42:35 | * | waleee-cl joined #nim |
18:47:21 | * | Zectbumo joined #nim |
18:48:09 | * | arecacea1 quit (Remote host closed the connection) |
18:48:28 | * | arecacea1 joined #nim |
18:51:02 | * | vicfred quit (Quit: Leaving) |
19:10:10 | FromDiscord | <Avatarfighter> What does -d:useMalloc with arc do? |
19:12:16 | FromDiscord | <shashlick> Makes Nim use C's malloc instead of Nim's own memory manager, albeit prefixing each allocation with its size to support clearing memory on reallocation |
19:12:27 | FromDiscord | <shashlick> from https://nim-lang.org/docs/nimc.html#additional-compilation-switches |
19:14:11 | * | vicfred joined #nim |
19:17:15 | * | Vladar quit (Quit: Leaving) |
19:21:10 | * | kungtotte quit (Ping timeout: 272 seconds) |
19:29:09 | FromDiscord | <exelotl> in the devel manual: "Since version 1.4 Nim allows view types to be used as local variables. This feature needs to be enabled via {.experimental: "views".}." |
19:29:51 | FromDiscord | <exelotl> does this mean I can do `var x: var int = y` ? |
19:30:19 | FromDiscord | <Clyybber> AFAIK it only applies to openArray for now |
19:30:24 | FromDiscord | <Clyybber> but the infrastructure for more is there |
19:31:48 | FromDiscord | <exelotl> ah I see, yeah that's the main thing to be excited about anyways :) |
19:32:44 | FromDiscord | <Clyybber> slicing returning views is one step that should be cool |
19:33:14 | FromDiscord | <exelotl> I can already achieve mutable hidden pointers using something like `iterator mutate[T](a: var T): var T = a` |
19:33:38 | FromDiscord | <Clyybber> heh, smart hack |
19:34:01 | FromDiscord | <Clyybber> did you see timothees {.byaddr.} ? |
19:34:05 | FromDiscord | <shashlick> even with -d:useMalloc --gc:orc, my plugins package still segfaults |
19:36:19 | FromDiscord | <Clyybber> are you using rtl for your dlls? |
19:36:25 | * | gmaggior quit (Ping timeout: 260 seconds) |
19:36:50 | * | narimiran quit (Ping timeout: 256 seconds) |
19:36:56 | FromDiscord | <Clyybber> ping @shashlick ? |
19:37:29 | FromDiscord | <acek7> so if i wanted to design a map making program, that just like does some simple fractal line map drawing i can do with a drawing tool similar to photoshop wouldnt anyone have any kind of tutorials or tips on how i could get to something like that with Nim |
19:37:58 | FromDiscord | <exelotl> ah I forgot about byaddr |
19:38:30 | FromDiscord | <shashlick> @Clyybber - i cannot compile nimrtl with --gc:arc |
19:38:54 | FromDiscord | <Clyybber> @acek7 Heh, if they were a tutorial for that the program you want to make would already exist, no ? :D |
19:39:02 | FromDiscord | <Clyybber> @shashlick Hmm, why? |
19:40:06 | FromDiscord | <shashlick> nim c --gc:orc nimrtl.nim => Error: system module needs: nimErrorFlag |
19:41:12 | FromDiscord | <acek7> i dont mind a little figuring it out myself i just kinda want a basic guide with some tips from someone who may have already built some desktop software. I know what i want is unique lol and i will figure it out but its a challenge and can be really frustrating. I know im still learning the language but why cant i learn and put what im learning into my project as well. |
19:41:20 | FromDiscord | <Clyybber> @shashlick Hmm, please add it to the issue |
19:41:55 | FromDiscord | <Clyybber> @acek7 I haven't coded any non-game UI heavy stuff, but fidget might be up your alley |
19:42:27 | FromDiscord | <Clyybber> And for rendering custom stuff OpenGL |
19:42:31 | FromDiscord | <Clyybber> which is language agnostic |
19:47:07 | FromDiscord | <shashlick> @Clyybber - https://github.com/nim-lang/Nim/issues/15202#issuecomment-696333281 |
19:47:08 | disbot | ➥ --gc:arc segfaults if dll modifies object owned by main executable ; snippet at 12https://play.nim-lang.org/#ix=2xUj |
19:48:49 | * | lritter joined #nim |
19:48:53 | * | gmaggior joined #nim |
19:49:17 | FromDiscord | <exelotl> `var x {.byaddr.} = y` seems weirdly inconsistent considering `var T` is used for the same thing in function parameters - though I appreciate that the later could lead to weird invalid combinations if used in a variable declaration |
19:49:34 | FromDiscord | <exelotl> like out of `var x: var[int] = y`, `var x: lent[int] = y`, `let x: var[int] = y`, `let x: lent[int] = y`, which ones would be valid? |
19:50:45 | FromDiscord | <exelotl> (edit) 'later' => 'latter' |
19:54:28 | FromDiscord | <Clyybber> 1, 2, 4 would be valid |
19:54:37 | FromDiscord | <Clyybber> ah nope |
19:54:40 | FromDiscord | <Clyybber> sorry |
19:54:44 | FromDiscord | <Clyybber> 1 and 4 |
19:55:28 | FromDiscord | <Clyybber> 2 and 3 don't make too much sense do they? |
19:55:50 | FromDiscord | <exelotl> indeed they don't but I wasn't quite sure haha |
20:05:44 | * | a_chou joined #nim |
20:10:31 | FromGitter | <deech_twitter> I have a closure I'm passing to C++ as a function pointer + void pointer, when the class destructor is called I'd like to notify arc/orc. `GC_unRef` only takes `ref`s so I'm wrapping the closure in an object. Is there a better way of doing this? |
20:14:16 | * | hnOsmium0001 quit (Killed (Sigyn (Spam is off topic on freenode.))) |
20:17:13 | FromDiscord | <Clyybber> deech: If possible `move` the closure into the C++ class |
20:17:51 | FromDiscord | <Clyybber> and then to destroy call this proc from the Cpp side: proc destroy(a: sink T) = discard |
20:20:14 | FromDiscord | <Clyybber> @deech_twitter see above |
20:20:54 | FromDiscord | <haxscramper> What is the recommended way of wrapping explicit C++ template instantiations into nim? E.g. `std::string` is a `typedef basic_string<char> string`. Just making `type StdString = BasicString[cchar]` is enough or there is some codegen interaction that I need to be aware of? |
20:21:46 | FromDiscord | <Clyybber> I |
20:22:39 | FromDiscord | <Clyybber> @haxscramper Nim generics don't translate to Cpp templates |
20:23:14 | FromDiscord | <Clyybber> So for wrapping this approach won't work, for porting sure, they are equivalent in terms of functionality |
20:23:55 | FromDiscord | <haxscramper> I'm specifically talking about wrapping |
20:24:35 | FromDiscord | <Zachary Carter> @shashlick - question: how does `getHeader` work if the header file is in a subdirectory? |
20:24:41 | FromDiscord | <haxscramper> Because C++ library uses `std::string` which is a typedef or another class which I can wrap, but I don't know how to connect two wrappers together |
20:25:11 | FromDiscord | <Clyybber> Maybe use emit? |
20:25:25 | FromDiscord | <Clyybber> I'm not sure, @Zachary Carter is the one to ask when it comes to cpp wrapping |
20:25:41 | FromDiscord | <shashlick> @Zachary Carter - it should find it - just give the header name |
20:25:44 | FromDiscord | <Clyybber> But the Nim compiler definitely doesn't translate nim generics to Cpp generics/templates |
20:25:52 | FromDiscord | <Zachary Carter> @shashlick hmm okay |
20:26:48 | FromDiscord | <shashlick> that's if you download the stuff, if you use -d:xxxStd you need to specify sub-path |
20:26:58 | FromDiscord | <haxscramper> I don't really like the idea. I'm writing automatic wrapper too so I'd rather not use hacks like that from the start. There is a https://nim-lang.org/docs/manual.html#importcpp-pragma-importcpp-for-objects which should work for regular objects. Now I'm doing `StdString* {.importcpp: r"std::string", header: cxheader.} = object` |
20:27:24 | FromDiscord | <Zachary Carter> gotcha |
20:27:49 | FromDiscord | <haxscramper> But because all methods are declared in base class I need to port them somehow to alias too, which is why I thought about doing the same (aliasing) in nim |
20:30:02 | FromDiscord | <Zachary Carter> I don't really understand the question @haxscramper - you're trying to wrap std::string? |
20:30:22 | FromDiscord | <haxscramper> tl;dr - yes |
20:30:42 | FromDiscord | <Zachary Carter> should be easy - should just be `{.importcpp: "std::string".} |
20:30:45 | FromDiscord | <Zachary Carter> (edit) '"std::string".}' => '"std::string".}`' |
20:31:07 | FromDiscord | <haxscramper> But this is question about wrapping shit like methods for typedefs of template instantiations of another class |
20:31:28 | FromDiscord | <haxscramper> I also need to have all methods wrapped too |
20:32:22 | FromDiscord | <Zachary Carter> you need to wrap them then |
20:32:45 | * | a_chou quit (Quit: a_chou) |
20:33:36 | * | kungtotte joined #nim |
20:34:25 | FromDiscord | <Zachary Carter> @shashlick - okay I just was doing something dumb setting up the cache directory for nimterop to build to - what if the static library that gets built is in a folder like `target/debug` - do I need to do anything specific besides defining `libStatic` to tell the linker where the built library is? |
20:34:58 | FromDiscord | <haxscramper> Yes, but base class is generic, so wrappers should also be generics. But than I have to declare std string wrapper as alias in nim so I can use methods, and I'm not sure how to handle this at all |
20:35:08 | FromDiscord | <shashlick> it will get linked automatically |
20:35:31 | FromDiscord | <shashlick> as long as header name matches - else you can use altNames |
20:35:38 | FromDiscord | <Zachary Carter> thanks |
20:35:39 | FromDiscord | <shashlick> getHeader will find and link the static lib |
20:36:03 | FromDiscord | <Zachary Carter> @haxscramper can you provide me with some example code? |
20:36:19 | FromDiscord | <Zachary Carter> not really sure what you're trying to do... |
20:38:43 | FromGitter | <deech> Clyybber: Thanks! |
20:39:11 | * | Kaivo quit (Ping timeout: 258 seconds) |
20:41:39 | * | Kaivo joined #nim |
20:43:28 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2ykA |
20:44:42 | FromDiscord | <haxscramper> Compiled with `nim cpp -r --nimcache:cache.d nim_user.nim` |
20:44:54 | FromDiscord | <Zachary Carter> \o/ |
20:45:22 | FromDiscord | <Recruit_main707> noice |
20:52:11 | FromDiscord | <Clyybber> @haxscramper Damn that works? Guess thats the power of import patterns |
21:08:58 | * | synshroud quit (Quit: ZNC 1.7.5 - https://znc.in) |
21:09:48 | * | lritter quit (Ping timeout: 260 seconds) |
21:10:13 | * | lritter joined #nim |
21:13:06 | * | solitudesf quit (Ping timeout: 256 seconds) |
21:14:03 | * | uvegbot joined #nim |
21:14:48 | FromGitter | <ynfle> Where in the manual does it talk about implicit returning? (not implicit `result`) |
21:16:09 | FromDiscord | <Recruit_main707> might be because its late, but how do you implicitly return something without result? |
21:16:45 | * | bra-ket quit (Ping timeout: 260 seconds) |
21:16:55 | FromGitter | <ynfle> ```proc t: string = "hello"``` |
21:21:27 | * | NimBot joined #nim |
21:22:13 | FromDiscord | <Recruit_main707> Yep, my brain idles already :P |
21:24:03 | jacereda | I'm intrigued by https://forum.nim-lang.org/t/6549, it says "Independent of the stack size, large arrays on the stack do not cause slowdowns.". Is that because large arrays need to be initialized or due to the stupid stack-extension mechanism on Windows where it touches every stack page involved upon function entry? |
21:25:32 | FromDiscord | <UNIcodeX> Is there a quick way to reverse a seq? |
21:27:21 | FromDiscord | <Vindaar> @UNIcodeX `algorithm.reverse` |
21:27:26 | * | arecacea1 quit (Remote host closed the connection) |
21:27:44 | * | arecacea1 joined #nim |
21:30:15 | * | apahl quit (Ping timeout: 272 seconds) |
21:30:52 | * | apahl joined #nim |
21:32:13 | * | Trustable quit (Remote host closed the connection) |
21:32:50 | FromDiscord | <dom96> hmmm, it would be nice if Nim's strformat supported thousands separators |
21:32:55 | FromDiscord | <dom96> from what I can see that isn't the case |
21:35:28 | FromDiscord | <dom96> love that for JS the most popular solution is to use regex |
21:36:12 | FromDiscord | <Avatarfighter> What is up party people |
21:37:24 | FromDiscord | <Vindaar> too much work to do. too unproductive it times 🙂 |
21:37:28 | FromDiscord | <Vindaar> *at |
21:37:52 | FromDiscord | <dom96> Screw it, no reason I can't use {.emit.} here to get a nice locale specific formatting in the browser 😄 |
21:41:32 | alehander92 | hmm |
21:41:37 | alehander92 | escape hatchess |
21:41:50 | alehander92 | haxscramper |
21:43:49 | alehander92 | online? |
21:44:27 | FromDiscord | <Vindaar> proper ping for him: @haxscramper |
21:54:47 | alehander92 | thanks! |
22:04:05 | FromGitter | <ynfle> > Where in the manual does it talk about implicit returning? (not implicit `result`) ⏎ ⏎ Anyone? |
22:08:23 | FromDiscord | <Elegant Beef> Are you just talking about returning undiscarded values? |
22:09:08 | FromGitter | <ynfle> Ya |
22:09:16 | FromGitter | <ynfle> The last line of a routine |
22:10:38 | FromDiscord | <Vindaar> @ynfle read the statements and expressions part of the manual and specifically the ones about statement list expressions and the void context ↵https://nim-lang.github.io/Nim/manual.html#statements-and-expressions-statement-list-expression |
22:10:47 | FromDiscord | <Vindaar> not sure if there is a more explicit part in the manual |
22:12:08 | FromDiscord | <Vindaar> sent a code paste, see https://play.nim-lang.org/#ix=2ykK |
22:12:43 | FromDiscord | <Vindaar> that block returns the value of the last line |
22:13:43 | FromDiscord | <Elegant Beef> Any undiscarded without the discardable pragma is passed up |
22:13:56 | FromDiscord | <Elegant Beef> Unless there is a branch i guess |
22:14:16 | FromDiscord | <Elegant Beef> *There is a condition in a proc where you can make it not like you using undiscarded values iirc* |
22:16:20 | FromGitter | <ynfle> I know that it happens |
22:16:28 | FromGitter | <ynfle> Just want to give someone a reference |
22:16:31 | FromGitter | <ynfle> Thanks anyways |
22:19:01 | * | a_chou joined #nim |
22:36:29 | FromGitter | <ynfle> I gave the Pmuch's blog post about it https://peterme.net/tips-and-tricks-with-implicit-return-in-nim.html |
22:37:27 | FromDiscord | <Vindaar> good choice! |
22:37:43 | FromDiscord | <Avatarfighter> I wish someone made an openmediavault alternative in nim |
22:38:05 | FromDiscord | <Avatarfighter> i have an old NAS that can barely run oopenmediavault but my nim programs run fine on it |
22:47:00 | * | a_chou quit (Ping timeout: 272 seconds) |
23:00:00 | FromDiscord | <dom96> I just set up a NAS using a barebones Ubuntu Server |
23:00:12 | FromDiscord | <dom96> Dunno what openmediavault provides but you likely don't need it |
23:02:27 | FromDiscord | <Avatarfighter> it just provides an interface for managing things like file shares, and SMART monitoring |
23:10:14 | FromDiscord | <dom96> yeah, it's trivial to set this up yourself |
23:10:26 | FromDiscord | <Avatarfighter> Yeah I assume so, I just dont have experience doing that stuff |
23:10:42 | FromDiscord | <Avatarfighter> I can probably write my own version of OpenMediaVault tbh |
23:10:45 | FromDiscord | <dom96> you don't need experience, just google |
23:10:52 | FromDiscord | <Avatarfighter> words to stand by 😛 |
23:11:08 | FromDiscord | <Avatarfighter> Deadass this NAS probably needs Lubuntu on it lmao |
23:13:15 | * | jacereda quit (Remote host closed the connection) |
23:13:38 | FromDiscord | <Avatarfighter> Its just a beefy processor zooming at 1200 MHz with 256MB of RAM 😎 |
23:42:29 | * | abm joined #nim |
23:58:50 | * | queen joined #nim |