00:00:31 | shashlick | works with your wren wrapper |
00:03:30 | rockcavera | array type does not have an equal insert of type seq? |
00:08:13 | rockcavera | would using shallowCopy() be safe? |
00:22:23 | rayman22201 | array type is fixed size at compile time. How can insert possibly work? You can't grow an array. |
00:24:17 | * | Hideki_ joined #nim |
00:24:55 | * | krux02_ quit (Remote host closed the connection) |
00:29:24 | rockcavera | rayman22201 I do not want to enlarge the array, I want to move it, eliminating the data that will be at an index larger than the size. |
00:30:24 | rockcavera | for now shallowCopy() is doing the job. I don't know if it would be the most appropriate ... |
00:32:09 | rayman22201 | shallowCopy() will probably work, but depending on the type inside the array, "there be dragons" |
00:33:25 | rockcavera | uint8 |
00:33:26 | rockcavera | ;) |
00:33:41 | rayman22201 | lol. then yeah, shallowCopy is fine |
00:34:20 | rockcavera | thanks |
00:34:52 | * | Hideki_ quit (Ping timeout: 264 seconds) |
00:38:54 | disruptek | shashlick: looking for a pattern for conditional code based upon availability of a module. |
00:43:38 | shashlick | https://github.com/genotrance/nimarchive/blob/master/nimarchive.nimble#L17 |
00:43:45 | shashlick | Poor man's solution |
00:44:14 | disruptek | ahh, hah. π |
00:44:25 | disruptek | i'll just punt for now. |
00:45:04 | disruptek | yours is probably going to last a long time though, tbh. |
00:46:04 | shashlick | Actually my thing is cause it is checked at install time itself |
00:50:46 | disruptek | a proc is the result of a macro and the compiler errors saying `express has no type`. i feel like this is simple but i can't remember what i need to do. |
00:50:54 | disruptek | s/express/expression/ |
00:52:56 | shashlick | Code |
00:56:43 | disruptek | someday i really need to setup a paster. |
00:58:08 | disruptek | https://gist.github.com/disruptek/b3003fb8ec0c11648278c543f253f75c |
01:02:14 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
01:03:54 | shashlick | Use ix |
01:06:06 | * | Traviss__ joined #nim |
01:07:24 | shashlick | I just use parseStmt |
01:07:28 | * | Traviss__ quit (Client Quit) |
01:07:45 | shashlick | Or quote do |
01:07:48 | * | Traviss__ joined #nim |
01:08:00 | shashlick | Makes things more readable for me |
01:08:46 | disruptek | i started with quote do but it feels hackish and expensive; i'm afraid it's going to break under me. but that's not really the problem. |
01:08:55 | disruptek | i don't think. π |
01:09:53 | * | traviss quit (Ping timeout: 245 seconds) |
01:10:23 | * | Hideki_ joined #nim |
01:10:57 | shashlick | It's working fine for me |
01:11:11 | shashlick | That's what I do in nimterop |
01:11:19 | * | Traviss__ quit (Client Quit) |
01:11:42 | * | traviss joined #nim |
01:12:17 | disruptek | i know, i use it in openapi extensively, but mostly for `if` statements. other stuff, i try to just construct the ast by hand. |
01:12:42 | disruptek | but, this isn't the problem; i can generate the proc just fine. i'm doing something else dumb. |
01:14:26 | * | Hideki_ quit (Ping timeout: 240 seconds) |
01:25:49 | disruptek | i'm building the proc manually here because i'm constructing input for cligen automatically; ie. a very long list of gully parameters, --long-options, and default values for same. so, it makes sense. |
01:31:24 | * | traviss quit (Quit: Leaving) |
01:37:23 | * | stefantalpalaru quit (Ping timeout: 265 seconds) |
01:45:03 | disruptek | ah, it was returning NimNode instead of untyped. i knew it was stupid. π€£ |
01:56:38 | * | traviss joined #nim |
02:05:56 | FromGitter | <Willyboar> Release my 3rd week in nim project and i think it is the baddest code you can ever seen. But it works |
02:08:54 | FromGitter | <gogolxdong> Blender list Chinese community on the first page, https://www.blender.org/community/, do you want to list us? |
02:10:53 | jken | Can two cases in a variable type share attributes? I get an error by redefining them in seperate cases. |
02:19:35 | jken | nevermind, rtfm'd |
02:21:08 | FromGitter | <gogolxdong> We have a new domain https://nim-cn.com/ |
02:21:51 | FromDiscord | <Rika> Why a new domain instead of another path in the main domain |
02:22:17 | FromGitter | <Willyboar> yeap! like cn.nim-lang.org |
02:22:28 | FromGitter | <gogolxdong> .org cannot be registered as domain name in China |
02:22:36 | FromDiscord | <Rika> Oh shit, I see |
02:22:42 | FromGitter | <Willyboar> Chinese is one of the most difficult languages :) |
02:22:45 | FromDiscord | <Rika> They can't access orgs? |
02:22:52 | FromGitter | <gogolxdong> yes. |
02:24:01 | FromGitter | <gogolxdong> we tried nim-lang-cn.org for a peroid, but was banned. |
02:25:10 | FromGitter | <Willyboar> you can find a co in another country to update the content |
02:26:37 | FromGitter | <gogolxdong> what's co? |
02:27:16 | FromGitter | <Willyboar> co-operator |
02:27:30 | FromGitter | <Willyboar> a partner |
02:28:21 | disruptek | jken: there's an rfc discussing ideas on how/why to chase that variant object behavior. |
02:29:16 | disruptek | change, too. |
02:29:34 | FromGitter | <gogolxdong> problem is .org is banned. We have the script to update website. |
02:31:34 | FromGitter | <Willyboar> Find a person outside china to register the domain. |
02:33:30 | FromGitter | <gogolxdong> Is the .com domain name a concern? Great Fire Wall will ban the ip point to .org if necessary, it's impossible to run a .org in China. |
02:34:58 | FromGitter | <gogolxdong> What you said is what we did a month ago, buy an AWS server as a flight. |
02:36:20 | FromGitter | <gogolxdong> Other domain name is unavailable and ridiculous. |
02:54:12 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
02:54:47 | * | pbb joined #nim |
03:17:06 | * | chemist69 quit (Ping timeout: 246 seconds) |
03:19:15 | * | chemist69 joined #nim |
03:25:15 | FromDiscord | <me2beats> hey guys. If my demo code is 12 lines long, is it still better to use code services for showing it? |
03:25:39 | disruptek | probably; there are a lot of grumpy folks hanging out in here. |
03:25:51 | disruptek | some of them are likely to have access to weapons. |
03:26:21 | leorize | if the channel is not busy then you can paste it |
03:26:28 | leorize | just remember not to edit it |
03:26:49 | leorize | but play.nim-lang.org is the better way to paste nim code :P |
03:27:28 | FromDiscord | <me2beats> my question is can I do something like this: |
03:27:28 | FromDiscord | <me2beats> ``` |
03:27:29 | FromDiscord | <me2beats> type |
03:27:29 | FromDiscord | <me2beats> Person = ref object of RootObj |
03:27:29 | FromDiscord | <me2beats> name: string |
03:27:29 | FromDiscord | <me2beats> age: int |
03:27:29 | FromDiscord | <me2beats> |
03:27:31 | FromDiscord | <me2beats> Animal = ref object of RootObj |
03:27:33 | FromDiscord | <me2beats> name: string |
03:27:34 | FromDiscord | <me2beats> age: int |
03:27:34 | FromDiscord | <me2beats> |
03:27:36 | FromDiscord | <me2beats> Student = ref object of Person if student_type == "person" else ref object of Animal |
03:27:38 | FromDiscord | <me2beats> id: int |
03:27:39 | FromDiscord | <me2beats> student_type: string |
03:27:41 | FromDiscord | <me2beats> ``` |
03:30:23 | FromDiscord | <me2beats> donβt know what to name it, something like a dynamic base setting maybe |
03:32:23 | disruptek | how about, Centaur? |
03:32:32 | disruptek | HALF MAN |
03:32:34 | disruptek | HALF BEAST |
03:32:57 | disruptek | HUNG LIKE A HORSE |
03:33:17 | disruptek | i think i have a picture here somewhere... |
03:34:31 | FromGitter | <Willyboar> Hercules died from the blood of one of them |
03:34:38 | FromGitter | <Willyboar> Chiron |
03:35:20 | disruptek | they can be dangerous at certain times of the month, alright. |
03:35:39 | disruptek | but, y'know herc was kinda a wimp. most of those stories are just that. |
03:35:41 | FromDiscord | <me2beats> lol |
03:35:41 | disruptek | stories. |
03:36:59 | FromDiscord | <me2beats> the problem is that I would like to set the instance class (object type?) depending on the arguments I enter. |
03:36:59 | FromDiscord | <me2beats> |
03:37:00 | FromDiscord | <me2beats> in python I can do something like this by changing the class of the object (obj.class = SomeOtherClass) Also in python2 you could use __bases__ |
03:37:07 | FromDiscord | <me2beats> the problem is that I would like to set the instance class (object type?) depending on the arguments I enter. |
03:37:07 | FromDiscord | <me2beats> |
03:37:07 | FromDiscord | <me2beats> in python I can do something like this by changing the class of the object (obj.class = SomeOtherClass) Also in python2 you could use `__bases__` |
03:39:58 | FromDiscord | <me2beats> It just seems to me that this is one of the reasons OOP is not flexible enough. |
03:39:58 | FromDiscord | <me2beats> OOP does not suggest that it may be convenient for you to choose the "parent" of an object depending on the parameters |
03:41:12 | disruptek | ol' herc was a more accomplished drinker than he was a strongman. |
03:41:32 | disruptek | and we already know how his animal husbandry skills failed him. |
03:41:49 | disruptek | fact is, drinking was in his blood. |
03:41:54 | disruptek | he was born to it. |
03:42:40 | disruptek | you spend that much time around alcohol, one of two things happen: |
03:42:49 | disruptek | 1) you learn to keep your mouth shut, |
03:43:12 | disruptek | 2) you die by the moon blood of a centaur. |
03:43:45 | disruptek | guess what i'm saying is, t'was not the drink that killed ol' herc. |
03:43:58 | disruptek | it was the way once he got started, he just WOULD NOT SHUT UP. |
03:50:31 | leorize | @me2beats try not to use inheritance :P |
03:50:55 | leorize | it seems to me that an object variant might fit this use case more |
04:00:44 | * | M948e5[m] joined #nim |
04:02:30 | FromDiscord | <me2beats> I will try to delve into the object variant thanks. |
04:02:30 | FromDiscord | <me2beats> |
04:02:31 | FromDiscord | <me2beats> about inheritance - itβs hard for me to imagine how to can not use it when creating GUI elements (Widgets) for example. |
04:07:11 | M948e5[m] | hi, i tried to go to your forum but i received only a blank page. |
04:07:12 | M948e5[m] | i tried to sign up for gitter but they only allow signing in through github and gitlab. gitlab just changed their privacy policy, so thats a no go. |
04:07:12 | M948e5[m] | i wont even get started on <<<discord>>>, which i now see this room is bridged to. |
04:12:12 | leorize | you can just use irc :P |
04:12:39 | leorize | the matrix bridge can be wonky at times due to matrix.org infrastructure |
04:18:31 | * | rockcavera quit (Remote host closed the connection) |
04:20:04 | * | u0_a172 joined #nim |
04:21:24 | * | u0_a172 quit (Client Quit) |
04:28:22 | * | theelous3 joined #nim |
04:39:23 | FromGitter | <vishr> Hello, I wanted to share a programming playground for that I created recently https://code.labstack.com/nim. I hope you will find it useful. |
04:43:34 | FromDiscord | <Rika> https://play.nim-lang.org/ |
04:44:26 | * | narimiran joined #nim |
04:45:36 | * | dddddd quit (Remote host closed the connection) |
04:48:06 | FromGitter | <bevo009> @vishr nice! Can you add a keyboard shortcut eg Ctrl-Enter? |
04:49:12 | FromGitter | <vishr> @bevo009 to run the program? |
04:49:26 | FromGitter | <bevo009> Just noticed the Playground has a keyboard shortcut now, very nice |
04:49:41 | FromGitter | <bevo009> @vishr yep to run it |
04:49:52 | FromGitter | <vishr> I will :) |
04:49:56 | FromGitter | <bevo009> Ctrl-Enter seems to be a default standard |
04:50:09 | FromGitter | <vishr> @bevo009 π |
04:52:56 | shashlick | if any ideas - please help - https://github.com/libarchive/libarchive/issues/1270 |
04:52:57 | FromGitter | <bevo009> I forgot who took over developing the Playground, but thanks for all the latest improvements eg font size, Nim version, C++ target and the keyboard shortcut |
04:53:52 | FromGitter | <bevo009> That's on a par with other online editors now |
04:54:20 | shashlick | @PMunch did all that |
04:58:36 | FromGitter | <gogolxdong> Wrote a html2karax tool to convert static html to Karax application or server side rendering. https://github.com/nim-lang-cn/html2karax/ |
04:59:37 | * | nsf joined #nim |
05:00:12 | FromGitter | <gogolxdong> We are using it to convert tutorial and manual. |
05:02:09 | FromGitter | <bevo009> @PMunch you're a champ, cheers! |
05:11:54 | * | Hideki_ joined #nim |
05:15:57 | * | Hideki_ quit (Ping timeout: 240 seconds) |
05:42:36 | Zevv | Guys, look at this Della-Vos book thing: https://github.com/FemtoEmacs/nimacros/blob/master/nimdoc.pdf |
05:45:22 | Zevv | it has illustrations from an 80's forth book, long chapers of prose about the antrophology of money. What *is* this? |
05:49:34 | Zevv | "The author recommends that you don't go beyond pate 30, and thus avoiding material that you may consider offensive" |
05:59:19 | * | LargeEpsilon joined #nim |
06:03:13 | * | theelous3 quit (Ping timeout: 245 seconds) |
06:06:17 | FromGitter | <zacharycarter> looks like someone is writing a book about creating Nim macros? |
06:06:34 | FromGitter | <zacharycarter> Victor Della-Vos is to be more specific |
06:07:30 | FromGitter | <zacharycarter> Also regarding the Lua conversation about games the other day - Lua is definitely well-suited for game scripting. It's (from what I can tell) the most widely used scripting language in game / engine development |
06:08:01 | FromGitter | <zacharycarter> so whoever was saying they don't think it's well suited - you're certainly entitled to your opinion but I think the majority of the industry disagrees with you |
06:10:31 | FromGitter | <zacharycarter> I'm attempting to learn from - https://github.com/gafferongames/networkedphysics-gdc2015. I've gotten the project to successfully compile on windows, but I can't figure out how it's supposed to run / work |
06:10:49 | FromGitter | <zacharycarter> I figured maybe something was broken on Windows, because support for it didn't seem complete, but I can't get it to compile / work on mac OS either |
06:10:50 | FromGitter | <zacharycarter> ugh |
06:13:39 | Zevv | Ive been working on a 50kloc lua project over the last years, a small mips platform doing DSL modem, routing, ipsec, openvpn, gre, rip, ospf and tons of other features. Not sure if I would choose lua again in 2020, but it has been a pleasant yourney overall. Lua scales. |
06:17:07 | FromGitter | <zacharycarter> lua-jit might even be a better option, but you just have to keep in mind it's unmaintained and will stay that way unless Mike Pall reawakens with a hunger to work on it again |
06:17:20 | FromGitter | <zacharycarter> so it will not keep up with the lua standard |
06:17:57 | Zevv | I tried a port to luajit a few years ago when mips support came available, but it wasnt worth the switch for us. |
06:18:06 | FromDiscord | <Chiqqum_Ngbata> https://moonscript.org/ |
06:18:31 | * | Mister_Magister joined #nim |
06:18:35 | Zevv | we're mostly memory bound - on a system with 8M flash and 64M ram, and luajit does not do better memory-wise |
06:18:38 | FromGitter | <alehander42> lua isnt typed right |
06:18:51 | Zevv | that is my biggest grope after all these yeras indeed |
06:18:53 | Zevv | thus nim |
06:20:47 | FromGitter | <zacharycarter> correct |
06:20:57 | FromGitter | <zacharycarter> moonscript doesn't solve much IMO |
06:21:25 | FromGitter | <alehander42> <3 |
06:22:17 | FromGitter | <alehander42> i have to admit: not sure if this would be open sourced |
06:22:21 | FromGitter | <zacharycarter> originally I was going to use the valve steamworks sdk for my networking code, and then I was also considering the valve game networking sockets library, but they would both require me to write a C wrapper to handle callbacks |
06:22:26 | FromGitter | <alehander42> but i am trying to do something that seems very not obvious to me |
06:22:32 | FromGitter | <alehander42> but it should be obvious |
06:22:42 | FromGitter | <alehander42> i want to render a PNode (or NimNode) |
06:22:44 | FromGitter | <zacharycarter> so now I'm back to square one as far as how to do network code for my game |
06:22:45 | FromGitter | <alehander42> to string |
06:23:00 | FromGitter | <alehander42> but with changing the PNode locations to match the result string |
06:23:04 | FromGitter | <alehander42> while rendering it |
06:23:27 | FromGitter | <alehander42> if you think about it, this probably requires patching the whole nim renderer right |
06:34:35 | FromGitter | <alehander42> it seems i can patch gsub .. maybe |
06:34:54 | * | Mister_Magister quit (Quit: bye) |
06:34:56 | * | PMunch joined #nim |
06:35:20 | * | Mister_Magister joined #nim |
06:35:44 | * | Mister_Magister is now known as Guest25229 |
06:36:09 | Zevv | zacharycarter: what level of networking are you looking for? More then just the sockets, I assume? |
06:36:10 | * | Guest25229 quit (Remote host closed the connection) |
06:37:09 | FromGitter | <zacharycarter> yeah - something a bit higher level, although if I dig through that gdc networked physics demo enough, I can probably start with raw sockets and add functionality on as I need |
06:37:19 | FromGitter | <zacharycarter> I don't think he's using any networking libraries in that demo |
06:39:10 | * | solitudesf joined #nim |
06:39:53 | * | Mister_Magister_ joined #nim |
06:40:07 | * | Trustable joined #nim |
06:43:04 | narimiran | !eval echo -11 mod 5 |
06:43:07 | NimBot | -1 |
06:44:14 | narimiran | !eval echo -3 mod 7 |
06:44:17 | NimBot | 3 |
06:46:50 | narimiran | !eval echo (-3 mod 5, -13 mod 5) |
06:46:52 | NimBot | (3, -3) |
06:50:04 | * | Mister_Magister_ is now known as Mister_Magister |
06:56:49 | PMunch | narimiran, yeah modulo is weird.. |
06:57:05 | narimiran | just in 1.0.x, it was ok in 0.20.x |
06:57:49 | PMunch | Huh, you're right. Your last example returns -3, -3 on 0.20.2 |
06:57:55 | PMunch | Which is what you'd expect |
06:58:08 | narimiran | and big thanks to you PMunch for having the version switch on the playground, it makes testing things quite easy |
06:58:40 | narimiran | here's another example: https://play.nim-lang.org/#ix=1ZM6 |
06:59:02 | PMunch | No problem :) Took a little bit of doing as I now have to build the docker images myself instead of using the ones from dockerhub |
06:59:34 | PMunch | Those are the examples from the manual right? |
06:59:53 | PMunch | Although the manual says that the last column should look like the firts.. |
07:00:00 | * | gmpreussner quit (Quit: kthxbye) |
07:00:28 | narimiran | the top part is from our docs, the bottom one i created based on the issue report |
07:00:43 | narimiran | `a mod b` fails when abs(a) < abs(b) |
07:00:48 | PMunch | Huh, the behaviour of that example is different between 0.20.2, 1.0.0, and 1.0.2 |
07:01:26 | narimiran | yeah, i know there was a recent fix because 1.0.0 was even more wrong :) |
07:02:07 | narimiran | sign of `b` was taken into an account, instead of `a` |
07:02:20 | Araq | er. is this *still* wrong? |
07:02:32 | Araq | :'-( |
07:02:40 | narimiran | Araq: see the examples and the reported issue: https://github.com/nim-lang/Nim/issues/12514 |
07:02:48 | PMunch | math.mod still works fine for floats FWIW |
07:05:04 | * | gmpreussner joined #nim |
07:05:35 | * | krux02 joined #nim |
07:06:07 | PMunch | It was right in 0.20.2 though.. |
07:06:31 | * | filcuc joined #nim |
07:18:53 | * | Vladar joined #nim |
07:21:04 | FromGitter | <alehander42> Araq, do you think the thing i said about patching renderer for my usecase |
07:21:07 | FromGitter | <alehander42> makes sense |
07:39:36 | * | theelous3_ quit (Ping timeout: 246 seconds) |
07:47:37 | * | GordonBGood joined #nim |
08:03:05 | * | gmpreussner quit (Ping timeout: 265 seconds) |
08:03:40 | * | gmpreussner joined #nim |
08:06:29 | * | Trustable quit (Remote host closed the connection) |
08:15:53 | * | lritter joined #nim |
08:22:35 | * | ng0 joined #nim |
08:23:24 | * | letto_ quit (Quit: Konversation terminated!) |
08:24:31 | planetis[m] | Can you please remove the "della vos" spam and ban the spammer already? |
08:28:12 | PMunch | Huh? |
08:29:31 | Zevv | yeah but *what* is that exactly - who has taken the time to put that up? |
08:29:59 | Zevv | there is a repo, it has code, it has a pdf that kind of makes sense and then changes into ramblings |
08:30:51 | planetis[m] | Its totally spam, good effort though |
08:31:11 | Araq | huh, narimiran please take a close look |
08:31:27 | Araq | maybe edit it? |
08:31:44 | planetis[m] | Maybe you didn't catch it bc its early morning |
08:31:48 | narimiran | edit what exactly? |
08:32:15 | narimiran | btw, the spam received 7 likes :) |
08:32:40 | FromGitter | <alehander42> its bizarre |
08:32:53 | Zevv | it really is. You should try to read the pdf, it's great |
08:32:55 | FromGitter | <kayabaNerve> Where is it? |
08:33:00 | Zevv | https://github.com/FemtoEmacs/nimacros/blob/master/nimdoc.pdf |
08:33:08 | PMunch | This is a really strange read.. |
08:33:46 | narimiran | i've checked other posts by the same user |
08:33:48 | Zevv | when the acid kicks in |
08:33:55 | narimiran | they are not (yet edited to) spam |
08:34:12 | PMunch | Zevv, yeah that is kinda what it feels like |
08:34:41 | Zevv | I really enjoyed that. Still groggy out of bed trying to read that, and halfway getting this doubt "is it *me*, or is there something wrong here?" |
08:34:46 | Zevv | get up, have a coffee, try again |
08:35:41 | Zevv | the interesting part is that all of the text seems to be unique - I can't find any matches on the content from anywhere |
08:35:58 | narimiran | i just scrolled to chapter 11. you have some nim code and then.... whatever that is :D |
08:36:12 | PMunch | I mean scrolling through it without reading much it seems completely fine |
08:36:18 | Zevv | Read page one: the author tells you not to go beyond page 30 becasue of offensive content |
08:37:04 | Zevv | "If I had not obtained the collaboration of Vindaar [...], I would not be able to write about Nim macros" |
08:37:24 | PMunch | I mean chapter 8 is a sharp turn from "A syntax changing macro" to "The tacit dimension" |
08:37:43 | FromGitter | <alehander42> i am like |
08:37:45 | FromGitter | <alehander42> ????????????????????????????????????????????????? |
08:37:47 | FromGitter | <alehander42> seriously |
08:37:52 | FromGitter | <alehander42> this is ridicolus |
08:38:09 | PMunch | It's amazing! |
08:38:15 | FromGitter | <alehander42> ban this stuff man |
08:38:21 | Zevv | I'm saving me a copy :) |
08:38:34 | Araq | trolling in a PDF file? |
08:38:37 | PMunch | Zevv, wanna pitch in on a print run? :P |
08:38:42 | FromGitter | <alehander42> but why so much effort |
08:38:49 | PMunch | Yeah that's the strange thing |
08:39:06 | PMunch | And they are obviously in the community, they mention Juan Carlos, and Vindaar by name |
08:39:20 | narimiran | so, what to do here? ban him based on this post, even though the previous two were ok? lock the thread? |
08:39:42 | Zevv | better delete it, imho. |
08:39:56 | narimiran | PMunch: their names come from https://forum.nim-lang.org/t/5383 |
08:40:14 | PMunch | What is wrong with it? Apart from being really weird :P |
08:40:20 | Zevv | *look* at it |
08:40:34 | PMunch | narimiran, aha |
08:43:00 | lqdev[m] | shashlick: verified the incompleteStruct update, works correctly |
08:43:18 | FromGitter | <kayabaNerve> Thanks Zevv |
08:43:42 | PMunch | Haha, chapter 11 is great :P |
08:43:54 | * | letto joined #nim |
08:44:47 | PMunch | Just a bunch of ramblings about indians, mormons, brazil, womens asses, and off course some unit conversion code examples in Nim :P |
08:44:48 | FromGitter | <alehander42> it gives me really bad vibe man |
08:45:18 | PMunch | Oh jeez, chap 11 is literally just the rest of the book :S |
08:45:23 | FromGitter | <alehander42> remove this from planet earth |
08:45:29 | PMunch | Yeah, it's like peeking into the mind of a mad-man |
08:45:44 | FromGitter | <kayabaNerve> Since when is there a tut3? |
08:46:00 | FromGitter | <alehander42> krux02 wrote it a while ago |
08:46:01 | FromGitter | <alehander42> iirc |
08:46:04 | Araq | since version 1 or maybe 0.20 |
08:46:13 | FromGitter | <kayabaNerve> Thanks for the info. |
08:46:36 | lqdev[m] | @kayabaNerve afaik it's since 0.20 |
08:46:41 | lqdev[m] | it wasn't here in 0.19 |
08:48:07 | PMunch | Hmm, interesting: github.com/FemtoEmacs/nimacros/commit/22d6276f937574711a95b49261c31dd189a29f46 |
08:49:03 | FromGitter | <kayabaNerve> Does anyone use Make + Nim? |
08:49:08 | Zevv | I do |
08:49:11 | FromGitter | <kayabaNerve> Or any build system + Nim other than nimscript? |
08:49:53 | PMunch | I mostly use Nimble |
08:50:00 | FromGitter | <kayabaNerve> Weird. I have a nimscript config file (likely could be a cfg though I do have a single if check) but I just use pragmas to coordinate builds. |
08:50:21 | PMunch | Nake was popular a while ago, but I'm not sure if it's very much used nowadays |
08:51:06 | FromGitter | <kayabaNerve> Side question, does Nim's GC successfully handle circular objects that reference itself? |
08:51:13 | FromGitter | <kayabaNerve> Nake's pretty dead, RIP :( |
08:52:55 | FromGitter | <kayabaNerve> (and to further explain my question, I'm thinking about circular linked lists) |
08:53:07 | PMunch | More by the same author, from three years ago: https://github.com/FemtoEmacs/femtodocs/blob/master/femto.pdf |
08:53:40 | PMunch | Parts of chapter 2 is more or less a copy-paste into the Nim macro thing |
08:54:31 | Zevv | I like the little pictures, makes me think of Leo Brodie |
08:54:37 | PMunch | And then chapter 4 is "The man who knew Javanese" which appears to be a random short story |
08:55:42 | Zevv | But try to find any sentence of that on google - nothing! |
08:55:42 | PMunch | And then chapter 5 "Arithmetic operations" |
08:55:46 | PMunch | This is, special.. |
08:56:26 | PMunch | Well the man who knew javanese is apparently a thing |
08:56:47 | narimiran | look how entertained you are. and you want me to delete it so nobody else can experience this? |
08:56:54 | narimiran | you selfish bastards! |
08:56:55 | solitudesf | relax guys, thats just how old people think |
08:56:57 | Zevv | :) |
08:57:18 | * | floppydh joined #nim |
08:58:01 | Zevv | First I suspected malicious intent, but this might just as well originate from a disturbed person. A good friend of my would generate similar ramblings when on the edge of psychosis |
08:59:15 | PMunch | Yeah, it really appears like that.. |
08:59:35 | Zevv | TempleOS |
08:59:44 | PMunch | Exactly! |
09:00:02 | PMunch | Hmm, I found a version of that story from 1966, but it's quite different |
09:00:11 | PMunch | Seems like he's written his own version |
09:01:24 | PMunch | Oh it's originally portugese.. |
09:08:45 | FromGitter | <kayabaNerve> So I finished glancing through Chapter 11. It's hilarous |
09:09:27 | PMunch | Did you actually read it? I only read a sentence here and there |
09:13:55 | * | Hideki_ joined #nim |
09:14:56 | FromGitter | <kayabaNerve> Define reading |
09:14:58 | FromGitter | <kayabaNerve> I glanced it |
09:15:07 | FromGitter | <kayabaNerve> Oh. I did read Chapter 4 |
09:15:30 | FromGitter | <kayabaNerve> *I rad enough of Chapter 11 to understand what it's about. |
09:16:00 | PMunch | Haha, can chapter 11 be understood? |
09:16:12 | FromGitter | <kayabaNerve> I mean, it's written horribly, but yes |
09:16:19 | FromGitter | <kayabaNerve> > Suddenly, the girl spoke. "Grandfather, after killing this bad man, and before throwing the body into the river, cut his hair off for me. I need it for Rachel's wig. The hair of the other bad man, which I sewed onto my doll's head has almost entirely gone." |
09:16:32 | FromGitter | <kayabaNerve> This was one of my favorite lines. Typed it up to text it to a friend. |
09:16:39 | FromGitter | <kayabaNerve> That exposition lol. Everyone speaks like that. |
09:17:16 | PMunch | Wow, I really should read this.. |
09:18:24 | PMunch | I assume no-one actually knows edu500ac? If this is indeed a psychosis thing they should probably seek help.. |
09:18:25 | FromGitter | <kayabaNerve> That's after he invades a boat, talks about the practices of wrapping tobacco and chain smoking, and gets threatened by the captain to have his male personal parts cut off. |
09:18:32 | * | Hideki_ quit (Ping timeout: 268 seconds) |
09:18:46 | FromGitter | <kayabaNerve> He also slips in at the end of the statement he knows martial arts. I think he specified takwaendo. |
09:19:05 | FromGitter | <kayabaNerve> *taekwondo. I apparently do not know how to spell that 0_o |
09:19:26 | PMunch | Yeah there are a lot of random slip-ins |
09:20:14 | FromGitter | <kayabaNerve> The entire section on women involving a danish mormon is ridiculous. |
09:20:31 | PMunch | In the other story there was a footnote saying something like "Before any of my scholary readers accuse me of plagiarizing I must avow that I know Ancient Greek and the first book i ever read was <some book>" |
09:20:42 | PMunch | Haven't read that |
09:20:43 | FromGitter | <kayabaNerve> It probably gets too dicey to bring up further in this christian minecraft server. |
09:20:52 | FromGitter | <kayabaNerve> Yep, lol. That was also ridiculous. |
09:21:15 | PMunch | But the part amount the study of american preferences in woman and butts was interesting |
09:21:22 | FromGitter | <kayabaNerve> It's in Chapter 11 after he talks about going to Brazil and how he wanted a French professor at the helm of the boat or something. |
09:21:27 | FromGitter | <kayabaNerve> ... yep, that's the part. |
09:21:56 | PMunch | Oh, I just read a sentence here and a sentence there :P |
09:35:58 | Araq | Southpark in reality |
09:36:40 | Araq | I'm sure you all remember the episode where they write a terrible book that adults love to get sick about |
09:38:03 | Araq | ... silence ... ok, never mind |
09:38:31 | PMunch | Haha, I haven't actually seen that episode |
09:41:05 | * | GordonBGood quit (Remote host closed the connection) |
09:43:10 | FromGitter | <kayabaNerve> Oh. I remember this lol. |
09:43:38 | FromGitter | <kayabaNerve> And they're all puking but think it's the best book to ever exist, but the kids are scared so they blame Butters, and then they want credit when their parents aren't mad. |
09:43:55 | Araq | yep, that one |
09:47:08 | * | nif quit (Quit: ...) |
09:47:21 | * | nif joined #nim |
09:51:39 | * | ng0_ joined #nim |
09:54:20 | * | ng0 quit (Ping timeout: 260 seconds) |
09:58:18 | * | ng0_ is now known as ng0 |
09:59:59 | lqdev[m] | wasn't there a pointer arithmetic module built into the stdlib? |
10:01:13 | lqdev[m] | I remember a PR for that but I don't know whether it was merged or not |
10:03:39 | FromDiscord | <arnetheduck> lqdev, not merged. we have a similar one in https://github.com/status-im/nim-stew/blob/master/stew/ptrops.nim |
10:03:56 | Zevv | everybody wants it, but nobody dares merge it |
10:04:13 | FromGitter | <matrixbot> `Balu` Hi there is this the official nim server? β And if so where could one ask for support? |
10:04:40 | Zevv | I think the idea is that it should be hard. If you stuff like `cast[pointer](cast[uint](p) + cast[uint](bytes))`, your increased heart rate and gooseebumps should act as a warning |
10:04:47 | * | solitudesf quit (Ping timeout: 268 seconds) |
10:05:04 | Zevv | Hi Balu, you're in the right place |
10:05:44 | lqdev[m] | @Balu yes, this is the official Nim server. also, you don't need to connect via matrix, there's a gitter channel which is bridged directly to IRC |
10:05:45 | lqdev[m] | wait, it's the other way around |
10:06:02 | lqdev[m] | you can connect to #freenode_#nim:matrix.org directly |
10:06:46 | * | Balu[m]1 joined #nim |
10:07:18 | * | stefantalpalaru joined #nim |
10:10:03 | lqdev[m] | @arnetheduck, ah, it was this module |
10:11:09 | Balu[m]1 | ok so hopefully i am in the right channel |
10:11:09 | Balu[m]1 | i was trying to do some threading stuff with nim and i am having a hard time a, i have looked at the documentation are there some other ressources than the documentation? Ideally that also go low latency networking? |
10:11:52 | Balu[m]1 | * ok so hopefully i am in the right channel |
10:11:53 | Balu[m]1 | i was trying to do some threading stuff with nim and i am having a hard time a, i have looked at the documentation are there some other ressources than the documentation? Ideally that also go into low latency networking? |
10:12:01 | Balu[m]1 | * ok so hopefully i am in the right channel |
10:12:02 | Balu[m]1 | i was trying to do some threading stuff with nim and i am having a hard time , i have looked at the documentation are there some other ressources than the documentation? Ideally that also go into low latency networking? |
10:20:19 | FromDiscord | <ZeeQyu> Nim in Action has a chapter on threadpool which helped me a lot. It mentions threads too, but I can't remember if it was in depth or not. That might not be the caliber you're looking for, but I thought I'd mention it either way. |
10:21:09 | Balu[m]1 | @ze |
10:22:33 | Balu[m]1 | @ZeeQyu i have read the documentation and its a bit shallow for me tbh so i was looking for a more practical tutorial or guide |
10:22:49 | Balu[m]1 | * |
10:27:16 | FromDiscord | <ZeeQyu> Yeah, not talking about the online documentation, nim in action is a printed book. |
10:27:46 | * | solitudesf joined #nim |
10:27:50 | PMunch | Balu, by the way, please don't edit your messages. They show up as copies on IRC |
10:27:54 | Araq | Balu[m]1, compile with --threads:on --gc:boehm and use {.gcsafe.}: <block here> |
10:28:06 | Araq | if the compiler complains |
10:28:23 | PMunch | Haha, the ultimate hack |
10:28:41 | Araq | you get all the thread problems and no help from nim but I'm beginning to think that's what people want so *shrug* |
10:28:59 | PMunch | Thread problems? |
10:29:40 | Araq | data races |
10:29:54 | PMunch | Balu, if you wait an indeterminate amount of time I will finish my article series on multitasking in Nim |
10:29:54 | Balu[m]1 | I see, was wondering what these red messages meant |
10:29:55 | Balu[m]1 | not really using gitter, matrix or irc much |
10:30:04 | Araq | deadlocks |
10:30:22 | Araq | but actually we have pragmas to fight them |
10:30:24 | PMunch | Araq, well you get those in Nim without boehm as well don't you? |
10:30:37 | PMunch | Oh yeah, but you could use those with boehm as well, no? |
10:30:41 | Araq | no, because the sharing is MUCH more restrictive |
10:31:00 | Balu[m]1 | i would not really call it thread problems its just i need a lot of performance out of it and i have no clue if i shoot myself in the foot with the things i write if i have no reference |
10:31:47 | * | Vladar quit (Quit: Leaving) |
10:32:40 | PMunch | Oh right, yeah I guess data races would be an issue |
10:32:42 | * | abm joined #nim |
10:32:49 | PMunch | As long as you don't use the locking pragmas |
10:33:02 | Balu[m]1 | are there some projects people have written or something where i could get some feeling on how to do things |
10:33:03 | Balu[m]1 | ? |
10:33:18 | Balu[m]1 | *that are pretty clear and not confusing af |
10:34:36 | PMunch | Nothing I can think of off the top of my head |
10:34:51 | * | solitudesf quit (Remote host closed the connection) |
10:34:56 | PMunch | Are you familiar with threading in general? |
10:35:02 | PMunch | From another language for example |
10:35:37 | leorize | there's httpbeast, but I'm unsure if it's quality :p |
10:35:53 | PMunch | Is httpbeast multithreaded? |
10:35:58 | PMunch | I thought that was just async |
10:36:57 | leorize | it's multithreaded |
10:37:04 | Balu[m]1 | yes i am so i know how you can end up in threadhell |
10:37:11 | leorize | only if you compile it with --threads:on though |
10:37:18 | PMunch | Aah right |
10:37:42 | PMunch | Balu[m]1, okay, is there anything in particular that you are afraid of? |
10:37:45 | leorize | also @mratsim should know a lot about threading in Nim |
10:38:02 | PMunch | The default GC behaves a bit different from "normal" threading environments |
10:38:09 | * | solitudesf joined #nim |
10:38:26 | lqdev[m] | I'm wondering, how can I get a unique string representation for a type? I need it during runtime. |
10:38:57 | Balu[m]1 | PMunch: yes being slow i need to hit certain speed requirerments |
10:39:01 | PMunch | Each thread gets its own heap, and sharing has to be done by copying, or explicit ptr passing and then manually making sure the memory is not collected |
10:39:09 | Balu[m]1 | and obviously having leaks and crashes all over the place |
10:39:21 | * | kevin joined #nim |
10:39:39 | PMunch | lqdev[m], unique? Depends on the type I guess |
10:39:44 | * | kevin is now known as Guest94463 |
10:40:18 | PMunch | Balu[m]1, well speed is mostly just normal Nim optimisation and then keeping in mind lock-contention and other such issues that you are probably familiar with |
10:41:10 | * | LargeEpsilon quit (Ping timeout: 268 seconds) |
10:41:29 | PMunch | Leaks should be pretty uncommon unless you start playing with GC_ref, which you probably shouldn't |
10:41:57 | PMunch | And crashes are more common when doing threading stuff, but that's just because you need to pass pointers around. |
10:43:26 | lqdev[m] | PMunch: talking about objecs here. say I have module a with object A, then module b with object A, I want a stringified representation of these objects' names so that they don't clash when added into a table |
10:43:42 | lqdev[m] | afaik it's impossible to use NimNodes at runtime? |
10:44:49 | PMunch | Of their names? |
10:45:00 | Araq | you can turn the names into strings and store the names |
10:45:49 | PMunch | So essentialy you want "a.A" and "b.A"? |
10:46:04 | * | Balu[m]1 sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/xKWSErHGcBDFxSYrcvYWyBRD > |
10:48:29 | lqdev[m] | PMunch: yeah |
10:48:35 | lqdev[m] | something like this |
10:49:24 | PMunch | Balu[m]1, maybe set up a thread for each core, then create channels to pass the data back and forth. When a request comes it, pass it onto a channel. Then one of the threads can read it from that channel, do the processing, and pass it back over a different channel. |
10:50:30 | * | Guest94463 quit (Quit: Leaving) |
10:50:56 | * | kevin_ joined #nim |
10:51:48 | * | kevin_ quit (Client Quit) |
10:52:03 | * | kevin_ joined #nim |
10:52:12 | * | kevin_ quit (Client Quit) |
10:52:42 | Balu[m]1 | the problem is i don't have enough cores to do that all at once |
10:54:11 | PMunch | What do you mean? That's why you spawn one thread per core and use channels to communicate |
10:55:05 | Balu[m]1 | assuming a 4core machine for this |
10:55:06 | Balu[m]1 | and lets say i have just 3 sockets and 3 pre built http request i need |
10:55:12 | PMunch | lqdev[m], well types don't really exist on runtime. So a macro that takes a typedesc and returns a string should work for you. |
10:55:15 | Balu[m]1 | thats 6 threads |
10:56:04 | Balu[m]1 | which means i have too many threads (i am aware that threads and cores are not the same) |
10:56:23 | PMunch | Wait |
10:56:39 | FromDiscord | <arnetheduck> isn't threadpool broken? |
10:56:44 | PMunch | So you have 3 sockets, data comes in, get's processed, and a reply is sent? |
10:56:55 | PMunch | arnetheduck, it is? |
10:57:25 | FromDiscord | <arnetheduck> I keep hearing that, and that yglukhov has some better version |
10:57:41 | FromDiscord | <arnetheduck> along with flowvars and channels |
10:58:14 | FromDiscord | <arnetheduck> only time I used channels (for a fairly simple case: testament) it crashed |
10:58:23 | Balu[m]1 | i have x sockets (2-infinity) and that results into at least 2 http request i have to sent out if the comparison evaluates to true which i make on the data i get with those sockets |
10:59:05 | Balu[m]1 | and performance is number 1 here so you can see how i can not just spawn random stuff around and do the request when needed |
10:59:47 | Balu[m]1 | and afaik the fastest cpus atm are 4 cored and you would be even faster with less cores |
11:00:44 | lqdev[m] | PMunch: I know, I'm asking how I could write one that does what I need |
11:00:53 | lqdev[m] | I don't know how to get the module name. |
11:01:17 | lqdev[m] | or better yet, some type hash. |
11:01:24 | * | GordonBGood joined #nim |
11:01:38 | PMunch | lqdev[m], old post but: https://forum.nim-lang.org/t/2784 |
11:01:53 | PMunch | Well you could hash the type implementation |
11:02:15 | lqdev[m] | sounds like an idea |
11:02:25 | PMunch | But that would mean type a.A and b.A would be the same if they have all the same fields |
11:02:35 | PMunch | And/or names depending on how you do it |
11:03:47 | PMunch | Balu[m]1, well you can assume the sockets are IO bound, so running all those on a single thread should be fine. What kind of comparison do you do? Between the socket data, or only within a single socket? |
11:04:24 | lqdev[m] | hm, there's signatureHash |
11:05:32 | Balu[m]1 | what do you mean io bound? can you elaborate a bit on that? |
11:05:32 | Balu[m]1 | i am doing math comparison but very simple ones just some addition,subtraction,division and multiplication |
11:06:31 | PMunch | IO bound as in the time spent reading/writing to the socket is not bound by how fast the CPU is, but rather by the network. So multithreading the reading/writing probably won't help at all |
11:07:01 | PMunch | Yeah, but are you comparing data across the sockets? |
11:07:20 | Balu[m]1 | PMunch: i should have maybe mentioned the data i receive is json and pretty nested so i would do the unmarshaling or unjsoning whatever you wanna call it in that thread |
11:07:25 | * | GordonBGood quit (Remote host closed the connection) |
11:07:31 | Balu[m]1 | yes but the sockets are from different providers |
11:07:37 | * | LargeEpsilon joined #nim |
11:07:47 | Balu[m]1 | so i get socketA from lets say Australia socketB from japan |
11:08:29 | Balu[m]1 | and so on so i think i am not bound by network speed there as they are two enteties |
11:08:32 | PMunch | So there is no data sharing between the sockets? |
11:08:41 | Balu[m]1 | there is |
11:08:44 | Balu[m]1 | the comparison |
11:08:51 | Balu[m]1 | for example: |
11:08:58 | Balu[m]1 | i need to find the highest number |
11:09:08 | Balu[m]1 | socket a gives me 1 socket b gives me 100 |
11:09:29 | Balu[m]1 | i need to compare that and send a http respond back to socket a saying you are lower |
11:09:37 | Balu[m]1 | and a http request to b saying you are higher |
11:10:00 | PMunch | And how do you match them? |
11:10:20 | Balu[m]1 | what do you mean? |
11:10:30 | Balu[m]1 | i take all sockets compare teh data against all the other sockets |
11:10:39 | PMunch | ie. if socket A sends 100 messages and socket B sends a 100 messages, which message from socket A should compare to which message from socket B |
11:10:44 | Balu[m]1 | and would limit that amoun based on how many cores i have |
11:11:01 | Balu[m]1 | always the lates message |
11:11:13 | Balu[m]1 | you can think of it like a auction |
11:11:19 | Balu[m]1 | they will send bids |
11:12:20 | Balu[m]1 | and the main thing here is that the speed only matters in those comparison |
11:13:34 | Balu[m]1 | it can take days to establish a socket connection and initalize whatever it wants i don't care about that it just matters in those ms during the comparison that the programm is as fast as possible so i want to preload/build and allocate as much as i can |
11:19:01 | PMunch | Okay, one thread does socket IO, sends the received "bids" tagged with a sender/message count to a channel. Then your N threads (where N is amount of cores or something similar) parse the JSON and extracts the data, this is then passed back on a channel with the same sender/message count label to the IO thread. This thread then matches the message count labels and sends the messages to the correct recipient. |
11:19:20 | PMunch | If the comparisson is slow you need some kind of map/reduce structure instead |
11:20:14 | FromDiscord | <arnetheduck> re threads in general, there's still https://github.com/nim-lang/Nim/issues/9878 that's been accepted |
11:22:51 | Balu[m]1 | PMunch: thats too slow i already tried that and other implementations beat that with no problem |
11:23:14 | PMunch | What other implementations? |
11:23:56 | * | ng0 quit (Ping timeout: 260 seconds) |
11:24:22 | Balu[m]1 | basically every implementation where i splitted the sockets that receive data into their own threads or tried too |
11:25:15 | Balu[m]1 | ideally i am looking for a freeze option or something like that where i can freeze threads and memory and move that somewhere else |
11:25:32 | PMunch | Huh? |
11:25:37 | PMunch | Like a thread-stealer? |
11:25:46 | PMunch | Err, work-stealer |
11:25:49 | Balu[m]1 | afaik that does not exist so its more a theory example |
11:26:18 | Balu[m]1 | ye i guess something like that |
11:27:33 | PMunch | Well, I wrote this a little while back: http://ix.io/1XA9/nim |
11:27:35 | Balu[m]1 | i guess what i am trying to say is i am looking for something that allows me to use more cores than i have in the best way possible |
11:27:41 | PMunch | Essentially a simple PoC work-stealer |
11:28:13 | PMunch | Must be compiler with --gc:boehm by the wa |
11:29:18 | PMunch | I mean with channels you are copying the memory. If you can make sure that the socket IO thread doesn't free the JSON string you could pass a pointer to it over the channel instead.. |
11:31:57 | PMunch | Have you tried to profile this? |
11:32:25 | PMunch | By the way that work stealer is not very optimised |
11:32:39 | Balu[m]1 | kinda tried it but more in theory land |
11:32:54 | Balu[m]1 | don't know how to profile real world http requests reliably |
11:33:35 | Balu[m]1 | afaik you either run it for a long time and just hope that everything averages out or you do some guess work |
11:33:47 | Balu[m]1 | and both is not very scientific |
11:34:29 | Balu[m]1 | my current aproach is just use the fastest tools i can reasonably have and hope for the best |
11:35:02 | PMunch | That's even less scientific :P |
11:35:17 | Balu[m]1 | i am very open for advice |
11:36:46 | Balu[m]1 | i guess thats what i get for scipping CS class |
11:40:53 | PMunch | Haha, yeah having CS education helps :P |
11:42:34 | * | rockcavera joined #nim |
11:44:50 | Balu[m]1 | PMunch: do you know if anyone has compared nim (speedwise) to normal C or Rust in a kinda trusthworthy and deep way? |
11:46:18 | PMunch | At lot of such comparissons have been done for single-threaded code |
11:46:34 | PMunch | Not sure about multi-threading |
11:47:33 | Balu[m]1 | a yes? where? |
11:50:16 | PMunch | Just google around |
11:51:31 | Balu[m]1 | I did all i found were some kids benchmarking on their macbooks while running minecraft in the background |
11:51:51 | FromDiscord | <mratsim> what kind of bench? |
11:52:10 | FromDiscord | <mratsim> Any speed you can reach with C, you can reach in Nim |
11:52:57 | Balu[m]1 | ideally a wide range of marks |
11:52:58 | Balu[m]1 | so they say |
11:53:08 | Balu[m]1 | mainly just curious |
11:53:28 | FromDiscord | <mratsim> well I have plenty in my repos, you just need to pick your poison |
11:54:24 | FromDiscord | <mratsim> Implementing exponential 10x faster than math.h: https://github.com/numforge/laser/blob/master/benchmarks/vector_math/bench_exp.nim |
11:54:51 | FromDiscord | <mratsim> As fast as assembly and JITtesd code in pure Nim: https://github.com/numforge/laser/blob/master/benchmarks/gemm/gemm_bench_float32.nim |
11:55:45 | FromDiscord | <mratsim> About 2x faster than Intel TBB and 10x faster than LLVM OpenMP on workstealing scheduler: https://github.com/mratsim/weave/tree/master/benchmarks/fibonacci |
11:56:36 | FromDiscord | <mratsim> as fast as C on a Quake raytracer: https://forum.nim-lang.org/t/5124#32243 |
11:59:51 | FromDiscord | <mratsim> The only perf that might be hard to replicate might be C++ virtual functions, might be faster, might be slower but you can always write your own VTable |
12:02:00 | Balu[m]1 | Nice will have a look at them |
12:11:45 | * | Trustable joined #nim |
12:25:04 | * | ng0 joined #nim |
12:35:00 | * | Hideki_ joined #nim |
12:36:15 | * | Vladar joined #nim |
12:41:28 | planetis[m] | mratsim: how you compiled your multiplication benchmark |
12:41:40 | * | clyybber joined #nim |
12:42:09 | planetis[m] | -d:release? |
12:43:53 | PMunch | Hmm, I think I managed to get GCC to lock up.. |
12:44:44 | * | nsf quit (Quit: WeeChat 2.6) |
12:46:33 | PMunch | It just never completes CC: helloworld.nim |
12:46:47 | clyybber | nice |
12:46:52 | clyybber | show us |
12:48:02 | PMunch | http://ix.io/1ZN6 |
12:49:04 | PMunch | If you actually want to try and run it: clone https://github.com/PMunch/unbound put that file in dynlibmod/examples. Then run ./configure --with-dynlibmodule && make in the root directory |
12:49:18 | PMunch | Then "nim c --app:lib helloworld.nim" in the examples directory |
12:50:03 | PMunch | Curiously compiling with cpp doesn't hang, but throws an error instead |
12:50:41 | PMunch | Because it places an include to util/log.h before the config.h include I tried to force in there.. |
12:54:41 | Zevv | PMunch: I think this is what I ran into a few months ago |
12:54:53 | Zevv | gcc is exectued and writes into a pipe |
12:55:11 | Zevv | nim waits for the proc to exit and *then* reads the pipe |
12:55:19 | PMunch | Aaah |
12:55:20 | Zevv | and the pipe fills up, so gcc will stall and never end |
12:56:57 | PMunch | It does spit out 3709 lines.. |
12:57:15 | PMunch | (I did --genScript:on and then ran that script) |
12:59:51 | PMunch | Oh great.. |
13:00:31 | PMunch | running with --genScript:on, then manually adding the #include I was trying to emit in the correct place and running the script makes it compile fine.. |
13:08:18 | * | a_b_m joined #nim |
13:10:00 | * | abm quit (Ping timeout: 265 seconds) |
13:14:27 | clyybber | So its a nim issue? |
13:15:07 | Zevv | stdlib issue |
13:15:20 | Zevv | actually. We do not have proper handling of subprocesses and pipes |
13:16:12 | PMunch | Hmm, interesting: /home/peter/.choosenim/toolchains/nim-#devel/lib/core/macros.nim(573, 3) Error: redefinition of 'headerwire2str'; previous declaration here: /home/peter/.choosenim/toolchains/nim-#devel/lib/core/macros.nim(573, 3) |
13:16:55 | PMunch | Previous declaration from same line? |
13:17:05 | PMunch | Or is that just a quirk of the macros module? |
13:17:52 | Araq | can happen easily if the declaration is inside a template and you instantiate it twice... |
13:19:21 | FromGitter | <Willyboar> Some feedback please. https://github.com/thebigbaron/pine |
13:19:52 | FromGitter | <Willyboar> Maybe the worst code base you can see but it is working |
13:20:32 | FromGitter | <Willyboar> Be polite it is my 3rd week project :) |
13:31:11 | * | tklohna_ quit (Ping timeout: 276 seconds) |
13:40:49 | clyybber | Willyboar: Would be a good idea to include the source of the example IMO |
13:40:57 | PMunch | Hmm, this binding is hard to get right.. |
13:41:24 | PMunch | So essentially the files seem to be require types from each other |
13:42:24 | FromGitter | <Willyboar> @clyybber This is right. I will create a repo with the default build. |
13:42:48 | PMunch | So module.h will require some type from msgreply.h, but msgreply.h also requires something from module.h. So there is no order I can do the cImports in that makes Nim happy.. |
13:43:00 | * | tklohna_ joined #nim |
13:49:21 | * | dddddd joined #nim |
13:50:30 | * | a__b__m joined #nim |
13:51:16 | PMunch | So I need to somehow grab the type definitions from the files first, then import the code while ignoring the types, essentially doing all the files in two different orders |
13:51:39 | PMunch | Oh wait, I need to do this multiple times for all the orders :S |
13:53:07 | * | leorize_ joined #nim |
13:53:59 | * | a_b_m quit (Ping timeout: 265 seconds) |
13:54:44 | PMunch | Willyboar, the hamburger menu on the demo page has a really strange hitbox.. |
13:56:32 | * | leorize quit (Ping timeout: 260 seconds) |
14:03:13 | * | floppydh quit (Quit: WeeChat 2.6) |
14:04:44 | shashlick | @PMunch how are the headers imported typically in C? |
14:05:45 | shashlick | If one doesn't include the other you could add a manually |
14:06:04 | shashlick | Or create a new file that includes both and cimport that |
14:06:13 | * | clyybber quit (Quit: WeeChat 2.6) |
14:07:58 | PMunch | Well in my working helloworld.c program I have two includes on config.h and util/module.h |
14:08:34 | PMunch | util/module.h is the only one of those that imports anything |
14:08:55 | PMunch | It imports lruhash.h, msgreply.h, and msgparse.h |
14:09:40 | PMunch | Hmm, wait a second |
14:10:23 | shashlick | By the way, the redefinition isn't a macros issue |
14:10:58 | shashlick | It's cause you are using multiple times on the same header file - toast creates that const |
14:11:17 | PMunch | Ah right, msgreply.h has a "struct module_qstate;" definition, but msgreply.c has a #include "util/module.h" |
14:11:42 | PMunch | Yeah I'm not sure what was going on with that, but it's not an issue any longer |
14:12:02 | shashlick | Ok |
14:12:18 | shashlick | Macros complains cause we are using parseStmt |
14:12:49 | FromGitter | <Willyboar> @PMunch Hmm... I know whats going wrong with that. I will fix it soon. |
14:14:01 | FromDiscord | <mratsim> @planetis the compilation command is there: https://github.com/numforge/laser/blob/e660eeeb723426e80a7b1187864323d85527d18c/benchmarks/gemm/gemm_bench_float32.nim#L371 |
14:14:12 | FromDiscord | <mratsim> nim cpp -r -d:release -d:danger -d:openmp --outdir:build benchmarks/gemm/gemm_bench_float32.nim |
14:15:52 | shashlick | @PMunch is hard with forward declarations |
14:16:02 | PMunch | If someone more familiar with nimterop wants a challenge over the weekend, implement this in Nim: https://github.com/PMunch/unbound/blob/master/dynlibmod/examples/helloworld.c |
14:16:16 | PMunch | Yeah I noticed.. |
14:16:24 | stefantalpalaru | "danger" implies "release", @mratsim: https://github.com/nim-lang/Nim/blob/60ff41a8da9fffecea034846dc415086b2c12ed6/config/nim.cfg#L72 |
14:16:29 | shashlick | You might need to declare it up top in a type and skip it in both files |
14:16:52 | PMunch | Yeah.. That's sorta why I wanted to use nimterop though |
14:17:04 | PMunch | In order to not have to declare a bunch of types and such manually |
14:17:26 | shashlick | I don't yet have a solution for forward declarations |
14:17:34 | shashlick | You only need to do it for those though |
14:17:40 | * | nsf joined #nim |
14:17:53 | shashlick | Rest can be done automatically |
14:18:06 | PMunch | I mean look at this monster: https://github.com/PMunch/unbound/blob/master/util/module.h#L577-L645 |
14:18:32 | PMunch | I'd probably need to do all the children types as well |
14:18:49 | shashlick | That's the one that's forward declared? |
14:18:54 | shashlick | Plus nested types ugh |
14:19:46 | PMunch | I mean it is even forward declared within its own file: https://github.com/PMunch/unbound/blob/master/util/module.h#L172 |
14:21:10 | PMunch | Running toast on that file manually actually doesn't spit out a definition for it |
14:21:21 | PMunch | Sees the first definition and ignores the second.. |
14:22:07 | skelett | Hi all, I'm currently implementing a parser using the `pegs` module. Is there an easy way to define an equivalent to the RegEx token `\b` using pegs? |
14:22:48 | narimiran | Zevv: ^ |
14:23:01 | Zevv | yellow! |
14:23:14 | PMunch | Oh well, I'm off |
14:23:15 | * | PMunch quit (Quit: Leaving) |
14:23:27 | narimiran | hi off, i'm dad |
14:24:16 | Zevv | narimiran: I can't do it. sorry. |
14:25:03 | Zevv | just not my style |
14:28:49 | FromGitter | <Willyboar> @Clyybber I create one repo with the default build https://github.com/thebigbaron/pineblog |
14:29:45 | * | NimBot joined #nim |
14:31:41 | * | jjido joined #nim |
14:31:42 | FromGitter | <Willyboar> And here is the live https://thebigbaron.github.io/pineblog/ |
14:32:13 | disruptek | !eval import md5; echo readFile(getAppFilename()).toMD5 |
14:32:15 | NimBot | Compile failed: /usercode/in.nim(1, 27) Error: undeclared identifier: 'getAppFilename' |
14:32:24 | disruptek | !eval import md5, os; echo readFile(getAppFilename()).toMD5 |
14:32:28 | NimBot | 16fd8a2c93ce094f4e20125f66a9fcb8 |
14:32:36 | * | disruptek o7 |
14:35:01 | * | Hideki_ quit (Remote host closed the connection) |
14:36:02 | * | Hideki_ joined #nim |
14:37:59 | * | Hideki_ quit (Remote host closed the connection) |
14:38:15 | * | Hideki_ joined #nim |
14:38:17 | shashlick | Ya cause toast can't do cOverride |
14:38:27 | * | theelous3_ joined #nim |
14:42:11 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
14:44:05 | Zevv | skelett: I don't think there is. What problem are you trying to solve? |
14:52:47 | lqdev[m] | this doesn't work as expected: https://play.nim-lang.org/#ix=1ZOH I'd expect the proc calls to yield the same results as the macro calls. can I work around that somehow? |
14:54:18 | * | a__b__m quit (Quit: Leaving) |
14:55:12 | * | jjido joined #nim |
14:58:51 | * | Hideki_ quit (Remote host closed the connection) |
14:59:36 | * | Hideki_ joined #nim |
14:59:47 | disruptek | lqdev: why don't you define typeHash[ObjX]() for the different types in a macro; then it'll be consistent by definition. |
15:00:34 | lqdev[m] | disruptek: what do you mean? |
15:01:25 | disruptek | have a macro that writes a series of typeHash(o: `some type`): string = `some str lit` procedures. |
15:01:33 | * | clyybber joined #nim |
15:04:03 | * | Hideki_ quit (Ping timeout: 245 seconds) |
15:09:13 | FromGitter | <geotre> Anyone know why the nim js backend randomly puts objects in 1-element arrays? |
15:09:14 | lqdev[m] | disruptek: I'm afraid that it'd be way too complex for what I'm trying to do |
15:10:09 | lqdev[m] | well, then. I'll try asking a different question. how can I store a type's unique ID expressed as a uint16? |
15:10:23 | disruptek | what you're trying to do is make compile-time hashing of types match runtime hashing of types. the types won't change, so why don't you just store them as procs or constants? |
15:10:35 | lqdev[m] | maybe not specifically a uint16, can be any int really. |
15:10:47 | disruptek | ah, you just hate strings that much? |
15:10:58 | lqdev[m] | no |
15:11:05 | lqdev[m] | I can't store a string |
15:11:19 | lqdev[m] | let me explain what I'm doing |
15:11:25 | lqdev[m] | I'm trying to store some runtime information about what object type is stored in a Wren foreign object |
15:11:53 | FromGitter | <Lecale> Hi nimsters, does anyone have time to try to answer a nimble install fail question for me |
15:11:55 | lqdev[m] | so I thought storing an additional int besides the actual object in foreign data might be an option |
15:11:59 | lqdev[m] | this int would represent the type of the object |
15:12:38 | lqdev[m] | @Lecale don't ask if you can ask |
15:12:43 | lqdev[m] | just ask the question |
15:13:17 | FromGitter | <Lecale> The system cannot find the file specified. β β ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5db3110de886fb5aa2f4633a] |
15:13:33 | disruptek | well, the mechanism is the same regardless of the type of the value you want to store. calculate it at compile-time and define it there so that you can retrieve the same value at runtime. i don't see what's complex about that; it's hard to imagine a faster solution for runtime code. |
15:15:47 | disruptek | this might help: https://www.youtube.com/embed/5X-Mrc2l1d0 |
15:16:09 | lqdev[m] | disruptek: yeah, that's what I wanted to do. I wanted to store the type info in a table defined in the `Wren` object |
15:16:38 | lqdev[m] | which could be looked up with the previously mentioned int |
15:16:56 | disruptek | sounds really amazing, brah. |
15:19:10 | * | Traviss__ joined #nim |
15:19:10 | * | Traviss__ quit (Client Quit) |
15:21:57 | FromDiscord | <treeform> geotre, its because they are ref objects, JS can't have memory pointers, but it can have indexes. So each type has an object pool with indexes, each ref is just an index into that object pool. |
15:22:05 | * | Traviss__ joined #nim |
15:22:05 | FromDiscord | <kodkuce> Lecale you have gcc installed right? |
15:22:29 | FromGitter | <geotre> @treeform that's what I thought, but this isn't a ref |
15:22:31 | FromDiscord | <treeform> geotre, 1-element array probably means you only have 1 of that object. |
15:22:48 | * | traviss quit (Ping timeout: 245 seconds) |
15:22:52 | * | Traviss__ quit (Client Quit) |
15:22:54 | FromGitter | <geotre> It's an object as a field of another object |
15:23:13 | FromDiscord | <treeform> geotre, sorry its regular objects that do this, ref objects are plain js objects. |
15:23:14 | FromGitter | <geotre> And a similar field doesn't get put into an array |
15:23:15 | * | traviss joined #nim |
15:24:02 | FromGitter | <geotre> Let me see if I can get a simple reproduction |
15:24:29 | FromDiscord | <treeform> geotre, I use ref objects everywhere in my JS code so that I get regular JS objects. |
15:27:57 | FromGitter | <geotre> Just switched it to a ref object, same result |
15:28:27 | FromGitter | <geotre> Maybe it's down to the size of the object? |
15:30:08 | * | traviss quit (Quit: Leaving) |
15:30:26 | * | traviss joined #nim |
15:33:47 | skrylar[m] | lua's object model supports inheritance if you want it, tho |
15:35:13 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
15:35:38 | clyybber | And there are maintained lua-jit forks |
15:36:34 | skrylar[m] | have been using janet, which is a lisp by the same person as wrote the fennel (lisp>lua) transpiler |
15:37:10 | disruptek | what have you written in janet? |
15:37:27 | skrylar[m] | they also use prototypes for quite a few things |
15:38:36 | skrylar[m] | @disruptek gdk3 bindings are made by a janet script https://git.sr.ht/~skrylar/sknGDK3 |
15:38:37 | skrylar[m] | (mostly) |
15:40:16 | * | Hideki_ joined #nim |
15:41:31 | FromGitter | <geotre> If I remove some fields from the parent object then I no longer get the 1-element array problem, so I'm pretty sure it's down to the size |
15:42:17 | skrylar[m] | biggest difference between prototypes (lua/io/js/janet) and "inheritance" (ignoring for a moment thats an abuse of the word, but its what people want to call it) is the runtime cost of calling procs :\ |
15:43:49 | disruptek | skrylar[m]: this is pretty cool. so you just process the original api to something easier to consume? i'm a little lost in the source. |
15:44:41 | skrylar[m] | theres a hand tweak stage to get rid of things that are hard to process and not worth it (ex. handing #ifdef when all that does is just work around stuff thats already deprecated anyway), then it goes in to a PEG parser to get a mini-ast, and then uses a visitor to spit out nim |
15:44:58 | skrylar[m] | followed by another hand tweak stage to handle stupidities like "enum out of order" |
15:46:10 | FromGitter | <brentp> how can i used the result of getStream from nim-lang/zip/zipfiles? |
15:46:41 | FromGitter | <brentp> ```code paste, see link``` β β gives a compile error [https://gitter.im/nim-lang/Nim?at=5db318e1fb4dab784a047ec1] |
15:46:51 | disruptek | oh, i get it. do you publish the product elsewhere? |
15:46:52 | lqdev[m] | disruptek: http://ix.io/1ZOW/nim line 160 |
15:46:55 | FromGitter | <brentp> `Error: attempting to call undeclared routine: 'readData'` |
15:46:57 | lqdev[m] | I'm not sure how to solve this, at all. |
15:48:30 | FromDiscord | <mratsim> import the module that contains readData |
15:48:52 | FromDiscord | <mratsim> you might have a generic sandwich |
15:49:20 | FromGitter | <brentp> ah. that was it. |
15:49:29 | FromGitter | <brentp> I think zip/zipfiles should export streams, eh? |
15:49:45 | FromGitter | <brentp> thanks @mratsim |
15:49:56 | disruptek | lqdev[m]: what role does RawVM play here? why would you need the vm to hash the type? |
15:50:13 | Araq | that's not a "generic sandwich", I know you love this word but it doesn't come up as often as you think |
15:51:04 | Araq | for a "generic sandwich" you need to have a 'mixin' declaration |
15:52:03 | clyybber | next time I go to subway I'm gonna order a generic sandwich |
15:52:14 | lqdev[m] | disruptek: `RawVM` stores the `Wren` instance in userdata. I want to store the generated hash/ID in a table in the `Wren` instance, the main problem is, the type I have is a generic type, and signatureHash doesn't work well with generics. |
15:52:28 | lqdev[m] | it hashes `T` and not the actual type passed as a generic param |
15:52:59 | lqdev[m] | so I'm asking: how can I get the generic param passed to my proc? |
15:53:20 | clyybber | Huh, just use the name of the generic param? |
15:53:37 | disruptek | but you don't need generics for the hashing, because you aren't ever going to look up the type hash for a type that doesn't exist. π€ͺ |
15:54:02 | lqdev[m] | clyybber: that won't work, see https://play.nim-lang.org/#ix=1ZOH |
15:54:03 | disruptek | again, you can predefine them. |
15:54:47 | lqdev[m] | disruptek: OK, but that's not my point |
15:55:52 | clyybber | lqdev[m]: You want the hash of a type is that right? |
15:56:24 | lqdev[m] | yeah, and that type is passed in as a generic param. |
15:56:46 | lqdev[m] | simply doing what I did in that playground example doesn't work. |
16:01:59 | disruptek | did you try my suggestion? |
16:02:42 | disruptek | skrylar[m]: which has more uptake, fennel or janet? |
16:02:55 | clyybber | lqdev[m]: I would use .getType() in that macro |
16:03:12 | clyybber | But it complains with "node is not a symbol" |
16:04:15 | clyybber | lqdev[m]: Do you need that proc? typeHash? |
16:04:53 | lqdev[m] | I need the hash of the generic param `T` passed to `newForeign` |
16:04:58 | * | Hideki_ quit (Ping timeout: 265 seconds) |
16:05:31 | lqdev[m] | I just came up with something, hopefully noone will kill me for using globals for this. |
16:07:20 | clyybber | lqdev[m]: YOu can use default(T) |
16:07:26 | clyybber | And then pass it to the macro |
16:07:35 | clyybber | use getType, etc. |
16:07:42 | clyybber | But I can't get it to work |
16:07:44 | lqdev[m] | hmm, sounds like an idea |
16:07:47 | clyybber | still have node is not a symbol |
16:08:07 | lqdev[m] | clyybber: make the macro parameter `typed` |
16:08:13 | FromDiscord | <mratsim> if "typed" it's a symbol |
16:08:19 | FromDiscord | <mratsim> yes ditto |
16:08:43 | clyybber | the macro parameter is typed |
16:09:20 | clyybber | and when I do `let tmp = default(T); getHash(tmp)` |
16:09:28 | clyybber | tmp is arguably a symbol, isn;t it? |
16:13:29 | clyybber | ah |
16:13:34 | clyybber | .getType() isn't.. |
16:13:36 | clyybber | alright |
16:16:29 | clyybber | lqdev[m]: Normally every type has an associated sym. Not sure how to access that in macros tho. I'm coming more from a compilers perspective |
16:17:30 | Araq | no. |
16:17:40 | disruptek | still think you're making this harder than it needs to be. |
16:17:42 | Araq | many types do not have a sym |
16:17:52 | Araq | seq[int] for example |
16:18:02 | clyybber | Araq: Yeah, I meant a sym field, and in lqdevs example every type has |
16:18:40 | clyybber | lqdev[m]: What do you need it for though? |
16:18:42 | Araq | well yes, seq[int] doesn't have a sym field |
16:18:55 | Araq | or to be precise: its sym field is nil |
16:19:14 | clyybber | Yeah |
16:19:23 | lqdev[m] | clyybber: I need to get a unique int which denotes a type |
16:19:46 | FromGitter | <alehander42> but what about equivalence |
16:19:49 | FromGitter | <alehander42> e.g. if A = B |
16:19:55 | FromGitter | <alehander42> is A int = B int |
16:20:14 | lqdev[m] | I got it here so far http://ix.io/1ZP7/nim |
16:20:45 | lqdev[m] | but the problem is, this http://ix.io/1ZP7/nim#n-160 prints `Sym "T"` which is not what I want |
16:21:03 | clyybber | lqdev[m]: No I mean why you need it? For Wren? |
16:21:09 | clyybber | I thought Wren is a scripting language? |
16:21:17 | lqdev[m] | clyybber: yeah |
16:21:25 | lqdev[m] | I want it for better error reporting |
16:21:54 | lqdev[m] | I thought that I can prepend the actual type's data with an integer signifying the type, which I can then look up in a table for error reporting |
16:22:13 | clyybber | Where comes wren into play? |
16:22:23 | clyybber | I'm not sure I understand what you are trying to do. |
16:23:11 | clyybber | nim types only exist at ct, wrens types exist only at rt but not at ct. |
16:23:22 | clyybber | At least when you use it as a scripting language. |
16:23:38 | * | kungtotte quit (Quit: WeeChat 2.6) |
16:23:51 | lqdev[m] | hm, how can I explain this |
16:24:01 | * | abm joined #nim |
16:24:12 | lqdev[m] | I want to check whether you pass the right types to Nim procs from Wren |
16:24:21 | * | kungtotte joined #nim |
16:24:36 | lqdev[m] | but the problem is foreign types, where you can't easily check whether a value is of a given type at runtime |
16:24:37 | clyybber | Aha |
16:25:02 | clyybber | But Wren types are not nim types right? |
16:25:08 | clyybber | You have to convert them at some point |
16:25:13 | lqdev[m] | nope |
16:25:30 | lqdev[m] | but Wren can store arbitrary bytes using foreign classes |
16:25:37 | * | LargeEpsilon quit (Ping timeout: 240 seconds) |
16:25:44 | clyybber | Hmm |
16:25:57 | lqdev[m] | you can assign a Nim object to this data given to you by Wren |
16:26:27 | shashlick | Is cdecl available on osx? |
16:26:34 | lqdev[m] | but Wren only knows it's a "foreign" type, it doesn't know what it really is |
16:26:46 | shashlick | And is it the default for cmake |
16:27:56 | lqdev[m] | so I thought prepending the foreign data with an additional 'type ID' would allow for reporting the actual type stored in foreign data in errors |
16:28:39 | disruptek | so there's really no reason you cannot use a fixed-length string, or a cstring, or a serialized object with its length, or pretty much anything. |
16:29:13 | disruptek | so for the last time, why do you not simply calculate a hash for the type at compile-time and use that? |
16:29:43 | clyybber | That is what he wants to do afaict |
16:30:05 | clyybber | Because calling that proc from wren isn't gonna work. Nim needs to know the type at ct. |
16:30:13 | lqdev[m] | how do I get the type passed to a generic param? I need to know the actual type passed to my `newForeign` proc to calculate that hash. |
16:30:31 | disruptek | so write a macro that creates constants for each of the types you want to work with. |
16:31:07 | disruptek | or procs, if you must. then just call them. you don't need to know types; nim will bind them for you correctly. that's the whole point of generics. |
16:31:34 | clyybber | lqdev[m]: Can't get the hash of the type afaict. Since signatureHash only operates on symbols. |
16:32:20 | disruptek | yes, but you only run signatureHash at compiletime. on the symbol. and then you create something that you can run at runtime, which returns that value you discovered at compiletime. |
16:32:56 | lqdev[m] | disruptek: you're missing the point of my question. how do I get the type passed to my generic param in the first place? |
16:33:15 | disruptek | runtime or compiletime? |
16:33:22 | lqdev[m] | I need to hash it somehow, but if I simply pass `T` into my macro all it'll see is `Ident "T"`. |
16:33:28 | lqdev[m] | compile time |
16:34:07 | disruptek | are you telling me you don't know the types you'll want to use in wren? you aren't going to define them ahead of time? |
16:34:14 | * | jjido joined #nim |
16:34:46 | lqdev[m] | not in euwren.nim. |
16:36:00 | disruptek | at some point, you're going to have to provide information to the computer to tell it what to do. |
16:37:01 | * | luis_ joined #nim |
16:37:09 | clyybber | bbl |
16:37:11 | * | clyybber quit (Quit: WeeChat 2.6) |
16:37:13 | * | ng0_ joined #nim |
16:37:32 | * | ng0 quit (Ping timeout: 260 seconds) |
16:37:36 | * | ng0_ is now known as ng0 |
16:37:53 | lqdev[m] | let me rethink what I want to do |
16:40:03 | disruptek | what you could do is to have a template that will register the type the first time you use it near some wren, ie. pass it to wren or w/e. |
16:41:11 | disruptek | or make the whole system runtime. it's not obvious to me that you need the compile-time component. |
16:49:32 | FromDiscord | <kodkuce> and i dont want to learn rust or C++ when Nim is almost 100% magic |
16:50:08 | FromDiscord | <mratsim> Any sufficiently advanced technology is indistinguishable from magic |
16:51:29 | FromDiscord | <kodkuce> thats why i writed almost ,still missing hacked newruntime π |
16:54:52 | FromGitter | <alehander42> learn many languages |
16:54:58 | FromGitter | <alehander42> if you feel like it |
16:55:11 | FromGitter | <alehander42> its good to have different tools |
16:55:41 | * | rockcavera quit (Remote host closed the connection) |
16:55:45 | disruptek | new languages bring new paradigms to old tools, too. |
16:58:03 | * | luis_ quit (Ping timeout: 240 seconds) |
17:01:39 | disruptek | are there basically no operations for ranges or am i just not looking in the right place? |
17:01:54 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
17:02:05 | FromGitter | <Willyboar> I think nimble directory needs a redesign |
17:02:11 | FromGitter | <Willyboar> no offence |
17:02:13 | narimiran | federico3: ^ |
17:02:14 | FromGitter | <Willyboar> :) |
17:03:08 | FromDiscord | <mratsim> ranges uses the same operations of the base type |
17:03:19 | FromDiscord | <mratsim> unless you meant ranges as in openarray |
17:03:30 | * | tklohna_ quit (Ping timeout: 268 seconds) |
17:04:38 | disruptek | i have some ranges of enums and i want to, eg. `if thing notin Range1 + Range2:` |
17:05:16 | disruptek | i'll just turn them into sets i guess. |
17:05:57 | FromGitter | <Willyboar> @narimiran i tried to run it locally but i can't figure it out. I will try to play with it. |
17:07:19 | * | jjido joined #nim |
17:09:22 | * | nif quit (Quit: ...) |
17:09:34 | * | nif_ joined #nim |
17:09:48 | * | Trustable quit (Remote host closed the connection) |
17:13:39 | FromGitter | <Willyboar> ``` friendly_timeinterval.nim(50, 20) Error: type mismatch: got <Duration> but expected 'int' ``` |
17:14:44 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
17:19:24 | FromDiscord | <Chiqqum_Ngbata> Range1 + Range2 implies rangeset no |
17:30:38 | * | rockcavera joined #nim |
17:45:20 | * | jjido joined #nim |
17:47:25 | * | jjido quit (Client Quit) |
17:49:26 | shashlick | size_t might be biting me too |
17:49:35 | * | jjido joined #nim |
17:49:56 | shashlick | Need a review of https://github.com/nimterop/nimterop/blob/master/nimterop/getters.nim#L45 |
17:50:23 | shashlick | size_t and ssize_t seem wrong to me now |
17:51:01 | shashlick | Cannot map to csize either cause that's wrong too |
17:52:12 | Araq | "size_t": "uint" is what you're looking for |
17:52:54 | shashlick | And ssize_t will be just int? |
17:54:27 | Araq | yes+ |
17:54:52 | shashlick | At least there's a bug but I'm wondering how this works on win lin but breaks on osx |
17:55:27 | shashlick | Anyway, will get back after some testing |
17:56:45 | shashlick | Thanks @Araq |
17:58:25 | FromDiscord | <Chiqqum_Ngbata> Is float64 not SomeNumber ? |
18:04:21 | * | jjido quit (Quit: My MacBook has gone to sleep. ZZZzzzβ¦) |
18:18:28 | lqdev[m] | @Chiqqum_Ngbata how so? |
18:18:48 | lqdev[m] | !eval float64 is SomeNumber |
18:18:50 | NimBot | Compile failed: ???(0, 0) Error: expression 'true' is of type 'bool' and has to be discarded |
18:19:36 | lqdev[m] | !eval echo float64 is SomeNumber |
18:19:39 | NimBot | true |
18:19:59 | Araq | lol the error message gave it away already |
18:20:07 | Araq | ... expression 'true' ... |
18:20:37 | lqdev[m] | yeah, I'm just pedantic so I wanted a proper `true` |
18:20:42 | lqdev[m] | lol |
18:28:33 | lqdev[m] | does `newCall` work for calling macros? |
18:29:05 | Araq | yes |
18:30:11 | lqdev[m] | for some reason my macro is expanded immediately, then. |
18:31:29 | lqdev[m] | http://ix.io/1ZPG/nim#n-226 see `macro foreign` and `macro addProcAux`. |
18:32:07 | * | Vladar quit (Quit: Leaving) |
18:34:58 | * | nsf quit (Quit: WeeChat 2.6) |
18:48:46 | lqdev[m] | Araq: yesterday you said that `bindSym` can only be used for `typed` macro parameters, right? so what can I do if my parameter is `untyped`? |
18:51:25 | Araq | no |
18:51:35 | Araq | bindSym works with string literals. |
18:52:58 | lqdev[m] | only with string literals? |
18:53:12 | lqdev[m] | so how can I .getImpl for a proc? |
19:02:22 | * | rockcavera quit (Remote host closed the connection) |
19:03:09 | * | lbartoletti quit (Ping timeout: 246 seconds) |
19:03:41 | * | lbartoletti joined #nim |
19:06:22 | Araq | via a typed macro parameter |
19:15:42 | * | rockcavera joined #nim |
19:23:14 | * | gangstacat quit (Ping timeout: 240 seconds) |
19:31:03 | disruptek | nimble doesn't install tests, docs, or examples. what a killer feature. |
19:32:57 | disruptek | if i have to clone the package to get any of that stuff, why bother with nimble? |
19:35:47 | shashlick | https://github.com/nim-lang/nimble/issues/653 |
19:37:03 | * | gangstacat joined #nim |
19:38:37 | disruptek | i can see the utility of not including test data, but to me this is probably better handled with git submodules. |
19:39:03 | skrylar[m] | submodules are wonky, but i use them for dependencies :| |
19:39:30 | skrylar[m] | well they can get weird if A depends on B and C while B depends on C since you can end up with a submodule cloning a submodule that you are already cloning |
19:40:01 | skrylar[m] | which is why meson added that mechanic of all deps belong in a top level dep folder and then sub projects get cloned in to an overarching thing to assemble them |
19:40:16 | disruptek | yes, but they solve the problem of "i wanna git clone but i don't wanna dl 400mb of test data i don't need; if i run tests, you can fetch 'em then" and they let us act without prior knowledge. |
19:40:46 | * | filcuc quit (Ping timeout: 252 seconds) |
19:40:48 | disruptek | almost all clones would include tests. |
19:41:14 | disruptek | this has nothing at all to do with dependencies. |
19:41:51 | disruptek | ignore me, i'm pretty frustrated right now. just sometimes feels like people don't even try to use this stuff. |
19:44:43 | disruptek | please raise your hand if you want this: https://github.com/disruptek/ndoc |
19:46:55 | dom96 | why when `nim doc` exists? |
19:47:06 | disruptek | have you ever run `nim doc`? |
19:47:17 | disruptek | have you ever run `pydoc`? |
19:47:56 | shashlick | i've used nim doc pretty successfully |
19:48:07 | disruptek | have you ever run `pydoc`? |
19:49:11 | disruptek | 'nuff said. |
19:49:24 | shashlick | so you want a cli tool to show the docs? |
19:49:59 | disruptek | yes, sincle apparently i also have to generate them myself, or at least try to -- nim doc doesn't even work for me much of the time. |
19:50:58 | dom96 | Have you made an attempt to improve `nim doc`? |
19:51:17 | disruptek | what's the point? |
19:52:02 | FromDiscord | <treeform> I had this idea of md-doc, https://github.com/treeform/mddoc |
19:52:18 | FromDiscord | <treeform> what if instead of generating HTML you generate md file and add that to the read me. |
19:52:40 | FromDiscord | <treeform> Because most libraries are small and only have a few methods. |
19:53:37 | FromDiscord | <treeform> here is an example of the readme it generates: https://github.com/treeform/chroma |
19:53:46 | disruptek | i just want a way to get docs that a) don't yet exist, and b) are in my console, and c) might be constrained to a particular symbol. |
19:54:43 | disruptek | i would even render them with color/italics/bold/whatever, or even bounce you into a browser if you want. but i'm sick and tired of having to google every damned thing when i have a computer here that can actually compute exactly what i want to see. |
19:55:32 | disruptek | have you seen this? https://github.com/h3rald/hastyscribe |
19:55:56 | dom96 | disruptek, what do you think is the point? |
19:56:37 | disruptek | i dunno dom96, i'm still waiting for a review on a dead-simple hack to improve the usability of nimble dramatically. not gonna even contemplate adding bump or trying to hack `nim doc` for my needs. |
19:56:45 | disruptek | i mean, please. |
19:56:48 | disruptek | give me a damned break. |
20:01:17 | shashlick | @disruptek - just tried bump - git branch --show-current => error: unknown option `show-current' |
20:01:18 | disruptek | treeform: where are you actually generating this md? i can't figure that out. |
20:01:25 | shashlick | uh oh; i cannot tell if i'm on the master branch |
20:01:39 | disruptek | `git --version` |
20:01:48 | * | Hideki_ joined #nim |
20:02:29 | shashlick | 2.17.1 |
20:02:31 | shashlick | ubuntu |
20:02:55 | disruptek | do you have an alternative method to determine your current branch? |
20:03:16 | disruptek | i just changed it so that it will refuse to run if you're not on master; seems safest. |
20:03:24 | shashlick | not pretty - git branch | check for * in output |
20:03:53 | disruptek | alright, i will fix it. in the meantime, because i've tagged that change and only that change, you can simply revert to 1.7.4. |
20:03:59 | dom96 | disruptek, 1) It's been just 5 days 2) Your attitude doesn't exactly encourage me to spend my time reviewing your PR 3) Your PR appears to have no impact on users other than yourself, 4) It does hacky shell escapes which may or may not work on Windows. |
20:04:00 | disruptek | nice, right? |
20:04:21 | disruptek | dom96: take your time. |
20:05:33 | disruptek | shashlick: oh, it's 1.7.3 you want, not 1.7.4 my bad. |
20:06:23 | * | Hideki_ quit (Ping timeout: 250 seconds) |
20:06:25 | shashlick | @dom96 - i would like to see some info in the PR that makes it easy to check the repo, i am often on my phone and seeing a new package repo added requires me to check the diff, select, copy paste and what not |
20:06:55 | disruptek | i just don't have the patience to codevelop dom's software. and that's fine. different strokes. |
20:07:14 | disruptek | treeform: i'm still curious about this if you wanna pass me a clue. |
20:07:20 | FromGitter | <alehander42> i kinda agree with dom's review |
20:07:35 | disruptek | then you're happy i closed the pr. π |
20:08:01 | FromGitter | <alehander42> no, i just think you should improve/add tests for the escape logic |
20:10:16 | disruptek | well, iirc i tried to use the shellEscape in stdlib and it was broken for this application somehow. |
20:11:34 | shashlick | nimterop and nimarchive were both just bumped |
20:11:46 | disruptek | wow, trying something new? |
20:12:09 | shashlick | bug fixes - now hopefully choosenim osx starts working |
20:12:26 | shashlick | don't have osx handy to test |
20:12:40 | shashlick | if i could just ssh in somewhere, would make life so easy |
20:16:28 | disruptek | i will never test nim code that i write on windows. i'm just not going to do it, ever. if that precludes my contributions, so be it. better to know before i go through the grief of submitting a pr. |
20:17:26 | disruptek | i guess i didn't read the contribution guidelines in this case. |
20:18:24 | FromGitter | <alehander42> well, nim is very multi platform |
20:18:33 | FromGitter | <alehander42> but i guess the CI should run the tests on windows |
20:19:32 | shashlick | my general advice is to first confirm that the owner is interested in a change before spending any time building it |
20:20:12 | disruptek | i intend to use my branch. i explained my reasons. i wouldn't publish software if i didn't think it'd help people to use it. |
20:20:40 | disruptek | you can decide if it's useful when i publish my next piece of code. if you like it, feel free to fork my branch. |
20:21:17 | shashlick | and i do get into details so that i'm in sync, i've wasted time in the past |
20:22:15 | disruptek | ima build ndoc in any event. i just thought i'd gauge interest. i'm got too many projects that are important to me to build stuff for others that they don't want. |
20:22:48 | * | narimiran quit (Ping timeout: 245 seconds) |
20:23:07 | shashlick | i'd suggest using nim doc functionality to pull the docmentation from code and just focus on rendering it differently |
20:23:59 | disruptek | i think i'm gonna use nimsuggest but i really haven't done any research. i'm curious to try it, though, because it might yield a superior solution for gully. |
20:24:58 | disruptek | if nim doc worked for me, that'd be one thing, but i don't see the point in building on quicksand. |
20:25:37 | shashlick | what exactly is the issue with `nim doc`? i'm using it with nimterop, nimarchive and nimgit2 so am wondering what's the problem |
20:25:45 | shashlick | i understand it does not render to the CLI |
20:25:49 | FromGitter | <xmonader> I think i found bug in async β https://gist.github.com/xmonader/af0ed799520206acda6e78872678dc9e β β run `python3 -m http.server on any place` β ... [https://gitter.im/nim-lang/Nim?at=5db35a4d3d669b28a0d86534] |
20:26:23 | shashlick | but it could be expanded to print to the cli, allow search, etc |
20:26:35 | disruptek | shashlick: here's one: https://github.com/xomachine/NESM/issues/13 |
20:26:37 | shashlick | an ndoc tool on top would make it cleaner sure |
20:27:03 | FromGitter | <xmonader> https://github.com/xmonader/nimdays/issues/11 original bug |
20:28:00 | shashlick | nimdoc and nimsuggest are completely different modes of the compiler and they do have issues |
20:28:34 | Araq | if I may try to moderate |
20:28:49 | FromGitter | <xmonader> stacktrace of what it's failing with β β ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5db35b012f8a034357d9098e] |
20:28:53 | disruptek | yes, but leorize has nimsuggest on fleek. i'm down to rely upon it, as it works perfectly for me everywhere. |
20:29:04 | shashlick | here's one I fixed recently - https://github.com/nim-lang/Nim/pull/11814 |
20:29:14 | Araq | a PR that says "take it or leave it" but remains open is fine IMO |
20:29:56 | Araq | it's understandable that not everybody wants to play the tiresome ping-pong game with a PR review process etc |
20:30:20 | Araq | having said that, if the PR includes a testcase the CI runs it on Windows too anyway |
20:33:11 | disruptek | you are welcome to anything i publish. |
20:33:34 | Araq | xmonader: I don't know if it's a stdlib issue or you misusing it ;-) |
20:33:40 | dom96 | xmonader: seems this line is failing: https://github.com/nim-lang/Nim/blob/devel/lib/pure/asyncdispatch.nim#L1843 |
20:34:01 | dom96 | Did semantics for that line change Araq? |
20:34:23 | Araq | yeah ... now needs a len check |
20:34:44 | Araq | interesting how long it takes to sort out these things |
20:35:04 | Araq | we changed that in 0.19? |
20:35:24 | dom96 | so this only gets triggered when `data` is "" I guess? |
20:35:30 | Araq | yes |
20:35:31 | FromGitter | <xmonader> one of nimdays readers tried to over use the tcp router and caught that :) |
20:35:36 | FromGitter | <xmonader> @dom96 yes |
20:35:45 | dom96 | That's probably why we never caught it |
20:35:50 | dom96 | No one would send that on purpose :P |
20:36:05 | dom96 | but yes, these kinds of changes is why Nim 1.0 is so important |
20:36:34 | FromGitter | <xmonader> I guess it's more related to browser network |
20:36:56 | dom96 | If you get "" from the socket then you should be handling that |
20:36:59 | dom96 | it means the socket disconnected |
20:37:13 | dom96 | I guess that code just attempts to send over another socket whatever it gets |
20:38:27 | FromGitter | <xmonader> the problem is http server running some where and a client (the browser) wants to reach it using that proxy, i think it's more related to the constant pulling? not sure |
20:39:53 | FromGitter | <xmonader> also I think maybe related to asyncCheck usage, because imo normal await on socket recv shouldn't yield "" |
20:41:56 | dom96 | it should |
20:42:15 | dom96 | Like I said, when a socket is disconnected that is what you get from `recv` |
20:49:20 | FromDiscord | <treeform> disruptek, "i'm still curious about this if you wanna pass me a clue." - I just saw a discussion around nim doc and I wanted to share my tool that does docs as a github readme. |
20:51:38 | * | GordonBGood joined #nim |
20:55:05 | * | lkw quit (Quit: ZNC 1.7.3 - https://znc.in) |
20:55:34 | * | lkw joined #nim |
21:01:42 | FromGitter | <xmonader> @dom96 did you try to do basic auth in jester? because I also encountered the same while trying to implement basic auth middleware |
21:05:06 | dom96 | nope, but that's just a header no? |
21:05:10 | * | msmorgan joined #nim |
21:06:27 | FromGitter | <xmonader> yeah but i also got empty data during the process, so i think maybe just getting empty string isn't really an indication the socket is closed |
21:07:08 | dom96 | it is |
21:07:31 | dom96 | https://nim-lang.org/docs/asyncnet.html#recv%2CAsyncSocket%2Cint |
21:08:39 | lqdev[m] | https://play.nim-lang.org/#ix=1ZQs can anyone explain to me why is the macro fully expanded? I thought expandMacros only expands one level. |
21:09:04 | FromGitter | <xmonader> yeah but what if the socket will get some data pushed into it after a few seconds? maybe the user writing his creds and pressing enter? |
21:10:30 | mipri | the underlying syscall either blocks or gives you an error (including EAGAIN / EWOULDBLOCK , telling you to try again) if there could be more content. a 0-length reply is always EOF |
21:11:24 | shashlick | @dom96 - if you are still here, please review https://github.com/dom96/choosenim/compare/master...genotrance:nimarchive |
21:11:42 | dom96 | shashlick, make a PR |
21:11:46 | shashlick | i'll submit soon after minor cleanup - replaced untar with nimarchive so now can extract xz, 7z natively |
21:11:59 | dom96 | that way my comments can be preserved |
21:12:02 | shashlick | setup full Windows CI |
21:12:11 | shashlick | okay how long you here |
21:13:04 | shashlick | also, install linux binary builds when available |
21:13:06 | lqdev[m] | anyone? I've been struggling with this for a while now. |
21:13:25 | shashlick | @Araq - the size_t fix fixed my libarchive issue on OSX |
21:13:58 | Araq | that's nice and disturbing, but ok |
21:14:03 | FromGitter | <xmonader> @lqdev it will generate the text `echo "Hello World"` in the compilation |
21:14:35 | FromGitter | <xmonader> and for b macro it will get replaced with a call to a |
21:14:44 | lqdev[m] | @xmonader I know, but why doesn't it generate `a()` instead. |
21:15:05 | lqdev[m] | as mentioned here: https://nim-lang.org/docs/macros.html#expandMacros.m%2Ctyped |
21:15:09 | lqdev[m] | it should expand one level |
21:15:14 | FromGitter | <xmonader> you expand b first -> a() -> a gets expanded -> echo("Hello, World") |
21:15:28 | lqdev[m] | that's two levels |
21:15:44 | Araq | there is also --expandMacro |
21:15:51 | FromGitter | <xmonader> I don't think it's valid to have macros hanging in the code in the compilation step |
21:15:53 | Araq | nim c --expandMacro:foobar |
21:16:00 | Araq | it's new in v1 |
21:21:48 | shashlick | @dom96 - https://github.com/dom96/choosenim/pull/143 |
21:22:51 | dom96 | shashlick, something that will make it easier for me to review and so faster for your PRs to be merged: please split up your PRs more. This PR seems to include a lot of different new functionality |
21:23:23 | Araq | just accept that you have gained a core developer and let him do his thing |
21:23:46 | shashlick | the travis stuff is inherited from nimarchive to enable windows CI |
21:23:54 | shashlick | choosenim doesn't work as is, i have comments in there |
21:25:22 | shashlick | I can put in some explanations in the PR but it was distracting in the past |
21:27:45 | disruptek | magic is open to interpretation. |
21:27:58 | dom96 | Araq, I would love to have others review my changes tbh |
21:28:10 | disruptek | treeform: i mean, i looked at it, but while i can read the output, i don't see how it's created in the first place. |
21:28:33 | Araq | dom96: deal. create Nimble PRs and let me review it |
21:29:49 | Araq | I'll eventually review your PRs after a week or so, make silly remarks and then you need to change these things and then we wait for the CIs and then I might make more remarks until you lost interest in contributing |
21:30:20 | shashlick | @dom96 - i fixed tester.nim to use execCmdEx's algorithm since it was missing lines in the output and failing tests |
21:31:43 | shashlick | once this is done, i'll add holy build box to the Linux CI so that the created binary can be used on any linux distro/version |
21:35:47 | disruptek | shashlick: bump 1.7.6 fixes your buglet; thanks. |
21:35:56 | shashlick | peace |
21:36:37 | dom96 | Approved with some minor comments |
21:36:52 | dom96 | Also, please fix CI |
21:37:21 | shashlick | ya nimble test hides all the messages and travis times out |
21:37:24 | shashlick | i'll clean it up |
21:37:46 | * | nif_ quit (Quit: ...) |
21:39:43 | * | nif joined #nim |
21:41:14 | disruptek | shashlick: did you see what cligen did for `csize`? |
21:42:06 | disruptek | https://github.com/c-blake/cligen/releases/tag/v0.9.40 |
21:42:45 | * | nif quit (Client Quit) |
21:44:43 | * | nif joined #nim |
21:45:02 | shashlick | yep that's what nimterop is also effectively doing |
21:45:47 | disruptek | is that in 0.3.1? |
21:47:12 | shashlick | yep |
21:47:20 | shashlick | that's what fixed my nimarchive osx issue |
21:48:01 | disruptek | okay, good; ima bump my nimterop and cligen reqs. |
21:49:36 | shashlick | see i'm releasing more often π |
21:49:50 | disruptek | is good, yes? |
21:49:52 | disruptek | is good. |
21:50:10 | Araq | is 'nimble bump' a thing now? |
21:51:25 | disruptek | no, but while `nim doc` works, there should be enough here for an enterprising soul to add it: https://disruptek.github.io/bump/bump.html |
21:51:57 | rockcavera | Is there any proc to do a reverse array? index 0 for high index and high index for 0? |
21:52:07 | rockcavera | I searched, but I didn't find it. |
21:52:12 | disruptek | see the `algorithm` module, iirc. |
21:52:26 | disruptek | `reversed` |
21:53:10 | shashlick | @Araq - did you want to update the mingw version we are testing and shipping? |
21:53:13 | rockcavera | disruptek thanks =D |
21:53:34 | rockcavera | I knew I had seen it, but I didn't know which package. |
21:53:43 | disruptek | yeah, it's sneaky like that. |
21:56:03 | * | solitudesf quit (Ping timeout: 240 seconds) |
21:57:28 | Araq | shashlick: sounds like a good idea |
21:58:06 | shashlick | did you want to still have a link to mingw on our site or just point to the official links? |
21:59:39 | shashlick | looking to resolve this - https://github.com/dom96/choosenim/pull/143/files/2f3ed0d366c889de97cd57338e2b1d89e9fcf8ad#diff-426be060ff890c3910f76bf5805616d1 |
21:59:58 | Araq | we mirror the mingws |
22:01:01 | Araq | because sourceforge is an offense |
22:01:42 | shashlick | you prefer win32-dwarf for i686 and win32-she for x64 right |
22:02:54 | shashlick | i can post on nim-lang but i don't have access |
22:03:38 | shashlick | do you want to retain version info in the names |
22:09:06 | shashlick | @dom96 - PR is passing now, made some changes and replied to feedback |
22:14:47 | Araq | version info is fine and I prefer table based exception handling, however that is named |
22:18:08 | * | vsantana joined #nim |
22:18:35 | shashlick | Structured Exception Handling (SEH) on 64-bit only |
22:19:07 | * | vsantana quit (Client Quit) |
22:20:42 | * | vsantana joined #nim |
22:23:04 | * | abm quit (Quit: Leaving) |
22:23:59 | Araq | bah ok |
22:24:20 | shashlick | okay who can help me post the binaries on nim-lang |
22:25:04 | * | GordonBGood quit (Remote host closed the connection) |
22:40:19 | rayman22201 | I found a race condition in virtual async events. But I won't have time this weekend to fix it :-( |
23:02:35 | federico3 | what is the right way to normalize identifiers? |
23:02:56 | disruptek | normalize? |
23:03:52 | disruptek | this might be useful depending on what you're trying to do: https://github.com/disruptek/openapi/blob/master/src/openapi/codegen.nim#L160 |
23:03:59 | federico3 | nope: it lowercases everything |
23:04:30 | disruptek | i believe the capsOkay flag enables caps. |
23:04:53 | federico3 | I mean normalize() |
23:05:16 | disruptek | i was asking what you meant by the word `normalize`. |
23:05:51 | disruptek | capsOkay in my proc toggles FirstCharacterCaps or notFirstCharacterCaps. |
23:05:57 | federico3 | hah, I thought you were suggesting strutils.normalize :D |
23:07:13 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
23:07:22 | disruptek | well, my thingy consumes any stupid string. but it's not designed to, like, hash it, so you could create collisions. fwiw. |
23:07:44 | federico3 | btw you have dead code |
23:08:13 | disruptek | yeah it's more complete than anything. |
23:09:04 | FromDiscord | <SolarOmni> Hey guys, uh, sorry to interrupt, but, I saw that Nim is now 1.0, so, does anyone know any good libs or anything for game dev? |
23:09:08 | disruptek | also, isValidNimIdentifier may be useful because i don't think there's one that's correct in stdlib. |
23:09:35 | disruptek | SolarOmni: what kinda games? |
23:10:14 | FromDiscord | <SolarOmni> What do you mean? |
23:11:04 | disruptek | there is lotsa nim code for creating games; it's something nim accels at. if you can provide more detail on what kinda game you wanna work on, it'd be easier to steer you towards particular packages that may be of interest. |
23:11:38 | FromDiscord | <SolarOmni> Aw, well, that's hard to say, I was looking for something pretty versatile I'd say. Something that I can use for just about anything I guess. |
23:11:50 | FromDiscord | <SolarOmni> Something that I can use over and over again for many different games. |
23:11:54 | FromDiscord | <SolarOmni> But for the moment, I suppose.. |
23:11:58 | FromDiscord | <SolarOmni> A simulation game. |
23:12:01 | disruptek | i guess look at nimgl for starters. |
23:12:04 | FromDiscord | <ZeeQyu> @SolarOmni For starters, are you looking for 2D or 3D? Installed or in the browser? Networked or singleplayer? |
23:12:15 | FromDiscord | <SolarOmni> 2D. Singleplayer. Desktop. |
23:13:20 | FromDiscord | <SolarOmni> nimgl, I'll take a look. |
23:13:31 | FromDiscord | <ZeeQyu> This page has a Game Development section |
23:13:31 | FromDiscord | <ZeeQyu> https://github.com/VPashkov/awesome-nim |
23:13:51 | FromDiscord | <SolarOmni> @ZeeQyu I'll also take a look at that. |
23:14:47 | FromDiscord | <ZeeQyu> If you're looking for a fully featured engine (3d and 2d) you can write nim in, look at Godot. The engine in itself seems well-developed, but I'm not certain how good the nim integration is. |
23:14:53 | FromDiscord | <ZeeQyu> Haven't looked ati t |
23:17:03 | * | lritter quit (Ping timeout: 250 seconds) |
23:17:07 | FromDiscord | <SolarOmni> I'm not. |
23:17:14 | FromDiscord | <SolarOmni> I don't like engines really. |
23:17:18 | FromDiscord | <SolarOmni> I prefer code. |
23:17:29 | FromDiscord | <ZeeQyu> Don't underestimate editors |
23:17:35 | FromDiscord | <ZeeQyu> But yeah, I can see where you're coming from |
23:17:45 | FromDiscord | <ZeeQyu> Something pure about just having code |
23:18:16 | * | krux02_ joined #nim |
23:18:30 | FromDiscord | <SolarOmni> Yeah. |
23:18:42 | FromDiscord | <SolarOmni> I actually have extensive experience with Godot already, I don't like it. |
23:19:06 | FromDiscord | <SolarOmni> I can't really say why..I can't put my finger on it. |
23:19:12 | FromDiscord | <ZeeQyu> Oh, you have? I haven't worked with it, what's your problem with it- Oh |
23:19:45 | FromDiscord | <SolarOmni> Maybe because it's too similar to Unity. |
23:19:46 | FromDiscord | <SolarOmni> I don't know. |
23:19:55 | FromDiscord | <ZeeQyu> I'd love to hear the reason if you realize what irks you, so please at me if you figure it out |
23:20:20 | FromDiscord | <SolarOmni> Well it's been about a year so I doubt I'll figure it out π |
23:20:43 | FromDiscord | <ZeeQyu> Aight |
23:20:43 | * | krux02 quit (Ping timeout: 245 seconds) |
23:21:04 | FromDiscord | <treeform> I prefer not to use engines and I like building everything from scratch. |
23:21:11 | FromDiscord | <SolarOmni> My man |
23:21:13 | FromDiscord | <SolarOmni> Or gal |
23:21:14 | FromDiscord | <SolarOmni> ... |
23:21:21 | FromDiscord | <SolarOmni> *shuts up* |
23:22:49 | FromDiscord | <ZeeQyu> You can only write an ecs so many times before you get tired of it and just want to make the actual game, so I can't really relate. But yeah, if the writing from scratch is something that makes you happy in itself, then all power to you. |
23:23:11 | FromDiscord | <SolarOmni> I like reinventing the wheel? |
23:23:43 | FromDiscord | <ZeeQyu> Alright then |
23:24:00 | FromDiscord | <treeform> I love reinventing the wheel, I made many open source libraries that you can use for game development: https://github.com/treeform/steamworks https://github.com/treeform/netpipe https://github.com/treeform/openal https://github.com/treeform/quickcairo https://github.com/treeform/euphony |
23:24:01 | FromDiscord | <SolarOmni> Of course if I'm using the same tech I can just write my own libs. |
23:24:20 | FromDiscord | <SolarOmni> Ooohhh~ |
23:24:25 | FromDiscord | <SolarOmni> *grabby hands* |
23:24:29 | FromDiscord | <ZeeQyu> Oh hello. Don't mind if I do |
23:25:05 | federico3 | too many gaming libraries and none that I really like :( |
23:25:28 | FromDiscord | <treeform> a ton of time I just need to see how other people done it, so that I can do it my way π |
23:25:37 | FromDiscord | <treeform> so I don't use the libraries but I love reading them |
23:26:10 | federico3 | treeform: some demos of euphony? |
23:26:20 | FromDiscord | <ZeeQyu> I think that might be the healthiest way to write things from scratch. With a great degree of research |
23:26:45 | FromDiscord | <treeform> federico3 , each block: is a mini demo: https://github.com/treeform/euphony/blob/master/tests/test.nim |
23:28:13 | FromDiscord | <treeform> I really liked this one, it just came together so naturally: https://github.com/treeform/euphony/blob/master/tests/test.nim#L106 |
23:29:53 | federico3 | I mean an online, playable demo |
23:30:32 | FromDiscord | <treeform> euphony is a windows, mac, linux only. It does not work with JS. |
23:30:44 | FromDiscord | <treeform> it uses openAL.dll |
23:30:59 | FromDiscord | <treeform> So I can't really give that to you "online" |
23:31:13 | federico3 | treeform: you can record the output :D |
23:31:31 | FromDiscord | <treeform> that I can do |
23:37:19 | FromDiscord | <treeform> |
23:37:19 | FromDiscord | <treeform> https://cdn.discordapp.com/attachments/371759389889003532/637434548912783361/2019-10-25_16-36-45.mp4 |
23:37:45 | FromDiscord | <treeform> That's all from a single bell sound. |
23:38:07 | FromDiscord | <ZeeQyu> Did you implement the pitch shifting, or is that an OpenAL thing? |
23:38:16 | FromDiscord | <treeform> OpenAL thing |
23:38:34 | FromDiscord | <ZeeQyu> Aww. I hoped to read how that all worked in nim code. |
23:38:43 | FromDiscord | <ZeeQyu> Has never stopped fascinating me |
23:39:40 | FromDiscord | <treeform> pitch shifting is just 1d scaling |
23:40:10 | FromDiscord | <ZeeQyu> Do you mean as in slowing playback? |
23:40:18 | FromDiscord | <SolarOmni> So |
23:40:33 | FromDiscord | <SolarOmni> Anyone know if the SDL wrapper works okay? |
23:40:44 | FromDiscord | <treeform> I think the SDL wrappers work great. |
23:40:51 | FromDiscord | <treeform> I don't like SDL not low level enough for me π |
23:41:04 | FromDiscord | <treeform> I recommend `glfw` |
23:41:25 | FromDiscord | <SolarOmni> Too low for me. ^^; I'm not well versed in black magic enough for that yet. |
23:42:23 | FromDiscord | <treeform> I have the exact same example implemented in glut, glfw and SDL. Would you like to see? |
23:42:32 | FromDiscord | <SolarOmni> Sure. |
23:42:34 | FromDiscord | <ZeeQyu> Oh yes please |
23:42:42 | FromDiscord | <treeform> https://github.com/treeform/quickcairo/blob/master/examples/realtime_glut.nim |
23:42:47 | FromDiscord | <treeform> https://github.com/treeform/quickcairo/blob/master/examples/realtime_glfw.nim |
23:42:51 | FromDiscord | <treeform> https://github.com/treeform/quickcairo/blob/master/examples/realtime_sdl2.nim |
23:43:00 | FromDiscord | <treeform> oh SDL2 ... no one uses SDL 1. |
23:43:18 | FromDiscord | <treeform> well some old linux games do... but you should not write new code for SDL1. |
23:44:38 | FromDiscord | <SolarOmni> Haha |