00:01:31 | FromDiscord | <Elegantbeef> you'd abuse `importc` to get it |
00:02:00 | FromDiscord | <Elegantbeef> If you search const pointer in discord's search you'll probably find a response from flywind iirc |
00:22:23 | FromDiscord | <!Patitotective> In reply to @dom96 "The first one is": too detailed i would say, the cute ones look nice, maybe without color fading |
00:51:49 | termer | Is there an async version of walkDir? |
00:51:51 | termer | I can't seem to find one |
00:52:16 | FromDiscord | <Elegantbeef> There isnt |
00:52:43 | FromDiscord | <Elegantbeef> Walkdir is mostly system calls afaik so async isnt exactly going to make it any faster |
00:52:54 | termer | they hit the disk |
00:52:59 | termer | is there some alternative method to read the contents of a dir that's async |
00:53:07 | termer | the point of async isn't to be faster, it's to avoid blocking the thread |
00:54:35 | termer | if I'm forced to use normal walkDir then that's ok, I'd just prefer async |
00:54:58 | FromDiscord | <Elegantbeef> I think you are |
00:55:07 | FromDiscord | <Elegantbeef> Unless you make your own async variant |
00:56:17 | termer | a shame but not the end of the world |
01:06:00 | * | wallabra joined #nim |
02:36:42 | FromDiscord | <Freakwill (William Song)> But It could be defined as `var e={1}` directly. What should I do if I could use `d={1}` without the suffix.↵(@Rika) |
02:38:07 | FromDiscord | <Elegantbeef> You can just do `var d = {1u8}` |
02:38:25 | FromDiscord | <Elegantbeef> `{1}` is invalid as Nim's builtin set cannot have integer sized values |
02:44:24 | * | arkurious quit (Quit: Leaving) |
02:51:47 | FromDiscord | <SaAnd> is there any reason to separate cfloat and float32, or cdouble and float64? like dont they both follow the same specification? |
02:52:14 | FromDiscord | <Elegantbeef> Think the C types are soon to be deprecated, though might be wrong |
02:52:25 | FromDiscord | <Elegantbeef> There really isnt much reason for them |
02:53:02 | FromDiscord | <SaAnd> nice, it was a question ive had for a while |
03:19:05 | * | _________ quit (Ping timeout: 268 seconds) |
03:40:17 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=47Ul |
03:40:29 | FromDiscord | <flywind> gives `Error: cannot use symbol of kind 'proc' as a 'field'` |
03:40:34 | FromDiscord | <flywind> works with procs. |
03:41:28 | FromDiscord | <flywind> The second case branch has the same name as the outer procs. |
03:43:37 | FromDiscord | <Elegantbeef> does `case name {.inject.}` change anything? |
03:43:39 | FromDiscord | <flywind> found it => https://github.com/nim-lang/Nim/issues/19552 |
03:43:47 | FromDiscord | <Elegantbeef> Or if you annotate it a `{.dirty.}` |
03:43:59 | FromDiscord | <flywind> Yeah |
03:47:45 | FromDiscord | <flywind> Annotating it with `{.dirty.}` works. |
04:15:30 | FromDiscord | <Bung> the microsoft webview2 documented code are all c++ , does this means if I want develop nim program base on it , I should compiles to c++ backend ? |
04:17:38 | FromDiscord | <Bung> or find c bindings to those dlls ? |
04:21:37 | * | _________ joined #nim |
05:12:26 | FromDiscord | <TechnoRazor> sent a code paste, see https://play.nim-lang.org/#ix=47Uy |
05:13:11 | FromDiscord | <TechnoRazor> (edit) "https://play.nim-lang.org/#ix=47Uy" => "https://play.nim-lang.org/#ix=47Uz" |
05:13:54 | FromDiscord | <Elegantbeef> Mixin takes consideration of the symbols in the instantiation scope |
05:14:11 | FromDiscord | <Elegantbeef> `result = doThing` is what's wrong |
05:14:21 | FromDiscord | <TechnoRazor> what's wrong with it? |
05:14:22 | FromDiscord | <Elegantbeef> Actually nvm i cant read |
05:14:50 | FromDiscord | <Elegantbeef> Also mixin doesnt have to exist before the dummy proc |
05:15:08 | FromDiscord | <TechnoRazor> i mean the dummy proc has to exist before the generic proc |
05:15:17 | FromDiscord | <Elegantbeef> It doesnt |
05:15:22 | FromDiscord | <Elegantbeef> That's the entire point of mixin |
05:15:48 | FromDiscord | <TechnoRazor> really? i thought i got compiler errors when there's no symbol named "doThing" at definition |
05:16:02 | FromDiscord | <Elegantbeef> No that's for non mixin'd |
05:16:14 | FromDiscord | <Elegantbeef> If you `bind` it's an issue, but since you mixin it's not an issue |
05:17:55 | FromDiscord | <Elegantbeef> This works fine |
05:17:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47UD |
05:18:07 | FromDiscord | <TechnoRazor> interesting, i could've sworn that didn't copile for me |
05:18:13 | FromDiscord | <TechnoRazor> (edit) "copile" => "compile" |
05:19:44 | FromDiscord | <TechnoRazor> sent a code paste, see https://play.nim-lang.org/#ix=47UE |
05:21:27 | FromDiscord | <creikey> how do I do this loop taking a mutable reference to i? https://media.discordapp.net/attachments/371759389889003532/1009693484795576390/unknown.png |
05:21:29 | FromDiscord | <creikey> without using ref |
05:21:31 | FromDiscord | <creikey> (edit) "without using ref ... " added "object" |
05:21:54 | FromDiscord | <Elegantbeef> `for i in images.mitems` |
05:22:03 | FromDiscord | <creikey> I saw that online I thought it was just for arrays of strings |
05:22:04 | FromDiscord | <creikey> lol |
05:22:06 | FromDiscord | <Elegantbeef> No it shouldnt break techno |
05:22:51 | FromDiscord | <TechnoRazor> so do i file an issue now or what? |
05:23:26 | FromDiscord | <Elegantbeef> If you cannot find another |
05:26:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47UG |
05:27:32 | FromDiscord | <Elegantbeef> Though i dont really get why you have a `getDoThing` 😄 |
05:28:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47UH |
05:33:25 | FromDiscord | <TechnoRazor> sent a code paste, see https://play.nim-lang.org/#ix=47UK |
05:33:46 | FromDiscord | <TechnoRazor> (edit) "https://play.nim-lang.org/#ix=47UK" => "https://play.nim-lang.org/#ix=47UL" |
05:35:28 | FromDiscord | <TechnoRazor> wait im stupid |
05:35:46 | FromDiscord | <TechnoRazor> it's past 1 AM here, i need sleep |
05:36:04 | FromDiscord | <TechnoRazor> the code i gave doesn't have an error |
05:37:41 | FromDiscord | <TechnoRazor> yeah i have no clue when or why i was getting an error, it's likely i just forgot `mixin doThing` |
05:37:49 | FromDiscord | <TechnoRazor> sorry im gonna read your message now |
05:38:00 | FromDiscord | <Elegantbeef> Ok |
05:38:28 | FromDiscord | <TechnoRazor> yeah that really isn't ideal |
05:41:38 | FromDiscord | <TechnoRazor> i guess ill just use `dynamicBindSym` |
05:49:55 | FromDiscord | <TechnoRazor> In reply to @TechnoRazor "ah, but if a": well i can't find an issue for this but i don't have the capacity to write one up |
05:53:03 | FromDiscord | <Elegantbeef> "Odd mixin bug" then provide the above |
06:03:44 | FromDiscord | <Phil> Hmm does anyone here have naming conventions for modules whose primary concern is providing procs to instantiate objects (in potentially complex ways) ? |
06:04:23 | FromDiscord | <Rika> C programmers would probably name it ctors |
06:04:35 | FromDiscord | <Phil> Ah what now? |
06:04:45 | FromDiscord | <Phil> Let me google htat |
06:04:52 | FromDiscord | <Rika> C[onstruc]tors |
06:05:23 | FromDiscord | <Phil> ... that's... a way to shorten that |
06:05:46 | FromDiscord | <Rika> Lol ya dont gotta tell me xd |
06:05:49 | FromDiscord | <Rika> Not my idea |
06:08:25 | FromDiscord | <Phil> so if it's about constructors specifically for a point object, it would be point.ctor.nim? point_ctor.nim? |
06:08:35 | FromDiscord | <Phil> for example |
06:09:43 | FromDiscord | <Rika> Underscore, period is not allowed |
06:10:05 | FromDiscord | <Rika> And sure but I don’t know, there isn’t really a standard for module naming |
06:10:52 | FromDiscord | <Phil> You're saying we're at a place where the xkcd about standards does not yet exist and we can have one to be the catalyst to get 50? Perfect! |
06:11:00 | FromDiscord | <Phil> (edit) "exist" => "apply" |
06:14:25 | FromDiscord | <Rika> I mean there’s no standard that everyone follows |
06:14:44 | FromDiscord | <Rika> There are definitely lots of standards everyone follows individually |
06:21:57 | * | NimEventer quit (Ping timeout: 252 seconds) |
06:22:23 | * | NimEventer joined #nim |
06:43:42 | * | PMunch joined #nim |
06:48:38 | FromDiscord | <proton> How to present 1 or 0 of 1bit in Nim |
06:50:48 | PMunch | 0b1? |
06:50:59 | PMunch | Or of course true and false |
06:53:18 | FromDiscord | <Elegantbeef> `on` or `off` 😛 |
06:54:52 | PMunch | Oh yeah, that is also an option |
06:59:17 | FromDiscord | <proton> `enable` bit(1) NOT NULL, one field of mysql table, how to write the variable meeting the type and length requirement? |
06:59:44 | PMunch | Depends on the ORM I guess |
07:00:40 | FromDiscord | <proton> sent a code paste, see https://play.nim-lang.org/#ix=47V4 |
07:00:48 | PMunch | But an object with `enable: uint {.bitsize: 1.}` would be a field with a single bit |
07:01:11 | PMunch | If you add two such fields to an object the entire object would still be 8 bits long (because it can't be smaller than that) |
07:01:16 | FromDiscord | <proton> (edit) "https://play.nim-lang.org/#ix=47V4" => "https://play.nim-lang.org/#ix=" |
07:02:40 | FromDiscord | <Rika> Yes, this doesn’t change anything if you’re storing one enable but only |
07:02:43 | FromDiscord | <Rika> Bit |
07:06:41 | FromDiscord | <proton> so what can I do |
07:08:06 | FromDiscord | <Rika> Don’t mind the extra 7 bits in memory and just convert between? I’m not sure what you actually want |
07:09:43 | FromDiscord | <proton> To pass the right type and length variable to the sql which requires bit(1) to have it work at first. |
07:12:21 | FromDiscord | <Rika> What is the type and length requirement |
07:14:33 | FromDiscord | <proton> bit(1) |
07:15:56 | FromDiscord | <proton> Error: unhandled exception: Data too long for column 'enable_comment' at row 1 |
07:16:25 | FromDiscord | <proton> `enable_comment` bit(1) DEFAULT NULL |
07:19:34 | PMunch | Which ORM? |
07:19:59 | PMunch | Or rather how are you communicating with the database? |
07:23:29 | FromDiscord | <proton> db_mysql |
07:24:04 | FromDiscord | <voidwalker> maybe TRUE/FALSE ? |
07:28:37 | FromDiscord | <proton> tried, too long |
07:29:19 | PMunch | This looks like it might be a bug in db_mysql |
07:31:08 | FromDiscord | <Rika> You can’t exactly pass a single bit as a parameter to a function, the minimum is pretty much 8; I’m not sure how the length stuff works so it’s hard to say |
07:31:41 | FromDiscord | <srozb> sent a code paste, see https://play.nim-lang.org/#ix=47V7 |
07:33:08 | PMunch | Yeah that's why it smells like a bug to me |
07:33:43 | PMunch | @srozb, I don't think types can be imported from a dynamic library like that |
07:34:06 | FromDiscord | <srozb> actually doesn't matter, same error with procs |
07:34:40 | FromDiscord | <srozb> oh wait! |
07:34:42 | FromDiscord | <srozb> 😄 thank you |
07:43:44 | FromDiscord | <Phil> In reply to @proton "tried, too long": what happens if you hard-code the boolean into the SQL? I'm curious |
07:45:19 | FromDiscord | <Phil> Just to give you a momentary workaround that allows you to progress, you could make enableCommentValStr = if enableComment: "TRUE" else: "FALSE" and insert that into the SQL.↵Trying with hard-coded SQL also ensures that you don't potentially have a column-definition issue |
07:45:48 | FromDiscord | <Phil> (edit) "make enableCommentValStr" => "make:↵`enableCommentValStr" | ""FALSE"" => ""FALSE"`" |
07:58:21 | FromDiscord | <Freakwill (William Song)> sent a long message, see http://ix.io/47Vb |
08:02:35 | PMunch | Freakwill_(William_Song), did you forget to import the `random` module where you try to call that? |
08:07:35 | * | rockcavera quit (Ping timeout: 256 seconds) |
08:15:31 | FromDiscord | <Freakwill (William Song)> No. otherwise It will report that `rand` is undefined↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
08:17:10 | * | rockcavera joined #nim |
08:17:11 | * | rockcavera quit (Changing host) |
08:17:11 | * | rockcavera joined #nim |
08:18:36 | * | nyeaa4 joined #nim |
08:23:13 | * | nyeaa4 quit (Client Quit) |
08:25:36 | FromDiscord | <domosokrat> sent a code paste, see https://play.nim-lang.org/#ix=47Vk |
08:25:42 | FromDiscord | <proton> @Phil Thanks for you suggestion, thought of this, and will try later. |
08:26:31 | FromDiscord | <domosokrat> The compiler compains about the result of the template |
08:27:10 | * | nyeaa4 joined #nim |
08:34:51 | NimEventer | New thread by Bung: Looking for windows webview2 binding, see https://forum.nim-lang.org/t/9385 |
08:57:56 | * | Jjp137 quit (Ping timeout: 255 seconds) |
08:58:14 | * | Jjp137 joined #nim |
09:28:39 | FromDiscord | <Freakwill (William Song)> It is the same error, I just truncated it. |
09:29:01 | FromDiscord | <Elegantbeef> The issue is your template doesnt have a return type |
09:29:05 | FromDiscord | <Elegantbeef> Wait nevermind |
09:29:28 | FromDiscord | <Elegantbeef> you need to do `result` at the end |
09:29:43 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=47VG |
09:35:45 | * | rockcavera quit (Remote host closed the connection) |
09:36:50 | FromDiscord | <voidwalker> Uh, what is the purpose of the Nim plugin for Qt Creator ? I cannot seem to use it to design a gui |
09:44:17 | FromDiscord | <Freakwill (William Song)> any idea? |
09:45:49 | FromDiscord | <Freakwill (William Song)> thanks a lot! |
10:01:33 | * | arkurious joined #nim |
10:09:17 | * | PMunch quit (Ping timeout: 252 seconds) |
10:09:23 | * | wallabra_ joined #nim |
10:10:23 | * | wallabra quit (Ping timeout: 252 seconds) |
10:11:30 | * | PMunch joined #nim |
10:11:31 | * | wallabra_ is now known as wallabra |
10:21:01 | * | CyberTailor joined #nim |
12:14:17 | FromDiscord | <Yardanico> In reply to @voidwalker "Uh, what is the": it's just a general IDE-like plugin with nimsuggest suport |
12:14:19 | FromDiscord | <Yardanico> (edit) "suport" => "support" |
12:14:33 | FromDiscord | <Yardanico> since Qt Creator also poses itself as a more-or-less general IDE, not exclusively for Qt development |
12:32:35 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=47Wy |
12:37:12 | FromDiscord | <Rika> : typedesc[a] = |
12:37:17 | FromDiscord | <Rika> Similarly with the other |
12:37:49 | FromDiscord | <Phil> You can even make your life easier by making it generic |
12:38:14 | FromDiscord | <Nalmyth> In reply to @Isofruit "You can even make": Preferred over polymorphism? |
12:38:25 | FromDiscord | <Rika> In Nim yes |
12:40:52 | FromDiscord | <Phil> That's a programming style choice.↵If you want to do OOP and thus polymorphism, then not necessarily.↵However, if you code procedurally as many do in nim, then yes |
12:41:38 | FromDiscord | <Phil> Personally I don't touch OOP with any of my codebases atm, however my projects are generally webdev which is generally more suited towards procedural coding |
12:42:18 | FromDiscord | <Phil> At least in regards to backend servers who need to interact with databases |
12:42:28 | FromDiscord | <Nalmyth> Thank you both! 🙂 |
12:42:58 | FromDiscord | <Rika> Nim support of OOP is that “it works” but don’t expect anything to the likes of Java |
12:43:50 | FromDiscord | <Phil> Yeah, I think it is there and gets you jut far enough that you can abstract away your problem with OOP for domains suited to it. |
12:43:56 | FromDiscord | <Phil> (edit) "jut" => "just" |
12:44:22 | FromDiscord | <Phil> If the problem isn't well suited for OOP aka feels weird to code with OOP then just go procedural |
12:44:34 | PMunch | Hmm, I think I've managed to busy-loop the C compiler |
12:44:46 | PMunch | Through some Nim code |
12:45:16 | FromDiscord | <Phil> ~~Though that's a tall order, I'm still trying to build up the proper feeling for when OOP is a good choice and when not... mostly because I have not yet coded enough scenarios where it is a good choice~~ |
12:45:48 | FromDiscord | <Phil> PMunch munching away at a poor compiler's sanity |
12:46:57 | FromDiscord | <Rika> The best fuzzers are human |
12:47:02 | FromDiscord | <Rika> I’m joking of course |
12:47:40 | PMunch | Hmm, it just seems to go all the way through Nim compilation, spawns the compiler, then just stops while one core is pegged at 100% |
12:56:52 | PMunch | Honestly I've got no idea what chokes it.. |
12:57:34 | FromDiscord | <Rika> Debugging a C compiler sounds like hell |
13:01:39 | PMunch | I mean how am I even supposed to fix this.. |
13:01:46 | FromDiscord | <voidwalker> trying to use https://github.com/filcuc/nimqml - when running it says `could not load: libDOtherSide.so.0.(9|8)` I have installed that doOtherSide thingie, it is in /usr/local/lib, copied it to /usr/lib as well as the path of the program. Added /usr/local/lib to path.. blah |
13:02:03 | FromDiscord | <voidwalker> `libDOtherSide.so.0.9` |
13:13:16 | PMunch | Huh, the issue was that imlib2-config didn't exist apparently |
13:14:06 | FromDiscord | <exelotl> In reply to @Isofruit "If the problem isn't": the problem is when you have Java brain, nothing feels weird to code with OOP 😅 |
13:14:30 | PMunch | Well, it manages to build with clang now, but gcc still chokes.. |
13:14:59 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=47WM |
13:18:16 | FromDiscord | <Phil> I'd argue that actually not a massive amount of people can code proper OO and think proper OO in the first place and just write procedural java |
13:18:20 | FromDiscord | <Phil> @exelotl |
13:18:44 | FromDiscord | <Nalmyth> sent a code paste, see https://paste.rs/kRW |
13:19:09 | FromDiscord | <Nalmyth> (edit) "https://play.nim-lang.org/#ix=47WP" => "https://play.nim-lang.org/#ix=47WO" |
13:19:21 | FromDiscord | <exelotl> maybe the `a.SecondType(...)` syntax for object construction isn't supported? |
13:19:40 | FromDiscord | <exelotl> I've never seen anyone use it before, it kind of threw me off to look at it x) |
13:20:08 | FromDiscord | <Phil> ... what is a.FirstType supposed to evaluate to? I don't think I've ever seen that used |
13:20:16 | FromDiscord | <Phil> Like, what's the intent to express here? |
13:20:30 | FromDiscord | <Nalmyth> In reply to @exelotl "maybe the `a.SecondType(...)` syntax": Hmm, seems to be. I see it used in other areas of the codebase `SecondType(...)` |
13:20:34 | FromDiscord | <Rika> I assume a is a module |
13:20:47 | FromDiscord | <Phil> Earlier a was a type, that's why I'm not sure it is |
13:20:51 | FromDiscord | <Nalmyth> In reply to @Isofruit "Like, what's the intent": It's an object inside a module.↵↵`vehicles.Car()` for example |
13:21:07 | FromDiscord | <Nalmyth> (edit) "In reply to @Isofruit "Like, what's the intent": It's an object ... inside" added "description" |
13:21:09 | FromDiscord | <Phil> so `a` module with a type `FirstType` inside of it? |
13:21:18 | FromDiscord | <Nalmyth> Yep, `FirstType` and `SecondType` |
13:21:25 | FromDiscord | <Phil> Ahhh check |
13:23:04 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=47WR |
13:23:34 | FromDiscord | <Nalmyth> So strange 🤔 I haven't been able to reproduce it in a smaller sample either |
13:26:02 | FromDiscord | <Phil> Just tried it, it works for me without issue |
13:26:35 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=47WT |
13:26:49 | FromDiscord | <Phil> You can just name them a.nim and b.nim, I just already had the files there for copy pasting |
13:27:36 | FromDiscord | <Phil> I would like to point out though that the code for `test` doesn't make much sense |
13:27:58 | FromDiscord | <Phil> You're passing in a parameter you don't need to make a static comparison.↵I assume this is mostly for learning purposes? |
13:28:09 | FromDiscord | <Phil> (edit) "comparison.↵I" => "comparison at runtime.↵I" |
13:28:10 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=47WV |
13:29:05 | FromDiscord | <voidwalker> I have some qt5-quickcontrols and qt5-quickcontrols2 installed.. not sure what's up, or where is that module version supposed to be ? |
13:29:42 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=47WW |
13:30:09 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/BxK |
13:30:17 | FromDiscord | <Nalmyth> (edit) "https://play.nim-lang.org/#ix=47WW" => "https://play.nim-lang.org/#ix=47WX" |
13:30:35 | FromDiscord | <Phil> is that thumbsup a confirmation that you have or that you will :-p ? |
13:30:48 | FromDiscord | <Nalmyth> In reply to @Isofruit "Question, did you take": Yes I've looked over OOP in nim, this project is not using any method specs 🤔 |
13:30:54 | FromDiscord | <Nalmyth> only proc and func |
13:31:11 | FromDiscord | <Phil> The main reason I'm asking is because I'm seeing inheritance in the future and since you mentioned polymorphism I thought that might be where you want to be heading |
13:31:18 | FromDiscord | <enthus1ast> most of the oop needs are handled by nims uniform call syntax anyway.... |
13:32:46 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=47WZ |
13:32:54 | FromDiscord | <Nalmyth> Although it's already clarified 🤔 |
13:33:08 | FromDiscord | <Phil> sent a code paste, see https://play.nim-lang.org/#ix=47X0 |
13:33:40 | FromDiscord | <Phil> But other than that , what is "default" ? |
13:33:56 | FromDiscord | <Nalmyth> In reply to @Isofruit "I maintain my stance": `nim default` returns the default value for a type |
13:34:13 | FromDiscord | <Nalmyth> In reply to @Isofruit "I maintain my stance": Hmm, and then use something like `t == default(t.VehicleBody())` |
13:34:35 | FromDiscord | <nocturn9x> is it possible to disable the GC on a module-level? |
13:34:44 | FromDiscord | <nocturn9x> I need nim's GC to stop interfering with my own :/ |
13:34:58 | FromDiscord | <Phil> In reply to @Nalmyth "Hmm, and then use": Ah, check. Alright, next question, which part of the code you're compiling aren't you showing us since there's somewhere in your code where you are using an unclarified VehicleBody 😄 |
13:35:03 | FromDiscord | <nocturn9x> For a language that supports manual memory management, it sure is hell to actually use it |
13:35:21 | FromDiscord | <exelotl> if you use ARC then it shouldn't interfere at all |
13:35:27 | FromDiscord | <nocturn9x> wrong |
13:35:27 | FromDiscord | <Nalmyth> In reply to @Isofruit "Ah, check. Alright, next": That could well be it, so somewhere there's a template calling a proc or something? |
13:35:32 | FromDiscord | <nocturn9x> ARC makes the program just crash, lol |
13:35:40 | FromDiscord | <nocturn9x> not even an error message or anything |
13:35:42 | FromDiscord | <nocturn9x> it just dies |
13:36:02 | FromDiscord | <nocturn9x> I just need to disable the GC for a single module |
13:36:04 | FromDiscord | <Phil> In reply to @Nalmyth "That could well be": Depends. I'd go CTRL + F and search through your usages of `VehicleBody` and see which are unclarified |
13:36:08 | FromDiscord | <nocturn9x> should I try compiling it as a dll? |
13:36:30 | FromDiscord | <nocturn9x> that sounds incredibly annoying though |
13:36:39 | FromDiscord | <exelotl> try running the program through valgrind or gdb to see where it's going wrong? |
13:36:55 | FromDiscord | <nocturn9x> it's like 5000+ lines of nim code |
13:37:01 | FromDiscord | <nocturn9x> and a lot more lines of C code |
13:37:09 | FromDiscord | <nocturn9x> I don't exactly have eons to debug nim's GC |
13:37:14 | FromDiscord | <nocturn9x> I just want to turn it off |
13:38:01 | FromDiscord | <exelotl> you can't selectively turn it off per-module but you can simply not invoke it, mostly by avoiding `ref` types and closures. |
13:38:12 | FromDiscord | <Nalmyth> In reply to @Isofruit "Depends. I'd go CTRL": Thank you! I will take a look 🙂 |
13:38:41 | FromDiscord | <nocturn9x> In reply to @exelotl "you can't selectively turn": I use objects or `ptr`s |
13:38:46 | FromDiscord | <nocturn9x> not sure why it's messing things up tbh |
13:38:54 | FromDiscord | <Nalmyth> Is there some way to find out which control flow is trying to call that function?↵I only see one line of output in the result |
13:39:04 | FromDiscord | <nocturn9x> In reply to @Nalmyth "Is there some way": GDB |
13:39:04 | FromDiscord | <Nalmyth> (edit) "Is there some way to find out ... which" added "at compile time" |
13:39:05 | FromDiscord | <dom96> @nocturn9x maybe this would help? https://nim-lang.org/docs/system.html#GC_disable |
13:39:16 | FromDiscord | <Nalmyth> In reply to @nocturn9x "GDB": I mean a compile time error |
13:39:21 | FromDiscord | <nocturn9x> In reply to @dom96 "<@523555920265871380> maybe this would": That is exactly what I'm looking for |
13:39:26 | FromDiscord | <nocturn9x> In reply to @Nalmyth "I mean a compile": oh, my bad |
13:39:26 | FromDiscord | <Nalmyth> (edit) "In reply to @nocturn9x "GDB": ... I" added "Sorry" |
13:39:33 | FromDiscord | <nocturn9x> although I'm confused |
13:39:37 | FromDiscord | <nocturn9x> arc seems to work now?! |
13:39:43 | FromDiscord | <nocturn9x> it would straight up crash before |
13:40:13 | FromDiscord | <Phil> magic.gif |
13:40:13 | FromDiscord | <nocturn9x> huh, weird https://media.discordapp.net/attachments/371759389889003532/1009819006938660945/unknown.png |
13:40:42 | FromDiscord | <nocturn9x> ok I'm genuinely confused |
13:40:57 | FromDiscord | <nocturn9x> didn't even need to bonk it for it to work again 😂 |
13:41:21 | FromDiscord | <Phil> You mentally bonked it |
13:41:30 | FromDiscord | <Phil> Nim is so advanced it doesn't need to physical love tap |
13:41:34 | FromDiscord | <Phil> A mental one suffices |
13:41:40 | FromDiscord | <nocturn9x> yeah I mean |
13:41:45 | FromDiscord | <nocturn9x> I was confused as to why ARC would crush |
13:41:53 | FromDiscord | <nocturn9x> it's RAII after all |
13:42:02 | FromDiscord | <nocturn9x> and my pointers live just as long as my objects so like |
13:42:03 | FromDiscord | <nocturn9x> 🤷 |
13:42:09 | FromDiscord | <nocturn9x> (edit) "crush" => "crash" |
13:43:01 | FromDiscord | <Phil> For the uninitiated, RAII = "If I get the memory I instantiate the object"? |
13:43:17 | FromDiscord | <Phil> Skimming through the wiki and not getting a firm grasp on the meaning for the acronym |
13:43:39 | FromDiscord | <Nerve> Unsure where else to post this, avoiding #internals since I figure that's for discussion of existing source. Has anyone looked at Vale's approach to automatic memory, generational references? They're a fascinating concept.↵https://verdagon.dev/blog/generational-references |
13:44:11 | FromDiscord | <Nerve> Nim has two reference counters so I figured this would be of interest to you guys |
13:44:23 | FromDiscord | <Phil> Ah, no, RAII = "This object lives after the constructor has finished and dies when the destructor has finished"? |
13:44:41 | FromDiscord | <flywind> In reply to @Nerve "Unsure where else to": It was discussed if you search the history. |
13:44:52 | FromDiscord | <Nerve> Hmm, I searched but didn't find much |
13:44:56 | FromDiscord | <nocturn9x> In reply to @Isofruit "Ah, no, RAII =": well |
13:44:57 | FromDiscord | <Nerve> Lemme try again |
13:45:04 | FromDiscord | <Rika> RAII is “when you make the object a(n abstract) resource is consumed in some way” I believe |
13:45:10 | FromDiscord | <nocturn9x> RAII stands for Resource Acquisition is Initialization |
13:45:21 | FromDiscord | <nocturn9x> whenever you start using it, there's a call to malloc |
13:45:29 | FromDiscord | <nocturn9x> when it goes out of scope, it's destroyed/dealloced |
13:45:46 | FromDiscord | <nocturn9x> it's basically as if you had manual memory management in C, but it can't catch cycles |
13:47:12 | FromDiscord | <Rika> It’s almost just ARC pretty much, if we conflate hard enough xd |
13:47:58 | FromDiscord | <flywind> In reply to @Nerve "Lemme try again": keywords are "vale" and "generational reference". |
13:48:37 | FromDiscord | <Phil> As someone with no low-level knowledge, malloc is basically acquiring the memory you need to store the object you want to create in, right?↵So it leads to the language calling malloc for you when you instantiate the object and dealloc when it goes out of scope? |
13:50:26 | FromDiscord | <exelotl> sent a long message, see http://ix.io/47X5 |
13:51:42 | FromDiscord | <huantian> I always thought RAII was also about the freeing of resources, like closing a file when the object goes out of scope |
13:54:50 | FromDiscord | <Rika> It is about that |
13:55:03 | FromDiscord | <Rika> At least that’s my impression of it |
13:55:08 | FromDiscord | <Phil> In reply to @exelotl "idk, there's the classic": I mean, if the classes are all small, then that's OOP as intended: Lots of small and simple classes that you can easily reason about coming together to do complex things. |
13:55:33 | FromDiscord | <Phil> But doing object instantiation "Just because" seems definitely like a bad design smell |
13:57:28 | FromDiscord | <Nerve> In reply to @exelotl "idk, there's the classic": This precise phenomena, the kraken-like tentacles of OOP "best practices" has grinded my gears for years. All taken for granted, with no consideration for the amount of pain it's causing and money it's wasting. In rare cases, with full understanding that yes we want that because it employs people, justifying middle management and perpetual contracts. |
13:58:46 | FromDiscord | <Nerve> I feel like there's an updated version of the "Lisp curse" brewing in my head to polemically attack this new age of graft. |
13:58:48 | FromDiscord | <Rika> You could say that it pinched your… nerves |
13:58:57 | FromDiscord | <Phil> badum ts |
13:58:58 | FromDiscord | <Nerve> (edit) "the "Lisp curse"" => ""The Lisp Curse"" |
14:00:25 | FromDiscord | <Nalmyth> sent a code paste, see https://play.nim-lang.org/#ix=47X9 |
14:00:52 | FromDiscord | <Phil> In reply to @Nalmyth "Finally I had a": Ohhhhh I feel your pain, that kind of crap is impossible to spot |
14:08:51 | * | oddish quit (Quit: nyaa~) |
14:13:10 | FromDiscord | <dom96> wat |
14:13:31 | FromDiscord | <dom96> what was the error for those extra `()`? |
14:15:04 | FromDiscord | <flywind> What about the `nim check`? The useful error message can probably be hidden. |
14:22:04 | FromDiscord | <nocturn9x> well |
14:22:07 | FromDiscord | <nocturn9x> I crashed the compiler |
14:22:12 | FromDiscord | <nocturn9x> and there's no error messages whatsoever |
14:22:25 | FromDiscord | <nocturn9x> it just stops compiling and exits silently |
14:23:11 | FromDiscord | <nocturn9x> _why_ 😭 |
14:24:08 | FromDiscord | <flywind> Using `./koch temp c -r yournimfile.nim`, you can probably get the traceback. |
14:24:20 | FromDiscord | <nocturn9x> Where do I get koch though |
14:25:32 | FromDiscord | <dom96> In reply to @nocturn9x "it just stops compiling": oh, definitely report that as an issue then |
14:25:45 | FromDiscord | <nocturn9x> heh https://media.discordapp.net/attachments/371759389889003532/1009830468369260544/unknown.png |
14:25:54 | FromDiscord | <nocturn9x> In reply to @dom96 "oh, definitely report that": dunno if I can create a small example for it |
14:26:12 | FromDiscord | <flywind> sent a code paste, see https://paste.rs/HuU |
14:26:30 | FromDiscord | <flywind> (edit) "https://play.nim-lang.org/#ix=47Xe" => "https://play.nim-lang.org/#ix=47Xf" |
14:27:03 | FromDiscord | <flywind> Looks like an endless loop in the compiler though. |
14:28:24 | FromDiscord | <ezquerra> Today I used choosenim to install nim on a new windows machine. I ran it from a non administrator console. The installation process showed a lot of warnings. I tried again from an admin console and the installation ran cleanly |
14:28:40 | FromDiscord | <flywind> (edit) "Looks like an endless loop in the compiler though. ... " added "Probably a recursive type definition, anyway I hope it work with the devel." |
14:28:52 | FromDiscord | <ezquerra> However, the nim was not added to the path. Is that normal? |
14:29:20 | * | PMunch quit (Quit: Leaving) |
14:29:39 | FromDiscord | <ezquerra> Also, I thin llamo it would be a good idea if choosenim copied itself into the bin folder so that you could use choosenim from anywhere as well |
14:30:06 | FromDiscord | <dom96> choosenim doesn't add to your path automatically |
14:30:19 | FromDiscord | <dom96> didn't you see a message in the output telling you to add it to your path? |
14:30:27 | FromDiscord | <nocturn9x> how can I detect like |
14:30:33 | FromDiscord | <nocturn9x> when different mm strategies are being used at the same time |
14:30:44 | FromDiscord | <nocturn9x> so like `when arc:` `when refc` etc. |
14:30:51 | FromDiscord | <dom96> also, it does copy itself to the bin folder |
14:30:59 | FromDiscord | <nocturn9x> `when compileOption("arc")` doesn't work |
14:31:04 | FromDiscord | <nocturn9x> (edit) "work" => "work, says invalid option" |
14:31:08 | FromDiscord | <dom96> sounds like you maybe installed it wrong, did you run the bat file? |
14:31:32 | FromDiscord | <nocturn9x> (edit) "the same" => "compile" |
14:31:55 | FromDiscord | <ezquerra> There was no bat file. I downloaded the .exe that I found on the releases page |
14:32:19 | FromDiscord | <ezquerra> There was also a zip file but I figured I could use either of them |
14:32:54 | FromDiscord | <flywind> In reply to @nocturn9x "`when compileOption("arc")` doesn't work,": when defined(gcArc) |
14:33:12 | FromDiscord | <nocturn9x> I had also found `when compileOption("gc", "arc")` |
14:33:16 | FromDiscord | <nocturn9x> but that sounds better |
14:33:41 | FromDiscord | <dom96> In reply to @ezquerra "There was also a": nope: https://github.com/dom96/choosenim#windows |
14:34:02 | FromDiscord | <dom96> I guess I need to hide the .exe |
14:34:41 | FromDiscord | <dom96> but that requires a change in choosenim :/ |
14:35:32 | FromDiscord | <dom96> or maybe just renaming the zip would work |
14:35:34 | FromDiscord | <ezquerra> This is as far as I read:↵> Download the latest Windows version from the releases page😅 |
14:36:05 | FromDiscord | <dom96> yeah.. I can't blame you |
14:37:06 | FromDiscord | <dom96> if I rename the zip to "choosenim-installer-0.8.4_windows_amd64.zip" will that be easier to pick then? :) |
14:37:51 | FromDiscord | <dom96> or should I make it "choosenim-0.8.4_windows_amd64-download-this-not-the-exe.zip"? :D |
14:38:01 | FromDiscord | <ezquerra> Lol |
14:38:28 | FromDiscord | <ezquerra> I think it’d be best if there was no exe on the download page. Avoid any ambiguity |
14:38:48 | FromDiscord | <dom96> yes, but I cannot do that because `choosenim self update` downloads that exe |
14:38:55 | FromDiscord | <dom96> and the url is hardcoded |
14:41:36 | FromDiscord | <ezquerra> What if there was a generic (or not numbered) installer executable that downloaded the zip and ran it for you? Then you could link to it from the installation instructions |
14:42:11 | FromDiscord | <domosokrat> What about choosenim-0.8.4\_windows\_amd64-self-update-only.exe |
14:42:26 | FromDiscord | <domosokrat> and hardcode that |
14:42:29 | FromDiscord | <dom96> In reply to @ezquerra "What if there was": sure, that could be an option too. People will still end up on the releases page without reading the readme though |
14:42:45 | FromDiscord | <dom96> In reply to @domosokrat "and hardcode that": yeah, that would require a change in choosenim though which means older versions would start failing to self update |
14:42:45 | * | rockcavera joined #nim |
14:42:45 | * | rockcavera quit (Changing host) |
14:42:45 | * | rockcavera joined #nim |
14:43:11 | FromDiscord | <domosokrat> ahh, yes |
14:43:17 | * | rockcavera quit (Remote host closed the connection) |
14:43:23 | FromDiscord | <dom96> I think a GUI installer for Windows would be cool |
14:43:41 | FromDiscord | <dom96> even a simple one-window one |
14:43:59 | FromDiscord | <dom96> it could also then do the PATH setting |
14:44:07 | * | rockcavera joined #nim |
14:44:08 | * | rockcavera quit (Changing host) |
14:44:08 | * | rockcavera joined #nim |
14:44:12 | FromDiscord | <dom96> if someone makes that I'll put it in the readme :) |
14:44:23 | FromDiscord | <dom96> for now I'll rename the zip |
14:44:43 | FromDiscord | <ezquerra> Yes. And you could place this “generic choosenim installer” in a different download place which you could link from the instructions |
14:46:03 | FromDiscord | <dom96> For real though, anyone interested? it would be a fun project, I'd do it but I have too many projects to maintain :) |
14:46:18 | FromDiscord | <dom96> Happy to help steer folks in the right direction though |
14:49:12 | FromDiscord | <auxym> GUI installer for nim? or choosenim? |
14:50:00 | FromDiscord | <dom96> choosenim |
14:52:31 | FromDiscord | <auxym> I sort of know my way around MSI, probably not too hard with wix. I could try a prototype since I have some free time these days but I also probably won't be able to maintain it going forward so... heh. |
14:53:04 | FromDiscord | <auxym> (or at least, I sort of did, 4 years ago when I used installshield at work for a couple months) |
14:53:05 | FromDiscord | <flywind> Writing a GUI installer for Nim is appreciated too. |
14:53:12 | FromDiscord | <dom96> I was thinking of writing it in Nim tbh |
14:53:19 | FromDiscord | <auxym> doesn't nim already have it though? |
14:53:34 | FromDiscord | <dom96> Nim has had various GUI installers over the years: NSIS/Inno |
14:55:25 | FromDiscord | <dom96> now we've got finish.exe which I guess makes maintenance easy but sucks for UX |
14:55:42 | FromDiscord | <auxym> msi is nice though. it's the modern(ish) way for installers in windows, to my understanding, vs old-style executables that just do whatever. They also allow for easy automated installs and updates on build servers and whatnot. inno makes an msi, no? Maybe wrapped in a exe launcher? |
14:57:35 | FromDiscord | <dom96> for choosenim all the installer would have to do is download zip, extract it and execute the batch script. Then maybe add ~/.nimble/bin to PATH as well. So pretty easy. |
14:57:48 | FromDiscord | <dom96> for Nim it would be far more involved |
14:58:02 | FromDiscord | <dom96> well, maybe not |
14:58:12 | FromDiscord | <dom96> but having choosenim is nice anyway :) |
14:58:18 | FromDiscord | <auxym> In reply to @auxym "msi is nice though.": apparently innosetup does not in fact build MSIs |
14:58:24 | FromDiscord | <Prestige> Why does it need a GUI installer for Windows? |
14:58:38 | FromDiscord | <dom96> it doesn't, but it would be nice |
14:58:51 | FromDiscord | <dom96> Windows users are used to installers |
14:58:56 | FromDiscord | <dom96> even developers |
14:59:10 | FromDiscord | <Prestige> Hmm |
14:59:21 | FromDiscord | <auxym> windows users like GUIs 🙂 but then again, users of nim and choosenim would have to be comfortable in the terminal to actually use the software. |
15:00:11 | FromDiscord | <auxym> maybe choosenim or nim could even be packaged for the windows appstore. No idea how much effort that is, though. |
15:00:12 | FromDiscord | <dom96> users of choosenim yes, but users of Nim could get away without a terminal |
15:00:17 | FromDiscord | <dom96> if VS code does the building for them |
15:00:23 | FromDiscord | <auxym> oh yeah |
15:00:45 | FromDiscord | <dom96> hm, Windows App store might be a good idea actually |
15:01:17 | FromDiscord | <auxym> does nim have a code signing cert? that might be a requirement for the appstore |
15:01:46 | FromDiscord | <dom96> nope |
15:01:55 | FromDiscord | <dom96> but getting one could also improve the antivirus situation |
15:02:02 | FromDiscord | <auxym> yeah |
15:06:14 | FromDiscord | <auxym> apparently (https://www.advancedinstaller.com/msix-publish-microsoft-store.html) the app is signed automatically when you upload it to the store, no need for a separate cert (or to setup signing in CI). Getting a developer account is a one time fee (19$ individual or 99$ company). |
15:07:30 | FromDiscord | <auxym> btw what does finish.exe do exactly? never looked in to it. just setup PATH? |
15:08:00 | FromDiscord | <dom96> it downloads some dependencies too iirc, not certain myself |
15:09:26 | FromDiscord | <gibson> There's a PR in progress for puppy that adds progress indication to the native win file downloading without external libs. That would make writing the installer even easier. If there's a better option I'd selfishly like to know the solution! |
15:10:58 | FromDiscord | <flywind> If Nim is in the Ms store, users can probably install the Nim in the limited working environment regardless of false postives. |
15:11:24 | FromDiscord | <flywind> Sounds like a good option. |
15:13:29 | FromDiscord | <auxym> In reply to @gibson "There's a PR in": like I said, my experience with installers is mostly MSI (https://en.wikipedia.org/wiki/Windows_Installer). MSI is basically a bunch of sql-style tables that contain all the data (files to be installed,reg keys, etc) and metadata (file paths, versions to handle upgrades,etc). Then windows has a built-in GUI that walks you through installing an MSI file (including progress bars IIRC). |
15:13:56 | FromDiscord | <auxym> wix (https://wixtoolset.org/) is an open-source toolchain to build MSIs, though I don't have experience with that. |
15:15:43 | FromDiscord | <gibson> Sounds like the best option. |
15:18:30 | FromDiscord | <auxym> apparently the newest way is MSIX https://docs.microsoft.com/en-us/windows/msix/overview but no idea about that |
15:18:57 | FromDiscord | <dom96> In reply to @gibson "There's a PR in": yeah, that's what I was thinking. We have a lot of awesome libraries that make creating a dependency-free exe which downloads some stuff and installs it really easy. |
15:19:37 | FromDiscord | <dom96> I've often also thought about creating a framework for installers ala NSIS/Inno in Nim because of that. I wonder if that could be a killer framework. |
15:22:02 | FromDiscord | <Rainbow Asteroids> In reply to @Nerve "Unsure where else to": iirc, Nim's ARC static, so it has no runtime cost compared to generational references, which branches on a dereference, so in theory, shouldn't Nim's ARC be faster than Vale's MM? |
15:26:05 | FromDiscord | <nocturn9x> this is what I was talking about https://media.discordapp.net/attachments/371759389889003532/1009845651984617543/unknown.png |
15:26:18 | FromDiscord | <nocturn9x> ARC just straight up crashes my code and gives me literally zero insight into what happened |
15:27:54 | FromDiscord | <dom96> run it with gdb to see where it crashes |
15:27:54 | * | rockcavera quit (Remote host closed the connection) |
15:32:10 | FromDiscord | <nocturn9x> not really too helpful https://media.discordapp.net/attachments/371759389889003532/1009847179302682684/unknown.png |
15:33:02 | FromDiscord | <nocturn9x> with refc: https://media.discordapp.net/attachments/371759389889003532/1009847398161457242/unknown.png |
15:33:22 | FromDiscord | <nocturn9x> the thing is why does it not crash for 487584756 iterations and does it crash only with one |
15:35:28 | FromDiscord | <nocturn9x> I even imported `std/segfaults` to try and catch it |
15:35:36 | FromDiscord | <nocturn9x> but nope, doesn't even trigger the catch block |
15:39:49 | FromDiscord | <nocturn9x> I guess I'll go and try to debug with `--gc:none` to rule out nim's memory management |
16:01:54 | FromDiscord | <nocturn9x> grrr why does nim disallow deleting elements from seqs during iteration |
16:01:58 | FromDiscord | <nocturn9x> it's so fricking annoying |
16:03:07 | FromDiscord | <auxym> In reply to @dom96 "I've often also thought": eh, just my opinion but doubt it. Besides the fact that traditional desktop apps lost a huge amount of popularity to the web (to my great sadness), my understanding is that "custom" installers like nsis, inno are sort of deprecated (or not preferred) in windows compares to standardization of msi (/msix). Even installshield, which sells licenses in the 4-5 fig range, creates MSIs last I used it |
16:03:46 | FromDiscord | <auxym> Now some sort of GUI msi-maker, competing with IS? Maybe. Huge undertaking though. |
16:05:31 | FromDiscord | <auxym> to my knowledge the only OSS option for MSI is wix, which is just CLI tools that take XMLs as input. and IS is crazy expensive. |
16:10:33 | FromDiscord | <nocturn9x> DEAR GOD I FIXED IT |
16:10:37 | FromDiscord | <nocturn9x> I hate managing memory. |
16:10:53 | FromDiscord | <nocturn9x> Good thing I just fixed the program that supposedly will do it for me in the future |
16:12:38 | FromDiscord | <auxym> `mitems` ? To iterate and modify elems |
16:12:54 | FromDiscord | <auxym> and yes managing memory does suck, which is why I like nim 😉 |
16:13:04 | FromDiscord | <nocturn9x> In reply to @auxym "`mitems` ? To iterate": wait |
16:13:08 | FromDiscord | <nocturn9x> I'm a fucking idiot |
16:13:16 | FromDiscord | <nocturn9x> _you're right I wanna die AAAAAA_ |
16:13:23 | FromDiscord | <nocturn9x> Well, I guess I learned something today. |
16:13:36 | FromDiscord | <nocturn9x> In reply to @auxym "and yes managing memory": there is only one thing I dislike about nim |
16:13:41 | FromDiscord | <nocturn9x> which is sadly core to its design |
16:13:58 | FromDiscord | <nocturn9x> the way _everything_ is a template: generics, in particular, are pretty nasty |
16:14:10 | FromDiscord | <nocturn9x> they're super cool... until they break |
16:14:45 | FromDiscord | <nocturn9x> just out of curiosity I wanna try using mitems instead |
16:15:07 | FromDiscord | <nocturn9x> does `mitems` allow me to _remove_ the element though? |
16:15:14 | FromDiscord | <nocturn9x> cuz that's what I need to do |
16:15:14 | FromDiscord | <auxym> prolly not |
16:15:25 | FromDiscord | <nocturn9x> yeah because iirc iterators are desugared to while loops |
16:15:26 | FromDiscord | <auxym> not sure, try it... |
16:15:57 | FromDiscord | <auxym> for or while, not sure, but yes they are expanded to a plain C loop |
16:16:25 | FromDiscord | <nocturn9x> mpairs |
16:16:30 | FromDiscord | <nocturn9x> it says m[index] can be modified |
16:16:35 | FromDiscord | <nocturn9x> let's see if that includes deletion |
16:17:33 | FromDiscord | <nocturn9x> hmm, nope, segfaults |
16:18:10 | FromDiscord | <auxym> what is deletion to you though? copying all the elems in a seq down one index over the index you are deleting? multiple copies so it might actually be more efficient to copy the elems you want to keep to a new seq (ie do a filter) |
16:18:30 | FromDiscord | <nocturn9x> to me it means basically pop and shift all the elements by 1 |
16:18:45 | FromDiscord | <nocturn9x> I should probably try using a deque actually |
16:18:54 | FromDiscord | <auxym> yeah. why not use filter? Are you memory limited? |
16:19:00 | FromDiscord | <auxym> or deque yeah |
16:19:02 | FromDiscord | <nocturn9x> In reply to @auxym "yeah. why not use": well this is my GC |
16:19:07 | FromDiscord | <nocturn9x> if the GC runs out of memory... |
16:19:18 | FromDiscord | <nocturn9x> it's game over |
16:19:20 | FromDiscord | <auxym> oh. writing gcs is way out of my league lol. |
16:19:29 | FromDiscord | <nocturn9x> this gc is stupid simple actually |
16:19:37 | FromDiscord | <Rainbow Asteroids> In reply to @nocturn9x "it's so fricking annoying": What are you trying to do? It make make more sense to use `sequtils.filterIt` instead. |
16:19:37 | FromDiscord | <nocturn9x> I'm not smart enough for anything more complex |
16:19:47 | FromDiscord | <nocturn9x> In reply to @Rainbow Asteroids "What are you trying": yes but that creates a copy |
16:20:08 | FromDiscord | <nocturn9x> although it may be more efficient now that I think about it |
16:20:18 | FromDiscord | <nocturn9x> because a pop in the middle is still copying everything over, right? |
16:20:28 | FromDiscord | <auxym> but doing shift by one a bunch of times is probably slow. consider using a sentinel value to mark deletions, or another DS like a slot table or tree or something |
16:20:35 | FromDiscord | <leorize> `keepIt` do in-place modification if you don't like allocating more memory |
16:20:53 | FromDiscord | <nocturn9x> what I need to do is simple |
16:20:56 | FromDiscord | <nocturn9x> go through a seq |
16:21:02 | FromDiscord | <nocturn9x> see if any object there has a field set |
16:21:08 | FromDiscord | <nocturn9x> if it doesn't, dealloc() it |
16:21:11 | FromDiscord | <nocturn9x> otherwise leave it there |
16:21:23 | FromDiscord | <auxym> In reply to @nocturn9x "although it may be": yes, single copy is likely more CPU-efficient than a bunch of copies (one shift for every elem). you're just temporarily using twice the memory |
16:21:32 | FromDiscord | <nocturn9x> yeah you're right |
16:21:35 | FromDiscord | <nocturn9x> as I said I'm an idiot |
16:21:36 | FromDiscord | <nocturn9x> brb |
16:22:32 | FromDiscord | <nocturn9x> can I pass extra arguments to the filter function |
16:22:33 | FromDiscord | <auxym> In reply to @leorize "`keepIt` do in-place modification": TIL, didn't know keepit. does it do a bunch of shifts? |
16:22:36 | FromDiscord | <nocturn9x> without creating a closure |
16:22:41 | FromDiscord | <nocturn9x> (edit) "closure" => "closure?" |
16:22:48 | FromDiscord | <nocturn9x> cuz a closure would probably make the GC angry |
16:22:51 | FromDiscord | <nocturn9x> (nim's GC) |
16:22:51 | FromDiscord | <leorize> it does, it uses `delete` internally↵(@auxym) |
16:23:04 | FromDiscord | <nocturn9x> In reply to @leorize "it does, it uses": ok well then maybe filterIt is better? |
16:23:09 | FromDiscord | <nocturn9x> because it does just one big copy |
16:23:25 | FromDiscord | <auxym> In reply to @nocturn9x "can I pass extra": filterIt is a template so no need to create a closure, just pass any body block |
16:23:25 | FromDiscord | <leorize> the `It` variants are inlined and does not use closures, if you want to avoid those |
16:23:31 | FromDiscord | <nocturn9x> thx |
16:24:05 | * | Jovan joined #nim |
16:24:08 | FromDiscord | <EyeCon> In reply to @leorize "`keepIt` do in-place modification": TIL, thanks! |
16:24:09 | FromDiscord | <leorize> that stuff never worked btw↵(@nocturn9x) |
16:24:16 | FromDiscord | <nocturn9x> oh no it works now |
16:24:21 | FromDiscord | <nocturn9x> idk why it didn't work before |
16:24:25 | FromDiscord | <nocturn9x> changed some code and it's ok now |
16:24:30 | FromDiscord | <nocturn9x> no idea what I did or why though |
16:25:27 | FromDiscord | <nocturn9x> so what I could do is `self.objects = self.objects.filterIt(it.marked)` |
16:26:16 | FromDiscord | <nocturn9x> but I also need to pass `it` to another function |
16:26:20 | FromDiscord | <nocturn9x> I have an idea |
16:26:32 | FromDiscord | <EyeCon> Isn't ithis just `self.objects.keepItIf(it.marked)`? |
16:26:43 | FromDiscord | <EyeCon> (edit) "ithis" => "this" |
16:27:17 | FromDiscord | <nocturn9x> I guess |
16:27:38 | FromDiscord | <leorize> if you have a bool like that you can avoid deletion by just moving it to an another seq and use it to figure out if an entry is "empty" |
16:28:50 | FromDiscord | <Rainbow Asteroids> sent a code paste, see https://play.nim-lang.org/#ix=47Y4 |
16:28:54 | FromDiscord | <nocturn9x> lemme try |
16:30:46 | FromDiscord | <nocturn9x> seems like it, yea |
16:33:38 | FromDiscord | <nocturn9x> sent a code paste, see https://play.nim-lang.org/#ix=47Y5 |
16:33:56 | FromDiscord | <nocturn9x> (edit) "https://play.nim-lang.org/#ix=47Y5" => "https://play.nim-lang.org/#ix=47Y6" |
17:07:41 | * | rockcavera joined #nim |
17:07:41 | * | rockcavera quit (Changing host) |
17:07:41 | * | rockcavera joined #nim |
17:23:06 | NimEventer | New thread by Jasonfi: How to allocate a channel and return a ptr?, see https://forum.nim-lang.org/t/9387 |
17:30:59 | * | pro joined #nim |
17:42:17 | * | pro quit (Quit: pro) |
18:01:11 | NimEventer | New thread by EyeCon: Anti-virus at work prevents the use of Nim binaries, see https://forum.nim-lang.org/t/9388 |
18:10:46 | * | xet7 joined #nim |
18:17:41 | FromDiscord | <Gabben> sent a code paste, see https://play.nim-lang.org/#ix=47Yv |
18:18:45 | FromDiscord | <Gabben> (edit) "https://play.nim-lang.org/#ix=47Yv" => "https://play.nim-lang.org/#ix=47Yw" |
18:44:03 | FromDiscord | <EyeCon> There was some utility function to manually join with a separator, like it would only apply if an index has exceeded some value |
18:44:17 | FromDiscord | <EyeCon> Can someone remind me? I realize that it's a terrible description |
18:49:57 | * | xet7 quit (Ping timeout: 252 seconds) |
18:50:09 | FromDiscord | <iAmNotAfraidofSpiders> sent a code paste, see https://play.nim-lang.org/#ix=47YB |
18:54:06 | FromDiscord | <EyeCon> In reply to @EyeCon "There was some utility": Found it after searching for countless different keywords. For posteriority: https://nim-lang.org/docs/strutils.html#addSep%2Cstring%2Cstring%2CNatural (`addSep`) |
18:57:15 | FromDiscord | <Phil> In reply to @iAmNotAfraidofSpiders "I'm new to nim,": That looks like you have a typo in the import somewhere, or the file asyncdocker.nim does.↵Could you show your code to allow replication? |
18:59:40 | FromDiscord | <Phil> In reply to @iAmNotAfraidofSpiders "I'm new to nim,": never mind, managed to replicate the issue with a simple import |
18:59:51 | FromDiscord | <iAmNotAfraidofSpiders> sent a code paste, see https://play.nim-lang.org/#ix=47YF |
18:59:54 | FromDiscord | <iAmNotAfraidofSpiders> Yeah, that's all I had 🙂 |
19:01:07 | FromDiscord | <Phil> Your problem here is that the package is from 2016, which IIRC was pre nim 1.0, I'm pretty sure there were a bunch of lib changes made since then that would render it incompatible. ↵You may notice for example that there is no std/asynchttpclient nowadays if you check the list of libs in nim's std lib section:↵https://nim-lang.org/docs/lib.html |
19:02:17 | * | xet7 joined #nim |
19:02:31 | FromDiscord | <Phil> 6 years is a pretty long time for a lib to go without updates |
19:03:57 | FromDiscord | <iAmNotAfraidofSpiders> That's what I thought, just wanted to double check as I'm still new 🙂 |
19:04:21 | FromDiscord | <Phil> No worries and happy to help |
19:10:35 | * | disso_peach quit (Ping timeout: 256 seconds) |
19:11:18 | FromDiscord | <iAmNotAfraidofSpiders> I was just playing around, going to see if I could capture results of docker `docker ps` , looking at the docs, I think I can probably run `gorgeEx` to capture the output of running that command. I'm not doing anything particularly important, just learning things. |
19:15:13 | * | disso_peach joined #nim |
19:20:09 | * | xet7 quit (Quit: Leaving) |
19:21:38 | FromDiscord | <dom96> asynchttpclient was never a thing in the stdlib |
19:22:40 | FromDiscord | <Phil> There's no nimble package for it though, that's why I thought it to be from std originally |
19:25:32 | FromDiscord | <dom96> sure, I don't blame you for thinking that |
19:25:45 | FromDiscord | <dom96> definitely lots of stuff got deprecated in the stdlib |
19:49:33 | FromDiscord | <Bung> In reply to @Isofruit "There's no nimble package": try puppy or https://github.com/juancarlospaco/harpoon |
19:53:35 | * | d4rckh joined #nim |
19:53:44 | d4rckh | hello! |
19:56:16 | FromDiscord | <Phil> In reply to @Bung "try puppy or https://github.com/juancarlospaco/harp": Generally solid advice, but I don't really have a usecase myself, was ore in regards to the asyncdocker package iAmNotAfraidOfSpiders found |
19:56:25 | FromDiscord | <Phil> In reply to @d4rckh "hello!": Heya |
19:59:22 | * | d4rckh quit () |
20:20:30 | FromDiscord | <answer> how do i run `nim check` with a specific backend like `js`? i can't seem to figure out the flag |
20:23:28 | FromDiscord | <domosokrat> try `nim check --backend:js` |
20:24:04 | FromDiscord | <answer> yep that worked thanks |
20:47:24 | FromDiscord | <enthus1ast> does one know if the the nim.tmLanguage syntax hightlighter is hand crafted? |
20:47:33 | FromDiscord | <enthus1ast> or is there a tool i could use to streamline |
20:47:38 | FromDiscord | <enthus1ast> @Varriount\: maybe? |
20:48:08 | FromDiscord | <Varriount> What do you mean by hand-crafted? |
20:48:21 | FromDiscord | <Varriount> It's not generated by the Nim compiler, if that's what you're asking. |
20:48:35 | FromDiscord | <Varriount> (edit) "compiler," => "compiler (or any other tool)," |
20:48:38 | FromDiscord | <enthus1ast> i meant, so its fully written by hand? |
20:48:40 | FromDiscord | <enthus1ast> ah ok |
20:48:59 | FromDiscord | <enthus1ast> oh boy |
21:02:30 | * | alice joined #nim |
22:10:22 | * | vicecea quit (Remote host closed the connection) |
22:10:53 | * | vicecea joined #nim |
22:27:01 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
22:31:17 | * | Lord_Nightmare joined #nim |
22:38:17 | FromDiscord | <m4ul3r> In reply to @iAmNotAfraidofSpiders "Yeah, that's all I": Were you ever able to get async docker working? ↵It hasn't been updated in a few years, and I tried making changes to get it working by no dice |
23:20:28 | NimEventer | New thread by Xioren: Need some direction on macros., see https://forum.nim-lang.org/t/9389 |