00:03:10 | FromDiscord | <ieltan> In reply to @.uninnocent "How can I encrypt": Is the encrypted string stored in the disk and then read by Nim? |
00:05:33 | FromDiscord | <ieltan> How I would approach this is to use a C library for encrypting the string in python using c bindings, and then use it again to decrypt it in Nim using c binding yet again, this ensure the underlying implementation for the encryption mechanism is the same across the two language and have the same bit pattern |
00:05:46 | FromDiscord | <.uninnocent> In reply to @ieltan "Is the encrypted string": No, it isn't |
00:05:56 | FromDiscord | <.uninnocent> Its fetched from a server |
00:07:43 | FromDiscord | <ieltan> Ok, then the server is probably using a standard so that you can easily decrypt it, you can just use a Nim library that deals with it without much issues normally |
00:08:14 | FromDiscord | <ieltan> (doesn't help that you don't tell us what kind of encrypting algorithm is being used) |
01:08:39 | * | mal``` quit (Server closed connection) |
01:09:22 | * | mal`` joined #nim |
02:05:55 | * | ajunior quit (Remote host closed the connection) |
02:12:35 | * | ajunior joined #nim |
02:28:27 | * | ajunior quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
03:23:17 | * | m5zs7k quit (Ping timeout: 245 seconds) |
03:23:55 | * | m5zs7k joined #nim |
03:39:55 | * | m5zs7k quit (Ping timeout: 240 seconds) |
03:40:46 | * | m5zs7k joined #nim |
04:25:33 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=4C12 |
04:31:45 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4C15 |
04:33:33 | FromDiscord | <ajusa> ah resort to inheritance, that actually makes sense. feels weird that the distinct type doesn't work though |
04:34:41 | FromDiscord | <Elegantbeef> It's an issue with the borrow pragma, it's likely an easy fix |
04:42:29 | * | noeontheend quit (Remote host closed the connection) |
04:57:02 | * | Amun-Ra quit (Server closed connection) |
04:57:21 | * | Amun-Ra joined #nim |
05:01:21 | * | noeontheend joined #nim |
05:04:16 | * | noeontheend quit (Remote host closed the connection) |
05:06:05 | * | noeontheend joined #nim |
05:36:39 | * | rockcavera quit (Remote host closed the connection) |
05:53:58 | * | azimut quit (Ping timeout: 240 seconds) |
06:10:35 | * | kenran joined #nim |
06:42:22 | FromDiscord | <Elegantbeef> If anyone is following along at home, now properly have the nimscript API piped for the Nim's dynlib https://github.com/beef331/nimscripter/blob/dll/tests/lib/helloworld.nim |
06:45:31 | * | ntat joined #nim |
06:54:33 | * | ajunior joined #nim |
06:55:01 | * | ajunior quit (Client Quit) |
07:05:18 | FromDiscord | <nnsee> In reply to @.uninnocent "How can I encrypt": you're probably better of choosing an encryption scheme and then seeing which python and nim libraries support that |
07:05:41 | FromDiscord | <nnsee> encryption itself is just maths and makes no reservations or demands for languages |
07:06:21 | FromDiscord | <nnsee> first you should probably want to figure out whether you're looking for symmetric or asymmetric encryption |
08:11:26 | FromDiscord | <ratogbm> sent a code paste, see https://play.nim-lang.org/#ix=4C23 |
08:11:32 | FromDiscord | <ratogbm> (edit) "https://play.nim-lang.org/#ix=4C23" => "https://play.nim-lang.org/#ix=4C24" |
08:14:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/50SRq |
08:15:00 | FromDiscord | <odexine> note that will cause a copy |
08:15:05 | FromDiscord | <Elegantbeef> In Nim `ref` are GC'd heap allocated data |
08:15:33 | FromDiscord | <Elegantbeef> No that will not copy with arc/orc cause move semantics |
08:15:45 | FromDiscord | <ratogbm> In reply to @odexine "note that will cause": Yeah, but I want 2 things pointing to the same object... |
08:16:16 | FromDiscord | <ratogbm> sent a code paste, see https://play.nim-lang.org/#ix=4C27 |
08:17:06 | FromDiscord | <odexine> In reply to @Elegantbeef "No that will not": i mean when adapted more closely to what he wants, in the case that `list` is not last-used on `p` |
08:17:20 | FromDiscord | <Elegantbeef> `let myR = list` |
08:20:40 | FromDiscord | <ratogbm> sent a code paste, see https://play.nim-lang.org/#ix=4C28 |
08:20:59 | FromDiscord | <ratogbm> (edit) "https://play.nim-lang.org/#ix=4C28" => "https://play.nim-lang.org/#ix=4C29" |
08:21:22 | FromDiscord | <Elegantbeef> You cannto do that safely in Nim |
08:21:23 | FromDiscord | <Elegantbeef> cannot\ |
08:21:45 | FromDiscord | <Elegantbeef> That's the closest you get |
08:21:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4C2a |
08:21:50 | FromDiscord | <Elegantbeef> Whoops `var p: ptr seq[int]` |
08:22:42 | FromDiscord | <ratogbm> I simply wanted another variable for the last element, so I don't have to drag the "big" one everywhere |
08:23:02 | FromDiscord | <odexine> perhaps a template would work for you |
08:23:40 | FromDiscord | <Elegantbeef> A template or taking the address are the only solutions |
08:24:04 | FromDiscord | <ratogbm> sent a code paste, see https://play.nim-lang.org/#ix=4C2b |
08:24:23 | FromDiscord | <ratogbm> (edit) "https://play.nim-lang.org/#ix=4C2b" => "https://play.nim-lang.org/#ix=4C2c" |
08:24:27 | FromDiscord | <Elegantbeef> Right and that's the same as `var p = addr list[^1]` |
08:24:33 | FromDiscord | <Elegantbeef> But that's not safe |
08:24:53 | FromDiscord | <Elegantbeef> `template p: var seq[int] = list[^1]` |
08:25:19 | FromDiscord | <Elegantbeef> The latter is safe but has the same issue as the first |
08:25:30 | FromDiscord | <Elegantbeef> has a similar issue to the first\ |
08:25:42 | FromDiscord | <Elegantbeef> If you add to the `list` whilst you have one of these you do not get a stable value |
08:26:41 | FromDiscord | <ratogbm> What does "stable" mean? |
08:27:02 | FromDiscord | <Elegantbeef> With the pointer any movement of the sequence causes a dangling pointer |
08:27:18 | FromDiscord | <Elegantbeef> In the template any addition to the list causes you to lose the reference since it's always indexing by `^1` |
08:27:19 | FromDiscord | <ratogbm> oh, I see... |
08:27:50 | FromDiscord | <ratogbm> In reply to @Elegantbeef "`template p: var seq[int]": but isn't this just a placeholder? |
08:28:44 | FromDiscord | <Elegantbeef> It's code substitution but results with the same outcome as the python, assuming you do not mutate `list` |
08:28:45 | FromDiscord | <ratogbm> Oh, you mean that the pointer will be stuck to the end of the list and move as soon as I add to the list. |
08:29:03 | FromDiscord | <ratogbm> (edit) "be stuck" => "stick" |
08:29:14 | FromDiscord | <ratogbm> (edit) "pointer" => "template" |
08:57:54 | * | psydruid joined #nim |
10:26:16 | * | jmdaemon quit (Ping timeout: 260 seconds) |
10:35:01 | * | jmdaemon joined #nim |
10:51:59 | * | ajunior joined #nim |
11:36:35 | * | jmdaemon quit (Ping timeout: 264 seconds) |
12:07:12 | * | lucasta joined #nim |
12:17:05 | * | koltrast quit (Quit: ZNC - http://znc.in) |
12:19:08 | * | koltrast joined #nim |
12:35:48 | * | ajunior quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
12:56:40 | * | lumo_e joined #nim |
13:00:06 | FromDiscord | <.kanaxa> Hi guys! Been learning Nim over the past month, it's a really pretty language (IMHO, and syntactically speaking) |
13:00:13 | FromDiscord | <.kanaxa> New here, so I'm just saying hi |
13:01:47 | FromDiscord | <odexine> hi |
13:02:51 | * | ajunior joined #nim |
13:06:12 | FromDiscord | <Phil> In reply to @.kanaxa "Hi guys! Been learning": Cheers, and wait until you get to avoid validation for stuff simply because of nim's type system, that's when you really start to appreciate it 😛 |
13:06:33 | FromDiscord | <Phil> An entire step of code, annihilated for the most part |
13:07:47 | * | xet7 quit (Remote host closed the connection) |
13:09:40 | * | xet7 joined #nim |
13:22:08 | * | lucasta quit (Quit: Leaving) |
13:26:51 | FromDiscord | <jan_darkk> sent a code paste, see https://play.nim-lang.org/#ix=4C3s |
13:27:08 | FromDiscord | <Phil> Neither, write `proc myProc() = 5` or the like |
13:27:17 | FromDiscord | <Phil> In fact, if you use std/sugar, you can turn that into `() => 5` |
13:27:22 | FromDiscord | <e.e.7> Congrats on Nim 2.0. |
13:27:24 | FromDiscord | <e.e.7> https://nim-lang.org/blog/2023/08/01/nim-v20-released.html |
13:27:55 | FromDiscord | <Phil> O.O hot dang |
13:28:12 | FromDiscord | <jan_darkk> In reply to @isofruit "Neither, write `proc myProc()": oh, tyvm! |
13:29:34 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=4C3t |
13:30:17 | FromDiscord | <jan_darkk> ah okay, that makes sense |
13:30:19 | FromDiscord | <jan_darkk> ty again |
13:34:11 | NimEventer | New thread by morturo: Rc[T] implementation, see https://forum.nim-lang.org/t/10365 |
13:38:39 | FromDiscord | <odexine> yo what ive never heard of the tuple unpacking thing |
13:39:07 | FromDiscord | <Phil> You mean that you can return a tuple from a proc and auto-unpack them when calling that? |
13:39:34 | FromDiscord | <Phil> That was one of the pieces of syntax that I was looking for pretty early on |
13:40:51 | FromDiscord | <odexine> no? i mean the nesting |
13:41:01 | FromDiscord | <odexine> i never heard any updates on tuple unpacking |
13:42:56 | FromDiscord | <odexine> yo unnamed block break being deprecated, cool |
13:50:55 | FromDiscord | <Zoom> congrats on 2.0 everyone! |
13:51:43 | * | ajunior quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:58:46 | * | progranner joined #nim |
13:59:23 | FromDiscord | <Chronos [She/Her]> Anyone know if crockford base32 has a Nim impl? |
14:05:23 | * | progranner quit (Ping timeout: 244 seconds) |
14:05:34 | * | ntat quit (Quit: leaving) |
14:07:19 | * | kenran quit (Remote host closed the connection) |
14:08:22 | * | progranner joined #nim |
14:21:27 | FromDiscord | <.kanaxa> Congrats on Nim 2.0! |
14:21:43 | FromDiscord | <.kanaxa> The Hacker News thread: https://news.ycombinator.com/item?id=36955806 |
14:24:30 | FromDiscord | <.kanaxa> In reply to @isofruit "Cheers, and wait until": I keep getting blown away by the UFC syntax, I never knew how expressive my code suddenly feels - especially when I feel like chaining calls |
14:24:45 | FromDiscord | <.kanaxa> UFC syntax feels like I'm racking up combos in a fighting game |
14:26:14 | FromDiscord | <Phil> In reply to @.kanaxa "I keep getting blown": I know how you feel!↵Feels bad though when you start getting more into compile-time stuff and start doing things in super-tiny steps to make sure you can see well where the compiler blows up on you 😛 |
14:26:19 | FromDiscord | <Phil> (edit) "In reply to @.kanaxa "I keep getting blown": I know how you feel!↵Feels bad though when you start getting more into compile-time stuff and ... start" added "generating code and" |
14:27:53 | FromDiscord | <Phil> Or I guess it's more that I start doing things in super tiny steps at that point because making libs e.g. to generate specific procs at compile time for the user (e.g. mapping an instance of type A to type B where most of the fields are dead simple) can be challenging, or rather generating more complex code in dynamic ways can be ^^ |
14:28:08 | FromDiscord | <Phil> (edit) "Or I guess it's more that I start doing things in super tiny steps at that point because making libs e.g. to generate specific procs at compile time for the user (e.g. mapping an instance of type A to type B where most of the fields are dead simple) can be challenging, or rather generating more complex code ... inrather" added "at compile-time" | "at compile-timein ... dynamic" added "rather" |
14:28:12 | FromDiscord | <.kanaxa> I'm not a professional programmer by trade, so Nim and a lot of computer science precepts feels quite difficult to me, some of the conversations you guys are having feel alien to me (e.g. things like compile-time vs run-time), I went through macros and the AST stuff and my head just burst |
14:28:19 | * | azimut joined #nim |
14:28:26 | FromDiscord | <.kanaxa> But I'm slowly catching up |
14:28:38 | FromDiscord | <Phil> In reply to @.kanaxa "I'm not a professional": Perfectly fine. I started with nim roughly 18 months ago and I still only have the very basic grasps of macros |
14:28:58 | FromDiscord | <Phil> Before that I was mostly a python dev and basically tuned out the second anyone brought up this stuff |
14:29:31 | FromDiscord | <Phil> The more you use nim you might eventually just run into this stuff on your own and can then learn on a case-by-case basis, so it's perfectly fine 😉 |
14:29:53 | FromDiscord | <Phil> For now just get used to the basic syntax, everything else can come later |
14:30:04 | FromDiscord | <.kanaxa> Yeah! I'm quite keen on learning, Nim feels quite exciting, I'm a Python guy mostly as well |
14:31:46 | FromDiscord | <.kanaxa> By profession I'm a practising lawyer/court advocate and solicitor, so heavy systems programming stuff is quite a distant world away for me to catch up to, but I really admire the vibe in the forums |
14:31:55 | FromDiscord | <.kanaxa> So I decided to focus on Nim |
14:32:29 | FromDiscord | <leetnewb> I'm also not a programmer by trade, and have found hanging out in the discord to be helpful at slowly grasping stuff over time |
14:32:50 | FromDiscord | <leetnewb> also bashing my head against nim docs over and over |
14:35:11 | FromDiscord | <.kanaxa> The hard part for me with Nim was the initial toolchain setup - I'm a Jetbrains IDE/Sublime Text user, but neither supported reliable visual debugging |
14:35:28 | FromDiscord | <.kanaxa> I've tried Nim debugging with GDB and the TUI and it seems quite usable |
14:35:33 | FromDiscord | <.kanaxa> But I settled on VSCode and its' quite nice now |
14:35:49 | FromDiscord | <.kanaxa> I may make a video on how beginners can setup visual debugging with VSCode for Nim, if I have a bit of time later |
14:36:21 | FromDiscord | <ieltan> UFCs has certain pitfalls but other than that I just can't go back to ole OOP-like approach |
14:36:34 | FromDiscord | <Phil> In that case you're farther along than I am, I never found a decent way to debug with gdb that I didn't find unwieldy, I debug with just compiling and wrapping my head around my code |
14:36:48 | * | progranner quit (Ping timeout: 252 seconds) |
14:37:31 | FromDiscord | <Phil> (edit) "farther" => "further" |
14:38:18 | FromDiscord | <.kanaxa> Especially coming from Python where the visual debugging support is awesome, and now having to deal with types, I need a debugger to make sense of things and learn Nim - I'm not a programmer of much ability yet, I can't hold state that well in my head without some IDE support haha |
14:39:24 | FromDiscord | <.kanaxa> In reply to @isofruit "In that case you're": I'd be happy to share the setup later |
14:39:33 | FromDiscord | <ieltan> In reply to @yu.vitaqua.fer.chronos "Anyone know if crockford": There is adelq/ulid on github that supposedly use it internally but I have no clue if what's in the source actually is a true and honest implementation |
14:39:33 | FromDiscord | <.kanaxa> (edit) "later" => "later, in case you might find it useful" |
14:45:01 | FromDiscord | <Phil> In reply to @.kanaxa "I'd be happy to": Sure!↵I have both vscode and Intellij set up so setup for either is fine by me |
14:45:19 | * | progranner joined #nim |
14:58:20 | * | ntat joined #nim |
14:59:37 | FromDiscord | <starkiller1493> IntelliJ works? The Nim plugin is outdated and even when it wasn't it was pretty buggy |
15:00:00 | FromDiscord | <starkiller1493> (edit) "works?" => "working?" |
15:01:12 | FromDiscord | <bostonboston> I've been using it for a month or so and it's not the most feature rich thing in the world but it works fine |
15:01:21 | FromDiscord | <bostonboston> There is one bug I know of |
15:02:04 | FromDiscord | <Phil> ? When did you try, last I did a couple months back it was alright, faster autocomplete and sightly more reliable jumping to definitions of symbols. |
15:02:25 | FromDiscord | <Phil> Though slightly messes up syntax highlighting |
15:03:01 | FromDiscord | <Phil> (edit) "messes" => "messed" |
15:03:16 | FromDiscord | <Phil> (that was directed at Starkiller) |
15:03:25 | FromDiscord | <bostonboston> I take that back I have 2 bugs, for whatever reason intellij has a hard time browsing/indexing nimble packages |
15:04:36 | FromDiscord | <Phil> The only reason I don't use Intellij more regularly is that compared to vscode it's way more resource intensive and the difference in opening a window in 5 Vs 10 seconds to open a window is one I notice |
15:05:38 | FromDiscord | <.kanaxa> In reply to @starkiller1493 "You got IntelliJ working?": No, but I did get the debugger working with the Nimsaem plugin in VSCode, and it's quite a good experience actually |
15:06:14 | FromDiscord | <.kanaxa> The IntelliJ nim plugin really was buggy |
15:06:27 | FromDiscord | <.kanaxa> (edit) "buggy" => "buggy, from my experience" |
15:06:53 | FromDiscord | <.kanaxa> (edit) "experience" => "experience, but that was like last year" |
15:07:09 | FromDiscord | <.kanaxa> I think there were updates this year but I haven't tested it since then |
15:09:06 | FromDiscord | <.kanaxa> I just updated to Nim 2.0 |
15:09:14 | FromDiscord | <.kanaxa> God, the updating experience for Nim is so smooth with choosenim |
15:11:15 | FromDiscord | <odexine> i think my biggest gripe with nim is still tooling |
15:11:25 | FromDiscord | <odexine> maybe i really should be getting to trying my hand at a formatter |
15:16:07 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
15:16:32 | * | progranner joined #nim |
15:16:46 | FromDiscord | <jmgomez> In reply to @odexine "i think my biggest": Hopefully now that 2.0 is out, things will improve for 2.2. I dont think it will automagically be better without anyone working on improving the Saem extension, but things likely will be better |
15:17:15 | FromDiscord | <.kanaxa> "Araq is a true artist" - high praise! https://media.discordapp.net/attachments/371759389889003532/1135954399534002246/image.png |
15:21:58 | FromDiscord | <griffith1deadly> eh, just wanna stable saem plugin with lsp.. |
15:24:58 | FromDiscord | <ratogbm> I am sorry to interupt youall, but what do I do if 1 characters isn't one character? |
15:25:16 | FromDiscord | <ratogbm> I am having really trouble with UTF |
15:26:12 | FromDiscord | <demotomohiro> In reply to @ratogbm "I am sorry to": https://nim-lang.org/docs/unicode.html↵Did you checked this module? |
15:26:22 | FromDiscord | <ratogbm> no... |
15:38:34 | FromDiscord | <bung8954> @demotomohiro `x.Foo[:T]` where's the document for the syntax `[:T]` ? |
15:39:43 | FromDiscord | <narimiran> https://news.ycombinator.com/item?id=36955806↵↵44 comments so far, and not even one mention of case insensitivity!! Wow, 2.0 is really great! |
15:39:59 | FromDiscord | <narimiran> (edit) "https://news.ycombinator.com/item?id=36955806↵↵44 comments so far, and not even one mention of case insensitivity!! Wow, ... 2.0" added "Nim" |
15:41:40 | FromDiscord | <.kanaxa> I just realized `std/db_sqlite => db_connector/db_sqlite` - sqlite's now in a third-party package? I would have loved that to be part of the standard library like in Python though |
15:48:51 | * | progranner quit (Ping timeout: 260 seconds) |
15:52:28 | FromDiscord | <ieltan> In reply to @narimiran "https://news.ycombinator.com/item?id=36955806 44 c": A shocker, I thought it would be brought up at least once |
15:53:04 | FromDiscord | <ieltan> some "testimonies" of people using Nim in prod too |
15:53:05 | FromDiscord | <narimiran> In reply to @ieltan "A shocker, I thought": day is still young.... if it doesn't happen, the end of the world is near |
15:53:46 | FromDiscord | <ieltan> Hahaha 😂 |
15:56:16 | FromDiscord | <ieltan> In reply to @.kanaxa "I just realized `std/db_sqlite": Its because you need some of the stdlib updates to not be not tied to Nim releases or devel, afaik |
15:56:28 | FromDiscord | <ieltan> It's still maintained and all |
15:56:35 | FromDiscord | <.kanaxa> Fair, fair |
15:56:53 | FromDiscord | <ieltan> (edit) "It's still ... maintainedso" added "officially" | "officiallymaintained and all ... " added "so I don't think it's "third-party"" |
15:57:17 | FromDiscord | <ieltan> Depends on your point of view though |
15:57:37 | FromDiscord | <demotomohiro> In reply to @bung8954 "<@288750616510201856> `x.Foo[:T]` where's the": https://nim-lang.org/docs/manual.html#procedures-method-call-syntax |
15:58:14 | * | disso-peach quit (Quit: Leaving) |
16:02:19 | FromDiscord | <bung8954> In reply to @demotomohiro "https://nim-lang.org/docs/manual.html#procedures-me": Thanks ! |
16:04:37 | FromDiscord | <starkiller1493> In reply to @isofruit "? When did you": In January I believe and it seems it hasn't been updated since |
16:06:36 | FromDiscord | <treeform> In reply to @.kanaxa "I just realized `std/db_sqlite": I also have a sqlite wrapper + ORM, https://github.com/treeform/debby , but you can use the lower level interface if you like https://treeform.github.io/debby/debby/sqlite.html |
16:07:48 | FromDiscord | <starkiller1493> In reply to @.kanaxa "No, but I did": I have that working too but stepping doesn't really work as step over and step into act almost identically |
16:27:34 | FromDiscord | <.kanaxa> In reply to @treeform "I also have a": This is nice! |
16:28:40 | FromDiscord | <.kanaxa> Feels a bit like Python's dataset package: https://dataset.readthedocs.io/en/latest/ |
16:28:57 | FromDiscord | <.kanaxa> Except that debby appears to be a fuller ORM |
16:29:32 | FromDiscord | <treeform> In reply to @.kanaxa "This is nice!": I actually based min on another python library: https://docs.peewee-orm.com/en/latest/ |
16:29:38 | FromDiscord | <.kanaxa> Looking forward to try it out! |
16:30:02 | FromDiscord | <.kanaxa> In reply to @treeform "I actually based min": I've used peewee before, it's quite nice |
16:30:40 | FromDiscord | <.kanaxa> Although personally if I'm leaning that way I just prefer to use a hacked-out version of Django's ORM, because I'm so used to its documentation and QuerySet idioms |
16:38:26 | FromDiscord | <ambient3332> Is OpenMP broken on Nim 2.0 stable? |
16:40:18 | FromDiscord | <Chronos [She/Her]> In reply to @ieltan "There is adelq/ulid on": Hm fair, thanks |
16:46:17 | FromDiscord | <Chronos [She/Her]> In reply to @ieltan "There is adelq/ulid on": Shame, no decoder |
16:47:14 | FromDiscord | <ratogbm> Guys, is there a way to index unicode properly? |
16:48:21 | FromDiscord | <ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=4C4l |
16:48:35 | FromDiscord | <ambient3332> Some OpenMP error |
16:50:11 | FromDiscord | <ambient3332> "error: invalid branch to/from OpenMP structured block" |
16:53:56 | FromDiscord | <ambient3332> --mm:refc works fine, but both ARC and ORC fail |
16:56:52 | FromDiscord | <ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=4C4o |
17:12:09 | * | mahlon quit (Quit: PotatoTech) |
17:12:30 | * | mahlon joined #nim |
17:14:39 | FromDiscord | <treeform> Nim 2.0 did not fix this? ↵> Also Nim requires you to use unique field names across all variants. |
17:20:41 | FromDiscord | <starkiller1493> I'm passing an object through several function with `obj: var MyObj`↵it works with synchronous code, but throws an error with async when compiling `Error: 'self' is of type <var SauceNao> which cannot be captured as it would violate memory safety,` |
17:21:15 | FromDiscord | <starkiller1493> (edit) |
17:22:46 | * | rockcavera joined #nim |
17:36:55 | * | mahlon quit (Quit: PotatoTech) |
17:38:56 | FromDiscord | <bung8954> that means you pass a mutable variable to async proc, it's not safe to capture it as the proc environment as it can be modified |
17:40:35 | * | mahlon joined #nim |
17:41:07 | * | mahlon quit (Client Quit) |
17:46:20 | FromDiscord | <starkiller1493> oh, that makes sense↵what would be the optimal way of modifying an attribute of an object several functions deep? |
17:46:33 | FromDiscord | <starkiller1493> (edit) "oh, that makes sense↵what would be the optimal way of modifying an attribute of an object several ... functions" added "async" |
17:47:19 | FromDiscord | <jmgomez> In reply to @treeform "Nim 2.0 did not": AFAIK there was no work in that direction |
17:49:58 | * | mahlon joined #nim |
17:51:33 | FromDiscord | <nervecenter> In reply to @starkiller1493 "oh, that makes sense": That seems sort of opposed to the async programming model |
17:52:06 | FromDiscord | <nervecenter> I think |
17:52:17 | * | mahlon quit (Client Quit) |
17:52:43 | FromDiscord | <nervecenter> You could of course handle it functionally and produce a new modified copy of the object that's assigned when the async call stack unwinds |
17:53:05 | FromDiscord | <nervecenter> But I doubt that's what you want |
18:03:38 | * | junaid_ joined #nim |
18:12:04 | FromDiscord | <starkiller1493> Yeah, returning a new object would probably make most sense, but it would make the API wrapper bit less clean to use |
18:12:34 | FromDiscord | <starkiller1493> (edit) "object" => "instance" |
18:22:22 | FromDiscord | <leximax> Hey there. I haven't used Nim in a number of years, but saw Nim hitting the big 2.0 milestone on HN and finishing off its ARC/ORC implementation and I wanted to extend congratulations to the development team. |
18:24:12 | * | bmp left #nim (#nim) |
18:25:09 | * | mahlon joined #nim |
18:25:22 | * | mahlon quit (Client Quit) |
18:26:13 | * | mahlon joined #nim |
18:26:34 | * | mahlon quit (Client Quit) |
18:29:05 | FromDiscord | <Phil> In reply to @leximax "Hey there. I": You can leave a message in the forum thread, I think only a fairly small subset of the core-devs actually check out the main channel 😉 |
18:30:11 | * | mahlon joined #nim |
18:30:24 | * | mahlon quit (Client Quit) |
18:30:33 | FromDiscord | <Elegantbeef> Nope↵(@treeform) |
18:31:12 | FromDiscord | <Elegantbeef> Make the object a `ref object` then remove the `var` |
18:31:12 | FromDiscord | <Elegantbeef> Fuck matrix slow |
18:31:45 | * | junaid_ quit (Remote host closed the connection) |
18:31:46 | FromDiscord | <Elegantbeef> @starkiller1493\: the ref object comment was for you |
18:35:00 | FromDiscord | <leximax> In reply to @isofruit "You can leave a": Hrm. What does most of the user-base use? When I was last hanging around it was mainly in IRC, but I've shut down my IRC bouncer a while back. |
18:36:34 | FromDiscord | <Phil> In reply to @leximax "Hrm. What does": I actually don't have any numbers whatsoever.↵This discord tends to be more active because direct communication and all that, however for more complicated things you tend to get better replies on the forums.↵Some folks (particularly some of the more experienced ones) tend to only occassionally be active and for reaching those for more complex questions the forum has proven (at least to me) superi |
18:37:09 | FromDiscord | <Phil> Just if you wanted to reach the compiler-devs in particular a good number of them basically only hang out in the internals channel 😄 |
18:37:21 | FromDiscord | <Phil> (edit) "Just if you wanted to reach the compiler-devs in particular a good number of them basically only hang out in the internals channel 😄 ... " added "and/or the forum" |
18:38:18 | FromDiscord | <leximax> Nah, I was just mostly curious. |
18:39:08 | * | cm quit (Ping timeout: 246 seconds) |
18:39:15 | * | cm_ joined #nim |
18:39:40 | * | cm_ is now known as cm |
18:44:15 | FromDiscord | <starkiller1493> In reply to @Elegantbeef "Make the object a": that still doesn't allow assignment |
18:45:19 | FromDiscord | <elegantbeef> Right you cannot capture `var T` so if what you require needs that you have to return or capture by pointer if you know it's safe |
18:46:43 | * | ntat quit (Quit: leaving) |
18:47:16 | FromDiscord | <starkiller1493> it should be safe with a pointer imo, i'm gonna try that |
18:47:51 | * | mahlon joined #nim |
18:48:11 | FromDiscord | <Phil> Using pointers to escape the type system you say? |
18:48:20 | FromDiscord | <Phil> Sounds like a familiar story 🤔 |
18:51:47 | FromDiscord | <elegantbeef> It's not escaping the type system |
18:51:56 | FromDiscord | <elegantbeef> it's escaping the memory safety |
18:54:17 | FromDiscord | <djazz> I did that too today to pass a var arg to a closure. It worked on microcontroller to just to "var capturedself = self" but not on pc |
18:54:35 | FromDiscord | <djazz> It created a copy on pc |
18:55:07 | FromDiscord | <djazz> So any changes to capturedself did not get into self |
18:56:55 | FromDiscord | <Elegantbeef> you should do `var captured = self.addr` then use that inside the closure |
18:56:58 | FromDiscord | <Elegantbeef> Assuming that's memory safe |
18:57:15 | FromDiscord | <Elegantbeef> If the closure does not outlive the `var` you're fine |
18:57:20 | FromDiscord | <Elegantbeef> If it does there is no real way of doing it |
18:57:28 | FromDiscord | <etra> how much of a bad idea would be to use something async like <https://github.com/ba0f3/telebot.nim> with <https://github.com/mratsim/weave>? |
18:59:42 | FromDiscord | <Elegantbeef> As long as you do not try to send futures across the bridge |
18:59:45 | FromDiscord | <djazz> In reply to @Elegantbeef "you should do `var": Yeah thats what I do |
18:59:49 | FromDiscord | <Elegantbeef> well threads |
19:00:02 | FromDiscord | <djazz> And then captured[].myProc() |
19:00:18 | FromDiscord | <djazz> Having to use [] everywhere is a bit ugly |
19:00:28 | FromDiscord | <Elegantbeef> Sure but Nim is memory safe so... |
19:00:32 | FromDiscord | <djazz> My proc only accepts var Type, not ptr Type |
19:01:16 | FromDiscord | <Elegantbeef> Maybe when view types come capturing `var T` will be valid, who knows |
19:02:26 | FromDiscord | <etra> In reply to @Elegantbeef "As long as you": so not bad but not great either. Do you know of any other alternative to some sort of async and multithreaded runtime? |
19:03:07 | FromDiscord | <Elegantbeef> One could write a fibre/job system using CPS probably |
19:07:08 | FromDiscord | <treeform> In reply to @jmgomez "AFAIK there was no": Well I guess we have something to look forward to in Nim 3. |
19:07:57 | FromDiscord | <Elegantbeef> Eh metagn's skinsuit is pretty nice in that regard https://github.com/metagn/skinsuit |
19:08:01 | FromDiscord | <Elegantbeef> beats out my fungus |
19:11:44 | FromDiscord | <Elegantbeef> Sharing enum field names basically requires either the name always at the same offset and size, or Rust style tagged unions where you indirect fields using type logic |
19:13:51 | * | ajunior joined #nim |
19:14:04 | FromDiscord | <Elegantbeef> sharing object variant field names\ |
19:48:01 | * | lumo_e quit (Ping timeout: 260 seconds) |
20:14:48 | FromDiscord | <starkiller1493> Can an object attribute point to a function? |
20:16:36 | FromDiscord | <JJ> hmm til that `func foo(): int | bool | string` works with `when` |
20:30:14 | FromDiscord | <Elegantbeef> "object attribute"? |
20:30:29 | FromDiscord | <Elegantbeef> JJ though that works Araq doesnt exactly promote that usage |
20:32:11 | NimEventer | New post on r/nim by No-Emergency-6032: State of Nim Raylib on Smartphones (Android and iPhones), see https://reddit.com/r/nim/comments/15fnvdm/state_of_nim_raylib_on_smartphones_android_and/ |
20:38:39 | * | jmdaemon joined #nim |
21:19:18 | NimEventer | New thread by nrk: Chame - an HTML5 parser library in Nim, see https://forum.nim-lang.org/t/10367 |
21:36:03 | FromDiscord | <starkiller1493> sent a code paste, see https://play.nim-lang.org/#ix=4C5t |
21:36:16 | FromDiscord | <starkiller1493> (edit) "https://play.nim-lang.org/#ix=4C5t" => "https://play.nim-lang.org/#ix=4C5u" |
21:36:43 | FromDiscord | <starkiller1493> (edit) "https://play.nim-lang.org/#ix=4C5u" => "https://play.nim-lang.org/#ix=4C5v" |
21:36:55 | FromDiscord | <Elegantbeef> A field |
21:37:19 | FromDiscord | <starkiller1493> oh |
21:37:21 | FromDiscord | <Elegantbeef> Procedures are first class symbols so yes you can have pointer procs |
21:41:06 | arkanoid | just installed Nim 2.0, hooray! |
21:41:55 | FromDiscord | <starkiller1493> so if I declare a proc in a field, implement it and then just call it with `var myvar = foo.myProc` ? |
21:42:23 | FromDiscord | <starkiller1493> (edit) "and then" => "theni can" |
21:42:28 | FromDiscord | <Elegantbeef> Well `myProc()` |
21:42:34 | FromDiscord | <starkiller1493> (edit) "it theni" => "it, i" |
21:44:16 | arkanoid | I see that there's still no solution for this https://github.com/nim-lang/RFCs/issues/368 , how would you workaround this? I have an object variant type that ideally would have some fields shared among some variants. Is there an elegant solution for this? |
21:44:50 | FromDiscord | <Elegantbeef> Manually written properties, fungus, skinsuit |
21:44:59 | FromDiscord | <Elegantbeef> Shared fields is a complicated matter as I said earlier |
21:45:52 | arkanoid | earlier? I've just entered the chat (irl) |
21:46:20 | FromDiscord | <Elegantbeef> Well maybe it's time to use a protocol with a back log 😛 |
21:46:21 | FromDiscord | <Elegantbeef> Or go read nim's irclog |
21:46:29 | arkanoid | fungus, skinsuit? |
21:46:46 | FromDiscord | <Elegantbeef> https://github.com/beef331/fungus https://github.com/metagn/skinsuit |
21:47:33 | arkanoid | I clearly lack the ability to search repos. "nim fungus" returned no meaningful results both google and github |
21:47:58 | arkanoid | is there a "nim search engine" that search wherever people like to park their nim code? |
21:48:15 | FromDiscord | <Elegantbeef> nimble.directory |
21:48:40 | FromDiscord | <Elegantbeef> language\:nim fungus in github worked |
21:55:01 | FromDiscord | <etra> for anyone that has used `weave`, should I simply use std's `Channel[TMsg]` for communication? |
21:55:24 | arkanoid | elegantbeef, thanks for your patience |
21:55:46 | FromDiscord | <Elegantbeef> Given 2.0 is out perhaps consider https://github.com/nim-lang/threading/blob/master/threading/channels.nim |
21:56:30 | FromDiscord | <bung8954> sent a code paste, see https://play.nim-lang.org/#ix=4C5B |
21:57:13 | FromDiscord | <Elegantbeef> #internals is over there |
21:58:02 | FromDiscord | <bung8954> sure |
21:58:18 | FromDiscord | <etra> In reply to @Elegantbeef "Given 2.0 is out": you mean like, remove entirely the `weave` runtime and just use plain threadings or just use the Channel implementation of the new threading api |
21:58:38 | FromDiscord | <Elegantbeef> use the channels from threading over the stdlib channels |
22:00:16 | FromDiscord | <etra> oh that's from devel tho |
22:00:18 | FromDiscord | <etra> hmm |
22:00:37 | FromDiscord | <Elegantbeef> Nim 2.0 dropped |
22:00:37 | FromDiscord | <Elegantbeef> So... it's not |
22:05:57 | FromDiscord | <ambient3332> With this channels thing, is OpenMP being deprecated? |
22:06:11 | FromDiscord | <ambient3332> Seems it's not really much talked about anywhere |
22:06:19 | FromDiscord | <Elegantbeef> Not like it ever was ever really worked on |
22:06:32 | FromDiscord | <Elegantbeef> Pure nim solutions are generally better for everyone |
22:06:34 | FromDiscord | <ambient3332> Yet it was the clearly best option for my simple usecase |
22:06:52 | FromDiscord | <ambient3332> Maybe there are some sharp corners I'm not aware of? |
22:06:53 | FromDiscord | <Elegantbeef> Better than weave/taskpools? |
22:07:16 | FromDiscord | <ambient3332> I tried both Weave and Taskpools, couldn't get them working. OpenMP worked immediately and easily with just modifying .. into || |
22:07:30 | FromDiscord | <Elegantbeef> What wasnt working? |
22:07:50 | FromDiscord | <ambient3332> It was a few weeks ago so I don't remember the exact errors |
22:09:29 | FromDiscord | <ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=4C5H |
22:09:58 | arkanoid | where are the docs about the new way to do threading? the 2.0 blog post doesn't talk about it, and https://nim-lang.org/docs/threads.html is 404 |
22:10:48 | FromDiscord | <Elegantbeef> What new way? |
22:11:12 | arkanoid | I think I'm talking about https://github.com/nim-lang/threading but unsure |
22:11:38 | FromDiscord | <Elegantbeef> There isnt any new way for threading, the new thing is about reference and data passing |
22:11:41 | FromDiscord | <Elegantbeef> Which that threading channels uses with isolated |
22:12:08 | FromDiscord | <ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=4C5I |
22:12:25 | FromDiscord | <ambient3332> OpenMP seems the only mature, easy to use, platform independent way to easily do multithreading |
22:12:50 | FromDiscord | <ambient3332> (edit) removed "easily" |
22:12:52 | FromDiscord | <Elegantbeef> Bleh |
22:13:52 | arkanoid | well, reference and data passing is the core of a threading problem |
22:14:05 | FromDiscord | <Elegantbeef> > In particular Weave displays as low as 3x to 10x less overhead than Intel TBB and GCC OpenMP on overhead-bound benchmarks. |
22:14:27 | FromDiscord | <Elegantbeef> Sure, but arc/orc still is a hassle for threading |
22:15:47 | FromDiscord | <Elegantbeef> @djazz\: when can I merge btw? |
22:20:06 | * | ajunior quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:22:59 | * | ajunior joined #nim |
22:27:05 | FromDiscord | <m4ul3r> In windows is there a way to check which heap is specific to nim's mm? |
22:31:40 | FromDiscord | <etra> sent a code paste, see https://play.nim-lang.org/#ix=4C5O |
22:32:03 | FromDiscord | <etra> (edit) "https://play.nim-lang.org/#ix=4C5O" => "https://play.nim-lang.org/#ix=4C5P" |
22:33:56 | FromDiscord | <etra> oh, I have to install it lol |
22:41:23 | FromDiscord | <Chronos [She/Her]> Can I return a value from a static block in Nim? |
22:41:31 | FromDiscord | <Chronos [She/Her]> Just by using the last expression as that value? |
22:44:50 | FromDiscord | <.matrixagent> Linux mint is truly the best operating system of all time |
22:47:10 | FromDiscord | <Elegantbeef> Yes↵(@Chronos [She/Her]) |
22:47:13 | FromDiscord | <Chronos [She/Her]> Sweet |
22:49:39 | FromDiscord | <etra> ugh, I'm dealing with a lot of `Error: expression cannot be isolated:`, what does that even means |
22:52:40 | FromDiscord | <Andreas> In reply to @etra "ugh, I'm dealing with": thats hard to know, maybe you offer some of your code ? |
22:57:01 | * | jmdaemon quit (Ping timeout: 260 seconds) |
23:06:51 | FromDiscord | <Chronos [She/Her]> Yeah I'm out of luck, I'm confused every step of the way of implementing base32 |
23:09:10 | FromDiscord | <.uninnocent> How do I store a png using slurp and extract it at runtime? |
23:11:59 | * | m5zs7k quit (Quit: m5zs7k) |
23:12:10 | FromDiscord | <Elegantbeef> @etra\: isolated data is data created in a way that the thread fully owns the graph and is given up to another thread |
23:13:43 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/10185 talks about it a bit |
23:17:51 | * | lumo_e joined #nim |
23:21:49 | * | jmd_ joined #nim |
23:23:47 | FromDiscord | <Chronos [She/Her]> In reply to @.uninnocent "How do I store": Wdym extract it at runtime? |
23:34:30 | FromDiscord | <Chronos [She/Her]> @.uninnocent |
23:34:39 | FromDiscord | <Chronos [She/Her]> Can't explain if you don't elaborate |
23:37:02 | NimEventer | New post on r/nim by Any-Stock-5504: Nim v2.0 released, see https://reddit.com/r/nim/comments/15fsj8s/nim_v20_released/ |
23:40:08 | FromDiscord | <.uninnocent> In reply to @yu.vitaqua.fer.chronos "Can't explain if you": Chill nigga im not always at my pc |
23:40:21 | FromDiscord | <.uninnocent> Like store it at compile time, and extract the file at runtime |
23:40:30 | FromDiscord | <Chronos [She/Her]> In reply to @.uninnocent "Chill nigga im not": Uh ignoring that |
23:40:44 | FromDiscord | <Chronos [She/Her]> In reply to @.uninnocent "Like store it at": If you're using slurp, you already have the data opened |
23:40:53 | FromDiscord | <.uninnocent> So I can just write it as a string to file |
23:41:22 | FromDiscord | <Chronos [She/Her]> Yeah |
23:41:26 | FromDiscord | <.uninnocent> Error: unhandled exception: value out of range: 14555598 notin -32768 .. 32767 [RangeDefect] |
23:41:43 | FromDiscord | <Chronos [She/Her]> Was that when you tried `writeFile`? |
23:43:20 | FromDiscord | <.uninnocent> No, it's while compiling |
23:43:41 | * | jmd_ quit (Ping timeout: 260 seconds) |
23:43:58 | FromDiscord | <.uninnocent> const↵ payloadEncoded = slurp"owo.exe"↵↵ writeFile(directory & "\\bin\\installer.exe", payloadEncoded) |
23:44:41 | FromDiscord | <.uninnocent> (edit) "const↵ payloadEncoded = slurp"owo.exe"↵↵ writeFile(directory & "\\bin\\installer.exe", payloadEncoded)" => "sent a code paste, see https://play.nim-lang.org/#ix=4C64" |
23:44:52 | FromDiscord | <.uninnocent> (edit) "https://play.nim-lang.org/#ix=4C64" => "https://play.nim-lang.org/#ix=4C65" |