00:13:16 | FromDiscord | <sclee15 (Sung-Chul Lee)> is there null/void safety feature in Nim? |
00:14:50 | FromDiscord | <Elegantbeef> There is `std/wrapnils` and also experimental not nil annotation/strict not nil annotation |
00:29:22 | * | rockcavera quit (Read error: Connection reset by peer) |
00:30:07 | * | rockcavera joined #nim |
00:30:07 | * | rockcavera quit (Changing host) |
00:30:07 | * | rockcavera joined #nim |
00:39:04 | FromDiscord | <sclee15 (Sung-Chul Lee)> @elegantbeef\:matrix.org thank you |
01:07:06 | * | aeverr quit (Ping timeout: 240 seconds) |
01:54:53 | FromDiscord | <reilly> I cannot figure out for the life of me how to access the children of a node in pragmagic/godot-nim. |
02:09:58 | * | arkurious quit (Quit: Leaving) |
03:27:53 | * | rockcavera quit (Remote host closed the connection) |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:35 | * | supakeen joined #nim |
05:30:08 | fn | <ForumUpdaterBot99> New thread by KerryC: String formatting a number with Javascript backend, see https://forum.nim-lang.org/t/8272 |
06:07:16 | fn | <ForumUpdaterBot99> New Nimble package! gnu - Godot-Nim Utility - Godot gamedev with Nim, see https://github.com/Knaque/gnu |
06:07:17 | fn | <R2D299> itHub: 7"GNU (Godot-Nim Utility) is a CLI for creating games in the Godot engine using the Nim programming language." |
06:44:37 | FromDiscord | <generic linux user> who said my talk:sunglassess: |
06:44:41 | FromDiscord | <generic linux user> (edit) "talk:sunglassess:" => "talk😎" |
06:44:48 | FromDiscord | <generic linux user> (edit) "talk😎" => "name😎" |
06:50:12 | FromDiscord | <arnetheduck> sent a long message, see http://ix.io/3ubs |
06:52:27 | FromDiscord | <arnetheduck> In reply to @haxscramper "And it is not": half of it is probably because although the manual explicitly says you should not rely on catching defects, people end up catching them by accident when using a naked `except:` making the "default" / easiest code work contrary to the intent of defects |
06:55:20 | fn | <ForumUpdaterBot99> New Nimble package! cpython - Alternative StdLib for Nim for Python targets, see https://github.com/juancarlospaco/cpython |
06:55:20 | fn | <R2D299> itHub: 7"Alternative StdLib for Nim for Python targets, hijacks Python StdLib for Nim" |
06:55:48 | * | max22- joined #nim |
06:57:16 | * | neceve joined #nim |
06:57:35 | FromDiscord | <saem> Defects are almost never the answer. A library author is deceiving themselves into thinking they know enough information about all systems within which their library will be used and somehow they can make and end-to-end system design choice. |
06:58:22 | FromDiscord | <saem> That's putting it more kindly than it should perhaps. |
07:01:59 | * | aeverr joined #nim |
07:16:41 | * | max22- quit (Ping timeout: 252 seconds) |
07:48:02 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @fn "<ForumUpdaterBot> New Nimble package!": Is it an implementation of Pythin in Nim? |
07:53:43 | FromDiscord | <generic linux user> !!! |
07:55:17 | FromDiscord | <Clonkk> What would be the point ?↵(@System64 ~ Flandre Scarlet) |
08:05:23 | * | SebastianM joined #nim |
08:11:17 | FromDiscord | <System64 ~ Flandre Scarlet> ah isn't it for compilling to Python?↵Didn't understood |
08:11:25 | FromDiscord | <Rika> no |
08:11:38 | FromDiscord | <Rika> its a simulation of the python stdlib i believe |
08:12:49 | FromDiscord | <Clonkk> https://github.com/juancarlospaco/cpython is a Nim API of Python stdlib through Nimpy |
08:12:52 | fn | <R2D299> itHub: 7"Alternative StdLib for Nim for Python targets, hijacks Python StdLib for Nim" |
08:13:00 | FromDiscord | <Rika> oh i see |
08:13:03 | FromDiscord | <Rika> thats strange but cool |
08:13:10 | FromDiscord | <Rika> oh i get it |
08:13:18 | FromDiscord | <Rika> its like the node library he also made |
08:13:38 | FromDiscord | <Clonkk> Exactly |
08:14:58 | FromDiscord | <Clonkk> You don't compile for Python in Nim. You run Python code in C with CPython and doing this hasb een made easy by Nimpy. Implementing Pythin in Nim would probably have little to no practical use↵(@System64 ~ Flandre Scarlet) |
08:16:47 | FromDiscord | <PsychoClay> `var s = "d"↵var i = 20↵let sp: array[2, pointer] = [s.addr, i.addr]`↵why doesnt this work? |
08:18:44 | FromDiscord | <Clonkk> Because i.addr is not a pointer it's `ptr int` and `s.addr` is a `ptr string` |
08:19:24 | FromDiscord | <Clonkk> You can cast `ptr X` to `pointer` if you really want to |
08:19:28 | FromDiscord | <PsychoClay> does cast[pointer](s.addr) work? |
08:19:30 | FromDiscord | <PsychoClay> ah yea |
08:19:51 | FromDiscord | <Clonkk> Can't tell you if it's a good idea or bad design though. Casting to raw pointer is usually not needed unless you interaéct with C |
08:20:01 | FromDiscord | <Rika> please note that you've arrived at "good luck have fun" territory |
08:20:02 | FromDiscord | <PsychoClay> well i ave some threading issues |
08:20:02 | FromDiscord | <Clonkk> WHat are yo utrying to do ? |
08:20:17 | FromDiscord | <Rika> what issues are you having |
08:20:30 | FromDiscord | <PsychoClay> not being able to access globals in threads |
08:20:40 | FromDiscord | <Rika> you generally shouldnt |
08:20:46 | FromDiscord | <Clonkk> That's normal |
08:20:57 | FromDiscord | <Clonkk> in NIm, thread have their own heap (that will change with arc/orc) |
08:21:10 | FromDiscord | <Clonkk> If you want to pass pointer to heap memory |
08:21:13 | FromDiscord | <Clonkk> You need to allocate a shared heap |
08:21:43 | FromDiscord | <Clonkk> `allocShared`, `deallocShared`, `freeShared`, `reallocShared` will be what you're looking for |
08:21:54 | FromDiscord | <PsychoClay> well up until now pointers have worked in combination with multiple channels |
08:22:16 | FromDiscord | <Clonkk> Do you compile with --gc\:arc ? |
08:22:20 | FromDiscord | <Rika> "worked" might just be a coincidence |
08:22:28 | FromDiscord | <PsychoClay> In reply to @Clonkk "Do you compile with": no |
08:22:32 | FromDiscord | <PsychoClay> should i? |
08:23:20 | * | xet7 quit (Read error: Connection reset by peer) |
08:24:05 | FromDiscord | <PsychoClay> but global vars dont get gc'd right so passing a pointer to a thread should be fine right? |
08:24:10 | * | xet7 joined #nim |
08:24:45 | FromDiscord | <Rika> that's not the root issue of using globals (atomicity/race conditions is usually) |
08:24:55 | FromDiscord | <Clonkk> If you want to pass global pointers to object between threads use https://nim-lang.org/docs/system.html#createSharedU%2Ctypedesc |
08:24:56 | FromDiscord | <Clonkk> And you'll have to free it with https://nim-lang.org/docs/system.html#freeShared%2Cptr.T |
08:25:17 | FromDiscord | <Rika> if you want to pass things between threads maybe channels would be better? |
08:25:26 | FromDiscord | <PsychoClay> im also using channels |
08:25:48 | FromDiscord | <PsychoClay> In reply to @Clonkk "And you'll have to": can i instead of doing this, use a gc that has a shared heap? |
08:25:56 | FromDiscord | <PsychoClay> or is that somethin non related |
08:25:59 | FromDiscord | <Clonkk> Channel can't send reference for now (unless you're using devel with new chnanel implementation and --gc\:arc then it might be)↵(@PsychoClay) |
08:26:30 | FromDiscord | <PsychoClay> well i dont use the channels for sending pointers |
08:27:17 | FromDiscord | <Clonkk> Currently, in Nim vanilla, sharing heap memory between thread is not valid unless using specific allocated shared heap. It may work because you work on the memory address that may still exists |
08:29:42 | FromDiscord | <PsychoClay> what do you mean by "not valid" ? |
08:30:04 | FromDiscord | <Clonkk> Right so basically, each thread has its own heap okay ? |
08:30:08 | FromDiscord | <PsychoClay> yea |
08:30:20 | FromDiscord | <Clonkk> So you can't share a pointer to a thread's heap memory to another thread |
08:30:22 | FromDiscord | <Rika> it's not gonna work as intended |
08:30:27 | FromDiscord | <Rika> it "works" until it doesnt |
08:30:49 | FromDiscord | <Rika> like those bugs that you wonder why it happens only when this happens and not when this happens |
08:31:48 | FromDiscord | <Clonkk> Only way to get a shared heap is changing you gc strategey so either --gc\:boehm, --gc\:arc, --gc\:orc (and maybe --gc\:go) |
08:32:02 | FromDiscord | <PsychoClay> so if i do that it should be fine? |
08:32:18 | FromDiscord | <Clonkk> What exactly are yo utrying to accomplish |
08:32:18 | FromDiscord | <PsychoClay> to use pointers to global vars? |
08:32:54 | FromDiscord | <PsychoClay> well i have a global registry of procs |
08:33:09 | * | max22- joined #nim |
08:33:15 | FromDiscord | <PsychoClay> and the registry need to be accesed from a thread |
08:34:25 | FromDiscord | <PsychoClay> i just need to access a table basically |
08:36:02 | FromDiscord | <Clonkk> You can share global between threads though that's valid |
08:36:10 | FromDiscord | <Clonkk> No need to use pointers |
08:36:11 | FromDiscord | <Clonkk> What you can't do is share pointer to local heap memory |
08:36:36 | FromDiscord | <PsychoClay> yea its just globals im trying to access |
08:37:01 | FromDiscord | <Clonkk> If it's global you don't need pointer |
08:37:05 | FromDiscord | <PsychoClay> but i keeg getting gcunsafe errors if i try to directly access it? |
08:37:45 | FromDiscord | <Clonkk> Because it is |
08:37:46 | FromDiscord | <Clonkk> But oyu can access it |
08:37:46 | FromDiscord | <Clonkk> Using pointer will not change it |
08:38:00 | FromDiscord | <PsychoClay> but it doesnt compile |
08:38:23 | FromDiscord | <Clonkk> https://nim-lang.org/docs/manual.html#threads |
08:38:35 | FromDiscord | <Clonkk> So either you're sure of what you're doing and you can the gc safe away |
08:39:03 | FromDiscord | <PsychoClay> so i should use ` {.cast(gcsafe).}:` ? |
08:39:16 | FromDiscord | <Rika> personally i would advise against it |
08:39:21 | FromDiscord | <Rika> and change the pattern you are using |
08:39:42 | FromDiscord | <Rika> aka: drop the sharing heap idea and think of a different solution |
08:39:53 | FromDiscord | <Elegantbeef> the gc safe away trick is here https://nim-lang.org/docs/manual.html#threads-gc-safety |
08:39:53 | FromDiscord | <Elegantbeef> Overrides thread analysis cause you're the programmer and supposedly can be trusted, but i've yet to be given reason to agree 😛 |
08:41:18 | FromDiscord | <PsychoClay> you mean the --threadAnalysis:off switch? |
08:41:31 | FromDiscord | <Clonkk> Whenever I can I try to use a threadpool with spawn instead of explicit thread |
08:41:32 | FromDiscord | <Clonkk> I found it easier to work with |
08:41:47 | FromDiscord | <ElegantBeef> Nah talking about the cast gcsafe |
08:42:05 | FromDiscord | <ElegantBeef> The matrix bridge is awful at times with the delay |
08:42:37 | FromDiscord | <PsychoClay> oh i see it felt like they wernt reading my messages |
08:43:47 | FromDiscord | <PsychoClay> In reply to @Clonkk "Whenever I can I": in my case the thread is supposed to run for the entire lifetime of the process so i dont think threadpool is very usefull in that case |
08:43:49 | FromDiscord | <ElegantBeef> Is this a table generated at runtime ro compiile time? |
08:43:54 | FromDiscord | <ElegantBeef> (edit) "ro" => "or" |
08:43:56 | FromDiscord | <PsychoClay> runtime |
08:44:15 | FromDiscord | <ElegantBeef> Does it change when threads run? |
08:44:27 | FromDiscord | <PsychoClay> no |
08:44:50 | FromDiscord | <PsychoClay> all the values get put into it at the start of runtime |
08:45:08 | FromDiscord | <ElegantBeef> So then you could just copy them into threadvars so you wouldnt have to run gcsafe on any interaction with the global var |
08:45:45 | FromDiscord | <Clonkk> Ah true I'm on Matrix↵(@ElegantBeef) |
08:45:48 | FromDiscord | <Clonkk> Sometimes there's a delay |
08:46:20 | FromDiscord | <Clonkk> Basically with threads it's sharedHeap manually allocated or copy |
08:46:29 | FromDiscord | <Clonkk> Or it's global with heap memory |
08:46:44 | FromDiscord | <ElegantBeef> Should preface that with "I'm no threading expert, just a schmuck that is somehow allowed to both own a multi threaded cpu and write code to run on it" |
08:47:37 | FromDiscord | <ElegantBeef> And the global with heap memory can have you doing the manual casting a lot assuming you like thread analysis |
08:49:00 | FromDiscord | <PsychoClay> so is there any benefit with using the cast(gcsafe) thing over useing a pointer? |
08:49:11 | FromDiscord | <ElegantBeef> you dont pass a pointer around pointlessly |
08:49:31 | FromDiscord | <PsychoClay> well its not pointless because im trying to access the table |
08:50:19 | FromDiscord | <ElegantBeef> Well like i said i'm not a thread expert, but if you're practically doing shared heap, why not you know just use shared heap and ensure you do it safely |
08:50:34 | * | SebastianM quit (Quit: Bye) |
08:51:31 | FromDiscord | <PsychoClay> could i use the boehm gc instead of manually allocating shared heap? |
08:51:56 | FromDiscord | <ElegantBeef> Well i'd suggest orc over boehm but yea |
08:52:16 | FromDiscord | <PsychoClay> hmm ok |
08:52:34 | FromDiscord | <PsychoClay> whats the benefit of using orc over boehm |
08:52:46 | FromDiscord | <ElegantBeef> It's apart of the nim compiler |
08:53:14 | fn | <ForumUpdaterBot99> New post on r/nim by monyarm: Does nim have an equivalent to python's max function?, see https://reddit.com/r/nim/comments/osj37g/does_nim_have_an_equivalent_to_pythons_max/ |
08:53:16 | FromDiscord | <ElegantBeef> It offers compile time inserted destructors where possible |
08:55:07 | FromDiscord | <PsychoClay> ok so if i use orc pointers to globals should be fine? |
08:55:33 | FromDiscord | <ElegantBeef> Well it still has thread analysis so that doesnt magically disappear |
08:55:52 | FromDiscord | <ElegantBeef> but you can use the cast gcsafe to access global variables without any issues |
08:56:33 | FromDiscord | <ElegantBeef> So if you know for certain there will be no modifications to that table you can access it freely without any race conditions afaik |
08:57:27 | FromDiscord | <PsychoClay> ok got it, thanks for your explanation :)) |
08:58:54 | FromDiscord | <Clonkk> I would wrap your registry in object, maybe a Lock to avoid race condition / concurrent access and use getter / setter to access your objects though |
08:59:06 | FromDiscord | <Clonkk> (yeah the bridge wasn't displaying edit to message) |
09:00:11 | FromDiscord | <PsychoClay> but if the table never gets modified, concurrent access doesnt matter right? |
09:00:36 | FromDiscord | <ElegantBeef> It should not, think clonkk was thinking about your sanity 😄 |
09:00:43 | FromDiscord | <PsychoClay> oh ok |
09:01:04 | FromDiscord | <Clonkk> If your table never gets modified then you will simply never call the setter 😄 |
09:01:33 | FromDiscord | <Clonkk> But if you don't create the API from the start, you'll use the object directly, and then one day you may actually need to modify something and you'll modify it directly |
09:01:45 | FromDiscord | <PsychoClay> true |
09:01:46 | FromDiscord | <ElegantBeef> Yea using a condition only on setting seems to be the smartest |
09:01:48 | FromDiscord | <Clonkk> And then you'll join madness |
09:01:52 | FromDiscord | <Clonkk> THat is multithreading |
09:02:30 | FromDiscord | <PsychoClay> i think ive already joined madness with my templates |
09:02:33 | FromDiscord | <ElegantBeef> Lol |
09:02:33 | FromDiscord | <Clonkk> Usually, you use a double lock. The WriteLock disable all reading and writing. The ReadLock enable reading but not writing ( can't modify while being accessed) |
09:03:05 | FromDiscord | <ElegantBeef> Well if you want code reviews there are occasionally eyes here 😄 |
09:04:17 | FromDiscord | <PsychoClay> well if u want to take a look https://github.com/PsychoClay/aberrant/blob/master/src/screep/scraper.nim heres a template that i made |
09:04:48 | FromDiscord | <ElegantBeef> Oh boy nested templates |
09:04:53 | FromDiscord | <PsychoClay> yea |
09:06:56 | FromDiscord | <ElegantBeef> Well inside the template i did find a lovely bug awaiting to appear 😄 |
09:07:43 | FromDiscord | <ElegantBeef> Ah nvm you arent using `os./` |
09:08:01 | FromDiscord | <ElegantBeef> Atleast hopefully not 😄 |
09:08:20 | FromDiscord | <PsychoClay> well i do |
09:08:27 | FromDiscord | <PsychoClay> idk what line ur referring to |
09:08:49 | FromDiscord | <ElegantBeef> the url joining, but as i see you define your own operator seems fine |
09:08:56 | FromDiscord | <PsychoClay> ah yea |
09:10:59 | FromDiscord | <ElegantBeef> That is quite a horrific template but hard to suggest something more reasonable presently |
09:12:15 | FromDiscord | <PsychoClay> i could just use regular procs but i really like having to write less code |
09:25:27 | FromDiscord | <Clonkk> Writing less code that is un readable isn't necessarily all the fuss |
09:26:03 | FromDiscord | <PsychoClay> well the template itself is unreadable but the code that uses the template is more readable for me |
10:10:49 | FromDiscord | <planetis> @saem I am in similar situation where I believe panicing is the right choice https://github.com/planetis-m/sync/issues/20 What's your opinion? Can a user of my library recover somehow from a deadlock? of course lock-free sync primitives like a phaser and timeouts are better choices, I am just not knowledgeable enough to make them. |
10:41:03 | * | max22- quit (Quit: Leaving) |
10:57:25 | FromDiscord | <zidsal> I'm not sure what the right answer is, but as an example if someone was to write a database with sync, I wouldn't want the program to panic, if someones query deadlocked I'd want the database to kill the query |
10:57:53 | FromDiscord | <zidsal> (edit) "I'm not sure what the right answer is, but as an example ... if" added "of recovery:↵↵" |
10:58:25 | * | max22- joined #nim |
11:05:51 | FromDiscord | <planetis> so a wait with a timeout |
11:06:00 | FromDiscord | <planetis> how can you handle an error in the calling thread from the waiting one |
11:08:54 | FromDiscord | <planetis> actually rust has that poison bool in its locks (but from what I gather it's there bc they dont support finally? could be wrong), but it also panics in this case |
11:31:38 | arkanoid | I've been studying haskell recently, and I'm realising how many haskell concepts inspired nim |
11:33:00 | arkanoid | actually I don't see haskell in the list of languaged that inspired nim, so probably I'm just catching second-level traits |
11:33:06 | FromDiscord | <Rika> idt its haskell that inspired nim |
11:33:12 | FromDiscord | <Rika> i believe its more coincidence |
11:33:16 | FromDiscord | <Rika> or a shared ancestor |
11:33:30 | FromDiscord | <Rika> nim is mainly inspired by pascal i believe? |
11:33:41 | FromDiscord | <Rika> so if haskell and pascal are related then yes |
11:35:11 | arkanoid | do you know any other imperative programming language that is capable of tracking effects and purity in particular? |
11:35:52 | * | arkurious joined #nim |
11:36:00 | FromDiscord | <Rika> no |
11:36:10 | FromDiscord | <Rika> i think that was an "original" idea |
11:36:55 | arkanoid | I fear FP programmers don't know about this. It's a "massive" quality |
11:45:35 | FromDiscord | <Rika> well its not a priority of nim |
11:52:51 | FromDiscord | <konsumlamm> Haskell isn't tracking effects like Nim either |
11:53:36 | FromDiscord | <konsumlamm> In reply to @arkanoid "I fear FP programmers": trust me, they do know about effect systems |
11:54:07 | FromDiscord | <Rika> i think they mean about nim having an effect system |
11:54:50 | FromDiscord | <konsumlamm> in that case, i'd have to use it before judging |
11:55:00 | FromDiscord | <konsumlamm> but i doubt it's particularly stable... |
11:55:26 | FromDiscord | <Rika> it isnt |
11:55:31 | FromDiscord | <Rika> it needs more love imo |
11:55:34 | FromDiscord | <Rika> its a promising feature |
11:55:47 | FromDiscord | <konsumlamm> is there any feature of Nim that doesn't need more love? |
11:56:07 | FromDiscord | <Rika> true |
11:57:40 | mst | wonder if I could build koka-style effects using macros and the existing code |
11:57:46 | mst | could be good for a laugh |
11:58:01 | FromDiscord | <konsumlamm> tbh, FP programmers won't suddenly like Nim, because they realize that it has a half-working effect system that barely anyone uses |
11:58:27 | mst | well, no, but that's really not the point |
11:59:24 | arkanoid | I use it quite everywhere |
11:59:47 | FromDiscord | <konsumlamm> In reply to @mst "well, no, but that's": ye, i was talking to arkanoid |
11:59:47 | mst | arkanoid: exception tracking or custom tags? |
12:00:02 | FromDiscord | <konsumlamm> In reply to @arkanoid "I use it quite": well, then you're part of "barely anyone" |
12:01:30 | * | max22- quit (Ping timeout: 272 seconds) |
12:02:13 | arkanoid | mst: both. I use {.noSideEffect, raises: [].} for intended "pure" code, then I have the "grey area" with noSideEffects but may raise specific exceptions, then there's the "lawless" part (hopefully just the main) where everything is possible |
12:03:17 | mst | ah, right, which 'func' adds implicitly |
12:03:25 | mst | course the main 'Effects' doc section doesn't mention it |
12:03:30 | arkanoid | I'm practicing to move the "grey areas" somewhere else by leveraging on Monads (Option, Either) |
12:03:32 | mst | *lolsigh* |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:34 | * | supakeen joined #nim |
12:08:47 | arkanoid | there are not so many issues tagged Effect System https://github.com/nim-lang/Nim/issues?q=is%3Aissue+is%3Aopen+label%3A%22Effect+system%22+ |
12:09:24 | FromDiscord | <konsumlamm> you call that many? |
12:10:10 | arkanoid | ? |
12:10:19 | FromDiscord | <Rika> read again |
12:10:21 | FromDiscord | <Rika> he said "not many" |
12:10:33 | FromDiscord | <konsumlamm> oh nvm |
12:12:24 | FromDiscord | <konsumlamm> it's not hard to guess why there are so few issues though |
12:13:25 | fn | <ForumUpdaterBot99> New thread by Ingo: Build long strings, speed., see https://forum.nim-lang.org/t/8273 |
12:14:09 | FromDiscord | <haxscramper> I think right now tag system is only used for eradicating some of the built-in language features from the code, such as exceptions |
12:14:10 | FromDiscord | <haxscramper> With `{.raises: [].}` |
12:15:38 | mst | right, but you can define your own tags |
12:15:39 | arkanoid | it's very useful to keep your code in shape. By moving all code into pure functions it's much easier to move the problems on the edge of the design |
12:15:44 | FromDiscord | <haxscramper> Used by users |
12:16:12 | FromDiscord | <haxscramper> And documentation hides effects and raises behind `{...}` so they are not explicitly visible |
12:16:13 | arkanoid | and tagging helps you group the edge |
12:17:15 | FromDiscord | <haxscramper> mst\: nobody does that |
12:18:17 | FromDiscord | <haxscramper> And by "nobody" I mean - there are 11 occurencies of things derived from `of RootEffect` in all nimble packages |
12:18:36 | FromDiscord | <haxscramper> And eight of them repeat the same pair TimeEffect/IoEffect |
12:18:40 | FromDiscord | <haxscramper> Because they had stdlib cloned |
12:19:54 | arkanoid | the manual doesn't say to extend RootEffect, but just just "type MyTag = object" |
12:20:55 | FromDiscord | <haxscramper> well, good luck trying figure that out. I can check for `{.tags: []` in that case |
12:23:01 | mst | -!- mst is now known as nobody |
12:23:19 | mst | (in practice I don't have anything that -needs- that currently but it's very tempting for certain stuff) |
12:23:33 | FromDiscord | <haxscramper> yeah, it looks nice |
12:23:37 | FromDiscord | <haxscramper> I have `ShellExecEffect` |
12:26:00 | FromDiscord | <haxscramper> well, anyway, for haxdoc I will implement `@effect{ShellExecEffect} :: Docstring related to particular effect` and `@raises{ArgumentError} :: Explanation why this exception might be raised` |
12:26:01 | FromDiscord | <haxscramper> So this stuff could be documented at least |
12:26:40 | FromDiscord | <haxscramper> So end users would be aware of the effects and reasons, and not just get random "unlisted effect/exception" errors |
12:28:30 | FromDiscord | <haxscramper> in commit message |
12:28:31 | FromDiscord | <haxscramper> I actually wrote about this (why effect tracking should have better documentation support) here https://github.com/haxscramper/haxdoc/commit/9e09f7a2dc2c56fdce66102a172f1d9104270145 |
12:30:30 | arkanoid | it's very easy to check for tags (please execute this in editor as is compile time) https://play.nim-lang.org/#ix=3ud2 |
12:32:01 | arkanoid | I really appreciate yout effort for pushing effect tracking into nim. It's really something that programmer lands to soon or later once they struggle handling complexity |
12:33:38 | FromDiscord | <haxscramper> Yes, but do you expect user to run this fr every possible procedure they want to use? |
12:34:10 | FromDiscord | <haxscramper> Main issue is visibility and documentation |
12:34:22 | FromDiscord | <haxscramper> And if haxdoc can give you a warning like "undocumented direct raise if " it is a good thing |
12:38:21 | arkanoid | actually I'm not an haxdoc user (I'm very bad in documenting my projects, while I tend to push design to useless levels) please excuse me if I take some time to understand what's the usage, while having a quick lunch |
12:39:43 | FromDiscord | <haxscramper> Yes. Even though I personally don't want to push for purity as much as you do, but lots of the inconveniences from exceptions are based on tooling, and not on the concept of tracking itself. Like bad error messages, no way to actually track changes (https://github.com/nim-lang/Nim/pull/18541/files#diff-13795c17121ec235cc0d7a1f5df177f3a5af2e32d2cbd2d95c8b020ad8c76516R703 ) in the code (and here we see Defect again) |
12:40:07 | FromDiscord | <haxscramper> `> not an haxdoc user` considering it is not even done yet that is understandable |
12:48:31 | * | jfinkhaeuser left #nim (#nim) |
13:00:26 | arkanoid | haxscramper, as a non nimdoc user, what's the new features offered by your haxdoc? |
13:02:38 | FromDiscord | <haxscramper> Works for whole project, has an API for custom tooling, export to XML/SQLite/html, supports documentation annotations like `@arg{}` that actually allow writing documentation comments with some semantic meaning, instead of just random text. Tracking of tags, effects, raises. |
13:02:58 | FromDiscord | <haxscramper> All of that is implemented in the proof-of-concept stage, but I need to finally finish hcparse |
13:02:59 | FromDiscord | <haxscramper> And then work on haxdoc |
13:03:15 | FromDiscord | <haxscramper> Also tracking changes between library versions |
13:03:35 | FromDiscord | <haxscramper> image.png https://media.discordapp.net/attachments/371759389889003532/869565686404493332/image.png |
13:05:55 | FromDiscord | <haxscramper> But most importantly, haxdoc should understand the code |
13:06:47 | FromDiscord | <haxscramper> and it also has sourcetrail integration |
13:06:57 | FromDiscord | <haxscramper> probably the only thing that is like 99%+ done |
13:07:38 | FromDiscord | <haxscramper> I'm missing IC to get information about template expansion, but aside from that |
13:08:30 | arkanoid | sci-fi question. Does it build some sort of dependency graph of function calls? I want to colorize functions |
13:09:10 | * | max22- joined #nim |
13:11:07 | FromDiscord | <haxscramper> yes |
13:11:38 | FromDiscord | <haxscramper> or if it doesn't it would be a 10-line change |
13:11:38 | FromDiscord | <haxscramper> https://github.com/haxscramper/haxdoc/blob/master/src/haxdoc/docentry_types.nim#L484 |
13:11:45 | FromDiscord | <haxscramper> I just tend to instantly forget details like this if I don't touch the project for over a week |
13:14:51 | arkanoid | well, this is wow |
13:15:44 | arkanoid | I mean, I'd use it. A doc tool that can let me graph my design and colorize it according to effects is what I exactly do in my mind |
13:16:25 | FromDiscord | <deech> Why is an underscore a valid identifier ,eg `let _ = "hello world"; echo _` but if you add some characters it isn't? eg. `let abc_ = ...` Is this due to to `_` unsensitivity? |
13:18:30 | FromDiscord | <haxscramper> `_` is a special case of an identifer |
13:18:32 | FromDiscord | <haxscramper> I'm surprised you can `echo` it actually |
13:19:51 | mst | it's commonly used for implicitish arguments |
13:24:25 | * | rockcavera joined #nim |
13:24:25 | * | rockcavera quit (Changing host) |
13:24:25 | * | rockcavera joined #nim |
13:38:01 | * | Vladar joined #nim |
13:40:52 | FromDiscord | <arnetheduck> In reply to @haxscramper "Also tracking changes between": should turn this into an abi-compatibility tool ;l) |
14:39:45 | fn | <ForumUpdaterBot99> New thread by Xhevahir: Nim earns mention in the news (unfortunately?), see https://forum.nim-lang.org/t/8274 |
14:46:55 | FromDiscord | <generic linux user> really? |
14:47:06 | FromDiscord | <generic linux user> is that a good mews or a bad one? |
14:47:22 | FromDiscord | <generic linux user> :| |
14:47:24 | fn | <Prestige99> I think publicity is good |
14:47:39 | FromDiscord | <generic linux user> atleast some ppl get to know it |
14:49:21 | FromDiscord | <generic linux user> there is go and rust there so i think we are equal |
14:49:41 | FromDiscord | <haxscramper> 0.000001 IQ antivirus vendor joins the chat |
14:49:51 | FromDiscord | <generic linux user> 🗿. |
14:49:55 | FromDiscord | <haxscramper> nImIsMalWaRe |
14:50:00 | FromDiscord | <generic linux user> naww |
14:50:28 | FromDiscord | <haxscramper> Other than regular issues with AV vendors I think more publicity is a good thing |
14:51:35 | FromDiscord | <generic linux user> they only mention nim once or twice |
15:52:04 | FromDiscord | <saem> I don't know the library well enough, but I do know nim stdlib doesn't have a kill for threads from the outside. But could the user conceivably have a sentinel? |
15:58:28 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
16:13:26 | * | stkrdknmibalz joined #nim |
16:18:29 | mst | oh, right, that's not really "exotic", what that is, is that -one- person wrote -one- blog post showing some basic windows process injection stuff using nim because it made for an easier and more elegant example than C |
16:59:59 | FromDiscord | <@bracketmaster-5a708063d73408ce4> @haxscramper\:matrix.org - what's an AV vendor? |
17:06:47 | FromDiscord | <krisppurg> Has anyone got this error? I appear to have gotten this error when I connect to gateway on `ws`. I have updated `ws` to `0.4.4`, but regardless I still get the error.↵↵(see file) https://media.discordapp.net/attachments/371759389889003532/869626888526639104/message.txt |
17:16:08 | FromDiscord | <krisppurg> nvm https://forum.nim-lang.org/t/7551#47896 solves the problem |
17:40:13 | fn | <ForumUpdaterBot99> New thread by Chaemon: Static generics with concept, see https://forum.nim-lang.org/t/8275 |
18:27:12 | * | max22- quit (Ping timeout: 245 seconds) |
18:50:33 | FromDiscord | <TurtleP> so something I'm wondering: is it better to raise and exception with a message or `return echo("my message")`? I rarely use exceptions and apologize if this is a stupid question |
19:04:57 | FromDiscord | <SolitudeSF> the latter is not a valid nim |
19:06:49 | FromDiscord | <TurtleP> well, that's kind of beside the point |
19:10:25 | * | max22- joined #nim |
19:18:38 | FromDiscord | <reilly> Is it possible to mark an import as used, similarly how you can do `var x {.used.}: string`? |
19:22:12 | fn | <Prestige99> Don't know, but why would you need that? |
19:22:51 | FromDiscord | <haxscramper> Or use `Result` if you want to have return-based value handling |
19:22:58 | FromDiscord | <haxscramper> But by default nim is geared towards exceptions |
19:22:59 | FromDiscord | <haxscramper> raise exceptions with readable messages |
19:23:36 | FromDiscord | <haxscramper> `{.push warning[Unused]:off.}` |
19:23:36 | FromDiscord | <haxscramper> `{.pop.}` |
19:24:37 | FromDiscord | <reilly> I'm working with godot-nim (see knaque/gnu), and as a part of that, I need to import scripts into stub.nim. No actual code is executed in the stub, only imports, but they have to be imported. Because there's no actual code, though, I get warned for each import. It just bugs me is all. |
19:25:06 | FromDiscord | <reilly> (Also see knaque/godot-nim-stub to see what the file system looks like) |
19:26:34 | FromDiscord | <haxscramper> push warning off |
19:28:16 | FromDiscord | <planetis> indeed a sentinel could be a solution |
19:40:08 | * | Vladar quit (Quit: Leaving) |
19:41:00 | FromDiscord | <ynfle (ynfle)> @\_discord\_237452759975067650\:t2bot.io I'm pretty sure it's a known issue |
19:54:47 | FromDiscord | <ynfle (ynfle)> To people on the other side of the bridges see the mention properly? |
20:06:55 | FromDiscord | <haxscramper> No, they are seen as `@_discord_237452759975067650:t2bot.io` |
20:08:21 | FromDiscord | <ynfle (ynfle)> @reilly I'm pretty sure it's a known issue |
20:08:28 | FromDiscord | <ynfle (ynfle)> Did that come through properly? |
20:09:59 | FromDiscord | <haxscramper> No, this one does not work |
20:10:05 | FromDiscord | <haxscramper> @haxscramper\: |
20:10:26 | FromDiscord | <haxscramper> You need to do it via autocomplete from the matrix side I think |
20:13:44 | FromDiscord | <ynfle (ynfle)> @reilly#1078 I'm pretty sure it's a known issue |
20:13:49 | FromDiscord | <ynfle (ynfle)> Did that work? |
20:15:45 | FromDiscord | <haxscramper> No. There is a "nim bridge testing" room on the matrix |
20:16:03 | FromDiscord | <haxscramper> That is bridged to discord, so you can figure out things there |
20:16:41 | FromDiscord | <reilly> I just got back from grabbing lunch, so I wouldn't have seen it until now anyway. |
20:17:00 | FromDiscord | <reilly> `{.push warnings: off.}` did the job. |
20:17:04 | FromDiscord | <ynfle (ynfle)> Lol just testing |
20:32:54 | fn | <ForumUpdaterBot99> New thread by Akito: String related Segmentation Faults, see https://forum.nim-lang.org/t/8276 |
20:42:26 | * | neceve quit (Ping timeout: 252 seconds) |
20:59:31 | FromDiscord | <Generational Me!> nim jobs? Can't find? |
20:59:54 | FromDiscord | <leorize> there's a jobs channel in this server |
21:47:40 | * | thunder joined #nim |
21:50:15 | * | max22- quit (Quit: Leaving) |
22:14:55 | FromDiscord | <bOrEd> Pls use wish |
22:57:47 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |