00:18:02 | * | Tanger quit (Remote host closed the connection) |
00:19:58 | * | asdflkj_ joined #nim |
00:48:38 | * | audiophile joined #nim |
00:48:47 | audiophile | how do i create an array without specifying length in initialization |
00:50:36 | audiophile | oh nvm |
00:53:17 | * | Tanger joined #nim |
01:13:03 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:13:25 | * | njoseph joined #nim |
01:15:05 | * | abm quit (Quit: Leaving) |
01:42:22 | audiophile | https://bpa.st/BEBA what's wrong witht his |
01:42:35 | audiophile | Error: unhandled exception: An attempt was made to access a socket in a way forbidden by its access permissions. |
01:42:35 | audiophile | [OSError] |
01:58:50 | FromDiscord | <Anonymous Poet> sent a code paste, see https://paste.rs/qpS |
02:13:05 | FromDiscord | <ElegantBeef> You cannot limit it that way, but you can limit it in a constructor |
02:14:08 | FromDiscord | <ElegantBeef> `proc initLambdaAbs: LambdaExp = LambdaExp(kind: Var, arg: initLambdaVar())`↵basically |
02:14:36 | FromDiscord | <Anonymous Poet> is there any way to force a constructor? |
02:14:54 | FromDiscord | <ElegantBeef> Dont expose the `LambdaExp` and use it in another module 😄 |
02:14:55 | FromDiscord | <Anonymous Poet> like in c++ you can say `Obj::Obj() = delete` |
02:15:06 | FromDiscord | <ElegantBeef> There arent default constructors in Nim |
02:15:43 | FromDiscord | <ElegantBeef> https://github.com/beef331/googleapi/blob/master/src/googleapi/storage.nim#L16-L40 |
02:15:44 | FromDiscord | <Anonymous Poet> Hmmmm ... for what I'm doing now exporting doesn't really matter, but this seems kind of frustrating :/ |
02:16:02 | FromDiscord | <Anonymous Poet> (ie. not being able to add constructor checks) |
02:16:04 | FromDiscord | <ElegantBeef> That shows you how you can limit that behaviour |
02:16:22 | FromDiscord | <ElegantBeef> Well constructors only exist if the type is exported, so that's the way to do it |
02:16:40 | FromDiscord | <ElegantBeef> (edit) "exported," => "accessible," |
02:17:16 | FromDiscord | <ElegantBeef> https://github.com/andreaferretti/patty might support what you want |
02:17:20 | FromDiscord | <Anonymous Poet> right, but i mean that i want the type to be accessible, but i also want to prevent certain invalid constructions for it |
02:18:00 | FromDiscord | <ElegantBeef> Do you need the type accessible or just the fields? |
02:19:08 | FromDiscord | <ElegantBeef> Like is it important to due `LambdaExp()` from another module 😄 |
02:19:08 | FromDiscord | <ElegantBeef> (edit) "due" => "do" |
02:19:08 | FromDiscord | <Anonymous Poet> i may want to do case matching on it in another module |
02:19:08 | FromDiscord | <ElegantBeef> Yea but the type isnt required for that just the field |
02:19:17 | FromDiscord | <ElegantBeef> Actually nvm 😄 |
02:19:23 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2PsJ |
02:22:27 | * | krux02 quit (Remote host closed the connection) |
02:25:15 | FromDiscord | <y_yu> I am trying to install nim on WSL2 ubuntu.↵When I install it with apt, it seems to install 1.0.6. But I want to use the latest version of nim. What is the best option to install the latest version of nim and still have proper version control of nim on ubuntu? |
02:25:38 | FromDiscord | <Anonymous Poet> choosenim |
02:25:47 | FromDiscord | <Anonymous Poet> https://github.com/dom96/choosenim |
02:26:22 | FromDiscord | <y_yu> In reply to @Anonymous Poet "choosenim": thank you. |
02:45:19 | * | audiophile quit (Quit: Default Quit Message) |
02:56:36 | * | asdflkj_ quit (Ping timeout: 272 seconds) |
03:03:21 | * | bozaloshtsh joined #nim |
03:03:21 | * | bozaloshtsh quit (Changing host) |
03:03:21 | * | bozaloshtsh joined #nim |
03:52:12 | FromDiscord | <ElegantBeef> @Anonymous Poet you've now got me wanting to take a shot at object variant construction using a macro 😄 |
03:52:23 | FromDiscord | <Anonymous Poet> haha, please do |
03:53:46 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
03:53:52 | * | njoseph joined #nim |
03:55:10 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2Pt0 |
03:55:27 | FromDiscord | <Anonymous Poet> (edit) "https://play.nim-lang.org/#ix=2Pt0" => "https://play.nim-lang.org/#ix=2ONj" |
03:55:43 | FromDiscord | <ElegantBeef> well it'd still use `initKind` but it'd automate all the constructors |
03:55:54 | FromDiscord | <Anonymous Poet> (edit) "https://play.nim-lang.org/#ix=2Pt2" => "https://play.nim-lang.org/#ix=2Pt1" |
03:55:59 | FromDiscord | <Anonymous Poet> that's fine, i like the case statement |
03:56:11 | FromDiscord | <Anonymous Poet> i just want to ensure that users dont footgun themselves |
03:56:27 | FromDiscord | <Anonymous Poet> in other words, i dont like that its possible to construct invalid objects |
04:00:54 | FromDiscord | <ElegantBeef> Well the idea results with your code looking like https://play.nim-lang.org/#ix=2Pt4, and it'll provide safety in the generated procedures `initApp` and `initAbs` will check if the passed in value is of kind `Var` |
04:01:22 | FromDiscord | <Anonymous Poet> link looks broken? |
04:01:37 | FromDiscord | <ElegantBeef> Works here? |
04:01:57 | FromDiscord | <ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2Pt8 |
04:03:00 | FromDiscord | <ElegantBeef> And that'd generate everything, constructors, enums, type |
04:03:38 | FromDiscord | <ElegantBeef> and for the `App` and `Abs` it'd error if you pass in a non-var for `arg` or `rand` |
04:05:07 | FromDiscord | <Anonymous Poet> you just wrote variant, right? |
04:06:00 | FromDiscord | <ElegantBeef> Hmm? |
04:07:18 | FromDiscord | <Anonymous Poet> in the snippet above |
04:07:23 | FromDiscord | <Anonymous Poet> is `variant` a builtin? |
04:07:25 | FromDiscord | <ElegantBeef> No |
04:07:30 | FromDiscord | <ElegantBeef> It's my desired syntax |
04:08:01 | FromDiscord | <Anonymous Poet> ahh, i thought you already wrote it up 😂 |
04:08:08 | FromDiscord | <ElegantBeef> Nah i was just showing what it'd be like |
04:09:12 | FromDiscord | <Anonymous Poet> yeah, something like that was what i had in mind, though really the most important thing (imo) is the ability to force a constructor |
04:09:18 | FromDiscord | <Anonymous Poet> and that would be more generally useful too |
04:09:53 | FromDiscord | <Anonymous Poet> since this lambda parser is just for me, i was asking mostly for best practices |
04:10:13 | FromDiscord | <ElegantBeef> Well the enforcing a constructor sorta requires using selective imports/exports |
04:10:47 | FromDiscord | <Anonymous Poet> this leads to an interesting discussion; how are nim classes represented in c? just structs or ? |
04:10:50 | FromDiscord | <ElegantBeef> if the type isnt exported you cannot call the export, though you also cannot use things like your proc where you use case, since that type isnt accesible |
04:10:59 | FromDiscord | <ElegantBeef> Nim doesnt have classes, but our objects are just C structs 😛 |
04:11:42 | FromDiscord | <Anonymous Poet> i'd honestly settle for a way to just ensure that a function i specify runs immediately after the struct is populated and before any other code (that uses that object) runs |
04:12:24 | FromDiscord | <Anonymous Poet> though youd lose overloading that way |
04:12:27 | FromDiscord | <ElegantBeef> I mean i'm making this regardless if you want it or not 😄 |
04:12:42 | FromDiscord | <Anonymous Poet> ah, haha, then follow your dreams 😛 😄 |
04:12:45 | FromDiscord | <ElegantBeef> Overriding isnt a thing without inheritance |
04:13:06 | FromDiscord | <Anonymous Poet> sorry, overloading |
04:41:59 | * | spiderstew_ joined #nim |
04:44:47 | * | spiderstew quit (Ping timeout: 272 seconds) |
05:12:19 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:23:50 | * | vicfred quit (Quit: Leaving) |
05:53:31 | * | wasted_youth2 quit (Quit: Leaving) |
05:59:26 | FromDiscord | <Anonymous Poet> sent a code paste, see https://paste.rs/hUl |
06:31:37 | FromDiscord | <mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2Ptt |
06:32:48 | FromDiscord | <Anonymous Poet> one observation is that result is a reserved variable name, im not sure if you're allowed to do `new result` like that |
06:33:13 | FromDiscord | <Anonymous Poet> i may be wrong though |
06:33:26 | FromDiscord | <ElegantBeef> The issue is that you're doing `result.startline()` which returns a value and you arent handling it |
06:34:28 | FromDiscord | <mattrb> Oh, that's interesting. I definitely did not understand that from that error message haha. Thanks! |
06:34:49 | FromDiscord | <ElegantBeef> Well it's what the error message says 😄 |
06:35:04 | FromDiscord | <ElegantBeef> Got a `proc()` when you wanted `PPU` |
06:35:28 | FromDiscord | <mattrb> Gotcha, I wasn't understanding that it was complaining about the return value of newPPU |
06:35:59 | FromDiscord | <mattrb> Since `result` is of type `PPU`, I didn't realize that'd be a problem |
06:36:27 | FromDiscord | <ElegantBeef> In nim you have to handle any non `{.discardable.}` procs |
06:36:56 | FromDiscord | <mattrb> I'll keep an eye out for that in the future. Thank you |
06:42:15 | FromDiscord | <mattrb> Is there a better way to achieve this result in Nim? I'd like to make `PPU` a `var PPU` a closure in those last 3 procs, but then the compiler complains about capturing `var PPU` in a closure |
06:42:23 | FromDiscord | <mattrb> Not sure what the Nim approach would be here |
07:46:40 | * | PMunch joined #nim |
07:54:37 | FromDiscord | <treeform> In reply to @ElegantBeef "It's how all the": Actually jsony can also generate JsonNodes ... and you can manually walk them. Its just faster not too. |
07:56:18 | FromDiscord | <treeform> I think what makes my jsony to JsonNodes faster then stdlib json module is that I don't use StringStream, don't use substrings, and parse my numbers 2 digits at a time without intermediate allocations. |
07:56:20 | FromDiscord | <ElegantBeef> I mean that's not contrary to what i said, but i didnt know that so cool! |
07:57:13 | FromDiscord | <mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2PtG |
07:58:43 | FromDiscord | <treeform> In reply to @mattrb "If I have an": I think using my `flatty/binny` lib that would be `ppu.vram.readUint16(row 240 + col)` |
08:02:19 | FromDiscord | <mattrb> Looking at your implementation, it seems like it does _effectively_ the same thing |
08:03:19 | FromDiscord | <mattrb> As a clarification as well, the offset I'm trying to access is measured in uint16s rather than uint8s, so I'd need to `2` the arg to your `readUint16` in order for it to work out |
08:03:44 | FromDiscord | <treeform> yeah that's right |
08:04:10 | FromDiscord | <mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2PtJ |
08:04:30 | FromDiscord | <mattrb> I can just hide all of this away in some file that I'll never have to look at again, I'm just hoping there's some prettier syntax to do the same thing |
08:04:48 | FromDiscord | <treeform> yeah that's what I did, hid it in some file. |
08:05:30 | FromDiscord | <treeform> if you want JS support its actually different: https://github.com/treeform/flatty/blob/master/src/flatty/jsbinny.nim#L54 |
08:05:34 | FromDiscord | <treeform> probably don't need js support. |
08:06:00 | FromDiscord | <mattrb> sent a code paste, see https://play.nim-lang.org/#ix=2PtK |
08:06:19 | FromDiscord | <mattrb> Ah right, the casting won't work in js |
08:06:34 | FromDiscord | <treeform> yeah you got to like rebuild the numbers its crazy |
08:06:54 | FromDiscord | <mattrb> At the end of the day, I'm hoping to target emscripten as well, so I'm hoping that won't be a problem since it'll go through c rather than js |
08:07:10 | FromDiscord | <treeform> yeah emscripten is basically a C target |
08:08:12 | FromDiscord | <mattrb> Okay I'll just bury this casting somewhere for now so that I don't have to look at it :p Thanks for the input |
08:08:44 | FromDiscord | <treeform> i am glad I could help |
08:18:21 | saem | Oh damn, CI passed. |
08:29:19 | Oddmonger | what means « template / generic instantation from here » in the alaviss/nim plugin ? I don't have this warning when compiling |
08:29:38 | Oddmonger | i appears on a line which echoes an object: |
08:29:46 | Oddmonger | for o in objs: |
08:29:50 | Oddmonger | echo o |
08:37:18 | Oddmonger | hello leorize[m] , i have found my problem with unmarshalling. I try to assign « null » to a ref member when restoring (because it hasn't been assigned yet), and it crash |
08:37:41 | Oddmonger | reading this: https://github.com/nim-lang/Nim/issues/15620 , i think i have to find a workaround… |
08:40:23 | Oddmonger | ah … it has been fixed since, but i'm using 1.4.1 (one month before the fix) |
08:42:27 | FromDiscord | <Yardanico> Also by the way, marshal is kind of deprecated nowadays, json.to and a lot of third party serialisation libraries exist in nimble |
08:43:16 | FromDiscord | <mattrb> Any idea why perf doesn't record nim very nicely? Are there preferred profiling tools for nim? https://media.discordapp.net/attachments/371759389889003532/810793337904693248/unknown.png |
08:43:38 | Oddmonger | noted Yardanico , thanks |
08:44:46 | FromDiscord | <Yardanico> @mattrb it should work just fine, you might also want to compile with --debugger:native though |
08:45:11 | FromDiscord | <Yardanico> So that Nim source code lines show up when debugging/profiling |
08:49:14 | FromDiscord | <mattrb> Hmm that doesn't seem to make the source code information show up. Maybe I'm just missing something in Hotspot, but I've had it just come up inline before with other languages and it doesn't seem to be doing that here |
08:55:57 | * | Tanger quit (Remote host closed the connection) |
09:01:52 | * | krux02 joined #nim |
09:01:53 | * | krux02_ joined #nim |
09:06:49 | ForumUpdaterBot | New thread by Izikeros: How to diagnose nimsuggest not working with vscode?, see https://forum.nim-lang.org/t/7507 |
09:09:35 | * | krux02_ quit (Quit: Leaving) |
09:18:25 | * | Q-Master quit (Read error: Connection reset by peer) |
09:18:33 | * | Q-Master joined #nim |
09:20:21 | * | kaletaa quit (Quit: ZNC 1.8.1 - https://znc.in) |
09:20:28 | * | deepend quit (Remote host closed the connection) |
09:20:58 | * | ForumUpdaterBot quit (Remote host closed the connection) |
09:21:04 | FromDiscord | <mratsim> In reply to @mattrb "Any idea why perf": it does though, but SDL has no debug symbols |
09:21:09 | * | ForumUpdaterBot joined #nim |
09:21:10 | * | kaletaa joined #nim |
09:22:02 | FromDiscord | <mratsim> I use Apple Instruments on Mac and VTune on Windows / Linux or perf annotate on Linux |
09:22:44 | FromDiscord | <mattrb> I’ll take a look at vtune as well. Ty 👍 |
09:22:53 | * | deepend joined #nim |
09:24:29 | FromDiscord | <mratsim> vtune is perf underneath |
09:24:37 | FromDiscord | <mratsim> unless you use Internel Kernel modules |
09:25:05 | FromDiscord | <mratsim> example https://media.discordapp.net/attachments/371759389889003532/810803861408579604/unknown.png |
09:30:51 | FromDiscord | <mattrb> I’m in bed right now, but I’ll totally check that out tomorrow. Seeing the source side-by-side with the asm seems super useful too |
09:33:48 | * | Tanger joined #nim |
09:34:00 | saem | I think linedir or some define like that is required for line info? I've been meaning to profile the compiler/nimsuggest a bunch but haven't gotten around to it. |
09:39:03 | Oddmonger | ok so marshall module is deprecated, but what about serializing nim objects, then ? |
09:41:19 | FromDiscord | <ElegantBeef> I like treeforms flatty |
09:42:09 | FromDiscord | <mratsim> In reply to @saem "I think linedir or": yes linedir which is implied by --debugger:native is needed |
09:50:39 | saem | I can never keep those straight, I just spam ask the ones I can recall |
10:07:57 | * | Vladar joined #nim |
10:13:36 | FromDiscord | <Yardanico> @Oddmonger as I said, you can use json.to for a lot of cases, and for others there are a lot of nim serialization libs |
10:14:08 | FromDiscord | <Yardanico> https://github.com/treeform/flatty, https://github.com/disruptek/frosty, https://github.com/jangko/msgpack4nim and possibly more |
10:14:13 | FromDiscord | <Yardanico> flatty seems to be really good :) |
10:14:33 | FromDiscord | <Yardanico> you can also use https://github.com/guzba/supersnappy together with flatty to compress serialized data |
10:17:27 | * | tane joined #nim |
10:21:29 | * | shirtyx joined #nim |
10:37:05 | FromGitter | <Araq> seam: any idea? https://builds.sr.ht/~araq/job/426540 |
10:37:13 | FromGitter | <Araq> otherwise my nkerror thing finally works |
10:40:56 | Oddmonger | thank you for the links Yardanico , i had searched a bit since and had only found msgpack4nim (which seemed ok for me) |
10:42:35 | Oddmonger | yes flatty seems nice |
10:51:26 | * | shirtyx quit (Quit: Going offline, see ya! (www.adiirc.com)) |
10:53:32 | Clonkk[m] | I've used msgpack4nim before. It is very nice and works well. It's probably slower than flatty but is has the added advantage of being a well known protocol available in multiple programmming language. It makes communicating with a Python or Java process easy for example |
10:54:36 | Clonkk[m] | Which is sometimes needed / useful (just to offer some perspective) |
10:56:31 | FromDiscord | <Rika> Then combine that with super snappy then you got supreme compression too haha |
10:58:40 | Clonkk[m] | Compression is only relevant for large volume of data I'd say |
11:02:09 | FromDiscord | <Yardanico> it's also relevant for network transmission |
11:02:18 | FromDiscord | <Yardanico> or for limited disk size :) |
11:06:42 | Clonkk[m] | Low capacity just change what "large volume" means :) |
11:15:44 | * | shirtyx joined #nim |
11:19:07 | * | lritter joined #nim |
12:12:58 | * | abm joined #nim |
12:45:02 | * | wasted_youth2 joined #nim |
12:45:59 | * | krux02 quit (Remote host closed the connection) |
12:46:46 | * | krux02 joined #nim |
12:47:01 | * | krux02_ joined #nim |
12:47:06 | * | krux02_ quit (Remote host closed the connection) |
13:04:07 | FromDiscord | <Zrisckrdeluke> Does nake recompile the entire thing when any change happens or is it just the files that change like how make works? |
13:09:17 | * | sagax quit (Remote host closed the connection) |
13:20:26 | planetis[m] | afaik nake just calls the compiler |
13:22:15 | * | sagax joined #nim |
13:48:44 | FromDiscord | <konsumlamm> is there an easy way to get the absolute value of an int64 as uint64 (so that it also works for low(int64))? |
13:49:45 | PMunch | myu64.abs.uint64 |
13:50:18 | FromDiscord | <konsumlamm> the input is an int64 though |
13:50:30 | PMunch | Yes? |
13:50:42 | PMunch | !eval (100'i64).abs.uint64 |
13:50:44 | NimBot | Compile failed: /usercode/in.nim(1, 14) Error: expression 'uint64(100'i64)' is of type 'uint64' and has to be used (or discarded) |
13:50:51 | PMunch | !eval echo (100'i64).abs.uint64 |
13:50:54 | NimBot | 100 |
13:51:04 | PMunch | !eval echo typeof((100'i64).abs.uint64) |
13:51:07 | NimBot | uint64 |
13:51:12 | FromDiscord | <konsumlamm> !eval echo low(int64).abs.uint64 |
13:51:16 | NimBot | /usercode/in.nim(1) in↵/playground/nim/lib/system/fatal.nim(49) sysFatal↵Error: unhandled exception: over- or underflow [OverflowDefect] |
13:51:26 | FromDiscord | <konsumlamm> that's the problem |
13:51:44 | PMunch | Ooh, because low(int64).abs is higher than high(int64).. |
13:51:46 | PMunch | Hmm |
13:52:41 | FromDiscord | <flywind> !eval echo low(int64).uint64 |
13:52:43 | NimBot | Compile failed: /usercode/in.nim(1, 16) Error: cannot convert -9223372036854775808 to uint64 |
13:53:33 | PMunch | !eval (proc (x: int64): uint64 = if x == low(int64): high(int64).uint64 + 1 else: abs(x).uint64)(100'i64) |
13:53:35 | NimBot | Compile failed: /usercode/in.nim(1, 28) Error: nestable statement requires indentation |
13:53:35 | FromDiscord | <konsumlamm> i could do some bit manipulation (invert if negative -> convert to uint64 -> add 1), but i was wondering if there is a nicer way |
13:53:44 | PMunch | Damn it :P |
13:54:13 | FromDiscord | <konsumlamm> hmm, ye, that's another possibility |
13:54:15 | FromDiscord | <flywind> like this |
13:54:28 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2Pwr |
13:54:49 | FromDiscord | <konsumlamm> the first `uint64(x)` should be a cast though, right? |
13:55:02 | PMunch | https://play.nim-lang.org/#ix=2Pws |
13:55:47 | PMunch | @flywind, that won't work. uint64(low(int64)) fails because you can't convert a negative number to uint64 |
13:55:50 | FromDiscord | <flywind> type conversion also works, no need for cast |
13:56:26 | FromDiscord | <konsumlamm> but if x is `low(int64)`, `uint64(x)` crashes |
13:56:40 | FromDiscord | <flywind> https://play.nim-lang.org/#ix=2Pwt |
13:57:06 | FromDiscord | <konsumlamm> huh |
13:57:21 | FromDiscord | <konsumlamm> !eval echo uint64(low(int64)) |
13:57:23 | NimBot | Compile failed: /usercode/in.nim(1, 12) Error: cannot convert -9223372036854775808 to uint64 |
13:59:16 | PMunch | Hmm, I guess this is a static conversion issue |
13:59:41 | PMunch | uint64(low(int64)) converts to uint64(-9223372036854775808) on compile-time which fails |
14:00:09 | FromDiscord | <flywind> !eval var x = low(int64); echo int64(x) |
14:00:13 | NimBot | -9223372036854775808 |
14:00:20 | PMunch | But uint64 is apparently capable of converting the number -9223372036854775808 stored in a int64 variable into a uint64 just fine.. |
14:01:00 | FromDiscord | <flywind> !eval var x = low(int64); echo uint64(x) |
14:01:04 | NimBot | 9223372036854775808 |
14:02:53 | FromDiscord | <flywind> I agree |
14:03:20 | FromDiscord | <flywind> !eval echo uint64(-1) |
14:03:22 | NimBot | Compile failed: /usercode/in.nim(1, 12) Error: -1 can't be converted to uint64 |
14:03:29 | FromDiscord | <flywind> !eval let x = -1; echo uint64(x) |
14:03:32 | NimBot | 18446744073709551615 |
14:03:50 | FromDiscord | <konsumlamm> hmm, is that intentional behaviour? |
14:04:18 | * | audiophile joined #nim |
14:05:12 | * | audiophile quit (Remote host closed the connection) |
14:07:13 | FromDiscord | <Clyybber> PMunch: Yeah, I noticed it too |
14:07:15 | FromDiscord | <Clyybber> it's a bug |
14:07:22 | FromDiscord | <Clyybber> it shouldn't error in compiletime either |
14:09:23 | * | ddevault joined #nim |
14:10:22 | FromDiscord | <Clyybber> although the PR specifically mentions "runtime" https://github.com/nim-lang/Nim/pull/12688/files#diff-3bd14d078188074c410028847113ceae68865d0ad5b844a27183ef87fbe2fcc3R67 |
14:11:24 | FromDiscord | <Clyybber> The manual also mentions it https://nim-lang.github.io/Nim/manual#statements-and-expressions-type-conversions |
14:11:25 | FromDiscord | <Yardanico> found some bug in trans.nim related that triggers with {.async.} and a for loop on iterator returning tuples 🤔 |
14:11:29 | FromDiscord | <Yardanico> will try to minimize |
14:11:33 | FromDiscord | <Clyybber> nice! |
14:11:40 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/810875978142056488/unknown.png |
14:12:43 | FromDiscord | <arnetheduck> status nim style guide live: https://status-im.github.io/nim-style-guide/ |
14:13:06 | PMunch | I have an annoying bug with some async code as well. It works fine until I trigger a callback stored in a sequence. Then it pegs the program at high CPU usage until I restart it |
14:13:14 | PMunch | But it's a pain to debug |
14:14:28 | FromDiscord | <konsumlamm> now, should i use `uint64(not x) + 1` or the if-else... |
14:17:22 | PMunch | And for the uint64 conversion bug this is a mixup between two intended features. Feature 1: low(int64) is done on compile-time, simply expands to a big negative number. Feature 2: you can't convert negative literals to unsigned integers. This is commonly used in C to generate the largest possible value e.g. `uint8_t x = -1;` to generate 255. But it is invalid in Nim in favour of high(uint8). |
14:17:23 | FromDiscord | <flywind> Since it is documented, I would use |
14:17:30 | FromDiscord | <Kiloneie> Finally after a long long time, here is another one of my videos:↵↵https://youtu.be/x76fT8GG0Pk |
14:17:30 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2Pwy |
14:17:54 | ForumUpdaterBot | New thread by Kiloneie: Nim SDL2 Game Development for Beginners (new video tutorial series), see https://forum.nim-lang.org/t/7508 |
14:18:04 | FromDiscord | <Yardanico> the bug I' checking is really specific and only seems to occur when an iterator with `when nimvm` inside is involved |
14:18:58 | FromDiscord | <Yardanico> (edit) "I'" => "I'm" |
14:19:04 | PMunch | @Kiloneie, audio sounds much better than the last video I watched :D |
14:19:51 | * | vsantana joined #nim |
14:20:37 | FromDiscord | <Kiloneie> New mic 😛 |
14:21:21 | * | Kiloneie joined #nim |
14:21:30 | FromDiscord | <no name fits> Speaking of vids, what do I call a stream where I just try to figure out Vulkan and Nim 👀 |
14:21:33 | PMunch | Is this a voice-over, or have you tuned it so that you can't hear the keyboard? |
14:21:51 | PMunch | Peer programming stream? :P |
14:22:23 | FromDiscord | <no name fits> I guess I could call it Peer programming |
14:22:24 | FromDiscord | <Kiloneie> new mic attachable boom mic and i have -25dB sensitivity so my mouse and keyboard is now super quiet |
14:22:41 | PMunch | Nice |
14:22:52 | FromDiscord | <Kiloneie> then a 30 dB gain over it |
14:23:00 | PMunch | Are those zoom effects manual? |
14:24:59 | FromDiscord | <Kiloneie> well kdenlive zoom |
14:25:09 | FromDiscord | <Kiloneie> you add keynotes keyframes ? |
14:25:38 | Zoom[m] | Kiloneie: nice sound indeed. A bit muddy to my taste |
14:25:47 | FromDiscord | <Kiloneie> so i set the start keyframe then the next one where i used my mouse to adjust the camera on the project view with 200% enlarge and voila |
14:25:50 | FromDiscord | <Kiloneie> it took a while though |
14:25:59 | Zoom[m] | It's nice to be summoned just in time for a sound discussion |
14:26:19 | FromDiscord | <no name fits> Why do I need a thumbnail 😅 |
14:27:12 | FromDiscord | <Kiloneie> xD |
14:27:21 | FromDiscord | <Kiloneie> i was planning to release it today |
14:27:38 | FromDiscord | <Kiloneie> i uploadedd it yesterday with plans to add skip buttons, but apparently that's no longer a thing on youtube |
14:27:43 | FromDiscord | <Kiloneie> so D: |
14:27:57 | FromDiscord | <Kiloneie> still, don't upload at like 22.00 CET like i used to |
14:28:09 | FromDiscord | <Kiloneie> from my experience, everyone is asleep, don't get much views |
14:28:21 | FromDiscord | <Kiloneie> and most of the views come from here and the forum |
14:28:53 | PMunch | Skip buttons? You mean chapters? |
14:29:21 | PMunch | Zoom[m], haha did I ping you on accident when I was asking about zooming? |
14:29:57 | PMunch | Kiloneie, ah so it's done manually. I thought you might have some keyboard shortcut that zoomed OBS to the currently active window or something |
14:29:58 | FromDiscord | <Kiloneie> well chapters should appear... |
14:30:04 | FromDiscord | <Kiloneie> i did put timestamps in correctly |
14:30:09 | FromDiscord | <Kiloneie> but apparently it takes time... |
14:30:12 | FromDiscord | <Kiloneie> idk how much |
14:30:15 | PMunch | Ah |
14:30:18 | FromDiscord | <Kiloneie> as i added them about an hour ago |
14:30:20 | PMunch | I don't see them now |
14:30:46 | FromDiscord | <Kiloneie> they are weird... i have them the same way on all my videos, yet half of the videos don't have chapters... |
14:30:49 | Zoom[m] | PMunch: Yep. Since 2020 I've suddenly become famous. Everyone seems to know me and mention me all the time. For the life of me, can't understand what happened :D |
14:31:04 | FromDiscord | <Kiloneie> someone commented on that on one of my videos and... it should work... |
14:31:06 | PMunch | Hahaha :P |
14:31:24 | PMunch | @Kiloneie, it might just take a little while as you say |
14:31:45 | FromDiscord | <Kiloneie> yeh for new videos... idk about my older ones... |
14:31:51 | Clonkk[m] | <Zoom[m] "PMunch: Yep. Since 2020 I've sud"> Zoom becoming famous the year of the pandemic, sounds about right :D |
14:31:59 | FromDiscord | <Kiloneie> stuck with no chapters those sad bastards xD |
14:33:11 | FromDiscord | <Kiloneie> Okay yeez youtube calm down now, getting spammed by notifications lol |
14:35:52 | FromDiscord | <Kiloneie> also video is not 2K, or 1440p, idk i used what da vinci told me to do before, this one was made with kdenlive |
14:38:26 | FromDiscord | <Kiloneie> i hope i made the content well, there is just so much boilerplate code for SDL that i didn't know where to begin. |
14:39:02 | * | Kiloneie left #nim ("Leaving") |
14:39:56 | ForumUpdaterBot | New thread by Serge: String "interning" attempt, see https://forum.nim-lang.org/t/7509 |
14:39:57 | FromDiscord | <hamidb80> i have no idea how to write $ function for Email https://media.discordapp.net/attachments/371759389889003532/810883097015877632/Screenshot_at_2021-02-15_18-09-01.png |
14:40:37 | FromDiscord | <Yardanico> @hamidb80 string(e) |
14:40:54 | FromDiscord | <Yardanico> also don't forget to export the $ func |
14:40:55 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2PwC |
14:41:02 | FromDiscord | <Yardanico> so you can stringify email from other modules |
14:43:30 | FromDiscord | <Yardanico> beautiful |
14:43:40 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2PwD |
14:44:52 | * | asdflkj_ joined #nim |
14:44:53 | FromDiscord | <hamidb80> In reply to @Yardanico "```nim type Future =": how did you activate syntax highlighting for your code? |
14:45:07 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/810884398106935306/unknown.png |
14:45:20 | FromDiscord | <Yardanico> that's how it's done in markdown |
14:45:26 | FromDiscord | <hamidb80> that's same as github |
14:45:32 | FromDiscord | <Yardanico> yes, because it also uses markdown :) |
14:50:20 | * | shirtyx quit (Quit: Going offline, see ya! (www.adiirc.com)) |
14:50:34 | FromDiscord | <Yardanico> @Clyybber https://github.com/nim-lang/Nim/issues/17045 |
14:58:57 | FromGitter | <YBR46084841_twitter> what does "defer" do after an if statement please |
14:59:21 | PMunch | defer will execute the block given to it at the end of the current scope, or in the case of an exception |
15:29:16 | * | haxscramper joined #nim |
15:29:46 | * | PMunch quit (Quit: leaving) |
15:29:57 | FromDiscord | <Yardanico> btw, @Araq what do you think about enabling github discussions for the nim repo? |
15:30:05 | FromDiscord | <Yardanico> they are available to all github users nowadays |
15:30:33 | FromDiscord | <Yardanico> https://docs.github.com/en/discussions/quickstart |
15:31:00 | FromDiscord | <flywind> see https://discord.com/channels/371759389889003530/371759389889003532/793002886959202364 |
15:31:04 | FromDiscord | <flywind> ^ |
15:31:15 | FromDiscord | <Yardanico> oh okay |
15:33:14 | * | maier joined #nim |
15:38:06 | FromDiscord | <hamidb80> what happens when an exception occurs inside a thread? |
15:38:49 | FromDiscord | <hamidb80> they're just ignored? |
15:39:09 | FromDiscord | <hamidb80> i mean they're just ignored and the thread goes down |
15:39:25 | FromDiscord | <Yardanico> no, the whole application quits |
15:40:38 | * | vicfred joined #nim |
15:40:42 | FromDiscord | <hamidb80> In reply to @Yardanico "no, the whole application": the number isn't increasing https://media.discordapp.net/attachments/371759389889003532/810898383203336262/Screenshot_at_2021-02-15_19-09-50.png |
15:40:51 | FromGitter | <YBR46084841_twitter> can someone explain me what this part of code does : proc toString(chars: openArray[WCHAR]): string = ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=602a9603e634904e60a00540] |
15:41:07 | FromDiscord | <Yardanico> @hamidb80 wdym? |
15:43:47 | FromDiscord | <Rika> i dont see anything wrong in your code @hamidb80 |
15:45:18 | FromDiscord | <hamidb80> In reply to @Rika "i dont see anything": yes that's my wrong |
15:45:26 | FromDiscord | <hamidb80> sorry |
15:53:38 | * | shirtyx joined #nim |
15:56:05 | FromGitter | <YBR46084841_twitter> proc toString(chars: openArray[WCHAR]): string = ⏎ result = "" ⏎ for c in chars: ⏎ if castchar == '\0': ⏎ break ... [https://gitter.im/nim-lang/Nim?at=602a99948621811d587b272e] |
15:56:23 | FromGitter | <YBR46084841_twitter> what does this procedure do please? |
16:00:01 | * | silvernode[m] quit (Quit: Idle for 30+ days) |
16:02:24 | FromDiscord | <konsumlamm> it converts an `openArray[WCHAR]` to a `string`? |
16:05:02 | FromGitter | <YBR46084841_twitter> the =='\0' is checking if its hexadecimal? |
16:06:32 | FromDiscord | <konsumlamm> no, that checks for the end of a string |
16:06:55 | FromDiscord | <konsumlamm> '\0' is the NIL character, it has nothing to do with '0' |
16:07:24 | * | NimBot joined #nim |
16:07:37 | FromGitter | <YBR46084841_twitter> ahhh thank you |
16:09:45 | voidpi | !seen disruptek |
16:10:06 | voidpi | :/ |
16:10:39 | Prestige | he's banned from the channel D: voidpi |
16:12:11 | voidpi | Prestige: thanks, not really a surprise |
16:12:22 | Prestige | np |
16:15:19 | * | clyybber joined #nim |
16:20:30 | haxscramper | When I run test for pattern matching with testament it reports as `Failure: reNimcCrash` without outputting anything else. Compilting and running tests using the same commands does not report any compilation errors, though only passed `[Suite]` names are printed out (instead of `suite + test` names like when using unittest). |
16:20:31 | haxscramper | |
16:20:31 | haxscramper | |
16:20:35 | haxscramper | Running testament using: `./bin/testament --nim:bin/nim r tests/stdlib/tmatching.nim` for a standalone testt |
16:20:35 | haxscramper | |
16:20:38 | * | clyybber quit (Quit: WeeChat 3.0.1) |
16:20:39 | haxscramper | Test using compiler: `./bin/nim r --hints:on -d:testing --nimblePath:tests/dep tests/stdlib/tmatching.nim` |
16:20:39 | haxscramper | |
16:20:41 | haxscramper | (taken from testament output) |
16:23:46 | haxscramper | I've added pattern matching library in the stdlib and running testament on already existing/working test suite, so most likely it I've just misused `testament` itself |
16:26:42 | FromDiscord | <Clyybber> @Araq ping |
16:30:49 | * | vsantana1 joined #nim |
16:31:56 | * | vsantana quit (Ping timeout: 240 seconds) |
16:31:56 | * | vsantana1 is now known as vsantana |
16:36:12 | FromGitter | <Araq> pong |
16:39:05 | FromDiscord | <haxscramper> In reply to @haxscramper "Or pushed for pattern": https://github.com/nim-lang/Nim/pull/17047 PRed it as-is, will see how it goes |
16:53:29 | FromDiscord | <haxscramper> Though CI seems to be getting green, my question is still relevant, so if anyone could tell me what I've done wrong I would much appreciate it |
17:03:08 | FromDiscord | <Clyybber> @Araq I think we need a loop DFA instruction |
17:03:29 | FromGitter | <Araq> ok |
17:04:13 | FromDiscord | <Clyybber> I'm not sure yet, if it's strictly needed, but it would also be nice since currently each loop potentially triples the dfa |
17:04:37 | FromGitter | <Araq> so far I'm underwhelmed with the DFA's results btw, if I were to redo it again, I would simply traverse the AST I think |
17:05:07 | FromDiscord | <Clyybber> Yeah, it's a nice interface to work with, but I think we may be able to "inline" it |
17:06:11 | FromGitter | <Araq> how is it "nice"? it was designed to avoid fixpoint computations and yet that's what we end up doing |
17:07:05 | FromDiscord | <Kiloneie> Hey @Araq did you get my DM ? |
17:07:41 | FromGitter | <Araq> no, what's a DM? |
17:08:05 | FromDiscord | <ache of head> direct message |
17:08:11 | FromDiscord | <Kiloneie> PM |
17:08:25 | FromDiscord | <Kiloneie> everyone keeps saying DM, when im used to PM, so i used that xD... |
17:08:46 | FromGitter | <Araq> I only know "PM" |
17:08:47 | FromDiscord | <Kiloneie> it used to be PM... why do people keep changing names of things D: |
17:09:14 | FromDiscord | <Kiloneie> xD, well i sent you one |
17:09:55 | FromGitter | <Araq> PM on gitter these days please |
17:10:12 | FromDiscord | <Kiloneie> idk what you guys use xD... |
17:10:18 | FromDiscord | <ache of head> i prefer direct message |
17:10:24 | FromDiscord | <ache of head> nothing is really private onnline |
17:10:28 | FromDiscord | <ache of head> (edit) "onnline" => "online" |
17:10:38 | FromDiscord | <treeform> only Araq uses gitter, rest use disocrd. |
17:10:40 | FromDiscord | <ache of head> but to each their own ¯\_(ツ)_/¯ |
17:13:58 | Clonkk[m] | <FromDiscord "<treeform> only Araq uses gitter"> Matrix users are gonna get pissed, all 3 of us ! |
17:15:10 | FromDiscord | <treeform> I never seen some one from Matrix speak! |
17:15:23 | FromDiscord | <gollark> I managed to get my dendrite instance to join the matrix room after several minutes of waiting. |
17:15:39 | FromDiscord | <gollark> But I have Discord open more so I'm not using that. |
17:17:23 | * | maier quit (Quit: Lost terminal) |
17:18:22 | FromDiscord | <gollark> I basically don't use Matrix at all because there aren't any interesting communities there (which I'm aware of) and joining things is sloooow. |
17:18:48 | vindaar[m] | <Clonkk[m] "Matrix users are gonna get pisse"> Hey, we're probably at least 5! |
17:19:45 | Clonkk[m] | <vindaar[m] "Hey, we're probably at least 5!"> I don't think the bots count |
17:20:20 | FromDiscord | <gollark> I was going to say something from there, but the client on my phone isn't showing this room. |
17:27:28 | FromGitter | <akavel> Hi! How do I set `-d:foo=bar` in .nimble file? |
17:29:28 | Clonkk[m] | switch("define","foo=bar") if I'm not mistaken |
17:31:23 | FromGitter | <akavel> @Clonkk[m]: nope, didn't work unfortunately; tried the same with "d" instead of "define" but still not working |
17:33:12 | FromGitter | <akavel> when I do it with `nim c -r -d:foo=bar`, it works; but `switch` doesn't seem to when doing `nimble run` :( |
17:34:19 | FromDiscord | <Solitude> im pretty sure you cant set compiler options from .nimble |
17:35:17 | ForumUpdaterBot | New thread by Drkameleon: Non-js modules, see https://forum.nim-lang.org/t/7510 |
17:36:07 | FromDiscord | <dom96> Araq: Discord is much better, you should really switch |
17:37:55 | Clonkk[m] | <FromGitter "<akavel> @Clonkk[m]: nope, didn'"> I do something like that from a config.nims file wasn't sure about nimble fild |
17:40:32 | FromGitter | <akavel> @Clonkk[m]: putting `switch(...)` in config.nims worked, thanks!!! <3 <3 <3 |
17:48:50 | * | waleee-cl joined #nim |
18:01:29 | * | saem quit (Read error: Connection reset by peer) |
18:01:49 | * | saem joined #nim |
18:04:05 | * | shirtyx quit (Quit: Going offline, see ya! (www.adiirc.com)) |
18:17:23 | ForumUpdaterBot | New thread by Johnconway: Control Flow with Type Checking, see https://forum.nim-lang.org/t/7511 |
18:22:36 | FromDiscord | <ache of head> bro john conway is in this?? |
18:24:09 | * | shirtyx joined #nim |
18:25:51 | * | a_chou joined #nim |
18:28:36 | FromDiscord | <exelotl> you can't say "sliding into my PMs" |
18:28:39 | FromDiscord | <exelotl> it just doesn't work |
18:33:10 | FromDiscord | <mratsim> In reply to @ache of head "bro john conway is": Conway died last year |
18:33:23 | * | vsantana1 joined #nim |
18:34:45 | * | vsantana quit (Ping timeout: 240 seconds) |
18:34:46 | * | vsantana1 is now known as vsantana |
18:34:52 | saem | It's that compiler talk that always gets me. |
18:35:04 | saem | But don't send me bug reports there. |
18:36:41 | FromDiscord | <ache of head> > Conway died last year↵wait, for real? |
18:36:48 | FromDiscord | <ache of head> i didn't know that |
18:36:59 | FromDiscord | <ache of head> in that case i am sorry if my comment seemed out of place |
18:39:55 | saem | It's cool, I have a lot of respect for his insight |
18:40:14 | saem | My job is basically Conway's law manifest |
18:40:22 | FromDiscord | <ache of head> me too, that's what i mean 😕 |
18:40:41 | FromDiscord | <ache of head> but from this perspective it looked a bit like i was making fun of him and i didn't mean to |
18:41:11 | FromDiscord | <ache of head> again i am sorry if anyone found this offensive |
18:41:14 | FromDiscord | <mratsim> I understood like you didn't know actually |
18:41:21 | FromDiscord | <ache of head> i need to stop making stupid jokes online 😩 |
18:41:50 | saem | I took it as praise, but everyone interests things differently. Little exchange clarifies the tone and all that. |
18:42:45 | saem | Stupid jokes online is half the reason I'm online |
18:43:05 | FromDiscord | <mratsim> and memes are the other half |
18:43:25 | saem | Yeah, kinda like gi joe |
18:43:30 | FromDiscord | <dom96> hello all |
18:43:34 | saem | Knowing is half the battle. |
18:43:55 | saem | The other half is red and blue lazers (that never got anything). |
18:45:28 | FromDiscord | <~355/113 Man> :pepesaber: |
18:45:33 | saem | Hmm, maybe I should spend a couple hours releasing a new version of the extension, need to take a quick peek at nimsuggest process handling to see if I can track down the leak in non-process mode. |
18:46:09 | saem | Non-project mode, rather. |
18:48:25 | saem | But I want to get back to sem fixes for great good (nkError and more). 😅 |
18:48:39 | FromDiscord | <haxscramper> Pattern matching CI for stdlib is green |
18:49:02 | saem | Oh damn! |
18:49:41 | saem | For the food that are lazy/in the phone, can has link to the PR? |
18:49:45 | FromGitter | <Araq> can we please get "let as expressions" first |
18:49:54 | FromGitter | <Araq> and then use them for pattern matching? |
18:50:06 | saem | +1 |
18:52:09 | saem | Destructuring, pinning, etc... All make pattern matching really shine. Guessing "let as expression" really opens that up? |
18:54:13 | FromDiscord | <haxscramper> Araq: will we get it before 1.6& |
18:54:14 | FromDiscord | <haxscramper> ? |
18:54:44 | FromDiscord | <haxscramper> And it looks nice, maybe, but that's all I can say about it really |
18:55:27 | FromDiscord | <haxscramper> Does it add anything else aside from writing `[all let capture]` vs `[all @capture]`? |
18:56:05 | FromDiscord | <Clyybber> isn't pattern matching already in fusion? |
18:56:08 | FromDiscord | <haxscramper> or whatever new round of syntax discussion (that does not add anything else) willb bring? |
18:56:16 | FromDiscord | <haxscramper> In reply to @Clyybber "isn't pattern matching already": Whis is now not bundled |
18:56:29 | FromDiscord | <haxscramper> == defeats the whole purpose of #245 |
18:56:56 | FromDiscord | <haxscramper> Which was to bring pattern matching into default installation as a part of a language |
18:59:58 | FromDiscord | <haxscramper> And what "let expression" would look like exactly? It would have to behave like a prefix operator with precedence 10 to allow for replacing existing syntax, or I would need to rethink the whole DSL top-down, or at least noticeable portion of it |
19:03:02 | FromGitter | <Araq> well if you want it in the standard, it should look exactly as we want it |
19:03:28 | FromDiscord | <haxscramper> Well, how do you want it to look then? |
19:03:33 | FromGitter | <Araq> Fusion is the stagging area |
19:04:04 | FromGitter | <Araq> I have not much of an opinion how I want it to look, however |
19:04:22 | FromDiscord | <haxscramper> Just write random pattern-patching expressoins that you would like to work |
19:04:39 | FromDiscord | <haxscramper> I mean I don't ask for full-blown explanation' |
19:04:51 | FromDiscord | <haxscramper> Just general understanding of what you find more appropriate |
19:05:02 | FromGitter | <Araq> if the contruct declares an identifier, this must be visible without knowing the macro's implementation |
19:05:13 | FromDiscord | <haxscramper> `/sutable for pattern-patching-that-is-worthy-of-stdlib` |
19:05:35 | FromGitter | <Araq> so instead of `of CallExpr(x):` it should be like `of CallExpr(let x):` |
19:06:53 | FromDiscord | <konsumlamm> (it is `of CallExpr(@x)` currently) |
19:06:54 | FromDiscord | <haxscramper> And subsequently `[all @capture] -> [all let capture]` (or `[let all capture]` |
19:07:21 | FromDiscord | <dom96> What will it look like in Python? or rather what is it most likely to look like? |
19:07:31 | FromGitter | <Araq> https://www.python.org/dev/peps/pep-0622/ |
19:07:54 | FromDiscord | <haxscramper> In reply to @dom96 "What will it look": `case ["drop", objects]:` |
19:07:57 | FromDiscord | <konsumlamm> actually, that was superseded by https://www.python.org/dev/peps/pep-0634/ |
19:08:07 | FromDiscord | <haxscramper> https://www.python.org/dev/peps/pep-0636/#matching-multiple-patterns |
19:08:51 | FromDiscord | <haxscramper> In reply to @haxscramper "`case ["drop", *objects]:`": In our case this would be `["drop", all @objects]` |
19:09:16 | FromDiscord | <haxscramper> And with `let` it might look like `["drop", all let objects]` |
19:10:51 | FromDiscord | <haxscramper> Well, whatever, so now `fusion` is officially nim's boost for staging area |
19:10:54 | FromDiscord | <dom96> hm, we don't really have Python's `` concept |
19:11:09 | FromDiscord | <haxscramper> and packages from it would have to be re-RFC-ed, and re-implemented partially to make it into stdlib |
19:11:14 | FromDiscord | <haxscramper> Which is generally fine by me |
19:11:34 | FromDiscord | <dom96> so I'd be tempted to drop this feature, unless it's a common feature of all pattern matching |
19:11:46 | FromDiscord | <dom96> in which case it would be interesting to see how other languages handle this |
19:12:16 | FromDiscord | <haxscramper> In reply to @dom96 "so I'd be tempted": `nnkProcDef` arguments, extracing conditions/bodies from conditional statement or something like that |
19:12:36 | FromDiscord | <haxscramper> `CaseStmt[all OfBranch[@conditions, .._]]` |
19:12:50 | FromDiscord | <haxscramper> Capture all case-of branches into `conditions` variable |
19:12:56 | FromDiscord | <konsumlamm> In reply to @dom96 "in which case it": well, most other languages don't require a prefix (like `@` or `let`) before captured variables |
19:14:03 | FromDiscord | <konsumlamm> many languages don't have flexible seq patterns like fusion/matching currently does |
19:14:06 | FromGitter | <Araq> well we can also avoid it but then it has to be hard-coded into the language, nothing else would really work |
19:14:07 | FromDiscord | <haxscramper> In reply to @dom96 "in which case it": Almost no other language pattern-matching has support for sequences in a way that we do, with possible exception of python's ``, and list head/tail which is arguable |
19:14:42 | FromDiscord | <haxscramper> Well, if you disregard regex of course |
19:14:42 | FromDiscord | <mratsim> I like @ as an idiom for capture, would be useful for closures as well, but it's already taken :/ |
19:15:21 | FromDiscord | <haxscramper> In reply to @mratsim "I like @ as": I really like the consistency of LET INTRODUCES NEW VARIABLE IN THE SCOPE that holds true for as many cases as possible |
19:15:57 | FromDiscord | <haxscramper> Though pattern matching should really have all captures as `lent` |
19:16:14 | FromDiscord | <haxscramper> Which is not done now because of view type's experimental status |
19:16:25 | FromDiscord | <konsumlamm> racket (which also implements pattern matching with macros) has the first identifier in a list (it's a lisp, so everything is a list there naturally) special cased, but captured variables are still not prefixed |
19:17:14 | FromDiscord | <haxscramper> > Well, whatever, so now fusion is (officially?) nim's boost for staging area↵Because #310 went nowhere, I think it is important that this decision should be highlited or confirmed or whatever? |
19:17:17 | FromDiscord | <mratsim> let foo: lent Foo = foo |
19:17:32 | FromDiscord | <haxscramper> Because nobody knows what the hell is going on in the fusion |
19:17:50 | FromDiscord | <konsumlamm> though the ship of not using a prefix at all has already sailed ig... (and it wouldn't work well with normal `case` expecting identifiers to be constants either) |
19:18:17 | FromGitter | <Araq> haxscramper: nim installation will offer the choice to download Fusion |
19:18:32 | FromGitter | <Araq> not much did change, but we should all freak out, of course |
19:18:35 | FromDiscord | <mratsim> what about parens for pattern matching? |
19:19:31 | FromDiscord | <konsumlamm> wdym? |
19:19:57 | FromGitter | <Araq> ideally a solution also would give us nicer `mapIt` but it's probably unrealistic |
19:20:52 | FromDiscord | <KnorrFG> hey, I feel a little stupid for asking this: but I want to allocate an array at runtime to store the contents of an image file. I could use a seq, but since the array length wont change after creation an array feels more appropriate. The thing is that array[type, size] only works if size is known at compile time, while I load the file at runtime. is there something like newArray? |
19:21:04 | FromDiscord | <mratsim> composable iterators would reduce the need for mapIt |
19:21:23 | FromDiscord | <haxscramper> @haxscramper: nim installation will offer the choice to download Fusion↵> not much did change, but we should all freak out, of course↵I'm really sorry for that much salt, but where is it written? Oh, I can see it in git diff, yeah, everyone certainly has all the time in the world to review changes that clearly say "unbundle nim from fusion" (instead of "make fusion installation optional") |
19:21:23 | FromDiscord | <Yardanico> @KnorrFG no, you can just use a seq with `let` |
19:21:23 | FromDiscord | <mratsim> In reply to @KnorrFG "hey, I feel a": use a sequence. |
19:21:32 | FromDiscord | <KnorrFG> ok 😄 |
19:23:10 | FromGitter | <Araq> @mratsim how would composable iterators offer something as terse as `a.mapIt($it)` |
19:23:12 | FromDiscord | <haxscramper> Actually wait, it means that new user would have to know to do `nim fusion` to install it? |
19:24:01 | FromDiscord | <haxscramper> It is now that they are asked about this during default installation |
19:24:44 | FromDiscord | <konsumlamm> composable iterators would offer `a.map(it => $it)`, which is pretty close imo |
19:25:11 | FromDiscord | <mratsim> I prefer a.map(lambda it: $it) |
19:25:26 | FromDiscord | <mratsim> the => is poor when you need <= for filter. |
19:25:34 | FromDiscord | <mratsim> The "it" always felt like magic. |
19:25:38 | FromDiscord | <konsumlamm> parentheses my friend |
19:25:49 | FromDiscord | <haxscramper> Can't `mapIt` just became a syntax sugar for any if the syntaxes then? |
19:25:51 | FromDiscord | <mratsim> If I want terse I would use Haskell. |
19:27:48 | FromDiscord | <Zrisckrdeluke> If you wanted terse you would program directly for xorg. |
19:27:52 | FromDiscord | <Zrisckrdeluke> or win32 |
19:28:26 | FromDiscord | <Yardanico> that's not terse :P |
19:29:45 | FromDiscord | <hamidb80> In reply to @mratsim "the => is poor": i don't think it's really an issue |
19:30:11 | FromDiscord | <hamidb80> b. filter( num => num <= 10 ) |
19:30:17 | FromDiscord | <hamidb80> sounds funny |
19:30:31 | FromDiscord | <Zrisckrdeluke> In reply to @Yardanico "that's not terse :P": The x11 documentation is composed of roughly 10 or so books. It's very terse. |
19:31:23 | FromDiscord | <hamidb80> In reply to @hamidb80 "b. filter( num": or you can just write b.filterit ( ir <= 10 ) |
19:31:31 | FromDiscord | <hamidb80> (edit) "ir" => "it" |
19:32:43 | FromDiscord | <Zrisckrdeluke> Is fusion a bad thing? I'm scrolling up and there seems to be some drama surrounding it. |
19:32:47 | * | shirtyx quit (Quit: Going offline, see ya! (www.adiirc.com)) |
19:32:53 | FromDiscord | <haxscramper> no, it is just |
19:33:07 | FromDiscord | <haxscramper> well, it was an idea that didn't exactly work out |
19:33:18 | FromDiscord | <haxscramper> But this is just a package now |
19:33:31 | FromDiscord | <Zrisckrdeluke> How will fusion affect me? |
19:33:57 | FromDiscord | <haxscramper> There are quite a number of cool modules in it, maybe you could find something interesting |
19:34:12 | FromDiscord | <haxscramper> Pattern matching, karax-style DSL consturctors, smart pointers, some JS helpers etc. |
19:34:20 | FromDiscord | <haxscramper> Sorted tables |
19:39:58 | FromDiscord | <haxscramper> About fusion etc. - I think I've seen the notion of "I don't know what is going on with a fusion"/"what fusion is" too many times, so I guess it is appropriate to maybe give some conclusive statement on this topic and stick to it. |
19:39:59 | FromDiscord | <haxscramper> Unbunlding nim from fusion and making it into "somewhat more special" package (like that it has special command like `nim fusion` to install) is the least costly one (I suppose). |
19:40:20 | FromGitter | <deech> It would be nice from a usability standpoint if making an object public made it's fields public as well. |
19:41:10 | FromDiscord | <hamidb80> In reply to @deech "It would be nice": so then we don't have private keys |
19:43:05 | FromGitter | <deech> Could maybe do `type O* = object* a:int b:int` where the `object*` means all the fields are public? Dunno, just a thought? |
19:43:30 | FromDiscord | <konsumlamm> eh, most of the time you don't want all fields to be public |
19:44:20 | FromGitter | <deech> Happens enough for me. |
19:44:50 | FromDiscord | <haxscramper> I suppose you can write a macro for that one |
19:45:12 | FromDiscord | <haxscramper> `Object {.allPub.} = object` |
19:45:15 | FromGitter | <deech> Or maybe `type O** = object ...` where `**` means all fields are public, maybe less intrusive. Yeah, could write a macro. |
19:47:09 | FromDiscord | <~355/113 Man> In reply to @konsumlamm "eh, most of the": meh, I still do this anyways :LUL: |
19:49:15 | FromDiscord | <haxscramper> In reply to @haxscramper "About fusion etc. -": Especially considering that #310 basically went nowhere, but now we basically have it solved (at least in my opinion what we got now can be considered acceptable at least) |
19:49:17 | FromDiscord | <dom96> The reason fusion fails is because it’s not realistic to have someone making sure the code in it is high quality |
19:50:19 | FromDiscord | <haxscramper> But it is still better than random libraries |
19:50:42 | FromDiscord | <dom96> How so? |
19:50:46 | FromDiscord | <haxscramper> At least on some topic it is possible to concentrate community efforts on a single implemenation |
19:51:05 | FromDiscord | <haxscramper> For example @konsumlamm did a great job discussing some parts of the patern matching |
19:51:22 | FromDiscord | <konsumlamm> 😊 |
19:52:30 | FromDiscord | <haxscramper> And there was a lot over overall feedback here and there |
19:52:59 | FromGitter | <deech> Is there a pattern matching proposal in the works? |
19:53:16 | FromDiscord | <dom96> Maybe there is some value there, but is it really significant enough over just searching nimble for other implementations and getting in touch with their owners? |
19:53:17 | FromDiscord | <haxscramper> https://nim-lang.github.io/fusion/src/fusion/matching.html |
19:53:30 | FromGitter | <deech> wow, thanks! |
19:54:06 | FromDiscord | <haxscramper> Also see https://github.com/nim-lang/fusion/pull/61 as there have been quite a number of fixes |
19:56:07 | FromGitter | <deech> It does `Option` matching, yay! |
19:56:38 | FromDiscord | <konsumlamm> In reply to @dom96 "Maybe there is some": imo, yes |
19:57:21 | FromDiscord | <konsumlamm> it's way more likely that people will contribute to something that's standard (or de facto standard) than some random nimble package |
19:57:56 | FromDiscord | <haxscramper> In reply to @dom96 "Maybe there is some": if owner has time and if they are interested in fixing things and so on. Fusion does have these problems too, but so does any other open-source project in the world. The difference is that fusion is not maintained by a single person (there are at least xflywind, juancarlospaco, and timotheecour that provide some reviews). Also this does not have that much attention because it has never |
19:58:04 | FromDiscord | <konsumlamm> especially since if something isn't standard, there will probably be multiple competing variants, so you first have to decide which one to use |
20:03:53 | FromDiscord | <konsumlamm> it would be nice if anyone has some time to review my PR: https://github.com/nim-lang/Nim/pull/16961 |
20:03:58 | FromDiscord | <konsumlamm> it's already a week old |
20:06:59 | FromDiscord | <Clyybber> @haxscramper fusion will come with nim optionally; do you still want pattern matching to end up in the stdlib instead of fusion? |
20:10:17 | FromDiscord | <haxscramper> In reply to @Clyybber "<@!608382355454951435> fusion will come": I would like to try and push for pattern matching in stdlib still, because I really feel like this should be a built-in part of the language that does not require any additional installation/configuration. But I can agree that let expressions and view types are important enough to wait with current implementation |
20:10:52 | FromDiscord | <haxscramper> Current solution is a good compromise I think |
20:11:05 | FromDiscord | <haxscramper> For this moment at least |
20:11:15 | FromDiscord | <Clyybber> yeah |
20:11:34 | FromDiscord | <Clyybber> I think it's a better fit for fusion because there are many ways to do pattern matching |
20:11:45 | FromDiscord | <Clyybber> and an implementation will always have to be somewhat opinionated |
20:11:46 | FromDiscord | <haxscramper> yes, all of them |
20:12:04 | FromDiscord | <haxscramper> now try to recommend one to newcomer? |
20:12:31 | FromDiscord | <haxscramper> We have patty, gara, fusion/matching and couple others |
20:12:44 | FromDiscord | <haxscramper> Now we have fusion/matching but still |
20:13:04 | FromDiscord | <haxscramper> If this is official one, why not make a final step and just finalize it |
20:13:23 | FromDiscord | <Clyybber> because there's no end to pattern matching features I suppose |
20:13:47 | FromDiscord | <haxscramper> In reply to @Clyybber "because there's no end": Current set feels more than enough |
20:14:03 | FromDiscord | <haxscramper> If something is missing or feels unnecessary feel free to discuss |
20:14:07 | FromDiscord | <haxscramper> That is the point |
20:14:09 | FromDiscord | <Clyybber> yeah |
20:14:26 | FromDiscord | <konsumlamm> In reply to @konsumlamm "it would be nice": @Clyybber you maybe? :) |
20:14:38 | FromDiscord | <Clyybber> thats why I think it fits better into fusion, because it has more possiblity for change |
20:14:47 | FromDiscord | <Clyybber> In reply to @konsumlamm "<@!107882072974065664> you maybe? :)": sure :) |
20:14:57 | * | koltrast_ quit (Ping timeout: 265 seconds) |
20:15:01 | FromDiscord | <haxscramper> I can agree to multi-month syntax tweaks and all (basically what we got in #245), but the ultimate target is that nim would have built-in pattern matching, and it would be the best one |
20:15:25 | FromDiscord | <haxscramper> At least the best one we managed to come up with |
20:15:47 | ForumUpdaterBot | New thread by Mikebelanger: Hotcodereloading and libfswatch, see https://forum.nim-lang.org/t/7512 |
20:15:51 | FromDiscord | <haxscramper> And it would be stabilized, since I can't tweak things in fusion all that much anyway |
20:15:59 | FromDiscord | <Clyybber> yeah, but changing something in fusion is easier than in stdlib |
20:16:04 | FromDiscord | <haxscramper> how so? |
20:16:05 | FromDiscord | <Clyybber> should we discover a better way to do things |
20:16:12 | FromDiscord | <haxscramper> ah, you mean this |
20:16:16 | FromGitter | <deech> haxscamper, reading over your matching implementation and it looks nice! What does shortened kind fields mean? Does it just detect some common string prefix? |
20:16:45 | FromDiscord | <haxscramper> Yes, you can match `ForStmt()` instead of `nnkForStmt()` |
20:16:53 | FromDiscord | <haxscramper> If you mean this one |
20:17:21 | * | Vladar quit (Quit: Leaving) |
20:17:41 | FromDiscord | <haxscramper> In reply to @Clyybber "should we discover a": I think we certainly would discover a better way of doing things, but this might only lead to minor tweaks of breaking syntax change that would warrant new fusion module anyway |
20:17:52 | FromGitter | <deech> I was looking at this one as well: https://github.com/nim-lang/fusion/blob/master/tests/tmatching.nim#L1488 |
20:18:06 | FromDiscord | <haxscramper> But breaking change is impossible in stdlib |
20:18:11 | FromDiscord | <Clyybber> exactly |
20:18:16 | FromDiscord | <haxscramper> And highly discouraged in fusion |
20:18:28 | FromDiscord | <Clyybber> yeah, but adding a new module to stdlib is also harder than to fusion |
20:18:57 | FromDiscord | <Clyybber> it's "less bad" if we end up with 3 matching impls in fusion, than if we end up with 3 matching impls in stdlib |
20:19:17 | FromDiscord | <Clyybber> because fusion makes less guarantees about maintenance |
20:19:21 | FromDiscord | <haxscramper> deech: it uses https://github.com/nim-lang/fusion/blob/ea18f8559c514b227b148300a2900b3e2a282b0d/tests/tmatching.nim#L1374 , and yes it allows to drop `cnt` prefix |
20:19:30 | FromDiscord | <Clyybber> @konsumlamm merged :) |
20:19:33 | * | Vladar joined #nim |
20:19:37 | FromDiscord | <konsumlamm> thx |
20:19:43 | FromDiscord | <Clyybber> thx for your PRs |
20:19:55 | FromDiscord | <konsumlamm> you're welcome xD |
20:20:04 | FromDiscord | <konsumlamm> there's still a lot to do |
20:21:10 | FromGitter | <deech> haxscamper, thanks for this. It makes an `Option` heavy API much nicer to use. |
20:21:22 | FromDiscord | <haxscramper> In reply to @Clyybber "it's "less bad" if": Maybe we could do something like this - advertise fusion anyway (as nim's boost (C++ boost)), and then reuse all feedback and user experience for making new RFC that uses all of that data. Basically that C++ does with boost |
20:21:34 | * | koltrast joined #nim |
20:21:50 | FromDiscord | <Clyybber> you mean letting matching stay in fusion and advertise fusion more? |
20:21:50 | FromDiscord | <haxscramper> 3-impl problem can be in any library |
20:21:54 | FromDiscord | <haxscramper> yes |
20:21:56 | FromDiscord | <haxscramper> exactly |
20:21:58 | FromDiscord | <Clyybber> sounds good |
20:21:59 | FromDiscord | <Clyybber> yeah |
20:22:26 | FromDiscord | <Clyybber> ironically making fusion optional will be kind of advertisement for fusion |
20:22:36 | FromDiscord | <Clyybber> because then people will actually know about it since they have to choose :P |
20:22:42 | FromDiscord | <haxscramper> I can write an overview article for next release about all modules in fusion, and we can just serve it as a brand-new thing (almost), |
20:22:52 | FromDiscord | <haxscramper> + my pattern matching article |
20:22:56 | FromDiscord | <haxscramper> For the next release |
20:23:25 | FromDiscord | <Clyybber> an article about fusion sounds like the exact right thing to do :D |
20:23:38 | FromDiscord | <Clyybber> but check back with Araq, maybe he's already writing one |
20:24:58 | FromDiscord | <konsumlamm> @Clyybber btw, do you happen to know why the CI fails here: https://github.com/nim-lang/Nim/pull/17036 ? it seems like CI is sometimes randomly failing due to SSL... |
20:25:07 | FromDiscord | <Clyybber> yeah, it's flaky |
20:25:14 | FromDiscord | <Clyybber> I think it's because of the recent SSL changes |
20:25:36 | FromDiscord | <konsumlamm> In reply to @Clyybber "an article about fusion": oh ye, an article about fusion sounds like a great idea |
20:26:18 | FromDiscord | <haxscramper> In reply to @Clyybber "you mean letting matching": And then going through full RFC process again for pattern matching, but armed with user feedback, discovered design and usability flaws and so on. We don't have an infinite amount of ways for implementing things, and some parts might really be unnecessary and require cutting out parts |
20:27:20 | FromDiscord | <haxscramper> #245 laid the foundation, now `fusion/matching` will provide real-world usage, and then we will see what's next |
20:27:59 | FromDiscord | <Clyybber> sounds like a plan |
20:40:17 | FromDiscord | <haxscramper> In reply to @konsumlamm "oh ye, an article": I want to do a general overview of all modules & push for the analogy of fusion being nim's boost but "more official". |
20:47:13 | * | abm quit (Quit: Leaving) |
20:47:14 | * | haxscramper quit (Remote host closed the connection) |
20:47:38 | * | haxscramper joined #nim |
20:47:55 | * | abm joined #nim |
20:58:11 | * | haxscramper quit (Remote host closed the connection) |
21:07:17 | * | liblq-devel joined #nim |
21:08:03 | * | giaco quit (Ping timeout: 256 seconds) |
21:10:12 | * | liblq-devel quit (Client Quit) |
21:31:17 | * | lritter quit (Ping timeout: 256 seconds) |
22:23:57 | * | anon_seren1ty joined #nim |
22:24:50 | * | anon_seren1ty quit (Remote host closed the connection) |
22:47:02 | * | a_chou quit (Quit: a_chou) |
22:48:28 | saem | oh joy, all sorts of VM crashes are now being surfaced. Time to go hunting. |
22:59:16 | * | vicfred quit (Quit: Leaving) |
23:01:06 | * | tane quit (Quit: Leaving) |
23:02:22 | * | WingardiumLevios joined #nim |
23:07:24 | * | CcxWrk quit (Ping timeout: 246 seconds) |
23:09:32 | * | WingardiumLevios left #nim ("WeeChat 1.9.1") |
23:11:01 | * | jess is now known as j |
23:13:11 | * | CcxWrk joined #nim |
23:17:40 | * | vsantana quit (Ping timeout: 272 seconds) |
23:34:29 | FromDiscord | <ElegantBeef> @haxscramper add a submission to this month with nim about your pattern matching and describe fusion in it 😛 |
23:36:50 | * | Vladar quit (Quit: Leaving) |
23:37:32 | * | vicfred joined #nim |