00:12:09 | FromGitter | <gogolxdong> I learned someone worked on video processing got 200times real-time compression from raw byte stream by GPU hard-coding. |
00:12:26 | FromDiscord | <stu002> I'd like to create a library using Nim concepts, but I get the impression they're likely to change quite a bit? |
00:13:14 | FromDiscord | <cabboose> Hey y'all, I'm having some trouble getting authentication to work with a web scraping project I have; I'll be happy to pay someone up to $50 AUD if they can team view me in about ~12 hours (8pm GMT + 8) and run me through it. Would anyone be interested or know where I can find assistance with it? The scripts run with Mechanize in python but web scraping is definitely not my domain. |
00:14:27 | FromDiscord | <cabboose> dm me if you want to see the website in question |
00:15:18 | FromDiscord | <cabboose> hell ill pay up to $100 AUD if someone can just get the damn authentication part working with persistence |
00:16:29 | Zoom[m] | Huh, why do I get `Cannot create a flowVar of type: Option[system.string]` with some of the GCs? |
00:25:30 | FromDiscord | <ElegantBeef> @stu002 the amount they will change isnt too much with all the RFCs combine, so go have fun! |
00:26:21 | FromDiscord | <ElegantBeef> If curious read about the RFCs here https://github.com/nim-lang/RFCs/issues?q=is%3Aissue+is%3Aopen+concepts |
00:28:59 | FromDiscord | <stu002> @ElegantBeef thanks -- sounds interesting. |
00:30:44 | FromDiscord | <ElegantBeef> Like when/if those rfcs come through you'll have to rewrite the concepts, but overall the way they work isnt going to change afaik |
00:35:39 | Zoom[m] | Ok. So I've managed to use threadpool to spawn my `execProcess`es and now most of them end up Zombie. Any tips? |
00:41:07 | * | Aethylia joined #nim |
00:42:02 | Aethylia | I have a situation where a.foo[int]() doesn't work, but foo[int](a) does. I'd like to understand this. Can anyone point me to the documentation explaining when this might happen? |
00:43:48 | FromDiscord | <ElegantBeef> A code example would go a long way |
00:43:55 | FromDiscord | <ElegantBeef> Or the compiler error |
00:44:04 | Aethylia | Sure thanks |
00:44:57 | Aethylia | proc foo[T](a: AsyncSocket) : T = return avar a = newAsyncSocket()discard a.foo[int]() |
00:45:35 | Aethylia | Sorry that seems to have lost the formatting xD |
00:45:41 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/ |
00:46:03 | Aethylia | https://play.nim-lang.org/#ix=2DtM |
00:46:11 | Aethylia | thanks |
00:47:47 | FromDiscord | <ElegantBeef> How do you expect it to convert an AsyncSocket to an int? |
00:48:25 | Aethylia | No sorry I over simplified there |
00:48:26 | * | abm quit (Read error: Connection reset by peer) |
00:49:48 | * | Tanger quit (Remote host closed the connection) |
00:49:54 | Aethylia | https://play.nim-lang.org/#ix=2DtN |
00:49:57 | Aethylia | okay this one |
00:51:11 | FromDiscord | <ElegantBeef> Yea it's with how generics work i believe to support the ufcs you need to do `[:T]` like so https://play.nim-lang.org/#ix=2DtO |
00:51:48 | FromDiscord | <ElegantBeef> It's talked about here https://forum.nim-lang.org/t/6988 |
00:51:54 | Aethylia | Ah I see, thanks I've never seen that syntax |
00:52:04 | Aethylia | Sorry for the messy example |
00:52:08 | FromDiscord | <ElegantBeef> It's fine |
00:52:13 | FromDiscord | <ElegantBeef> You quickly corrected yourself 😄 |
00:54:23 | Aethylia | haha, I'd been trying to figure it out for hours I got mixed up the first time. Thanks so much for the help. I think this could use adding to the tutorial |
00:55:23 | * | opal quit (Ping timeout: 240 seconds) |
00:55:24 | FromDiscord | <ElegantBeef> Yea i agree the tutorial tends to lack a few key things |
00:57:28 | * | opal joined #nim |
00:59:24 | Zoom[m] | So, spawning multiple threads for `execProcess` seems to work relatively well only with markAndSweep gc, arc and orc end up with stuck zombie threads |
01:00:01 | Zoom[m] | Can anyone read this at least? :) |
01:03:23 | * | kinkinkijkin quit (Remote host closed the connection) |
01:03:59 | * | opal quit (Remote host closed the connection) |
01:04:44 | Prestige | We can see your message if that's what you're asking |
01:05:08 | * | opal joined #nim |
01:08:06 | Zoom[m] | Prestige: yep, just not sure if bridging's working |
01:09:40 | Aethylia | ah sorry, I wasn't quite sure if you meant read it in a 'consider it' kind of way or not |
01:10:22 | Zoom[m] | Sorry, too late here, worded it awkwardly. |
01:11:03 | Aethylia | 1am here too but I have the morning off tomorrow so irc lurking it is |
01:11:10 | Zoom[m] | With markAndSweep I still get lots of zombie processes, but they get reaped evenetually. Wouldn't say soon enough, though |
01:12:03 | FromDiscord | <cabboose> anyone tried dynamic wrapping of python modules with python3? is it worth the effort? |
01:12:15 | Zoom[m] | * With markAndSweep I still get lots of zombie threads, but they get reaped eventually. Wouldn't say soon enough, though |
01:15:55 | FromDiscord | <ElegantBeef> @cabboose https://nimble.directory/search?query=python |
01:16:07 | FromDiscord | <ElegantBeef> Idk what you're looking for exactly but something is bound to be similar there |
01:17:45 | * | theelous3 quit (Read error: Connection reset by peer) |
01:19:30 | Zoom[m] | Anyway, even with markAndSweep most of the threads are sleeping, some are zombie and just 3-5 are running for most of the time. MaxPoolSize was set to 128. Any ideas on that strange behaviour? Am I hitting some user limits? |
01:19:57 | FromDiscord | <ElegantBeef> Are you capable of peeking their code? |
01:20:09 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/osproc.html#peekExitCode%2CProcess |
01:21:57 | FromDiscord | <cabboose> @ElegantBeef I did mean the python3 pckg by matkuki; i'll give it a shot and see for myself i suppose |
01:22:00 | FromDiscord | <cabboose> thanks |
01:23:15 | * | Tanger joined #nim |
01:25:43 | Zoom[m] | ElegantBeef, I'm using execProcess ATM so I get no handle to the launched processes, will change the code to use execCmdEx |
01:26:00 | Zoom[m] | Probably not tonight, though |
01:27:27 | * | Aethylia quit (Remote host closed the connection) |
01:37:34 | * | a_chou joined #nim |
01:39:23 | * | a_chou quit (Remote host closed the connection) |
01:40:43 | * | Jjp137 joined #nim |
01:59:09 | FromDiscord | <Avatarfighter> @ElegantBeef what does the `:` do in `[:T]` in that code you spent earlier |
02:02:45 | FromDiscord | <ElegantBeef> It allows you to use ufcs with generics afaik |
02:02:51 | FromDiscord | <ElegantBeef> So it sets the T i guess |
02:03:06 | FromDiscord | <ElegantBeef> It resolves the `[]` so it can be used in a UFCS |
02:03:10 | FromDiscord | <Avatarfighter> ok so lets backtrack a tiny bit |
02:03:14 | FromDiscord | <Avatarfighter> tf UFCS stand for |
02:04:43 | FromDiscord | <Rika> Universal function call syntax |
02:04:47 | FromDiscord | <Avatarfighter> oh |
02:04:58 | FromDiscord | <Avatarfighter> thanks rika |
02:10:35 | FromDiscord | <ElegantBeef> The issue being that when doing `a[T].` it can be resolved as a `proc [](a : T, A: typedesc)` as i understand it |
02:22:19 | * | apahl quit (Ping timeout: 272 seconds) |
02:23:17 | * | rockcavera joined #nim |
02:23:54 | * | apahl joined #nim |
02:49:40 | * | mmohammadi9812 quit (Ping timeout: 272 seconds) |
02:51:55 | FromDiscord | <𝙼𝚊𝚝𝚜𝚞𝚖𝚘𝚝𝚘> How to get MAC address of current active interface on windows in nim? I'm new to nim so any help will be appreciated. |
03:00:42 | FromDiscord | <ElegantBeef> https://github.com/PMunch/getmac seems like a package that supports it on all platforms |
03:04:04 | FromDiscord | <ElegantBeef> @𝙼𝚊𝚝𝚜𝚞𝚖𝚘𝚝𝚘 just to make sure you see the above |
03:06:07 | * | mmohammadi9812 joined #nim |
03:06:46 | * | muffindrake quit (Ping timeout: 244 seconds) |
03:09:10 | * | muffindrake joined #nim |
03:46:36 | * | clouds joined #nim |
03:53:51 | * | clouds left #nim ("WeeChat 1.9.1") |
03:53:53 | * | clouds joined #nim |
04:03:45 | * | clouds left #nim ("WeeChat 1.9.1") |
04:05:31 | * | NimBot joined #nim |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:36 | * | supakeen joined #nim |
04:15:04 | * | Cthalupa quit (Ping timeout: 246 seconds) |
04:17:37 | * | Cthalupa joined #nim |
04:20:23 | * | leorize quit (Ping timeout: 240 seconds) |
04:22:33 | * | leorize joined #nim |
04:23:04 | * | apahl quit (Ping timeout: 240 seconds) |
04:24:09 | * | apahl joined #nim |
04:32:00 | FromDiscord | <Gyllou> hulloh |
04:32:43 | * | leorize quit (Ping timeout: 240 seconds) |
04:33:16 | FromDiscord | <Rika> Hello. |
04:34:56 | FromDiscord | <Gyllou> whats happenin |
04:36:24 | FromDiscord | <Gyllou> looks like its been pretty quiet tonight |
04:37:21 | FromDiscord | <Rika> Well most people are probably asleep or busy at work because most of us here are European or American, save for me of course |
04:37:41 | FromDiscord | <Gyllou> yea thats fair |
04:37:43 | FromDiscord | <Gyllou> lol |
04:37:58 | FromDiscord | <Gyllou> im still up coding, i should probably goto bed but then work will come sooner |
04:38:17 | FromDiscord | <Rika> Lol, do you have any questions about nim or something? |
04:39:56 | FromDiscord | <Gyllou> eh not really im working on a package for nim rn |
04:40:04 | FromDiscord | <Gyllou> still learning my way around arraymancer |
04:41:02 | FromDiscord | <Rika> First time with nim and already at arraymancer? |
04:41:33 | disruptek | gyllou: how'sit goin' with the hashing? |
04:41:33 | FromDiscord | <Gyllou> eh not ive been around the block with tensor libraries |
04:41:53 | FromDiscord | <Rika> Is it me or is gyllou new I don’t know someone fill me in |
04:42:08 | FromDiscord | <Gyllou> pretty well, i imported a few of those packages and ive been benchmarking them |
04:42:34 | FromDiscord | <Gyllou> well working on benchmarking them, im also getting acquainted with what dimensions arraymancer can handle as well as its api in general |
04:43:02 | FromDiscord | <Gyllou> im reasonably new to nim but ive been popping in here for the past few weeks as I learn |
04:43:16 | FromDiscord | <Rika> Oh I see |
04:43:20 | disruptek | rika: gyllou is doing some ai graph stuff. |
04:43:26 | FromDiscord | <Rika> Cool stuff |
04:43:37 | FromDiscord | <Gyllou> yea im excited about it |
04:43:57 | disruptek | me too. |
04:44:11 | disruptek | actually, i'm just excited to have electricity. |
04:44:18 | FromDiscord | <Gyllou> i wish arraymancer had more documentation though |
04:44:26 | FromDiscord | <Gyllou> thats always a good thing! |
04:44:35 | FromDiscord | <Gyllou> why wouldnt you? outages? |
04:44:44 | FromDiscord | <Rika> Maybe living in the woods |
04:45:05 | disruptek | yeah, i'm in an rv. |
04:45:20 | FromDiscord | <Gyllou> gotcha |
04:45:32 | disruptek | i was working on incremental compilation and then *bzzt*. |
04:45:42 | FromDiscord | <Gyllou> that sucks jesus |
04:45:54 | FromDiscord | <Gyllou> do you have any servers in there? |
04:46:27 | disruptek | nah. i have a nas box but everything i care about is in the cloud. |
04:46:40 | FromDiscord | <Gyllou> oh okay thats good an all |
04:46:41 | disruptek | what's amazing is how shitty btfs is on the san, though. |
04:47:07 | disruptek | it's just terrible. feels like i roll back snapshots every other time i crash. |
04:47:14 | disruptek | and i crash multiple times per day. |
04:47:32 | Prestige | why do you crash so much? |
04:47:32 | disruptek | i switched another lun to ext4 and it's rock-solid. |
04:47:34 | FromDiscord | <Gyllou> thats a headache |
04:47:47 | FromDiscord | <Gyllou> ive never really messed with ext4 |
04:47:49 | disruptek | yeah, it's a pita. |
04:48:04 | FromDiscord | <Gyllou> is it worth it over ext3? |
04:48:15 | disruptek | bcachefs is finally entering mainline, so that's what i'm pinning hopes upon. |
04:48:27 | disruptek | ext4 is quite a large improvement over ext3. |
04:49:04 | FromDiscord | <Gyllou> interesting, had to look that one up |
04:49:11 | FromDiscord | <Gyllou> yea i should probably migrate to that |
04:49:21 | disruptek | whenever the neighbor uses her microwave, i lose power. |
04:49:24 | FromDiscord | <Gyllou> just not enough hands for everything |
04:49:33 | disruptek | i know the feeling. |
04:49:44 | disruptek | i've been meaning to replace my cron daemon for like, a year. |
04:49:51 | disruptek | it's ridiculous. |
04:50:14 | FromDiscord | <Gyllou> theres always something |
04:50:15 | * | leorize joined #nim |
04:50:22 | FromDiscord | <Gyllou> we have so much data rn |
04:50:44 | FromDiscord | <Gyllou> and with only a handful of people its pretty cumbersome to manage |
04:50:56 | disruptek | well, i told you to hire me. |
04:51:18 | * | rockcavera quit (Remote host closed the connection) |
04:51:20 | FromDiscord | <Gyllou> haha we need to be profitable first |
04:51:40 | disruptek | hmmph. |
04:51:46 | FromDiscord | <Gyllou> well we primarily concerned with taking a conservative approach to growth rn |
04:52:06 | FromDiscord | <Gyllou> i do kinda like not having any business types all up in my science |
04:52:20 | disruptek | i feel that. |
04:52:28 | disruptek | everything is complicated with money. |
04:52:44 | FromDiscord | <Gyllou> yea, i started this because i love robotics and research |
04:53:02 | FromDiscord | <Gyllou> i dont want have it turn into spreadsheets and zoom calls |
04:53:19 | FromDiscord | <Gyllou> (edit) "i dont want ... have" added "to" |
04:54:05 | disruptek | what a retarded edit result. why can't the bridge just perform the edit and color it appropriately? |
04:54:19 | disruptek | Yardanico: get on that shit please. |
04:55:10 | FromDiscord | <Gyllou> lol |
04:55:26 | disruptek | well i'm always trying to get him to write some nim. |
04:55:38 | disruptek | he's just stubborn about it for some reason. |
04:55:59 | FromDiscord | <Gyllou> im really enjoying it. it kinda brings back alot of what I like about programming. |
04:56:12 | FromDiscord | <Gyllou> sometime C can really suck it out of me |
04:56:52 | disruptek | yeah, it's like that. |
04:58:13 | disruptek | the best part about it is that whatever you have to do, it's likely no slower than the fastest code out there. |
04:58:52 | disruptek | i mean, it's always the case that i'm writing something else like C# and i just know that if i do something elegant, it's going to be slow. |
04:59:17 | disruptek | and that's just not a problem in nim. that makes elegance free, and that's a big deal. |
04:59:38 | FromDiscord | <Gyllou> yea that bugs me, i like c# alot but i agree |
04:59:52 | FromDiscord | <Gyllou> same with the jvm langs |
05:00:10 | disruptek | right. i love clojure as a concept but i'm just not able to accept the performance. |
05:00:25 | FromDiscord | <Gyllou> ive gottten to where i can write pretty damn fast python code, but I spend alot of time optimizing it |
05:00:30 | disruptek | probably naive of me, i suppose. |
05:00:36 | FromDiscord | <Gyllou> i havent touched it yet. |
05:00:50 | disruptek | fast python doesn't have anything pythonic about it. |
05:00:56 | disruptek | this is the problem. |
05:01:00 | FromDiscord | <Gyllou> i think crystal looks cool, but im not sure i trust it for production based their release history |
05:01:24 | disruptek | to me it adds nothing to the toolbox. |
05:01:47 | FromDiscord | <Gyllou> yea its very true, you spend alot of time getting it to be anything but python |
05:01:51 | FromDiscord | <nikki> i think the codegen to C is suuuuuch a great feature, to be able to just look at it to get a sense of what it'll do behind the scenes |
05:02:19 | FromDiscord | <Gyllou> yea i agree |
05:02:33 | disruptek | well, i'm gonna build a proper introspection shim. |
05:02:57 | FromDiscord | <Gyllou> i wish nim had more packages for stuff im doing, but it has the most important building blocks....and really good ones at that |
05:02:58 | disruptek | even with my mangling patch, i don't really want to look at the c. |
05:03:03 | disruptek | it's just not that convenient. |
05:03:36 | FromDiscord | <Gyllou> yea i took a gander, useful, but i dont see myself tweaking at that stage anytime soon |
05:04:08 | disruptek | you definitely don't want to. |
05:04:26 | FromDiscord | <nikki> yeah the main thing that has mad it tractable is that my editor has "goto def" working so i can just hit the hotkey on a symbol and i jump to the defn in the c code |
05:04:28 | disruptek | but it's sometimes handy to track down a copy or something. |
05:04:29 | FromDiscord | <nikki> like the flags are setup for that |
05:04:57 | disruptek | that sounds decent, but.. meh. |
05:05:21 | * | astronavt quit (Quit: Leaving) |
05:05:29 | disruptek | i want high-level instrumentation and i think it's not that hard to build it. |
05:06:14 | FromDiscord | <nikki> yeah that'd be cool to see |
05:06:20 | FromDiscord | <nikki> what do you mean by instrumentation in this case |
05:08:18 | disruptek | i'm making a thing that does cloud resource acquisition at compile-time and then moves a runtime continuation into the cloud. |
05:08:35 | FromDiscord | <ElegantBeef> Knowing disruptek he probably meant like a flute or something 😄 |
05:09:07 | disruptek | i just want to be able to serialize my continuation back into ast, basically. |
05:11:18 | FromDiscord | <nikki> seems cool |
05:11:19 | disruptek | it's not that i can't just put another layer on top, but i think more folks would benefit from adding the layer to the bottom; integrating it into objects, say. |
05:12:02 | FromDiscord | <nikki> could you say like `doThing1(); wait(2.weeks); doThing2();` for some agent that's running in the cloud |
05:12:10 | FromDiscord | <nikki> and in the 2 week period its run state is serialized or sth |
05:12:32 | disruptek | oh, no. the goal is to have it way more integrated. |
05:13:12 | disruptek | there's like a microkernel layer that knows how to do basic stuff like drop privileges and fork. |
05:13:49 | disruptek | so it can, say, create a new microservice and install code and setup a cron to kick it off two weeks later. |
05:14:10 | FromDiscord | <nikki> dang |
05:14:27 | disruptek | the microservice lets this entity be managed by the rest of the environment, for example to delete it or measure it in some way. |
05:14:45 | FromDiscord | <nikki> right yeah |
05:15:06 | FromDiscord | <nikki> does your cps thing use some notion of the current execution frame and save it somehow |
05:15:08 | disruptek | but this can all be done at compile-time. so when you run code, you're able to access these resources as native objects. |
05:15:18 | FromDiscord | <nikki> like you learn about local variables and learn that you should be able to serialize them or sth? |
05:15:59 | FromDiscord | <nikki> so that you can do `let x = computeSomethingNow(); wait(2.weeks); doThingWithData(x);` |
05:16:05 | disruptek | cps just rewrites the procedure and captures everything local and rewrites it all to operate on the same data. |
05:16:42 | disruptek | i mean, yes, you can do that. but it's a small part of the puzzle. |
05:17:08 | FromDiscord | <nikki> right yeah |
05:17:52 | disruptek | i'm building this to do more stuff like, "if foo(): one() else: two()" and i want both branches to run at the same time in two separate lambda calls in the cloud. |
05:18:09 | FromDiscord | <nikki> ahhh word |
05:18:30 | FromDiscord | <nikki> and maybe it figures out the flow graph and dependencies |
05:18:40 | disruptek | if 0 == randint(0, 1000): echo "i'm the forker" else: echo "i'm fork number x" |
05:18:58 | FromDiscord | <nikki> like in the case you showed because (or if) the `one()` and `two()` calls aren't sequenced relative to each other because of depending on one or the other |
05:19:06 | disruptek | right. |
05:19:29 | FromDiscord | <nikki> cool. well it also has parallels (ha) for being used in eg. gpu compute locally |
05:19:52 | disruptek | yeah, but there are i/o limitations there. |
05:19:52 | FromDiscord | <nikki> like -- being able to express a computation and have it automatically parallelize or sth |
05:20:12 | disruptek | smarter people are solving those problems for us. 😉 |
05:20:24 | FromDiscord | <nikki> haha |
05:20:26 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
05:20:34 | disruptek | i'm just trying to make a hack, basically. |
05:20:34 | * | njoseph joined #nim |
05:21:17 | FromDiscord | <nikki> well, hacks in nim are always appreciated |
05:22:31 | disruptek | it's just too hard to calculate fibonacci(100) |
05:22:58 | disruptek | i'm willing to pay for it, as long as it means running a few thousand parallel routines in the cloud with like 3 lines of code. |
05:23:09 | disruptek | it should cost almost nothing. |
05:23:19 | disruptek | that's the low-friction software i want. |
05:27:56 | * | Cthalupa quit (Ping timeout: 260 seconds) |
05:29:33 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:29:51 | * | Cthalupa joined #nim |
05:33:22 | * | solitudesf joined #nim |
05:34:10 | disruptek | solitudesf: are you busy? |
05:44:33 | * | rockcavera joined #nim |
05:50:43 | * | leorize quit (Ping timeout: 240 seconds) |
05:51:10 | * | leorize joined #nim |
05:55:51 | solitudesf | yes |
05:56:00 | disruptek | punk. |
06:13:06 | * | narimiran joined #nim |
06:23:55 | * | natrys joined #nim |
06:37:21 | * | habamax joined #nim |
06:38:37 | FromDiscord | <tinygiant> sent a code paste, see https://play.nim-lang.org/#ix=2Dwt |
06:46:00 | solitudesf | iterate with index, `for i, item in array` |
06:52:18 | FromDiscord | <tinygiant> sent a code paste, see https://play.nim-lang.org/#ix=2Dwy |
06:54:38 | solitudesf | lol |
07:00:05 | FromDiscord | <Rika> sounds like json needs an update |
07:54:27 | * | PMunch joined #nim |
08:21:27 | * | xet7 joined #nim |
08:53:56 | Oddmonger | hello, what does this mean ? got <type string> but expected 'string' ( https://play.nim-lang.org/#ix=2DwW ) |
08:55:12 | * | nc-x joined #nim |
08:55:31 | nc-x | Oddmonger |
08:55:32 | nc-x | result = X |
08:55:42 | nc-x | you are assigning `type string` to result |
08:55:55 | nc-x | it should be result = a |
08:56:39 | Oddmonger | ahhhh /o\ |
08:56:47 | Oddmonger | thank you |
09:05:23 | FromDiscord | <Rika> When it says type something it means you're assigning a type, like a = int or so |
09:21:25 | * | Tanger quit (Remote host closed the connection) |
09:24:05 | * | nc-x quit (Remote host closed the connection) |
09:24:23 | * | leorize quit (Ping timeout: 240 seconds) |
09:26:55 | * | natrys quit (Ping timeout: 246 seconds) |
09:27:25 | * | natrys joined #nim |
09:33:43 | * | abm joined #nim |
09:37:33 | * | Vladar joined #nim |
09:53:01 | * | leorize joined #nim |
09:53:43 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
10:02:33 | * | habamax_ joined #nim |
10:05:23 | * | habamax quit (Ping timeout: 260 seconds) |
10:08:37 | * | xet7 quit (Quit: Leaving) |
10:30:23 | * | leorize quit (Ping timeout: 240 seconds) |
10:45:40 | Oddmonger | is there a use case with type assigning ? |
10:45:59 | Oddmonger | assigning a type to a variable seems so strange |
10:47:53 | * | leorize joined #nim |
10:56:19 | FromDiscord | <Rika> no clue really, only works on compiletime even |
10:56:23 | * | nc-x joined #nim |
10:56:43 | nc-x | yeah. there is no usecase and the compiler gives an error https://play.nim-lang.org/#ix=2DxG |
10:58:13 | nc-x | and if you have a usecase, then use `type abc = int` |
10:58:13 | Oddmonger | may be for macros… |
10:58:30 | nc-x | maybe |
10:58:37 | nc-x | i don't use macros :) |
10:58:45 | Oddmonger | maybe one day :) |
10:59:06 | bung | I try to use nimble readPackageInfoFromNims proc , Got exception: /bin/sh: : command not found printPkgInfo() failed |
10:59:48 | Oddmonger | i was reading this: https://hookrace.net/blog/introduction-to-metaprogramming-in-nim/ , and finished in the strformat man page, wondering how to pad hex numbers display ^^' |
11:02:25 | * | nc-x quit (Remote host closed the connection) |
11:03:21 | PMunch | !eval import strutils; echo "'" & 100.uint8.toHex().align(5) & "'" |
11:03:25 | NimBot | ' 64' |
11:03:28 | PMunch | Like that? |
11:04:18 | PMunch | Where is `readPackageInfoFromNims` defined bung? |
11:07:00 | bung | nimblepkg/packageparser.nim |
11:07:20 | bung | I modified it locally for exporting |
11:10:43 | PMunch | Do you have /bin/sh? |
11:12:05 | bung | ls /bin/sh |
11:12:16 | bung | yeah I have |
11:13:34 | PMunch | Ah, it is failing to find an executable |
11:14:33 | ForumUpdaterBot | New thread by Domogled: Std/tables [] vs. add(), see https://forum.nim-lang.org/t/7055 |
11:15:41 | * | narimiran quit (Ping timeout: 256 seconds) |
11:16:01 | * | Cthalupa quit (Ping timeout: 265 seconds) |
11:18:49 | * | habamax_ quit (Quit: leaving) |
11:19:09 | * | habamax joined #nim |
11:19:22 | * | Cthalupa joined #nim |
11:19:55 | planetis[m] | is casting from string to seq[byte] safe in arc/orc? |
11:22:42 | Araq | yes if |
11:22:55 | Araq | - the string doesn't come from a string literal |
11:23:03 | Araq | - you don't mutate the seq[byte] |
11:23:21 | Araq | in fact, hmm, better never mutate the resulting seq[byte] |
11:26:32 | * | lritter joined #nim |
11:27:35 | bung | no idea now, it seems design for cli usage |
11:27:43 | planetis[m] | it's just that this new "zippy" lib does it, but indeed seems like it doesn't mutate seq[byte] |
11:30:37 | * | opal quit (Read error: Connection reset by peer) |
11:30:37 | * | leorize quit (Remote host closed the connection) |
11:31:19 | * | leorize joined #nim |
11:32:10 | * | opal joined #nim |
11:34:32 | Zevv | so, will this forever hold then? |
11:34:39 | Zevv | I thought we did not make this promise? |
11:41:42 | FromDiscord | <dom96> IMO all "cast"ing should always be "unsafe" |
11:42:34 | FromDiscord | <dom96> if a type conversion is safe then the compiler should allow it |
11:42:48 | FromDiscord | <dom96> i.e. seq[byte](myStr) should work |
11:44:43 | * | xet7 joined #nim |
11:48:23 | * | opal quit (Ping timeout: 240 seconds) |
11:51:25 | * | opal joined #nim |
12:03:13 | bung | PMunch it seems nimsuggest should init with correct project file, with my PR my project file suggest well, old version doesn't |
12:04:25 | Zoom[m] | Can locks be used with threadpool? ATM can't spawn the proc which acesses the global var with a lock due to it not being GCsafe |
12:05:02 | bung | and now it slower when init but faster with other files, since it has build whole graph |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:37 | * | supakeen joined #nim |
12:08:29 | Zoom[m] | When I mark a proc {.gcsafe.} it explicitly points to a global var guarded by a lock |
12:09:10 | Zoom[m] | `foo() s not GC-safe as it accesses 'bar' which is a global using GC'ed memory` |
12:09:18 | PMunch | bung, this one? https://github.com/PMunch/nimlsp/pull/61 |
12:09:18 | disbot | ➥ Nimble |
12:09:37 | bung | yes |
12:09:57 | PMunch | Zoom[m], it's still not GC-safe even if it is behind a lock |
12:10:01 | bung | nimble and clean read to merge I think |
12:11:47 | Zoom[m] | PMunch: so locks can't be used with spawn? I see dom96 has an example in the book (6.23) which is not far from what I have |
12:12:44 | * | mmohammadi9812 quit (Quit: Quit) |
12:13:01 | * | mmohammadi9812 joined #nim |
12:15:08 | Zoom[m] | TBH, I'm trying to directly mutate a global seq from behind a lock, is it a problem? |
12:15:58 | PMunch | The lock isn't the problem, they work fine with spawn and threadpools |
12:16:13 | PMunch | The problem is that you have a global variable that uses a GC'ed type and try to access it from a thread |
12:17:49 | PMunch | The default garbage collector in Nim uses thread-local memory. This means that if this thread tried to access this variable and triggered the GC for that thread it wouldn't find references from other threads and could end up free-ing the global variable. This is obviously bad. In order to have global variables you need to make sure that they are GC-safe, ie. doesn't use the garbage collector. |
12:20:07 | Zoom[m] | ah, thanks. So, do I need to rewrite it using FlowVars or channels? |
12:21:49 | PMunch | Depends on what you're trying to do |
12:22:29 | PMunch | But some kind of rewrite is necessary |
12:35:32 | Zoom[m] | I'm trying to process a list of strings with an external process, hopefully in parallel. Basically, this: https://play.nim-lang.org/#ix=2Dt8 |
12:36:43 | PMunch | Yeah, I'd rewrite that to a channel |
12:37:14 | PMunch | Basically make output a channel, then each `get_w` writes their result to the channel, and when they are all done you just exhaust the channel in your main thread. |
12:40:36 | * | xet7 quit (Ping timeout: 265 seconds) |
12:44:57 | Zoom[m] | Not sure how to convert the output to a channel since it's a seq. I don't like it to be copied, so I need to channel individual responses, right? |
12:50:36 | Zoom[m] | Also, my previous try with channels failed: Threadpool was launching the threads (the list is huge) and nothing was coming out of a channel until they all were created. It looks like I was receiving wrong. |
12:53:58 | Zoom[m] | I mean, it would be nice to start receiving something from the channel before "they were all done". It's a FIFO, why wait? |
13:11:51 | PMunch | Ah, no don't convert it on runtime, convert your code to use a channel and not a seq |
13:12:12 | PMunch | What you probably did was pass the channel to the thread, but what you need to do is pass a pointer to the channel to the thread |
13:12:28 | PMunch | Otherwise it will copy the channel and you won't be able to read from it |
13:15:07 | * | Vladar quit (Remote host closed the connection) |
13:20:21 | Zoom[m] | ATM I'm trying to use a global channel which should pass a tuple. |
13:20:48 | * | Vladar joined #nim |
13:21:52 | Zoom[m] | An I'm seeing the same problem. Threads get created, most of them geto to sleep, some become zombies, and no processing with the channel's output happens, even though I'm checking for dataAvailable in the loop which spawns the threads. |
13:22:12 | PMunch | Code? |
13:22:21 | Araq | "threads become zombies"? |
13:22:26 | Zoom[m] | * And I'm seeing the same problem. Threads get created, most of them go to sleep, some become zombies, and no processing with the channel's output happens, even though I'm checking for dataAvailable in the loop which spawns the threads. |
13:22:52 | Zoom[m] | I mean the processes which are launched in threads |
13:26:07 | Zoom[m] | Ok, the code is a mess. I'm trying to get a bunch of word definitions from a local instance of dico. |
13:27:37 | Araq | notice that osproc supports running multiple processes without multi-threading |
13:27:47 | Araq | (not sure if it helps) |
13:31:01 | Zoom[m] | https://play.nim-lang.org/#ix=2Dyi |
13:31:58 | Zoom[m] | The size of a threadpool and the amount of processess that get stuck in a sleeping or zombie states varies widely with the change of GC |
13:32:30 | * | Kaivo joined #nim |
13:32:52 | Araq | use createThread instead of the thread pool |
13:33:44 | Zoom[m] | Ok, but what's wrong with using the thread pool here? |
13:34:02 | Araq | the thread pool was written by a moron (=me) |
13:34:54 | Zoom[m] | So, do you mean I'm actually hitting some bugs, and not just having an unworkable implementation? |
13:35:47 | Araq | bugs or not, one big problem is that threadpools don't reliably work with channels |
13:36:52 | Zoom[m] | As I said yesterday, this simple code is actually a miserable experience. It believe it would be trivial with Rust's Rayon (at least I used it successfully to launch multiple processess). |
13:37:32 | Zoom[m] | I tried it with FlowVars already, and was getting the same behaviour from the processess. |
13:38:33 | Araq | there is also Weave |
13:38:55 | Araq | which offers a much better multi-threading package but it focusses on CPU perf, not on IO |
13:40:01 | Zoom[m] | couldn't spawn the proc's with weave, something was wrong with some 'semantics' it said |
13:40:53 | PMunch | Wait, why doesn't threadpools work well with channels? |
13:41:14 | Araq | I used createThread to control processes, worked without problems. |
13:41:20 | Araq | well |
13:42:05 | Araq | with the usual problems that I also remember from other languages/runtimes |
13:42:07 | Zoom[m] | <PMunch "Wait, why doesn't threadpools wo"> Yeah, as I said, we have an example in Dom's book, is it not relevant in this regard? |
13:42:46 | Araq | PMunch, 'spawn' was originally designed for parallelism, not for concurrency |
13:42:51 | PMunch | What kind of problems? I don't really see why it would cause issues, but maybe I'm missing something |
13:42:52 | PMunch | Ah |
13:42:54 | Araq | the idea is that when you do |
13:43:02 | Araq | spawn foo(args) |
13:43:13 | Araq | it's *optionally* run on a different thread |
13:43:28 | Araq | but the semantics are much like 'foo(args)' |
13:43:57 | Araq | and then later threadpool got patched because people simply don't understand 'spawn' |
13:44:55 | Araq | or maybe because they rightly demand that it is at least non-blocking :-) |
13:45:03 | Zoom[m] | May be because it's not maybe_spawn? |
13:45:29 | PMunch | I can see how people would misunderstand that |
13:45:52 | PMunch | But anyways Zoom[m], how many threads/processes are you trying to start simultaneously? |
13:46:46 | Zoom[m] | I hoped that would be not for me to decide. The list is about 10000 and I expected the threadpool to manage it for me |
13:47:34 | PMunch | Ah right |
13:47:34 | Araq | Zoom[m], execProcesses handles it fine IME |
13:47:54 | Araq | give it a list of tasks and it runs them |
13:48:09 | Araq | without creating N processes at the same time, it slices through them |
13:48:11 | PMunch | Yeah starting a thread for each program might be a bit overkill |
13:50:34 | Zoom[m] | But I need to capture their output. Do I need to utilize `afterRunEvent` somehow? |
13:52:39 | FromGitter | <gogolxdong> Is there a way to store table from its string repr? |
13:52:47 | FromGitter | <gogolxdong> restore |
13:53:10 | Araq | Zoom[m], yeah |
13:53:24 | Araq | maybe look at compiler/extccomp.nim |
13:53:30 | Zoom[m] | <PMunch "Yeah starting a thread for each "> Why? Isn't it a perfect case of using threads? Completely separate processes in their own threadas? |
13:53:41 | PMunch | Nope |
13:54:06 | PMunch | Threads are a fairly heavy OS construct. Optimally you don't want more threads than you have cores on your CPU |
13:54:30 | PMunch | Furthermore they are meant to run things across cores, and don't really have anything to do with running external programs. |
13:54:50 | Zoom[m] | Yep, isn't the threadpool supposed to limit the number of threads to maintain the optimal load? |
13:54:53 | PMunch | If anything you'll slow your program down from running them in separate threads vs. a proper async solution |
13:55:06 | PMunch | Yes, in a CPU-bound computation |
13:55:39 | PMunch | What you are doing is starting separate programs (which will run in their own thread(s)), and the consumption of their output is to your program the same as IO |
13:55:47 | PMunch | And IO bound stuff is better handled with async |
13:56:03 | Araq | PMunch, 10_000 threads are really not much of a problem on any OS these days |
13:56:13 | Zoom[m] | This is what I started with :D |
13:56:20 | Araq | but sure, async's resource consumption is better |
13:56:32 | PMunch | Araq, oh yeah, not much of a problem, but not giving you any benefits either |
13:56:54 | Araq | well if the job is "I need to ship this yesterday" |
13:57:03 | Araq | then using 10_000 threads can get you there |
13:57:17 | PMunch | Well yeah |
13:57:30 | Araq | without having to mess around with 3rd party async osproc implementations :P |
13:57:48 | Araq | (yeah yeah, we should have one of these ourselves) |
13:57:54 | Zoom[m] | Well, I expected this to be a threadpool's job. I should say "limit threads to nCPUs and process all that" |
13:57:54 | PMunch | But there are plenty of things we do when "this should be shipped yesterday" that we shouldn't tell other people about :P |
13:58:14 | Araq | Zoom[m], threadpool does that but I doubt it helps much |
13:58:26 | PMunch | Threadpool should indeed be a tool to do this, but not the best one |
13:58:35 | Zoom[m] | In my case it led to a bunch of zombie processes :) |
13:58:51 | PMunch | Then you probably did something wrong :P |
13:58:52 | Araq | threadpool has logic like |
13:58:54 | PMunch | Threads can be tricky |
13:58:59 | Zoom[m] | I just need a tool, not the best one |
13:59:05 | PMunch | What does execProcesses really do Araq? |
13:59:07 | Araq | "are the CPUs busy? no? let me create more threads then..." |
13:59:46 | Araq | the idea of threadpool is to adjust the number of threads for the workload |
14:00:30 | Araq | nothing of this code was written in mind with process control :-) |
14:00:33 | Zoom[m] | <Araq ""are the CPUs busy? no? let me c"> That's prefectly fine by me! I'm not sure why in my case the processess I'm launching are so slow, but I'm not hitting IO (hdd) freezes so please RUN MOAR |
14:01:01 | Araq | so call setMinPoolSize/setMaxPoolSize |
14:01:11 | PMunch | Well, without code it's pretty hard for us to guess why.. |
14:01:18 | Zoom[m] | That's what I did |
14:01:20 | Araq | but I don't see the point, createThread gives more guarantees |
14:01:42 | Zoom[m] | I showed the code. It's trivial |
14:02:27 | Araq | we can't run your code tho |
14:02:34 | Zoom[m] | I just used a common sense and didn't wan't to flood the OS so that's why I used a threadpool |
14:03:17 | Zoom[m] | There's a commented string which substituted the process for `echo` |
14:06:31 | Zoom[m] | So, what I'm saying is, the task of "take a list of stuff, process it in parallel and start giving me back the results as soon as any is available" is rather common and threadpool+channel combo looks like it's made specifically for that. |
14:07:29 | PMunch | And if you were actually doing processing in your thread then I'd agree |
14:07:47 | PMunch | But you're calling a separate program, which turns this from CPU bound to IO bound in the eyes of your program |
14:09:59 | Zoom[m] | That's what I reasoned at first. But the catch is, there's not much to do except launch more processes. And I don't see how async/await could help me there. |
14:11:18 | FromDiscord | <Rika> less overhead i believe |
14:13:25 | PMunch | Because you can start as many processes as you want, as they will run their own threads, and then poll them for completion |
14:13:34 | PMunch | Which is basically what execProcesses does |
14:13:47 | PMunch | You could also use https://github.com/cheatfate/asynctools/blob/master/asynctools/asyncproc.nim |
14:15:00 | Zoom[m] | Thanks for the link. Less technical overhead, but much more mental one. Not the best trade-off |
14:15:02 | * | Cthalupa quit (Ping timeout: 264 seconds) |
14:15:24 | PMunch | Why don't you want to use execProcesses though? |
14:15:47 | PMunch | That's the easiest and a good technical solution |
14:16:17 | Zoom[m] | Because to be honest, when I looked at the docs I couldn't see a clear way or capturing the output |
14:16:54 | PMunch | Ah, that's what you would do in the callback |
14:17:05 | PMunch | You get the Process object, so you can read it's output |
14:17:08 | PMunch | its* |
14:17:26 | * | Cthalupa joined #nim |
14:17:29 | Zoom[m] | "The highest (absolute) return value of all processes is returned." is not what I'm looking in a description. |
14:17:36 | PMunch | Only issue is if the program produces too much output and fills its buffer |
14:17:47 | * | narimiran joined #nim |
14:17:55 | PMunch | Zoom[m], huh? That is the return value of the entire call |
14:18:17 | PMunch | Basically just meant to be used to check if any of the processes errored out, if you haven't attached a callback |
14:18:35 | Zoom[m] | I understand it now. I just would love the docs to be a little bit more prescriptive |
14:18:39 | PMunch | Useful if you are just calling a bunch of processes for batch processing where you will later read the result from a file for example |
14:19:54 | Zoom[m] | I also stand my ground that threadpool+channel should work, as it's the dumbest and most obvious thing on the surface |
14:20:23 | PMunch | Pretty sure it does work if you do it right :P |
14:21:09 | Zoom[m] | I'm not sure what you're hinting at, but it worked with Rayon on a similar case for me. :D |
14:21:19 | Zoom[m] | Hope I'm not getting banned for that |
14:21:48 | PMunch | Haha, you don't get banned for saying that you can make stuff work in other languages :P |
14:21:48 | FromDiscord | <Rika> you probably would if your situation was reversed (nim working and rust not) |
14:21:53 | FromDiscord | <Rika> (and in the rust discord) |
14:22:13 | FromDiscord | <Rika> also i'd argue rust's rayon has probably had more work than many nim libraries have had |
14:22:52 | Zoom[m] | I spammed rust_newbies alright in my time, never had problems with my dumb questions |
14:23:04 | PMunch | Still not entirely sure what would prevent channels to work in a threadpool though |
14:23:10 | PMunch | Must be a really funky implementation :P |
14:23:53 | FromDiscord | <Rika> perhaps your questions to rust were common; i dont think your threadpools question is common at all |
14:24:12 | Zevv | pssst... just join us on the dark side and come work on cps |
14:25:21 | Zoom[m] | <Zoom[m] "So, what I'm saying is, the task"> Isn't it common? Let's not dive into io vs cpu, it's a simple solution that's obviously works as intended, when it works |
14:29:06 | Zoom[m] | In an ideal world my code should use some asynchronous solution, but technically it should have worked, right? |
14:29:45 | PMunch | Yes, but again, without your code it's pretty hard to tell if you just messed it up or if there is a problem with the library |
14:30:39 | Zoom[m] | Again, here it is: https://play.nim-lang.org/#ix=2Dyi |
14:31:03 | Zoom[m] | I wasn't going to show this monstrosity to anyone |
14:33:49 | * | narimiran quit (Ping timeout: 264 seconds) |
14:36:13 | * | narimiran joined #nim |
14:39:54 | jonjitsu[m] | Is it considered bad style to assign enums values and use those values later. A use case can be when there are environment variables used and you want to avoid typo bugs, ex: https://play.nim-lang.org/#ix=2DyC |
14:41:49 | PMunch | Not at all, in fact I'd say that is good practice |
14:42:14 | PMunch | Haven't seen it much in user code, but definitely being used in libraries |
14:45:09 | Zoom[m] | That's what the type system is there for, to free us from bugs :D |
14:47:07 | ForumUpdaterBot | New thread by Jackhftang: Quick question about acyclic pragma , see https://forum.nim-lang.org/t/7057 |
14:47:43 | jonjitsu[m] | ok I wasn't sure if enums were more for the symbol and if the value was guaranteed not to be mangled or some other side effect like that |
14:57:19 | * | PMunch quit (Ping timeout: 246 seconds) |
15:04:14 | * | luis_ joined #nim |
15:11:02 | * | PMunch joined #nim |
15:14:02 | PMunch | No stream tonight unfortunately, I have some real-world stuff to do, and besides improving the layouting algorithm for notifishower I'm not really sure what I'd be doing |
15:14:21 | Prestige | PMunch: nimlsp ;) |
15:14:37 | PMunch | Actually bung has been doing some work on NimLSP lately |
15:15:15 | * | tane joined #nim |
15:15:40 | PMunch | Oh well, gotta go fetch something at the post office |
15:17:43 | Prestige | see ya |
15:21:29 | FromGitter | <Kvothe87> i tried to update the nim version. I tried choosenim update stable ang got an error (libcrypto-1_1-x64|libeay64).dll |
15:24:05 | FromGitter | <Kvothe87> tried to download choosenim again, thinking that maybe i had it in the other pc, tried with the exe and it seems like it did not do anything. Tried with the zip file and running the runme.bat and got that teh system cannot find the specified path press any key to continue and then nothing |
15:26:23 | * | gangstacat quit (Ping timeout: 272 seconds) |
15:26:59 | Oddmonger | how to pass values as cint ? (10,10) is parameters is passed like tuple of int's |
15:27:25 | Prestige | (10.cint, 10.cint) ? |
15:27:39 | Oddmonger | /o\ i was afraiding this |
15:27:47 | Oddmonger | thank you |
15:28:01 | Prestige | Any time! |
15:30:30 | Oddmonger | may be it's time for a template… |
15:31:25 | Prestige | Or maybe a converter, if you're using that a lot |
15:32:54 | Oddmonger | ah, didn't know converter |
15:33:15 | FromDiscord | <Rika> theyre a feature many people dont recommend using but theres the occasional use so |
15:33:16 | Oddmonger | i think it will be used a lot, indeed |
15:34:20 | * | luis_ quit (Quit: luis_) |
15:34:50 | Oddmonger | ok so let's stick to the template for beginning |
15:37:35 | * | waleee-cl joined #nim |
15:49:23 | * | leorize quit (Ping timeout: 240 seconds) |
15:49:37 | * | astronavt joined #nim |
15:50:58 | Oddmonger | for macros, tried this, not the right way it seems : https://play.nim-lang.org/#ix=2DyT |
15:51:19 | Oddmonger | may be i'm taking the wrong path for cint/int conversions |
15:52:03 | FromDiscord | <InventorMatt> https://play.nim-lang.org/#ix=2DyU |
15:52:14 | FromDiscord | <InventorMatt> you just needed to add an ouput parameter |
15:52:18 | * | leorize joined #nim |
15:52:53 | Oddmonger | ahh like this! Thank you |
15:53:50 | FromDiscord | <InventorMatt> no problem. i make the same mistake all the time with templates |
15:53:58 | * | luis_ joined #nim |
15:54:27 | FromDiscord | <Zachary Carter> you can make the return type `Vec2` instead of `untyped` |
15:54:52 | FromDiscord | <Zachary Carter> also - you don't need to use `repr` you can just print the object representation with `echo` |
15:55:03 | FromDiscord | <Zachary Carter> so - https://play.nim-lang.org/#ix=2DyV |
15:57:24 | Oddmonger | ok, yes for the repr i wasn't sure too |
15:58:07 | Oddmonger | can i use this template in another file ? It seems templates cannot be imported |
15:58:15 | FromDiscord | <Zachary Carter> you can export templates |
15:59:02 | FromDiscord | <Zachary Carter> but remember templates are for code substitution |
15:59:17 | FromDiscord | <Zachary Carter> so if a symbol in the template isn't available in that source unit you'll encounter issues |
15:59:29 | Oddmonger | yes, i see that |
15:59:55 | Oddmonger | as Vec2 is defined in source A, and template must be defined in source B |
16:00:14 | Oddmonger | B template doesn't know what Vec2 is |
16:00:36 | Oddmonger | so i can export the type with « type Vec2* = » |
16:01:18 | FromDiscord | <Zachary Carter> actually |
16:01:35 | FromDiscord | <Zachary Carter> the template doesn't necessarily have to know what Vec2 is, if you use `untyped` |
16:01:35 | Oddmonger | i have other errors though |
16:01:44 | Oddmonger | ah |
16:01:47 | FromDiscord | <Zachary Carter> so for instance - https://play.nim-lang.org/#ix=2Dz5 |
16:01:48 | FromDiscord | <Zachary Carter> this compiles |
16:01:55 | FromDiscord | <Zachary Carter> even though I haven't defined `Vec2` anywhere |
16:02:26 | FromDiscord | <Zachary Carter> since the return value is `untyped` it won't be type checked |
16:03:10 | Oddmonger | not so easy in fact… |
16:03:57 | Oddmonger | when i try to use the template ( foo( toVec2( 10,12) ) , the compiler says it cannot be called |
16:04:31 | Oddmonger | but « that was working before :( »™ |
16:05:24 | Oddmonger | didn't expected so much resistance in this field :') |
16:07:00 | Oddmonger | ah i see, he thinks i want to call : foo ( Vec2(…) ) which is not a function |
16:09:03 | FromDiscord | <Zachary Carter> yeah |
16:10:03 | Oddmonger | ok i had a typo ( ':' instead of '.') |
16:10:07 | Oddmonger | thank you :) |
16:15:38 | * | kaliy joined #nim |
16:21:04 | FromDiscord | <Zachary Carter> sure! |
16:27:36 | * | hnOsmium0001 joined #nim |
16:45:16 | FromGitter | <Knaque> What would be the equivalent of this Python code (https://hastebin.com/exiwoqelik.py) so that I can Ctrl+C gracefully? |
16:46:31 | * | natrys quit (Quit: natrys) |
16:46:34 | FromDiscord | <lqdev> https://nim-lang.org/docs/system.html#setControlCHook%2Cproc%29 |
16:46:39 | FromDiscord | <lqdev> @Knaque ^ |
16:47:11 | FromGitter | <Knaque> Of course it would be right under my nose... |
16:47:36 | FromGitter | <Knaque> Thank you. |
16:48:19 | disruptek | 🏀⚽ |
17:01:34 | FromDiscord | <Avatarfighter> disruptek: feeling sporty today? |
17:02:02 | disruptek | hard to feel sporty with these big balls. |
17:02:32 | FromDiscord | <Avatarfighter> oh nice you got big basketballs to compensate ? 😛 |
17:03:24 | * | kinkinkijkin joined #nim |
17:03:43 | FromDiscord | <Avatarfighter> Also, how is IC going disruptek 😩 |
17:04:24 | disruptek | what are you cryin' for? you don't have any code that's expensive to compile. |
17:04:35 | FromDiscord | <Avatarfighter> Oh I know |
17:04:39 | FromDiscord | <Avatarfighter> Its just so interesting |
17:04:49 | FromDiscord | <Avatarfighter> You're basically my primary source on how hard IC is |
17:05:05 | disruptek | well, the frontend is really simple. araq is making good progress. |
17:05:25 | solitudesf | cmon man, he has to compile nimph |
17:05:27 | disruptek | i'm struggling with a bug. not sure if it's a frosty issue or what. |
17:06:08 | FromDiscord | <Avatarfighter> What is the bug if I may ask? |
17:06:39 | disruptek | i'm getting a sequence for write that has an impossibly large length. |
17:07:32 | FromDiscord | <Avatarfighter> That's a really interesting bug |
17:07:41 | FromDiscord | <Avatarfighter> I had something not similar at all in another project 😛 |
17:09:01 | FromDiscord | <Avatarfighter> Do you have any idea what could be causing this? |
17:12:04 | FromDiscord | <Avatarfighter> probably not now that I think about it since if you did the bug wouldn't be a bug |
17:13:20 | disruptek | i think it's distinct-string related but i thought i had a passing test for this. |
17:13:40 | disruptek | also, it works some of the time, so... |
17:14:22 | disruptek | every filesystem path in the compiler is a distinct string. 🤷 |
17:24:01 | * | habamax quit (Quit: leaving) |
17:31:14 | disruptek | `len(a) == L` the length of the seq changed while iterating over it |
17:31:34 | disruptek | yet frosty's writes are all performed against immutable inputs. |
17:38:00 | * | natrys joined #nim |
17:38:22 | FromDiscord | <krisppurg> @haxscramper have you looked at the code yet, if not then I'm around if you got any questions or solutions and I'll try. |
17:38:52 | * | luis_ quit (Ping timeout: 272 seconds) |
17:43:06 | FromDiscord | <haxscramper> @krisppurg Yes, I looked at it, but the only thing (quite obvious, so probably not the reason for error) - there is still an `./aaa.mp3` as parameter for `ffmpeg`, so it won't generate any data etc. Anything else - I can't say for sure unless I just build & debug it myself |
17:44:10 | FromDiscord | <krisppurg> hm |
17:45:16 | FromDiscord | <krisppurg> still working though? |
17:46:26 | FromDiscord | <krisppurg> the audio file I used was https://media.discordapp.net/attachments/371759389889003532/775416019769491496/anyways_you_can_stop.mp3 |
17:46:45 | FromDiscord | <krisppurg> (edit) "the audio file I used was ... https://media.discordapp.net/attachments/371759389889003532/775416019769491496/anyways_you_can_stop.mp3" added "(if that helps)" |
17:47:17 | FromDiscord | <haxscramper> I can't build whole code you linked (`cannot open file: ws`) and to be honest this is probably not something I have time to debug right now - async code etc. is not something I'm familliar with |
17:48:52 | FromDiscord | <krisppurg> nimble install dimscord |
17:49:02 | disruptek | never. |
17:49:13 | FromDiscord | <haxscramper> Sorry, but I'm not going to debug this whole thing right now |
17:49:21 | FromDiscord | <krisppurg> eh oh well |
17:49:49 | FromDiscord | <krisppurg> what version of Nim are you running? I am using v1.2.0 |
17:51:11 | FromDiscord | <haxscramper> 1.4.0. And just for the record - my experience with dimscord/async/&related is just building documentation example. You probably much more proficient with that part of application than myself, so it is not like I can help to debug anything either. |
17:51:24 | FromDiscord | <krisppurg> alright |
17:51:39 | FromDiscord | <krisppurg> I might as well stop using startProcess and try execCmdEx |
17:52:02 | FromDiscord | <krisppurg> Is there any benefits so far for not using streams or...? |
17:52:02 | disruptek | nope. |
17:52:10 | disruptek | !repo asynctools |
17:52:11 | disbot | https://github.com/cheatfate/asynctools -- 9asynctools: 11Various asynchronous tools for Nim language 15 63⭐ 22🍴 |
17:54:17 | * | luis_ joined #nim |
17:54:27 | FromDiscord | <krisppurg> wait... |
17:54:39 | FromDiscord | <krisppurg> BRUH i realised I used aaa.mp3 |
17:54:44 | FromDiscord | <krisppurg> it works now lmfao |
17:55:02 | FromDiscord | <krisppurg> I think. |
17:57:15 | Zoom[m] | Thanks everyone who helped me earlier, especially PMunch and Araq. Don't want to sound rude, but I just looked at asynctools or execProcessess and rewrote the whole program in Rust with Rayon. No Zombies anymore. It's not even bigger in LOC. I feel like I lost this battle |
17:57:46 | FromDiscord | <krisppurg> yup it works thanks for your help haxscramper |
17:57:50 | PMunch | Too bad you couldn't get it to work out.. |
17:57:52 | disruptek | nonsense. sounds like you used the right tool for the job. |
17:59:47 | Zoom[m] | PMunch: I'm not a coder, so I code in abrupt waves when the inspiration or necessity strikes, so absorbing Nim docs for two days was too much for me, especially when I was hitting some strange behaviour which we discussed |
18:01:21 | PMunch | Ah, I can see that |
18:01:31 | Zoom[m] | What I was doing is I was looking for a way to automatically form decks for anki. One program exports the most infrequently used words from a book (txt) and the other polls dico for dictionary definitions and outputs the file Anki could import. |
18:02:57 | * | gangstacat joined #nim |
18:03:02 | FromDiscord | <shadow.> im getting a static assertion error when trying to compile in c++ mode |
18:03:13 | FromDiscord | <shadow.> i can fetch the exact error if needed |
18:03:39 | * | disruptek is now known as keisterfish |
18:03:45 | ForumUpdaterBot | New thread by Mantielero: Raspberry Pi 1B - nmqtt - exit code 137, see https://forum.nim-lang.org/t/7059 |
18:04:19 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2DzW |
18:04:21 | FromDiscord | <shadow.> and a bunch of other weird g++ errors lmao |
18:04:34 | FromDiscord | <shadow.> (edit) |
18:05:16 | * | a_b_m joined #nim |
18:05:20 | FromDiscord | <shadow.> any ideas on how to fix? |
18:05:24 | FromDiscord | <shadow.> c works fine |
18:08:38 | * | abm quit (Ping timeout: 272 seconds) |
18:10:30 | PMunch | Zoom[m], just out of curiosity, could you run this for me: https://play.nim-lang.org/#ix=2DA0 |
18:12:17 | Zoom[m] | Just , a moment, I think Dico just crapped into it's pants or something, pardon my French |
18:13:21 | PMunch | No worries, my French isn't all that great either :P |
18:17:41 | * | shadowninja55 joined #nim |
18:21:00 | shadowninja55 | ello |
18:21:05 | PMunch | Hi there |
18:21:11 | shadowninja55 | im getting static assertion errors when trying to compile to c++ |
18:21:21 | shadowninja55 | *compile through c++ i guess |
18:21:26 | shadowninja55 | i believe its a g++ error |
18:21:31 | shadowninja55 | should i paste it here? |
18:21:51 | keisterfish | ~paste |
18:21:52 | disbot | paste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead. |
18:22:01 | shadowninja55 | ah ok |
18:22:35 | shadowninja55 | https://hastebin.com/iriwiyelog.csharp |
18:22:37 | shadowninja55 | does this suffice? |
18:22:53 | keisterfish | sure. |
18:23:08 | shadowninja55 | alr cool |
18:23:32 | PMunch | Thanks for watching out for us keisterfish |
18:23:45 | keisterfish | yep. |
18:24:11 | keisterfish | looks like your compiler doesn't agree with nim wrt int sizes. |
18:24:13 | * | luis_ quit (Remote host closed the connection) |
18:24:20 | PMunch | Yeah |
18:24:20 | shadowninja55 | hmm |
18:24:27 | shadowninja55 | i just checked my mingw installation and it seems to be mingw32 |
18:24:31 | shadowninja55 | should i get 64 instead lmao |
18:24:37 | shadowninja55 | ive been using c++ for months now fine but |
18:24:43 | shadowninja55 | does mingw32 pose an issue for nim? |
18:24:50 | PMunch | If you are on a 64 bit system then you should use mingw32-w64 or whatever it is called |
18:24:58 | shadowninja55 | ah ok |
18:25:26 | PMunch | At least that's what I've been using when cross compiling to Windows |
18:25:34 | shadowninja55 | lemme go install that rq |
18:25:58 | keisterfish | or just x-compile to 32-bit. |
18:26:27 | shadowninja55 | eh its probably best to get x64 since im on a 64 bit system |
18:26:38 | keisterfish | of course. |
18:26:39 | PMunch | Sure, you could try to do --arch:32 or whatever the option is |
18:26:53 | PMunch | And that should at least give you a build with the Mingw version you have installed |
18:27:33 | shadowninja55 | oh ok |
18:27:36 | shadowninja55 | lemme try that |
18:30:53 | shadowninja55 | im installing mingw 64 rn |
18:31:09 | shadowninja55 | also do you have any idea which produces faster-executing programs in general with nim? c or c++ |
18:31:36 | PMunch | Well, C++ tends to be faster for certain things |
18:31:46 | PMunch | But they're not too far apart |
18:31:55 | keisterfish | use c. |
18:33:09 | * | Kaivo quit (Ping timeout: 256 seconds) |
18:35:21 | * | Kaivo joined #nim |
18:35:47 | shadowninja55 | i just realized nim has an installation of mingw64 lmao |
18:37:02 | keisterfish | tell me something and tell me true: |
18:37:08 | keisterfish | are you really a ninja? |
18:37:12 | shadowninja55 | hmm |
18:37:23 | shadowninja55 | considering i use windows probably not |
18:38:09 | * | keisterfish is now known as disruptek |
18:39:14 | * | mmohammadi9812 quit (Ping timeout: 256 seconds) |
18:39:39 | shadowninja55 | oml it worked |
18:40:47 | shadowninja55 | thank you lol |
18:41:03 | shadowninja55 | all i had to do was remove my mingw32 from path since nim already has a mingw64 and the 32 was higher |
18:41:07 | FromDiscord | <krisppurg> is there a way to convert from string to binary? |
18:41:25 | solitudesf | to what? |
18:41:44 | * | pbb quit (Ping timeout: 240 seconds) |
18:42:27 | FromDiscord | <krisppurg> to binary |
18:42:32 | FromDiscord | <krisppurg> binary data string |
18:42:39 | shadowninja55 | manually or with a builtin |
18:42:49 | FromDiscord | <krisppurg> any |
18:43:00 | shadowninja55 | i mean you could iterate the chars |
18:43:01 | solitudesf | and whats wrong with string itself? |
18:43:05 | shadowninja55 | and then extract the bits |
18:43:29 | FromDiscord | <krisppurg> nothing related to above, but I'm sending voice audio data to discord |
18:43:38 | FromDiscord | <krisppurg> which needs to be binary |
18:43:46 | solitudesf | ... |
18:43:47 | FromDiscord | <krisppurg> as final |
18:44:02 | FromDiscord | <krisppurg> hence why I was asking. |
18:44:21 | * | mmohammadi9812 joined #nim |
18:44:43 | FromDiscord | <treeform> @krisppurg its very easy just cast it: `cast[seq[uint8]](yourString)` |
18:44:54 | solitudesf | just send it? |
18:45:34 | FromDiscord | <krisppurg> sending to udp unrelated to my question. |
18:45:34 | FromDiscord | <treeform> string is a seq[char] which is a seq[uint8] |
18:45:36 | * | pbb joined #nim |
18:45:38 | solitudesf | string is just a sequence of bytes, no need to cast anything |
18:45:39 | FromDiscord | <krisppurg> thanks treeform btw |
18:46:29 | FromDiscord | <treeform> I end up casting the strings all the time, as different apis take different signatures for just "buffer" of data. |
18:46:49 | shadowninja55 | is there any way to use gcc/g++ optimization flags with nim? |
18:46:56 | solitudesf | --passC |
18:48:28 | FromDiscord | <treeform> shadowninja55, its really easy, --passC, --passL, or the {.passC.} {.passL.} pragmas... |
18:48:43 | FromDiscord | <treeform> depends if you want compile time or link time optimizations |
18:48:53 | solitudesf | just keep in mind that -d:danger/release already implies -O3 |
18:49:35 | FromDiscord | <krisppurg> I want it to be something like `011001011101` @treeform |
18:50:03 | FromDiscord | <treeform> oh you want to convert it to a string of characters that is 0 and 1s? |
18:50:05 | shadowninja55 | how would i do passC for c++ mode? |
18:50:06 | * | habamax joined #nim |
18:50:16 | FromDiscord | <treeform> passC also works for c++ |
18:50:22 | solitudesf | c means compiler |
18:50:24 | FromDiscord | <treeform> its "pass to compiler" |
18:50:42 | FromDiscord | <krisppurg> yes |
18:50:50 | shadowninja55 | ahh ok |
18:51:03 | FromDiscord | <treeform> so you want some thing like "abc" to turn into "1010001010101100010101" |
18:51:25 | Zoom[m] | PMunch: looks like it's chugging along just fine. Thank you, that's very educational |
18:52:00 | FromDiscord | <krisppurg> yes |
18:52:04 | solitudesf | strutils.toBin |
18:52:58 | PMunch | Zoom[m], no problem, I was just curious if I was using execProcesses right :P |
18:55:02 | FromDiscord | <treeform> @krishass here: https://play.nim-lang.org/#ix=2DAj |
18:55:47 | FromDiscord | <treeform> oh I did not know that toBin takes a param |
18:57:12 | FromDiscord | <treeform> @krisppurg this is probably better https://play.nim-lang.org/#ix=2DAl |
18:57:25 | FromDiscord | <Yardanico> @krisppurg uhh, I don't think you need binary as text representation, do you? |
18:57:35 | FromDiscord | <Yardanico> this is not how voice works |
18:57:44 | FromDiscord | <treeform> that is true |
18:57:52 | FromDiscord | <treeform> you want to cast it the first way |
18:58:00 | FromDiscord | <Yardanico> you transmit bytes themselves, not the binary text representation of them |
18:58:51 | FromDiscord | <treeform> binary text representation is very rare, I never used it for anything. |
18:58:57 | FromDiscord | <krisppurg> https://discord.com/developers/docs/topics/voice-connections#encrypting-and-sending-voice-voice-packet-structure |
18:59:21 | FromDiscord | <Yardanico> yes |
18:59:28 | FromDiscord | <Yardanico> "Binary data" means bytes themselves |
18:59:31 | FromDiscord | <Yardanico> not the text representation of them |
18:59:35 | FromDiscord | <krisppurg> oh? |
18:59:37 | FromDiscord | <treeform> @krisppurg you want to cast it not to text them |
18:59:52 | FromDiscord | <krisppurg> well how am I going to write to stream? |
18:59:58 | FromDiscord | <Yardanico> just write the bytes |
18:59:59 | FromDiscord | <Yardanico> BYTES |
19:00:19 | FromDiscord | <Yardanico> e.g. write for http://nim-lang.github.io/Nim/streams.html |
19:00:21 | FromDiscord | <Yardanico> or writeData |
19:00:25 | FromDiscord | <krisppurg> o |
19:01:11 | FromDiscord | <krisppurg> but what about all together? |
19:02:02 | FromDiscord | <Yardanico> still the same |
19:04:04 | FromDiscord | <treeform> @krisppurg I made binny module that makes this easy: https://play.nim-lang.org/#ix=2DAn |
19:04:15 | FromDiscord | <treeform> this is how you would do the whole packet. |
19:06:52 | * | mmohammadi9812 quit (Ping timeout: 246 seconds) |
19:07:07 | * | mmohammadi9812 joined #nim |
19:10:46 | FromDiscord | <krisppurg> I see `add` being called, what would `audio` would look like? |
19:10:52 | FromDiscord | <treeform> a string |
19:11:01 | FromDiscord | <krisppurg> just string? |
19:11:05 | FromDiscord | <treeform> yeah? |
19:11:08 | FromDiscord | <treeform> packet is also a string |
19:11:13 | FromDiscord | <treeform> its just string & string |
19:11:46 | FromDiscord | <krisppurg> the chunk audio im sending looks something like `÷¸l¶:male_sign:ªù▲§q¸¤↨è:spades:òÞÃ─±` this |
19:11:58 | FromDiscord | <krisppurg> (edit) "`÷¸l¶:male_sign:ªù▲§q¸¤↨è:spades:òÞÃ─±`" => "`÷¸l¶ªù▲§q¸¤↨èòÞÃ─±`" |
19:12:09 | FromDiscord | <treeform> is it encrypted? |
19:12:10 | * | mmohammadi9812 quit (Quit: Quit) |
19:12:12 | FromDiscord | <krisppurg> yes |
19:12:17 | FromDiscord | <treeform> then it should work |
19:12:20 | FromDiscord | <krisppurg> alright |
19:12:32 | FromDiscord | <krisppurg> wait do you mean binary encrypted? |
19:12:45 | FromDiscord | <krisppurg> or just encrypted opus lol |
19:12:52 | FromDiscord | <treeform> opus encodes it? |
19:13:07 | FromDiscord | <treeform> it appears that docs want it also encrypted |
19:13:34 | FromDiscord | <krisppurg> I'm just calling ffmpeg with the options including the codec being opus |
19:13:38 | FromDiscord | <treeform> I made the `hexPrint` functions which makes working with binary data easier: `flatty/hexprint` |
19:13:48 | FromDiscord | <krisppurg> (edit) "I'm just calling ffmpeg with ... the" added "file as input and" |
19:13:55 | FromDiscord | <treeform> usually if you print binary data it looks like this `÷¸l¶ªù▲§q¸¤↨èòÞÃ─±` |
19:14:24 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=2DAq |
19:14:52 | FromDiscord | <treeform> I work a lot with binary data |
19:15:46 | FromDiscord | <treeform> It says at the top "Voice encryption uses the key passed in Opcode 4 Session Description and the nonce formed with the 12 byte header appended with 12 null bytes to achieve the 24 required by xsalsa20_poly1305. Discord encrypts with the libsodium encryption library." |
19:15:54 | FromDiscord | <treeform> I don't know if `ffmpeg` did that for you. |
19:16:27 | FromDiscord | <treeform> you might need to run it through some thing like `libsodium`... you will need to do your own research. |
19:16:51 | FromDiscord | <krisppurg> nah I've got that covered |
19:17:11 | FromDiscord | <treeform> good luck then! |
19:17:15 | FromDiscord | <krisppurg> I am using libsodium |
19:17:18 | FromDiscord | <treeform> cool |
19:17:54 | FromDiscord | <krisppurg> on writeUint8, it expects two parameters I only put `0x80` |
19:18:32 | * | mmohammadi9812 joined #nim |
19:18:34 | habamax | exit |
19:18:38 | * | habamax quit (Quit: leaving) |
19:20:15 | FromDiscord | <treeform> @krisppurg sorry I typed, please use add instead of write: https://play.nim-lang.org/#ix=2DAt |
19:21:19 | FromDiscord | <treeform> @krisppurg full api here: https://github.com/treeform/flatty |
19:22:49 | FromDiscord | <krisppurg> i've looked through the repo and code when you first mentioned ur lib |
19:23:57 | ForumUpdaterBot | New thread by Snej: Any workarounds for view-object bugs?, see https://forum.nim-lang.org/t/7061 |
19:31:35 | * | mbomba joined #nim |
19:32:43 | * | leorize quit (Ping timeout: 240 seconds) |
19:35:17 | FromGitter | <bung87> @PMunch please merge my two PRs |
19:36:53 | PMunch | Sorry ,did you address my comments already? |
19:38:19 | * | shadowninja55 quit (Quit: Connection closed) |
19:39:57 | FromGitter | <bung87> I think i take carefully,think seriously. |
19:41:32 | PMunch | Huh? |
19:43:56 | bung | which one ? I commented them all. |
19:47:26 | * | brainproxy joined #nim |
19:53:05 | * | astronavt quit (Quit: Leaving) |
20:01:59 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
20:11:11 | * | lmariscal quit (Quit: I'm Out!) |
20:12:24 | * | leorize joined #nim |
20:14:19 | * | lmariscal joined #nim |
20:37:09 | * | natrys quit (Quit: natrys) |
21:02:26 | * | narimiran quit (Ping timeout: 264 seconds) |
21:06:43 | * | leorize quit (Ping timeout: 240 seconds) |
21:14:57 | * | kinkinkijkin quit (Remote host closed the connection) |
21:29:45 | * | PMunch quit (Quit: leaving) |
21:38:23 | FromDiscord | <dom96> Today's MVP, iffy, https://github.com/nim-lang/nimble/pull/871 |
21:38:24 | disbot | ➥ Simpler GitHub Actions CI |
21:43:10 | * | lritter quit (Quit: Leaving) |
21:45:19 | * | leorize joined #nim |
21:49:29 | * | mbomba quit (Quit: WeeChat 2.9) |
21:55:23 | * | pbb quit (Quit: No Ping reply in 180 seconds.) |
21:56:49 | * | pbb joined #nim |
21:57:11 | FromDiscord | <alehander42> oi |
21:58:23 | * | leorize quit (Ping timeout: 240 seconds) |
22:00:05 | FromDiscord | <Daniel> oi |
22:00:40 | * | leorize joined #nim |
22:03:10 | * | Vladar quit (Quit: Leaving) |
22:06:59 | * | guelosk[m] joined #nim |
22:20:53 | * | sagax joined #nim |
22:22:57 | * | solitudesf quit (Ping timeout: 260 seconds) |
22:26:23 | * | opal quit (Ping timeout: 240 seconds) |
22:28:28 | * | opal joined #nim |
22:32:28 | FromDiscord | <emizzle> sent a code paste, see https://play.nim-lang.org/#ix=2DBF |
22:32:35 | FromDiscord | <emizzle> (edit) |
22:35:28 | * | NimBot joined #nim |
22:35:43 | FromDiscord | <ElegantBeef> @emizzle I believe this speaks to that https://github.com/nim-lang/RFCs/issues/250 |
22:35:44 | disbot | ➥ Type checking for nil dereference: nilable and not-nilable types ; snippet at 12https://play.nim-lang.org/#ix=2w7D |
22:40:17 | * | tane quit (Quit: Leaving) |
22:42:28 | jonjitsu[m] | Anyone have handy a library that does http requests which provides both async and synchronous APIs that I can check out? |
22:42:44 | mipri | std/httpclient does that |
22:45:17 | jonjitsu[m] | thx |
23:06:35 | FromDiscord | <alehander42> oh yeah |
23:06:54 | FromDiscord | <alehander42> i think i tried to get a day off |
23:07:03 | FromDiscord | <alehander42> my work next week |
23:07:05 | FromDiscord | <alehander42> for that |
23:07:17 | FromDiscord | <alehander42> task eventually(and other stuff) |
23:18:57 | * | xace quit (Ping timeout: 260 seconds) |
23:22:38 | ForumUpdaterBot | New thread by DataPulverizer: Issue with compile time evaluation, see https://forum.nim-lang.org/t/7062 |
23:35:45 | * | xace joined #nim |
23:36:20 | FromDiscord | <nikki> the elems of any type `openArray` matches are always guaranteed to be contiguous in memory right? so that i could pass the `addr` of the first elem along with a length to pass things to C |
23:37:03 | FromDiscord | <ElegantBeef> Do sequences take up contiguous memory? 😄 |
23:37:10 | FromDiscord | <nikki> yup |
23:37:13 | FromDiscord | <ElegantBeef> Then yep |
23:37:34 | FromDiscord | <nikki> cool that works out nicely |
23:37:45 | FromDiscord | <ElegantBeef> Openarray only covers seqs and arrays, one of which is compiletime constant size so I can say i know that's in order like ducks |
23:38:00 | FromDiscord | <nikki> so far `openArray` just seems to match arrays and seqs, but i was wondering if that was sth to assume in all types it's meant to match if that evolve in the future. probs don't need to worry about that for now lol |
23:38:25 | FromDiscord | <ElegantBeef> It's just a generic so you dont have a proc that takes just `array[3, T]` or /we |
23:38:50 | FromDiscord | <ElegantBeef> I dont imagine it'd ever get any other data type |
23:38:56 | FromDiscord | <nikki> i think it's technically a view type |
23:39:23 | FromDiscord | <nikki> so you can def a local var that's an openarray viewing something else. tho that's in the experimental view stuff only for now 🤔 |
23:39:30 | FromDiscord | <nikki> it's really neat that it exists tho bc. that's definitely a pain point in other langs |
23:39:46 | FromDiscord | <nikki> they either don't have anything like this at all or have slices but slices are also distinct objects and not just views and it gets weird |
23:40:01 | FromDiscord | <ElegantBeef> Yea C# used an IEnumerable interface for supporting all collections |
23:40:19 | FromDiscord | <nikki> ah yeah; that's also probably different bc. it only is about satisfying an iterable concept rather than a mem layout one |
23:40:25 | FromDiscord | <ElegantBeef> Didnt feel right as it supports lists/dicts/ anything that can be iterated |
23:40:42 | FromDiscord | <nikki> like i'm guessing that it's just about returning an iterator that supports next, maybe prev, and get current elem, right? |
23:40:48 | FromDiscord | <ElegantBeef> Yea |
23:40:53 | FromDiscord | <ElegantBeef> It's for `foreach` iteration |
23:41:04 | FromDiscord | <ElegantBeef> I dont think there is a single array/list abstraction there |
23:42:24 | FromDiscord | <nikki> yeah i think when you want some amt of generic but also don't want memory spaghetti it helps to have an openArray-ish type |
23:42:25 | FromDiscord | <nikki> thx nim! |
23:42:40 | disruptek | c# is for racists. |
23:43:30 | FromDiscord | <ElegantBeef> Indeed, i've started a `C# -> Nim` article on dev.to since I know C# pretty well, to try to aid transitioning from C#. |
23:45:02 | mipri | is there a shortcut for "<some unicode char>".runeAt(0) ? |
23:59:31 | * | opal quit (Remote host closed the connection) |