00:04:33 | FromDiscord | <RattleyCooper> Hey beef, you think you'd ever create a repo for the `NettyStream` type from nettyrpc? |
00:05:31 | FromDiscord | <Elegantbeef> Nah cause i'll be removing it for frosty when 1.6 is stable |
00:06:08 | FromDiscord | <RattleyCooper> ok |
00:06:44 | FromDiscord | <Elegantbeef> Both frosty and flatty offer better serialization |
00:19:17 | FromDiscord | <cabboose> haxscramper is making a c header parser or something right |
00:19:43 | FromDiscord | <cabboose> we should band together and make one before he does; except it’s filled with raise Defects |
00:20:04 | FromDiscord | <cabboose> no exceptions allowed except Defect and Exception |
00:20:27 | FromDiscord | <cabboose> And the module has a exitproc that raises Defect too |
00:20:35 | FromDiscord | <cabboose> in fact; why not just raise Defect when you import the module |
00:20:40 | FromDiscord | <cabboose> beautiful |
00:22:27 | FromDiscord | <Elegantbeef> Sounds lovely, now where does this idea come from? |
00:23:48 | FromDiscord | <cabboose> Such passion |
00:23:56 | FromDiscord | <cabboose> https://media.discordapp.net/attachments/371759389889003532/885681959957839892/image0.png |
00:25:07 | FromDiscord | <Elegantbeef> I mean anyone with a brain will say what hax said |
00:25:13 | FromDiscord | <cabboose> Of course |
00:25:31 | FromDiscord | <cabboose> But doesn’t it just make you itch to sprinkle some defects into his life |
00:25:50 | FromDiscord | <Elegantbeef> Not really cause i also have similar views to him with regards to defects |
00:25:50 | FromDiscord | <Varriount> In reply to @cabboose "haxscramper is making a": Doesn't Nimteropt already do that? |
00:26:26 | FromDiscord | <cabboose> I can’t remember exactly what he’s making but it’s beyond the current design as far as i remember |
00:26:33 | FromDiscord | <cabboose> something super hacky |
00:27:32 | FromDiscord | <Elegantbeef> https://github.com/haxscramper/hcparse |
00:27:34 | nrds | <R2D299> itHub: 7"High-level nim bindings for parsing C/C++ code" |
00:28:07 | FromDiscord | <cabboose> There you go |
00:33:35 | FromDiscord | <leorize> bummer, I raise Defect a lot, didn't know it was so evil |
00:33:37 | FromDiscord | <leorize> time to raise more of them |
00:34:01 | FromDiscord | <Elegantbeef> I mean it's only evil if people dont understand what they mean and what they do |
00:34:35 | FromDiscord | <Elegantbeef> You know what they do so i trust you! 😛 |
00:36:10 | FromDiscord | <cabboose> A man after my own heart :’) |
01:10:27 | * | neurocyte6 joined #nim |
01:12:30 | * | neurocyte quit (Ping timeout: 260 seconds) |
01:12:30 | * | neurocyte6 is now known as neurocyte |
01:28:48 | FromDiscord | <auxym> so... this has nothing to do with nim, but I'll try anyways since you guys are cool: say I have the following C macro defined: `#define MTB_BASE 0x41006000UL`. And a struct defines a field of the same name `typedef struct {... uint32_t MTB_BASE ...} MTB_Type`. Any way to access that struct field like `mtb->MTB_BASE` by preventing macro expansion somehow? |
01:29:46 | FromDiscord | <leorize> wdym prevent macro expansion? |
01:30:09 | FromDiscord | <auxym> prevent `MTB_BASE` from being replaced by `0x...` |
01:30:31 | FromDiscord | <leorize> you rename the C macro \:) |
01:30:31 | FromDiscord | <Elegantbeef> Welcome to preprocessor hell |
01:30:45 | FromDiscord | <auxym> ps. this is from code being generated by ARM's SVDConv tool, for which they don't provide code, and produces question results, like this |
01:30:51 | FromDiscord | <auxym> yay |
01:30:53 | FromDiscord | <leorize> yea, the preprocessor doesn't understand C, it only knows how to copy-paste |
01:31:11 | FromDiscord | <auxym> yeh, I'll fix that crap manually I guess |
01:31:37 | FromDiscord | <auxym> thanks |
01:31:39 | FromDiscord | <leorize> if you have a tool that can parse C, just use it to alter the faulty macro automatically |
01:32:22 | FromDiscord | <leorize> or you can something that automagically lowercase all field names \:p |
01:37:29 | * | arkurious quit (Quit: Leaving) |
01:40:07 | FromDiscord | <Varriount> In reply to @auxym "so... this has nothing": Would defining another macro (`#define MTB_BASE_FIELD_NAME MTB_BASE`) before the original C macro, then using that new macro as the field name work? |
01:41:04 | FromDiscord | <auxym> Yeah, could work. Just trying to get a quick hack working so I'll patch it manually for now (with lowercase). Thanks though |
01:41:13 | FromDiscord | <Varriount> Or, I think you could use token concatenation (if I recall, it would be something like `#define MTB_PREFIX(x) MTB##x`) |
01:51:07 | * | audiophile_ quit (Quit: Default Quit Message) |
02:16:22 | * | audiophile_ joined #nim |
02:18:03 | * | audiophile joined #nim |
02:21:47 | * | audiophile_ quit (Ping timeout: 252 seconds) |
02:21:55 | * | audiophile is now known as audiophile_ |
02:29:10 | FromDiscord | <Alea> sent a code paste, see https://play.nim-lang.org/#ix=3yqh |
02:29:52 | FromDiscord | <impbox [ftsf]> @Alea where did beginDrawing come from? |
02:30:14 | FromDiscord | <impbox [ftsf]> it'll be either a macro or template |
02:30:21 | FromDiscord | <Alea> ah found this |
02:30:23 | FromDiscord | <Alea> https://media.discordapp.net/attachments/371759389889003532/885713781479571486/unknown.png |
02:30:44 | FromDiscord | <impbox [ftsf]> looks like raylib, yup, they're templates |
02:31:03 | FromDiscord | <impbox [ftsf]> you can pass a block of code to a template via the : indent syntax |
02:31:50 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3yqi |
02:32:18 | FromDiscord | <impbox [ftsf]> body is whatever you put indented after the colon |
02:34:07 | FromDiscord | <Alea> also has anyone run into nimble just getting stuck while installing a package off github? |
02:34:19 | FromDiscord | <Alea> oh wait |
02:34:24 | FromDiscord | <Alea> forgot that this package is huge |
02:40:19 | FromDiscord | <aleclarson> sent a code paste, see https://paste.rs/kYi |
02:41:39 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3yqk |
02:41:43 | FromDiscord | <Elegantbeef> Probably the ugliest solution and probably want a function |
02:42:09 | FromDiscord | <Elegantbeef> Or make your own `isEnum[T: enum](s: string): bool` |
02:52:30 | FromDiscord | <aleclarson> thx beef |
02:55:35 | * | Terry[m] joined #nim |
03:02:49 | FromDiscord | <Alea> so stupid idea, but is there anyway to make a macro for curly braces? |
03:02:56 | FromDiscord | <Alea> like c-style |
03:03:11 | FromDiscord | <Alea> presumably just making it so that {} = () |
03:03:49 | FromDiscord | <leorize> you might have better luck making an editor plugin that renders `{}` at indent regions |
03:09:07 | FromDiscord | <impbox [ftsf]> i do miss being able to jump from start to end of blocks in my editor |
03:09:10 | FromDiscord | <impbox [ftsf]> probably a plugin for that |
03:29:57 | * | audiophile_ quit (Quit: Default Quit Message) |
03:34:38 | * | mdbauman__ joined #nim |
03:38:06 | * | mdbauman_ quit (Ping timeout: 260 seconds) |
03:53:20 | FromDiscord | <leorize> if you use neovim, then `]]` or `[]` should work |
03:58:49 | FromDiscord | <impbox [ftsf]> i use good ol vim |
03:59:20 | FromDiscord | <impbox [ftsf]> i've tried neovim a few times but run into issues, maybe i'll give it another go |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.2.1) |
04:06:29 | * | supakeen joined #nim |
04:14:01 | * | rockcavera quit (Remote host closed the connection) |
04:30:32 | NimEventer | New Nimble package! genny - Generate a shared library and bindings for many languages., see https://github.com/treeform/genny |
04:30:35 | nrds | <R2D299> itHub: 7"Generate a shared library and bindings for many languages." |
04:33:11 | * | Guest77 joined #nim |
04:41:17 | FromDiscord | <impbox [ftsf]> Nice! |
04:54:26 | * | Guest77 quit (Quit: Client closed) |
05:04:53 | nrds | <Prestige99> is "sound" the go-to cross platform sound lib? Looks decent but I don't see a release - just sitting at version 0.1.0 |
05:09:02 | * | arfy joined #nim |
05:16:53 | FromDiscord | <impbox [ftsf]> doing what with sound? |
05:18:26 | nrds | <Prestige99> playing music and sounds in a game |
05:18:39 | FromDiscord | <impbox [ftsf]> Use SDL! |
05:19:03 | FromDiscord | <Elegantbeef> openal(slappy) is good aswell |
05:19:10 | nrds | <Prestige99> just for sound? |
05:19:52 | FromDiscord | <Elegantbeef> You can |
05:20:16 | FromDiscord | <Elegantbeef> https://wiki.libsdl.org/SDL_Init you can init specific systems |
05:20:40 | FromDiscord | <impbox [ftsf]> Prestige, what are you using for the rest of your game? |
05:20:54 | FromDiscord | <impbox [ftsf]> but yeah, can use SDL just for audio if you like |
05:20:57 | nrds | <Prestige99> Experimenting with using pixie for rendering |
05:21:05 | FromDiscord | <impbox [ftsf]> and input? |
05:21:13 | nrds | <Prestige99> glfw |
05:21:52 | FromDiscord | <impbox [ftsf]> ahh k, i'd just use SDL for all of the above =p |
05:22:11 | * | Doraemon joined #nim |
05:22:40 | FromDiscord | <impbox [ftsf]> can pixie draw to any surface? |
05:22:52 | FromDiscord | <impbox [ftsf]> looks like it can work with SDL as well |
05:22:58 | FromDiscord | <Elegantbeef> It just renders to an internal texture |
05:23:20 | FromDiscord | <Elegantbeef> You can in theory use any window context manager aslong as you can copy to it |
05:24:30 | * | NeoCron quit (Ping timeout: 260 seconds) |
05:25:17 | nrds | <Prestige99> I have it rendering with glfw to the screen, should also allow for shaders |
05:25:26 | nrds | <Prestige99> maybe more complicated than it needs to be :P |
05:28:28 | FromDiscord | <impbox [ftsf]> probably easy to swap out for SDL2_nim and can do shaders with that as well as input + audio |
05:32:35 | nrds | <Prestige99> Hm I'll look into that, thanks |
05:32:52 | FromDiscord | <impbox [ftsf]> there's a pixie SDL example |
05:33:46 | * | xet7 quit (Quit: Leaving) |
05:35:57 | * | xet7 joined #nim |
05:50:01 | FromDiscord | <Varriount> Zevv: I posted a link to the failing grammar in the GitHub issue. (https://github.com/Varriount/squint) |
05:52:33 | * | xet7 quit (Remote host closed the connection) |
06:05:39 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3yqM |
06:06:11 | FromDiscord | <Elegantbeef> Cause that's super dangerous to do? |
06:06:16 | FromDiscord | <Elegantbeef> plus we have bitsets |
06:07:15 | FromDiscord | <Rika> Because enums are not sets? |
06:11:58 | * | max22- joined #nim |
06:19:33 | * | PMunch joined #nim |
06:19:51 | FromDiscord | <codic> I don't want a set, I want an enum |
06:20:06 | FromDiscord | <codic> i guess it's dangerous because it can go out of bounds, fair |
06:20:17 | FromDiscord | <codic> just makes working with old C apis inconvinent |
06:20:32 | FromDiscord | <codic> too lazy to wrap it all 😛 |
06:20:55 | FromDiscord | <Elegantbeef> But just use a bitset |
06:21:27 | FromDiscord | <Elegantbeef> I dont know the API so dont know why you cannot just use a bitset |
06:22:58 | FromDiscord | <impbox [ftsf]> aww playground down |
06:24:07 | FromDiscord | <codic> bc the C api wants an enum, eg `xcb_grab_mode_t` |
06:24:51 | FromDiscord | <codic> and it's not very common to need bitwise ops anyways |
06:24:56 | FromDiscord | <codic> so I think using enums is a reasonable deicsion |
06:25:08 | FromDiscord | <impbox [ftsf]> can't you map a nim set to a c enum? |
06:25:10 | FromDiscord | <codic> they could also have used constants |
06:25:13 | FromDiscord | <codic> how do you do that? |
06:25:55 | FromDiscord | <impbox [ftsf]> https://nim-lang.org/docs/manual.html#set-type-bit-fields example here |
06:26:01 | PMunch | @imp, rebooting the playground now |
06:26:57 | FromDiscord | <codic> hmm, yeah I could do that... |
06:27:01 | FromDiscord | <codic> don't really have a use case |
06:27:17 | FromDiscord | <impbox [ftsf]> well if you want those operators you showed above, that's what bitsets are for |
06:27:24 | FromDiscord | <Elegantbeef> Also i dont get the point for your use case `xcb_grab_mode_t` |
06:27:34 | FromDiscord | <Elegantbeef> It has either sync or async |
06:37:47 | PMunch | @imp, playground is back now |
06:38:29 | FromDiscord | <impbox [ftsf]> \o/ thanks <3 |
06:50:49 | * | jjido joined #nim |
06:55:34 | FromDiscord | <Varriount> https://media.discordapp.net/attachments/371759389889003532/885780522016575498/unknown.png |
06:56:08 | FromDiscord | <Varriount> I'm attempting to compile my NPeg grammar with `-d:release` |
06:56:20 | * | max22- quit (Ping timeout: 260 seconds) |
07:00:13 | FromDiscord | <Rika> In reply to @codic "bc the C api": Just because the C api wants an enum doesn’t mean it maps to an enum in Nim |
07:12:51 | * | max22- joined #nim |
07:16:14 | FromDiscord | <Yardanico> hacktoberfest this year will count GitLab PRs too |
07:16:15 | FromDiscord | <Yardanico> "You can now have PRs submitted via Gitlab count towards your Hacktoberfest goal!" |
07:20:11 | NimEventer | New thread by Filip: Why is backward index operator [^1] not zero based [^0]?, see https://forum.nim-lang.org/t/8408 |
07:30:48 | FromDiscord | <cabboose> Because stepping back in the index would be the last in the sequence |
07:30:52 | FromDiscord | <cabboose> 🤨 |
07:31:10 | FromDiscord | <cabboose> Carrot 0 would just be 0 lol |
07:31:48 | FromDiscord | <Rika> it's just like that because of opinion though |
07:33:01 | FromDiscord | <impbox [ftsf]> i found it confusing at first too |
07:33:01 | * | PMunch quit (Read error: Connection reset by peer) |
07:33:03 | FromDiscord | <impbox [ftsf]> used to it now |
07:33:13 | FromDiscord | <cabboose> I think the semantics are more intuitive that carrot index would be that many before 0 |
07:33:21 | FromDiscord | <impbox [ftsf]> ^0 for last would have made more sense to me, not sure if there's any good reason for it one way or the other |
07:34:13 | NimEventer | New thread by Marks: What is the status of Nim IUP?, see https://forum.nim-lang.org/t/8409 |
07:34:45 | FromDiscord | <cabboose> I guess it depends whether you consider the carrot index to be looking at the sequence reversed or whether it is you iterating backwards from 0 in the same index |
07:35:04 | FromDiscord | <cabboose> Wait that might have been confusing |
07:35:11 | FromDiscord | <cabboose> Either way I get what you mean |
07:35:20 | FromDiscord | <Rika> In reply to @impbox "^0 for last would": probably because of people used to using -1 for last index |
07:35:28 | FromDiscord | <Elegantbeef> I'm in party it takes 3 seconds to realize you've fucked up and adapt! 😀 |
07:35:36 | FromDiscord | <cabboose> Ah yeah good point |
07:35:37 | FromDiscord | <impbox [ftsf]> @Rika yeah that could be it |
07:35:58 | FromDiscord | <impbox [ftsf]> yeah, it wasn't a hard thing to get used to, though i can imagine some bugs could be caused by it |
07:37:06 | FromDiscord | <cabboose> Pretty easy to implement some kind of sugar for that though right |
07:37:08 | FromDiscord | <haxscramper> I also tried to figure out what pythong is doing after answering the question, just to have something to compare to |
07:37:11 | FromDiscord | <haxscramper> and IMO it makes no sense |
07:37:14 | FromDiscord | <impbox [ftsf]> `Builtin roof operator that can be used for convenient array access. a[^x] is a shortcut for a[a.len-x].` |
07:37:18 | FromDiscord | <impbox [ftsf]> at least the docs explain it |
07:37:41 | FromDiscord | <haxscramper> `[1,3,4][-1]` is `4`, but `[1, 3,4][0:-1]` is `[1,3]` |
07:37:57 | FromDiscord | <haxscramper> like what |
07:38:01 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3yr2 |
07:38:09 | * | PMunch joined #nim |
07:38:14 | FromDiscord | <impbox [ftsf]> err |
07:38:24 | FromDiscord | <cabboose> raise Defect |
07:38:34 | FromDiscord | <haxscramper> `anger` |
07:38:45 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
07:39:00 | FromDiscord | <haxscramper> Well, next thing woild be `raise Defect(nil)` |
07:39:06 | FromDiscord | <Rika> `[:]` is akin to `[..<]` |
07:39:25 | FromDiscord | <haxscramper> yes, but `[1,3,4][0:-0]` is `[]` |
07:39:33 | FromDiscord | <Rika> -0 isnt valid lol |
07:39:44 | FromDiscord | <Rika> python just being 20000 iq |
07:39:45 | FromDiscord | <haxscramper> ah |
07:39:54 | FromDiscord | <haxscramper> so I literally can't do slice until the end? |
07:39:56 | FromDiscord | <Rika> you can |
07:39:59 | FromDiscord | <Rika> omit the numbner |
07:40:01 | FromDiscord | <Rika> (edit) "numbner" => "number" |
07:40:04 | FromDiscord | <Rika> `[0:]` |
07:40:07 | FromDiscord | <Rika> yes |
07:40:09 | FromDiscord | <Rika> very intuitive |
07:40:19 | FromDiscord | <Rika> extremely human thought friendly |
07:40:20 | FromDiscord | <cabboose> Sometimes Python is just the superior language guys |
07:40:29 | FromDiscord | <Rika> lmfao |
07:40:34 | FromDiscord | <impbox [ftsf]> [:] |
07:40:45 | FromDiscord | <Rika> that returns a shallow copy of the whole array |
07:40:59 | FromDiscord | <haxscramper> `[::-1]` |
07:41:04 | FromDiscord | <cabboose> Hahahahaha |
07:41:06 | FromDiscord | <Rika> reversed array |
07:41:09 | FromDiscord | <impbox [ftsf]> my head |
07:41:12 | FromDiscord | <Rika> yes |
07:41:33 | FromDiscord | <impbox [ftsf]> glad i don't touch python any more |
07:41:36 | FromDiscord | <Rika> same |
07:41:41 | FromDiscord | <haxscramper> It physically pains me to read that SO answer about slicing |
07:41:41 | FromDiscord | <cabboose> Ditto |
07:41:56 | FromDiscord | <impbox [ftsf]> i remember thinking python was the most amazing thing ever... |
07:42:02 | FromDiscord | <impbox [ftsf]> when i discovered it after using PHP |
07:42:27 | FromDiscord | <Rika> i dont remember ever thinking that python was great, even as a beginner, only "its neat" |
07:42:39 | FromDiscord | <impbox [ftsf]> it was pretty amazing after PHP tbh |
07:43:02 | FromDiscord | <Rika> youre comparing a rock to a computer though |
07:43:31 | FromDiscord | <cabboose> Rock to a snake |
07:43:33 | FromDiscord | <enthus1ast> PHP is strange, but currently it is not that bad, it has good class support etc |
07:43:43 | FromDiscord | <enthus1ast> (omg i have good words for PHP) |
07:44:00 | * | PMunch quit (Read error: Connection reset by peer) |
07:44:04 | FromDiscord | <Rika> who's banning him |
07:44:07 | FromDiscord | <Rika> he cant be trusted |
07:44:12 | FromDiscord | <cabboose> I’m just quitting the discord |
07:44:16 | FromDiscord | <cabboose> I’m quitting nim |
07:44:26 | FromDiscord | <Elegantbeef> Good riddance! 😛 |
07:44:36 | FromDiscord | <Rika> nah it would have been better if you left, beef |
07:47:20 | FromDiscord | <Yardanico> no i like beef |
07:47:23 | FromDiscord | <Elegantbeef> You cant get rid of me that easily |
07:47:31 | FromDiscord | <Rika> what the fuck |
07:47:38 | FromDiscord | <Rika> someone likes beef? |
07:47:44 | FromDiscord | <Yardanico> yes |
07:47:45 | FromDiscord | <Yardanico> it's tasty |
07:47:47 | FromDiscord | <Rika> oh did you mean the food |
07:47:48 | FromDiscord | <Rika> yeah |
07:47:52 | FromDiscord | <Yardanico> no i mean beef the person too |
07:47:56 | FromDiscord | <Rika> no way |
07:47:56 | FromDiscord | <Elegantbeef> I'm like crabs but for your brain, so sphyillis |
07:48:02 | FromDiscord | <impbox [ftsf]> who else will respond to me at any time of the day? |
07:48:02 | FromDiscord | <Yardanico> also we should probably move to #offtopic :P |
07:48:06 | FromDiscord | <Rika> syphilis you mean |
07:48:33 | FromDiscord | <Elegantbeef> Yea i cannot spell |
07:48:34 | * | PMunch joined #nim |
07:48:47 | FromDiscord | <impbox [ftsf]> you heard the yard! |
07:48:49 | FromDiscord | <Elegantbeef> We've established this time and time again |
07:49:07 | FromDiscord | <Rika> yard is dum |
07:49:13 | FromDiscord | <Rika> imperial in general is dum |
07:49:35 | FromDiscord | <Yardanico> hey, i didn't make my nickname because of some weird random measurement systems |
07:49:41 | * | PMunch quit (Remote host closed the connection) |
07:50:18 | FromDiscord | <Elegantbeef> Should've you'd be a lot cooler |
07:50:30 | FromDiscord | <Elegantbeef> Take my word for it, i'm talking 3 three people that despise me |
07:51:34 | * | PMunch joined #nim |
07:51:35 | FromDiscord | <Rika> beef's english systems are destabilising |
07:51:58 | FromDiscord | <Hamid Bluri> that's not a big deal |
07:52:11 | FromDiscord | <Rika> i mean beef isnt a big deal in general |
07:52:43 | FromDiscord | <Yardanico> :FeelsOkayMan: 👉 #offtopic |
07:53:10 | FromDiscord | <Elegantbeef> Any nim stuff we can talk about, like bug fixes?! |
07:53:24 | FromDiscord | <Rika> you're a bug |
07:53:30 | FromDiscord | <Yardanico> In reply to @Rika "you're a bug": rika |
07:55:25 | FromDiscord | <impbox [ftsf]> @ElegantBeef we could implement all of python's horrible slice stuff in nim |
07:55:57 | FromDiscord | <Elegantbeef> I could also strip down to nothing and live in the forest |
07:56:18 | FromDiscord | <Rika> please dont implement python slices in nim |
07:56:30 | FromDiscord | <Elegantbeef> I dont see the value in making shitty software.... on second thought i've looked at my code all i write is shit |
07:57:10 | FromDiscord | <Elegantbeef> This guy has PRs in the nim compiler, get scared 😛 |
07:57:27 | FromDiscord | <Hamid Bluri> question |
07:58:01 | FromDiscord | <Hamid Bluri> how do you test nim compiler when you edit the parser? |
07:58:08 | FromDiscord | <Yardanico> you run tests |
07:58:09 | FromDiscord | <Hamid Bluri> does it take a long time to test? |
07:58:12 | FromDiscord | <Elegantbeef> I dont edit the parser |
07:58:31 | FromDiscord | <Yardanico> In reply to @hamidb80 "does it take a": for testing everything we have CI, you can only test parts that you think might be affected by your change |
07:58:38 | FromDiscord | <Yardanico> (locally) |
07:58:39 | FromDiscord | <haxscramper> `tests/tastspec.nim` |
07:58:49 | FromDiscord | <Elegantbeef> I generally have a test file i run and then run the test suite for the specific area i was testing then push to a repo and get the first have of the CI |
07:58:50 | FromDiscord | <haxscramper> For parser AST add things ther |
07:59:03 | FromDiscord | <Elegantbeef> first half\ |
07:59:16 | FromDiscord | <haxscramper> In reply to @haxscramper "`tests/tastspec.nim`": https://github.com/nim-lang/Nim/pull/18798/files |
07:59:52 | FromDiscord | <Hamid Bluri> and why does sometimes CI fail without a specefic reason? |
08:00:14 | FromDiscord | <Elegantbeef> Sometimes it just doesnt live happily |
08:00:37 | FromDiscord | <Elegantbeef> Locally atleast it should be more stable |
08:09:55 | FromDiscord | <Elegantbeef> Also @Hamid Bluri what are you working on? |
08:11:15 | FromDiscord | <Hamid Bluri> what do you mean |
08:11:32 | FromDiscord | <Elegantbeef> With the parser |
08:11:56 | FromDiscord | <Hamid Bluri> just curious how did you touch it 😄 |
08:12:17 | FromDiscord | <Hamid Bluri> `timeocoder` asked me to improve nimpretty |
08:12:30 | FromDiscord | <Hamid Bluri> but i couldn't find anything related to nimpretty in nim repo |
08:12:31 | FromDiscord | <Elegantbeef> Ah, i've never touched the parser so good luck |
08:12:48 | FromDiscord | <Elegantbeef> Semantics are fun! |
08:12:58 | FromDiscord | <Hamid Bluri> In reply to @Elegantbeef "Ah, i've never touched": i remember you did a pr |
08:13:08 | FromDiscord | <Yardanico> In reply to @hamidb80 "but i couldn't find": nimpretty is in https://github.com/nim-lang/Nim/tree/devel/nimpretty |
08:13:10 | FromDiscord | <Elegantbeef> "a" \:D |
08:13:17 | FromDiscord | <Yardanico> also search for when defined(nimpretty) in the compiler source |
08:13:28 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/885800121621684254/unknown.png |
08:22:39 | FromDiscord | <cabboose> Nup now I’m staying to spite beef |
08:27:20 | FromDiscord | <Elegantbeef> Damn spite beef |
09:18:47 | FromDiscord | <cabboose> Ok what do i need for cps |
09:18:56 | FromDiscord | <cabboose> devel check |
09:19:16 | FromDiscord | <cabboose> keeps whinging about the proc mismatch |
09:19:30 | arfy | hi there. I just wanted to say I've been checking out nim for a day or two and really enjoying it so far. It's what would happen if you could comple python straight to native code! :) |
09:19:40 | arfy | compile python* |
09:21:22 | FromDiscord | <cabboose> hmm im actually getting an error using choosenim trying to update my devel toolchain |
09:26:24 | NimEventer | New thread by Ingo: Keep a http connection alive and hand it off to another proc, see https://forum.nim-lang.org/t/8410 |
09:26:32 | FromDiscord | <Rika> In reply to @cabboose "hmm im actually getting": What errors |
09:28:20 | FromDiscord | <cabboose> Ah nothing; I thought I closed VS Code but there was something still running in the background which kept nimsuggest running |
09:28:36 | FromDiscord | <cabboose> so that just prevented overwrites |
10:19:44 | FromDiscord | <Kiloneie> Huh, switching from the current GC to GC ORC, changes the output of "echo repr b" b being a pointer to "a", so that it outputs ptr 10 instead of the memory address.↵↵How can i see the memory address now ? |
10:21:48 | * | xet7 joined #nim |
10:34:42 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
10:48:43 | * | xet7 quit (Remote host closed the connection) |
11:12:43 | NimEventer | New post on r/nim by zemja_: Is Nim in Action outdated?, see https://reddit.com/r/nim/comments/plixt9/is_nim_in_action_outdated/ |
11:26:15 | FromDiscord | <ant1fact> In reply to @treeform "I think it always": thanks for that link! |
11:34:10 | FromDiscord | <ant1fact> Is it possible to batch export all types and their members in a .nim file without marking everything with its own ? |
11:35:28 | FromDiscord | <enthus1ast> the new version has a import ... {.all.} pragma, but i'm not sure if this is ugly for normal code yet (useful for test, though |
11:35:58 | FromDiscord | <ant1fact> will try that, thanks |
11:36:57 | FromDiscord | <enthus1ast> personally i would avoid it for normal code |
11:37:27 | FromDiscord | <enthus1ast> maybe in cases like c++ "friends" class |
11:38:15 | FromDiscord | <haxscramper> `import {.all.}` is for cases where you want to extend library implementation but have to acces internal details |
11:38:18 | FromDiscord | <Rika> I would refrain from doing the import all |
11:38:21 | FromDiscord | <haxscramper> for example `getOpt` from talbe |
11:38:23 | FromDiscord | <haxscramper> (edit) "talbe" => "table" |
11:38:37 | FromDiscord | <haxscramper> Or I needed to add getLowestValue for `fusion/btreetabs` |
11:38:57 | FromDiscord | <haxscramper> Also compiler has tons of procs that are not exported, but I just have to access them |
11:39:14 | FromDiscord | <haxscramper> Otherwise I would have to reimplement thousands of lines of code |
11:39:25 | FromDiscord | <haxscramper> reimplement/copy and maintain in my library |
11:43:15 | * | jjido joined #nim |
11:55:00 | * | max22- quit (Ping timeout: 260 seconds) |
12:00:41 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.2.1) |
12:06:30 | * | supakeen joined #nim |
12:16:26 | * | arkurious joined #nim |
12:19:56 | FromDiscord | <ant1fact> how can I do the following?↵↵case char↵of 0..9: do_something() |
12:20:17 | FromDiscord | <ant1fact> should I just write out each integer as a char like '0', '1', '2', ... '9' |
12:20:20 | FromDiscord | <ant1fact> or is there a better way |
12:21:59 | FromDiscord | <konsumlamm> `0` is different from `'0'` |
12:22:03 | FromDiscord | <Rika> yes |
12:24:41 | FromDiscord | <srozb> hey, does anybody know how to call an arbitrary address in memory in Nim (suppose I already know the function address and parameters). As an example let sleepFuncAddr = 0xdeadb33f, how to make it proc sleepFunc(msec: int) and finally call sleepFunc(1234) ? I know it's exactly what one should't do from security perspective but still want to do such thing |
12:25:29 | FromDiscord | <Rika> do yyou know the exact parameters, return type, and pragmas the proc has? |
12:25:35 | FromDiscord | <srozb> yes |
12:26:02 | FromDiscord | <Rika> `let sleepFunc = cast[proc(...): ... {. ... .}](0xdeadbeef)` |
12:26:09 | FromDiscord | <srozb> oh cool |
12:26:10 | FromDiscord | <Rika> actually no |
12:26:16 | FromDiscord | <Rika> well no yeah thats right |
12:26:25 | FromDiscord | <Rika> i think... |
12:35:17 | FromDiscord | <srozb> suppose procAddr is valid function address in process memory (actually kernel32.dll Sleep function, that only takes one DWORD argument), following code: let sleepFun = cast[proc(msec: DWORD)](procAddr) gives me Error: expression cannot be cast to proc (msec: DWORD){.closure.} |
12:36:36 | PMunch | Try: `let sleepFun = cast[proc(msec: DWORD) {.cdecl.}](procAddr)` |
12:36:43 | PMunch | Or whatever calling convention it uses |
12:36:57 | PMunch | It definitely doesn't use the closure calling convention :P |
12:37:26 | FromDiscord | <srozb> and its working! |
12:37:38 | FromDiscord | <srozb> thanks! how cool is that anyway! |
12:40:55 | PMunch | No problem :) |
12:56:17 | * | Vladar joined #nim |
12:59:39 | * | Guest2 joined #nim |
13:15:12 | FromDiscord | <impbox [ftsf]> I guess windows doesn't do ASLR then |
13:24:19 | * | Guest2 quit (Quit: Client closed) |
13:37:16 | * | max22- joined #nim |
13:49:53 | PMunch | Hmm, is there a way to collapse recurring characters in a string in Nim? |
13:50:10 | PMunch | Say I have "haaaarp" and I want "harp" |
13:52:37 | nrds | <Prestige99> Don't think so |
13:53:17 | nrds | <Prestige99> wouldn't be too hard to write though I guess |
14:02:30 | * | PMunch quit (Quit: Leaving) |
14:27:32 | * | rockcavera joined #nim |
14:27:32 | * | rockcavera quit (Changing host) |
14:27:32 | * | rockcavera joined #nim |
14:32:39 | FromDiscord | <aleclarson> PMunch you must have a good name, cuz i mentioned you in my dream for some reason \:P |
14:33:56 | FromDiscord | <Gumber aka Zachary Carter> that's pretttttty creepy |
14:34:00 | FromDiscord | <Gumber aka Zachary Carter> did you use his real name or PMunch? |
14:34:13 | FromDiscord | <Gumber aka Zachary Carter> if it was the former, that's even creepier |
14:36:51 | FromDiscord | <aleclarson> lol the latter |
14:37:10 | FromDiscord | <aleclarson> it was smth like "oh you know PMunch? yeah i see him in the nim discord all the time" |
14:37:15 | FromDiscord | <aleclarson> wtf brain |
14:38:37 | FromDiscord | <Gumber aka Zachary Carter> yeah that's weird |
14:38:45 | FromDiscord | <Gumber aka Zachary Carter> known PMunch for at least 3 years I think |
14:38:50 | FromDiscord | <Gumber aka Zachary Carter> never once dreamed about him |
14:39:16 | * | ykaelig joined #nim |
14:39:20 | FromDiscord | <Gumber aka Zachary Carter> def had dreams about people I barely know / just met though |
14:39:43 | FromDiscord | <Gumber aka Zachary Carter> always a trippy experience |
14:45:22 | NimEventer | New thread by Skaruts: I'm having a Nim+Lua+Libtcod callback wrapping problem, see https://forum.nim-lang.org/t/8411 |
14:46:48 | FromDiscord | <aleclarson> yeah, the brain is frickin random when it comes to dreams.↵sometimes i wonder if the randomizer in my brain is cryptographically sound |
14:48:54 | FromDiscord | <Rika> Depends on what you mean by randomiser |
14:49:05 | FromDiscord | <cabboose> sent a code paste, see https://paste.rs/Mfe |
14:49:07 | FromDiscord | <Rika> Like “you saying a random number”? No because of biased |
14:49:34 | FromDiscord | <aleclarson> like unconscious rng in dream state |
14:49:53 | FromDiscord | <cabboose> however `proc test() {.cps:Continuation.} = echo “hello world”` would function as prescribed |
14:51:19 | FromDiscord | <cabboose> type mismatch being along the lines of ‘got proc () C {.gcsafe, locks:0.} but expected proc() Continuation {.nimcall.}’ etc |
14:51:46 | FromDiscord | <Rika> In reply to @cabboose "So I didn’t have": I’m assuming it needs to be exported? Just a guess |
14:51:52 | FromDiscord | <Rika> Almost literal shot in the dark |
14:52:04 | FromDiscord | <cabboose> Tried exporting the C |
14:52:30 | FromDiscord | <cabboose> I dont know if I did with the test but I could try that tomorrow; seems like an odd requirement :’) |
14:52:31 | FromDiscord | <Rika> Maybe conflicting with some name |
14:52:45 | FromDiscord | <Rika> Since it’s a single letter |
14:52:51 | FromDiscord | <cabboose> I did try other proc names and continuation names |
14:52:55 | FromDiscord | <cabboose> like TestC |
14:52:58 | FromDiscord | <cabboose> for the continuation |
14:53:00 | FromDiscord | <cabboose> still no luck |
14:53:15 | FromDiscord | <Rika> Maybe it is the export then |
14:53:18 | FromDiscord | <cabboose> I’ll message their IRC tomorrow if I keep hitting a wall |
14:53:23 | FromDiscord | <cabboose> aiight ill give it a shot |
14:53:25 | FromDiscord | <cabboose> thanks |
14:53:27 | FromDiscord | <cabboose> goodnight cobba |
14:53:35 | FromDiscord | <Rika> Who? |
14:53:50 | FromDiscord | <Rika> Either I am too young or too old to understand the reference |
14:57:53 | FromDiscord | <aleclarson> he must be australian |
15:07:34 | FromDiscord | <aleclarson> can a proc parameter have a default value? |
15:08:15 | FromDiscord | <Rika> Yes |
15:13:51 | FromDiscord | <Gumber aka Zachary Carter> must be the last parameter(s) defined in the proc signature |
15:15:24 | FromDiscord | <aleclarson> 😌 👍 |
15:17:22 | FromDiscord | <Gumber aka Zachary Carter> Are there any cheaper linux notebooks that compare to a macbook pro in terms of hardware capabilites that folks are aware of? |
15:17:47 | FromDiscord | <Gumber aka Zachary Carter> I want a laptop for game development, but I don't want to buy a gaming laptop and I don't really want to spend the money on a macbook pro if I don't have to... |
15:18:16 | FromDiscord | <Gumber aka Zachary Carter> I do want to run linux or mac on whatever I get though... I already have a desktop windows PC |
15:18:38 | FromDiscord | <Gumber aka Zachary Carter> I guess it's also a shitty time to be laptop shopping because of the chip shortage, but that's supposed to drag on for years potentially so.... |
15:21:04 | FromDiscord | <Rika> In reply to @Gumber "Are there any cheaper": Are you still on good terms with Lenovo? |
15:44:15 | FromDiscord | <aleclarson> is there a `.cast` pragma for "prove not nil"? |
15:44:39 | FromDiscord | <aleclarson> sent a code paste, see https://play.nim-lang.org/#ix=3ytr |
15:44:40 | FromDiscord | <Rika> you can just disable the warning |
15:45:56 | FromDiscord | <aleclarson> on a one-line basis? |
15:45:58 | FromDiscord | <enthus1ast> @Gumber aka Zachary Carter\: tuxedo maybe |
15:46:05 | FromDiscord | <aleclarson> (edit) "on a one-line basis?" => "for just one line?" |
15:47:16 | FromDiscord | <Gumber aka Zachary Carter> @Rika kind of forgot about them, will check out their current line up |
15:47:47 | FromDiscord | <aleclarson> In reply to @aleclarson "for just one line?": oh i guess casting works \:P↵`cast[Foo not nil](foo)` |
15:47:56 | FromDiscord | <Rika> i believe lenovo makes really linux friendly laptops (and actually also sells some with linux preloaded) |
15:48:03 | FromDiscord | <Rika> anyway idk why you asked here, i just realised |
16:00:18 | * | xet7 joined #nim |
16:01:34 | * | ykaelig quit (Quit: Client closed) |
16:06:40 | FromDiscord | <leorize> @cabboose\: Nim devel got a fix that broke CPS and we are fixing it |
16:06:41 | FromDiscord | <leorize> you can join cps discussion rooms for more details on the progress |
16:17:10 | FromDiscord | <Gumber aka Zachary Carter> In reply to @Rika "anyway idk why you": because I do what I want! |
16:17:23 | FromDiscord | <Rika> yards comin for ya |
16:17:27 | FromDiscord | <Gumber aka Zachary Carter> psh I'm a mod |
16:17:37 | FromDiscord | <Gumber aka Zachary Carter> he might be the admin / owner |
16:17:39 | FromDiscord | <Rika> hes a modder mod |
16:17:46 | FromDiscord | <Gumber aka Zachary Carter> but he's also the one that made me the mod for whatever reason |
16:17:52 | FromDiscord | <Gumber aka Zachary Carter> he must see something in me |
16:18:01 | FromDiscord | <Gumber aka Zachary Carter> believes in me |
16:18:03 | FromDiscord | <Rika> lol |
16:32:46 | * | vicfred joined #nim |
16:51:38 | FromDiscord | <reilly> In light of Rust's recent 1.55 update, in which they improved their float-parsing algorithm, what algorithm does Nim's float parser user? |
16:51:42 | FromDiscord | <reilly> (edit) "user?" => "use?" |
16:52:10 | FromDiscord | <haxscramper> nim 1.6. ships with dragonbox |
16:53:58 | FromDiscord | <Rika> what does rust use now? |
16:54:17 | FromDiscord | <pedroos (Pedro Sobota)> Hello there. I wanted to ask\: where is the definition of the tuple type in the NIm source code? |
16:54:41 | FromDiscord | <haxscramper> https://github.com/rust-lang/rust/pull/86761 |
16:55:21 | FromDiscord | <haxscramper> In reply to @pedroos (Pedro Sobota) "Hello there. I wanted": `tuple` does not have a definition in nim stdlib |
16:55:28 | FromDiscord | <haxscramper> Or you want to know where in compiler it is defiend? |
16:55:37 | FromDiscord | <pedroos (Pedro Sobota)> Yes, in compiler |
16:58:21 | FromDiscord | <haxscramper> tuple type is represented via `tyTuple` kind and it does not have a concrete definition from what I can tell. Instead it is separated into multiple locations in `ccgexprs/cgen` etc, |
16:59:16 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3ytK |
16:59:42 | FromDiscord | <pedroos (Pedro Sobota)> Great, so it's a compiler-only type |
17:00:05 | FromDiscord | <haxscramper> `ccgtype.mapType` shows how it is implemented |
17:00:17 | FromDiscord | <haxscramper> `/` how type is generated |
17:01:12 | * | jjido joined #nim |
17:01:17 | FromDiscord | <haxscramper> `/` how type is mapped, and discard what I said, that's a wrong explanation |
17:01:18 | FromDiscord | <Rika> pedroos: i mean its similar to how object is implemented i would say |
17:01:43 | NimEventer | New thread by Konradmb: Call parent `$` from overwritten converter?, see https://forum.nim-lang.org/t/8412 |
17:01:43 | FromDiscord | <pedroos (Pedro Sobota)> Ok, sorry I'm C# developer so I'm used to "everything is an object" |
17:05:08 | FromDiscord | <haxscramper> In reply to @pedroos (Pedro Sobota) "Great, so it's a": well, it is "magic" type, yes |
17:06:52 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
17:07:19 | FromDiscord | <pedroos (Pedro Sobota)> Yes, so I found this in mapType\: |
17:07:34 | FromDiscord | <pedroos (Pedro Sobota)> Where is ctStruct defined? I can't find it |
17:08:45 | FromDiscord | <pedroos (Pedro Sobota)> Oh! Nevermind, I found it at TCTypeKind. |
17:14:14 | FromDiscord | <pedroos (Pedro Sobota)> Is there a lot of the base library is implemented in compiler types vs. actual types? |
17:15:32 | FromDiscord | <haxscramper> tuple/string/set/seq |
17:15:32 | FromDiscord | <haxscramper> array |
17:16:11 | FromDiscord | <haxscramper> well, primitive types require special compiler support, because they are codegened into js/C/C++/VM code |
17:17:30 | FromDiscord | <pedroos (Pedro Sobota)> Oh, I see |
17:17:48 | * | tiorock joined #nim |
17:17:48 | * | tiorock quit (Changing host) |
17:17:48 | * | tiorock joined #nim |
17:17:49 | * | rockcavera is now known as Guest8197 |
17:17:49 | * | tiorock is now known as rockcavera |
17:18:17 | * | audiophile_ joined #nim |
17:19:02 | FromDiscord | <haxscramper> also `NimNode` |
17:19:33 | FromDiscord | <haxscramper> But that one is an absolute dark magic |
17:21:37 | * | Guest8197 quit (Ping timeout: 252 seconds) |
17:22:43 | FromDiscord | <pedroos (Pedro Sobota)> It's fun, well in c# as you may know, there is primitives basically as ints, floats and value types, but they have mirror structs in the base library |
17:23:01 | FromDiscord | <pedroos (Pedro Sobota)> So this is where it gets me so I don't find these definitions while searching Nim |
17:25:21 | FromDiscord | <haxscramper> You can look at the generated C code, if would be easier than searching in the compier |
17:25:22 | FromDiscord | <haxscramper> And more illustrative I guess |
17:25:40 | FromDiscord | <pedroos (Pedro Sobota)> Oh! Great one |
17:25:49 | FromDiscord | <haxscramper> `--linetrace:off --stacktrace:off -d:danger` to cleanup generated code from any extra checks etc. |
17:26:15 | FromDiscord | <haxscramper> `--nimcache:yourDir` and them see for a file named `@m<your-orginal-filename>.c` |
17:32:26 | FromDiscord | <haxscramper> Just definining type won't make it occur in the generated code due to dead code elimination, you need to use it somehow |
17:32:26 | FromDiscord | <haxscramper> Like `echo (123, 4)` |
17:32:29 | FromDiscord | <pedroos (Pedro Sobota)> A discard is enough in this case? |
17:32:33 | FromDiscord | <pedroos (Pedro Sobota)> I may get in the habit of seeing the generated C side by side... |
17:38:02 | FromDiscord | <haxscramper> I don't know about discard, it all depends on how smart dead code delimination is |
17:38:03 | FromDiscord | <pedroos (Pedro Sobota)> Yup... |
17:38:46 | FromDiscord | <Rika> I don’t think it’s that smart because a discarded proc call can still have effects |
17:39:50 | FromDiscord | <pedroos (Pedro Sobota)> Uhum, just trying to think about avoiding the prints (echos) but it's harmless |
17:40:15 | FromDiscord | <pedroos (Pedro Sobota)> Thank you guys |
17:45:24 | * | vicfred quit (Quit: Leaving) |
17:49:40 | * | robertmeta quit (Ping timeout: 250 seconds) |
17:50:48 | * | Zevv joined #nim |
17:51:02 | * | Zevv left #nim (#nim) |
17:51:56 | * | robertmeta joined #nim |
17:54:17 | * | jjido joined #nim |
18:00:57 | * | SebastianM joined #nim |
18:02:00 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
18:05:13 | * | jjido joined #nim |
18:27:04 | Terry[m] | Last night, I had a dream, a dream where Araq and Dominik were beating me with a book. They told me that if I don't write everything in macros then they will dig up my greatgrandmother and map her. |
18:27:13 | Terry[m] | I am not sure what that dream meant. |
18:27:37 | FromDiscord | <haxscramper> ... |
18:28:01 | FromDiscord | <haxscramper> I have only one response really, and it is `raise Defect(nil)` |
18:30:46 | FromDiscord | <Rika> hax you're gonna make me go insane with that statement |
18:35:45 | * | max22- quit (Ping timeout: 260 seconds) |
18:44:33 | FromDiscord | <ant1fact> how does one reset a variable to its defaulty empty state? |
18:44:36 | FromDiscord | <ant1fact> (edit) "defaulty" => "default" |
18:46:46 | FromDiscord | <ant1fact> for a seq[float] would I just set the variable to = @[] ? |
18:48:39 | FromDiscord | <Rika> you could |
18:49:06 | FromDiscord | <haxscramper> `var a: T; a = default typeof(a)` |
18:52:40 | FromDiscord | <Beans.> How do I pass a reference of a proc to another proc as a parameter, and then call that referenced proc in the proc it was passed to? I don't know how the original proc is going to be defined, or where, or what it's identifier would be. |
18:52:47 | FromDiscord | <Beans.> Here's some pseudocode of what I'm trying to do |
18:53:05 | FromDiscord | <Beans.> sent a code paste, see https://play.nim-lang.org/#ix=3yuu |
18:53:19 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
18:55:04 | FromDiscord | <Beans.> Sorry If I messed up my explanation, I'm new to nim |
18:56:20 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3yux |
18:56:25 | FromDiscord | <haxscramper> No need for extra `ref`, just use procedure name |
18:57:08 | * | SebastianM quit (Quit: Bye) |
18:57:19 | FromDiscord | <Beans.> Thanks! |
19:01:43 | * | xet7 quit (Remote host closed the connection) |
19:02:38 | * | xet7 joined #nim |
19:03:55 | * | max22- joined #nim |
19:10:25 | FromDiscord | <pedroos (Pedro Sobota)> Hi guys, I have one more question related to tuples. I am in INim and I'm typing 'tuple'. I am getting 'tuple' here, but what am I getting? Is this a type or not? |
19:12:34 | FromDiscord | <haxscramper> `tuple` as a type, without any further specification is a typeclass that means "any tuple" |
19:12:46 | FromDiscord | <haxscramper> Like `(1, 23) is tuple and (1, 3) is (int, int)` |
19:13:07 | FromDiscord | <haxscramper> `tuple/object/enum/proc/ref/ptr` etc. are special typeclasses |
19:13:29 | FromDiscord | <haxscramper> There are more |
19:15:28 | FromDiscord | <pedroos (Pedro Sobota)> Great... are typeclasses then a formal type in themselves...? or is there a way to inquire into wether an expression returns a typeclass, as distinct from a type? |
19:16:38 | FromDiscord | <haxscramper> no, typeclasses cannot be returned by an expression, you only can have a type literal |
19:17:03 | FromDiscord | <haxscramper> So `typeof(SomeInteger)` is `SomeInteger`, but you can't create variable of `SomeInteger` in any way |
19:17:09 | FromDiscord | <haxscramper> But `int is SomeInteger` |
19:17:34 | * | vicfred joined #nim |
19:17:35 | FromDiscord | <haxscramper> So typeclass is basically `SomeInteger = int or int8 or int16 or int32 ...` |
19:18:14 | FromDiscord | <haxscramper> And you can defined one yourself, but for `tuple` it requires some magic, since there is an infinite number of tuples, so you can't just `or` them together |
19:18:58 | FromDiscord | <haxscramper> I.e. not a "format type in themselves" but rather a shorthand for `or`ing things together |
19:22:10 | FromDiscord | <Recruit_main707> sent a code paste, see https://play.nim-lang.org/#ix=3yuE |
19:22:14 | FromDiscord | <Elegantbeef> Type classes are generic constraints |
19:23:33 | FromDiscord | <pedroos (Pedro Sobota)> Ok so both SomeInteger and int are type literals and SomeInteger is the one of the 'integers' typeclass... is this typeclass then like a union type? |
19:23:46 | FromDiscord | <Elegantbeef> It's not a union it's just to limit generics to specific types |
19:24:08 | FromDiscord | <haxscramper> it is a union of types |
19:24:19 | FromDiscord | <haxscramper> I.e. does not exist at runtime as TS union type |
19:24:20 | FromDiscord | <Elegantbeef> `proc someThing[T: int or float](a: T) = echo a` can only take `int` or `float` it doesnt take `int` and `float` |
19:24:41 | FromDiscord | <haxscramper> Strictly a compile-time thing |
19:27:09 | FromDiscord | <pedroos (Pedro Sobota)> By union I meant 'either' type, sorry... so is it like an 'either type' of these types int, int8... ? But informally so only the compiler knows about it...? Correct? |
19:27:19 | FromDiscord | <Recruit_main707> sent a code paste, see https://play.nim-lang.org/#ix=3yuF |
19:27:38 | FromDiscord | <Elegantbeef> You should be able to with a macro recruit |
19:28:04 | FromDiscord | <Elegantbeef> Yea pedroos sounds like you've got it |
19:28:28 | FromDiscord | <Elegantbeef> It's not a sumtype or union where at runtime it can store all the values, it's a compile time "When generating this procedure it only accepts X" |
19:29:19 | FromDiscord | <pedroos (Pedro Sobota)> Yeah |
19:44:46 | FromDiscord | <Elegantbeef> Hmm recruit i cannot reason my way around it right now |
19:44:47 | FromDiscord | <Elegantbeef> You can make a type class of any type you define |
19:44:47 | FromDiscord | <pedroos (Pedro Sobota)> @haxscramper\:matrix.org as for defining a typeclass myself... is it just defining a 'either type', like done at the compiler? And is this done only with structures found at the compiler, or is it a language construct? |
19:44:48 | FromDiscord | <Elegantbeef> That's an implict generic typeclass of all YourType instantiations |
19:44:50 | FromDiscord | <Elegantbeef> But you can also do `string or float` if you want or whatever types you have at your disposal |
19:44:53 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3yuJ |
19:48:24 | FromDiscord | <pedroos (Pedro Sobota)> Let me see.. this is like defining a method for any instance of YourType? |
19:49:20 | FromDiscord | <Elegantbeef> Yea |
19:49:26 | FromDiscord | <pedroos (Pedro Sobota)> I don't know if you mean the typeclass is in the T generic parameter |
19:49:44 | FromDiscord | <Elegantbeef> Well the typeclass here is that you can pass all instantiations of the YourType |
19:51:27 | FromDiscord | <Elegantbeef> Dont think this was linked so here https://nim-lang.org/docs/manual.html#generics-type-classes |
19:54:24 | FromDiscord | <pedroos (Pedro Sobota)> Oh I get it so it's like this A for A[T...], A[T] for A[T[T2...]] |
19:54:57 | * | jjido joined #nim |
19:55:54 | FromDiscord | <Elegantbeef> Quite possibly if `...` means "any type" 😀 |
19:58:13 | FromDiscord | <pedroos (Pedro Sobota)> Yes exactly that's what it means. Very fun... |
19:58:28 | FromDiscord | <Elegantbeef> To elaborate for fun https://play.nim-lang.org/#ix=3yuR |
20:00:51 | FromDiscord | <Elegantbeef> Generally speaking though `doStuff` should be `doStuff[T](yourtype: YourType[T])` if you actually use `T` since it's more ergonomic |
20:01:18 | FromDiscord | <pedroos (Pedro Sobota)> I see, the T is optional in this case... |
20:06:08 | FromDiscord | <pedroos (Pedro Sobota)> So typeclass is in the language but the tuple typeclass is in the compiler... |
20:06:45 | FromDiscord | <Elegantbeef> Yes, since tuples do not have a generic instantiation, they encompass a variety of tuples |
20:06:54 | FromDiscord | <Elegantbeef> same with `object` |
20:09:41 | FromDiscord | <pedroos (Pedro Sobota)> I don't get about 'generic instantiation'. Do you have any doc that explains this? Does this mean there is no specific Tuple[T] defined anywhere like in the base library? |
20:12:08 | FromDiscord | <Elegantbeef> A generic instantiation is like `YourType[float]` since tuples can be literally any size or types joined there needs to be compiler magic for a build in typeclass |
20:12:50 | FromDiscord | <Elegantbeef> There are no varadic generics(aside from tuples) in nim so you cannot do `YourType[int, int, float]` and `YourType[int]` |
20:12:51 | FromDiscord | <pedroos (Pedro Sobota)> I get if you have Tuple that can act as Tuple[T] then you basically don't need to define Tuple[T] (unless you want to make one type out of it). But then you don't need to define any generic type, right? Confusion for me as c# all generic types are exact\: A\<T\> != A != A\<T\<T2\>\> etc.. |
20:13:37 | FromDiscord | <Gumber aka Zachary Carter> @enthus1ast sorry I forgot to thank you earlier when you made your suggestion - checking them out now |
20:13:57 | FromDiscord | <Elegantbeef> there is no `tuple[T]` since tuples can be any size/types |
20:14:13 | FromDiscord | <Elegantbeef> And as such there is not a single type that can represent `[T]` in the tuple |
20:14:54 | FromDiscord | <Elegantbeef> `proc something(t: tuple)` accepts any tuple, if you want to limit it to specific tuples you could do `(int, int) or (int, float)` instead of `tuple` |
20:19:02 | FromDiscord | <Elegantbeef> To clarify if it's an implicit type class no you do not need to specify a generic parameters unless you need those types |
20:20:08 | FromDiscord | <Elegantbeef> `assert @[10] is seq` `assert @[10] is seq[int]` both pass for instance |
20:20:50 | FromDiscord | <Elegantbeef> the first is checking if it's of the seq typeclass, the second checks if it's of a specific instantiation |
20:22:00 | FromDiscord | <pedroos (Pedro Sobota)> Yes I didn't mean A[T, T2...] I meant A[T[T2...]] . So in Nim\: A works with 'is' operator for A[T], A[T] works for A[T[T2]], etc... and that's when you'd want/need to define A[T] for example (since A does not work for A[T[T]]) |
20:24:11 | FromDiscord | <pedroos (Pedro Sobota)> Oh I get it so a type of a type class is an instantiation of it. I have a question, are all types instantiations of one of the typeclasses? |
20:40:47 | FromDiscord | <Elegantbeef> I dont quite get the question [pedroos (Pedro Sobota)](https://matrix.to/#/@pedroos-5d669684d73408ce4fc97911:gitter.im) |
20:45:57 | FromDiscord | <pedroos (Pedro Sobota)> I think I'll read up more @elegantbeef\:matrix.org , thanks for the links |
20:45:57 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
20:47:11 | FromDiscord | <aleclarson> is `{.inline.}` better than `template` in any way, or is it just less flexible? |
20:48:20 | FromDiscord | <Recruit_main707> there was a forum thread that explained the differences afaik |
20:51:18 | FromDiscord | <Recruit_main707> a template is literally placing its body wherever you call it basically, at nim compile time https://forum.nim-lang.org/t/3948 |
20:51:52 | FromDiscord | <Recruit_main707> `{.iniline.}` is left for the c/c++ compiler to inline if it considers it optimal |
20:56:02 | FromDiscord | <aleclarson> interesting. good to know that `template` does not cache its arguments in the sense that `a + b` will run every time the template references it as an argument |
20:56:57 | FromDiscord | <aleclarson> now the question is, what's a situation where `template` is the better choice? seems like never |
20:57:14 | FromDiscord | <aleclarson> (edit) "now the question is, what's a situation where `template` is the better choice? seems like ... never" added "basically" |
20:58:32 | FromDiscord | <Recruit_main707> usually only when metaprogramming |
20:58:51 | FromDiscord | <Recruit_main707> they allow certain stuff inline procs wouldnt |
20:59:37 | FromDiscord | <Recruit_main707> basically, for inlining code, usually {.inline.} is the way to go |
21:03:59 | FromDiscord | <Gumber aka Zachary Carter> templates are akin to preprocessor macros in C/C++ |
21:04:10 | FromDiscord | <Gumber aka Zachary Carter> I wouldn't use inline tbh |
21:04:17 | FromDiscord | <Gumber aka Zachary Carter> the C compiler might not respect it |
21:04:32 | FromDiscord | <Gumber aka Zachary Carter> I'd just invoke the C compiler with whatever optimization options you want |
21:04:37 | FromDiscord | <Gumber aka Zachary Carter> and let it do its thing |
21:04:48 | FromDiscord | <Recruit_main707> it usually does afaik |
21:04:49 | FromDiscord | <Gumber aka Zachary Carter> it's probably smarter than you regarding what needs to be inlined anyway |
21:05:01 | FromDiscord | <Recruit_main707> thats true |
21:05:19 | FromDiscord | <Recruit_main707> so its useful to use inline to let it choose then? :P |
21:05:30 | FromDiscord | <Gumber aka Zachary Carter> I just omit the inline pragma period |
21:05:47 | FromDiscord | <Gumber aka Zachary Carter> unless I'm really trying to hunt down some optimization issue |
21:06:01 | FromDiscord | <Gumber aka Zachary Carter> it's otherwise premature and might do more damage than good |
21:06:23 | FromDiscord | <Gumber aka Zachary Carter> unless you wrote the compiler and know what it's going to do |
21:06:37 | FromDiscord | <Gumber aka Zachary Carter> in this case both compilers 😄 since both perform optimization pases |
21:06:44 | FromDiscord | <Gumber aka Zachary Carter> (edit) "in this case both compilers 😄 since both ... performpasses" added "can" | "pases" => "passes" |
21:07:08 | FromDiscord | <aleclarson> hmm, i'm getting this when using `{.inline.}` after `not nil`↵> Invalid syntax. When used with a type, 'not' can be followed only by 'nil' |
21:07:33 | FromDiscord | <Gumber aka Zachary Carter> can you share your code |
21:08:06 | FromDiscord | <Gumber aka Zachary Carter> sounds like you're not using the pragma correctly |
21:08:55 | * | vicfred quit (Quit: Leaving) |
21:08:56 | FromDiscord | <aleclarson> https://play.nim-lang.org/#ix=3yvg |
21:09:12 | * | tiorock joined #nim |
21:09:12 | * | tiorock quit (Changing host) |
21:09:12 | * | tiorock joined #nim |
21:09:12 | * | rockcavera is now known as Guest4051 |
21:09:12 | * | Guest4051 quit (Killed (cadmium.libera.chat (Nickname regained by services))) |
21:09:12 | * | tiorock is now known as rockcavera |
21:09:26 | FromDiscord | <Gumber aka Zachary Carter> oh I dunno wtf this not nil thing is |
21:09:33 | FromDiscord | <Recruit_main707> that not nil is wrong |
21:09:35 | FromDiscord | <Gumber aka Zachary Carter> play with experimental features and expect broken stuff |
21:09:42 | FromDiscord | <Recruit_main707> what do you expect it to do? |
21:10:10 | FromDiscord | <aleclarson> In reply to @Recruit_main707 "that not nil is": ?? |
21:10:32 | FromDiscord | <aleclarson> it's an inline proc that evaluates to a non-nil ref |
21:11:11 | FromDiscord | <Gumber aka Zachary Carter> you're not supposed to apply not nil to anything but types |
21:11:11 | FromDiscord | <Gumber aka Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix=3yvh |
21:11:18 | FromDiscord | <Gumber aka Zachary Carter> you're trying to apply it to a proc |
21:11:26 | FromDiscord | <Recruit_main707> well i was right, just for the wrong reason :p |
21:11:27 | FromDiscord | <aleclarson> no its being applied to the return type |
21:11:33 | FromDiscord | <Gumber aka Zachary Carter> no it's not |
21:11:39 | FromDiscord | <Gumber aka Zachary Carter> go read the documentation |
21:11:41 | FromDiscord | <Gumber aka Zachary Carter> you're doing it wrong |
21:11:42 | FromDiscord | <aleclarson> the fook |
21:11:43 | FromDiscord | <Recruit_main707> you need to do it in the type declaration |
21:12:03 | FromDiscord | <Recruit_main707> bruh |
21:12:06 | FromDiscord | <Recruit_main707> sent a code paste, see https://play.nim-lang.org/#ix=3yvj |
21:12:18 | FromDiscord | <aleclarson> that's wacky af, but ok |
21:12:25 | FromDiscord | <Recruit_main707> sent a code paste, see https://play.nim-lang.org/#ix=3yvk |
21:12:33 | FromDiscord | <fowl> Hey guys I have a buddy that does devops and he mentioned Nim to me, he really likes it. Finds it easy to use, he usually writes python. I tried to talk to him about the meta programming but unfortunately he didn’t know what that was. Everybody loves Nim 🙂 Thank you all |
21:12:54 | FromDiscord | <Gumber aka Zachary Carter> Weird |
21:12:55 | FromDiscord | <Recruit_main707> glad to hear :) |
21:12:56 | FromDiscord | <Gumber aka Zachary Carter> but okay |
21:13:04 | FromDiscord | <fowl> He’s going to lose his mind when I show him macros |
21:13:23 | FromDiscord | <Gumber aka Zachary Carter> macros aren't unique to Nim |
21:13:32 | FromDiscord | <Gumber aka Zachary Carter> but cool nonetheless |
21:13:41 | FromDiscord | <Gumber aka Zachary Carter> (edit) "nonetheless" => "none the less" |
21:15:06 | FromDiscord | <fowl> I’ve not seen them how they are in Nim, a compile time function you return ast from, and you have access to type info too. It’s bananas |
21:15:20 | FromDiscord | <Recruit_main707> sent a code paste, see https://play.nim-lang.org/#ix=3yvl |
21:15:29 | FromDiscord | <aleclarson> In reply to @Gumber "you're doing it wrong": i call baloney, then why does it work when i remove `{.inline.}` |
21:15:41 | FromDiscord | <Recruit_main707> should work |
21:15:52 | FromDiscord | <Gumber aka Zachary Carter> I don't know - I've never used `notnil` before |
21:15:57 | FromDiscord | <Gumber aka Zachary Carter> it's an experimental feature |
21:16:00 | FromDiscord | <aleclarson> lols |
21:16:04 | FromDiscord | <Skaruts> is there some way to create a type that is equivalent to every kind of `int` except `cint`? |
21:16:05 | FromDiscord | <Gumber aka Zachary Carter> and it sounds like it got that treatment because it was being deprecated |
21:16:09 | FromDiscord | <Gumber aka Zachary Carter> so why would I use it? |
21:16:28 | FromDiscord | <aleclarson> they better not deprecate it \:( |
21:16:29 | FromDiscord | <Recruit_main707> Skaruts, cint == int32 |
21:16:39 | FromDiscord | <Gumber aka Zachary Carter> and why would you put it on the proc signature? |
21:16:46 | FromDiscord | <Gumber aka Zachary Carter> it doesn't even make logical sense to put it there |
21:16:54 | FromDiscord | <Gumber aka Zachary Carter> you're enforcing it on the type |
21:16:56 | FromDiscord | <aleclarson> it's saying the proc will never return nil |
21:17:00 | FromDiscord | <Gumber aka Zachary Carter> no it's not |
21:17:04 | FromDiscord | <Gumber aka Zachary Carter> read the docs lol |
21:17:18 | FromDiscord | <aleclarson> u don't even use it, that's exactly what it says xD |
21:17:34 | FromDiscord | <Gumber aka Zachary Carter> I know how to read documentation |
21:17:38 | FromDiscord | <Gumber aka Zachary Carter> apparently better than you... |
21:17:45 | FromDiscord | <Recruit_main707> calm down you two |
21:17:57 | FromDiscord | <Gumber aka Zachary Carter> I'm calm 🙂 |
21:18:08 | FromDiscord | <aleclarson> you just assaulted me with words! |
21:18:11 | FromDiscord | <aleclarson> lol |
21:18:14 | FromDiscord | <Gumber aka Zachary Carter> happens |
21:18:22 | FromDiscord | <aleclarson> tru |
21:18:34 | FromDiscord | <Gumber aka Zachary Carter> sent a code paste, see https://play.nim-lang.org/#ix= |
21:18:35 | FromDiscord | <Gumber aka Zachary Carter> again |
21:18:41 | FromDiscord | <Gumber aka Zachary Carter> I'll leave it at that |
21:18:49 | FromDiscord | <Gumber aka Zachary Carter> types, not procedures |
21:19:10 | FromDiscord | <Skaruts> @Recruit_main707 thing is, I'm having to cast to cint a lot when using libraries, and I just need a template that takes any int and abstracts the casts. But if it's a cint I don't need the template |
21:19:10 | FromDiscord | <aleclarson> that doesn't prove your point. in my example, `not nil` is applied to the return type. it works when you remove `{.inline.}` |
21:19:16 | FromDiscord | <Gumber aka Zachary Carter> omg |
21:19:26 | FromDiscord | <Gumber aka Zachary Carter> the return type of a procedure is not a type |
21:19:37 | FromDiscord | <aleclarson> how? |
21:19:44 | FromDiscord | <Gumber aka Zachary Carter> none of the example code shows it being applied to a procedure |
21:19:51 | FromDiscord | <Gumber aka Zachary Carter> you can't just will the semantics of something to change because you think it should |
21:20:04 | FromDiscord | <aleclarson> then explain why it works without `{.inline.}` |
21:20:04 | FromDiscord | <Gumber aka Zachary Carter> it's designed to be applied to the type definition as it shows in the docs |
21:20:06 | FromDiscord | <Gumber aka Zachary Carter> and clearly states |
21:20:11 | FromDiscord | <Gumber aka Zachary Carter> it might compile |
21:20:13 | FromDiscord | <Gumber aka Zachary Carter> that doesn't mean it works |
21:20:21 | FromDiscord | <Gumber aka Zachary Carter> and regardless |
21:20:24 | FromDiscord | <Gumber aka Zachary Carter> what does that even mean? |
21:20:30 | FromDiscord | <Gumber aka Zachary Carter> that it only applies to the type when that one procedure is invoked? |
21:20:36 | FromDiscord | <aleclarson> yes |
21:20:38 | FromDiscord | <Gumber aka Zachary Carter> yeah, no |
21:20:58 | FromDiscord | <aleclarson> in some cases, the type can be nil, in others not |
21:20:59 | FromDiscord | <Gumber aka Zachary Carter> go look at the source if you want to know how it works |
21:21:08 | FromDiscord | <Gumber aka Zachary Carter> you obviously think I'm incorrect |
21:21:14 | FromDiscord | <Gumber aka Zachary Carter> and clearly you know it should work the way it should |
21:21:22 | FromDiscord | <aleclarson> i've used the feature \:) |
21:21:26 | FromDiscord | <Gumber aka Zachary Carter> cool |
21:21:44 | FromDiscord | <Gumber aka Zachary Carter> like what do you expect out of this - you're using an experimental feature in an undocumented way |
21:21:58 | FromDiscord | <Gumber aka Zachary Carter> and then complaining when it's combined with a pragma |
21:22:09 | FromDiscord | <Gumber aka Zachary Carter> that I already explained was probably not wise to use |
21:22:21 | FromDiscord | <aleclarson> i already said screw it, and took off the `{.inline.}` part \:P |
21:22:26 | FromDiscord | <Gumber aka Zachary Carter> okay then |
21:22:29 | FromDiscord | <Recruit_main707> In reply to @Skaruts "<@!386230567571554305> thing is, I'm": inothing will happen if you cast a cint to cint so you could ignore it. |
21:22:36 | FromDiscord | <aleclarson> i'm just trying to correct you, and it's not working D\: |
21:22:47 | FromDiscord | <Gumber aka Zachary Carter> yeah because I'm not convinced you know what you're talking about |
21:22:49 | FromDiscord | <Skaruts> the compiler ignore the cast? |
21:22:58 | FromDiscord | <Skaruts> ignores |
21:23:01 | FromDiscord | <aleclarson> where's elegantbeef when you need him |
21:23:34 | FromDiscord | <Recruit_main707> you are doint `cast[cint](number)`? |
21:23:35 | FromDiscord | <aleclarson> anyway, i'll let this go now \:P |
21:23:37 | FromDiscord | <Gumber aka Zachary Carter> the docs don't even specify how the thing works lol |
21:23:41 | FromDiscord | <Gumber aka Zachary Carter> not sure how you can be sure |
21:23:41 | FromDiscord | <aleclarson> true |
21:23:48 | FromDiscord | <Skaruts> no just `n.cint` |
21:24:04 | FromDiscord | <Recruit_main707> yes |
21:24:25 | FromDiscord | <Gumber aka Zachary Carter> you can use a converter |
21:24:52 | FromDiscord | <Gumber aka Zachary Carter> `converter toCint(x: int): cint = x.cint` |
21:24:53 | FromDiscord | <Recruit_main707> oh yeah thats very fitting for your usecase probably |
21:25:09 | FromDiscord | <Gumber aka Zachary Carter> you could even get rid of `int` and go with like `someinteger` or whatever the type is |
21:25:22 | FromDiscord | <Gumber aka Zachary Carter> but I'm not really sure why you need it - if you have the C signature as taking a cint |
21:25:34 | FromDiscord | <Gumber aka Zachary Carter> Nim I feel like is usually smart enough to generate code to coerce it to one |
21:25:40 | FromDiscord | <Skaruts> hmm, might be a good idea, I'll give it a try, it might be better than creating a template for every fnction that takes cint |
21:25:45 | FromDiscord | <Gumber aka Zachary Carter> you usually don't need an explicit coercion or cast |
21:25:52 | FromDiscord | <Gumber aka Zachary Carter> yeah definitely don't do that |
21:25:56 | FromDiscord | <Gumber aka Zachary Carter> that sounds ridiculous |
21:25:58 | FromDiscord | <Recruit_main707> i was trying to see if `SomeInteger and not cint` worked but the converter is better yes |
21:26:01 | FromDiscord | <Skaruts> yea I'm using SomeInterger in my templates |
21:26:11 | FromDiscord | <Gumber aka Zachary Carter> yeah you could use it in the converter tmk |
21:26:45 | FromDiscord | <Gumber aka Zachary Carter> but honestly I don't understand the need for any of it |
21:26:49 | FromDiscord | <Skaruts> I tried `type NotCint = SomeInteger and not cint` and it compiled, but then the compiler complained that cint != NotCint |
21:26:59 | FromDiscord | <Skaruts> anyway gonna try the converter |
21:27:35 | FromDiscord | <Skaruts> no, sorry, it complained that int literal != NotCint |
21:27:45 | FromDiscord | <Gumber aka Zachary Carter> I don't really use `int` that much unless I really need a hardware independent integer |
21:27:55 | FromDiscord | <Gumber aka Zachary Carter> and 64 bits is usually more than I need |
21:27:56 | FromDiscord | <Recruit_main707> it maybe gets confused because SomeInteger includes cint |
21:28:02 | FromDiscord | <Gumber aka Zachary Carter> oh |
21:28:05 | FromDiscord | <Gumber aka Zachary Carter> that could be it |
21:28:36 | FromDiscord | <Skaruts> I don't know any better, so I just use ints and floats almost everywhere |
21:28:43 | FromDiscord | <Gumber aka Zachary Carter> 😄 |
21:28:53 | FromDiscord | <Gumber aka Zachary Carter> I mean that's most people |
21:28:59 | FromDiscord | <Gumber aka Zachary Carter> it doesn't matter most of the time |
21:29:16 | * | max22- quit (Quit: Leaving) |
21:29:24 | FromDiscord | <Skaruts> also because otherwise Nim complains and my brain explodes |
21:29:25 | FromDiscord | <Gumber aka Zachary Carter> only if you're working on resource constrained devices or in games or other software that needs to perform |
21:29:44 | FromDiscord | <Recruit_main707> then this worked for me so idk:↵`not SomeFloat and not string` |
21:29:53 | * | jjido joined #nim |
21:30:20 | FromDiscord | <Recruit_main707> so i suggest you to use the converter and ignore the no-issue :p |
21:30:42 | FromDiscord | <Elegantbeef> I'm back bitches! |
21:30:54 | FromDiscord | <Recruit_main707> welcome back :) |
21:31:15 | FromDiscord | <Gumber aka Zachary Carter> wb |
21:31:23 | FromDiscord | <Elegantbeef> What was i needed for though?! |
21:31:25 | FromDiscord | <Gumber aka Zachary Carter> I'm about to go take an afternoon covid nap |
21:31:29 | FromDiscord | <Skaruts> right thanks guys |
21:31:38 | FromDiscord | <Recruit_main707> np |
21:31:45 | FromDiscord | <Gumber aka Zachary Carter> There was a discussion around the notnil experimental annotation |
21:31:54 | FromDiscord | <Gumber aka Zachary Carter> and whether it could be applied to a proc signature |
21:32:15 | FromDiscord | <Gumber aka Zachary Carter> can scroll up a bit if you care to read |
21:32:38 | FromDiscord | <aleclarson> specifically the return type of a proc |
21:32:50 | FromDiscord | <Gumber aka Zachary Carter> no not the return type of a proc |
21:32:53 | FromDiscord | <Gumber aka Zachary Carter> in the proc signature |
21:32:57 | FromDiscord | <Gumber aka Zachary Carter> next to the return type |
21:33:05 | FromDiscord | <Gumber aka Zachary Carter> not on the type definition, on the proc signature |
21:33:08 | FromDiscord | <Recruit_main707> it does seem to work as aleclarson expects without the pragma, but the docs do say what you say |
21:33:12 | FromDiscord | <aleclarson> being after the return type makes it part of the return type |
21:33:18 | FromDiscord | <Gumber aka Zachary Carter> that's not where the type is defined lol |
21:33:26 | FromDiscord | <aleclarson> it's where the return type is defined |
21:33:32 | FromDiscord | <Gumber aka Zachary Carter> sure for the procedure yes |
21:33:36 | FromDiscord | <aleclarson> right |
21:33:42 | FromDiscord | <Gumber aka Zachary Carter> yeah saying it's defined next to the return type |
21:33:50 | FromDiscord | <Gumber aka Zachary Carter> makes it sound to me, like it's defined on the type |
21:33:59 | FromDiscord | <Elegantbeef> Well i do think it makes sense it cannot be used with inline |
21:33:59 | FromDiscord | <Gumber aka Zachary Carter> if you omit the word procedure |
21:34:18 | FromDiscord | <Recruit_main707> enlighten us please |
21:34:20 | FromDiscord | <Gumber aka Zachary Carter> yes because it's code flow analssis which you're potentially changing |
21:34:23 | FromDiscord | <Gumber aka Zachary Carter> with the inline pragma |
21:34:28 | FromDiscord | <Gumber aka Zachary Carter> but regardless |
21:34:47 | FromDiscord | <Gumber aka Zachary Carter> still questioning whether it even works the way alec is trying to make it work |
21:34:51 | FromDiscord | <Gumber aka Zachary Carter> or whether it just compiles |
21:34:57 | FromDiscord | <Elegantbeef> Give me one second to see |
21:35:24 | FromDiscord | <Recruit_main707> In reply to @Gumber "still questioning whether it": it does |
21:35:25 | FromDiscord | <Gumber aka Zachary Carter> the docs don't say or give that as an example |
21:35:37 | FromDiscord | <Elegantbeef> It works with the concrete type, with the `Type not nil` it doesnt since that's not how it's supposed to be used and also cause it is fucky logic |
21:35:51 | FromDiscord | <Gumber aka Zachary Carter> yeah exactly |
21:35:53 | FromDiscord | <aleclarson> not fucky at all |
21:36:03 | FromDiscord | <Jasmina Kiwi> Hello |
21:36:07 | FromDiscord | <Gumber aka Zachary Carter> oh concrete type |
21:36:10 | FromDiscord | <Elegantbeef> Well it's pretty fucky since you're type definition happens where the procedure is pasted in |
21:36:21 | FromDiscord | <Jasmina Kiwi> Umm |
21:36:30 | FromDiscord | <Elegantbeef> IE `type TestNoNil = Test not nil` gumber |
21:36:30 | FromDiscord | <Jasmina Kiwi> Whats this server |
21:36:40 | FromDiscord | <Elegantbeef> A server for the nim programming language |
21:37:01 | FromDiscord | <Jasmina Kiwi> ..... |
21:37:03 | FromDiscord | <Jasmina Kiwi> Ok |
21:37:07 | FromDiscord | <Recruit_main707> its not easy to find by accident, is that why you are here? |
21:37:24 | FromDiscord | <Jasmina Kiwi> I honestly dk |
21:37:34 | FromDiscord | <Elegantbeef> I'd argue that you dont want to have to annotate `not nil` everywhere as such should just use the concrete type |
21:37:42 | FromDiscord | <Elegantbeef> Well now that you're here time to learn Nim 😛 |
21:37:56 | FromDiscord | <aleclarson> a proc can guarantee a ref type is nil, even if the ref type can be nil in other unrelated procs |
21:38:11 | FromDiscord | <Jasmina Kiwi> Aha... |
21:38:14 | FromDiscord | <aleclarson> it would be weird to have `CollectionNotNil` when i can just do `Collection not nil` |
21:38:14 | FromDiscord | <Jasmina Kiwi> Well |
21:39:02 | FromDiscord | <Elegantbeef> I'd argue that `T not nil` should need to be converted to `T` explictly |
21:39:12 | FromDiscord | <Jasmina Kiwi> Idk whats umm language thingy ur talking |
21:39:14 | FromDiscord | <Elegantbeef> And vice versa |
21:39:18 | FromDiscord | <Jasmina Kiwi> Im a medical student |
21:39:25 | FromDiscord | <Recruit_main707> programming language |
21:39:33 | FromDiscord | <Recruit_main707> how did you get here xD |
21:39:37 | FromDiscord | <Jasmina Kiwi> Idk |
21:39:48 | FromDiscord | <Elegantbeef> The thing that makes computers beep boop |
21:39:55 | FromDiscord | <Recruit_main707> lol |
21:39:56 | FromDiscord | <Jasmina Kiwi> I've been on this server for a while but didn't really talk |
21:40:07 | FromDiscord | <Jasmina Kiwi> It was on my servers |
21:40:11 | * | Vladar quit (Quit: Leaving) |
21:40:17 | FromDiscord | <Jasmina Kiwi> I don't remember joining |
21:40:21 | FromDiscord | <Elegantbeef> The crown logo brings in everyone |
21:40:22 | FromDiscord | <Gumber aka Zachary Carter> https://nim-lang.org/ |
21:40:26 | FromDiscord | <Gumber aka Zachary Carter> if this sounds exciting to you |
21:40:29 | FromDiscord | <Gumber aka Zachary Carter> you might be in the right place |
21:40:37 | FromDiscord | <Jasmina Kiwi> Only explanation is that bot |
21:40:37 | FromDiscord | <Recruit_main707> yeah i dont think she is into coding |
21:40:41 | FromDiscord | <aleclarson> @Jasmina Kiwi ur boyfriend probably playing a trick on you |
21:40:49 | FromDiscord | <Jasmina Kiwi> ...... |
21:40:55 | FromDiscord | <Recruit_main707> bot? |
21:40:58 | FromDiscord | <Jasmina Kiwi> Ugh |
21:41:09 | FromDiscord | <Jasmina Kiwi> Well he's my ex |
21:41:10 | FromDiscord | <Elegantbeef> Me i am bot |
21:41:15 | FromDiscord | <Elegantbeef> Beep boop beep |
21:41:16 | FromDiscord | <Gumber aka Zachary Carter> Your ex is a robot? |
21:41:20 | FromDiscord | <Jasmina Kiwi> What |
21:41:21 | FromDiscord | <Jasmina Kiwi> No |
21:41:31 | FromDiscord | <Jasmina Kiwi> U said my bf or something |
21:41:35 | FromDiscord | <Gumber aka Zachary Carter> nah that wasn't me |
21:41:40 | FromDiscord | <aleclarson> he probably hacked ur account |
21:41:42 | FromDiscord | <Gumber aka Zachary Carter> I don't assume things about people like that |
21:41:42 | FromDiscord | <Jasmina Kiwi> Wr broke up last month |
21:41:47 | FromDiscord | <Gumber aka Zachary Carter> okay let's not have this haha |
21:41:50 | FromDiscord | <Jasmina Kiwi> Anyways |
21:41:53 | FromDiscord | <Jasmina Kiwi> No |
21:41:54 | FromDiscord | <Gumber aka Zachary Carter> there's an #offtopic channel if you all want to discuss that |
21:41:55 | FromDiscord | <Recruit_main707> lets go back to the point |
21:42:06 | FromDiscord | <Jasmina Kiwi> A bot called epic giveaways |
21:42:15 | FromDiscord | <Jasmina Kiwi> It adds you to servers |
21:42:19 | FromDiscord | <Jasmina Kiwi> Automatically |
21:42:23 | FromDiscord | <Gumber aka Zachary Carter> oh yes, we've had spam bots |
21:42:27 | FromDiscord | <Jasmina Kiwi> Im assuming thats what happened |
21:42:30 | FromDiscord | <Gumber aka Zachary Carter> probably |
21:42:41 | FromDiscord | <Gumber aka Zachary Carter> yeah I mean it's a programming language / software development discord server |
21:42:50 | FromDiscord | <Gumber aka Zachary Carter> so people make apps, games, web applications, etc... using this language |
21:42:53 | FromDiscord | <Gumber aka Zachary Carter> among other things |
21:43:19 | FromDiscord | <Jasmina Kiwi> Hmm my job is to open up people and fix them |
21:43:30 | FromDiscord | <Gumber aka Zachary Carter> yeah, quite a different set of skills required there |
21:43:39 | FromDiscord | <Jasmina Kiwi> Ahahah..... |
21:43:44 | FromDiscord | <Gumber aka Zachary Carter> you maybe could make a new surgeon simulator with Nim if you wanted to |
21:43:48 | FromDiscord | <Gumber aka Zachary Carter> and practice |
21:43:57 | FromDiscord | <Gumber aka Zachary Carter> but uh, beyond that I'm not sure it would be of much use to someone in your profession |
21:44:01 | FromDiscord | <Jasmina Kiwi> That would take years |
21:44:03 | FromDiscord | <Recruit_main707> leave the poor frogs alone |
21:44:07 | FromDiscord | <Gumber aka Zachary Carter> 😄 |
21:44:11 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
21:44:14 | FromDiscord | <Jasmina Kiwi> I Don't know anything about coding |
21:44:21 | FromDiscord | <Gumber aka Zachary Carter> it's okay, I don't know anything about surgery |
21:44:25 | FromDiscord | <reilly> Well there's one way to find out ;) |
21:44:29 | FromDiscord | <Elegantbeef> Anywho alec the issue is the pragma is getting attached to some part of the `not nil` part |
21:44:40 | FromDiscord | <Elegantbeef> Programming isnt brain surgery so that's a plus |
21:44:57 | FromDiscord | <Jasmina Kiwi> Well |
21:45:08 | FromDiscord | <Recruit_main707> yeah, @Jasmina Kiwi if you want to keep talking lets move to #offtopic, but if you are gonna leave, then bye :) |
21:45:21 | FromDiscord | <Jasmina Kiwi> Tell me something interesting about your feild |
21:45:40 | FromDiscord | <Jasmina Kiwi> If you'd like i can tell u interesting facts about yourself or your body |
21:45:52 | FromDiscord | <Gumber aka Zachary Carter> prob better a topic suited for #offtopic |
21:45:59 | FromDiscord | <Jasmina Kiwi> Ok |
21:46:02 | FromDiscord | <Gumber aka Zachary Carter> we like to keep this focused on questions / discussions of the language |
21:46:07 | FromDiscord | <Gumber aka Zachary Carter> and software development in general |
21:46:10 | FromDiscord | <Gumber aka Zachary Carter> if possible |
21:46:15 | FromDiscord | <Gumber aka Zachary Carter> (edit) "if ... possible" added "and when" |
21:46:16 | FromDiscord | <Jasmina Kiwi> But first tell me interesting stuff about software things |
21:46:19 | FromDiscord | <aleclarson> In reply to @Elegantbeef "Anywho alec the issue": seems like a bug then |
21:47:44 | FromDiscord | <Elegantbeef> Well i dont think notnil is meant for anywhere but type defs so it's just luck that it works for a parameter |
21:47:59 | FromDiscord | <Elegantbeef> I personally dont see the point of only partially using it |
21:48:50 | FromDiscord | <Skaruts> is there a `SomeString` type in nim? |
21:49:10 | FromDiscord | <Elegantbeef> What's that supposed to mean? |
21:49:17 | FromDiscord | <Skaruts> string or cstring |
21:49:26 | FromDiscord | <Elegantbeef> Well you just wrote it |
21:49:36 | FromDiscord | <Elegantbeef> `type SomeString = cstring or string` 😛 |
21:49:49 | FromDiscord | <Skaruts> yup, but was just wondering if it existed with some other name |
21:50:21 | FromDiscord | <Elegantbeef> So alec since 1.6 is soonTM i'd just suggest using strict not nil as it has better features and you can do `--warningAsError:strictNotNil` |
21:50:24 | FromDiscord | <Elegantbeef> https://nim-lang.github.io/Nim/manual_experimental_strictnotnil.html look at the features 😜 |
21:53:07 | FromDiscord | <aleclarson> i don't really need that level of type safety. will that be the default behavior at some point? |
21:53:21 | FromDiscord | <Elegantbeef> It's desired eventually |
21:53:30 | FromDiscord | <aleclarson> that's one thing i like about Objective-C. how nilability is implicit |
21:53:59 | FromDiscord | <aleclarson> u can even send messages to nil and it won't crash \:) |
21:55:16 | FromDiscord | <Elegantbeef> Well you can always use wrapnils to make some easy nim management |
21:56:06 | FromDiscord | <aleclarson> interesting |
21:57:25 | FromDiscord | <Elegantbeef> I meant nil but wrote nim, so that's my life |
21:59:13 | FromDiscord | <aleclarson> tomato tomato |
22:00:02 | * | marek joined #nim |
22:03:58 | * | marek quit (Client Quit) |
22:06:58 | FromDiscord | <Recruit_main707> can you predeclare a type? |
22:08:30 | FromDiscord | <Elegantbeef> In what way? |
22:11:00 | FromDiscord | <Recruit_main707> well, i have a bunch of types i need to export↵then some emitted c++ code that uses those types↵then another type that needs the emitted c++ code but its also needed by the first bunch of types |
22:17:54 | * | mdbauman__ quit (Read error: Connection reset by peer) |
22:19:23 | FromDiscord | <JSONBash> should https://nim-lang.github.io/Nim/channels_builtin.html have a code example at the top? |
22:23:01 | * | audiophile_ quit (Quit: Default Quit Message) |
22:23:46 | FromDiscord | <Elegantbeef> @JSONBash\: yes https://github.com/nim-lang/Nim/blob/devel/lib/system/channels_builtin.nim#L29 |
22:28:20 | * | vicfred joined #nim |
22:42:12 | * | stkrdknmibalz joined #nim |
23:16:52 | * | audiophile_ joined #nim |
23:19:24 | FromDiscord | <JSONBash> In reply to @Elegantbeef "<@245741179721744395>\: yes https://github.com/nim-": That works, thanks! |
23:29:45 | * | audiophile_ quit (Ping timeout: 260 seconds) |