00:06:22 | * | NimBot joined #nim |
00:08:47 | * | luis quit (Quit: luis) |
00:21:44 | * | krux02 quit (Remote host closed the connection) |
00:28:12 | FromGitter | <gogolxdong> Did something change in db_mysql , query in rawExec escape punctuation like `@` and `.`. |
00:29:32 | FromGitter | <gogolxdong> which got nothing from query. |
00:31:25 | leorize[m] | nope, db_mysql code for rawExec hasn't been changed in 3 years |
00:35:23 | FromGitter | <gogolxdong> after inserting into sql ? placeholder , [email protected], became `cloudfastnet\64cncarecc\46com` |
00:35:24 | * | luis joined #nim |
00:35:45 | * | hyiltiz joined #nim |
00:35:45 | * | hyiltiz quit (Changing host) |
00:35:45 | * | hyiltiz joined #nim |
00:35:59 | * | hyiltiz quit (Client Quit) |
00:41:05 | * | luis quit (Quit: luis) |
00:46:19 | * | hyiltiz joined #nim |
00:46:20 | * | hyiltiz quit (Changing host) |
00:46:20 | * | hyiltiz joined #nim |
00:47:01 | * | TomDotTom joined #nim |
00:47:43 | FromDiscord | <exelotl> Term rewriting macros and converters go hand in hand. A cool use case I found on the GBA: I have two very similar types (one with padding which is used by the hardware, one without padding which I do my useful work with)↵I can use a converter + custom assignment operator to make the two types interchangeable, and then use term a rewriting macro to eliminate the cost of the implicit function calls |
00:48:03 | FromDiscord | <exelotl> (edit) 'Term rewriting macros and converters go hand in hand. A cool use case I found on the GBA: I have two very similar types (one with padding which is used by the hardware, one without padding which I do my useful work with)↵I can use a converter + custom assignment operator to make the two types interchangeable, and then use ... term' => 'Term rewriting macros and converters go hand in hand. A cool use case I found on the GBA: I ha |
00:49:01 | disruptek | term rewriting macros can do ridiculous stuff. they just don't make any sense, imo. |
00:49:31 | disruptek | i mean, i think it's the wrong way. too magical to work with. |
00:49:31 | * | luis joined #nim |
00:55:18 | FromDiscord | <exelotl> They're ripe for misuse but i'm happy they exist |
01:01:51 | FromDiscord | <exelotl> As in they allow me to do some (legitimately useful) low-level GBA things that I previously thought were impossible because it would require a {.writeonly.} pragma or break the semantics of the `=` operator |
01:03:50 | FromDiscord | <exelotl> So if term rewriting macros were to go away I would start asking for weird one-off features |
01:13:13 | FromDiscord | <juan_carlos> term rewriting is cool, used it for compile time translations. |
01:13:18 | * | Tanger joined #nim |
01:24:01 | * | luis quit (Quit: luis) |
01:32:01 | * | TomDotTom quit (Ping timeout: 264 seconds) |
01:32:42 | * | apahl_ joined #nim |
01:35:38 | * | apahl quit (Ping timeout: 256 seconds) |
01:36:08 | * | rockcavera joined #nim |
01:39:32 | * | luis joined #nim |
01:41:10 | Prestige | Can someone shed light on why this can't be invoked without converting Player to AnimatedActor? https://i.imgur.com/tNyKgbu.png |
01:41:34 | Prestige | I thought since Player extends AnimatedPlayer, and I'm using a method, it would work |
01:47:50 | * | luis quit (Read error: Connection reset by peer) |
01:52:34 | FromDiscord | <Elegant Beef> Actor is accessible from that file right? |
01:53:30 | FromDiscord | <Rika> oh yeah, the base classes have to be exported and accessible in all files |
01:53:41 | FromDiscord | <Elegant Beef> It seems it is, but just double checking |
01:53:42 | FromGitter | <gogolxdong> Author: Bung <[email protected]> ⏎ Date: Fri Sep 4 17:04:27 2020 +0800 ⏎ ⏎ ```Fix #15219 SQL escape in db_mysql is not enough (#15234)``` [https://gitter.im/nim-lang/Nim?at=5f8508a607361f0cc64a34e3] |
01:53:44 | disbot | https://github.com/nim-lang/Nim/pull/15234 -- 6Fix #15219 SQL escape in db_mysql is not enough |
01:54:22 | FromGitter | <gogolxdong> I think this causes some regression about special punctuation escape. |
01:55:32 | * | mnafees joined #nim |
01:55:49 | mnafees | Is https://nim-lang.github.io/ the docs for the upstream git repo? |
01:56:09 | FromDiscord | <Elegant Beef> Prestige i believe the issue is the `var` removing it makes it work |
01:56:10 | Prestige | @Elegant Beef yeah I'm importing it in player.nim |
01:56:26 | Prestige | hm |
01:56:29 | mnafees | I want to use https://nim-lang.github.io/Nim/bitops.html#bitsliced%2CT%2CSlice%5Bint%5D but it does not exist in the Nim system install I have rn (ver 1.2.6) |
01:57:09 | Prestige | interesting - it was originally a proc so it needed var, but doesn't as a method. Pretty neat actually |
01:57:13 | Prestige | ty beef |
01:57:18 | FromDiscord | <Elegant Beef> Well no it's a reference type |
01:57:20 | FromDiscord | <Elegant Beef> https://nim-lang.org/docs/bitops.html |
01:57:24 | FromDiscord | <Elegant Beef> Actual docs mnafees |
01:58:28 | FromDiscord | <Elegant Beef> https://play.nim-lang.org/#ix=2AxS See prestiege reference types are currently(atleast for now) mutable inheritely https://play.nim-lang.org/#ix=2AxS |
01:58:31 | FromDiscord | <Elegant Beef> I'm dome |
01:58:44 | FromDiscord | <Elegant Beef> Pasting the link twice, big brain |
01:58:52 | FromDiscord | <Rika> hello dome |
01:58:52 | Prestige | haha |
01:58:57 | mnafees | Thanks @Elegant Beef |
01:59:04 | FromDiscord | <Elegant Beef> No problem |
01:59:21 | FromDiscord | <Rika> elegant beef beef |
01:59:27 | mnafees | I got overjoyed when I found that bitops proc but I guess I'll have to make do without it for now :/ |
01:59:47 | FromDiscord | <Elegant Beef> It's cause my name has a space in it and ircord isnt done in a way to remove any redundancies |
02:00:03 | FromDiscord | <Elegant Beef> I mean you could always `choosenim devel` |
02:00:32 | mnafees | See, I was thinking about something on those lines. Thanks! (Nim newbie here) |
02:00:56 | FromDiscord | <Elegant Beef> I still consider myself a nim newbie so... 😛 |
02:01:00 | FromDiscord | <Rika> beef i know i was making a joke |
02:01:03 | FromDiscord | <Elegant Beef> But yea those are docs for 1.3.7 |
02:01:05 | FromDiscord | <Rika> ok noob |
02:01:14 | FromDiscord | <Elegant Beef> I wasnt certain if you knew why they were doing it |
02:01:17 | FromDiscord | <Elegant Beef> One name person here |
02:01:31 | FromDiscord | <Rika> would you like me to add spaces in my name |
02:01:40 | FromDiscord | <Elegant Beef> I mean you do you |
02:01:49 | FromDiscord | <Rika> how lewd |
02:02:03 | * | mnafees quit (Remote host closed the connection) |
02:02:40 | FromDiscord | <Elegant Beef> *Opens up reddit sees a "Nim is just amazing" post, nods head* |
02:02:57 | FromDiscord | <Rika> 👌 |
02:03:14 | FromDiscord | <Elegant Beef> https://www.reddit.com/r/nim/comments/ja3umq/nim_is_just_amazing/ If anyone is interested in reading the praise 😛 |
02:04:39 | * | luis joined #nim |
02:05:48 | Prestige | "and don't get me started on Rust and its syntax" yep lol |
02:07:14 | FromDiscord | <Rika> rust syntax be *pain* |
02:07:31 | FromDiscord | <Elegant Beef> I've never wrote rust, i've seen the symbol laden nature and never really wanted to |
02:08:41 | FromDiscord | <Rika> "praise the turbofish" xd |
02:09:57 | FromDiscord | <Elegant Beef> The `addr` and `ptr` keywords make me happy for that reason, but i'm sure if i actually attempted to learn something that used `*` or `&` i might not regret my existance 😄 |
02:12:05 | * | luis quit (Quit: luis) |
02:12:18 | * | luis joined #nim |
02:15:06 | * | Senketsu quit (Quit: WeeChat 2.9) |
02:21:23 | * | Senketsu joined #nim |
02:28:59 | * | vicfred_ joined #nim |
02:31:36 | * | vicfred quit (Ping timeout: 272 seconds) |
02:42:27 | * | luis quit (Quit: luis) |
02:42:41 | * | luis joined #nim |
02:43:25 | * | muffindrake quit (Ping timeout: 240 seconds) |
02:45:50 | * | muffindrake joined #nim |
02:53:37 | * | Senketsu quit (Quit: WeeChat 2.9) |
02:57:36 | * | luis quit (Read error: Connection reset by peer) |
03:35:01 | * | bunbunbunbunny quit (Quit: Lost terminal) |
03:37:02 | * | luis joined #nim |
03:50:57 | * | rockcavera quit (Remote host closed the connection) |
04:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:34 | * | supakeen joined #nim |
04:12:42 | FromGitter | <gogolxdong> @ehmry are you there |
04:13:56 | FromGitter | <gogolxdong> What's the name of this ⣶⢖⠻⡜⡄⡄⢡⣚⠁⠾⣠⡷⠁⢬⣸⢥⠰⣄⠿⡳⣘⠤⡤⢛ or something like that? |
04:14:50 | FromDiscord | <Rika> braille |
04:17:03 | FromGitter | <gogolxdong> How to calculate and print? |
04:19:40 | * | vicfred_ quit (Quit: Leaving) |
04:20:23 | * | opal quit (Ping timeout: 240 seconds) |
04:23:01 | FromGitter | <gogolxdong> Why uses braille as file identifier? |
04:23:24 | * | opal joined #nim |
04:32:22 | * | luis quit (Quit: luis) |
04:57:09 | * | luis joined #nim |
05:10:36 | * | solitudesf joined #nim |
05:14:46 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:14:49 | FromGitter | <gogolxdong> Is there a way to get filename from a AsyncFile variable? |
05:25:08 | leorize[m] | I don't think so |
05:28:47 | * | vicfred joined #nim |
05:32:24 | FromGitter | <gogolxdong> seems so. |
05:35:09 | * | luis quit (Ping timeout: 272 seconds) |
05:45:45 | * | vicfred quit (Ping timeout: 256 seconds) |
05:49:49 | * | narimiran joined #nim |
05:59:18 | * | arecacea1 quit (Remote host closed the connection) |
06:00:05 | * | arecacea1 joined #nim |
06:05:56 | * | PMunch joined #nim |
06:08:04 | PMunch | Prestige, you on? |
06:08:54 | Prestige | hey PMunch |
06:09:25 | PMunch | Hi, I see you had some trouble getting colours to work with my PR |
06:09:31 | PMunch | How did you try to set them? |
06:10:17 | Prestige | I was attempting to set the status with the ansi codes inside the string, using xsetroot |
06:10:31 | PMunch | Ah yes, that doesn't work |
06:10:38 | PMunch | You need to do something like this: xsetroot -name "$(echo "Hello \e[31mworld\e[0m")" |
06:10:46 | Prestige | ah I see |
06:10:52 | Prestige | I'll try that out |
06:10:53 | PMunch | xsetroot by itself doesn't treat \e as the escape character |
06:12:02 | * | luis joined #nim |
06:12:05 | Prestige | PMunch: works, that's pretty neat :) |
06:13:09 | PMunch | Yay :) And yeah, it's a pretty neat feature |
06:13:33 | PMunch | You can also use the 8-bit and 24-bit versions |
06:14:35 | Prestige | I wonder if there's a way we could make it easier for users to generate the status with colors |
06:14:44 | Prestige | maybe a tool exists already |
06:14:59 | PMunch | Currently the 3/4 bit versions are based on the xterm colours, I was thinking about actually reading .Xresources to get the correct colours from your shell, but I didn't know if you wanted that or not |
06:15:10 | PMunch | What do you mean? |
06:15:58 | Prestige | have xresources support would be pretty awesome. I mean a way for people to easily generate colors by name, or something |
06:16:12 | Prestige | I think polybar allows hex or color names |
06:16:20 | PMunch | Ah right |
06:16:36 | Prestige | maybe outside the scope of the PR |
06:17:08 | PMunch | I based it off-of the ANSI colours as they are sort of ubiquitous in terminal applications, so piping something to xsetroot should preserve colours |
06:17:40 | PMunch | And since it has 24-bit support it's much easier to generate than hex colours from a bash script.. |
06:18:31 | Prestige | Yeah - I'll approve it. I think I should add a section in the readme giving examples and resources |
06:19:32 | Prestige | PMunch: btw, did you see I recently added support for tags? You can now view multiple tags at once, and can assign a window to multiple tags |
06:20:26 | PMunch | Feel free to add the hacktoberfest-accepted label to the PR or the hacktoberfest topic to your repo as well by the way :) I'm only missing a single PR to get the tshirt :P |
06:20:46 | PMunch | You can view multiple tags at once? |
06:20:49 | PMunch | How does that work? |
06:21:17 | Prestige | It will find all windows of the selected tags, and they are processed by the layout |
06:21:23 | PMunch | And what happens if you watch two tags with the same window in it? |
06:21:36 | Prestige | It only shows once |
06:21:38 | PMunch | Aah right, so they all get put in the same layout |
06:22:03 | * | opal quit (Ping timeout: 240 seconds) |
06:25:52 | * | opal joined #nim |
06:26:36 | PMunch | Prestige, see the variables section here: https://codeburst.io/colorize-your-shell-commands-without-any-libraries-or-plugins-2cd4a264a17e |
06:26:44 | PMunch | That's one way to make it easier |
06:28:14 | Prestige | I think I'll write something similar on the wiki, and link to it from the readme. Thanks |
06:28:39 | * | user0 joined #nim |
06:43:57 | PMunch | A simple script like this can also help convert hex colours into an ansi escape sequence: http://ix.io/2AyH |
06:44:27 | PMunch | (Might not work in your terminal if it doesn't have 24-bit colour support, but it should work with my nimdow colour patch) |
06:47:00 | Prestige | I wrote up https://github.com/avahe-kellenberger/nimdow/wiki/Setting-the-status hopefully that will be enough to get the point across |
06:47:22 | Prestige | oh I need to change that |
06:54:45 | PMunch | Why are you setting 1 there? |
06:54:54 | PMunch | That is bold, which is not (currently) supported |
06:57:00 | PMunch | Now I just need to update nimdow on this machine :P |
06:57:16 | PMunch | Does the refresh use the new binary if I replace it? |
06:57:33 | Prestige | nah it just reloads the config |
06:57:54 | PMunch | Hmm okay |
06:57:59 | PMunch | Guess it's time for a reboot then |
06:59:13 | PMunch | Did you add the floating window default for certain windows by the way? |
06:59:50 | Prestige | Not per user configuration, just based on window properties |
07:01:06 | Prestige | I forgot if that's something you'd requested, I track everything through github issues |
07:01:13 | PMunch | Hmm, based on windows properties? |
07:02:17 | Prestige | Yeah, like if it's a dialog or if the window requests the same min and max size |
07:02:55 | * | apahl_ quit (Ping timeout: 240 seconds) |
07:03:18 | PMunch | Hmm |
07:03:35 | PMunch | Same min and max as what? |
07:03:54 | * | apahl joined #nim |
07:04:42 | PMunch | Problem is that I use xlunch in a windowed mode as a system menu and I need it to float when it is opened |
07:04:48 | Prestige | I call XGetWMNormalHints and check if min_width and max_width are the same, and same for the height |
07:05:23 | Prestige | ah hmm I wonder what it is doing to try to be floating |
07:05:43 | Prestige | I added logging, so we should be able to figure it out |
07:06:25 | PMunch | Well it does set a class hint |
07:06:34 | PMunch | Which is how I detected it in i3 |
07:06:55 | Prestige | ah so i3 didn't handle it either? |
07:07:07 | Prestige | Maybe we should submit a pr to xlunch |
07:07:25 | PMunch | well I'm a maintainer, so no need for me to PR :P |
07:08:10 | PMunch | Well i3 will force every window to stack, unless you've specified otherwise in the config |
07:08:13 | Prestige | if you set _NET_WM_WINDOW_TYPE_DIALOG or have min/max sizes the same, it will be floating |
07:08:21 | Prestige | ah interesting |
07:09:10 | PMunch | I have this rule in my i3 config: for_window [class="xlunch-windowed"] floating enable border none |
07:09:14 | Prestige | https://github.com/avahe-kellenberger/nimdow/blob/master/src/nimdowpkg/windowmanager.nim#L774 and line 786 |
07:09:27 | PMunch | It's not really a dialog though.. |
07:09:46 | Prestige | can request a specific size? |
07:09:50 | Prestige | That's what most do |
07:10:06 | PMunch | Well I can (and do) request a specific size |
07:13:08 | Prestige | hm how are you setting it? I think you could use https://tronche.com/gui/x/xlib/ICC/client-to-window-manager/XSetWMNormalHints.html |
07:13:21 | PMunch | Hmm, xlunch doesn't set WM_SIZE_HINTS at all it seems |
07:14:00 | PMunch | Currently it just specifies size by its call to XCreateWindow https://tronche.com/gui/x/xlib/window/XCreateWindow.html |
07:14:23 | Prestige | ah okay, yeah I just look at the size hints |
07:14:50 | PMunch | Do you consider x and y position when placing floats? |
07:15:10 | Prestige | Yeah, if it's 0,0 I center the window though |
07:15:12 | Prestige | iirc |
07:15:38 | PMunch | Hmm, okay |
07:15:48 | Prestige | hm I lied, I think I always center it |
07:15:55 | PMunch | Ah.. |
07:16:07 | PMunch | Then having floating for xlunch wouldn't help anyways |
07:16:52 | Prestige | well, I'll look into it tomorrow if you want. I should change that behavior, but I know some floating windows aren't centered... |
07:17:02 | Prestige | ah probably the dialogs |
07:17:23 | Prestige | If you implement the size hints I'll fix the centering issue tomorrow |
07:18:33 | Prestige | It's actually going to be a single if statement on line 791 I think |
07:18:43 | Prestige | Anyway, gn PMunch thanks for the PR :) |
07:21:02 | * | luis quit (Read error: Connection reset by peer) |
07:21:53 | PMunch | No problem :) |
07:27:43 | * | ehmry joined #nim |
07:50:36 | FromDiscord | <neow> what is the general solution when you need type a to have a field of type b, but you need type b to have a field of type a |
07:52:29 | FromDiscord | <Rika> you need one of the types to be a ref type in that case |
07:52:48 | FromDiscord | <Rika> putting them in the same type block will make them able to reference each other |
07:54:52 | FromDiscord | <neow> yes, one of them is indeed a ref, but I'd like to avoid putting them into the same type block |
07:55:10 | FromDiscord | <neow> I'm really weighing inheritance or generics, but I'd like to hear from more experienced people |
07:55:25 | FromDiscord | <Rika> they must be in the same type block |
07:56:14 | FromDiscord | <neow> but if I make it generic, and use the one single type in every single use case, I wouldn't |
07:56:31 | FromDiscord | <neow> but it'd feel hacky |
07:56:33 | FromDiscord | <Rika> yes, but i dont see the reason to do so |
07:56:40 | FromDiscord | <neow> I want to keep them in different modukes |
07:56:44 | FromDiscord | <neow> (edit) 'modukes' => 'modules' |
07:57:00 | FromDiscord | <Rika> is there no way to make them not dependent on each other |
07:57:21 | FromDiscord | <neow> probably create a base class and every time I access the field convert back? |
07:57:25 | FromDiscord | <neow> or generics |
07:58:00 | FromDiscord | <haxscramper> Or is it really necessary to put this in different modules? I'd recommend putting all types in once place anyway, especially when you have case like this - e.g. file organization should not really affect program design so much |
07:58:03 | FromDiscord | <Rika> do you have more details on what kind of types these are? |
08:00:27 | FromDiscord | <neow> yes, statement and expression types for syntax |
08:01:19 | FromDiscord | <neow> statement heavily depends on expression, but I was about to add anonymous functions as expressions... which would have a block of statements as one of the fields |
08:01:44 | FromDiscord | <neow> > Or is it really necessary to put this in different modules? I'd recommend putting all types in once place anyway, especially when you have case like this - e.g. file organization should not really affect program design so much↵@haxscramper probably not a bad idea to have a types.nim module |
08:01:46 | FromDiscord | <haxscramper> You are writing programming language (something similar) and decided to use separate types/inheritance? |
08:02:04 | FromDiscord | <neow> two separate types for expr and stmt |
08:02:13 | FromDiscord | <neow> for a parser |
08:02:58 | FromDiscord | <haxscramper> I **highly** recommend using heterogeneous AST instead, based on single case object. I found it much easier to work with in the long run - works with pattern matching, you get very uniform tree operations etc. A little more runtime checks for node types but that is probably not that bad. |
08:03:44 | FromDiscord | <neow> a single node object, and code modelled as a list of nodes? |
08:04:18 | FromDiscord | <haxscramper> Basically yes, for example look at how `NimNode` is defined - I usually do the same for all AST-like types |
08:04:40 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
08:10:04 | FromDiscord | <neow> I see |
08:10:22 | FromDiscord | <neow> I'm looking at Nim/doc/astspec.txt |
08:11:56 | * | lum quit (Quit: WeeChat 2.9) |
08:12:39 | * | lum joined #nim |
08:14:49 | * | bung joined #nim |
08:15:14 | * | leorize quit (Remote host closed the connection) |
08:15:35 | FromDiscord | <mratsim> @neow you might find this repo interesting: https://github.com/mratsim/compute-graph-optim I explore step by step my own custom AST (note that i wanted it to work at both runtime and compile-time which prevented me from using inheritance/methods for example) |
08:15:48 | * | leorize joined #nim |
08:15:53 | * | leorize quit (Remote host closed the connection) |
08:16:13 | bung | how to pass a string by offset to a proc accept openArray[byte], need copy ? |
08:16:35 | * | leorize joined #nim |
08:16:57 | FromDiscord | <mratsim> no |
08:16:59 | bung | the string is not need anymore |
08:17:21 | FromDiscord | <mratsim> I think toOpenArray works on string no? |
08:18:06 | * | luis joined #nim |
08:18:45 | FromDiscord | <mratsim> otherwise cast[ptr byte](foo[0].addr).toOpenArray(foo.len-1).toOpenArray(offSetStart, offsetStop) 😄 |
08:19:08 | FromDiscord | <mratsim> and then open a RFC to make openarray/slicing more sane |
08:19:47 | FromDiscord | <mratsim> anyway not sure it's exactly that but this gives you the general idea, cast t, convert ptr to openarray, slice the openarray |
08:20:06 | lum | italic |
08:20:43 | lum | italic |
08:23:38 | * | lum quit (Quit: WeeChat 2.8) |
08:25:54 | * | lum joined #nim |
08:26:22 | bung | ok , thanks ! let me try |
08:27:48 | * | luis quit (Quit: luis) |
08:28:01 | * | luis joined #nim |
08:37:44 | * | lum quit (Quit: WeeChat 2.8) |
08:44:25 | FromDiscord | <tomck> Hello - do exceptions have any performance implications when not using them? or do I need to explicitly disable? |
08:46:28 | bung | I need put the cast directly to the proc param? |
08:47:02 | bung | Error: invalid type: 'openArray[byte]' for var |
08:47:07 | FromDiscord | <Elegant Beef> I could be wrong but i believe a release build doesnt have exceptions or assertions enabled |
08:47:17 | bung | seems cant store it to a variable |
08:51:28 | * | Vladar joined #nim |
08:53:47 | FromDiscord | <Rika> @Elegant Beef exceptoins are enabled |
08:53:59 | FromDiscord | <Elegant Beef> Ah my bad 😄 |
08:54:18 | FromDiscord | <Rika> you must turn on panics (--panics:on) and even then only defect exceptions are disabled; catchables can still be caught |
08:54:50 | FromDiscord | <Elegant Beef> Yea now that i actually think about it, it'd be pretty dumb to toggle off exceptions |
08:55:13 | FromDiscord | <Rika> you can only avoid exceptions by using functions that do not use them |
08:55:31 | FromDiscord | <Rika> (afaik.) |
08:55:56 | FromDiscord | <Rika> maybe not catching them at all will also yield negligible performance loss |
08:56:07 | FromDiscord | <Rika> but when you do catches your performance dies |
08:57:57 | * | luis quit (Read error: Connection reset by peer) |
09:04:08 | FromGitter | <gogolxdong> Flutter supports desktop now. |
09:04:44 | FromGitter | <gogolxdong> I think Google will buy Nim and discard dart. |
09:08:33 | * | lum joined #nim |
09:09:38 | FromDiscord | <Elegant Beef> Hope not google's bad with languages |
09:10:05 | FromDiscord | <tomck> Google will buy nim in favour of dart? for flutter? |
09:10:26 | FromDiscord | <tomck> Can you use nim w/ flutter currently? |
09:11:13 | * | lum quit (Client Quit) |
09:11:34 | * | lum joined #nim |
09:11:48 | * | fredrikhr8 joined #nim |
09:14:08 | FromGitter | <gogolxdong> No, so it's I think(hope). We need to run IPFS server on mobile phone, better with a GUI to add file. |
09:15:20 | * | fredrikhr quit (Ping timeout: 260 seconds) |
09:15:21 | * | fredrikhr8 is now known as fredrikhr |
09:16:55 | FromDiscord | <mratsim> @Bung you should be able to store a ptr in a variable but I would need more code to help you debug |
09:19:31 | * | luis joined #nim |
09:20:55 | bung | I declare it as var b:openArray[byte] |
09:22:00 | * | lum quit (Quit: WeeChat 2.8) |
09:22:18 | * | lum joined #nim |
09:23:48 | * | Tanger quit (Quit: Leaving) |
09:24:41 | * | lum quit (Client Quit) |
09:26:34 | * | lum joined #nim |
09:28:39 | * | lum quit (Client Quit) |
09:31:22 | bung | I pass casting directly it works |
09:32:39 | * | luis quit (Read error: Connection reset by peer) |
09:32:59 | * | lum joined #nim |
09:36:41 | FromDiscord | <mratsim> you can store an openarray |
09:36:49 | FromDiscord | <mratsim> but you can store the cast to ptr |
09:36:56 | FromDiscord | <mratsim> can't |
09:44:21 | FromDiscord | <Recruit_main707> where does that cant go though :p |
09:44:51 | * | arecacea1 quit (Ping timeout: 265 seconds) |
09:47:44 | bung | hmm, hard to implement mysql protocol compression, never use that feature.. |
09:48:02 | Oddmonger | i have an array of objects , and i'd like to initialize only some members of each object, is it possible on a one-liner ? |
09:51:43 | Oddmonger | something like this: https://play.nim-lang.org/#ix=2Azf |
09:52:58 | Oddmonger | otherwise, i'll have to make a loop to fill |
09:54:38 | FromDiscord | <Rika> if you wanted one line, its going to be a really really long line |
09:54:43 | FromDiscord | <Rika> go with the loop imo |
09:55:21 | * | noonien joined #nim |
09:55:30 | * | lum quit (Ping timeout: 256 seconds) |
09:57:05 | * | lum joined #nim |
09:58:00 | Oddmonger | ok that's clear speak :) |
09:58:25 | Oddmonger | go for the loop then, thank you |
10:04:34 | * | lum quit (Quit: WeeChat 2.8) |
10:04:45 | * | PMunch quit (Quit: Leaving) |
10:04:52 | * | lum joined #nim |
10:17:35 | * | PMunch joined #nim |
10:18:36 | * | newUser joined #nim |
10:19:43 | * | opal quit (Ping timeout: 240 seconds) |
10:20:37 | * | narimiran quit (Ping timeout: 264 seconds) |
10:23:00 | * | PMunch quit (Quit: Leaving) |
10:23:30 | newUser | Hi, I have an include folder with .h and .nim (.h with c2nim converted) files. My project in another folder should import the header and the nim files from include. I have set the --cincludes: and for searching the nim files --path:. It works, but is it the correct way? |
10:23:49 | * | PMunch joined #nim |
10:25:11 | newUser | if I not use --path: gcc will not find the converted files and I must copy them into the project file. |
10:25:25 | newUser | folder |
10:29:48 | * | luis joined #nim |
10:38:53 | * | luis quit (Quit: luis) |
10:52:36 | * | opal joined #nim |
10:54:54 | * | luis joined #nim |
10:58:07 | bung | does your .h all convert to pure nim ? |
10:58:24 | bung | if yes , I dont think you need .h anymore |
11:00:52 | bung | if you wraps .h you just use `{.importc: "printf", varargs, header: "<stdio.h>".}` |
11:01:48 | bung | where header: you can put your .h path as const string |
11:03:14 | federico3 | fragmenting the community even further? Meh https://forum.nim-lang.org/t/6915 |
11:04:33 | * | luis quit (Read error: Connection reset by peer) |
11:04:39 | FromDiscord | <Rika> its inevitable if you want to become large |
11:06:04 | newUser | bung: I must {.importc the header files |
11:07:15 | newUser | bung: ups, no I don't import them, I didn't saw the '#' |
11:10:52 | bung | in any case you can just do that in code put absolute file path |
11:11:09 | newUser | bung: I have converted with c2nim the header files, so get a nim file. In the nim file I have: {.push importc, header: "****.h", discardable.} |
11:11:55 | newUser | and in the project folder I import only the nim files, which I have left in the include folder |
11:11:58 | * | mmohammadi981266 joined #nim |
11:12:04 | * | mmohammadi981266 quit (Client Quit) |
11:12:46 | bung | you can just put constant file path to header: |
11:12:52 | * | luis joined #nim |
11:13:25 | newUser | in --path: (I have a build.sh) I have the include path for the nim files |
11:13:49 | newUser | 'you can just put constant file path to header:', how? |
11:14:08 | * | mmohammadi981266 joined #nim |
11:14:22 | bung | like this https://github.com/bung87/zstd/blob/master/src/zstd/common.nim |
11:14:26 | * | mmohammadi981266 quit (Client Quit) |
11:19:50 | FromDiscord | <neow> > @neow you might find this repo interesting: https://github.com/mratsim/compute-graph-optim I explore step by step my own custom AST (note that i wanted it to work at both runtime and compile-time which prevented me from using inheritance/methods for example)↵@mratsim Thanks a lot! I'll take a look a it! You mention Laser, is Laser a big deal? |
11:19:58 | FromDiscord | <neow> I've seen it pop up several time |
11:20:02 | FromDiscord | <neow> (edit) 'time' => 'times' |
11:20:44 | FromDiscord | <neow> also, the code is divided into episodes? Is this a blog/vid series? I'll have to find the link |
11:23:24 | * | mmohammadi981266 joined #nim |
11:23:53 | * | mmohammadi981266 quit (Client Quit) |
11:25:07 | * | lum quit (Ping timeout: 246 seconds) |
11:27:33 | newUser | bung: If I understand it correct, I don't need c2nim, but a nim file with compile commands? |
11:30:00 | * | luis quit (Quit: luis) |
11:30:09 | * | luis joined #nim |
11:32:07 | * | rockcavera joined #nim |
11:32:58 | bung | you can do it without c2nim, c2nim convert and wraps automanticlly ? I dont remenber, never use it |
11:35:16 | * | lum joined #nim |
11:35:58 | * | dv-^_^6193923289 quit (Ping timeout: 246 seconds) |
11:36:27 | newUser | I have added to the converted file: at start {.push importc, header: include_path, discardable.} and at the end {.pop.} |
11:38:02 | newUser | and have to look for some bad converted lines, for example c2nim convert a division sign '/' to '//', that's all for me |
11:38:36 | newUser | your solution will compiles every time the c files? |
11:39:06 | newUser | I have forgotten, I have a lib file to the c include files. |
11:41:37 | * | krux02 joined #nim |
11:41:43 | newUser | my solution works, but I only wanted to know if the --path:include_path the correct way is, to search for nim files |
11:42:05 | FromDiscord | <mratsim> > @mratsim Thanks a lot! I'll take a look a it! You mention Laser, is Laser a big deal?↵@neow It's my research repo on high performance computing |
11:42:29 | newUser | I must have additional: --cincludes:include_path for the header files |
11:42:53 | * | luis quit (Ping timeout: 246 seconds) |
11:45:09 | * | luis joined #nim |
11:54:52 | * | lum quit (Ping timeout: 265 seconds) |
11:56:25 | * | newUser quit (Remote host closed the connection) |
12:03:20 | * | kwilczynski quit (Ping timeout: 260 seconds) |
12:04:23 | * | kwilczynski joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:37 | * | supakeen joined #nim |
12:08:17 | * | Kaivo joined #nim |
12:09:22 | bung | @newUser it works indeed, for project that's fine, as you have build.sh |
12:10:33 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2AzU |
12:10:39 | bung | for a lib you'll need note your comple flags somewhere |
12:10:50 | * | luis quit (Read error: Connection reset by peer) |
12:10:59 | * | luis joined #nim |
12:11:09 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=2AzV |
12:12:01 | bung | @newUser nim has compiled file cache dont worry about it |
12:12:25 | * | lum joined #nim |
12:12:28 | FromDiscord | <Clyybber> @flywind generates invalid C for me |
12:12:34 | FromDiscord | <Clyybber> can you open an issue for it? |
12:12:45 | FromDiscord | <flywind> I will report it. |
12:20:01 | * | luis quit (Quit: luis) |
12:20:14 | * | luis joined #nim |
12:26:22 | * | TomDotTom joined #nim |
12:36:36 | * | luis quit (Quit: luis) |
12:36:45 | * | luis joined #nim |
12:40:39 | * | mmohammadi981266 joined #nim |
12:46:19 | * | mmohammadi981266 quit (Quit: I quit (╯°□°)╯︵ ┻━┻) |
12:49:20 | * | mmohammadi981266 joined #nim |
12:52:09 | * | rockcavera is now known as Guest18463 |
12:52:09 | * | tiorock joined #nim |
12:52:09 | * | Guest18463 quit (Killed (card.freenode.net (Nickname regained by services))) |
12:52:09 | * | tiorock is now known as rockcavera |
12:59:00 | * | lum quit (Quit: WeeChat 2.8) |
13:20:39 | * | mmohammadi981266 quit (Quit: I quit (╯°□°)╯︵ ┻━┻) |
13:21:16 | * | luis quit (Quit: luis) |
13:32:51 | * | luis joined #nim |
13:51:00 | * | mmohammadi981266 joined #nim |
13:52:50 | * | lritter joined #nim |
14:03:08 | FromDiscord | <Ricky Spanish> can you use multiple getheader() with nimterop? |
14:05:13 | * | PMunch quit (Quit: Leaving) |
14:11:02 | * | mmohammadi981266 quit (Quit: I quit (╯°□°)╯︵ ┻━┻) |
14:13:50 | FromDiscord | <lqdev> yeah |
14:13:52 | * | mmohammadi981266 joined #nim |
14:13:55 | FromDiscord | <lqdev> why wouldn't you? |
14:16:38 | FromDiscord | <Ricky Spanish> iv no idea i just didnt see any examples of doing it |
14:17:06 | FromDiscord | <Ricky Spanish> i seen only 1 header to 1 dll example basically |
14:17:38 | FromDiscord | <Ricky Spanish> anyway thanks @lqdev |
14:26:44 | * | mmohammadi981266 quit (Quit: Ping timeout (120 seconds)) |
14:27:37 | * | mmohammadi981266 joined #nim |
14:35:39 | FromDiscord | <Ricky Spanish> getting a few type issues when using nimterop with vcc code basically ```# const 'ORT_API_CALL' has unsupported value '_stdcall'↵# const 'ORTCHAR_T' has unsupported value 'wchar_t'``` it doesent like these types for obvious reasons, is there a simple way to pattern match and replace _stdcall with __cdecl? like this ``` proc onSymbol*(sym: var Symbol) {.exportc, dynlib.} =↵ sym.name = sym.name.strip(chars={'_'}).replace("__", |
14:35:54 | FromDiscord | <Ricky Spanish> (edit) removed '```' | 'proc' => '```proc' | '"_")```?' => '"_")``` ?' |
14:36:20 | FromDiscord | <Ricky Spanish> (edit) '=↵ ' => '=' |
14:39:32 | * | luis quit (Quit: luis) |
14:46:32 | * | lum joined #nim |
14:46:34 | * | luis joined #nim |
14:49:42 | * | mmohammadi981266 quit (Read error: Connection reset by peer) |
14:58:49 | * | waleee-cl joined #nim |
15:10:02 | * | hnOsmium0001 joined #nim |
15:12:54 | * | gmaggior joined #nim |
15:16:01 | * | luis quit (Quit: luis) |
15:19:06 | * | narimiran joined #nim |
15:23:14 | Zevv | hello hello @treeform |
15:25:57 | Yardanico | hello hello can you hear me |
15:25:59 | Yardanico | https://www.youtube.com/watch?v=wJnBTPUQS5A |
15:29:08 | FromGitter | <ynfle> > Objects that have no ancestor are implicitly final and thus have no hidden type field. ⏎ Can someone tell me what *no hidden type field* means? |
15:30:52 | Yardanico | runtime type for methods |
15:30:57 | Yardanico | for dynamic dispatch |
15:33:54 | * | user0 quit (Remote host closed the connection) |
15:36:28 | * | lum quit (Quit: WeeChat 2.8) |
15:41:54 | FromDiscord | <exelotl> ynfle: taking a look at the generated C code, you can see that inheriting from RootObj produces a struct with runtime type info (the "Sup" field): https://pastebin.com/raw/zvXwGNmn |
15:44:13 | FromDiscord | <Noobi> Hey, so what are some projects to start learning Nim? |
15:44:54 | FromDiscord | <exelotl> advent of code is a good one, but that's a couple of months away :( |
15:46:14 | * | lum joined #nim |
15:47:52 | Yardanico | @Noobi you can try exercism |
15:48:14 | disruptek | i've tried it many times, but the demon remains. |
15:48:14 | Yardanico | also check https://nim-lang.org/learn.html |
15:49:37 | FromDiscord | <exelotl> No disruptek. You are the demons |
15:50:40 | FromGitter | <ynfle> @exelotl +1 |
15:50:52 | disruptek | rude. |
15:51:40 | FromGitter | <Knaque> (https://files.gitter.im/5602f03e0fc9f982beb19f61/hGpZ/image.png) |
15:51:42 | disruptek | we need someone to impl ndoc. |
15:51:46 | disruptek | !repo ndoc |
15:51:48 | disbot | https://github.com/nodeca/ndoc -- 9ndoc: 11js port of pdoc, with extentions 15 93⭐ 8🍴 7& 29 more... |
15:51:49 | FromGitter | <Knaque> Whoops, I thought I had a link copied... |
15:51:54 | disruptek | no, not that one. |
15:51:57 | disruptek | !repo disruptek/ndoc |
15:51:58 | disbot | https://github.com/disruptek/ndoc -- 9ndoc: 11like pydoc but for nim 15 0⭐ 0🍴 |
15:52:37 | FromGitter | <Knaque> Take two: Does Nim/Nimble have an existing equivalent of https://github.com/jgillick/python-pause? I'm considering making it myself but I wouldn |
15:52:46 | FromGitter | <Knaque> *'t want to if someone has already done so. |
15:53:00 | FromGitter | <Knaque> Wow, me and my keyboard are not getting along today apparently. |
15:53:57 | disruptek | pause doesn't seem to add anything over stdlib. |
15:54:36 | FromGitter | <Knaque> Let me rephrase the question then. Does Nim already provide a convenience procedure for waiting until a date/time? |
15:54:49 | * | lum quit (Ping timeout: 264 seconds) |
15:55:02 | Yardanico | well, os.sleep |
15:56:21 | FromGitter | <Knaque> No, `os.sleep` just sleeps for `x` milliseconds. I mean something like passing a `DateTime` object. |
15:56:26 | FromGitter | <ynfle> @exelotl, ⏎ ⏎ > *<FromDiscord>* <exelotl> ynfle: taking a look at the generated C code, you can see that inheriting from RootObj produces a struct with runtime type info (the "Sup" field): https://pastebin.com/raw/zvXwGNmn ⏎ ⏎ so *hidden type field* means a `super` type [https://gitter.im/nim-lang/Nim?at=5f85ce296e1aa94de7f8e898] |
15:57:12 | * | oculuxe joined #nim |
15:58:02 | * | oculux quit (Ping timeout: 244 seconds) |
15:58:25 | Yardanico | @Knaque but you can convert DateTime into seconds |
15:58:33 | FromDiscord | <Rika> yeah |
15:58:48 | Yardanico | just os.sleep((getTime() - futureTime).inMilliseconds) |
15:58:50 | FromDiscord | <Rika> i dont see whats so hard about importing times and using the values and conversions there |
15:58:50 | disruptek | well, that's not what pause is, either. |
15:59:36 | FromGitter | <Knaque> @disruptek see the last example in the README. |
15:59:57 | disruptek | sure. |
16:00:09 | disruptek | so it's two lines instead of one. |
16:00:27 | disruptek | no one has implemented it because it's nonsensical. |
16:01:10 | Yardanico | https://github.com/jgillick/python-pause/blob/master/pause/__init__.py#L59 |
16:01:12 | Yardanico | it uses sleep as well |
16:01:13 | FromGitter | <Knaque> I've heard enough then. |
16:01:14 | Yardanico | I see no differences :P |
16:01:25 | Yardanico | well it also does some "smarter" logic |
16:01:32 | Yardanico | because sleep isn't 100% accurate |
16:01:54 | * | lum joined #nim |
16:02:03 | FromDiscord | <treeform> Zevv, hello. |
16:02:37 | FromGitter | <Knaque> Pause exists for convenience more than anything else. |
16:02:52 | disruptek | yeah, that's why i put my cock on the front. |
16:03:56 | disruptek | Araq: does this ic3 mean that i need to wait before impl my name cache across bmodulelist? |
16:06:40 | disruptek | knaque: do you really want nim project ideas? |
16:06:59 | FromGitter | <Knaque> Yes, yes I do. Clearly I'm looking in the wrong places. |
16:07:38 | disruptek | i have tons of stuff that needs work. so does shashlick. |
16:07:59 | disruptek | you could impl graph algos for |
16:08:01 | disruptek | !repo gram |
16:08:01 | disbot | https://github.com/disruptek/gram -- 9gram: 11Generic graphs in Nim 15 11⭐ 1🍴 7& 4 more... |
16:09:31 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
16:09:32 | disruptek | you could remove recursion from |
16:09:34 | disruptek | !repo frosty |
16:09:34 | disbot | https://github.com/disruptek/frosty -- 9frosty: 11Serialize native Nim objects to strings, streams, or sockets ⛄ 15 15⭐ 0🍴 |
16:10:48 | disruptek | you could move a couple remaining encodings from runtime to compiletime in |
16:10:50 | disruptek | !repo jason |
16:10:50 | disbot | https://github.com/disruptek/jason -- 9jason: 11JSON done right 🤦 15 30⭐ 1🍴 |
16:11:27 | FromGitter | <Knaque> I'm probably gonna fuck something up, but I guess that's better than being yelled at over a sleep procedure. |
16:11:38 | Zevv | hello treeform. I would like to use typography together with sdl |
16:12:13 | disruptek | knaque: criterion needs a maintainer and it's written by my favorite nim programmer. |
16:12:20 | disruptek | !repo criterion |
16:12:20 | disbot | https://github.com/LemonBoy/criterion.nim -- 9criterion.nim: 11Statistic-driven micro-benchmark framework 15 38⭐ 4🍴 7& 1 more... |
16:12:51 | disruptek | golden needs a complete reimpl using frosty and gram and it's written by my second favorite nim programmer: |
16:12:54 | disruptek | !repo golden |
16:12:54 | disbot | https://github.com/disruptek/golden -- 9golden: 11a benchmark for compile-time and/or runtime Nim 🏆 15 22⭐ 0🍴 |
16:13:33 | disruptek | gully is mostly fleshed out structurally but needs many more small operations impl'd: |
16:13:36 | disruptek | !repo gully |
16:13:36 | disbot | https://github.com/disruptek/gully -- 9gully: 11a code comment formatter 15 3⭐ 0🍴 |
16:14:38 | disruptek | my testes have issues |
16:14:40 | disruptek | !repo testes |
16:14:43 | disbot | https://github.com/disruptek/testes -- 9testes: 11a small unittest framework with decent support 🔴🟡🟢 15 16⭐ 0🍴 7& 29 more... |
16:15:03 | FromGitter | <Knaque> Oh no, my worst enemy, choice! I'll poke around those and see if I can even begin to understand them. |
16:15:47 | disruptek | shashlick will weigh in with a longer list, i'm sure. |
16:16:24 | Yardanico | Zevv: ping him first :) |
16:16:50 | FromDiscord | <Vindaar> sent a long message, see http://ix.io/2ABC |
16:16:57 | Zevv | I did, he responded |
16:17:14 | Zevv | anyway, my question is what would be the most painless way to do that |
16:18:12 | disruptek | here's another one: openapi needs a v3 impl and you can simply copy and modify the schema from the v2 impl |
16:18:15 | disruptek | !repo openapi |
16:18:16 | disbot | https://github.com/disruptek/openapi -- 9openapi: 11OpenAPI Code Generator for Nim 15 34⭐ 3🍴 7& 5 more... |
16:19:16 | disruptek | bump needs github api support embedded into it using the github package. |
16:19:18 | disruptek | !repo bump |
16:19:19 | disbot | https://github.com/disruptek/bump -- 9bump: 11a tiny tool to bump nimble versions 🍻 15 17⭐ 2🍴 7& 1 more... |
16:23:23 | FromGitter | <Vindaar> @Knaque: sorry, my ping in my last message didn't make it. This was aimed at you http://ix.io/2ABC |
16:24:40 | FromDiscord | <reilly> @Vindaar No, that's fair actually. Coming (pretty much) straight from Python to Nim, I've never thought about it that way before. I've been a little bit spoiled. |
16:25:20 | FromDiscord | <Vindaar> That's fine and why I wanted to highlight it in case it came off as rude 🙂 |
16:26:00 | FromDiscord | <shashlick> i'm honestly wondering what to work on |
16:26:03 | disruptek | there's an unreasonable amount of contempt for imports. |
16:26:20 | disruptek | probably because package management isn't all that slick. |
16:26:38 | Zevv | i have nothing against imports |
16:26:41 | FromDiscord | <shashlick> well, i did what i had to there - chilling out since 1.4 is out any minute |
16:26:48 | Zevv | as long as its stdlib or my local project im importing |
16:26:55 | FromDiscord | <shashlick> too dumb to fix compiler bugs |
16:27:03 | * | leorize quit (Ping timeout: 240 seconds) |
16:27:51 | FromDiscord | <reilly> Too obsessed with convenience to think about why something is dumb and pointless. |
16:28:11 | FromDiscord | <reilly> "But it looks cleaner!!!!" |
16:29:03 | FromDiscord | <Vindaar> Happens to the best of us 😉 Also many things are not obvious until one sees an alternative |
16:29:09 | disruptek | Zevv: so you don't trust your own work enough to reuse it? |
16:29:44 | * | leorize joined #nim |
16:30:04 | * | njoseph quit (Read error: Connection reset by peer) |
16:30:36 | Zevv | i dont have much work |
16:30:42 | Zevv | and most of it kind of sucks |
16:30:48 | Zevv | so, yeah |
16:30:48 | * | njoseph joined #nim |
16:30:52 | * | leorize quit (Remote host closed the connection) |
16:31:16 | * | leorize joined #nim |
16:31:32 | Zevv | we don't all make one new cool project a week, you know |
16:32:06 | * | abm joined #nim |
16:35:38 | disruptek | i'd say only about 10% of my work is decent. |
16:36:13 | disruptek | the point is, sharing it gives everyone something to work with and improve. |
16:37:07 | disruptek | if we resist imports because imports, then we don't build this beneficial ecosystem. |
16:37:32 | disruptek | i don't feel bad about written the first poor implementation. |
16:37:41 | disruptek | s/written/writing/ |
16:38:26 | FromDiscord | <Vindaar> that is precisely the point I accepted a couple of years ago and just started pushing my code. If people don't like it, not like I hurt anyone (maybe their eyes) |
16:38:58 | Zevv | I've always shared most of my stuff |
16:39:20 | disruptek | i would personally rather have the inspiration. i tried to use grim but i couldn't; it inspired gram. |
16:39:21 | FromDiscord | <Vindaar> and you know, a library that works, but has ugly code is still better than no library of the kind |
16:39:32 | Zevv | sometimes it surprises me; like getting HN #1 for a day after 3 years, or finding your software in the debian repository one day |
16:40:03 | disruptek | i am willing to submit issues in the hopes that someone will fix their code for me. |
16:40:40 | disruptek | it hasn't worked with yardanico, but it usually works with shashlick. |
16:47:32 | * | qeeg quit (Ping timeout: 260 seconds) |
16:56:36 | * | NimBot joined #nim |
17:09:52 | * | user0 joined #nim |
17:15:36 | Zevv | Hm why can't I GC_ref() a string with ar |
17:15:37 | Zevv | c |
17:23:49 | Yardanico | Zevv: because they can be constant and stuff |
17:24:15 | Zevv | yeah but *are* they |
17:24:33 | Zevv | how can I make sure it's not going away now then? |
17:24:37 | Yardanico | idk :P |
17:24:56 | disruptek | why would it go away? |
17:25:02 | Yardanico | disruptek: get destroyed |
17:25:06 | disruptek | why would it go away? |
17:25:11 | Yardanico | get destroyed |
17:25:13 | * | nature joined #nim |
17:25:14 | disruptek | why would it go away? |
17:25:16 | Yardanico | across nim and C boundaries |
17:25:18 | Yardanico | or DLL boundaries |
17:25:21 | disruptek | why would it go away? |
17:25:30 | Yardanico | why disruptek is slow? |
17:25:38 | Zevv | I have a binary blob that I readFile() into a const. I want to pass this blob to C code so it needs to stay around. |
17:25:38 | disruptek | it's scope-based mm. if it doesn't leave scope, it doesn't get destroyed. |
17:25:44 | Yardanico | disruptek: but it leaves the scope |
17:25:49 | Zevv | I did this by putting it into a var, taking the addr[0], and GC_reffing the var |
17:25:51 | * | vesper11 joined #nim |
17:25:57 | * | nikki93 joined #nim |
17:26:11 | disruptek | how could a const get destroyed? |
17:26:23 | Zevv | not the const, because I can't take the address of that |
17:26:26 | Zevv | not even the unsafeAddress |
17:26:30 | Zevv | so I copy it into a var first |
17:26:35 | Zevv | and use the address of that |
17:26:39 | disruptek | in an outer scope. |
17:26:53 | Zevv | no in a local scope |
17:27:03 | disruptek | why use a const at all? |
17:27:10 | Zevv | because I want the asset to go into my binary |
17:27:14 | disruptek | compile-time vars are available at runtime for stupid reasons. |
17:27:15 | Zevv | it's a .ttf font |
17:27:26 | Zevv | is this a stupid reason? |
17:27:32 | * | natrys joined #nim |
17:27:35 | disruptek | this is an exploit of that stupidity. |
17:27:43 | Zevv | isn't everything in life |
17:27:53 | disruptek | welcome to my stupid life. |
17:28:38 | disruptek | Zevv: btw |
17:28:45 | disruptek | bentley pees like a bitch. |
17:28:48 | Zevv | anyway, I just moved the 'let' to a global and now it's ok. but I just wondered _whyy_ |
17:28:57 | disruptek | why what? |
17:29:11 | disruptek | GC_ref was never a "good idea." |
17:29:32 | Zevv | sure |
17:29:41 | Zevv | but that still doesn't answer my question |
17:29:49 | Yardanico | disruptek: but it was the least evil idea :) |
17:30:02 | disruptek | a single compile-time var seems less evil to me. |
17:30:18 | disruptek | it does what you want and doesn't duplicate anything. |
17:51:59 | nature | How do I get the reference of a variable ? |
17:52:44 | nature | when I do `x = ref myVar` it gives me an error |
17:54:05 | Yardanico | nature: you want to create a "ref type" from your "type"? |
17:54:19 | nature | yes |
17:54:20 | Yardanico | var myRef = new(mytype); x[] = myVar |
17:54:33 | Yardanico | but if you modify myRef it won't modify existing myVar of course |
17:55:10 | nature | I ended doing `x = cast[ref myType](myVar)` |
17:55:14 | Yardanico | no |
17:55:15 | Yardanico | don't |
17:55:18 | Yardanico | it won't work properly |
17:55:23 | Yardanico | what is myVar anyway |
17:55:39 | nature | it's an XmlNode |
17:55:52 | Yardanico | it's already a ref |
17:56:01 | nature | really ? |
17:56:01 | Yardanico | XmlNode = ref XmlNodeObj |
17:56:03 | Yardanico | yes |
17:56:07 | nature | oh ok then |
17:56:08 | Yardanico | https://nim-lang.org/docs/xmltree.html#XmlNode |
17:56:11 | nature | thanks :) |
17:56:25 | nature | so if I walk a node tree |
17:56:54 | nature | and assigns one of the XmlNode I'll be able to modify it later right ? |
17:57:14 | nature | and the tree will end up modified |
17:57:30 | nature | Or am I misunderstanding something here ? |
17:57:56 | Yardanico | nature: I think you're right, yes |
17:58:14 | nature | Thanks for your help Yardanico |
18:04:04 | Zevv | how would I propagate the version string from a .nimble into my code? |
18:04:14 | disruptek | !repo bump |
18:04:15 | disbot | https://github.com/disruptek/bump -- 9bump: 11a tiny tool to bump nimble versions 🍻 15 17⭐ 2🍴 7& 1 more... |
18:04:19 | disruptek | bump has a safe routine for this. |
18:04:23 | Zevv | ta |
18:04:47 | Yardanico | Zevv: const NimVersion {.strdefine.} = "" |
18:05:08 | Yardanico | sorry |
18:05:11 | Yardanico | const NimblePkgVersion {.strdefine.} = "" |
18:05:51 | Zevv | and then manually cut and paste this into the nimble task? |
18:05:56 | Yardanico | no? |
18:06:01 | Yardanico | nimble sets it automatically |
18:06:08 | Zevv | oh I didnt know |
18:06:11 | disruptek | nimble is for chumps. |
18:06:24 | Zevv | and pussies |
18:06:34 | Yardanico | and people who just want to get the job done ;) |
18:06:34 | Zevv | I had a make file first |
18:06:42 | disruptek | makes sense. |
18:06:57 | disruptek | because it's wise to tie the success of your software to nimble. |
18:08:00 | Zevv | right |
18:08:33 | FromDiscord | <dom96> /ban disruptek,Zevv |
18:08:42 | FromDiscord | <Rika> mod abuse |
18:08:43 | FromDiscord | <Rika> smh |
18:08:53 | Zevv | Yeah, we prepared for that. We have our own fork read |
18:08:55 | Zevv | ready |
18:09:26 | disruptek | nimble is approaching its 1,000th issue. |
18:09:31 | disruptek | you can't buy that kind of reliability. |
18:09:44 | FromDiscord | <aooo> what is the C equivalent for static with regard to local variables in nim? |
18:10:09 | Yardanico | {.global.} pragma I guess |
18:10:10 | disruptek | have you heard johannes linstead? |
18:10:25 | Yardanico | well disruptek you make good stuff, but you are also criticizing existing stuff too much :) |
18:10:36 | Yardanico | also you're not right about 1000 issues |
18:10:47 | Yardanico | it has 102 open, 469 closed issues |
18:10:50 | disruptek | oh, is it more? |
18:10:53 | Yardanico | and 10 open and 276 closed PRs |
18:11:06 | disruptek | i see an issue counter approaching 900. |
18:11:11 | disruptek | which repo are you looking at? |
18:11:17 | Yardanico | yeah, because GitHub counts both PRs and issues as issues |
18:11:27 | Yardanico | disruptek: https://github.com/nim-lang/nimble/ |
18:11:31 | disruptek | you think PRs are a sign of reliability? |
18:11:41 | disruptek | interesting. |
18:11:47 | Yardanico | I didn't say |
18:11:51 | disruptek | no, that's a theory i had not contemplated. |
18:11:51 | Yardanico | but the opposite is also not true |
18:12:08 | Yardanico | it doesn't mean that something isn't reliable if it has a lot of PRs and/or issues |
18:12:08 | * | Zevv slides out of here |
18:12:10 | disruptek | okay buddy, i don't give a shit. you can spin it any way you want. |
18:12:30 | Yardanico | yeah I know that you like criticism a lot :) |
18:12:40 | disruptek | feel free to criticize my code. |
18:12:43 | disruptek | it might improve it. |
18:12:45 | Yardanico | criticising other projects* |
18:12:49 | FromDiscord | <Rika> bruh |
18:13:48 | FromDiscord | <dom96> dayuum |
18:13:56 | * | lum quit (Quit: WeeChat 2.8) |
18:14:22 | FromDiscord | <aooo> In C, a local variable is limited to the function by default. is that the case in nim? |
18:14:29 | disruptek | yes. |
18:14:30 | Yardanico | yes of course |
18:14:42 | Yardanico | and as I said you can use {.global.} pragma to do the same as you do with static in C |
18:14:47 | Yardanico | but it's better to just create a global then |
18:14:53 | Yardanico | {.global.} pragma doesn't always work the right way |
18:15:40 | FromDiscord | <aooo> thank you 😄 |
18:18:27 | disruptek | i criticize because i care. |
18:18:52 | disruptek | if you don't criticize, it's because you don't care or you don't want to share your opinion with others to the benefit of all. |
18:18:55 | disruptek | which is it? |
18:19:18 | disruptek | maybe you just aren't critical. |
18:19:19 | Yardanico | disruptek: criticizing is good, but not when you don't provide a universally better option |
18:19:30 | Yardanico | or at least try to properly criticize |
18:19:32 | Yardanico | by making issues |
18:19:36 | Yardanico | reporting them |
18:19:40 | disruptek | excuse me, are you for real right now? |
18:19:57 | disruptek | i'm not going to engage with such an absurd statement. |
18:20:02 | disruptek | i've PR'd nimble, have you? |
18:20:05 | Yardanico | yes |
18:20:13 | Yardanico | what's the point in criticizing stuff if you don't help improving it? I know you have nimph, but even you have issues with it |
18:20:23 | Yardanico | and I see you criticizing nimble almost every time someone mentions it |
18:20:41 | disruptek | because it's an almost universal deficiency. |
18:20:53 | disruptek | almost everyone uses it, so any flaw there hurts almost everyone. |
18:20:54 | Yardanico | and you're confusing people who are new to nim |
18:21:03 | disruptek | i'm done here. |
18:21:07 | Yardanico | me too |
18:21:37 | idf | same, im out of popcorn |
18:21:42 | disruptek | feel free to resurrect my PR to nimble and resubmit it. |
18:22:34 | * | ehmry joined #nim |
18:22:41 | voidpi | Yardanico: I'm new to nim and I'm not confused, disruptek is high |
18:24:58 | FromDiscord | <shashlick> I don't believe it is possible to create bug free software |
18:25:11 | FromDiscord | <Rika> disruptek is our resident genius maniac |
18:25:40 | disruptek | bullshit. nothing i write is particularly complex or ambitious. |
18:25:46 | FromDiscord | <Rika> i believe that software cannot be bug free and that more issues in the repo != more bugs in your software |
18:25:47 | voidpi | also nim, nimble or anything for that matter are not free to critique |
18:25:53 | FromDiscord | <Rika> just means the bugs have been discovered |
18:26:03 | FromDiscord | <Rika> i'd be worried if there were barely any issues |
18:26:11 | Zevv | it is obviously possible |
18:26:23 | Zevv | "Write a program printing all numbers from 1 to 5, inclusive" |
18:26:29 | Zevv | I bet you can make that, bug free |
18:26:34 | * | xioren joined #nim |
18:26:40 | FromDiscord | <aooo> Why does more combined issues mean more problems when a lot of those issues could have been nothing and was closed? |
18:26:47 | disruptek | the point was that the software is not a reliable basis for a requirement because it locks the user into an ecosystem that undergoes quite a bit of churn and hasn't demonstrated stability. |
18:26:52 | voidpi | there is qmail |
18:27:41 | FromDiscord | <shashlick> Edge cases don't negate the fact |
18:28:08 | FromDiscord | <shashlick> I don't walk around with the illusion that my code is some immaculate conception |
18:28:19 | FromDiscord | <shashlick> There will always be smarter people who can piss all over it |
18:28:30 | FromDiscord | <shashlick> Make it 5000x faster or some other metric |
18:28:33 | disruptek | not the point. |
18:29:04 | disruptek | which looks more stable to you? https://github.com/nim-lang/nimble/graphs/code-frequency or https://github.com/disruptek/bump/graphs/code-frequency |
18:29:20 | Yardanico | how is that a metric of "being stable" |
18:29:36 | disruptek | yardanico: i don't believe you have anything to contribute here. |
18:29:49 | FromDiscord | <shashlick> Nim's crap too by that metric |
18:29:57 | disruptek | well, it's not stable. |
18:30:01 | FromDiscord | <shashlick> Any position can be defended by sound logic |
18:30:02 | disruptek | i'm not claiming it is. |
18:30:15 | disruptek | you're right: i'll provide the sound logic. |
18:30:26 | FromDiscord | <shashlick> Irrefutable logic is not hard to come by |
18:30:34 | FromDiscord | <shashlick> It makes no difference to the status quo |
18:30:42 | disruptek | sounds great, dude. |
18:30:44 | * | Vladar quit (Quit: Leaving) |
18:30:49 | disruptek | also: what the fuck are you talking about? |
18:31:17 | disruptek | it cannot be refuted that bump is stable. i believe it has seen one significant change -- a code reorder -- in the last year. |
18:31:35 | FromDiscord | <shashlick> What's the comparison between bump and nimble |
18:31:43 | disruptek | scroll back. |
18:31:59 | FromDiscord | <shashlick> Like me comparing nimterop with Nim, or even c2nim for that matter |
18:32:22 | disruptek | yeah, i can't trust you not to break nimterop in a patch version. no, it's not stable, either. |
18:32:32 | FromDiscord | <shashlick> Some times people drive into dead ends |
18:32:36 | disruptek | we're talking about sourcing code to determine a project's version at compile-time. |
18:32:52 | disruptek | i suggested bump. someone else suggested nimble. |
18:33:02 | disruptek | tell me again how i'm a maniac. |
18:34:06 | FromDiscord | <shashlick> Feel free to provide alternatives |
18:34:24 | FromDiscord | <shashlick> And challenge the status quo |
18:34:25 | disruptek | you want me to create a new library for this because bump is too unstable? |
18:34:57 | disruptek | we are waiting for a staticGetCurrentDir, basically, and it has been approved in concept but no impl has been provided yet. |
18:35:03 | FromDiscord | <Rika> i dont understand, isnt there a clear difference in complexity between the programs? |
18:35:09 | disruptek | of course. |
18:35:26 | disruptek | bump is a shell-script-turned-into-code that i made for shashlick. |
18:35:35 | FromDiscord | <shashlick> You're comparing your implementation with nimble's implementation which has not changed in years |
18:36:07 | disruptek | i don't believe there's any useful comparison, honestly. |
18:36:15 | FromDiscord | <Rika> ah i see, i misunderstood |
18:36:17 | FromDiscord | <shashlick> Anyway, feel free to propose your alternatives |
18:36:23 | disruptek | you're talking about demanding that the user use nimble in order to use zevv's software. |
18:36:43 | * | opal quit (Ping timeout: 240 seconds) |
18:36:45 | disruptek | why do you keep asking me for alternatives? i've already proposed bump. |
18:36:55 | FromDiscord | <shashlick> Bump is your alternative |
18:37:04 | disruptek | okay, well i've already replaced nimble with nimph. |
18:37:18 | disruptek | what exactly do you want an alternative for? zevv's software? |
18:37:41 | disruptek | i also proposed staticGetCurrentDir. |
18:37:53 | FromDiscord | <shashlick> Not every great idea is going to succeed |
18:38:00 | * | nature quit (Quit: WeeChat 2.9) |
18:38:08 | disruptek | shashlick: put down your book of koans and answer the question. |
18:38:21 | disruptek | who the fuck is this? confucious say shashlick need to get a fucking grip. |
18:38:24 | FromDiscord | <shashlick> Promote your stuff all you want, don't piss on the status quo as marketing |
18:38:34 | FromDiscord | <shashlick> No one buys such stuff |
18:38:36 | disruptek | okay buddy. |
18:38:53 | FromDiscord | <shashlick> It does a disservice to your hard work |
18:39:16 | disruptek | i have no idea what you're talking about. |
18:39:48 | disruptek | i guess you're offended because i explained why nimble would not be my first choice. |
18:39:56 | disruptek | i think you guys should grow some fucking balls. |
18:39:59 | FromDiscord | <shashlick> I'm not offended |
18:40:06 | disruptek | if you don't want criticism for your software, don't share it with others. |
18:40:21 | FromDiscord | <shashlick> If there are legitimate alternatives then advertise them for their pros/cons |
18:40:27 | disruptek | don't tell me i need to provide alternatives. the onus is on you to provide alternatives. |
18:40:33 | disruptek | i already have. |
18:40:33 | * | opal joined #nim |
18:40:38 | FromDiscord | <shashlick> you already have a variety of alternatives |
18:40:45 | FromDiscord | <shashlick> That's what I'm talking about |
18:40:49 | disruptek | SO WHY DO YOU KEEP ASKING ME FOR ALTERNATIVES? |
18:40:54 | disruptek | what the actual fuck. |
18:41:04 | FromDiscord | <shashlick> I'm talking about advertising your already existing alternatives |
18:41:12 | disruptek | what? |
18:41:20 | disruptek | you don't want me to share code? |
18:41:20 | FromDiscord | <shashlick> Is it really so confusing? |
18:41:22 | disruptek | yes. |
18:41:30 | disruptek | it absofuckinglutely is. |
18:41:48 | supakeen | What are we fighting about? |
18:41:53 | disruptek | you want me to write a new library that produces compile-time versions for projects? |
18:41:57 | disruptek | that isn't bump, right? |
18:42:08 | FromDiscord | <shashlick> Communication |
18:42:12 | disruptek | that's the alternative you want me to provide instead of suggesting bump in contrast to nimble. |
18:42:16 | disruptek | is that right? |
18:44:09 | FromDiscord | <shashlick> Bump is a fine alternative, which already exists and you are proposing to Zevv |
18:44:49 | disruptek | you don't want me to speak of nimble, then. |
18:44:57 | disruptek | that's your criticism of my criticism, right? |
18:45:02 | FromDiscord | <shashlick> it would be better to argue the pros/cons in principal |
18:45:24 | disruptek | well, i have, but i'm happy to reiterate so you don't think this is a nimble attack: |
18:45:25 | FromDiscord | <shashlick> You don't see me trashing potential every user of c2nim now do you |
18:45:47 | FromDiscord | <shashlick> Ok cool then I may have misunderstood |
18:45:48 | disruptek | bump is stable. it's a common requirement. it works. it's small. |
18:46:01 | disruptek | it works at compile-time without regard to the user's package manager. |
18:46:29 | disruptek | these are all contrasts to nimble; that's why i'm sharing them here. |
18:54:31 | FromDiscord | <Xephobia> hello, i'm learning nim after learning c++ as my first language and its really great! But is there something like atexit() from cstdlib in nim? |
18:54:47 | disruptek | yep. |
18:54:48 | FromDiscord | <Xephobia> it execute a function when we close the program |
18:55:06 | disruptek | see the exitprocs module. |
18:55:08 | FromDiscord | <Xephobia> a bot answered me? how? |
18:55:15 | FromDiscord | <Xephobia> are you a bridge to irc? |
18:55:24 | FromDiscord | <Xephobia> thanks you |
18:55:54 | disruptek | yeah, i'm the bot that provides objectivity to a channel that desperately needs it. |
18:56:27 | FromDiscord | <Xephobia> is thre an human behind you or you are powered by AI? |
18:56:28 | FromDiscord | <ache of head> hahahahaha |
18:56:33 | FromDiscord | <ache of head> yes disruptek is an IA |
18:56:35 | FromDiscord | <ache of head> AI* |
18:56:37 | FromDiscord | <Rika> He's powered by a crazy AI |
18:56:44 | FromDiscord | <Xephobia> darn |
18:56:51 | FromDiscord | <Xephobia> in pure nim? |
18:57:04 | FromDiscord | <ache of head> yea |
18:57:05 | disruptek | i wouldn't call it `pure`. |
18:57:09 | FromDiscord | <ache of head> the project is managed with nimph |
18:57:11 | FromDiscord | <ache of head> remember |
18:57:36 | FromDiscord | <Xephobia> what is nimph |
18:57:48 | FromDiscord | <ache of head> https://tenor.com/ubVM.gif |
18:57:51 | FromDiscord | <ache of head> https://github.com/disruptek/nimph |
18:58:12 | FromDiscord | <Xephobia> sorry |
18:58:18 | FromDiscord | <Xephobia> i'm new to the nim |
18:58:36 | FromDiscord | <Xephobia> i'm getting you a headache? |
18:58:52 | disruptek | no, i think i got that before you arrived. |
18:59:36 | FromDiscord | <ache of head> i've always been one. |
18:59:42 | FromDiscord | <ache of head> so no harm done |
19:00:02 | FromDiscord | <Xephobia> darn that's a really good AI, could it answer me how many messages were you trained on? |
19:00:10 | FromDiscord | <Xephobia> if you use deep learning of course |
19:00:11 | disruptek | no. |
19:00:24 | FromDiscord | <Xephobia> you use if else? |
19:00:28 | disruptek | yes. |
19:00:46 | FromDiscord | <Xephobia> is your source opened? |
19:00:48 | disruptek | no. |
19:01:00 | FromDiscord | <Xephobia> ok |
19:01:12 | * | qeeg joined #nim |
19:01:44 | FromDiscord | <Xephobia> can you give me your ping in milisseconds? |
19:01:48 | disruptek | no. |
19:02:07 | FromDiscord | <Xephobia> why? |
19:02:10 | disruptek | no. |
19:02:18 | Yardanico | yes. |
19:02:35 | disruptek | by the time you receive it, it will already be out-of-date. |
19:02:35 | FromDiscord | <ache of head> maybe??? |
19:02:50 | FromDiscord | <Xephobia> that logic |
19:02:57 | disruptek | if/else ftw. |
19:03:03 | voidpi | if you break disruptek you pay for it |
19:03:16 | FromDiscord | <Xephobia> wait there is two bots, |
19:03:18 | FromDiscord | <Xephobia> ? |
19:03:21 | FromDiscord | <ache of head> and he's actually fairly easy to break so take it easy |
19:03:24 | FromDiscord | <ache of head> yeah, most people on here are bots |
19:03:49 | FromDiscord | <Rika> Xepho in all seriousness they're not bots |
19:03:56 | FromDiscord | <Xephobia> bruh |
19:03:59 | FromDiscord | <ache of head> https://tenor.com/ubVM.gif |
19:04:01 | FromDiscord | <ache of head> did someone ask you |
19:04:05 | FromDiscord | <Xephobia> there are irc bridge? |
19:04:05 | FromDiscord | <ache of head> how could you break the joke |
19:04:07 | FromDiscord | <ache of head> yeah |
19:04:08 | Yardanico | @Xephobia yes |
19:04:10 | Yardanico | !repo ircord |
19:04:11 | disbot | https://github.com/Yardanico/ircord -- 9ircord: 11Discord <-> IRC bridge in Nim 15 9⭐ 1🍴 |
19:04:17 | FromDiscord | <Xephobia> darn |
19:04:26 | FromDiscord | <Rika> M8 the dude looked seriously confused |
19:04:26 | FromDiscord | <Xephobia> :GWaobloChildPepeCry: |
19:04:29 | FromDiscord | <ache of head> lmao |
19:04:31 | FromDiscord | <ache of head> ok |
19:04:52 | FromDiscord | <Xephobia> sorry for spamming and being a morron, but i'm still enjoying nim! |
19:04:57 | FromDiscord | <Rika> Dw |
19:05:32 | FromDiscord | <Xephobia> why is thre 2/more irc bridge ? |
19:05:48 | Yardanico | wdym? |
19:07:28 | FromDiscord | <ache of head> iiuc, there's one bridge, but you see a different pfp and display name for each user that takes part in the bridge |
19:07:59 | FromDiscord | <Yardanico> @Xephobia The bridge uses webhooks and random "robohash" avatars from Gravatar (based on the nickname). |
19:08:13 | FromDiscord | <Yardanico> So that there's clear separation of different people from IRC |
19:08:29 | FromDiscord | <Xephobia> ho i see |
19:13:34 | xioren | how might one implement this: [[proc, proc,..], [proc, func,...],...] |
19:13:35 | FromDiscord | <neow> hey im enjoying nim too |
19:13:49 | Yardanico | xioren: and what would this do?> |
19:14:03 | xioren | i need to iterate over a bunch of procs that all check something and return a boolean |
19:14:54 | FromDiscord | <Rika> So a list of procs, or a 2d list? |
19:15:44 | xioren | so im checking magic numbers and it would be something like: all_procs = [[archive procs], [image_procs], [etc]] |
19:15:55 | xioren | so 2d |
19:16:44 | FromDiscord | <neow> seq[seq[proc(arg: type): bool]] ? |
19:17:05 | xioren | lemme try that |
19:17:18 | FromDiscord | <neow> ofc replace type with a proper type |
19:21:16 | Yardanico | @neow also add {.nimcall.} if you specifically don't want closures |
19:21:52 | FromDiscord | <neow> what kinda closures? |
19:22:23 | FromDiscord | <neow> oh, like from type definitions |
19:22:30 | FromDiscord | <neow> proc definitions* |
19:22:36 | FromDiscord | <neow> right? |
19:24:01 | FromGitter | <matrixbot> `BarrOff` hello, how can I get the name of the proc that called the current proc? |
19:24:15 | FromDiscord | <neow> wait I'm confused |
19:24:17 | FromDiscord | <neow> https://play.nim-lang.org/#ix=2tgN |
19:24:24 | FromDiscord | <neow> I only found this from nimcall |
19:25:04 | Yardanico | @neow "nimcall" means that the proc has default nim calling convention |
19:25:28 | * | abm quit (Quit: Leaving) |
19:26:29 | narimiran | Yardanico: maybe add what checks are kept with -d:release |
19:26:37 | Yardanico | narimiran: well, there's a lot of them :P |
19:27:02 | narimiran | ok, just two-three most important? :P |
19:27:29 | Yardanico | https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L55 for the full list (https://nim-lang.org/docs/nimc.html "Runtime checks (see -x):") |
19:27:46 | Yardanico | well I guess bound checks, overflow checks, nil checks |
19:28:04 | narimiran | sounds good |
19:28:05 | xioren | here is a rough example of what i would need to do...this gives type errors: proc test1(x: string): bool = |
19:28:08 | xioren | result = false |
19:28:10 | xioren | func test2(x: string): bool = |
19:28:13 | xioren | result = true |
19:28:15 | xioren | proc test3(x: string): bool = |
19:28:16 | Yardanico | "-d:danger disables all runtime safety checks including bound checks, overflow checks, nil checks and more" |
19:28:18 | xioren | result = false |
19:28:20 | xioren | let |
19:28:23 | xioren | a: seq[proc(x: string): bool] = @[test1, test2] |
19:28:25 | xioren | b: seq[proc(x: string}: bool] = @[test3] |
19:28:28 | xioren | var |
19:28:28 | narimiran | Yardanico: thumb up |
19:28:30 | xioren | x: seq[seq[proc(x: string): bool]] |
19:28:33 | xioren | woops |
19:28:35 | xioren | that was supposed to be a link |
19:28:57 | xioren | https://play.nim-lang.org/#ix=2ACM |
19:29:31 | FromDiscord | <neow> you forgot to close a ( |
19:29:34 | FromDiscord | <neow> on line 12 |
19:29:45 | FromDiscord | <neow> oh you typed } instead of ) |
19:29:48 | * | natrys quit (Quit: natrys) |
19:29:58 | FromGitter | <matrixbot> `BarrOff` is there something similar to C's *FUNCTION* macro in Nim? |
19:30:25 | xioren | good catch |
19:30:38 | xioren | still get a type error though |
19:31:16 | Yardanico | xioren: maybe you want something like https://play.nim-lang.org/#ix=2ACP ? |
19:31:18 | FromDiscord | <neow> yeah, I see |
19:32:08 | Yardanico | narimiran: pushed the update |
19:32:34 | * | abm joined #nim |
19:32:53 | Yardanico | @BarrOff I don't think so |
19:32:58 | Yardanico | and you probably mean __func__ right ? |
19:33:24 | Yardanico | you can get the function name of the callee with stack traces I think (if the're not disabled which happens in release modes) |
19:33:39 | xioren | thats seems to work yardanico, at least with the example. thanks |
19:34:34 | FromDiscord | <neow> I don't understand why that type error happens @xioren, but this: https://play.nim-lang.org/#ix=2ACS seems to work |
19:34:42 | FromDiscord | <neow> maybe someone more experienced can help |
19:36:17 | xioren | yeah that seems to work too, thanks. although in my code it doesnt seem to want to let me have a seq with both func and procs. oh well i'm half way there. |
19:36:28 | Yardanico | xioren: because funcs and procs are different types :) |
19:36:38 | Yardanico | funcs are procs with a {.noSideEffect.} pragma |
19:36:45 | Yardanico | but of course you can circumvent that by casting funcs to procs |
19:36:48 | xioren | yeah i guess the pragma make them unique |
19:37:24 | FromDiscord | <neow> I wonder how to fix the original solution so that it works |
19:37:32 | FromDiscord | <neow> the error seemed to be in the pragmas to me |
19:38:06 | xioren | yeah the type error i get refers to the .noSideEffect. pragma |
19:38:44 | xioren | i guess i could just turn all me func to procs lol |
19:38:44 | FromDiscord | <neow> https://play.nim-lang.org/#ix=2ACU |
19:38:51 | xioren | my* |
19:39:10 | FromDiscord | <neow> I think .add's got it to work, which is weird considering, I haven't changed the type |
19:39:50 | Yardanico | well, because nim compiler can automatically convert between nimcall and closure procs :) |
19:40:00 | Yardanico | but not with the @[] list of procs |
19:40:32 | FromDiscord | <Xephobia> what does the block statements actually goes? i should know because i'm from c++ but |
19:40:38 | FromDiscord | <neow> what is the differnece between nimcall and closure procs? damn I should really read the manual, yet it is kinda intimidating |
19:40:56 | Yardanico | @Xephobia https://nim-lang.org/docs/manual.html#statements-and-expressions-block-statement |
19:41:08 | Yardanico | for statements - mostly for breaking out of blocks |
19:41:16 | Yardanico | *as a statement |
19:41:20 | Yardanico | as an expression - https://nim-lang.org/docs/manual.html#statements-and-expressions-block-expression |
19:41:20 | FromDiscord | <Xephobia> i deleted it because i figured it out but maybe the bot don't do that |
19:41:29 | Yardanico | you can't delete messages in IRC |
19:41:51 | FromDiscord | <Xephobia> darn |
19:41:56 | Yardanico | @neow see https://nim-lang.org/docs/manual.html#types-procedural-type |
19:42:04 | Yardanico | scroll a bit down and you'll see "nimcall" and "closure" |
19:44:30 | FromDiscord | <neow> nimcalls are ones that do not access the local environment, only the topmost one if I understood it correctly |
19:46:27 | FromDiscord | <neow> I got it woow |
19:46:28 | FromDiscord | <neow> https://play.nim-lang.org/#ix=2ACW |
19:46:39 | FromDiscord | <neow> Thanks a lot Yardanico, I learned something today |
19:47:18 | Yardanico | but as my I showed in my example, type annotations in Nim are completely optional if you have a value for your variable :) |
19:47:45 | Yardanico | but they can be useful if you're learning the language, although editors with nim plugins who have advanced features (based on nimsuggest) can show you the types |
19:48:07 | * | luis joined #nim |
19:49:01 | * | luis quit (Client Quit) |
19:49:21 | Yardanico | btw narimiran, isn't https://opencollective.com/nim considered the main way of donating to Nim right now? |
19:49:25 | FromDiscord | <neow> yeah, I always try to write the type description out, also because I find it makes my code cleaner |
19:49:27 | Yardanico | opposed to https://salt.bountysource.com/teams/nim |
19:50:15 | FromDiscord | <neow> the donation page descriptions are also kinda old, still talking about 1.0 |
19:50:33 | Yardanico | you mean bountrysource? |
19:50:37 | Yardanico | yeah it wasn't updated in a long time |
19:50:37 | xioren | brb |
19:50:54 | narimiran | Yardanico: yeah, opencollective is the main one AFAIK |
19:50:59 | Yardanico | ok, will PR that as well |
19:53:13 | * | xioren left #nim (#nim) |
19:55:44 | bung | how to declare a variable store ptr array[4,char] and ptr array[4,char]? |
19:56:14 | Yardanico | you want to store two pointers? |
19:56:39 | bung | just one , it may be 4 or 7 |
19:56:52 | Yardanico | you said two ptr array[4, char] |
19:57:01 | * | xioren joined #nim |
19:57:18 | bung | store into one |
19:57:34 | Yardanico | ?? |
19:57:45 | Yardanico | can you please show some code? :) |
19:58:02 | bung | hdr: array[4, char] | array[7, char |
19:58:17 | bung | pass the variable to the proc param like this |
19:59:10 | Yardanico | as a proc argument that will work, yes |
19:59:14 | Yardanico | https://play.nim-lang.org/#ix=2ACZ |
19:59:17 | Yardanico | so not sure what's your issue |
19:59:45 | bung | https://github.com/bung87/amysql/blob/3785f05de95a8e9617c9495c9d8c8f2cf2434680/src/amysql/private/protocol.nim#L389 |
20:00:31 | Yardanico | yes, and why do you need it as ptr array[4, char] ? |
20:00:50 | Yardanico | I don't see b used in that proc |
20:00:59 | Yardanico | you make the variable, but don't use it |
20:01:12 | bung | let payloadLen = conn.processHeader(b[]) |
20:01:30 | Yardanico | and what's your current issue? |
20:01:49 | Yardanico | but I don't think it will be easily possible with arrays |
20:01:57 | Yardanico | since you want to dispatch different array types based on runtime length |
20:02:00 | Yardanico | which is not possible |
20:02:28 | Yardanico | why do you need an array exactly? you can access chars of a cstring just as easily |
20:02:47 | bung | yeah, I may not need array of char |
20:02:51 | Yardanico | and then do different runtime stuff based on the length of that string |
20:03:03 | bung | I just follow old implementation |
20:03:08 | Yardanico | so what's the problem? :P |
20:03:52 | xioren | so does the compiler automatically assign a .noSideEffect. pragma to a proc if it detects no side effects? |
20:04:20 | Yardanico | usually yes |
20:04:35 | FromDiscord | <Avatarfighter> cant you force that by making a proc a func? |
20:04:42 | FromDiscord | <Avatarfighter> well not force it |
20:04:44 | FromDiscord | <Avatarfighter> rather ensure |
20:05:08 | Yardanico | you can as well just use a pragma |
20:05:10 | bung | I mean can I declare b upon of when defined(mysqlx_compression_mode)? |
20:05:27 | Yardanico | bung: yes, if you have a compile-time condition, then you can differentiate |
20:05:45 | Yardanico | @Avatarfighter func has always been an alias to proc with a {.noSideEffect.} pragma |
20:05:48 | Yardanico | and it's true even with strictFuncs |
20:05:57 | FromDiscord | <Avatarfighter> yeah ik |
20:06:26 | xioren | i see, any way to bypass as its giving me a type error with some procs being assigned .noSideEffect. implicitely and others not, when trying to put multiple procs into a seq. |
20:06:49 | Yardanico | can you show the code? |
20:07:04 | bung | or maybe declare it as 7 then casting to 4 in that condition ? |
20:07:24 | Yardanico | bung: why not just use cstring? |
20:07:29 | Yardanico | I don't see why do you need arrays in that case at all |
20:07:30 | * | narimiran quit (Ping timeout: 256 seconds) |
20:07:52 | Yardanico | or even simple strings, without cstrings |
20:08:03 | xioren | https://play.nim-lang.org/#ix=2AD4 |
20:08:14 | xioren | all the matchers are just simple procs that return boolean |
20:08:27 | Yardanico | xioren: well I meant a self-contained code which shows you an error :P |
20:08:45 | bung | yeah, that may simpler which easy parse numbers |
20:08:57 | xioren | lol let me see if i can come up with an example |
20:09:34 | Yardanico | or if it's open source you can give me a link to the repo |
20:09:59 | xioren | https://play.nim-lang.org/#ix=2AD5 |
20:11:12 | Yardanico | well, in that case the error happens because nim infers the type of the seq by the first element if you initialize it with @[ |
20:11:17 | Yardanico | and the types don't match |
20:12:11 | xioren | hmm |
20:12:14 | Yardanico | xioren: |
20:12:25 | Yardanico | https://play.nim-lang.org/#ix=2AD6 |
20:13:39 | xioren | lemme give that a shot |
20:15:54 | xioren | unfortunately still get the mismatch when implemented in my code D: |
20:16:38 | xioren | vexing |
20:16:39 | Yardanico | I think I'll go for now, please make a repo or at least a gist with code to reproduce the same :) if it's not proprietary of course |
20:16:53 | Yardanico | you can also post the question on the forum |
20:17:07 | xioren | thnx for help |
20:21:23 | FromDiscord | <neow> xioren, you can get the type of a proc by typing for example isTar.type.name |
20:21:35 | FromDiscord | <neow> if you import typetraits |
20:21:41 | Yardanico | but why would that be needed? |
20:22:00 | FromDiscord | <neow> maybe to check if all those filters are really of the same type |
20:22:40 | Yardanico | well, I don't think that he needs all filters to be *exactly* of the same type (I mean tags/effects) |
20:29:12 | xioren | i got around it for now but putting all the procs with side effect into their own seq. ill deal with finding a more eloquent solution at a later time lol. |
20:29:22 | xioren | by* |
20:38:33 | * | nature joined #nim |
20:39:10 | * | lritter quit (Quit: Leaving) |
20:46:54 | FromDiscord | <dom96> oh, I missed some nice fighting |
20:49:00 | * | luis joined #nim |
20:49:39 | * | luis quit (Client Quit) |
20:49:48 | * | luis joined #nim |
21:01:02 | * | bung quit (Ping timeout: 265 seconds) |
21:19:10 | disruptek | yeah, great; willful ignorance and stubborn lack of ambition. |
21:19:18 | disruptek | really nice stuff. |
21:31:29 | * | solitudesf quit (Ping timeout: 265 seconds) |
21:49:29 | * | luis quit (Quit: luis) |
21:49:46 | * | luis joined #nim |
22:09:46 | * | bung joined #nim |
22:11:12 | * | tiorock joined #nim |
22:11:12 | * | tiorock quit (Changing host) |
22:11:12 | * | tiorock joined #nim |
22:11:12 | * | rockcavera quit (Killed (verne.freenode.net (Nickname regained by services))) |
22:11:12 | * | tiorock is now known as rockcavera |
22:14:40 | * | bung quit (Ping timeout: 272 seconds) |
22:17:37 | * | rockcavera quit (Ping timeout: 264 seconds) |
22:29:25 | * | rockcavera joined #nim |
22:39:05 | * | nature quit (Ping timeout: 240 seconds) |
22:46:07 | * | disruptek is now known as asd |
23:17:21 | * | TomDotTom quit (Quit: Leaving) |
23:21:18 | * | Onionhammer quit (Quit: Ping timeout (120 seconds)) |
23:21:24 | * | screens_ quit (Quit: No Ping reply in 90 seconds.) |
23:21:35 | * | Onionhammer joined #nim |
23:23:12 | * | screens_ joined #nim |
23:24:08 | * | TomDotTom joined #nim |
23:24:13 | * | lain quit (Ping timeout: 260 seconds) |
23:24:48 | * | voidpi quit (Ping timeout: 260 seconds) |
23:26:58 | * | lain joined #nim |
23:30:22 | * | voidpi joined #nim |
23:34:10 | * | voidpi quit (Client Quit) |
23:39:48 | * | luis quit (Quit: luis) |
23:46:52 | * | luis joined #nim |
23:49:48 | * | landerlo joined #nim |
23:51:08 | landerlo | Hi, looking into Nim for a compiler, I was very happy that the stdlib already includes performant sparse int sets |
23:51:32 | asd | yeah, they are nice. |
23:51:37 | * | asd is now known as disruptek |
23:52:36 | landerlo | However, I miss the genericity to be able to use other ordinals like distincts of ints. I plan to have many different sets and I want to enforce some type safety by having different distinct opaque int types for ids mainly |
23:53:05 | disruptek | you can use the sets module. |
23:54:05 | landerlo | Yes, but I like the performance of IntSets, I created a PR to extend IntSets to allow other ordinals https://github.com/nim-lang/Nim/pull/15564 |
23:54:06 | disbot | ➥ Make IntSet a generic ordinal set OrdSet[A] |
23:54:58 | disruptek | so why doesn't it pass tests? |
23:56:12 | FromDiscord | <Elegant Beef> Tests are just suggestions |
23:56:37 | disruptek | why not [A: Ordinal]? |
23:57:49 | landerlo | Would A: Ordinal also include the distinct types? I think opaque ints are a more interest case than other enums |
23:58:31 | disruptek | i agree. |
23:58:34 | landerlo | It's my first nim code, so probably should had asked here before having a stab at that, but I found the experience very smooth. |
23:58:59 | disruptek | well, you have my +1. i think we should make it work one way or another. |
23:59:28 | disruptek | ie. i think the Ordinal class should match anything with .ord, .succ, .prev or w/e. |
23:59:55 | disruptek | so why doesn't it pass tests? |