00:00:29 | * | azimut quit (Ping timeout: 255 seconds) |
00:17:15 | NimEventer | New thread by guzba: Default object values behavior, see https://forum.nim-lang.org/t/11013 |
00:19:11 | FromDiscord | <makoren> downloading the zip file for x64 windows binaries seems suspicious, windows defender says its a trojan |
00:19:49 | FromDiscord | <makoren> also cant run certutil on it without it breaking and saying it's found a virus |
00:20:50 | FromDiscord | <guzba8> huge efforts have gone into trying to get that not to happen for some time now, however in the end windows defender seems to be unwilling to not do these things to nim |
00:21:14 | FromDiscord | <guzba8> sadly there is no "im not malware" flag to add to the download |
00:38:31 | FromDiscord | <soup> sent a code paste, see https://play.nim-lang.org/#pasty=CqgQIUtnHYPX |
00:40:32 | FromDiscord | <soup> when i try to print to terminal second object always undefined but it is defined in javscript |
00:41:29 | FromDiscord | <Elegantbeef> Did you just disregard what I said? |
00:41:38 | FromDiscord | <soup> it did not work |
00:43:23 | FromDiscord | <soup> Error\: undeclared identifier\: 'Type |
00:43:55 | FromDiscord | <soup> if i put `ref object` i get Error\: undeclared field\: 'relatesTo' |
01:03:32 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "the logic should be": Yeah, makes sense to me! |
01:05:46 | FromDiscord | <Elegantbeef> soup the `Type` in my example was for you to replace with the actual type |
01:06:21 | FromDiscord | <soup> i tried replacing with ref object but it not work |
01:10:29 | FromDiscord | <Elegantbeef> I guess you cannot wrap the `m.relateTo` without a getter/setter |
01:10:30 | FromDiscord | <Elegantbeef> It's a dumb field name anyway |
01:10:46 | FromDiscord | <soup> that is how the library does it |
01:13:23 | FromDiscord | <Elegantbeef> You can do `type MyType = distinct JsObject` from JsFFI to wrap this |
01:13:45 | FromDiscord | <Elegantbeef> But Nim does field access properly so it's `a.b` not `a[b]` |
01:18:07 | FromDiscord | <soup> thank you i try now |
01:28:42 | FromDiscord | <soup> i try `type Content = distinct JsObject`but this `var a = event.content.`"m.relates\_to"\`\` give error undeclared field |
01:29:00 | FromDiscord | <Elegantbeef> Right you'll want to use properties if you want it statically typed |
01:29:11 | FromDiscord | <Elegantbeef> If you don't care about static typing just use `JsObject` |
01:29:23 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/manual.html#procedures-properties |
01:35:49 | FromDiscord | <soup> i give up now |
01:35:51 | FromDiscord | <soup> thank you |
01:35:53 | FromDiscord | <soup> i try later |
01:37:28 | FromDiscord | <soup> 再见 朋友 |
01:50:51 | FromDiscord | <girvo> the nim-lang.org VSCode extension + nimlangserver is so much nicer. I'm impressed |
02:03:25 | FromDiscord | <sirius_3x> is there a specific pragma to tell the compiler to unwrap/unroll a loop? |
02:03:35 | FromDiscord | <Elegantbeef> Nope |
02:03:50 | FromDiscord | <sirius_3x> probably have to use templates for something like that? |
02:04:03 | FromDiscord | <Elegantbeef> Macros, but yea |
02:04:14 | FromDiscord | <sirius_3x> In reply to @Elegantbeef "Macros, but yea": oh right, yea. ok thanks |
02:04:17 | FromDiscord | <Elegantbeef> https://stackoverflow.com/a/74077789/15200657 |
02:08:48 | FromDiscord | <girvo> sent a code paste, see https://play.nim-lang.org/#pasty=luJBvafIxMPA |
02:10:08 | FromDiscord | <Elegantbeef> False errors are quite common |
02:24:23 | FromDiscord | <girvo> Oh goody |
02:24:46 | FromDiscord | <girvo> Is there a `# nimsuggest ignore-errors` comment hint thing? |
02:24:54 | FromDiscord | <girvo> (I couldn't find one, I did look) |
02:25:08 | FromDiscord | <odexine> False errors can pop up and disappear on any part of code |
02:25:19 | FromDiscord | <girvo> cool lol |
02:25:32 | FromDiscord | <girvo> Are they from nimsuggest or from nimlangserver? |
02:25:38 | FromDiscord | <girvo> The error suggest (lel) the former |
02:25:40 | FromDiscord | <odexine> Suggest |
02:25:42 | FromDiscord | <Elegantbeef> Closest you get is `when not defined(nimsuggest)` |
02:26:27 | FromDiscord | <girvo> We didn't have these false errors previously, I'm guessing because we were running an older version or something? nimsuggest would mostly just shit the bed and die lol |
02:38:41 | FromDiscord | <girvo> sent a code paste, see https://play.nim-lang.org/#pasty=keuQnYzPwOYK |
02:54:14 | FromDiscord | <zumi.dxy> lmao |
03:39:42 | * | lx12ucy_ joined #nim |
03:52:48 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#pasty=ICfLPImwSHAX |
03:55:22 | * | lx12ucy_ quit (Ping timeout: 246 seconds) |
03:57:45 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#pasty=TabgYarXVESb |
04:02:03 | FromDiscord | <Elegantbeef> The answer is you cannot |
04:03:04 | FromDiscord | <user2m> In reply to @Elegantbeef "The answer is you": hmm bit of an odd qurik then |
04:35:31 | FromDiscord | <janakali> sent a code paste, see https://play.nim-lang.org/#pasty=OogbBrCmwvMf |
04:35:46 | FromDiscord | <janakali> (edit) "https://play.nim-lang.org/#pasty=AihWMArCUCav" => "https://play.nim-lang.org/#pasty=uNHnVxrMnpcn" |
04:36:17 | FromDiscord | <janakali> (edit) "https://play.nim-lang.org/#pasty=cmIIXaAjrlsa" => "https://play.nim-lang.org/#pasty=uBXgeUWHRhYW" |
04:38:00 | * | lx12ucy quit (Quit: WeeChat 4.2.1) |
04:38:50 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#pasty=JsITFEbQiESt |
04:51:15 | FromDiscord | <janakali> In reply to @user2m "lol a surprisingly ugly": If you're not allergic to macros you can use this instead: https://github.com/nim-lang/Nim/issues/21327#issuecomment-1416489029 |
04:55:27 | FromDiscord | <Elegantbeef> A weapon for a more civilized time |
04:58:50 | * | Jjp137 quit (Quit: Leaving) |
05:03:52 | FromDiscord | <jviega> Eh, Nim has plenty of ugly edges that are pretty well hidden by the pythonesque facade 🙂 |
05:04:56 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#pasty=vUZdWTZqqBpQ |
05:08:22 | * | krux02 quit (Remote host closed the connection) |
05:16:55 | * | Jjp137 joined #nim |
05:34:01 | FromDiscord | <user2m> sent a code paste, see https://play.nim-lang.org/#pasty=RAbIMVeAhJsw |
05:44:14 | FromDiscord | <aryzen> Hello! I just discovered Nim a couple days ago and now I'm trying it out! I hope to get to know everyone and see if the language is a good fit for me! |
06:16:59 | FromDiscord | <ayex> welcome [aryzen](https://matrix.to/#/%40_discord_298392862305812480%3At2bot.io) , enjoy! 🙂 |
06:38:26 | NimEventer | New thread by undefined: Resources for Web Authentication, see https://forum.nim-lang.org/t/11015 |
06:55:03 | * | GreaseMonkey quit (Remote host closed the connection) |
06:55:27 | * | greaser|q joined #nim |
06:56:33 | * | junaid_ joined #nim |
07:07:04 | * | advesperacit joined #nim |
07:09:25 | FromDiscord | <Phil> In reply to @aryzen "Hello! I just discovered": cheers! |
07:10:50 | FromDiscord | <penguinite> In reply to @aryzen "Hello! I just discovered": Good luck, and remember that you can always ask for help here if you need to. |
07:12:43 | * | rockcavera quit (Remote host closed the connection) |
07:20:25 | * | PMunch joined #nim |
07:30:51 | FromDiscord | <Robyn [She/Her]> Nim can output JSON for docs, right? |
07:31:49 | FromDiscord | <Robyn [She/Her]> Found it! |
07:46:07 | PMunch | It's not perfect, but it is pretty good |
07:52:31 | * | dtomato quit (Ping timeout: 256 seconds) |
07:52:35 | * | dtomato1 joined #nim |
08:01:17 | FromDiscord | <aryzen> Thank you for the welcome! I’ll turn up tomorrow to ask some questions while I work on something simple to get acquainted |
08:01:39 | FromDiscord | <aryzen> (A question, how do discord users appear to IRC users?) |
08:03:33 | FromDiscord | <Elegantbeef> https://irclogs.nim-lang.org/ |
08:08:50 | PMunch | (Unless you have a script running in your IRC client which does something else) |
08:09:11 | PMunch | I have one which strips nicknames from the FromDiscord part for example |
08:09:17 | PMunch | So you appear like normal users |
08:09:55 | * | ntat joined #nim |
08:10:54 | FromDiscord | <Elegantbeef> I find it hard to believe I appear normal |
08:22:34 | Amun-Ra | but from what I know we see here different names that they are displayed on discord, right? |
08:43:25 | * | azimut joined #nim |
08:55:53 | PMunch | Ah yes, I think we see the actual nick and not the display name |
08:55:53 | * | arkanoid quit (Ping timeout: 260 seconds) |
08:55:56 | PMunch | Or something like that |
08:58:01 | * | redj quit (Ping timeout: 264 seconds) |
08:58:04 | * | junaid_ quit (Remote host closed the connection) |
08:59:04 | * | redj joined #nim |
09:09:07 | FromDiscord | <nnsee> yeah, username vs display name |
09:09:16 | FromDiscord | <nnsee> they're usually different |
09:10:04 | PMunch | Luckily pinging still works, but that might be a bridge thing @nnsee |
09:10:41 | PMunch | Sorry for highlighting you, just wanted to show that it worked |
09:11:14 | FromDiscord | <nnsee> yeah, I think the bridge corrects the mentions to point to the actual user |
09:11:42 | FromDiscord | <nnsee> generally just doing @whateverusername, if you're sending a raw message, won't trigger the mention and is just printed as text |
09:11:50 | FromDiscord | <nnsee> so the bridge must be doing _something_ |
09:13:26 | PMunch | Ah right, makes sense |
09:13:43 | Amun-Ra | nice |
09:13:47 | PMunch | On IRC you're highlighted as long as your name appears, even in a link like a GitHub link |
09:14:26 | Amun-Ra | that depends on the client |
09:14:30 | PMunch | And nicks auto-complete with tab in my HexChat client. So I've set up my Discord-nick-fixer script to add a @ before all usernames |
09:14:40 | PMunch | Of course, everything in IRC depends on the client |
09:14:43 | Amun-Ra | ;) |
09:15:06 | Amun-Ra | https://local.host/PMunch/text.txt |
09:15:17 | Amun-Ra | PMunch: did that triggered? |
09:15:23 | PMunch | Yup |
09:15:26 | Amun-Ra | hmm |
09:16:02 | * | azimut quit (Remote host closed the connection) |
09:16:35 | * | azimut joined #nim |
09:19:58 | FromDiscord | <nnsee> yeah I used to spend most of my day on IRC |
09:20:23 | FromDiscord | <nnsee> these days, especially on mobile, discord and whatever chats are just more comfortable to use unfortunately |
09:20:42 | Amun-Ra | if only I could connect to discord from cli |
09:21:00 | FromDiscord | <Elegantbeef> There is probably a third party cli client |
09:21:08 | Amun-Ra | there were 3rd party discord clients but the discord said nah-ah |
09:21:41 | FromDiscord | <Elegantbeef> Insert inane ramblings about matrix here |
09:21:46 | Amun-Ra | ;) |
09:22:00 | PMunch | My Element/Matrix is so slow though.. |
09:22:07 | PMunch | I think it might be my home server.. |
09:22:25 | FromDiscord | <Elegantbeef> There is that whole sliding sync that'll be rolling out |
09:22:59 | Amun-Ra | my aruba vps is lagging since a few months, they really want me to migrate from that cheap plan… ;) |
09:23:33 | Amun-Ra | …to a point it often eats letters I type |
09:24:57 | FromDiscord | <Robyn [She/Her]> In reply to @Amun-Ra "there were 3rd party": Iirc Discordo is one that still works |
09:25:41 | FromDiscord | <Robyn [She/Her]> https://github.com/ayn2op/discordo @Amun-Ra |
09:26:09 | FromDiscord | <Elegantbeef> Bleh no point using any of these third party clients if discord can just say "No" |
09:27:09 | Amun-Ra | Robyn: yes, but it's agains tos and they may activate that ban hammer that's hanging above your head ;) |
09:27:27 | FromDiscord | <zumi.dxy> man that client looks like a dream |
09:27:52 | PMunch | Yeah the single company being able to ban you threat isn't great |
09:29:08 | FromDiscord | <Elegantbeef> This just in "Centralisation is bad" 😛 |
09:29:24 | FromDiscord | <Robyn [She/Her]> In reply to @Amun-Ra "Robyn: yes, but it's": True |
09:29:33 | PMunch | On the other hand it means spamming is harder |
09:29:36 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "This just in "Centralisation": It isn't :P |
09:29:42 | PMunch | So it's a double edged sword.. |
09:29:49 | FromDiscord | <Elegantbeef> It very much is bad |
09:29:56 | FromDiscord | <Robyn [She/Her]> In reply to @PMunch "On the other hand": Matrix had a moderator's guilt type thing |
09:30:02 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "It very much is": I meant it is, sorry |
09:30:10 | FromDiscord | <Robyn [She/Her]> I need to read over what I type better |
09:30:20 | FromDiscord | <Robyn [She/Her]> In reply to @chronos.vitaqua "Matrix had a moderator's": Guild |
09:30:27 | PMunch | @Robyn_[She/Her], moderators guilt thing? |
09:30:31 | PMunch | Ah :P |
09:30:43 | FromDiscord | <Robyn [She/Her]> Yeah, I make a lot of typos |
09:30:53 | FromDiscord | <Elegantbeef> You say it has less spam but discord still has a fair bit of spam |
09:30:59 | FromDiscord | <nnsee> moderator's guilt. where all of the faces you ban during the day come back to haunt you |
09:31:08 | FromDiscord | <Elegantbeef> So it's just a side effect of public servers |
09:31:12 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "You say it has": Oh it definitely does, it's not moderated enough |
09:31:49 | * | jmdaemon joined #nim |
09:32:00 | FromDiscord | <Elegantbeef> I do think one could add a spam protection feature on a homeserver |
09:32:03 | PMunch | @Elegantbeef, I'd say 98% of the spam in the Nim community comes from Matrix |
09:32:21 | FromDiscord | <Elegantbeef> Sure but discord tends towards DM spam |
09:32:21 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "So it's just a": Hence why something like a shared ban list is a good idea, though I think that someone should need to either do something very heinous or be banned in multiple servers for the ban to be globally banned on all servers that use the system |
09:32:25 | FromDiscord | <Robyn [She/Her]> ^^^ |
09:32:28 | PMunch | And that is *after* we added the Mjolnir antispam thing |
09:32:36 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Sure but discord tends": Used to have a problem with that a while ago |
09:32:41 | PMunch | Ah right, for some reason I never get those.. |
09:33:04 | FromDiscord | <Robyn [She/Her]> It's odd :p |
09:33:20 | PMunch | I might not be active enough |
09:33:45 | FromDiscord | <Elegantbeef> Well a shared ban list is a bit of a joke |
09:33:46 | FromDiscord | <Elegantbeef> The homeserver can just cool down/ban people for sending spam |
09:33:46 | FromDiscord | <Elegantbeef> If I send a message that is 99% similar in a large number of matrix rooms I'm probably not a human |
09:34:21 | PMunch | Fair |
09:34:38 | PMunch | At least if the message is longer than some set of characters, or sent very quickly |
09:34:43 | FromDiscord | <Elegantbeef> This falls apart if you run your own spam homeserver |
09:34:50 | FromDiscord | <Elegantbeef> But that's an easy block |
09:36:12 | FromDiscord | <Elegantbeef> We can always look at email though for whether centralisation stops spam 😛 |
09:36:38 | FromDiscord | <Elegantbeef> There are like what 4 email services being used nowadays, and spam is still prevalent |
09:38:12 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Well a shared ban": Eh, imo it'd work well for communities specifically made for groups that are discriminated against commonly |
09:39:03 | FromDiscord | <Elegantbeef> I mean sure any cesspools generally should be blocked from a homeserver |
09:39:20 | FromDiscord | <nnsee> In reply to @Elegantbeef "There are like what": i mean |
09:39:23 | FromDiscord | <nnsee> to be fair here |
09:39:39 | FromDiscord | <nnsee> my hmail accounts pretty much never get spam in inbox |
09:39:45 | FromDiscord | <nnsee> gmail even |
09:40:08 | FromDiscord | <Elegantbeef> Yea depends on how dumbly you were with your email 😄 |
09:40:34 | FromDiscord | <Elegantbeef> If your email finds it's way on a spam list, you're done! |
09:41:04 | FromDiscord | <nnsee> the one i've had for ages now (literally my first gmail account) gets quite a lot of spam, 10-20 emails a day, but it almost always ends up in my spambox |
09:41:32 | FromDiscord | <Elegantbeef> After saying that cesspool think I'm sorta surprised fourthrie.ch is not a registered domain 😛 |
09:41:38 | FromDiscord | <nnsee> the one exception i can think of is when someone used google's own services to trigger an email sent to me with spam content |
09:41:51 | FromDiscord | <Elegantbeef> Someone needs to pick that up and make it the most anti-nazi website |
09:41:54 | FromDiscord | <nnsee> i think it was via google sheets edit requests or something? |
09:42:11 | FromDiscord | <nnsee> probably because it's reich not riech |
09:42:39 | FromDiscord | <nnsee> but that doesn't seem Alice either |
09:42:41 | FromDiscord | <nnsee> Alice, even |
09:42:42 | FromDiscord | <Elegantbeef> Hey it's 2\:30 and you expect me to spell words properly |
09:42:49 | FromDiscord | <nnsee> god damn it autocorrect |
09:43:02 | FromDiscord | <Elegantbeef> Damn wonderland |
09:44:03 | Amun-Ra | Alice? |
09:44:21 | FromDiscord | <Elegantbeef> I was just going to jokingly say I don't think any users with `@fourthrei.ch` in their name would be worth talking to, but had to make sure that wasn't a real domain |
09:44:35 | Amun-Ra | ;) |
09:44:53 | FromDiscord | <Elegantbeef> Yea I do not know what word fits where Alice sits |
09:45:05 | FromDiscord | <Elegantbeef> alive? |
09:45:58 | FromDiscord | <Elegantbeef> Oh wait it is registered |
09:46:50 | Zevv | PMunch: how did our session sink in overnight for you |
09:47:12 | Amun-Ra | speaking of these kinds of domains: the chemistry institute of jagiellonian university in cracow had domain ch.uj.edu.pl (ch - chemistry, uj - jagiellonian university); the problem is ch.ujk in polish is di.ck (in the most derogatory form) |
09:47:28 | Amun-Ra | ch.uj* |
09:47:33 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "I mean sure any": Oh definitely, but abuse prevention is needed |
09:48:18 | FromDiscord | <Elegantbeef> I don't see how you can do prevention in a decentralised platform |
09:48:28 | FromDiscord | <Elegantbeef> Ostensibly everything should be whitelisted at the start |
09:48:50 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "I don't see how": Was referencing a shared banlist type thing |
09:48:56 | FromDiscord | <Elegantbeef> As time goes on you do create a blacklist of servers |
09:49:21 | Amun-Ra | if I have a proc with static bool and when statement inside its body, amd I right thinking nim actually creates two separate C functions? |
09:49:24 | FromDiscord | <Elegantbeef> Well that's more intervention than prevention, but tomato potato |
09:49:30 | FromDiscord | <Elegantbeef> Yes |
09:49:49 | FromDiscord | <Elegantbeef> Static parameters are monomorphically instantiated just as generic parameters |
09:49:49 | Amun-Ra | thanks |
09:50:48 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/blob/91efa49550b377e677cb0ff0d10e0c1192955b63/tests/statictypes/tstaticprocparams.nim |
09:50:53 | FromDiscord | <Elegantbeef> It's a fun example of the rabbit hole you can go |
09:50:58 | FromDiscord | <Elegantbeef> Atleast in devel 😉 |
09:52:36 | Amun-Ra | ;) |
09:54:50 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Well that's more intervention": Fair, but yeah that's how it should ideally be done |
09:57:11 | FromDiscord | <Elegantbeef> Sure we don't disagree but when talking about spammers a banlist does not work, the homeserver needs to just prevent repeat events in different rooms |
09:57:12 | FromDiscord | <Elegantbeef> The commenting about it being a joke was in response to spammers |
09:57:12 | FromDiscord | <Elegantbeef> You don't need a ban list if you get banned on your own homeserver 😄 |
09:57:46 | PMunch | Zevv, well I was working until 11PM last night, so haven't had a ton of time to think about it. |
09:58:01 | PMunch | But one thought struck me, this could replace something like FreeRTOS right? |
09:58:10 | FromDiscord | <Robyn [She/Her]> In reply to @Elegantbeef "Sure we don't disagree": Yeah I understand that |
09:58:30 | FromDiscord | <Robyn [She/Her]> Hm, I wonder if that would be better as something integrated into the server or as an appservice |
09:58:33 | PMunch | I mean these RTOSes are basically your typical OS task scheduling, but with the ISR based CPS stuff you showed me none of that would be necessary |
09:58:37 | FromDiscord | <Robyn [She/Her]> Or a bot |
09:58:38 | PMunch | No more guessing stack sizes |
09:59:11 | FromDiscord | <Elegantbeef> I don't know if Bots or AppServices get full access to public server events |
09:59:21 | FromDiscord | <Elegantbeef> I also don't know why I capitalised how I did |
09:59:27 | Zevv | PMunch: well, 'replace' is quite a thing. |
09:59:37 | Zevv | but it's a viable alterantive for a lot of cases I think |
10:00:03 | Zevv | you know, under the hood the stuff that runs is not different from a handful of small ISR handlers |
10:00:11 | Zevv | it's just that you don't have to write the spaghetti yourself |
10:00:38 | Zevv | but it will not bring you things like process priorities and paralellism just like that |
10:00:57 | Zevv | although this would be pretty much "trivial" to add. |
10:01:17 | Zevv | and like I said, the nice thing is that there is no magic scheduling CPU architectural specific stuff under the hood. It's just Nim. |
10:01:25 | Zevv | so it's hyper portable. |
10:03:28 | Zevv | also, the way I built the demo to be strictly ISR driven might not be the right model of course. you might as well run this safely from normal CPU context instead. |
10:04:24 | Zevv | a model i sometimes use is to put the CPU to sleep the normal way, and have interrupts enable. My main loop does a quick poll of the global interrupt status registers to see which ISRs fired and then runs what needs to be done to service that, and go back to sleep. So it's interrupt driven, but without ISRs |
10:05:29 | PMunch | Yeah of course not, you'd still need to implement some kind of scheduler |
10:05:43 | Zevv | exactly. |
10:06:11 | PMunch | But you could build all that on top of CPS, instead of having to use ISR to do context switching the old fashioned way |
10:07:12 | PMunch | Zevv, right with that architecture you could easily decide which task has the highest priority |
10:10:20 | PMunch | Just a thing about the limitations though, how do you know if you violate any of them? |
10:10:38 | PMunch | Are there errors thrown at compile-time, or do you just get sub-optimal behaviour |
10:11:18 | Zevv | good questions. |
10:11:43 | Zevv | and of course, you can prioritize. If there are X tasks suspended and Y is happening, it's up to your scheduler to figure out which one to resume first |
10:12:08 | Zevv | the real-time behavior will never be as strict as old fashion ISRs of course |
10:12:15 | Zevv | since there is no reentrancy. |
10:12:34 | Zevv | but it's not black and white. You can easily mix and match. No reason *not* to have ISRs and tasks |
10:12:35 | PMunch | Hmm, what do you mean by that? |
10:12:53 | Zevv | with normal ISRs your main code is interrupted whatever it's doing and your ISR runs |
10:13:04 | PMunch | Yeah |
10:13:11 | Zevv | so you have hard real time semantics - you can guarentee your code runs withing 1 uS of the event happening |
10:13:14 | Zevv | that's what interrupts do |
10:13:24 | PMunch | Sure |
10:13:36 | Zevv | but like I said, one does by no means exclude the other |
10:13:54 | Zevv | it's all small and very non-intrusive |
10:13:57 | PMunch | But what did you mean by reentrancy? |
10:14:12 | Zevv | like true multitastking |
10:14:24 | Zevv | task A is doing something stupid and spins but B still gets to run |
10:15:19 | PMunch | Ah right |
10:15:24 | Zevv | which is a nice feature but a pain to deal with because you get into all the normal problems with exclusion and locking and data races and what more |
10:15:32 | PMunch | Yeah I guess this is slightly more cooperative |
10:15:53 | PMunch | Although with the control-flow slicing you'd have to do something really stupid to not trigger a CPS breakpoint |
10:16:43 | Zevv | well, beware that CPS will only slice when there is a CPS call in your code |
10:16:56 | Zevv | so if you make a tight loop for(volatile int i =0; i <1e9; i++) |
10:17:00 | Zevv | CPS will not break that for you |
10:17:09 | Zevv | for those cases it's trivial to make a yield() though |
10:17:27 | Zevv | which is basically a cpsMagic that will stash the task in the pool |
10:17:31 | Zevv | where it will be picked up "later" |
10:17:56 | PMunch | Wait, only when there is a CPS call? |
10:18:03 | Zevv | right. that's by design. |
10:18:15 | Zevv | you are in control of where you suspend |
10:18:23 | PMunch | Right, the graphic you shared made it seem like it sliced on every control flow boundary |
10:18:42 | Zevv | good point, maybe we need to make that more explicit. |
10:18:51 | Zevv | it *used* to be like that tho |
10:18:59 | PMunch | Aah, right |
10:48:12 | * | ntat quit (Quit: Leaving) |
11:13:35 | FromDiscord | <arnetheduck> for anyone contributing to impactful open source projects on github, you're eligible to participate in launch of one of the more serious zkvm projects of this year: https://provisions.starknet.io/ |
11:27:14 | FromDiscord | <odexine> Not sure what this means for us |
11:44:31 | PMunch | @odexine, I think it was more of a "if you contribute to other projects" kind of notice |
11:44:42 | PMunch | The last category: "You made at least three commits to a repository that is one of the top 5,000 repositories worldwide, ranked by number of stars, before November 15th, 2023. At least one of these commits occurred during 2018 or later." |
11:45:23 | FromDiscord | <odexine> I mean more of “yeah, and?” kind of question but put more nicely (I’m not that good at putting things nicely) |
11:45:41 | PMunch | Hmm, apparently I'm eligible |
11:45:48 | PMunch | Not quite sure why :P |
11:50:45 | Zevv | "Congratulations!" |
11:52:33 | Zevv | PMunch: do you copilot |
11:53:22 | PMunch | Nope, I prefer to get a normal seat when I'm out flying |
11:53:55 | Zevv | fair enough. |
11:54:34 | PMunch | Besides, I don't have a pilot license, so I doubt they'd allow me up there anyways |
11:55:01 | * | jmdaemon quit (Ping timeout: 264 seconds) |
11:59:07 | FromDiscord | <nnsee> In reply to @arnetheduck "for anyone contributing to": what is a zkvm |
12:04:38 | FromDiscord | <arnetheduck> In reply to @nnsee "what is a zkvm": a zero-knowledge virtual machine - executes code and at the same time generates a zero-knowledge proof that the code was not manipulated and that execution carried out according to the code -> users can verify for example that a transaction was carried out correctly -> you can outsource code execution to others and trust that the result was not manipulated (and prove it to others without revealin |
12:06:35 | FromDiscord | <nnsee> interesting |
12:19:11 | PMunch | Anyone have a more elegant way of doing this? https://play.nim-lang.org/#pasty=EgwepUgOihtO |
12:40:10 | FromDiscord | <odexine> In reply to @arnetheduck "a zero-knowledge virtual machine": Is the proof generated using energy wastage? |
12:40:57 | FromDiscord | <odexine> Or rather just how is it made |
12:41:31 | FromDiscord | <odexine> Well actually duh never mind, zero knowledge so it’s different from usual |
12:42:41 | Zevv | i have zero knowledge |
12:45:49 | FromDiscord | <odexine> At least it’s just zero, I got it in the negatives… |
12:49:01 | FromDiscord | <Robyn [She/Her]> Underflow go brrrr |
12:59:48 | PMunch | Laughs in Ghandi nukes |
13:00:32 | FromDiscord | <Robyn [She/Her]> That's actually just a meme that went viral, apparently dev of the game said that bug isn't even possible |
13:05:02 | PMunch | Haha, yeah I just read up on the Wikipedia article |
13:05:17 | PMunch | Still a very iconic example of integer underflow, true or otherwise |
13:05:58 | FromDiscord | <Robyn [She/Her]> Oh yeah definitely |
13:06:08 | FromDiscord | <Robyn [She/Her]> Look at pacman for the effects of integer overflow :P |
13:06:13 | FromDiscord | <Robyn [She/Her]> Level 256 go brrrr |
13:06:33 | FromDiscord | <Robyn [She/Her]> Also the original mario on the NES for the minus levels |
13:06:45 | FromDiscord | <Robyn [She/Her]> And I thiiink Mario 3 for OOB memory access |
13:28:53 | PMunch | Or the Pokemon missingo |
13:29:33 | PMunch | Not technically an underflow situation though, but reading from memory that contains something else than what you expect |
13:33:23 | FromDiscord | <nnsee> iirc it was that certain regions didn't clear/overwrite the buffer for which types of pokemon can spawn in that region, and other regions or cutscenes? used the same memory location as a buffer for other things, I think for item names or the textbox or something |
13:33:57 | FromDiscord | <nnsee> going to the region which didn't clear the buffer started trying to spawn pokemon found in that buffer, but since it wasn't valid data, missingno spawned instead |
13:34:01 | FromDiscord | <nnsee> probably misremembering something |
13:35:39 | PMunch | Something like that, yeah |
13:36:53 | PMunch | I think it was tied to a specific puzzle needing some extra memory which was placed somewhere no pokemon could spawn. So they re-used the memory for the spawn table for the puzzle. But if you timed it just right and flew from one place to another (which didn't trigger the reset of the spawn table) then it still had the puzzle in the spawn table. |
13:36:59 | PMunch | At least that's how I remember it :P |
13:54:51 | FromDiscord | <odexine> From what I remember it involved a sequence-like data structure and a faulty size update, leading to invalid reads |
14:03:59 | FromDiscord | <Robyn [She/Her]> In reply to @PMunch "Not technically an underflow": Ooh, original mario + tennis game to manipulate the Mario level counter |
14:04:15 | FromDiscord | <Robyn [She/Her]> It's a sheer coincidence that the tennis game works like that |
14:04:24 | PMunch | Wait what? |
14:04:31 | FromDiscord | <Robyn [She/Her]> Yeah, for the NES |
14:05:13 | PMunch | Found a wiki article on the Pokemon missingo thing, apparently your name was briefly changed for a tutorial, and your actual name was stored in the spawn table location |
14:05:53 | FromDiscord | <Robyn [She/Her]> There's a tennis game that uses a counter for tracking footsteps which is used for playing sounds, by sheer coincidence it doesn't clear the Mario level counter, and since Mario also doesn't clear it on reset, it can use the steps from the Tennis game to manipulate what level you spawn on |
14:06:11 | FromDiscord | <Robyn [She/Her]> Even spawning on levels using tiles as the name instead of the typical `3-1` for example |
14:06:20 | FromDiscord | <Robyn [She/Her]> I found it pretty interesting, unfortunate it was before my time |
14:06:33 | FromDiscord | <Robyn [She/Her]> Would've loved the retro consoles, emulators aren't the same I'd imagine |
14:06:51 | FromDiscord | <Robyn [She/Her]> That must be a stab to the heart for people here xD |
14:07:08 | FromDiscord | <nnsee> liveoverflow made a video analyzing the missingno bug (in terms of what you'd do if you were trying to figure it out yourself) |
14:07:11 | FromDiscord | <nnsee> it's pretty good |
14:07:19 | FromDiscord | <nnsee> https://youtu.be/p8OBktd42GI |
14:07:23 | FromDiscord | <nnsee> just watched it |
14:08:51 | FromDiscord | <Robyn [She/Her]> I'm not interested in Pokemon much tbh, even on a technical level |
14:09:09 | FromDiscord | <Robyn [She/Her]> Oh, but Atari is pretty neat with how it worked for writing bytes to the screen |
14:10:07 | * | rockcavera joined #nim |
14:31:24 | FromDiscord | <66aaron23> Need help, trying to use nimx but when I import nimx/window it says cannot open the files https://media.discordapp.net/attachments/371759389889003532/1208058048900505690/image.png?ex=65e1e6bb&is=65cf71bb&hm=67ac068d6a4a3e707863fc90a223d1a437bae94487efdd8c60715731793fa0d4& |
14:31:42 | FromDiscord | <66aaron23> (edit) "Need help, trying to use nimx but when I import nimx/window ... it" added "and nimx/text_field" |
14:41:22 | FromDiscord | <nnsee> In reply to @chronos.vitaqua "I'm not interested in": it's less pokemon and more about memory debugging |
14:41:31 | FromDiscord | <nnsee> the concepts are pretty abstract and not just about pokemon |
14:41:57 | FromDiscord | <nnsee> In reply to @66aaron23 "Need help, trying to": have you tried actually compiling the code? |
14:42:03 | FromDiscord | <nnsee> nimsuggest gets confused sometimes |
14:42:08 | FromDiscord | <nnsee> and may need a restart |
14:42:16 | FromDiscord | <Robyn [She/Her]> In reply to @nnsee "the concepts are pretty": Fair |
14:42:36 | FromDiscord | <nnsee> the follow up video is interesting as well |
14:50:55 | FromDiscord | <Robyn [She/Her]> I might take a look then! I usually only put videos on when eating lol |
14:59:28 | FromDiscord | <Robyn [She/Her]> Out of curiosity, does anyone think that the docs website generated by `nim doc` could be improved in any way? What are people's gripes about it? |
15:03:05 | FromDiscord | <zumi.dxy> needs table of contents in mobile view |
15:03:37 | FromDiscord | <odexine> In reply to @zumi.dxy "needs table of contents": This |
15:03:37 | FromDiscord | <zumi.dxy> i'm assuming it's hidden because it would be Too Damn Long to scroll through in mobile |
15:03:59 | FromDiscord | <leorize> it has horrible groupings |
15:04:26 | FromDiscord | <zumi.dxy> honestly a long ToC would probably be preferable than scrolling through blindly or guessing from ctrl+f |
15:04:37 | FromDiscord | <odexine> Or that a pop up side bar hasn’t been implemented yet |
15:04:50 | FromDiscord | <zumi.dxy> true |
15:05:30 | PMunch | @Robyn_[She/Her], I have plenty of ideas :P |
15:05:41 | PMunch | Basically why I put so much time into improving jsondoc |
15:06:29 | FromDiscord | <arnetheduck> In reply to @odexine "Or rather just how": a zk proof a cryptographic / mathematical primitive - in many ways, it's similar to a public key signature (often with an elliptic curve involved, just like signatures) |
15:07:10 | PMunch | My idea was to generate jsondocs for all the standard library modules across versions, and all modules in Nim across their versions. Then insert all that information in a database and link it together based on the nimble package definition of which packages where required. So now you have a fully searchable, fully cross-linked version of the docs |
15:07:32 | PMunch | Want to get every procedure in the ecosystem which takes a Stream object as the first parameter, easy! |
15:08:01 | FromDiscord | <zumi.dxy> i'm kinda interested in having man pages for nim functions like C does↵found this thread which seems to imply that the formatting even in json heavily assumes something can parse HTML <https://forum.nim-lang.org/t/8798> |
15:08:38 | FromDiscord | <zumi.dxy> yes even if libc + everything else function manpages aren't a good idea, but it's very useful in a pinch |
15:10:54 | PMunch | Yeah it still implies some HTML parsing |
15:11:10 | PMunch | Basically I gave up at some point while porting it to jsondoc |
15:11:20 | PMunch | I just wanted something to work for my Ratel documentation |
15:12:49 | PMunch | To get it working properly I think the best bet is to first rip out the jsondoc and latex doc targets, then rewrite the HTML doc target to a JSON one and implement HTML and Latex as separate executables. Then allow nim doc to run these executables, similar to how `git log` runs `git-log` under the hood for example |
15:13:26 | FromDiscord | <zumi.dxy> i wonder how the latexgen one works |
15:14:17 | PMunch | Poorly is my best guess :P |
15:17:04 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "it has horrible groupings": Oh? Elaborate by that? |
15:17:43 | FromDiscord | <Robyn [She/Her]> In reply to @PMunch "Basically why I put": I was actually looking into that and planning on potentially using that to generate comprehensive docs for the web (and also via a bot) |
15:18:13 | FromDiscord | <Robyn [She/Her]> In reply to @PMunch "To get it working": Ah hm |
15:21:36 | PMunch | It's just a small subset of HTML though, so parsing it shouldn't be that hard if you want to use the existing output |
15:22:49 | FromDiscord | <Robyn [She/Her]> If I get time for that, I could look into doing a rewrite? Seems like it'd be very useful for generating formats for other doc targets↵↵HTML, CSS and the appropriate JS is out of my scope completely though, so |
15:22:59 | FromDiscord | <Robyn [She/Her]> And same with LaTeX, also out of my field |
15:23:17 | FromDiscord | <Robyn [She/Her]> For generating docs, that's essentially just working with macros, right? |
15:23:35 | FromDiscord | <Robyn [She/Her]> I'd imagine this would be a good and fairly decent contribution to a language I love to use :P |
15:24:18 | PMunch | Not really macros, it's built in directly in the compiler |
15:30:21 | FromDiscord | <leorize> basing the json output on whatever that LSP does might be a good idea |
15:33:22 | * | def- quit (Quit: -) |
15:33:38 | * | def- joined #nim |
15:34:36 | FromDiscord | <Robyn [She/Her]> In reply to @PMunch "Not really macros, it's": std/macros-esque? Since the compiler AST seems similar from when I messed with it |
15:34:49 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "basing the json output": Wdym by that? I don't understand |
15:35:04 | FromDiscord | <Robyn [She/Her]> Like, basing it on nimsuggest's codebase? |
15:35:41 | FromDiscord | <leorize> no, LSP can show docs, right? and they can distinguish parameters and types as well |
15:36:05 | FromDiscord | <leorize> so their output format must be doing something right |
15:36:10 | FromDiscord | <leorize> study it |
15:38:45 | * | ntat joined #nim |
15:38:49 | PMunch | Is it possible to put `{.compile:.}` pragmas in the config.nims file? |
15:40:02 | FromDiscord | <leorize> nope |
15:40:07 | PMunch | I think nimsuggest/the lsp clients just show the raw markdown/rst stuff |
15:40:24 | PMunch | And yeah @Robyn_[She/Her] the API is similar to macros |
15:40:27 | FromDiscord | <leorize> and you shouldn't use config.nims anyway, it's slow af |
15:40:47 | PMunch | But much more versatile |
15:42:06 | FromDiscord | <leorize> I haven't seen a good use of it's extended capabilities, though |
15:46:47 | PMunch | I use it currently to recursively add passC:"-I" for each folder in a big folder |
15:52:15 | * | derpydoo joined #nim |
15:57:24 | FromDiscord | <Robyn [She/Her]> In reply to @PMunch "I think nimsuggest/the lsp": Yeah that's what I thought |
15:57:53 | FromDiscord | <Robyn [She/Her]> I'd imagine if the docs generation was reworked, it'd be nicer to use it in the lsp unless it has it's own API |
15:58:20 | FromDiscord | <Robyn [She/Her]> I'll take a look at what the LSP does, can't guarantee I'll even work on this anytime soon considering I'm finally able to focus on one project without immediately jumping ship- |
15:58:37 | FromDiscord | <Robyn [She/Her]> This is much more than a short side project |
16:02:47 | * | xet7 quit (Remote host closed the connection) |
16:03:03 | FromDiscord | <griffith1deadly> In reply to @leorize "and you shouldn't use": then use just .cfg? |
16:07:11 | FromDiscord | <Robyn [She/Her]> In reply to @griffith1deadly "then use just .cfg?": I think leorize meant mostly for when it comes to code execution |
16:07:18 | FromDiscord | <Robyn [She/Her]> Configuration is probably fine for the most parf? |
16:07:22 | FromDiscord | <Robyn [She/Her]> Part |
16:08:05 | FromDiscord | <leorize> for configuration is what I meant |
16:08:17 | FromDiscord | <leorize> if you can get away with .cfg, go for it |
16:09:22 | PMunch | I mean it takes an imperceptible amount of time to run my config.nims script.. |
16:09:28 | PMunch | So I don't worry about it too much |
16:10:14 | FromDiscord | <leorize> I thought so until we got rid of that in nimskull, sped the compiler up a bunch |
16:10:14 | * | azimut quit (Ping timeout: 255 seconds) |
16:10:41 | FromDiscord | <leorize> turns out not having to sem system.nim for nimscript speeds things up |
16:10:47 | PMunch | Is there a way to mark an import as used? |
16:11:13 | FromDiscord | <leorize> you can just add the used pragmas the last time I checked |
16:12:10 | PMunch | On the import? |
16:12:13 | PMunch | I get an error.. |
16:12:31 | FromDiscord | <leorize> I just checked what I did but looks like you have to modify the imported module |
16:12:32 | FromDiscord | <leorize> https://github.com/alaviss/nim-sys/blob/master/src/sys/private/syscall/posix.nim |
16:13:14 | PMunch | But isnt' that for people importing that module? |
16:13:22 | PMunch | Not for the imports in that module |
16:13:30 | FromDiscord | <leorize> yea |
16:13:31 | PMunch | The reason I need this is because I create modules via a macro |
16:13:47 | PMunch | And I lazily throw in some imports that the module might need |
16:14:10 | FromDiscord | <leorize> try some push pop for the warning then? |
16:14:27 | FromDiscord | <leorize> or you could just turn off that warning for the module |
16:15:24 | FromDiscord | <Robyn [She/Her]> In reply to @leorize "for configuration is what": Oh huh |
16:16:14 | FromDiscord | <onigirimental> How can I get C++ header for my nim library? |
16:16:36 | FromDiscord | <leorize> you write it yourself, pretty much |
16:16:51 | FromDiscord | <Robyn [She/Her]> In reply to @PMunch "The reason I need": I typically do something like `discard compiles(functionCall)`, with `functionCall` being a function from that library |
16:18:37 | PMunch | Oh good idea |
16:19:51 | * | def- quit (Quit: -) |
16:20:34 | * | def- joined #nim |
16:25:29 | * | krux02 joined #nim |
16:25:42 | FromDiscord | <jmgomez> In reply to @onigirimental "How can I get": Compile with `--header:YourCppHeader.h"` |
16:27:41 | FromDiscord | <maker_of_mischief> do you think i could jank nim into being able to work with this?↵https://ce-programming.github.io/toolchain/ |
16:29:28 | FromDiscord | <leorize> should not be too hard |
16:29:56 | FromDiscord | <leorize> your main concern will be what is the target CPU architecture |
16:30:11 | FromDiscord | <leorize> and how programs start |
16:37:53 | FromDiscord | <ebahi> is it possible to have valueless keys using parsecfg? |
16:38:32 | FromDiscord | <ebahi> without tje equal sign also so something like this: |
16:39:13 | FromDiscord | <ebahi> (edit) "without tje equal sign also so something like this:" => "sent a long message, see https://pasty.ee/qKCiaOtDLJiG" |
16:39:33 | FromDiscord | <ebahi> (edit) "long message," => "code paste," | "https://pasty.ee/uzKBRtmvDoAU" => "https://play.nim-lang.org/#pasty=rrqQOIPcnFFg" |
16:46:35 | * | def- quit (Quit: -) |
16:50:54 | FromDiscord | <leorize> I don't think you can, parsecfg parses an ini derivative and they're all key value pairs |
16:58:07 | FromDiscord | <ebahi> hmm |
16:58:18 | FromDiscord | <ebahi> arethere any resources to make custom file formats in nim? |
16:58:23 | FromDiscord | <ebahi> (edit) "arethere" => "are there" |
17:02:04 | FromDiscord | <leorize> reading the parser is an easy way to do it |
17:02:54 | FromDiscord | <odexine> you could basically make a derivative of parsecfg |
17:03:09 | FromDiscord | <nervecenter> In reply to @ebahi "are there any resources": If you're using binary formats, I've discovered all you really need is `std/streams` and `std/endians`, so that's a start. Writing bytes to a basic `FileStream` is pretty easy. |
17:03:49 | FromDiscord | <nervecenter> That would of course be the foundation of further structured formatting anyways. |
17:04:17 | FromDiscord | <odexine> in the context above, theyre making a config format |
17:04:30 | FromDiscord | <nervecenter> Oh I see |
17:04:39 | * | def- joined #nim |
17:04:59 | FromDiscord | <ebahi> hmmm ill look into parsecfg |
17:07:41 | * | def- quit (Client Quit) |
17:08:36 | * | def- joined #nim |
17:08:40 | FromDiscord | <odexine> checked |
17:09:01 | FromDiscord | <odexine> parsecfg supports key-only format |
17:09:16 | FromDiscord | <ebahi> how? |
17:10:04 | FromDiscord | <odexine> shows here https://nim-lang.org/docs/parsecfg.html#supported-ini-file-structure |
17:10:40 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#pasty=zlgcoXlnFBpq |
17:11:12 | FromDiscord | <odexine> value would be the empty string in such case |
17:11:42 | * | def- quit (Client Quit) |
17:11:53 | FromDiscord | <ebahi> oh yea, thank you i'll try to see if it works how i want it |
17:11:56 | FromDiscord | <odexine> so when calling `getSectionValue` please set the third parameter to another string |
17:11:59 | * | def- joined #nim |
17:12:02 | FromDiscord | <odexine> so that you can disambiguate |
17:12:16 | FromDiscord | <odexine> https://nim-lang.org/docs/parsecfg.html#getSectionValue%2CConfig%2Cstring%2Cstring%2Cstring↵sorry 4th parameter |
17:12:44 | FromDiscord | <odexine> sent a code paste, see https://play.nim-lang.org/#pasty=LxCoZxUoTTIG |
17:13:22 | FromDiscord | <ebahi> hmmm i see ill see how it works |
17:16:06 | * | def- quit (Client Quit) |
17:17:26 | * | def- joined #nim |
17:18:14 | * | PMunch quit (Quit: Leaving) |
17:19:06 | * | johnjaye joined #nim |
17:20:42 | johnjaye | How does Nim handle stuff like overflow compared to C? |
17:21:33 | Amun-Ra | nim raises an error on overflow |
17:22:36 | FromDiscord | <djazz> for ints, not unsigned ints |
17:22:40 | FromDiscord | <djazz> i think |
17:23:40 | johnjaye | ok. this is probably vague but you know how in C it feels like it's constantly making these weird decisions just so some really weird architecture could be supported? |
17:23:46 | Amun-Ra | overflow in C applies to signed ints only |
17:23:55 | johnjaye | i think not reporting overflow and having -fwrapv is part of that. because not all hardware has overlfow |
17:24:39 | Amun-Ra | C defined unsigned "overflows" as wrapping around |
17:24:43 | Amun-Ra | defines* |
17:26:27 | johnjaye | as i understand it it will optimize assuming overflow doesn't happen |
17:26:48 | * | def- quit (Quit: -) |
17:26:50 | johnjaye | whereas with -fwrapv it will allow signed overflow and not remove your code. e.g. int f(int i) { return i + 1 > i; } |
17:27:11 | johnjaye | without -fwrapv i believe this would be optimized to always return 1 |
17:27:19 | * | azimut joined #nim |
17:27:38 | Amun-Ra | there was no standard signed int format defined until C23, that's why overflow is undefined |
17:27:56 | * | def- joined #nim |
17:29:00 | * | azimut quit (Remote host closed the connection) |
17:29:23 | Amun-Ra | C23 defined signed format as two's complement only; so no more ones' complement, sign-magnitude, etc. |
17:29:44 | * | azimut joined #nim |
17:36:55 | * | def- quit (Quit: -) |
17:37:29 | * | def- joined #nim |
17:37:33 | johnjaye | that's very strange. |
17:37:41 | johnjaye | so C goes so far as to not even assume two's complement? |
17:38:11 | Amun-Ra | nope |
17:38:31 | johnjaye | i guess that makes my point for me. i'm basically asking if nim tries to relax some of these pedantic assumptions of c. |
17:38:39 | Amun-Ra | C was born in old times, were weird architectures roamed the world |
17:38:43 | johnjaye | right |
17:38:50 | Amun-Ra | where* |
17:40:09 | johnjaye | there's 2 different things here though. there's running on outdated archs, then there's targeting embedded hardware with no FPU, MMU, etc. |
17:40:21 | johnjaye | how does nim approach those compared to c |
17:40:59 | Amun-Ra | fpu is compiler's poblem |
17:41:36 | Amun-Ra | and mmu is agnostic to the topic |
17:42:16 | * | lx12ucy joined #nim |
18:11:49 | * | lx12ucy quit (Ping timeout: 264 seconds) |
18:13:35 | * | lx12ucy joined #nim |
18:34:29 | * | rockcavera quit (Ping timeout: 240 seconds) |
18:42:18 | * | rockcavera joined #nim |
18:42:18 | * | rockcavera quit (Changing host) |
18:42:18 | * | rockcavera joined #nim |
18:43:25 | FromDiscord | <JJ> In reply to @Amun-Ra "overflow in C applies": that's very interesting. til |
18:44:03 | * | lx12ucy quit (Ping timeout: 268 seconds) |
18:47:05 | FromDiscord | <fosster> hi guys, does the nim's stdlib have a Result type (value-or-error type)? |
18:57:38 | * | lx12ucy joined #nim |
19:02:03 | Amun-Ra | nope |
19:02:33 | FromDiscord | <nervecenter> In reply to @fosster "hi guys, does the": It has a rudimentary Option type: https://nim-lang.org/docs/options.html |
19:03:09 | Amun-Ra | the closest is ofc return+raise |
19:03:11 | FromDiscord | <nervecenter> Variants are probably the weakest part of Nim's type system and really could use some cleaning. |
19:03:24 | FromDiscord | <nervecenter> (edit) "cleaning." => "cleaning or re-imagining." |
19:03:26 | Amun-Ra | fisster: https://github.com/arnetheduck/nim-results |
19:03:33 | FromDiscord | <leorize> nim-result and badresults exist |
19:04:06 | FromDiscord | <leorize> https://github.com/disruptek/badresults |
19:22:25 | FromDiscord | <fosster> thanks |
19:22:55 | FromDiscord | <fosster> I just hate exception-type error handling, but they chose it to be the standard in nim unfortunately |
19:23:59 | * | junaid_ joined #nim |
19:24:21 | FromDiscord | <whisperecean> Do we have some library for any message queue software? |
19:24:54 | Amun-Ra | I wrote a very crude result implementation but finaly reverted back to raises, I mark all the exceptions explicitely (bc of having push raises: [] at the beginning of every file) |
19:25:17 | FromDiscord | <saint.___.> In reply to @fosster "I just hate exception-type": What do you prefer? |
19:26:28 | Amun-Ra | results are just exceptions in disguise |
19:27:05 | FromDiscord | <fosster> results↵(@saint._.) |
19:32:17 | * | ntat quit (Quit: Leaving) |
19:38:09 | FromDiscord | <fosster> results are less ambiguos than exceptions, exceptions may happen in every moment and unexpectedly if you don't make it obvious in the code that something may fail↵(<@709044657232936960_=41mun-=52a=5b=49=52=43=5d>) |
19:39:19 | FromDiscord | <nnsee> but there are methods of making exceptions explicit in nim, forcing you to handle them as you would results |
19:39:27 | FromDiscord | <nnsee> ie with the `raises` pragma |
19:39:46 | FromDiscord | <saint.___.> In reply to @nnsee "but there are methods": I thought this was the opposite that exceptions forced you to handle them and results didn't |
19:39:49 | FromDiscord | <saint.___.> In languages in general |
19:39:50 | Amun-Ra | {.push raises: [].} is your friend:) |
19:39:53 | FromDiscord | <saint.___.> I guess I'm getting it mixed up? |
19:40:03 | FromDiscord | <saint.___.> Or is it lang dependent |
19:40:23 | FromDiscord | <saint.___.> I realize in nim with the discard thing results are sort of forced to be consumed or handled |
19:40:33 | FromDiscord | <saint.___.> Seems more of an anomaly for nim |
19:41:11 | FromDiscord | <leorize> results must be handled at the exact usage site, so it's a little more explicit |
19:41:40 | FromDiscord | <nnsee> sure |
19:41:53 | FromDiscord | <nnsee> mind you i prefer result types as well |
19:42:26 | FromDiscord | <nnsee> but you can get pretty far with exceptions and it doesn't have the same issues in nim than it does elsewhere |
19:43:24 | FromDiscord | <fosster> I thought raises was just an indication, I didn't think it would ensure that you handle the exception↵(@nnsee) |
19:43:38 | FromDiscord | <fosster> I thought `{.raises .}`was just an indication, I didn't think it would ensure that you handle the exception |
19:44:37 | Amun-Ra | if you mark your func with raises: [] you must handle all the exceptions in the body |
19:45:18 | Amun-Ra | that's why I always have {.push raises: [].} at the top and mark all exceptions explicitely |
19:45:31 | FromDiscord | <leorize> nim exceptions isn't any more remarkable than the rest, other than a cheaper handling fees |
19:48:01 | * | advesperacit quit (Ping timeout: 272 seconds) |
19:48:17 | * | advesperacit joined #nim |
19:48:41 | FromDiscord | <nnsee> why must we fight |
19:49:00 | FromDiscord | <fosster> you mean in the body of the function or where the function was called?↵(<@709044657232936960_=41mun-=52a=5b=49=52=43=5d>) |
19:51:05 | Amun-Ra | fosster: https://play.nim-lang.org/#pasty=fpGiIKKPdTMA |
19:53:38 | FromDiscord | <leorize> i'd sell you my errors library if it worked well \:p I have an idea to build one on top of `union`, and error passthrough is simply an extension of the result `union` (ie. `int | ParseError | IOError`) |
19:53:54 | FromDiscord | <leorize> sum types ended up being too expensive to build properly outside of the compiler so that didn't fly |
19:55:01 | * | lx12ucy quit (Ping timeout: 264 seconds) |
19:59:38 | * | greaser|q quit (Changing host) |
19:59:38 | * | greaser|q joined #nim |
19:59:45 | * | greaser|q is now known as GreaseMonkey |
20:02:11 | FromDiscord | <fosster> thx↵(<@709044657232936960_=41mun-=52a=5b=49=52=43=5d>) |
20:04:11 | Amun-Ra | fosster: https://play.nim-lang.org/#pasty=VisvVJEhFxGb |
20:08:39 | * | advesperacit quit (Ping timeout: 260 seconds) |
20:08:56 | * | advesperacit joined #nim |
20:10:29 | * | junaid_ quit (Remote host closed the connection) |
20:28:32 | * | def- quit (Quit: -) |
20:34:39 | FromDiscord | <Robyn [She/Her]> In reply to @nnsee "but you can get": Like unrolling the stack? :p |
20:35:47 | * | def- joined #nim |
20:53:35 | * | def- quit (Quit: -) |
20:55:02 | * | def- joined #nim |
21:13:34 | * | def- quit (Quit: -) |
21:15:03 | * | def- joined #nim |
21:17:59 | * | def- quit (Client Quit) |
21:18:12 | * | def- joined #nim |
21:41:59 | FromDiscord | <aryzen> What would be nice would be a beginners channel |
21:42:31 | FromDiscord | <aryzen> My skill level is far too low to really be clogging this channel up with constant easy questions |
22:05:16 | FromDiscord | <graveflo> In reply to @aryzen "My skill level is": You can ask them here. This channel typically is beginner questions |
22:13:13 | FromDiscord | <aryzen> alright then, I'll keep that in mind |
22:25:50 | * | def- quit (Quit: -) |
22:27:47 | FromDiscord | <aryzen> How can an Echo have side effects? |
22:28:08 | FromDiscord | <aryzen> (edit) "Echo" => "echo" |
22:28:34 | advesperacit | it writes to stdout |
22:29:01 | FromDiscord | <aryzen> oh |
22:29:22 | FromDiscord | <aryzen> And is there anything like a dot operator? or does it just flatly import all exported symbols? |
22:29:43 | FromDiscord | <Robyn [She/Her]> Depends what you mean? I don't understand what you mean exactly |
22:29:44 | advesperacit | you can use debugEcho if you need to echo for debug purposes in a func or {.nosideeffects.}, but that should be removed once you're done with it |
22:30:05 | FromDiscord | <aryzen> Oh ok, that makes sense |
22:30:18 | FromDiscord | <Robyn [She/Her]> Nim uses UFCs for function calls and also always imports defined types in the thr global scope |
22:30:29 | FromDiscord | <aryzen> In reply to @chronos.vitaqua "Nim uses UFCs for": That answers it, thanks |
22:31:01 | FromDiscord | <that_dude.> https://nim-lang.org/docs/manual.html#lexical-analysis-operators You can also use any of the following for symbol operators |
22:54:00 | * | advesperacit quit () |
22:58:23 | FromDiscord | <aryzen> so, `doSomethingOn(thisThing)` is the same as `thisThing.doSomethingOn`? |
22:58:43 | FromDiscord | <aryzen> or am I misunderstanding? |
23:00:20 | FromDiscord | <that_dude.> Same thing |
23:00:40 | FromDiscord | <aryzen> and I'm guessing that's done just so people who come from other languages can feel comfortable? |
23:01:34 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#pasty=IZASECZsqViP |
23:02:05 | FromDiscord | <that_dude.> Yes, but also so that you can show intent on how you express things while only needing to define it once |
23:02:10 | * | def- joined #nim |
23:03:11 | FromDiscord | <that_dude.> It's a simmilar thing with the case insensitivity. That way you can use code from any other code base and you can freely adapt it to your naming style. |
23:03:20 | FromDiscord | <that_dude.> (edit) "simmilar" => "similar" |
23:04:46 | FromDiscord | <that_dude.> I like using `a.b` when I'm grabbing a detail or doing some conversion `thing(a.asC)` for example while I like using `a.b()` when mutating a, `a.update()` |
23:06:29 | * | derpydoo quit (Ping timeout: 240 seconds) |
23:12:45 | FromDiscord | <aryzen> The fact that everything sits at the same level is a bit difficult for me, but I can see it’s versatility |
23:13:58 | FromDiscord | <aryzen> At least at this moment I can’t think of any issues from it either though |
23:14:49 | FromDiscord | <that_dude.> sent a code paste, see https://play.nim-lang.org/#pasty=ANIntrTdmEhV |
23:30:20 | * | azimut quit (Ping timeout: 255 seconds) |
23:31:35 | FromDiscord | <graveflo> In reply to @that_dude. "Speaking of help, what's": `array[3, cfloat]` is contiguous memory. You will have to daelloc anything you allocate to the heap that is not dealloced by something else |
23:33:11 | * | rockcavera quit (Read error: Connection reset by peer) |
23:35:02 | * | rockcavera joined #nim |
23:37:18 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=GaNvUUSabree |
23:39:30 | FromDiscord | <graveflo> sent a code paste, see https://play.nim-lang.org/#pasty=kmgRNqisFkpZ |