00:02:00 | FromDiscord | <Quibono> So I think I finally need arraymancer and weave lol, thinking of playing around with a 4000x4000 array |
00:07:08 | * | mbomba quit (Ping timeout: 260 seconds) |
00:08:12 | * | mbomba joined #nim |
00:17:48 | FromGitter | <deech> Is there a built in to make a copy of a `cstring`? |
00:20:28 | FromDiscord | <ElegantBeef> It's copied on assignment |
00:20:40 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=2H5M |
00:20:47 | mipri | it's not. |
00:21:06 | mipri | https://play.nim-lang.org/#ix=2H5N |
00:23:27 | mipri | better: https://play.nim-lang.org/#ix=2H5O |
00:23:54 | FromDiscord | <ElegantBeef> I see |
00:24:20 | FromDiscord | <ElegantBeef> I was creating a new string and converting it then assigning b to it i suppose |
00:33:20 | FromGitter | <deech> `alloc0` it is! |
00:41:18 | mipri | that just allocates, so you still need copyMem, and then you have to deallocate it yourself |
00:42:03 | mipri | $p.cstring allocates a string and copies p into it, and then gives you a cstring that points into the string |
01:03:20 | disruptek | and you ask me why i drink. |
01:04:43 | FromDiscord | <ElegantBeef> Well we only have to interact with you, we dont have to live with you |
01:05:47 | disruptek | you sound like my favorite red-head. |
01:06:11 | disruptek | i mean, she may not be my favorite, but the price is right. you get me? |
01:13:31 | FromDiscord | <shadow.> ofc |
01:13:43 | FromDiscord | <shadow.> i bet she loves your testes too |
01:13:48 | FromDiscord | <shadow.> they're quite pretty |
01:13:54 | disruptek | i know, right? |
01:14:05 | FromDiscord | <shadow.> of course |
01:18:25 | FromDiscord | <shadow.> hmm |
01:18:38 | FromDiscord | <shadow.> we need a custom graphics library for your testes so you can have full color |
01:18:47 | FromDiscord | <shadow.> and we don't have to limit them to ansi or whatever you're currently using |
01:20:16 | FromDiscord | <windowsboy111> I know I asked this question, but are there any gui libraries that support webpage rendering and like other normal gui toolkits? I knew that in C theres gtk and webkit2gtk but I'm not sure if I can do something similar |
01:20:43 | FromDiscord | <windowsboy111> I got stuck yet again. |
01:21:13 | FromDiscord | <windowsboy111> tried wxnim, doesn't really work well, often just doesn't compile at all |
01:21:58 | * | abm quit (Quit: Leaving) |
01:22:23 | FromDiscord | <ElegantBeef> Nimx? |
01:24:16 | * | Tanger joined #nim |
01:24:32 | Prestige | Can you get nimx to compile atm? |
01:28:39 | FromDiscord | <exelotl> The nimx experience in browser wasn't so good for me |
01:28:52 | FromDiscord | <exelotl> At least when I tried the samples |
01:29:06 | FromDiscord | <ElegantBeef> I compiled it last week or so |
01:29:24 | ForumUpdaterBot | New thread by ElegantBeef: JS isIndirect template excluding skVar, see https://forum.nim-lang.org/t/7224 |
01:29:27 | Prestige | I tried yesterday and had some issue, I'll try again in a bit when I'm free |
01:29:32 | FromDiscord | <exelotl> So my answer is, yet again "fidget, when its ready" |
01:29:39 | FromDiscord | <ElegantBeef> Well that's still not a toolkit imo |
01:29:48 | Prestige | ^ |
01:29:54 | FromDiscord | <exelotl> Ah fair |
01:30:17 | Prestige | maybe when neogfx has full linux support, I'll make a wrapper |
01:30:27 | FromDiscord | <ElegantBeef> The biggest issue with nimx in browser, is the font rendering sucks |
01:30:43 | FromDiscord | <ElegantBeef> Super aliased |
01:30:51 | disruptek | not clear if you want a webview, of which there are like 3-4 choices, or if you want a gui api that you can optionally render in the browser somehow. |
01:31:24 | Prestige | I just want a good native option that is cross platform |
01:31:33 | Prestige | I'm using electron till then |
01:32:58 | FromDiscord | <windowsboy111> nimx? DSL? |
01:33:10 | FromDiscord | <windowsboy111> is it called dsl |
01:33:46 | FromDiscord | <windowsboy111> yep |
01:34:22 | FromDiscord | <ElegantBeef> !repo nimx |
01:34:23 | disbot | https://github.com/yglukhov/nimx -- 9nimx: 11GUI library 15 722⭐ 61🍴 7& 2 more... |
01:34:31 | FromDiscord | <windowsboy111> yeah, heard it before |
01:34:44 | FromDiscord | <windowsboy111> I just don't know it can render webpages |
01:34:44 | FromDiscord | <shadow.> hmm |
01:34:50 | FromDiscord | <ElegantBeef> Nimx can yes |
01:35:04 | FromDiscord | <ElegantBeef> Oh not entire webpages |
01:35:13 | FromDiscord | <ElegantBeef> But the UI works in browser/native http://yglukhov.github.io/nimx/livedemo/main.html |
01:35:16 | FromDiscord | <windowsboy111> hmm, interesting |
01:35:48 | Prestige | when I try to install the deps for nimx, clurp fails |
01:35:51 | FromDiscord | <windowsboy111> ah no, I |
01:35:53 | FromDiscord | <windowsboy111> ahh |
01:36:06 | FromDiscord | <ElegantBeef> What nim version? |
01:36:07 | FromDiscord | <windowsboy111> I mean like it can be a browser itself |
01:36:22 | FromDiscord | <ElegantBeef> Are you looking for a webview? |
01:36:33 | FromDiscord | <ElegantBeef> Nimx renders opengl natively and using webgl for browser |
01:36:48 | FromDiscord | <windowsboy111> oh |
01:37:08 | Prestige | Beef: 1.4.2 |
01:37:37 | Prestige | https://i.imgur.com/aiNrDTr.png |
01:37:57 | Prestige | just running nimble install -d inside of a cloned nimx repo |
01:38:35 | FromDiscord | <ElegantBeef> https://media.discordapp.net/attachments/371759389889003532/785681700218601472/unknown.png |
01:39:15 | FromDiscord | <windowsboy111> same https://media.discordapp.net/attachments/371759389889003532/785681865213870090/unknown.png |
01:39:25 | ForumUpdaterBot | New thread by Lutins: Front webpage design proposal, see https://forum.nim-lang.org/t/7225 |
01:43:26 | FromDiscord | <windowsboy111> what about nake |
01:43:53 | * | mbomba quit (Quit: WeeChat 3.0) |
01:43:54 | FromDiscord | <ElegantBeef> What about it? |
01:44:06 | FromDiscord | <windowsboy111> for some reason not found? do I need to configure $PATH manually https://media.discordapp.net/attachments/371759389889003532/785683087316353064/unknown.png |
01:44:23 | * | mbomba joined #nim |
01:47:19 | FromDiscord | <ElegantBeef> Did you add nimble to your path? |
01:47:38 | FromDiscord | <windowsboy111> yes? https://media.discordapp.net/attachments/371759389889003532/785683978316808232/unknown.png |
01:48:04 | FromDiscord | <ElegantBeef> I mean the nimble dir |
01:48:31 | FromDiscord | <windowsboy111> this? no https://media.discordapp.net/attachments/371759389889003532/785684199683260436/unknown.png |
01:49:05 | FromDiscord | <ElegantBeef> yea `~/.nimble/bin` should be in your path |
01:49:16 | FromDiscord | <ElegantBeef> It's where nimble installs shipped binaries |
01:59:09 | FromDiscord | <windowsboy111> ~~okay, not very stable~~ (actually I'm down, probably sth that is fixable) https://media.discordapp.net/attachments/371759389889003532/785686874848493629/unknown.png |
02:01:32 | FromDiscord | <shadow.> lol |
02:01:36 | FromDiscord | <shadow.> ye |
02:02:24 | FromDiscord | <windowsboy111> and also, this is really interesting |
02:02:48 | FromDiscord | <Rika> ngl i just realized this like a dumbass but doesnt nim resemble oberon more than python |
02:02:51 | FromDiscord | <windowsboy111> it doesn't follow my theme https://media.discordapp.net/attachments/371759389889003532/785687806730960928/unknown.png |
02:03:08 | FromDiscord | <Rika> isnt nimx gtk? |
02:03:38 | FromDiscord | <Rika> check your gtk theme settings |
02:07:59 | FromDiscord | <windowsboy111> yep, but... https://media.discordapp.net/attachments/371759389889003532/785689101163560960/unknown.png |
02:08:59 | * | snowolf quit (Remote host closed the connection) |
02:09:47 | FromDiscord | <Quibono> How do I define a type that has default fields that can't change? |
02:10:25 | disruptek | make it a constant, i guess. |
02:10:38 | disruptek | s/constant/concept/ |
02:11:28 | FromDiscord | <Quibono> What's the second bit mean? |
02:12:03 | FromDiscord | <Quibono> Like I'm trying to make a currency library so for instance the number of digits after the decimal separator should be constant for each currency. |
02:13:22 | FromDiscord | <ElegantBeef> Nimx is custom rendered @Rika @windowsboy111 it doesnt use GTK, that's nigui you're thinking of |
02:13:45 | FromDiscord | <reilly> Does the stdlib include something for pretty-printing integers (i.e. 123456 -> 123,456) or do I have to make that myself? |
02:14:04 | FromDiscord | <windowsboy111> nigui????? |
02:14:07 | FromDiscord | <windowsboy111> reallly? |
02:14:10 | FromDiscord | <ElegantBeef> Nigui uses gtk |
02:14:14 | FromDiscord | <ElegantBeef> Nimx is custom rendered |
02:14:22 | FromDiscord | <windowsboy111> oh |
02:14:22 | FromDiscord | <ElegantBeef> Nigui doesnt work in browser afaik |
02:14:22 | FromDiscord | <windowsboy111> ok |
02:14:27 | FromDiscord | <windowsboy111> misunderstood |
02:14:32 | disruptek | it means you might be able to conceptually limit implementation based upon mutability, but you cannot make the object have a static field value without a fair amount of boilerplate. |
02:14:47 | FromDiscord | <windowsboy111> I want it to work like a browser btw, not work in a browser |
02:14:56 | FromDiscord | <ElegantBeef> So you want a webview? |
02:14:59 | FromDiscord | <windowsboy111> yes |
02:15:03 | FromDiscord | <ElegantBeef> Then go get a webview |
02:15:36 | FromDiscord | <windowsboy111> my original code is really really really horrible, https://media.discordapp.net/attachments/371759389889003532/785691014772817950/unknown.png |
02:15:53 | FromDiscord | <Quibono> I think I can just do it with object inheritance. |
02:16:06 | FromDiscord | <windowsboy111> I shouldn't even post this image at all, this is totally bull\\\\ |
02:16:15 | FromDiscord | <ElegantBeef> Neel and webgui should work for you |
02:17:00 | FromDiscord | <windowsboy111> actually I tried out neel before, but then I want the tab thingy to be natively coded, instead of javascript |
02:17:19 | FromDiscord | <Rika> what do you mean? |
02:18:05 | FromDiscord | <windowsboy111> neel ain't bad at all https://media.discordapp.net/attachments/371759389889003532/785691639280566343/unknown.png |
02:18:09 | FromDiscord | <windowsboy111> (my old code) |
02:18:10 | FromDiscord | <Rika> oh you mean you'd like your gui to be native? |
02:18:22 | FromDiscord | <windowsboy111> yes, other parts to be native |
02:18:42 | FromDiscord | <windowsboy111> but if it is not possible, I'll just code it in js |
02:19:29 | FromDiscord | <Rika> then just webview should be relevant, continue with the normal gui lib youre using unless you also want theming via gtk or kde |
02:19:41 | FromDiscord | <Rika> qt not kde |
02:20:55 | FromDiscord | <windowsboy111> so you mean you can use webview with other gui libs? how? |
02:22:38 | FromDiscord | <Rika> im not sure maybe its a different webview i think of |
02:23:39 | disruptek | this filter, this tiny piece of code... exposes a c++ codegen error. |
02:23:44 | disruptek | i can't believe it. |
02:24:03 | disruptek | it's only 60 fucking lines. |
02:24:11 | FromDiscord | <ElegantBeef> Just say i wrote it and blame me |
02:24:58 | disruptek | it doesn't work in nim-1.0 or devel. unlikely to work anywhere in between. |
02:26:26 | * | idxu_ joined #nim |
02:27:08 | * | idxu quit (Ping timeout: 260 seconds) |
02:27:28 | * | idxu_ is now known as idxu |
02:28:02 | * | FromGitter quit (Ping timeout: 260 seconds) |
02:29:26 | * | oprypin quit (Ping timeout: 264 seconds) |
02:31:45 | * | cmc[m] joined #nim |
02:32:05 | FromDiscord | <shadow.> id say if anything it resembles modula 3 more |
02:32:22 | FromDiscord | <shadow.> i mean maybe not in syntax |
02:32:25 | FromDiscord | <shadow.> but in model certainly |
02:32:58 | disruptek | modula 3 is the one with keanu reeves in it, right? |
02:33:09 | FromDiscord | <Rika> in syntax it looks like oberon dunnit? |
02:33:26 | * | oprypin joined #nim |
02:35:00 | * | mbomba quit (Quit: WeeChat 3.0) |
02:35:24 | FromDiscord | <shadow.> yeah kinda haha |
02:35:40 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/785696063851069471/modula2.png |
02:35:40 | FromDiscord | <shadow.> but see |
02:35:43 | FromDiscord | <shadow.> procedure |
02:35:45 | FromDiscord | <shadow.> var block |
02:35:54 | FromDiscord | <shadow.> simple number ranges and type inference |
02:36:03 | FromDiscord | <shadow.> english operators like mod |
02:36:19 | FromDiscord | <Rika> the var blocks on the top reminds me of really old C |
02:36:26 | FromDiscord | <shadow.> haha |
02:36:33 | FromDiscord | <shadow.> what, early declarations? |
02:36:37 | FromDiscord | <Rika> yeah |
02:36:41 | FromDiscord | <shadow.> fair enough lol |
02:38:22 | FromDiscord | <Rika> or maybe algol? |
02:38:29 | FromDiscord | <Rika> i dont remember which language i remember |
02:38:35 | disruptek | whoa. |
02:38:51 | * | disruptek 🤯 |
03:00:07 | * | a_chou joined #nim |
03:00:45 | * | a_chou quit (Remote host closed the connection) |
03:16:30 | FromDiscord | <reilly> I'm losing my mind struggling at something so basic. Is there a thing for pretty printing an integer? (i.e. 12345 -> 12,345) |
03:20:53 | FromDiscord | <shadow.> underscore |
03:21:04 | FromDiscord | <shadow.> oh wait |
03:21:13 | FromDiscord | <shadow.> you mean formatting it? |
03:21:28 | FromDiscord | <shadow.> bc you can do like: |
03:21:34 | FromDiscord | <shadow.> !eval echo 12_345 |
03:21:36 | NimBot | 12345 |
03:21:44 | FromDiscord | <shadow.> for readabilitt |
03:21:49 | FromDiscord | <ElegantBeef> They want to pretty print it |
03:21:49 | FromDiscord | <shadow.> (edit) "readabilitt" => "readability" |
03:21:56 | FromDiscord | <shadow.> yeah oki |
03:22:09 | FromDiscord | <shadow.> in that case idk, prolly somewhere in the sto lol |
03:22:13 | FromDiscord | <shadow.> stl |
03:25:21 | FromDiscord | <Quibono> I mean you could like make a proc with a counter counting backwards and adding commas after every third char... |
03:25:29 | FromDiscord | <Quibono> 😮 |
03:27:41 | FromDiscord | <reilly> It's strutils.insertSep(). |
03:30:10 | FromDiscord | <Quibono> ... But I was making a really ugly kludgy way to do it lol |
03:34:31 | FromDiscord | <reilly> I've been trying to make a really kludgy way to do it for the past hour. |
03:47:30 | FromDiscord | <Quibono> https://play.nim-lang.org/#ix=2H6K |
03:47:39 | FromDiscord | <Quibono> I don't get why it thinks revStr is undeclared |
03:48:18 | * | nekits07 quit (Ping timeout: 256 seconds) |
03:48:21 | FromDiscord | <Rika> "len.revstr" -> "revstr.len" |
03:48:23 | FromDiscord | <Rika> lmao |
03:49:21 | FromDiscord | <Rika> @Quibono "len.revstr" -> "revstr.len" if you didnt see yet |
03:49:44 | FromDiscord | <Quibono> Thanks, now I just need to figure out why it returns... nothing lol |
03:50:37 | FromDiscord | <Rika> .. will not count down |
03:50:45 | FromDiscord | <Rika> so 1..0 -> no looping |
03:50:52 | FromDiscord | <Rika> use countdown() for reverse counting |
03:51:11 | * | nekits07 joined #nim |
03:51:12 | FromDiscord | <Rika> also you're using the string values as numbers? |
03:51:28 | FromDiscord | <Quibono> Yeah I'm all over the place, brb |
03:53:28 | FromDiscord | <Quibono> I always get confused between the index of the thing and the value at the index. |
03:54:07 | FromDiscord | <Rika> just keep on practicing like this and youll remember sooner or later |
03:54:30 | * | audiofile joined #nim |
03:54:51 | * | gangstacat quit (Quit: Ĝis!) |
03:56:37 | FromDiscord | <Quibono> https://play.nim-lang.org/#ix=2H6M |
03:56:39 | FromDiscord | <Quibono> Boom, it works |
03:56:54 | FromDiscord | <Quibono> Probably a much simpler way to do that, but... |
03:58:16 | FromDiscord | <Quibono> Thank you to @Rika for not laughing too uproariously and helping when I had no clue what was wrong. |
04:05:22 | FromDiscord | <Rika> 👌 |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:32 | * | supakeen joined #nim |
04:07:45 | FromDiscord | <Quibono> Is there a better way to do it? |
04:14:26 | FromDiscord | <Rika> to do what |
04:15:11 | FromDiscord | <Rika> btw you did the value index mixup thing again on line 13 |
04:16:30 | FromDiscord | <Quibono> To pretty a number like that |
04:17:00 | FromDiscord | <Rika> like reilly said https://nim-lang.org/docs/strutils.html#insertSep%2Cstring%2Cchar%2Cint |
04:21:25 | FromDiscord | <ElegantBeef> The nice thing is you can always click "source" and see this https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/strutils.nim#L2288 |
04:21:38 | * | narimiran joined #nim |
04:25:51 | * | mbomba joined #nim |
04:29:49 | audiofile | im bacccc |
04:31:40 | * | gangstacat joined #nim |
04:32:01 | FromDiscord | <ElegantBeef> yellow |
04:38:25 | * | thomasross quit (Ping timeout: 240 seconds) |
04:44:07 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:08:00 | * | a_chou joined #nim |
05:08:05 | * | audiofile quit (Ping timeout: 240 seconds) |
05:37:43 | FromDiscord | <Cohjellah> Hey guys with strscan |
05:37:51 | FromDiscord | <Cohjellah> how do I match a char and set it to char variable |
05:38:01 | FromDiscord | <Cohjellah> if I use $w it throws an error because it's a char variable, not string |
05:38:16 | * | nekits07 quit (Ping timeout: 240 seconds) |
05:40:39 | FromDiscord | <ElegantBeef> I dont think it's possible as the parser thinks `$w` is a string |
05:40:56 | FromDiscord | <Cohjellah> there's no character matcher for a char? |
05:40:58 | FromDiscord | <Cohjellah> Guess I'll use a string |
05:41:13 | FromDiscord | <ElegantBeef> https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/strscans.nim#L310 |
05:41:13 | FromDiscord | <ElegantBeef> nope |
05:41:55 | * | vicfred quit (Quit: Leaving) |
05:46:31 | FromDiscord | <flywind> see https://github.com/nim-lang/Nim/pull/16240 |
05:46:31 | disbot | ➥ add support for parsing chars in `scanf` macro |
05:46:54 | FromDiscord | <flywind> and use devel version |
05:51:30 | FromDiscord | <ElegantBeef> Dont show that as it proves i'm inept with git 😛 |
05:52:42 | * | NimBot joined #nim |
05:54:47 | narimiran | then do `let myChar = parsedString[0]` and live with it |
06:05:57 | * | a_chou quit (Quit: a_chou) |
06:06:27 | FromDiscord | <starl0rd> morning everyone. |
06:06:39 | FromDiscord | <starl0rd> help me understand this ? -> https://play.nim-lang.org/#ix=2H7a |
06:08:17 | FromDiscord | <ElegantBeef> https://nim-lang.org/docs/system.html#new%2Cref.T |
06:08:51 | FromDiscord | <starl0rd> motivated by Zevvs: article here, https://zevv.nl/nim-memory/. it says only way to get a ref pointer is use the `new` kw |
06:09:16 | FromDiscord | <ElegantBeef> What do you expect? |
06:12:01 | FromDiscord | <ElegantBeef> That's the only way for a ref pointer of a non heap allocated type |
06:12:17 | FromDiscord | <ElegantBeef> `ref objects` are explicitly heap allocated |
06:12:23 | FromDiscord | <ElegantBeef> @starl0rd Where is the confusion? |
06:13:30 | FromDiscord | <starl0rd> yea, no, your links clears it. thanks |
06:13:32 | FromDiscord | <starl0rd> : ) |
06:17:46 | FromDiscord | <starl0rd> also, if i have a `ref object` type, like Person, `typeof Person()` give me `Person` and not `ref Person` ? |
06:17:54 | FromDiscord | <starl0rd> (edit) "give" => "gives" |
06:18:10 | FromDiscord | <ElegantBeef> Well yea person is a ref object |
06:18:50 | FromDiscord | <ElegantBeef> Typically what you do if you want both is declare a `PersonRef` or `PersonObj` for whichever you'll use less |
06:19:14 | FromDiscord | <ElegantBeef> Then the ref is `Person = ref PersonObj` in the case you use `Person` a lot |
06:19:37 | FromDiscord | <ElegantBeef> See the json node for example https://nim-lang.org/docs/json.html#JsonNode |
06:21:47 | FromDiscord | <ElegantBeef> I guess i should've just said "ref objects are not `ref Person` since that'd wrong/annoying" |
06:22:00 | FromDiscord | <Rika> ref Person == ref ref object |
06:22:01 | FromDiscord | <ElegantBeef> Cause if person is a ref object that's `ref ref object` |
06:22:05 | FromDiscord | <ElegantBeef> Shit rika! |
06:22:14 | disruptek | i usually just assume that it's wrong/annoying if you're the one saying it. |
06:22:20 | FromDiscord | <ElegantBeef> Cheers |
06:22:45 | FromDiscord | <ElegantBeef> Truthfully i do the same |
06:23:29 | FromDiscord | <starl0rd> i think i kind of get it, and kind of dont ? |
06:24:03 | FromDiscord | <ElegantBeef> The ref is included in the object declaration to say `ref Person` is wrong as there is no `Person` |
06:24:05 | FromDiscord | <starl0rd> non ref objects are simple. everytime you get a new object and copying /reassigning actually copies it |
06:24:14 | disruptek | the idiom is `new (ref Person)` when you haven't defined a ref type for Person. |
06:24:33 | FromDiscord | <starl0rd> ref objects do give a referece since when i re-assign them, i can modify the orignal |
06:24:49 | FromDiscord | <starl0rd> which means they ought to be returning a ref / pointer |
06:24:50 | FromDiscord | <ElegantBeef> They're heap allocated, with managed pointers |
06:24:50 | disruptek | what languages have you written? |
06:25:18 | disruptek | typeof yields the symbol name for the type, period. |
06:25:37 | FromDiscord | <starl0rd> sure, but the typeof should tell me its a refernce / pointer |
06:25:42 | disruptek | typeof yields the symbol name for the type, period. |
06:25:44 | FromDiscord | <ElegantBeef> Why should it? |
06:25:55 | FromDiscord | <ElegantBeef> If you want to see if it's reference look at the code not the console |
06:26:03 | FromDiscord | <Rika> think of it this way |
06:26:17 | FromDiscord | <Rika> Person is an alias for whatever the object declaration is |
06:26:23 | FromDiscord | <Rika> like a template |
06:26:44 | FromDiscord | <Rika> so if you say Person = ref object, saying "Person" means "ref object" |
06:27:00 | FromDiscord | <Rika> if you say "ref Person", it will mean "ref ref object" which is wrong |
06:27:07 | FromDiscord | <starl0rd> sure |
06:27:13 | FromDiscord | <Rika> unless its really a double ref |
06:27:17 | disruptek | Person is a symbol. |
06:27:22 | disruptek | ref object is a typedef. |
06:27:31 | disruptek | typeof yields symbols, not typedefs. |
06:27:35 | FromDiscord | <starl0rd> but if i do `var a = Person()` |
06:27:40 | FromDiscord | <starl0rd> a does hold a reference |
06:27:43 | FromDiscord | <Rika> ye |
06:27:45 | FromDiscord | <Rika> yes |
06:27:45 | FromDiscord | <starl0rd> (edit) "a" => "`a`" |
06:27:47 | disruptek | if you want to dig into the type's definition, you need to use macros. |
06:27:58 | FromDiscord | <Rika> and typeof says its a reference, its implicit when you say "Person" |
06:28:05 | FromDiscord | <starl0rd> so the `typeof a` should be a ref |
06:28:10 | FromDiscord | <Rika> and it does |
06:28:11 | disruptek | holy smokes. |
06:28:43 | FromDiscord | <starl0rd> lol. so Person MEANS is a `ref` implicitly |
06:28:47 | FromDiscord | <ElegantBeef> Yes |
06:28:47 | FromDiscord | <starl0rd> i geddit now |
06:28:59 | FromDiscord | <starl0rd> too much of C conditioning |
06:29:02 | FromDiscord | <starl0rd> i guess |
06:29:07 | FromDiscord | <starl0rd> Thanks guys. |
06:29:34 | FromDiscord | <starl0rd> @Rika @ElegantBeef disruptek: +1 for assist |
06:36:56 | * | Cthalupa quit (Ping timeout: 240 seconds) |
06:39:24 | * | Cthalupa joined #nim |
06:58:08 | disruptek | there's something funky going on with intsets. |
07:00:52 | disruptek | never mind, i'm blind. |
07:21:42 | FromDiscord | <starl0rd> a teeny tiny Q. if i instantiate a non ref object. like `var a = NonRef()` it'll be on the stack vs if i do `var b = new NoRef()` then it'll be on the heap ? |
07:21:53 | disruptek | right. |
07:22:13 | FromDiscord | <Rika> yes |
07:22:26 | FromDiscord | <starl0rd> your boy got this, it seems |
07:23:19 | * | habamax joined #nim |
07:28:48 | FromDiscord | <ElegantBeef> Congrats! |
07:30:38 | FromDiscord | <ElegantBeef> Now you know why we use `init` for objects and `new` for ref objects 😄 |
07:32:07 | FromDiscord | <starl0rd> haven't seen any `init` tho |
07:32:17 | FromDiscord | <starl0rd> i just call the constructor ? |
07:32:59 | FromDiscord | <ElegantBeef> For custom constructors that are procs convention dictates you use `initObject` of non refs and `newObject` for ref objects |
07:33:29 | mipri | https://nim-lang.org/docs/tables.html - example with initTable procs |
07:34:37 | mipri | and separate newTable procs. And although you can see the fields of the types there, the fields aren't exported so you can't use the constructor |
07:35:02 | disruptek | that reminds me, |
07:35:16 | disruptek | why does bentley always look at me while licking his little doggy dick? |
07:35:28 | FromDiscord | <ElegantBeef> To make you envious |
07:36:04 | mipri | it's only because he's wondering why you've from across the room to stare at him at close range, coincidentally whenever he does that. |
07:36:38 | disruptek | i was asking rika. |
07:37:03 | FromDiscord | <nikki> i like `let p = (ref Person)(name: "hoho", age: 42)` |
07:37:23 | disruptek | i love me some hohos. |
07:37:44 | FromDiscord | <nikki> and not giving names to ref types |
07:37:52 | FromDiscord | <nikki> they can show up in fields etc. for sure |
07:37:56 | disruptek | yuk. |
07:38:20 | FromDiscord | <starl0rd> so `initThis` means, by convention, it's a normal value type / object that'll be copied. while `newThis` means it'll be a `ref` type and copies will mutate the orig |
07:38:29 | FromDiscord | <Rika> why would you ask me i thought everything i said was worthless |
07:38:45 | FromDiscord | <Rika> yes starl0rd |
07:39:07 | FromDiscord | <starl0rd> must be getting tiring xD |
07:39:20 | FromDiscord | <Rika> no im used to it |
07:39:35 | FromDiscord | <Rika> i honestly wish my patience were longer |
07:39:59 | disruptek | i figured you'd have some expertise in this area. |
07:40:22 | FromDiscord | <starl0rd> isn't patience an uncountable ? |
07:40:44 | FromDiscord | <Rika> isnt length an uncountable as well |
07:40:48 | FromDiscord | <starl0rd> like you can have more or less of it, like rain, but not longer ? |
07:40:54 | mipri | patients are always countable, starl0rd. They're human beings. |
07:41:12 | FromDiscord | <starl0rd> patience, patient. |
07:41:52 | disruptek | starl0rd: so i reimpl your bloom filter and it exposed a cpp codegen bug. |
07:42:22 | FromDiscord | <starl0rd> filter level, 9000+ |
07:42:37 | disruptek | you can't make this stuff up. |
07:42:46 | FromDiscord | <starl0rd> what did it break ? |
07:42:54 | disruptek | even when i'm trying to be good, i manage to trip over shit some bozo left lying in the dark. |
07:43:23 | disruptek | something to do with builtin set sizing, but only under cpp. |
07:43:33 | disruptek | and mutability. |
07:43:43 | FromDiscord | <starl0rd> i legit made it off a wiki article, i haven't the slightest idea if it was supposed to be that way : P |
07:44:01 | disruptek | no, mine is quite different. |
07:44:29 | FromDiscord | <starl0rd> can i have a look ? |
07:44:29 | disruptek | yours supposed unlimited size; mind is for smaller quantities. |
07:44:35 | disruptek | supports, too. |
07:44:46 | disruptek | yeah, it's in skiplists now. |
07:44:50 | disruptek | !repo skiplists |
07:44:51 | disbot | https://github.com/disruptek/skiplists -- 9skiplists: 11generic skip list implementations💃 15 6⭐ 1🍴 |
07:44:54 | * | PMunch joined #nim |
07:45:15 | disruptek | now it's failing on windows. 🤣 |
07:47:51 | FromDiscord | <starl0rd> might aswel name it safari. |
07:49:11 | FromDiscord | <sealmove> @PMunch (and whoever might interest): I laid out the whole idea behind binaryparser's reword, check it out: https://github.com/PMunch/binaryparse/issues/14. As I warned this is huge change and I am very motivated to go forward with it, so it seems likely it will be a fork under the name "binarylang" or something, unless you are up for letting me change the whole code :P. |
07:49:13 | FromDiscord | <starl0rd> yours has layers of filters |
07:49:13 | disbot | ➥ Syntax rework/extension ; snippet at 12https://play.nim-lang.org/#ix=2H7w |
07:50:15 | disruptek | yeah, mine is designed to leverage the built-in sets. |
07:50:48 | FromDiscord | <starl0rd> hey, i found a nit : P |
07:50:57 | disruptek | what's that? |
07:51:09 | FromDiscord | <starl0rd> Natural vs uint |
07:51:26 | FromDiscord | <starl0rd> no wrap around arith, tho you probably wont ever hit it |
07:52:06 | disruptek | yeah, i need them to fail if the conversion to uint16 fails. |
07:52:13 | disruptek | whatfer set limitation reasons. |
07:52:47 | disruptek | did you measure the size of your filter? |
07:55:58 | FromDiscord | <starl0rd> i did |
07:56:36 | FromDiscord | <starl0rd> i am measuring `sizeof set[range[0..10]]` now, which gives me 2 |
07:57:03 | FromDiscord | <starl0rd> and when i do `sizeof set[range[0..100]]` it gives me 13 |
07:57:11 | FromDiscord | <starl0rd> what is happening here ? |
07:57:22 | disruptek | when we don't know the answer we just make up numbers. |
07:58:21 | FromDiscord | <starl0rd> like the Govy. |
07:58:23 | FromDiscord | <starl0rd> Govt. |
07:58:34 | disruptek | yeah, it's fine. |
07:58:37 | FromDiscord | <nikki> !eval echo(sizeof set[range[0..100]]) |
07:58:39 | NimBot | 13 |
07:58:50 | disruptek | if you get an invoice you don't agree with, just don't pay it. |
07:59:39 | disruptek | you were storing a byte for every bit, for each layer. |
08:00:33 | FromDiscord | <starl0rd> i just had 1 layer |
08:00:59 | FromDiscord | <ElegantBeef> 100/80 |
08:01:00 | disruptek | oh i thought you had a 3-hash setup. |
08:01:10 | FromDiscord | <ElegantBeef> 100/8 😄 |
08:01:21 | FromDiscord | <Rika> 100/8 then ceil it |
08:01:28 | FromDiscord | <starl0rd> all 3 hashes mapped to 1 bit Array |
08:01:38 | FromDiscord | <Rika> !eval echo ceil(100/8) |
08:01:40 | NimBot | Compile failed: /usercode/in.nim(1, 6) Error: undeclared identifier: 'ceil' |
08:01:43 | FromDiscord | <Rika> does ceil exit in |
08:01:50 | FromDiscord | <Rika> okay that answers my question |
08:01:54 | FromDiscord | <Rika> was it in math |
08:01:58 | disruptek | most likely. |
08:02:04 | FromDiscord | <Rika> !eval import math; echo ceil(100/8) |
08:02:07 | NimBot | 13.0 |
08:02:29 | FromDiscord | <Rika> theres why sizeof set[range[0..100]] is 13 |
08:02:35 | disruptek | of course. |
08:02:43 | FromDiscord | <starl0rd> isn't set supposed to be BIT vectors ? |
08:02:50 | FromDiscord | <starl0rd> it should be 100 BITS |
08:02:53 | FromDiscord | <ElegantBeef> no |
08:02:58 | * | disruptek sighs. |
08:02:59 | FromDiscord | <ElegantBeef> well it has to be base 2 |
08:03:12 | FromDiscord | <Rika> 100 bits indeed now divide that by 8 to get bytes |
08:03:17 | FromDiscord | <Rika> sizeof gives bytes |
08:03:18 | FromDiscord | <ElegantBeef> well 8 multiple |
08:03:48 | FromDiscord | <starl0rd> facepalms into eternity |
08:04:00 | FromDiscord | <Rika> ahahaha |
08:04:08 | FromDiscord | <Rika> it doesnt really make sense to count in bits |
08:04:22 | FromDiscord | <Rika> because you cant exactly have smaller than a byte anyway |
08:04:26 | FromDiscord | <starl0rd> that's how i look at nim sets now, mentally |
08:04:37 | FromDiscord | <starl0rd> 1 bit for each number in whatever range you passed |
08:04:45 | disruptek | yes. |
08:04:49 | FromDiscord | <starl0rd> it's either, there, or isnt |
08:04:50 | FromDiscord | <Rika> yup |
08:04:52 | FromDiscord | <Rika> thats true |
08:05:02 | FromDiscord | <starl0rd> doesn't matter if you use it or not |
08:05:05 | FromDiscord | <Rika> yep |
08:05:30 | FromDiscord | <starl0rd> and i was told it was done because we cant guess what numbers will end up in set eventually |
08:05:37 | FromDiscord | <starl0rd> even tho i am not using them now |
08:05:47 | FromDiscord | <starl0rd> like if i union with another set and suck |
08:05:51 | FromDiscord | <starl0rd> such |
08:06:00 | disruptek | you can pack objects with bits using the .bitsize pragma. |
08:06:15 | FromDiscord | <starl0rd> how so ? |
08:07:26 | disruptek | by using the .bitsize pragma on an object field to indicate its size in bits. |
08:07:33 | FromDiscord | <starl0rd> https://play.nim-lang.org/#ix=2H7D |
08:07:56 | FromDiscord | <starl0rd> i did it without sets. and it wont let me make it an array till i told it the size |
08:08:07 | disruptek | that's the thing about arrays... |
08:08:37 | FromDiscord | <ElegantBeef> Arrays are sized at compile time |
08:08:50 | FromDiscord | <ElegantBeef> If you dont know the size you want at compile time, you get a seq 😄 |
08:09:09 | FromDiscord | <starl0rd> i should know this at compile time |
08:09:14 | FromDiscord | <starl0rd> i am WRITING this lol |
08:09:22 | FromDiscord | <starl0rd> with no user input or stuff |
08:09:35 | FromDiscord | <starl0rd> i could make them arrays it seems |
08:10:01 | FromDiscord | <starl0rd> and if i make a array of range[0..1] it really should hold 1 bit per value |
08:10:10 | FromDiscord | <starl0rd> per element |
08:10:36 | FromDiscord | <ElegantBeef> No you'd be getting 1 byte per element |
08:10:37 | disruptek | what you really want is to dynamically compute the ideal k/n values to tune the filter after you know how large it needs to be and what performance you need. |
08:11:11 | FromDiscord | <starl0rd> int8's ? |
08:11:15 | FromDiscord | <Rika> @ElegantBeef more of "however large the element is" per element smh |
08:11:25 | FromDiscord | <ElegantBeef> Well yea 0..1 isnt a bit |
08:11:28 | FromDiscord | <Rika> int8 is 8 bits large |
08:11:50 | FromDiscord | <Rika> just like how bools are 8 bits large |
08:12:03 | FromDiscord | <ElegantBeef> If you want bit's use ints or bitsets 😄 |
08:12:18 | disruptek | http://nim-lang.github.io/Nim/manual.html#implementation-specific-pragmas-bitsize-pragma |
08:13:03 | FromDiscord | <starl0rd> if i only 2 values, and i want to use however bits needed to represent them completly (1 in this case), how do i tell the compiler that ? |
08:13:23 | FromDiscord | <starl0rd> the bitsize pragma , like disruptek posted ? |
08:13:25 | disruptek | i will need a larger bloom filter, so the next version has to be based upon intsets, or something from-scratch. |
08:13:55 | FromDiscord | <starl0rd> i guess you used 1 hash functions and 3 arrays / location spaces |
08:13:56 | disruptek | yes, but there's no way to use that syntax outside of an object. |
08:14:07 | FromDiscord | <starl0rd> i used 3 hash functions and 1 location space : P |
08:14:25 | disruptek | well i wanted to be able to use less memory. |
08:15:34 | disruptek | what's funny is, someone just reported the "bug" that sets always use 16bit ints underneath. |
08:16:12 | FromDiscord | <starl0rd> that's... me |
08:16:24 | disruptek | oh, that makes sense. |
08:16:45 | FromDiscord | <starl0rd> i picked it up when going through the tutorial at the sets part |
08:16:50 | disruptek | i was gonna code around it but i decided it doesn't matter enough. |
08:17:48 | disruptek | better to have a simpler impl and then one that scales larger, because the small one is more valuable as a fully static type. |
08:28:28 | * | Vladar joined #nim |
08:59:25 | * | Tanger quit (Remote host closed the connection) |
09:00:10 | * | ache-of-head[m] quit (Quit: Idle for 30+ days) |
09:02:09 | * | Kaivo quit (Ping timeout: 260 seconds) |
09:02:30 | * | MarderIII joined #nim |
09:02:46 | * | MarderIII quit (Read error: Connection reset by peer) |
09:04:04 | * | Kaivo joined #nim |
09:21:17 | * | qwertfisch quit (Ping timeout: 260 seconds) |
09:21:55 | * | qwertfisch joined #nim |
09:25:15 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
09:48:13 | * | mbomba quit (Quit: WeeChat 3.0) |
09:52:56 | * | Cthalupa quit (Ping timeout: 240 seconds) |
09:54:11 | * | Cthalupa joined #nim |
10:05:21 | FromDiscord | <starl0rd> sent a code paste, see https://play.nim-lang.org/#ix=2H8h |
10:06:13 | FromDiscord | <starl0rd> if i also want the `kind` property in `Node` , how do i add it? anywhere i put it, it says i am trying to redfine `kind` |
10:08:35 | FromDiscord | <Vindaar> what do you mean have the `kind` property in `Node`? It's right there already |
10:21:25 | FromDiscord | <starl0rd> yea, i do have it, my repr message got weirdly formated in the output |
10:27:50 | FromDiscord | <mratsim> your sets must use 1 byte, that's the minimal addressable size by the hardware |
10:28:42 | FromDiscord | <mratsim> I don't think you will find 2-bit machines and other 8-bit you might be able to find bytes of size 12 and 24 bits but they are going the way of the dodo |
10:29:03 | mipri | the HP48G series of calculators had nibble addressing, though. |
10:31:04 | FromDiscord | <mratsim> Then for packing as I mentioned in the forum it all depends on your requirements: compile-time/runtime are they copied/moved to other locations/threads, do you favor size or CPU usage, are they dynamic in size. |
10:42:31 | FromDiscord | <starl0rd> that's what known as word size right? min size of a memory location with an address ? |
10:45:21 | FromDiscord | <mratsim> yes |
10:45:54 | FromDiscord | <mratsim> And if you want dynamic bitsets, this is a good start: 13 lines to set and iterate on set bits: https://github.com/mratsim/number-theory/blob/master/src/primes.nim#L8-L22 |
10:46:26 | FromDiscord | <mratsim> and a bit by bit iterator: https://github.com/mratsim/constantine/blob/master/tests/support/ec_reference_scalar_mult.nim#L17-L25 |
10:47:31 | FromDiscord | <mratsim> if if you want to do multi-bit packing, say 3 or 5-bit in a datastructure, this is the do-it-yourself way: https://github.com/mratsim/constantine/blob/master/constantine/elliptic/ec_endomorphism_accel.nim#L148-L180 |
10:48:48 | FromDiscord | <starl0rd> that's comprehensive. i'll look into them. thanks @mratsim |
10:49:16 | FromDiscord | <mratsim> You might also want to look into repos that implements "Succinct Data Structures" |
10:49:20 | FromDiscord | <mratsim> and papers |
10:52:47 | FromDiscord | <starl0rd> im just trying to pick up the language right now. there seems be some material to be covered here with macros, templates etc. gc/arc etc. is it alright if i hit you after ? |
10:53:00 | FromDiscord | <starl0rd> (edit) "?" => "for recs?" |
10:53:22 | FromDiscord | <starl0rd> (edit) "templates etc." => "templates," |
10:54:20 | FromDiscord | <mratsim> Personally I learn better with example, don't try to learn the manual, find a small problem you want to fix, could be advent of code for example, and start using Nim |
10:54:25 | FromDiscord | <mratsim> and search when stuck |
10:55:13 | FromDiscord | <mratsim> For me I started with writing super simple neural network with only a scalar neuron (no matrices or anything) by following a tutorial for Javascript but in Nim and gradually worked my way up |
10:57:34 | FromDiscord | <starl0rd> yea, i agree that doing gets it under your hands better. but i like to get a taste of various ways things are done in a language. and going though the manual seems like a good way to familiarize myself with the constructs the language provides. |
10:58:02 | FromDiscord | <starl0rd> else i find myself writing code the way i am familiar with other languages |
10:58:39 | FromDiscord | <starl0rd> and i didn't really know an language with proper macros yet, so i am also kindda excited to pick em up : p |
11:30:24 | Zoom[m] | Do we have some Result type? Like an option, but which can return a value (possibly of other type) on none/error? |
11:33:31 | FromDiscord | <lqdev> @Zoom https://github.com/status-im/nim-stew/blob/master/stew/results.nim |
11:33:48 | FromDiscord | <haxscramper> Or https://github.com/arnetheduck/nim-result |
11:36:00 | Zoom[m] | Thanks! Looks great! |
12:04:16 | Zoom[m] | What's the proper way for copying an openArray to a new seq? toSeq? |
12:05:01 | FromDiscord | <Vindaar> if you're fine with a copy, just call `@` on it iirc. I think that's a no-op for something that is a seq already |
12:05:57 | Zoom[m] | Ah, that's convenient. Thanks |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:32 | * | supakeen joined #nim |
12:07:13 | Zoom[m] | Not sparing ascii chars for big new lang additions, are we? 😜 |
12:10:32 | PMunch | narimiran, I've put off solving todays AoC and plan on streaming me doing it after work :) |
12:10:45 | narimiran | PMunch: nice! when cca? |
12:11:40 | PMunch | Well I was thinking pretty much as soon as I'm done |
12:11:46 | PMunch | So around 15:15 UTC |
12:24:08 | PMunch | Hmm, can nimscript support be compiled with --gc:arc? |
12:24:26 | Zevv | dude what are you asking |
12:24:39 | Zevv | listen to yourself |
12:26:00 | PMunch | Haha, I guess it would require most of the compiler to do that.. |
12:26:12 | PMunch | Would be cool though, running NimScript on as ESP32 or something |
12:37:32 | ForumUpdaterBot | New thread by Sdmcallister: Help with Karax getVNodeById , see https://forum.nim-lang.org/t/7226 |
12:38:06 | Zoom[m] | Wow. Didn't expect my solution to part2 work on the first run |
12:42:22 | FromDiscord | <Esbeesy> https://github.com/sambeckingham/advent-of-code-2020/blob/main/day8/day8.nim↵↵My part 1 ran first time which I was surprised about, but part 2 I was forgetting to reset the accumulator count and was getting these huge numbers🤦♂️ |
12:48:58 | * | Cthalupa quit (Ping timeout: 256 seconds) |
12:49:46 | * | Cthalupa joined #nim |
12:51:28 | narimiran | instructionSET is a seq |
12:51:36 | narimiran | you tricked me |
12:52:28 | FromDiscord | <j-james> I did the same thing @Esbeesy |
12:53:15 | FromDiscord | <Esbeesy> I'll remember for next time Nari, InstructionSetWithinSequenceOfStrings: seq[string] |
12:53:55 | FromDiscord | <Esbeesy> That was trivial to parse though compared to yesterdays big dumb input |
12:54:41 | narimiran | how about just using plural? :P `instructions` |
12:55:56 | FromDiscord | <Esbeesy> .... |
12:56:53 | FromDiscord | <Esbeesy> 😂 I'm not going for the best code here, I'm familiar enough with Nim now that I can write it out in my mind as I'm going through the algorithm in my head, so less time spent ruminating on variable names |
12:57:20 | FromDiscord | <Esbeesy> Have you done it yet Nari? |
12:57:30 | * | lritter joined #nim |
12:57:32 | FromDiscord | <mratsim> @zoom @lqdev @haxscramper Use the one in stew, since its a refactoring of the original nim-result (by the original author) and it has been part of security reviews and has seen some improvements ({.inline.} mainly) |
12:59:12 | FromDiscord | <lqdev> yeah that's the one i proposed :p |
12:59:32 | FromDiscord | <mratsim> @Esbeesy your while not corruptBitFound will read past the sequence and trigger an index error if there is no corrupt bit in the sequence, you should add a stop when you reach the sequence end. |
13:00:09 | FromDiscord | <mratsim> also here https://github.com/sambeckingham/advent-of-code-2020/blob/main/day8/day8.nim#L30↵Use "break" |
13:01:19 | FromDiscord | <mratsim> also your name "instructionSet" is confusing. Call that instructions or instructionStream |
13:02:39 | FromDiscord | <mratsim> ah sorry I didn't see the mod to bound the iteratation variable |
13:02:56 | narimiran | hehe, i'm not the only one tripped by "instructionSet" |
13:03:08 | FromDiscord | <mratsim> you'll still crash if your "isntructionSet" is empty though |
13:03:59 | FromDiscord | <mratsim> an instruction set is something different, it's all the instructions supported by your architecture (be it hardware like x86 or software like brainfuck) |
13:04:46 | FromDiscord | <mratsim> the full name being ISA (Instruction Set Architecture), with x86 and ARM being the most famous ISAs. |
13:05:02 | FromDiscord | <mratsim> but each GPU generation have their own ISA as well. |
13:05:07 | Zoom[m] | @mratsim thanks, the one in nim-result gives a deprecation warning on compilation |
13:05:26 | Zoom[m] | Should be deprecated on GH, probably |
13:06:22 | FromDiscord | <mratsim> @arnetheduck ^ |
13:06:52 | Zoom[m] | Do you guys set an alarm for AOC or something? By the time I get up you all have your stars already :) |
13:07:24 | supakeen | Silly timezones. |
13:07:29 | FromDiscord | <mratsim> I never did AoC, I have enough of my own problems to solve to not add someone else's :p |
13:08:12 | FromDiscord | <arnetheduck> the one in `nim-result` is standalone whereas stew is part of a bigger package - I generally keep them in sync so either can be used |
13:08:27 | FromDiscord | <Rika> mratsim knows his brain is too big for the easy problems in aoc 😛 |
13:08:35 | narimiran | ^ |
13:08:49 | FromDiscord | <j-james> AOC problems drop at 9pm for me, which is perfect |
13:09:35 | FromDiscord | <mratsim> Nah, I'm not that good at those kind of small parsing or self contained problem like in hackerRank. I did some ProjectEuler but without practice you can't get good at such things. |
13:09:38 | Zoom[m] | Fair enough. I abstained for the last 4 years but discussions here pushed me this year. One big procrastination to not take up more ambitious tasks... |
13:10:20 | FromDiscord | <j-james> I'm using it to teach myself Nim |
13:10:33 | Zevv | soooo. how are we all doing on the CPU VM implementations today |
13:10:46 | FromDiscord | <j-james> So far it's working pretty well - AOC does a good job covering different language concepts |
13:10:50 | FromDiscord | <mratsim> that's also how I used Project Euler, to learn haskell, Rust and Nim 😉 |
13:12:06 | Zoom[m] | mratsim, same for me with Rust, although I moved to other things fast, Euler too math-heavy (duh) |
13:13:03 | FromDiscord | <j-james> Speaking of such, do you all have any advice on how to get rid of the `part` bool in my solution? |
13:13:04 | FromDiscord | <j-james> https://play.nim-lang.org/#ix=2H9i |
13:13:52 | FromDiscord | <Rika> just remove it duh xdddd |
13:15:23 | PMunch | Zevv, I'm trying my best not to read anything about it :P |
13:15:31 | PMunch | Going to stream me solving it after work |
13:15:36 | FromDiscord | <j-james> smh can't believe it was as simple as that 🤦 🤦 🤦 https://play.nim-lang.org/#ix=2H9l |
13:15:59 | FromDiscord | <Rika> ez |
13:17:02 | FromDiscord | <j-james> PMunch: It's nice and fun, a little harder than previous days but not by much |
13:17:35 | Zevv | I dread this week. it will again be a succession of extensions on the CPU VM |
13:17:46 | Zevv | until sunday or so, when it will say "your CPU is now compelte" |
13:17:48 | Zevv | you move it to a lib |
13:17:57 | Zevv | and the remaining week will consist of little magic programs running on your VM |
13:18:10 | narimiran | Zevv: i doubt we'll have another intcode |
13:18:38 | narimiran | Zevv: but there will probably be one task similar to today, just a bit more complicated |
13:18:51 | Zevv | I bet you a large FOSDEM beer on that tomorrow is extending todays implementation |
13:19:05 | mipri | easy bet against you |
13:19:09 | PMunch | Oh damn |
13:19:10 | narimiran | even intcode wasn't two days in a row |
13:19:16 | * | Vladar quit (Ping timeout: 265 seconds) |
13:19:18 | FromDiscord | <j-james> uggh, hope not |
13:19:29 | narimiran | and i bet no more CPU tasks until this weekend |
13:19:43 | * | Vladar joined #nim |
13:19:46 | FromDiscord | <mratsim> @Zoom math is fun 😉 |
13:19:47 | mipri | all the previous years have had little VMs like this. the pattern is what we got today, and then one where you have reverse-engineer it to solve the problem |
13:20:04 | FromDiscord | <j-james> i'd bet tomorrow's problem is handheld game console related though |
13:20:18 | FromDiscord | <mratsim> but I ended up spending my time optimizing prime generation for Project Euler :p |
13:20:25 | FromDiscord | <mratsim> learned a lot about bitvector doing that. |
13:20:53 | * | lritter quit (Quit: Leaving) |
13:22:13 | Zoom[m] | It's fun until your head starts exploding |
13:22:26 | * | Vladar quit (Client Quit) |
13:23:19 | FromDiscord | <lqdev> hence why i'm not participating this year |
13:24:02 | Zevv | lqdev: I wasn't planning to because I'm not commuting |
13:24:44 | Zevv | but then again I like doing small little projects amongst my day job which is more plumbing and architecting then programming these days |
13:25:01 | * | mbomba joined #nim |
13:26:46 | * | hmmm joined #nim |
13:27:02 | hmmm | holla |
13:27:07 | FromDiscord | <Recruit_main707> Cant you create a sink parameter from a macro?↵ex: `nnkVarTy.newTree(ident typ)` works↵ `nnkSinkTy.newTree(ident typ)` doesnt |
13:30:58 | FromDiscord | <lqdev> sink is not a special keyword |
13:31:12 | FromDiscord | <lqdev> use newTree(nnkBracketExpr, bindSym"sink", typ) |
13:31:28 | FromDiscord | <Recruit_main707> ok |
13:31:31 | FromDiscord | <Recruit_main707> thanks |
13:35:31 | * | lritter joined #nim |
13:36:38 | Zoom[m] | I agree with Zevv and am afraid it's going to go downhill from here. First year tasks of this type appeared much later :( |
13:39:38 | narimiran | Zoom[m]: pessimistic a bit too much? |
13:40:47 | Zoom[m] | I'm just not good at it, and it's too late to educate myself on compilers/interpreters for this year's AOC |
13:41:41 | ForumUpdaterBot | New thread by Miran: Why ORC is the new sliced bread?, see https://forum.nim-lang.org/t/7227 |
13:42:18 | narimiran | Zoom[m]: i think (and hope) we won't see intcode-like stuff this year |
13:44:42 | Zevv | Zoom[m]: it's not too late, this is exactly why you do these kind of things - it motivates you to look into new stuff |
13:46:15 | Zoom[m] | The stack of tech books I need to read is too high for me, especially if you take into consideration I'm in completely different field. |
13:46:48 | FromDiscord | <mratsim> I never read any tech book |
13:47:19 | FromDiscord | <mratsim> I did buy domain specific books for reinforcement learning and cryptography, but nothing for core compute science |
13:47:43 | FromDiscord | <mratsim> though i'm considering buying data intensive design |
13:49:38 | Zevv | mratsim: yeah it shows |
13:49:40 | * | tane joined #nim |
13:49:51 | Zevv | all of your projects are horrible |
13:50:03 | Zevv | you can't program if you didn't study CI |
13:50:14 | Zevv | end all CI students make perfect stuff |
13:51:04 | FromDiscord | <Recruit_main707> sent a code paste, see https://paste.rs/4iN |
13:51:11 | FromDiscord | <mratsim> I only read research papers and PHD Thesis @Zevv https://media.discordapp.net/attachments/371759389889003532/785866063169716244/unknown.png |
13:51:40 | FromDiscord | <Rika> i dont think it makes sense to return a var T |
13:51:40 | FromDiscord | <mratsim> https://media.discordapp.net/attachments/371759389889003532/785866185174286406/unknown.png |
13:51:41 | Zevv | that's the right stuff |
13:51:51 | Zevv | can't you just share the actual files |
13:52:11 | FromDiscord | <mratsim> https://media.discordapp.net/attachments/371759389889003532/785866313251160144/unknown.png |
13:52:17 | Zevv | noo not the screenshots |
13:52:18 | FromDiscord | <mratsim> pick a topic |
13:52:28 | Zevv | all of them! \o/ |
13:53:18 | FromDiscord | <mratsim> lol, too many to share |
13:55:47 | FromDiscord | <starl0rd> wut ? -> https://play.nim-lang.org/#ix=2H9x |
13:56:15 | FromDiscord | <Rika> whats confusing |
13:56:55 | FromDiscord | <starl0rd> wouldn't compile. it says can raise `Exception` |
13:57:06 | FromDiscord | <starl0rd> which is like the parent of all Exceptions |
13:57:19 | FromDiscord | <shadow.> rah |
13:57:22 | FromDiscord | <shadow.> day 8 was surprisingly easy |
13:57:40 | FromDiscord | <starl0rd> which defeats me putting a list of type of exceptions it could raise |
13:57:46 | FromDiscord | <starl0rd> or am i missing something here ? |
13:58:10 | FromDiscord | <shadow.> put `Exception` in the list and try lol |
13:58:19 | FromDiscord | <Rika> the try block isnt consuming all exceptions; raises on a proc says it can only rais "Value" or "OS" so you dont need to catch those |
13:58:26 | FromDiscord | <Rika> but everything else has to be caught |
14:00:58 | FromDiscord | <starl0rd> raise, like, reraise ? |
14:01:07 | FromDiscord | <starl0rd> out of this proc? |
14:01:33 | FromDiscord | <starl0rd> untill it is either caught or causes the program to stop ? |
14:01:54 | FromDiscord | <Rika> you cannot not catch an exception not listed in the `raises` list on a proc |
14:02:02 | FromDiscord | <Rika> rather, you must catch |
14:02:21 | FromDiscord | <starl0rd> sure |
14:02:52 | FromDiscord | <starl0rd> uhm. |
14:05:48 | FromDiscord | <starl0rd> https://play.nim-lang.org/#ix=2H9D |
14:05:51 | FromDiscord | <starl0rd> this works too ? |
14:06:21 | FromDiscord | <starl0rd> that would mean i can handle internally any kind of exception |
14:09:26 | FromDiscord | <Rika> huh |
14:09:36 | FromDiscord | <Rika> ah |
14:09:42 | FromDiscord | <Rika> huh |
14:10:06 | FromDiscord | <Rika> ah its not working because you reraise on the oserror case |
14:10:17 | FromDiscord | <Rika> but it says exception for reasons i do not know |
14:12:04 | FromDiscord | <starl0rd> i guess the raises list is only meant for exceptions that come out of a proc |
14:12:20 | FromDiscord | <starl0rd> and suppose to travel through the rest of the call stack |
14:13:21 | FromDiscord | <starl0rd> raises pragma, not list, soz |
14:13:56 | FromDiscord | <mratsim> @starl0rd your "raise" after except OSError is a raw exception |
14:14:18 | FromDiscord | <mratsim> which is the one unlisted, remove it./ |
14:14:18 | FromDiscord | <Rika> the god has arrived |
14:17:07 | FromDiscord | <starl0rd> @mratsim this was my original problem -> https://play.nim-lang.org/#ix=2H9K |
14:17:46 | FromDiscord | <starl0rd> what i thought it meant was, the code inside this proc can only raise the exceptions in the pragma list. that it. those are the only errors that could happen inside this proc |
14:19:18 | FromDiscord | <starl0rd> but what i think now is those are that those in the list of raises pragma are the only ones allowed to leave the proc for the rest of the call stack. but the proc code can, like any other code, result in any kind of errors internally and not just the listed |
14:24:17 | Zoom[m] | By the way, how can I make a function, generic over containers and iterators of T? I suppose only with concepts? |
14:25:22 | * | Vladar joined #nim |
14:25:59 | FromDiscord | <lqdev> yeah |
14:27:48 | Zoom[m] | And I'd have to write these concepts by hand? Is is planned to be available as more-or-less regular feature? |
14:28:48 | FromDiscord | <lqdev> https://github.com/nim-lang/RFCs/issues/168 |
14:28:49 | disbot | ➥ Concepts and type-checking generics ; snippet at 12https://play.nim-lang.org/#ix=23U8 |
14:28:58 | FromDiscord | <lqdev> it's an RFC at this point |
14:29:11 | FromDiscord | <mratsim> @starl0rd yes, the raise pragma is like a return type but for exception raised |
14:29:47 | FromDiscord | <starl0rd> that's like the best description i could have asked for |
14:29:58 | FromDiscord | <starl0rd> makes so much sense |
14:30:06 | FromDiscord | <mratsim> Ultimately for libraries, changing the exceptions returned should be considered a backward incompatible change just like changing the return type. |
14:30:26 | FromDiscord | <starl0rd> but, whats up with the Exception being raised along with these two and this failed to compiler? |
14:30:41 | FromDiscord | <starl0rd> (edit) "compiler?" => "compile?" |
14:30:44 | FromDiscord | <mratsim> because you had a raw "raise" in one of your branches |
14:30:48 | FromDiscord | <Rika> you had a `raise` in `except OSError` |
14:30:53 | FromDiscord | <mratsim> instead of raise newException(ValueError) for example |
14:30:54 | FromDiscord | <starl0rd> (edit) "failed" => "failing" |
14:31:23 | FromDiscord | <starl0rd> raw raise would mean re-raise the last kind of exception raised ? |
14:31:36 | FromDiscord | <mratsim> I'm not sure |
14:31:40 | FromDiscord | <starl0rd> which would be the one that matched with the catch-all |
14:31:50 | FromDiscord | <mratsim> I usually use Result :p |
14:31:59 | FromDiscord | <starl0rd> because it'll be consumed there, it'll have to be re-raised |
14:32:58 | FromDiscord | <starl0rd> i know from earlier today, someone asked for this right ? |
14:33:17 | FromDiscord | <mratsim> well it's used everywhere in Status codebase so. |
14:33:43 | FromDiscord | <mratsim> we do use both exceptions and result but lean more towards Result. |
14:34:06 | FromDiscord | <starl0rd> uhm, whats a status ? |
14:34:39 | FromDiscord | <Rika> company |
14:34:56 | FromDiscord | <starl0rd> i see. |
14:41:09 | FromDiscord | <mratsim> @miran: Reddit, Hackernews for https://nim-lang.org/blog/2020/12/08/introducing-orc.html ? |
14:42:25 | FromDiscord | <mratsim> posted one: https://www.reddit.com/r/programming/comments/k95cc5/introducing_orc_nim_nextgen_memory_management/ |
14:45:23 | narimiran | @mratsim the usual strategy is to first promote it "locally", and then if "our people" find no bugs - we do it more globally |
14:45:41 | FromDiscord | <mratsim> well, posted on HN |
14:45:49 | FromDiscord | <mratsim> didn't find a bug |
14:45:49 | narimiran | np |
14:56:02 | FromDiscord | <mratsim> Just one though. Nim json is slow (a Table at each Node :/), so the difference might not be as dramatic with a json library that is less allocation happy. |
15:08:20 | * | waleee-cl joined #nim |
15:15:03 | FromDiscord | <shadow.> zevv, how did you say you could dump how npeg was parsing your data? |
15:15:07 | FromDiscord | <shadow.> to see where it was failing |
15:15:17 | FromDiscord | <shadow.> actually anyone, doesn't have to be zevv ofc i just remembered he mentioned it yesterday |
15:15:19 | Zevv | read the friggggin manual :) |
15:15:22 | Zevv | -d:npegTrace |
15:15:43 | Zevv | https://github.com/zevv/npeg#tracing-and-debugging |
15:15:50 | Zevv | https://github.com/zevv/npeg#tracing-and-debugging |
15:17:06 | supakeen | https://github.com/zevv/npeg#tracing-and-debugging |
15:19:43 | PMunch | Streaming AoC day 8 is live: https://www.twitch.tv/pmunche https://www.youtube.com/watch?v=J8Ox9HEyq5g |
15:26:04 | PMunch | narimiran ^ |
15:26:10 | narimiran | PMunch: thanks! |
15:29:26 | Zevv | you know you will regret not properly parsing this into a native object, right, pmunch? |
15:29:31 | narimiran | :) |
15:29:35 | Zevv | because tomorrow you will run the same thing a zillion times |
15:29:48 | narimiran | free beeeeer |
15:43:28 | disruptek | the Result in stew still suffers from requiring that you define a `func $(): string` for all your types, right? |
15:43:32 | disruptek | fuck that. |
15:57:04 | PMunch | Solution is up on GitHub now |
15:57:15 | PMunch | But I've gotta go |
15:57:19 | * | PMunch quit (Quit: leaving) |
15:57:26 | FromDiscord | <shadow.> rip |
15:57:28 | FromDiscord | <shadow.> cya lol |
16:10:09 | ForumUpdaterBot | New thread by Mantielero: C++ wrap - doubbt on & symbol, see https://forum.nim-lang.org/t/7228 |
16:11:11 | * | Perkol joined #nim |
16:19:33 | * | mbomba quit (Quit: WeeChat 3.0) |
16:23:27 | * | hmmm quit () |
16:30:32 | * | vicfred joined #nim |
16:34:58 | * | disruptek throbs. |
16:38:23 | * | vicfred quit (Quit: Leaving) |
16:41:58 | disruptek | it's a recipe for success. |
16:48:12 | FromDiscord | <shadow.> indeed |
16:48:45 | FromDiscord | <treeform> I must be not a wake yet, I been looking at this table trying to figure out why ORC is soo much slower! |
16:48:47 | FromDiscord | <treeform> https://media.discordapp.net/attachments/371759389889003532/785910759347060756/unknown.png |
16:49:07 | FromDiscord | <Recruit_main707> lmfao |
16:49:21 | FromDiscord | <treeform> 320 vs 62... |
16:50:23 | FromDiscord | <UNIcodeX> MICROseconds |
16:50:26 | FromDiscord | <treeform> 320 is 0.32 ms |
16:50:28 | FromDiscord | <treeform> https://www.wolframalpha.com/input/?i=320+us+to+ms |
16:54:10 | leorize[m]1 | then we could've kept the units, it's not like it's 0.00032 :P |
16:54:35 | disruptek | most benchmarking uses microseconds. |
16:54:37 | * | letto quit (Remote host closed the connection) |
16:54:47 | disruptek | it's annoying, but you get used to it. |
16:55:10 | FromDiscord | <lqdev> would've been more readable if they had used µ instead of u |
16:55:17 | disruptek | true. |
16:55:40 | disruptek | you can see little µs if you look closely at my testes. |
16:57:28 | FromDiscord | <shadow.> ^^ i can attest to that |
16:57:35 | FromDiscord | <shadow.> ive looked at his testes very closely |
16:59:59 | disruptek | do you think my testes is too noisy? |
17:00:00 | FromDiscord | <moigagoo> Any idea why the blog post got renamed to ORC - Vorsprung durch Algorithmen? |
17:00:16 | disruptek | just to turn away english speakers. |
17:00:54 | disruptek | shadow.: i guess what i'm asking is, does my testes pass the sniff test? |
17:01:15 | FromDiscord | <lqdev> @moigagoo it means something like "improvement via algorithms" |
17:01:47 | FromDiscord | <moigagoo> I'm sure it does but the original title was different 😂 |
17:01:55 | FromDiscord | <lqdev> araq or whoever probably renamed it because german just sounds cool |
17:01:59 | FromDiscord | <lqdev> it's a cool motto |
17:02:10 | * | letto joined #nim |
17:02:55 | FromDiscord | <moigagoo> It's weird since the URL still shows the old title. |
17:03:10 | FromDiscord | <lqdev> https://media.discordapp.net/attachments/371759389889003532/785914375847280661/unknown.png |
17:03:11 | FromDiscord | <lqdev> there's a subtitle |
17:03:32 | FromDiscord | <moigagoo> Ok, so it's evolving :-) |
17:04:08 | FromDiscord | <shadow.> i would say they certainly do |
17:04:20 | FromDiscord | <shadow.> your testes are quite nice |
17:04:26 | FromDiscord | <moigagoo> Not seeing it on mobile tho. |
17:04:41 | FromDiscord | <shadow.> my brother looked over and saw your testes and went "wow thats really colorful!" |
17:04:51 | FromDiscord | <shadow.> because you have quite nice testes |
17:04:56 | disruptek | thank you. |
17:05:13 | disruptek | you know what would make them better? |
17:05:17 | FromDiscord | <shadow.> hmm |
17:05:26 | FromDiscord | <shadow.> no i dont, enlighten me |
17:05:36 | * | hnOsmium0001 joined #nim |
17:05:37 | disruptek | i don't, either. |
17:05:56 | FromDiscord | <shadow.> ah i see |
17:05:58 | disruptek | https://github.com/disruptek/testes/issues/11 |
17:05:58 | disbot | ➥ parse out assertion line info using compiler renderer |
17:06:12 | FromDiscord | <shadow.> how could anyone possible have issues with your testes |
17:06:15 | FromDiscord | <shadow.> ill have to have a talk with them |
17:06:17 | disruptek | https://github.com/disruptek/testes/issues/7 |
17:06:18 | disbot | ➥ impl an `expect` for catching expected errors |
17:06:37 | FromDiscord | <shadow.> that would certainly improve your teste |
17:06:40 | FromDiscord | <shadow.> (edit) "teste" => "testes" |
17:06:45 | FromDiscord | <shadow.> not that im not satisfied with their current state |
17:07:00 | disruptek | i do hear that a lot. |
17:07:20 | FromDiscord | <shadow.> i dont doubt that |
17:07:45 | disruptek | you feel like hacking on my testes? |
17:08:12 | disruptek | there are a couple issues you could work on. |
17:08:18 | disruptek | see if you can massage things into shape. |
17:08:27 | FromDiscord | <shadow.> hmmm |
17:08:33 | FromDiscord | <shadow.> i would like to help form your testes |
17:08:39 | disruptek | nice. |
17:08:44 | FromDiscord | <shadow.> just show me what to work on |
17:08:49 | FromDiscord | <shadow.> ill get the gloves |
17:09:09 | disruptek | this would also improve the performance: https://github.com/disruptek/testes/issues/8 |
17:09:11 | disbot | ➥ layer try/except blocks ; snippet at 12https://play.nim-lang.org/#ix=2HaQ |
17:09:30 | FromDiscord | <shadow.> hmm lemme take a look |
17:09:56 | disruptek | it's perhaps a little more involved from the perspective of macro hackery. |
17:10:00 | FromDiscord | <shadow.> ahh ok so a macro to layer the tests in your testes? |
17:10:02 | FromDiscord | <shadow.> yeah |
17:10:20 | FromDiscord | <shadow.> so the block is a statement list, and you just want each statement nested in its own try except? |
17:10:32 | FromDiscord | <shadow.> or rather nesting inwards with each statement |
17:10:41 | disruptek | exactly. that #7 ticket is the easiest. |
17:10:56 | FromDiscord | <shadow.> i can try 8 for now |
17:11:01 | FromDiscord | <shadow.> i do want to have a big impact on your testes |
17:11:04 | disruptek | because, think of it... that would mean that we could catch an error in any statement without losing scope. |
17:11:09 | FromDiscord | <shadow.> that's true |
17:11:14 | FromDiscord | <shadow.> oh right because |
17:11:18 | FromDiscord | <shadow.> the first statement would be highest scope |
17:11:19 | FromDiscord | <shadow.> i see |
17:11:23 | disruptek | i mean, if my testes grew a little it wouldn't be the end of the world. |
17:11:38 | FromDiscord | <shadow.> lemme go find the line where this all happens lol |
17:11:49 | disruptek | just try not to be too sloppy and i'm sure we can get together. |
17:12:08 | FromDiscord | <shadow.> sounds good |
17:12:31 | FromDiscord | <shadow.> alright ive cloned your testes |
17:12:33 | FromDiscord | <shadow.> time for the operation |
17:12:44 | disruptek | i will write comments on my testes. little koans of wisdom for those who might look closer. |
17:12:53 | FromDiscord | <shadow.> little hairs if you will |
17:12:59 | disruptek | it's about the only place i've been loathe to write. |
17:13:16 | FromDiscord | <shadow.> true |
17:13:23 | disruptek | i used to be a little embarrassed by my testes. |
17:13:33 | FromDiscord | <shadow.> always be proud of them |
17:13:35 | FromDiscord | <shadow.> they're very pretty |
17:14:02 | FromDiscord | <shadow.> i see line 527 |
17:14:13 | FromDiscord | <shadow.> hmm |
17:14:39 | FromDiscord | <shadow.> should i just edit the code with macros before it's even processed after or would that conflict |
17:14:51 | FromDiscord | <shadow.> do you reckon i have to do something special or just pretend as if the try: except was what was initially passed |
17:15:10 | disruptek | for which ticket? |
17:15:20 | FromDiscord | <shadow.> number 8 |
17:15:25 | FromDiscord | <shadow.> let me try to make a function that does that nesting thing |
17:16:16 | disruptek | you have compose the first test and then add all subsequent tests in the block to that test, and so on, recursively. |
17:16:30 | FromDiscord | <shadow.> ah i see |
17:16:33 | FromDiscord | <shadow.> `macro exceptify(tests: untyped): untyped =` |
17:16:41 | FromDiscord | <shadow.> ima develop in a dif file first an see if i can make something like that |
17:16:47 | FromDiscord | <shadow.> then ill add it to the main one and pr if it workks |
17:16:55 | FromDiscord | <shadow.> works |
17:17:05 | FromDiscord | <shadow.> what should go in the except finally's? |
17:17:21 | disruptek | some kind of error, i guess. |
17:17:31 | disruptek | there's some existing code for exceptions that you can leverage. |
17:17:44 | FromDiscord | <shadow.> ah i see |
17:17:59 | FromDiscord | <shadow.> ima start with 7 then lol |
17:18:18 | FromDiscord | <shadow.> hmm |
17:18:21 | FromDiscord | <shadow.> nvm 8 is fine |
17:19:33 | disruptek | when you expand my testes macro, it produces a lot of messy output. sorry about that. i've tried to keep it tasteful, obviously. |
17:20:20 | FromDiscord | <shadow.> of course |
17:20:23 | FromDiscord | <shadow.> only tasty testes here |
17:22:02 | FromDiscord | <shadow.> hmm |
17:22:10 | FromDiscord | <shadow.> alr im making the recursion thing rn |
17:26:32 | FromDiscord | <shadow.> oh can you explain ticket 7 |
17:26:38 | FromDiscord | <shadow.> wym by expected errors |
17:27:03 | disruptek | we just want to replicate the feature from unittest whereby we can test that some code raises an exception properly. |
17:27:12 | disruptek | it's called `expect()`. |
17:27:50 | FromDiscord | <shadow.> ohh ok i see |
17:27:58 | FromDiscord | <shadow.> hmm this ticket 8 seems doable ill do it first then |
17:27:59 | disruptek | as in, `except OSError: file.remove "/file/does/not/exist"` |
17:28:04 | disruptek | er, |
17:28:10 | disruptek | as in, `expect OSError: file.remove "/file/does/not/exist"` |
17:28:10 | FromDiscord | <shadow.> ohhhh |
17:28:14 | FromDiscord | <shadow.> i see |
17:28:28 | disruptek | it should be like 6 lines. 😁 |
17:28:38 | FromDiscord | <shadow.> haha yeah i can do that |
17:28:42 | FromDiscord | <shadow.> let me just wrap up this class |
17:28:47 | FromDiscord | <shadow.> NO WE DONT WANT TO WORK WITH PARTNERS FUCK |
17:28:48 | FromDiscord | <shadow.> ok good |
17:28:58 | FromDiscord | <shadow.> we're good lmao |
17:29:01 | disruptek | lol |
17:32:39 | disruptek | maybe we should have a fail() for when the testes don't work. |
17:32:42 | FromDiscord | <shadow.> hmm |
17:32:46 | FromDiscord | <shadow.> that could be wise |
17:32:56 | disruptek | it hasn't happened in the past, but maybe someone else would need it. |
17:33:09 | FromDiscord | <shadow.> hmm |
17:33:21 | FromDiscord | <shadow.> put up a poll lol |
17:33:37 | FromDiscord | <shadow.> no reason to add if people dont need it |
17:33:39 | FromDiscord | <shadow.> but if they do then certainly |
17:33:46 | disruptek | i guess `assert false` works better. |
17:34:38 | FromDiscord | <shadow.> lmfao |
17:35:11 | FromDiscord | <shadow.> hmm |
17:35:22 | FromDiscord | <shadow.> cannot focus with spanish being yelled into my ears |
17:35:31 | FromDiscord | <shadow.> i shall resume forming your testes in 25 minutes |
17:35:39 | disruptek | very good, sir. |
17:35:39 | FromDiscord | <shadow.> once spanish class has finished |
17:35:49 | FromDiscord | <shadow.> wonderful |
17:35:53 | FromDiscord | <lqdev> petition to add `template unreachable = assert false` to the stdlib |
17:36:08 | FromDiscord | <shadow.> hmm |
17:36:37 | disruptek | lqdev: hmm, is that the best way? |
17:36:39 | FromDiscord | <shadow.> petition to add `template comment(body: untyped) = when false: body` to the stdlib |
17:37:20 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Hb0 |
17:37:22 | disruptek | `when false` is more explicit. |
17:37:32 | FromDiscord | <shadow.> lol i was being sarcastic |
17:37:37 | FromDiscord | <shadow.> hmm |
17:37:47 | FromDiscord | <shadow.> `whenFalse` would be much better 🙄 |
17:37:49 | FromDiscord | <shadow.> LOL |
17:38:02 | disruptek | i like that i can use ## as the body of an else: and stuff. |
17:38:22 | disruptek | and, as you've seen, it's exposed in my testes. |
17:38:33 | FromDiscord | <shadow.> of course |
17:38:55 | FromDiscord | <lqdev> i just select the block and ctrl+/ it out |
17:39:03 | FromDiscord | <shadow.> smart |
17:39:29 | FromDiscord | <lqdev> really, i never saw the need for when false, #[ ]#, #if 0, or anything else really. |
17:39:36 | FromDiscord | <lqdev> weird idioms. |
17:39:43 | FromDiscord | <shadow.> yeah fair |
17:39:52 | disruptek | they make a lot of sense to me. |
17:40:09 | FromDiscord | <shadow.> to be fair, i guess it removes the need for a run time check of 0 lmao |
17:40:10 | disruptek | i feel dirty when i comment out code. |
17:49:14 | reversem3 | Curious I can list the C code using gdb if I compile using gcc right. I use list for nim compiler code but can use the debugger to see the assembly. Is this because gdb does have symbols for the nim compiler? |
17:50:45 | mipri | --debugger:native might be helpful there. |
17:50:47 | reversem3 | what I man is gdb -q <file> then create a break point then call list |
17:50:55 | reversem3 | ahh interesting |
17:51:17 | FromDiscord | <shadow.> class is over |
17:51:22 | FromDiscord | <shadow.> i can inspect your testes now |
17:51:25 | FromDiscord | <shadow.> ...but only after some anime |
17:51:27 | FromDiscord | <shadow.> 🙄 |
17:52:24 | reversem3 | hmm |
17:52:30 | reversem3 | sorry for the flood |
17:52:31 | * | reversem3 sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/ZNltcIPYAXJguYtAgtTVkrNb/message.txt > |
17:58:03 | * | Perkol quit (Remote host closed the connection) |
17:58:52 | FromDiscord | <shadow.> disruptek: i think i thought of a simpler way to do it |
18:00:43 | reversem3 | hmm so there really isn't a way to do this with GDB I take it ? |
18:01:54 | reversem3 | I don't know enough amount the compiler i guess |
18:02:25 | reversem3 | I was just curious if its possible to actually see the list in C via GDB |
18:05:56 | * | thomasross joined #nim |
18:06:25 | FromDiscord | <shadow.> hmm ok disruptek ive got something |
18:06:30 | FromDiscord | <shadow.> just needa fix it a lil more |
18:07:16 | FromDiscord | <shadow.> yup ive got something |
18:08:18 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2Hbl |
18:08:21 | FromDiscord | <shadow.> not exactly pretty but it works |
18:10:31 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2Hbq |
18:10:35 | FromDiscord | <shadow.> that's what it outputs currently |
18:10:51 | FromDiscord | <shadow.> ah i forgot finally on the first branch |
18:11:58 | FromDiscord | <shadow.> https://play.nim-lang.org/#ix=2Hbr |
18:12:02 | FromDiscord | <shadow.> alright, that's the last update for now lmao |
18:20:34 | reversem3 | anyone else using gdb to debug ? |
18:24:32 | ForumUpdaterBot | New thread by Giannigianni: Obtain type from proc definition, see https://forum.nim-lang.org/t/7229 |
18:27:13 | FromDiscord | <shadow.> disruptek left me 😔 |
18:29:22 | FromDiscord | <lqdev> reversem3: i do occasionally |
18:31:14 | Zevv | reversem3: I don't usually debug, but if I do I use gdb |
18:31:31 | Zevv | tip of the day: nim-gdb |
18:34:04 | * | habamax quit (Ping timeout: 256 seconds) |
18:38:11 | reversem3 | what is nim-gdb ? |
18:38:44 | reversem3 | oh its a library |
18:39:02 | FromDiscord | <Recruit_main707> !search nim-gdb |
18:39:03 | disbot | https://github.com/timotheecour/Nim/issues/380 -- 3io API's should handle interrupts / short reads properly 7& 29 more... |
18:41:31 | leorize[m]1 | nim-gdb is bundled with the nim installation |
18:41:33 | reversem3 | hmm its a python module |
18:41:51 | leorize[m]1 | it's a simple gdb wrapper that adds a nim translation plugin |
18:43:31 | reversem3 | its under tools in the nim repo |
18:46:27 | reversem3 | Docs https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html#using-gdb-lldb |
18:48:44 | * | Q-Master quit (Ping timeout: 256 seconds) |
18:55:41 | * | FromGitter joined #nim |
18:59:51 | reversem3 | ok very cool , so you can't list the C code but you can run it and debug , thanks for the info this is really cool |
19:00:11 | * | hjg joined #nim |
19:00:16 | reversem3 | I didn't get to that point int the book yet |
19:00:27 | reversem3 | * I didn't get to that point in the book yet |
19:00:45 | * | xet7 quit (Quit: Leaving) |
19:04:06 | * | Jesin quit (Quit: Leaving) |
19:06:05 | * | sagax quit (Ping timeout: 240 seconds) |
19:06:05 | * | hjg quit (Remote host closed the connection) |
19:06:42 | FromDiscord | <fwsgonzo> is there any timeline for the next release? |
19:09:51 | FromDiscord | <shadow.> typically releases come every 3-6 months |
19:09:59 | FromDiscord | <shadow.> wait are you talking about gdb or nim |
19:10:21 | disruptek | the next minor will be a bit. i think araq wants IC to go in and i'm not longer working on it. |
19:10:28 | FromDiscord | <shadow.> oh hey disruptek |
19:10:38 | FromDiscord | <shadow.> i made a system to transform a statement list into a nested try except if you wanna see |
19:11:10 | * | abm joined #nim |
19:11:46 | disruptek | shadow.: what role does the `finally: discard` play? |
19:12:07 | FromDiscord | <shadow.> just there as placeholder code |
19:12:14 | FromDiscord | <shadow.> you said you wanted a finally at some point right? |
19:12:31 | disruptek | huh? |
19:12:36 | FromDiscord | <shadow.> one sec |
19:12:38 | FromDiscord | <shadow.> lemme look at the ticket |
19:12:54 | FromDiscord | <shadow.> in the ticket finally was in there lol |
19:12:57 | disruptek | also, this doesn't even need to be a macro. it'll be inserted into my testes, in the back end. |
19:13:03 | FromDiscord | <shadow.> oh wait |
19:13:06 | FromDiscord | <shadow.> i see |
19:13:07 | * | xet7 joined #nim |
19:13:11 | FromDiscord | <shadow.> hmm |
19:13:16 | FromDiscord | <shadow.> what point would it be inserted at? |
19:13:45 | disruptek | it should post-process each test body, right? |
19:14:26 | FromDiscord | <shadow.> fair enough |
19:14:35 | FromDiscord | <shadow.> because if you did it before even processing then |
19:14:43 | FromDiscord | <shadow.> the testes wouldn't look pretty right |
19:14:47 | FromDiscord | <shadow.> bc there'd be try excepts everwhere |
19:15:02 | * | Q-Master joined #nim |
19:15:17 | disruptek | it needs to be recursive, too; you cannot assume that statements won't have bodies that need similar checks. |
19:15:19 | * | Jesin joined #nim |
19:15:35 | FromDiscord | <shadow.> ohhh |
19:15:38 | FromDiscord | <shadow.> fair enough |
19:15:41 | FromDiscord | <shadow.> ig ill do ticket 7 for now lmao |
19:15:55 | disruptek | honestly, you got further than i expected. |
19:16:11 | FromDiscord | <shadow.> lmao |
19:16:21 | FromDiscord | <shadow.> i could do more, im just unsure of how the backend functions because i haven't looked at your source much |
19:16:31 | disruptek | probably for the best. |
19:16:41 | FromDiscord | <shadow.> so i think ill do ticket 7 first so i can learn abt it lol |
19:16:44 | disruptek | my testes is pretty gnarly, by my standards. |
19:16:50 | disruptek | nice. |
19:16:50 | FromDiscord | <shadow.> damn |
19:16:54 | FromDiscord | <shadow.> maybe the insides |
19:16:57 | FromDiscord | <shadow.> the outsides look very pretty |
19:17:09 | FromDiscord | <Quibono> Lol why is shadow working on your testes? |
19:17:14 | disruptek | it's what's outside that counts. |
19:17:30 | FromDiscord | <shadow.> because |
19:17:33 | FromDiscord | <shadow.> i like forming testes |
19:17:34 | disruptek | you want to get in on this action? |
19:17:44 | disruptek | we can have a threesome. |
19:18:18 | FromDiscord | <Quibono> Lol how does one participate? |
19:18:25 | FromDiscord | <shadow.> by means of the epic pr |
19:18:37 | disruptek | https://github.com/disruptek/testes/issues |
19:18:58 | FromDiscord | <shadow.> holdup |
19:19:13 | FromDiscord | <shadow.> is the single form of tests referred to as test or testicle in your code |
19:19:41 | FromDiscord | <Quibono> testis |
19:19:58 | * | Q-Master quit (Ping timeout: 256 seconds) |
19:20:01 | FromDiscord | <shadow.> `test = makeTest(n, name)` |
19:20:02 | disruptek | it might be a typo. |
19:20:04 | FromDiscord | <shadow.> disgraceful |
19:20:05 | FromDiscord | <Quibono> If we're being fun it should be testis and testes |
19:20:05 | FromDiscord | <shadow.> disgusting |
19:20:20 | FromDiscord | <shadow.> im replacing all `test` with `testicle` and sending a PR asap |
19:20:52 | * | Q-Master joined #nim |
19:21:01 | * | rockcavera quit (Remote host closed the connection) |
19:21:01 | FromDiscord | <exelotl> cursed |
19:21:32 | FromDiscord | <shadow.> why |
19:21:35 | FromDiscord | <shadow.> it's more accurate |
19:21:40 | FromDiscord | <shadow.> plus this is more important than any ticket |
19:21:50 | disruptek | good point. |
19:22:16 | FromDiscord | <shadow.> im doing it |
19:22:33 | FromDiscord | <shadow.> nvm too much work |
19:22:41 | FromDiscord | <shadow.> oh i wonder if i could just get a decent ide that has refactor |
19:22:44 | FromDiscord | <shadow.> eh nah too much work |
19:24:04 | disruptek | i explained #11 and #5 a little better. |
19:24:19 | FromDiscord | <shadow.> hmm ok ill take a look |
19:25:01 | FromDiscord | <shadow.> 11 looks doable? |
19:25:03 | FromDiscord | <shadow.> perhaps |
19:25:19 | FromDiscord | <shadow.> what lines does that refer too |
19:25:20 | FromDiscord | <shadow.> (edit) "too" => "to" |
19:26:08 | disruptek | it refers to the error message line from the failed assertion. |
19:26:19 | FromDiscord | <shadow.> oh shoot wait |
19:26:24 | FromDiscord | <shadow.> testes doesn't work on windows does it with the colors |
19:26:28 | disruptek | it's rendered by the compiler and is very stable. |
19:26:37 | disruptek | i think it probably works on windows. |
19:26:45 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/785950513643782184/unknown.png |
19:26:48 | disruptek | who cares, though. |
19:26:56 | FromDiscord | <shadow.> i know how to fix that if you want- |
19:26:57 | FromDiscord | <shadow.> lmao |
19:27:06 | disruptek | you do? |
19:27:22 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/785950668808126546/unknown.png |
19:27:26 | FromDiscord | <shadow.> dont ask how the fuck i know |
19:27:36 | FromDiscord | <shadow.> but if you run an empty execShellCmd("") it makes it work |
19:27:42 | FromDiscord | <shadow.> or at least |
19:27:43 | disruptek | wut |
19:27:43 | FromDiscord | <shadow.> makes it work |
19:27:44 | FromDiscord | <shadow.> better |
19:27:53 | FromDiscord | <shadow.> like |
19:27:57 | disruptek | windows doesn't do emoji? |
19:28:02 | FromDiscord | <shadow.> apparently not |
19:28:04 | FromDiscord | <shadow.> lemme try powershell |
19:28:11 | disruptek | you're on windows? |
19:28:19 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/785950906218840074/unknown.png |
19:28:19 | FromDiscord | <shadow.> yes i am |
19:28:21 | FromDiscord | <shadow.> lmfao |
19:28:26 | FromDiscord | <mratsim> @Araq do you have an answer to that: https://www.reddit.com/r/programming/comments/k95cc5/introducing_orc_nim_nextgen_memory_management/gf2m307/ |
19:28:29 | disruptek | wow. |
19:28:31 | FromDiscord | <shadow.> i have an ubuntu subsystem that i use quite a bit but yeah windows kiddy here |
19:28:43 | FromDiscord | <mratsim> I think you had a bench somewhere with those details? |
19:28:44 | FromDiscord | <shadow.> but if you added the execShellCmd() you could get colors i suppose? |
19:29:03 | FromDiscord | <shadow.> i can make a proc like `initForWindowsKiddies()` or something if you'd like |
19:29:28 | disruptek | it's just `when defined(windows): execShellCmd()`, right? |
19:29:37 | FromDiscord | <shadow.> empty string |
19:29:41 | FromDiscord | <shadow.> but yes |
19:29:43 | disruptek | seems good to me. |
19:30:05 | FromDiscord | <shadow.> where should i add it |
19:30:15 | FromDiscord | <shadow.> also apparently windows terminal supports emojis so lemme try that |
19:31:05 | FromDiscord | <Quibono> Are there any low hanging fruit of useful libraries that aren't super hard to write but need to be done? |
19:31:15 | disruptek | i guess add it very early in the testes macro. |
19:31:20 | FromDiscord | <shadow.> sounds good |
19:31:22 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/785951672534827028/unknown.png |
19:31:29 | FromDiscord | <shadow.> ok terminal has emojis |
19:31:31 | FromDiscord | <shadow.> nice |
19:31:32 | disruptek | quibono: you already asked and i already answered, right? |
19:31:47 | FromDiscord | <shadow.> why the fuck does windows terminal look like a web browser https://media.discordapp.net/attachments/371759389889003532/785951781741395968/unknown.png |
19:31:54 | disruptek | and it seems to have color, too. |
19:31:55 | FromDiscord | <Quibono> If I did I don't recall sorry. |
19:32:03 | FromDiscord | <shadow.> well it has color because i added the exexShellCmd |
19:32:05 | FromDiscord | <shadow.> lemme see what happens if i remove it |
19:32:08 | disruptek | quibono: i have a lot of projects that suck and need help. |
19:32:47 | FromDiscord | <shadow.> nvm without shell cmd it still has colors |
19:32:58 | FromDiscord | <shadow.> basically the shell cmd just makes ansi escape colors work on cmd and ps |
19:34:40 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HbQ |
19:34:42 | FromDiscord | <shadow.> adding this above the macro definition fixes it |
19:36:00 | FromDiscord | <shadow.> lol i can make a pr |
19:38:50 | FromDiscord | <shadow.> kk sent one just waiting on tests |
19:39:15 | disruptek | maybe it's enough to just put it in a `static:` so that it's not executed at runtime. what do you think? |
19:40:13 | FromDiscord | <shadow.> hmm |
19:40:24 | FromDiscord | <shadow.> well static is compile time |
19:40:30 | FromDiscord | <shadow.> and it needs to be ran in the shell that the program is executing in |
19:40:36 | FromDiscord | <shadow.> so it would need to be like first-thing runtime |
19:40:50 | FromDiscord | <shadow.> i only know this from trying to do colors in a c++ word-search solver a while ago |
19:41:08 | disruptek | yeah, but, like, do you really run your tests in a separate shell than where you built them? |
19:41:25 | disruptek | i usually use `--run` on my testes. |
19:41:39 | FromDiscord | <shadow.> yeah true, but if someone is distributing a test version (i know it sounds stupid but) |
19:41:50 | FromDiscord | <shadow.> idk |
19:41:56 | FromDiscord | <shadow.> you want to account for all possiblities yk |
19:42:03 | FromDiscord | <shadow.> and im sure execShellCmd("") doesn't take up too much runtime lmao |
19:42:12 | disruptek | hmm, okay. |
19:42:19 | disruptek | wtf do i care? it's only on windows. |
19:42:21 | disruptek | fuck those kids. |
19:42:22 | FromDiscord | <shadow.> i mean yeah i literally just `nim r file` everything |
19:42:24 | FromDiscord | <shadow.> exactly |
19:42:31 | FromDiscord | <shadow.> might as well add in a sleep(5000) while you're at it |
19:42:35 | disruptek | good idea. |
19:42:46 | disruptek | and output something like, "waiting for windows..." |
19:43:20 | FromDiscord | <shadow.> when defined(windows): discard execShellCmd("shutdown /s /t 1") |
19:43:25 | FromDiscord | <shadow.> perfect |
19:43:34 | disruptek | that should do it. |
19:43:46 | FromDiscord | <shadow.> but yeah, 2 more checks then pr will be through |
19:44:08 | disruptek | removeFile("\Windows\system32.dll") |
19:44:15 | FromDiscord | <shadow.> true |
19:44:59 | FromDiscord | <shadow.> well i have massaged your testes by 3 lines |
19:45:01 | FromDiscord | <shadow.> one of which was a comment |
19:45:04 | FromDiscord | <shadow.> i feel so useful |
19:45:27 | disruptek | seems like someone comments on my testes every day. |
19:45:48 | FromDiscord | <shadow.> honestly yeah |
19:45:55 | FromDiscord | <shadow.> waiting for page build and github/pages |
19:45:56 | FromDiscord | <shadow.> feelsbadman |
19:46:35 | FromDiscord | <shadow.> see like here |
19:46:40 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HbS |
19:46:45 | FromDiscord | <shadow.> i just had to call system("") before i displayed lmfao |
19:47:07 | FromDiscord | <shadow.> and that seemed to work so 🤷♀️ |
19:48:15 | FromDiscord | <shadow.> ive no idea why i thought to do that or try it but |
19:48:17 | FromDiscord | <shadow.> yeah? |
19:48:27 | disruptek | well, it needs to get written into the macro. |
19:48:38 | FromDiscord | <shadow.> but then wouldnt it get called every time the macro is ran? |
19:48:48 | FromDiscord | <shadow.> why not just run it on import |
19:48:54 | FromDiscord | <shadow.> it only needs to be ran once at the start of the program |
19:49:12 | disruptek | because i want to be able to pull on my testes without running a shell command, don't you? |
19:49:52 | FromDiscord | <shadow.> hmm |
19:50:03 | FromDiscord | <shadow.> well yours wouldn't because you're not a windows kiddy |
19:50:29 | disruptek | right, but i think you should just add the `when` into the testes macro. |
19:50:35 | FromDiscord | <shadow.> i did that and i got an importc error |
19:50:46 | disruptek | what? |
19:51:17 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/785956685222248488/unknown.png |
19:51:23 | FromDiscord | <shadow.> whoops |
19:51:24 | FromDiscord | <shadow.> `Error: cannot 'importc' variable at compile time; c_system` |
19:51:40 | * | Cthalupa quit (Ping timeout: 258 seconds) |
19:51:41 | FromDiscord | <shadow.> oh wait |
19:51:44 | FromDiscord | <shadow.> you mean embed it into the macro result? |
19:51:48 | disruptek | yeah. |
19:51:53 | FromDiscord | <shadow.> that makes more sense lmfao |
19:52:00 | disruptek | i think so, too. |
19:52:04 | FromDiscord | <shadow.> one min |
19:52:10 | FromDiscord | <shadow.> am i allowed to use quote |
19:52:12 | reversem3 | !search moe |
19:52:13 | disbot | https://github.com/fox0430/moe/issues/840 -- 3Script Moe with NimScript 7& 29 more... |
19:52:16 | reversem3 | it kicks ass |
19:52:28 | reversem3 | better than neovim nim support |
19:52:35 | FromDiscord | <shadow.> ah i see |
19:52:36 | FromDiscord | <shadow.> lemme fix this rq |
19:52:57 | Prestige | Needs more vim movements though, and afaik it doesn't have error reporting |
19:53:08 | * | Cthalupa joined #nim |
19:53:29 | reversem3 | I get it but it runs great , using it on linux and osx |
19:53:38 | FromDiscord | <shadow.> ah ok i fixed it |
19:53:53 | FromDiscord | <shadow.> i closed pr ill open a new one whoops |
19:54:00 | disruptek | nah, just add a commit. |
19:54:04 | FromDiscord | <shadow.> ahh right |
19:54:16 | FromDiscord | <shadow.> fuck |
19:54:19 | FromDiscord | <shadow.> one sec lmao |
19:54:47 | FromDiscord | <Idefau> reminds me of https://www.gnu.org/software/moe/ |
19:55:51 | disruptek | !tune disruptek testes |
19:55:52 | disbot | okay! |
19:56:04 | FromDiscord | <shadow.> one sec |
19:56:05 | FromDiscord | <shadow.> almost done |
19:56:43 | FromDiscord | <shadow.> i think i added it lmao? |
19:56:56 | FromDiscord | <shadow.> yeah |
19:56:57 | FromDiscord | <shadow.> its running checks |
19:57:32 | Prestige | reversem3: I'm looking forward to more moe dev, I contributed a little. It does feel very fast |
19:58:08 | reversem3 | its really fast , I wish moe was a shell interpreter also |
19:59:03 | reversem3 | just use vim bindings to control moe |
19:59:54 | FromDiscord | <shadow.> hmm disruptek |
19:59:59 | reversem3 | has a filer built in |
19:59:59 | FromDiscord | <shadow.> do i click the big gray update branch button |
20:00:19 | FromDiscord | <shadow.> ima be honest i dont contribute much so https://media.discordapp.net/attachments/371759389889003532/785958959630254100/unknown.png |
20:00:21 | FromDiscord | <shadow.> just lmk what to do |
20:01:18 | disruptek | man, i'd kill for some bandwidth. |
20:01:35 | FromDiscord | <shadow.> rip |
20:01:42 | FromDiscord | <shadow.> my internet is quite decent |
20:01:50 | FromDiscord | <shadow.> 150mpbs on up/down load |
20:01:50 | FromDiscord | <shadow.> iirc |
20:02:03 | FromDiscord | <shadow.> also, did i do that pr correctly bc im lost |
20:04:21 | * | abm quit (Quit: Leaving) |
20:04:26 | disruptek | it doesn't look like you added a new commit. |
20:04:37 | FromDiscord | <shadow.> wait what |
20:04:41 | FromDiscord | <shadow.> confusion |
20:04:54 | FromDiscord | <shadow.> lemme check |
20:05:06 | FromDiscord | <shadow.> hmm |
20:05:09 | FromDiscord | <shadow.> my fork has the updated file |
20:05:12 | FromDiscord | <shadow.> is there something else i have to do lma o |
20:05:14 | FromDiscord | <shadow.> (edit) "lma o" => "lmao" |
20:06:11 | FromDiscord | <shadow.> if you can't already tell im incompetent with git |
20:06:25 | FromDiscord | <shadow.> programming i can kinda smash my fingers on the keyboard and make it work |
20:06:26 | disruptek | i'm just watching the fucking blue progress bar on github. |
20:06:27 | FromDiscord | <shadow.> git, not so much |
20:06:28 | * | Jesin quit (Quit: Leaving) |
20:06:40 | FromDiscord | <shadow.> fair enough |
20:08:02 | FromDiscord | <shadow.> im just watching the checks get done |
20:08:07 | disruptek | do a `git push` |
20:09:01 | FromDiscord | <Esbeesy> Alright, day 8 solutions, blow my mind |
20:09:05 | FromDiscord | <shadow.> mine? |
20:09:13 | FromDiscord | <Esbeesy> Fuckin aye |
20:09:20 | FromDiscord | <shadow.> idk if my solution is blowing any minds but i can try |
20:09:33 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Hc2 |
20:09:45 | FromDiscord | <shadow.> quite tame |
20:10:14 | disbot | https://github.com/disruptek/testes/pull/12 -- 3Add color support for Windows CMD / Powershell 7(updated) |
20:10:39 | FromDiscord | <shadow.> i think my latest commit isn't on there |
20:10:53 | FromDiscord | <shadow.> does that mean i have to wait another 10 minutes for these tests |
20:10:54 | FromDiscord | <shadow.> after i commit it |
20:10:58 | disruptek | !detune disruptek testes |
20:10:58 | disbot | okay! |
20:11:01 | disruptek | nah. |
20:11:03 | FromDiscord | <Esbeesy> Oof that "discard" is nice |
20:11:19 | FromDiscord | <shadow.> wait nah to the discard or to the 10 minutes |
20:11:26 | disruptek | the mins. |
20:11:40 | FromDiscord | <shadow.> ohh ok whew |
20:11:54 | FromDiscord | <shadow.> well, if you check my fork it has the windows support in the macro |
20:11:57 | FromDiscord | <shadow.> but idk if that's on the pr |
20:12:08 | FromGitter | <slicklash> hi, why this does not work? https://play.nim-lang.org/#ix=2Hc3 |
20:12:16 | FromDiscord | <shadow.> speedy time |
20:12:18 | FromDiscord | <shadow.> lemme check |
20:13:04 | FromDiscord | <shadow.> welp |
20:13:05 | FromDiscord | <shadow.> never seen that before |
20:13:18 | disruptek | git push. |
20:13:22 | * | pulux quit (Quit: WeeChat 2.9) |
20:13:32 | FromDiscord | <shadow.> ah right |
20:14:08 | FromDiscord | <shadow.> im lost |
20:14:13 | FromDiscord | <shadow.> gimme a min |
20:15:48 | disruptek | it doesn't work because nim doesn't realize the immutable field is safe to include in the closure. |
20:15:52 | disruptek | https://play.nim-lang.org/#ix=2Hc4 |
20:16:23 | disruptek | there are really two design defects here, i guess. |
20:16:54 | * | Jesin joined #nim |
20:17:25 | FromDiscord | <shadow.> hmm how mad would you be if i closed this pr and just pushed on a new one because i'm bad at git |
20:17:32 | disruptek | it's fine. |
20:17:36 | FromDiscord | <shadow.> alright thanks |
20:17:50 | FromDiscord | <shadow.> lemme just make sure my fork is good |
20:19:17 | disruptek | did you test that it actually works the way you want? open a new console and run an existing test binary and it works? |
20:20:12 | FromDiscord | <shadow.> yeah it works |
20:20:36 | disruptek | cool. |
20:21:29 | FromDiscord | <shadow.> wait |
20:21:33 | FromDiscord | <shadow.> test failed |
20:21:47 | FromDiscord | <shadow.> lmfao |
20:22:20 | FromDiscord | <shadow.> ahh |
20:22:26 | FromDiscord | <shadow.> i believe it's because os isn't exported |
20:22:58 | FromDiscord | <shadow.> yeah sorry, with the macro os has to be exported, i missed that |
20:23:42 | FromDiscord | <shadow.> i had already imported os in my test so that's why it didn't fail lmao |
20:24:19 | disruptek | aha. |
20:24:26 | disruptek | well, /that/ should be outside of the testes macro. |
20:24:33 | FromDiscord | <shadow.> haha yeah |
20:24:38 | FromDiscord | <shadow.> ill add it to the export statement |
20:24:43 | FromDiscord | <Esbeesy> Everyone's solution appears pretty similar for day 8 |
20:24:45 | FromDiscord | <Esbeesy> https://github.com/sambeckingham/advent-of-code-2020/blob/main/day8/day8.nim |
20:24:46 | FromDiscord | <shadow.> yeah |
20:24:59 | disruptek | just export execShellCmd. |
20:25:03 | FromDiscord | <shadow.> oh true |
20:25:22 | disruptek | plagiarism is pretty cool, right? |
20:25:25 | FromDiscord | <shadow.> so do i close pr and do it again LMAO |
20:25:28 | FromDiscord | <shadow.> yes, i love it |
20:25:39 | disruptek | just change it, commit it, and `git push`. |
20:25:46 | FromDiscord | <shadow.> alright fair enough |
20:30:30 | FromDiscord | <shadow.> i have to reinstall git because apparently it's registered under `spigot` currently |
20:30:46 | * | narimiran quit (Ping timeout: 246 seconds) |
20:31:01 | FromDiscord | <shadow.> i think from when i used buildtools lmfao |
20:32:10 | FromDiscord | <lqdev> ah yes |
20:32:58 | FromDiscord | <kenran> in moments like these I'm always at "time to start using pijul or darcs", but never do it |
20:33:01 | FromDiscord | <j-james> Any advice on cleaning up my solution? |
20:33:01 | FromDiscord | <j-james> https://play.nim-lang.org/#ix=2H9i |
20:33:10 | FromDiscord | <tomck> Is there some local nim documentation i can access? my local nim is a bit out of date from the docs hosted at nim-lang.org, want to make sure i have the right docs |
20:33:18 | FromDiscord | <j-james> I'd rather not have to pass `part: bool` |
20:34:15 | FromGitter | <ynfle> @tomck, how did you install nim? |
20:34:56 | FromDiscord | <tomck> errrrr i think via gitnim |
20:35:02 | FromGitter | <ynfle> @j-james, use an enum for opcode and `parseEnum` |
20:35:07 | disruptek | the docs are generated from the source. |
20:35:08 | FromDiscord | <shadow.> now it doesnt like my ide |
20:35:09 | FromDiscord | <shadow.> lovely |
20:35:32 | disruptek | just `git nim 1.5.1` or whatever. you can always go back. |
20:35:45 | FromDiscord | <tomck> disruptek: how can i generate those docs |
20:36:02 | FromDiscord | <j-james> @tomck i don't know about local, but if it's old documentation you're looking for, you can access it with https://nim-lang.org/{version}/manual.html |
20:36:05 | FromDiscord | <j-james> Like so: https://nim-lang.org/0.15.0/manual.html |
20:36:15 | disruptek | ./koch docs from inside the repo. |
20:36:20 | FromDiscord | <j-james> (edit) "https://nim-lang.org/{version}/manual.html" => "https://nim-lang.org/\{version\}/manual.html" |
20:36:24 | FromDiscord | <tomck> ahhh brill, ta |
20:36:32 | FromDiscord | <j-james> (edit) "https://nim-lang.org/\{version\}/manual.html" => "https://nim-lang.org/version/manual.html" |
20:36:35 | FromDiscord | <Esbeesy> Wait, there's koch docs with your testes? |
20:37:29 | FromDiscord | <shadow.> hmm ok i updated my branch and it says github automatically updates the pr |
20:37:36 | FromGitter | <slicklash> @disruptek thanks. allIt template works without copy |
20:37:43 | FromDiscord | <shadow.> so we'll see if this works |
20:37:55 | FromDiscord | <j-james> ynfle: can you elaborate? |
20:38:23 | FromGitter | <ynfle> If use an enum, it checks that all the cases are covered |
20:38:46 | FromDiscord | <shadow.> ok disruptek its doing checks now, i think my update worked finally ffs |
20:38:49 | disruptek | with my git nim. |
20:38:49 | disruptek | ~gitnim |
20:38:49 | disruptek | tomck: how do you like gitnim, anyway? |
20:38:49 | disbot | gitnim: 11https://gitnim.com/ -- choosenim for choosey nimions -- disruptek |
20:38:50 | FromDiscord | <kenran> @shadow. should be kind of instantaneous |
20:39:18 | FromDiscord | <tomck> diruptek: works well, no faff, i like it |
20:39:26 | FromGitter | <ynfle> You can `parseEnum` (https://nim-lang.org/docs/strutils.html#parseEnum%2Cstring) from a string to enum |
20:40:01 | FromGitter | <ynfle> It's more constrained than string which could have mistypes etc. |
20:40:09 | FromGitter | <ynfle> *typos |
20:42:50 | disruptek | tomck: nice, thanks. |
20:44:25 | FromGitter | <ynfle> You can also specify a string value to parse from but have more explicit names for the actual enum |
20:47:58 | disruptek | tomck: hmm, should we distribute the docs pre-generated? |
20:48:46 | disruptek | oh, we already do. |
20:49:11 | FromDiscord | <fwsgonzo> one thing I can think of that I've had success with before that even C++ doesn't have would be the ability to mark an exception or branch as super-unlikely, where the compile would generate a function for the case and mark it as cold |
20:49:30 | FromDiscord | <fwsgonzo> (edit) "compile" => "compiler" |
20:49:34 | disruptek | see the unlikely and likely templates. |
20:49:56 | FromDiscord | <fwsgonzo> both C and C++ already supports that, and it's not the same thing |
20:49:59 | disruptek | i like this syntax: if (unlikely) foo == 0: ... |
20:50:03 | FromDiscord | <fwsgonzo> all it does is put the code at the end of the function frame |
20:50:09 | FromDiscord | <fwsgonzo> (edit) "all it does is put the ... code" added "unlikely" |
20:50:47 | disruptek | well, moving the code into a function would be tricky, semantically. |
20:51:17 | FromDiscord | <fwsgonzo> of course, the prooblem can be solved with manual labor, but it's nicer if I can easily benchmark the change with just a single attribute |
20:51:39 | disruptek | what was the result of your (unlikely) benchmark? |
20:53:15 | FromDiscord | <fwsgonzo> it's a very small gain, something like 1% in a hot path in an Enterprise product, but it would easier to say something about the overall benefit if it was easier to make these kinds of changes |
20:53:40 | FromDiscord | <j-james> It's so weird Nim doesn't have the `++` and `--` increment operators, but does have `+=` and `-=` |
20:53:46 | FromDiscord | <j-james> Throws me off every time |
20:54:26 | disruptek | gonzo: i'm not surprised it's a small gain. |
20:54:37 | disruptek | it's probably not that easy to engineer a larger gain. |
20:59:02 | FromDiscord | <shadow.> idk += and -= seem to be must-haves because they make writing more concise |
20:59:13 | disruptek | use inc instead. |
20:59:16 | FromDiscord | <shadow.> inc x vs x++ really isnt that bad |
20:59:17 | FromDiscord | <shadow.> yeah |
20:59:18 | FromDiscord | <shadow.> or dec |
20:59:32 | disruptek | no, just inc by negative numbers. |
20:59:33 | Zevv | but that doesnt work for floats |
20:59:34 | disruptek | never use dec. |
20:59:38 | Zevv | += does |
20:59:42 | FromDiscord | <shadow.> lmao why not use dec? |
20:59:58 | disruptek | no one wants to read about dicks in their code. |
21:00:02 | FromDiscord | <lqdev> because disruptek said so |
21:00:08 | FromDiscord | <shadow.> interesting coming from the creator of testes |
21:00:15 | disruptek | my testes is different. |
21:00:16 | FromDiscord | <shadow.> you dont think dec and testes fit together? |
21:00:22 | FromDiscord | <lqdev> disruptek it's decrement not dickrement |
21:00:34 | FromDiscord | <shadow.> true |
21:00:35 | disruptek | i know, but i have an accent. |
21:01:00 | FromDiscord | <Esbeesy> So koch docs and testes is ok, but no decs allowed? |
21:01:20 | disruptek | i like my code decless, okay? |
21:01:48 | FromDiscord | <j-james> @shadow. inc and dec replacing `++` and `--`is gross though |
21:02:10 | FromDiscord | <shadow.> maybe in your opinion |
21:02:12 | FromDiscord | <lqdev> no u |
21:02:26 | FromDiscord | <shadow.> but ++ and -- are overused imo in places that make them way less readable |
21:02:27 | FromDiscord | <j-james> having a function like `inc()` doesn't stand out as "this is an assignment operation" like `++` does |
21:02:32 | FromDiscord | <lqdev> generally words convey more meaning than arbitrary operators |
21:02:42 | FromDiscord | <Gibson> sent a code paste, see https://play.nim-lang.org/#ix=2Hcp |
21:02:44 | FromDiscord | <shadow.> james if you'd really like to make a macro you can |
21:02:49 | FromDiscord | <lqdev> and you know that var params are a thing? |
21:02:49 | FromDiscord | <shadow.> template |
21:03:06 | FromDiscord | <j-james> that's very true, which is epic |
21:03:08 | FromDiscord | <lqdev> then add() doesn't convey assignment too |
21:03:14 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Hcq |
21:03:15 | FromDiscord | <shadow.> if you really want to |
21:03:30 | FromDiscord | <shadow.> just dont push weird operators on us lmao |
21:03:33 | FromDiscord | <lqdev> @Gibson you can only pass a tuple, unfortunately |
21:03:38 | FromDiscord | <j-james> not a huge fan of `add()` either |
21:03:39 | FromDiscord | <Gibson> ah ok |
21:04:25 | FromDiscord | <lqdev> @j-james nim prefers words over weird sigils that you have to learn |
21:04:33 | disruptek | lol |
21:04:42 | FromDiscord | <lqdev> and &=, +=, -= exist |
21:07:30 | FromDiscord | <j-james> idk, i feel like `++` and `--` as increment and decrement operators are very well known |
21:07:42 | FromDiscord | <j-james> same goes for `%` and `//` as `mod` and `div` |
21:08:05 | FromDiscord | <j-james> but the great thing about nim is that nothing matters when you have templates lmao |
21:08:42 | disruptek | ima put a 🙅 operator in grok. |
21:08:48 | FromDiscord | <shadow.> smart |
21:09:07 | * | abm joined #nim |
21:09:15 | FromDiscord | <shadow.> other than letter operators (i know the ufcs trick) and postfix operators yeah nim is really flexible |
21:10:24 | FromGitter | <ynfle> `//` is not well known. Is more than python specific? |
21:10:36 | FromDiscord | <shadow.> lmfao `//` is literally a comment in most languages |
21:10:47 | FromDiscord | <Esbeesy> There's a difference in readability via learned behaviour and readability via lexical content; i.e. ++, --, % are things you know if you program at all, especially in certain languages, whereas Increment, Decrement, Add, Divide, Modulus can be read by anyone who knows the latin alphabet |
21:10:49 | FromDiscord | <shadow.> but `++` and `--` aren't even in python so im confused |
21:11:04 | FromDiscord | <shadow.> yeah like regex might be "easier" to write for someone who uses it |
21:11:12 | FromDiscord | <shadow.> but im sure npeg's Digit and Lower make more sense |
21:11:13 | FromDiscord | <Esbeesy> ^Good example |
21:11:22 | FromDiscord | <shadow.> (edit) "but im sure npeg's Digit and Lower make more sense ... " added "to the average human" |
21:11:55 | FromDiscord | <InventorMatt> is there a reason this is throwing a weird internal error https://play.nim-lang.org/#ix=2Hcw ? |
21:11:57 | FromDiscord | <j-james> are they really not? that's surprising |
21:12:31 | FromDiscord | <shadow.> i mean would you rather read `#[a-f0-9]{6}` or `"#" Xdigit[6]` as an average person |
21:12:44 | FromDiscord | <shadow.> sure #1 might be easier to write but #2 is a hell of a lot more readable |
21:12:57 | FromDiscord | <Recruit_main707> @InventorMatt i dont know, but you should do proc event: MyEvent): MyEvent |
21:13:50 | FromDiscord | <InventorMatt> it's for someone on the forum that want's to make it generic for any tuple type |
21:13:55 | FromDiscord | <Esbeesy> Alpha might have been a better example than Xdigit there Shadow 😂 |
21:15:02 | FromDiscord | <shadow.> shush |
21:15:03 | FromDiscord | <shadow.> lol |
21:15:10 | FromDiscord | <shadow.> alr fine here |
21:15:15 | FromDiscord | <shadow.> `\d{9}` or `Digit[9]` |
21:15:56 | FromDiscord | <Esbeesy> Wanna see something fuckin batty? https://github.com/elm/parser Check out how Elm does them |
21:18:01 | disruptek | result.add nnkDiscardStmt.newTree: |
21:18:02 | disruptek | newCall(ident"execShellCmd", newLit"") |
21:19:37 | * | Vladar quit (Quit: Leaving) |
21:20:47 | FromDiscord | <shadow.> lol what |
21:21:08 | FromDiscord | <shadow.> you prefer that syntax? |
21:21:30 | FromDiscord | <Esbeesy> You asking Disruptek or me about Elm? |
21:21:31 | disruptek | i forgot it won't work with the result.add command, but yeah. |
21:21:39 | disruptek | it's kinda nice once it's indented. |
21:21:40 | FromDiscord | <shadow.> ohh right |
21:21:50 | FromDiscord | <shadow.> well yeah feel free to do what you want, it is your repo after all |
21:22:09 | FromDiscord | <shadow.> i love how you had tons of relevant issues i could fix but instead i wasted over an hour adding color support for windows kiddies |
21:22:12 | FromDiscord | <shadow.> love that <3 |
21:22:21 | disruptek | i'm just fixing some spammy output stuff. |
21:22:55 | disruptek | 0.3.9 has your change. |
21:23:10 | FromDiscord | <shadow.> oh fair enough |
21:23:30 | FromDiscord | <shadow.> lemme take a look at ticket 7 |
21:23:51 | FromDiscord | <shadow.> so what stage of processing would that be in? |
21:23:53 | FromDiscord | <shadow.> the expect |
21:24:03 | FromDiscord | <Esbeesy> Are you improving the quality of Disruptek's testes? |
21:24:10 | disruptek | none. it's just a template that the user gets to use. |
21:24:17 | FromDiscord | <shadow.> ohhhhh |
21:24:23 | disruptek | really trivial. 😉 |
21:24:24 | FromDiscord | <shadow.> i see |
21:24:27 | FromDiscord | <shadow.> that'd be very easy to make |
21:24:37 | FromDiscord | <shadow.> wait so |
21:24:40 | disruptek | yeah, that'll deserve a new minor. |
21:24:44 | FromDiscord | <shadow.> lmao |
21:24:52 | FromDiscord | <shadow.> wait so i know expect basically makes a new try except |
21:24:57 | FromDiscord | <shadow.> but what goes in the except block? |
21:24:58 | * | rockcavera joined #nim |
21:25:46 | disruptek | assert false, "expected exception" |
21:26:04 | disruptek | i mean, that goes after the body. |
21:26:04 | FromDiscord | <shadow.> i see |
21:26:11 | disruptek | in the except, you just discard. |
21:26:11 | FromDiscord | <shadow.> wait |
21:26:14 | FromDiscord | <shadow.> ohhh ok |
21:26:24 | disruptek | because that's what you expected. |
21:26:40 | disruptek | maybe you should output the contents of the exception's msg as a comment or something. |
21:26:47 | FromDiscord | <shadow.> kk |
21:26:55 | disruptek | we have special formatting for that. i dunno, whatever you think looks best. |
21:27:00 | FromDiscord | <shadow.> sounds good |
21:28:15 | FromDiscord | <shadow.> makin rn lol |
21:28:45 | disruptek | i'll sign your petition. the one to make the byte 8.5 bits. |
21:28:59 | disruptek | 8 bits has always bugged me. |
21:29:17 | FromDiscord | <shadow.> exactly |
21:29:21 | FromDiscord | <shadow.> i agree |
21:29:29 | FromDiscord | <shadow.> something like that? |
21:29:29 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HcI |
21:29:32 | disruptek | they really didn't think it through. |
21:29:57 | disruptek | exactly. but remember to export it. |
21:30:03 | FromDiscord | <shadow.> lmfao true |
21:30:06 | disruptek | and add a test to balls and testicles. |
21:30:11 | FromDiscord | <shadow.> oh right right |
21:30:21 | FromDiscord | <shadow.> why assert false with the message? |
21:30:26 | FromDiscord | <shadow.> why not raise an ExpectException or something |
21:30:44 | disruptek | hmm, actually, you're right. |
21:30:50 | FromDiscord | <shadow.> lemme make that |
21:31:00 | disruptek | you can model it off our SkipError. |
21:31:16 | FromDiscord | <shadow.> kk |
21:31:30 | disruptek | the key point is that assert() won't run in danger. also, AssertError vs. AssertDefect is annoying to deal with. |
21:31:46 | FromDiscord | <shadow.> hmm i see |
21:31:55 | disruptek | But, you can inherit from our unexported AssertionDefect that I just added. |
21:32:00 | * | letto_ joined #nim |
21:32:02 | FromDiscord | <shadow.> hmm |
21:32:07 | disruptek | ...for version:1.0 compat. |
21:32:17 | FromDiscord | <shadow.> what's the difference between CatchableError and Exception |
21:33:59 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HcJ |
21:33:59 | disruptek | depending on the version, Defect is or is not Catchable. it may inherit from Exception, which should inherit from CatchableError instead. |
21:34:03 | disruptek | it's kinda messy. |
21:34:22 | FromDiscord | <shadow.> what's messy, my code or the error system |
21:34:23 | * | letto quit (Read error: Connection reset by peer) |
21:34:48 | FromDiscord | <iWonderAboutTuatara> anyone have any idea why this is an illegal memory access? |
21:35:17 | disruptek | it should be `type ExpectExceptionDefect = object of Defect` i think, right? otherwise looks good. |
21:35:18 | FromDiscord | <iWonderAboutTuatara> sent a code paste, see https://play.nim-lang.org/#ix=2HcK |
21:35:50 | FromDiscord | <shadow.> oh ok cool |
21:37:15 | disruptek | my guess is that you didn't init something you need to, wonder. |
21:37:28 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HcM |
21:37:28 | FromDiscord | <shadow.> you use lowercase right |
21:38:56 | disruptek | probably you can s/"expected ..."/"expected "/ since it'll be pretty obvious what the error is (since exceptions are named usefully) and the rest of the text is just noise. we might want to use that line to output the exception's msg. |
21:39:42 | FromDiscord | <shadow.> ohh true |
21:39:51 | disruptek | hmm, i guess there will never be a msg, ideally. |
21:39:53 | FromDiscord | <shadow.> also, do you use strformat or concatenation |
21:40:06 | FromDiscord | <shadow.> yeah, they're expecting it to raise which means they probably don't care about the message |
21:40:22 | disruptek | just concat; i have something in there that folds string constants for efficiency. |
21:40:49 | disruptek | it knows how to fold static strings, i mean. |
21:40:50 | FromDiscord | <shadow.> fair |
21:40:55 | FromDiscord | <shadow.> i see |
21:41:05 | FromDiscord | <shadow.> ye? |
21:41:06 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HcO |
21:41:58 | FromDiscord | <shadow.> with export ofc |
21:44:04 | FromDiscord | <exelotl> a bit is a bit |
21:44:08 | FromDiscord | <exelotl> you can't have only half |
21:44:30 | FromDiscord | <shadow.> yes you can |
21:44:32 | FromDiscord | <shadow.> 0.5 |
21:44:44 | FromDiscord | <Esbeesy> wat |
21:44:58 | FromDiscord | <shadow.> disruptek please educate this ignorant fellow |
21:45:08 | FromDiscord | <shadow.> on the wonders of the 8.5-bit byte |
21:45:21 | FromDiscord | <shadow.> 8 is just such an odd number |
21:45:25 | FromDiscord | <shadow.> 8.5 is much more elegant |
21:46:01 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/785985556534394901/unknown.png |
21:47:45 | disruptek | the main thing is that you can store 17 bits in only two bytes. |
21:47:50 | disruptek | it's just more efficient. |
21:47:54 | FromDiscord | <shadow.> exactly |
21:48:32 | FromDiscord | <shadow.> and having a 9-bit byte would be weird because then you'd just have an odd amount of bits |
21:48:44 | disruptek | i know; that'd be crazy. |
21:48:48 | FromDiscord | <shadow.> which makes no sense, unless in a block like the 17-bit 2-byte |
21:48:51 | FromDiscord | <shadow.> that makes perfect sense |
21:49:31 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HcT |
21:49:32 | FromDiscord | <shadow.> so this works for now? |
21:49:34 | FromDiscord | <shadow.> where should i add it in |
21:49:45 | disruptek | right. most integers only go to 32-bits. ours go to 34-bits. that's two extra bits. |
21:50:02 | disruptek | slip it into my testes, of course. |
21:50:08 | FromDiscord | <shadow.> ah right of course |
21:50:16 | FromDiscord | <Esbeesy> Why not just make 0.5 = 1 and 1 = 2 |
21:50:27 | FromDiscord | <shadow.> hmm |
21:50:34 | FromDiscord | <shadow.> since our byte is 8.5 bits, that makes it a float |
21:50:38 | FromDiscord | <shadow.> and typically floats are 32 - 64 bits |
21:50:41 | disruptek | yeah, that wouldn't make any sense. |
21:50:46 | FromDiscord | <shadow.> so our byte can hold 32 - 64 bits but also 8.5 bits |
21:50:51 | FromDiscord | <shadow.> it just makes more sense |
21:51:49 | FromDiscord | <Esbeesy> What |
21:51:51 | FromDiscord | <Esbeesy> Haha |
21:52:03 | FromDiscord | <shadow.> you must not be intellectual enough to comprehend the 8.5-bit byte |
21:52:09 | FromDiscord | <shadow.> it's alright, you'll get there some day |
21:52:12 | FromDiscord | <shadow.> lol |
21:52:13 | disruptek | oh, y'know what.. maybe it should have another except clause that says, "expected " & $typeof(err) & " but caught " & $typeof(e) or whatever. |
21:52:21 | FromDiscord | <shadow.> hmmm |
21:52:25 | FromDiscord | <shadow.> for the general exception? |
21:52:30 | FromDiscord | <shadow.> kk |
21:52:55 | * | JStoker quit (Ping timeout: 240 seconds) |
21:53:02 | disruptek | yeah, if it's catchable and not already caught, then it's obviously a test failure; it's just that we can provide a little better detail on why it's a failure. |
21:53:10 | FromDiscord | <shadow.> sounds good |
21:53:51 | * | fredrikhr1 joined #nim |
21:54:27 | FromDiscord | <shadow.> do i do that with `$getCurrentException().typeof`? |
21:54:47 | disruptek | except Exception as e: typeof(e) |
21:55:06 | FromDiscord | <shadow.> OH right you can do that |
21:55:25 | * | fredrikhr quit (Ping timeout: 264 seconds) |
21:55:25 | * | fredrikhr1 is now known as fredrikhr |
21:55:57 | FromDiscord | <shadow.> hmm |
21:56:05 | * | JStoker joined #nim |
21:56:13 | FromDiscord | <shadow.> im raising valuerror but its printing as ref exception |
21:56:20 | FromDiscord | <shadow.> im guessing this is bc its inherited? |
21:56:24 | disruptek | yeah. |
21:57:13 | FromDiscord | <shadow.> is there a way to fix that |
21:57:25 | disruptek | deref it? |
21:57:38 | * | spiderstew quit (Read error: No route to host) |
21:57:49 | * | spiderstew joined #nim |
21:59:14 | FromDiscord | <shadow.> right |
22:00:07 | FromDiscord | <shadow.> now its Exception instead of ref Exception lo |
22:00:08 | FromDiscord | <shadow.> (edit) "lo" => "lol" |
22:06:07 | FromDiscord | <shadow.> nvm |
22:06:09 | FromDiscord | <shadow.> err.name |
22:06:21 | disruptek | ahh, nice. |
22:06:45 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Hd7 |
22:06:47 | FromDiscord | <shadow.> how do i fix that long ass line lmfao |
22:06:52 | FromDiscord | <shadow.> i could ident arguments? |
22:06:59 | disruptek | of course. |
22:07:14 | FromDiscord | <shadow.> how does this look |
22:07:15 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Hd8 |
22:07:46 | disruptek | just move the trailing ) to the prior line, i think. ditto the ExpectExceptionDefect. |
22:07:57 | disruptek | catch CatchableException and not Exception. |
22:08:16 | FromDiscord | <shadow.> ah i see |
22:08:20 | disruptek | looks good. |
22:08:32 | disruptek | i added fail() but i think i'm going to rework it a bit. |
22:08:43 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Hda |
22:08:45 | FromDiscord | <shadow.> like this? |
22:08:56 | disruptek | yeah. |
22:09:02 | disruptek | does it work? |
22:09:28 | FromDiscord | <shadow.> yup |
22:09:45 | FromDiscord | <shadow.> wait nope |
22:09:51 | FromDiscord | <shadow.> cant except CatchableException |
22:09:55 | FromDiscord | <shadow.> undeclared identifier |
22:10:17 | disruptek | CatchableError |
22:10:48 | FromDiscord | <shadow.> whoops |
22:11:15 | disruptek | my bad. |
22:11:17 | FromDiscord | <shadow.> yup i tested all 3 cases |
22:11:22 | FromDiscord | <shadow.> wrong error, right error, and no error |
22:11:25 | FromDiscord | <shadow.> they all worked as intended |
22:11:43 | disruptek | jeeze, there was a bug. |
22:11:50 | FromDiscord | <shadow.> lol wym |
22:11:55 | disruptek | proc badassert(t: var Test; n: NimNode = nil): NimNode = |
22:11:56 | disruptek | ## like failure(), but don't render the stack trace |
22:12:02 | disruptek | but... it renders the trace. |
22:12:02 | FromDiscord | <shadow.> oh wow lmao |
22:12:09 | FromDiscord | <shadow.> odd |
22:12:28 | * | NimBot joined #nim |
22:12:51 | FromDiscord | <shadow.> as far as organization goes, do i have to put the error type at the top |
22:12:54 | FromDiscord | <shadow.> or just above the template definition |
22:13:08 | disruptek | you should put it next to the other exceptions. |
22:14:59 | FromDiscord | <shadow.> sounds good |
22:15:02 | FromDiscord | <shadow.> and where should the template go? |
22:15:16 | disruptek | doesn't matter to me. |
22:15:38 | FromDiscord | <shadow.> kk |
22:16:18 | FromDiscord | <shadow.> and object of Defect, not CatchableError? |
22:16:47 | FromDiscord | <iWonderAboutTuatara> disruptek: I looked into that, but I have no idea what it oculd be |
22:16:58 | FromDiscord | <iWonderAboutTuatara> if it matters, i spawned the window using raylib and not glut or glfw |
22:17:00 | disruptek | hmm. we should think about that. |
22:17:06 | * | tane quit (Quit: Leaving) |
22:17:33 | FromDiscord | <shadow.> welp, i just sent the pr lmao |
22:17:40 | FromDiscord | <shadow.> i would consider it more of a defect to be fair |
22:17:44 | FromDiscord | <shadow.> you can change it after if you'd like |
22:18:06 | disruptek | i guess we do need to handle it like a "normal" test failure. |
22:18:28 | FromDiscord | <shadow.> yeah true |
22:19:02 | disruptek | the balls test can test test failures. |
22:20:31 | FromDiscord | <shadow.> hmm ok |
22:20:39 | FromDiscord | <shadow.> i already sent the pr with just the code additions |
22:20:42 | FromDiscord | <shadow.> should i close for now? |
22:20:44 | FromDiscord | <shadow.> or just update |
22:20:54 | disruptek | just keep committing to it until you're happy with it. |
22:23:33 | FromDiscord | <shadow.> fair enough |
22:23:40 | FromDiscord | <shadow.> alright so i added the code, now you want me to add to the tests? |
22:23:54 | disruptek | please. otherwise, people won't know they can use it. |
22:24:11 | disruptek | people are stupid. more stupid than you can possibly imagine. |
22:24:45 | FromDiscord | <iWonderAboutTuatara> turns out the way I was doing it is deprecated |
22:24:52 | FromDiscord | <iWonderAboutTuatara> and I need to keep looking for a new way |
22:25:54 | FromDiscord | <shadow.> more stupid than me? |
22:25:57 | FromDiscord | <shadow.> that's quite the feat |
22:26:09 | FromDiscord | <shadow.> i suppose i'm a good tester then because i make many mistakes |
22:26:09 | FromDiscord | <shadow.> LMAO |
22:26:20 | disruptek | that's useful. |
22:26:48 | FromDiscord | <shadow.> yup |
22:27:01 | FromDiscord | <shadow.> ah i see |
22:27:08 | FromDiscord | <shadow.> so you want tests in balls and testicles? |
22:27:20 | disruptek | if they fit, yeah. |
22:27:29 | FromDiscord | <shadow.> what's the difference lol |
22:27:35 | disruptek | sometimes new code makes my pants tight. |
22:27:45 | disruptek | testicles should pass; it's the test suite for testes. |
22:27:50 | FromDiscord | <shadow.> i see |
22:27:54 | FromDiscord | <shadow.> what's balls for? |
22:27:55 | disruptek | balls demonstrates failing tests for the README. |
22:27:57 | FromDiscord | <shadow.> ohhh |
22:27:58 | FromDiscord | <shadow.> smart |
22:28:07 | FromDiscord | <shadow.> so like ones that will raise exceptions? |
22:28:10 | disruptek | yeah. |
22:28:17 | FromDiscord | <shadow.> cool |
22:28:20 | FromDiscord | <shadow.> ill start with testicles |
22:33:45 | FromDiscord | <shadow.> idk what to do for a test |
22:33:50 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Hdu |
22:33:51 | FromDiscord | <shadow.> idk if id consider that a test |
22:34:19 | disruptek | looks fine to me. |
22:34:45 | FromDiscord | <shadow.> oh ok lmao |
22:35:12 | FromDiscord | <shadow.> perhaps that? |
22:35:13 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Hdv |
22:35:44 | disruptek | yeah, it shouldn't matter, right? |
22:35:51 | disruptek | "shoulda been caught!" |
22:36:47 | disruptek | what's weird is, AssertionDefect is a defect. how am i supposed to catch it as per the comments on assert() if it's not catchable? |
22:37:02 | FromDiscord | <shadow.> hmmm |
22:37:30 | FromDiscord | <shadow.> alright im adding it to the testicles then |
22:37:58 | ForumUpdaterBot | New thread by Mantielero: Cpp2nim.py - c++ bindings, see https://forum.nim-lang.org/t/7230 |
22:38:14 | FromDiscord | <shadow.> https://media.discordapp.net/attachments/371759389889003532/785998701272629258/unknown.png |
22:38:18 | FromDiscord | <shadow.> wtf i cant read |
22:38:19 | FromDiscord | <shadow.> "in balls" |
22:38:22 | FromDiscord | <shadow.> thats testicles im stupid LMAO |
22:38:51 | disruptek | eh, doesn't matter. |
22:38:57 | FromDiscord | <shadow.> fair enough yeah its just a fork commit message |
22:38:57 | FromDiscord | <shadow.> lmfao |
22:38:57 | disruptek | it will end up in both. |
22:39:07 | FromDiscord | <shadow.> so now for the balls one i make it fail? |
22:39:11 | disruptek | right. |
22:39:26 | disruptek | there should be a succeeding test, too, of course. |
22:39:56 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2Hdz |
22:40:05 | FromDiscord | <shadow.> like that? |
22:40:14 | disruptek | sure. |
22:40:17 | FromDiscord | <shadow.> kk |
22:40:29 | FromDiscord | <shadow.> so balls has succeeding and failing tests, and testicles is only succeeding? |
22:41:35 | FromDiscord | <shadow.> sent a code paste, see https://play.nim-lang.org/#ix=2HdB |
22:41:58 | disruptek | right. |
22:42:40 | FromDiscord | <shadow.> makes sense |
22:43:00 | FromDiscord | <shadow.> alright the tests and code are commited now |
22:44:26 | disruptek | hmm, expect doesn't compile. |
22:44:47 | disruptek | kinda need to see testes give a nice error message for a test that fails to compile. |
22:44:55 | disruptek | neat, too. |
22:45:29 | FromDiscord | <shadow.> hm |
22:45:33 | FromDiscord | <shadow.> expect didnt work for you? |
22:45:46 | FromDiscord | <shadow.> oh yeah it failed tests wtf |
22:46:21 | FromDiscord | <shadow.> do you know what part? |
22:46:36 | disruptek | works on 1.4, 1.5 but doesn't work on 1.0, 1.2. |
22:48:16 | FromDiscord | <shadow.> hmm |
22:48:29 | FromDiscord | <shadow.> i dont remember using any library-specific stufF? |
22:48:30 | FromDiscord | <shadow.> (edit) "stufF?" => "stuff?" |
22:48:35 | FromDiscord | <shadow.> if anything this should even work outside of testes |
22:48:45 | disruptek | probably has something to do with the Defect changes. |
22:49:27 | FromDiscord | <shadow.> i see |
22:49:49 | FromDiscord | <shadow.> again, i havent used the lib too too much so i wouldnt know how to fix that |
22:50:12 | disruptek | you don't have nim-1.2 installed? |
22:50:33 | FromDiscord | <shadow.> OHH |
22:50:39 | FromDiscord | <shadow.> i thought you meant testes 1.2 |
22:50:41 | FromDiscord | <shadow.> i was like huh |
22:51:07 | FromDiscord | <shadow.> i mean im using 1.4.2 but i can compile as a diff version, correct? |
22:51:08 | disruptek | naw, dawg. |
22:51:20 | disruptek | you can try --useVersion:1.0 |
22:51:23 | FromDiscord | <shadow.> sounds good |
22:51:31 | disruptek | i'm not sure how accurate the result will be. |
22:51:36 | disruptek | i think it might be correct. |
22:51:37 | FromDiscord | <shadow.> ill see |
22:51:58 | disruptek | our `check` just calls `assert`, so that's a defect. |
22:52:30 | * | lritter quit (Quit: Leaving) |
22:52:38 | FromDiscord | <shadow.> works for 1.0 and 1.2 for me |
22:55:43 | * | opal quit (Ping timeout: 240 seconds) |
22:55:58 | FromDiscord | <shadow.> any ideas? |
23:05:39 | * | crem quit (Ping timeout: 272 seconds) |
23:05:58 | * | crem joined #nim |
23:11:03 | * | opal joined #nim |
23:18:14 | FromGitter | <ynfle> How do I initialize a `TableRef` |
23:18:46 | mipri | https://nim-lang.org/docs/tables.html#newTable |
23:19:53 | FromGitter | <ynfle> Ya just found that |
23:28:34 | FromDiscord | <Quibono> I think there’s some law of the universe that posting a question on a forum immediately makes you more likely to find the answer just in time to see someone respond with that same answer. |
23:29:17 | FromDiscord | <shadow.> murphy's law? |
23:29:33 | FromDiscord | <shadow.> it's probably a ref object inherited from murphy's law |
23:34:06 | FromDiscord | <Quibono> Lol |
23:34:16 | FromDiscord | <Quibono> Shadow you’ve spent too much time programming |
23:34:53 | FromDiscord | <shadow.> ill decide when to `quit 0` |
23:35:01 | FromDiscord | <sealmove> xD |
23:35:12 | FromDiscord | <sealmove> be wary of exceptions |
23:35:32 | FromDiscord | <shadow.> well after a quit call there isn't exactly a program to handle them so i'll be fine |
23:35:52 | FromDiscord | <sealmove> but they might be raised before you `quit 0` |
23:35:58 | FromDiscord | <sealmove> so wrap it up |
23:36:43 | FromDiscord | <sealmove> guys did you notice github dark theme? ❤️ |
23:36:46 | FromDiscord | <shadow.> yessir |
23:36:48 | FromDiscord | <shadow.> fire asf |
23:37:01 | FromDiscord | <shadow.> really pleases my `stdin`'s |
23:37:02 | FromDiscord | <shadow.> LMAO |
23:37:03 | FromDiscord | <shadow.> IM DONE |
23:37:32 | FromDiscord | <sealmove> hahahah |
23:39:15 | FromDiscord | <juliuskiesian> is it possible to make all fields of a ref object public? |
23:39:28 | mipri | yes, put * by all of them |
23:39:29 | FromDiscord | <shadow.> without using star? |
23:39:30 | FromDiscord | <shadow.> lmao |
23:39:31 | FromDiscord | <shadow.> yeah |
23:39:46 | FromDiscord | <shadow.> there might be a way to do it with metapogramming? |
23:39:47 | FromDiscord | <shadow.> im not sure |
23:39:50 | FromDiscord | <shadow.> (edit) "metapogramming?" => "metaprogramming?" |
23:39:59 | FromDiscord | <shadow.> if you're too lazy to put after everything lol |
23:40:01 | mipri | you can also redefine the type and cast to your redefinition, with obvious caveats. |
23:41:08 | FromDiscord | <juliuskiesian> is the bot so smart already? |
23:41:19 | FromDiscord | <sealmove> come on it's just stars, put them. it's not like you have to write `public` |
23:41:38 | FromDiscord | <juliuskiesian> yeah, i'll just do that. 🙂 |
23:43:01 | FromDiscord | <shadow.> haha fair |
23:43:06 | FromDiscord | <shadow.> disruptek: you still there lol |
23:43:13 | FromDiscord | <shadow.> still dunno why test fails on 1.0 and 1.2 |
23:46:36 | FromDiscord | <shadow.> in your opinions, which gc should i use? or is it based on use case |
23:46:47 | FromDiscord | <shadow.> bc ik default would normally be the answer but i see many people suggesting arc |
23:49:29 | mipri | arc/orc are a cheap go-faster option when they have that effect (I've seen better than twice as fast just in advent of code). even when they don't alter your benchmarks much, they make destructors more useful, and they probably still have non-benchmarked performance benefits like less pausing at high memory usage |
23:51:58 | FromDiscord | <shadow.> so should i just use arc/orc in general? |
23:52:04 | FromDiscord | <shadow.> and which of those do you prefer? |
23:55:57 | mipri | sure, go with orc. |
23:56:24 | FromDiscord | <shadow.> fair enough |
23:58:36 | FromDiscord | <shadow.> is there a way to set default gc in nim config? |
23:59:13 | mipri | compile anything without turning hints off, and it'll show you a path to a nim.cfg |
23:59:24 | mipri | just put --gc:orc where it says # additional options, right at the top |
23:59:41 | FromDiscord | <shadow.> dang thanks |