00:21:04 | * | BitPuffin|osx quit (Ping timeout: 240 seconds) |
00:39:27 | * | Nobabs27 quit (Quit: Leaving) |
00:40:59 | krux02 | why is getSize from tuple and object so different? |
00:41:49 | krux02 | Araq: why is getSize from tuple and object so different? |
00:45:05 | * | Nobabs27 joined #nim |
01:06:09 | krux02 | no answer needed, staring at code long enoguh solves any problem |
01:07:22 | FromGitter | <Varriount> krux02: So? Why *are* they different? |
01:07:32 | FromGitter | <Varriount> Don't leave us in suspense! |
01:07:45 | krux02 | object is much more complex than tuple |
01:07:56 | krux02 | object has a lot of different cases |
01:08:18 | krux02 | for example it has a hidden type field for objects inheriting RootObj |
01:08:50 | krux02 | it has interesting type layout of case of objects (tagged unions) |
01:09:44 | FromGitter | <Varriount> I'd always imagined the case-objects were composed of unions |
01:10:01 | krux02 | well they are |
01:11:31 | ldlework | dom96: he came up with a nice implementation! |
01:12:13 | krux02 | ldlework: ??? |
01:14:00 | krux02 | is that an old conversation? |
01:14:40 | ldlework | krux02: yeah I think he knows what I mean |
01:15:04 | krux02 | ok, because I have no idea what you are talking about, but that is ok it was not addressed at me |
01:17:12 | FromGitter | <rosshadden> @gokr Do I still need to patch nim to use Ardunimo, or is the `useMalloc` compilation switch sufficient? |
01:20:04 | * | shashlick quit (Ping timeout: 240 seconds) |
01:21:43 | * | shashlick joined #nim |
01:26:37 | * | zachcarter quit (Quit: zachcarter) |
01:36:24 | * | Gonzih quit (Ping timeout: 246 seconds) |
01:41:03 | * | ftsf joined #nim |
01:52:04 | * | chemist69 quit (Disconnected by services) |
01:52:09 | * | chemist69_ joined #nim |
02:04:01 | * | Serenit0r joined #nim |
02:07:27 | * | Serenitor quit (Ping timeout: 260 seconds) |
02:10:10 | * | brson quit (Quit: leaving) |
02:10:21 | * | Gonzih joined #nim |
02:16:19 | ldlework | uh oh my concepts example is falling apart now that I'm trying to use those types |
02:16:29 | ftsf | =( |
02:20:52 | * | chatter29 joined #nim |
02:20:56 | chatter29 | hey guys |
02:20:58 | chatter29 | allah is doing |
02:21:03 | chatter29 | sun is not doing allah is doing |
02:21:06 | chatter29 | to accept Islam say that i bear witness that there is no deity worthy of worship except Allah and Muhammad peace be upon him is his slave and messenger |
02:21:26 | * | chatter29 quit (Client Quit) |
02:21:39 | * | chatter29 joined #nim |
02:22:00 | ftsf | aww I was expecting rust evangelism |
02:27:32 | * | chatter29 quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
02:52:09 | * | Jesin quit (Quit: Leaving) |
02:56:34 | * | def-pri-pub joined #nim |
03:28:50 | * | zachcarter joined #nim |
03:29:28 | * | def-pri-pub quit (Quit: leaving) |
03:33:30 | * | Jesin joined #nim |
03:39:45 | * | zachcarter_ joined #nim |
03:40:59 | * | zachcarter quit (Ping timeout: 260 seconds) |
03:41:00 | * | zachcarter_ is now known as zachcarter |
03:45:55 | rauss | Lol |
03:59:27 | FromGitter | <Varriount> ftsf: Ugh, I don't know if I could have resisted arguing, if faced with that particular temptation. |
04:06:12 | FromGitter | <Varriount> zachcarter: How are things going? |
04:06:39 | zachcarter | Varriount: hey bud, pretty good thanks been working on docu this week also been taking a bit of a break due to crap at work |
04:07:07 | zachcarter | Im trying to finish up one of the sample games too |
04:07:51 | FromGitter | <Varriount> zachcarter: If you want inspiration, I suggest something based on https://jayisgames.com/review/spybot-the-nightfall-incident.php |
04:08:31 | zachcarter | Ooo thank you I’ll check this out |
04:12:05 | ftsf | \o/ 1 week left of work before i start full time nim coding :3 |
04:12:16 | FromGitter | <Varriount> O: |
04:12:28 | FromGitter | <Varriount> ftsf: How did you manage that? |
04:12:44 | ftsf | i quit my job =p |
04:12:49 | FromGitter | <Varriount> Oh. |
04:14:11 | demi- | ha |
04:15:09 | ftsf | gonna focus on developing my own projects and hopefully get some stuff out there before i run out of savings :3 |
04:15:15 | zachcarter | living the dream |
04:16:33 | FromGitter | <Varriount> ftsf: If you don't mind me asking, where do you live? |
04:16:41 | ftsf | Sydney, AU |
04:17:13 | FromGitter | <Varriount> Ah. Well, if you ever move to US, plan very carefully where you live. |
04:17:20 | ftsf | hmm no plans to ever move to the US |
04:17:28 | FromGitter | <Varriount> The rent in my area is atrocious |
04:17:28 | ftsf | i visited once |
04:17:34 | ftsf | which area? |
04:17:38 | ftsf | Sydney rent is terrible too |
04:17:42 | FromGitter | <Varriount> Virgnia |
04:18:14 | ftsf | AUD 630/week for a 2 bedroom house here |
04:18:29 | demi- | yeah aus market is v bad |
04:18:42 | FromGitter | <Varriount> Being the state in which DC resides is both a blessing and a curse - plenty of jobs, but very expensive cost of living |
04:18:58 | FromGitter | <Varriount> Although, it's not as bad as San Francisco |
04:19:08 | * | Nobabs27 quit (Quit: Leaving) |
04:19:12 | zachcarter | speaking of plenty of jobs i need to get on that job hunt this weekend |
04:20:25 | ftsf | good luck! |
04:20:29 | ftsf | where are you zachcarter? |
04:20:38 | zachcarter | thanks! |
04:20:44 | zachcarter | like 30 mins from Varriount :P |
04:21:25 | zachcarter | I have a gig currently, just not the biggest fan of it |
04:21:34 | ftsf | *nods* |
04:21:36 | FromGitter | <Varriount> zachcarter: See PM in gitter |
04:21:40 | zachcarter | okay |
04:22:02 | ftsf | my gig was pretty good, but we got bought out and can see things changing a lot. and feels like time i should focus on my own stuff. |
04:24:57 | zachcarter | well I wish you the best of luck ftsf, brave move man |
04:32:48 | * | vlad1777d joined #nim |
04:44:52 | FromGitter | <Varriount> ftsf: Develop a super-popular indie game with Nim and sell it to the masses. You get to make money and support Nim |
04:47:01 | zachcarter | what ^ said |
04:50:01 | * | Serenit0r quit (Quit: Leaving) |
04:51:15 | ftsf | cheers =) |
04:51:19 | ftsf | that's the plan! |
04:52:23 | ftsf | https://twitter.com/hashtag/vektor2089 making this atm pretty niche, but once that's done i'll try something more marketable. |
04:54:37 | FromGitter | <Varriount> ftsf: Is that written in Nim? Very slick! |
04:55:01 | ftsf | yep, 100% nim |
04:55:13 | ftsf | well, except for libSDL which isn't written in nim |
04:56:04 | FromGitter | <Varriount> ftsf: That's fine. |
04:56:54 | * | krux02 quit (Remote host closed the connection) |
05:13:52 | FromGitter | <Varriount> ftsf: Any builds for Mac? |
05:20:00 | ftsf | yes, have a working cross compile toolchain for building for mac from linux |
05:21:43 | FromGitter | <Varriount> ftsf: What horrible contortions did you have to go through to get that working? |
05:22:40 | ftsf | using https://github.com/tpoechtrager/osxcross |
05:23:25 | ftsf | was a bit of a pain to set up, but now it seems to work pretty nicely |
05:28:33 | ftsf | would be good to get a nice docker build image for cross compiling and set up automated builds |
05:30:43 | * | rauss quit (Quit: WeeChat 1.7) |
06:07:18 | * | ftsf quit (Ping timeout: 246 seconds) |
06:13:53 | * | nsf joined #nim |
06:19:22 | * | ftsf joined #nim |
06:43:50 | * | rokups joined #nim |
07:00:30 | * | ftsf quit (Ping timeout: 246 seconds) |
07:13:02 | * | ftsf joined #nim |
07:13:24 | * | yglukhov joined #nim |
07:20:50 | * | Andris_zbx joined #nim |
07:28:46 | * | vivus quit (Quit: Leaving) |
07:37:08 | * | Arrrr joined #nim |
07:54:29 | * | samuell joined #nim |
08:04:54 | Araq | now look at this: https://github.com/nim-lang/Nim |
08:05:13 | Araq | big crown. github update? who enjoys to fix it? |
08:05:30 | FromGitter | <ftsf> needs to be bigger! |
08:12:38 | FromGitter | <andreaferretti> I have an issue with latest updates |
08:12:44 | FromGitter | <andreaferretti> I cannot find what I am doing wrong |
08:13:03 | FromGitter | <andreaferretti> https://github.com/unicredit/nim-teafiles no more compiles |
08:13:28 | FromGitter | <andreaferretti> apparently this line (https://github.com/unicredit/nim-teafiles/blob/master/teafiles.nim#L139) fails with `Error: 'char' cannot be passed to a procvar` |
08:13:45 | FromGitter | <andreaferretti> but I do not see anything that passes a char to anything |
08:14:20 | Araq | I need to add more of your stuff to my testsuite |
08:14:29 | FromGitter | <andreaferretti> :-P |
08:14:38 | Araq | I test your linalg and concepts stuff iirc |
08:14:38 | FromGitter | <andreaferretti> I am trying to keep everything up to date |
08:14:43 | FromGitter | <andreaferretti> thank you |
08:14:50 | Araq | before merging. |
08:14:54 | FromGitter | <andreaferretti> still, I am trying to fix this |
08:15:15 | FromGitter | <andreaferretti> it must be something introduced yersterday |
08:15:27 | Araq | no, this morning. |
08:15:31 | FromGitter | <andreaferretti> ah ok |
08:15:33 | Araq | I merged my .procvar changes |
08:16:03 | Araq | seems also easy to fix but as usual makes me wonder why it wasn't triggered by something else already |
08:16:14 | FromGitter | <andreaferretti> what is this about? maybe it can help to debug this |
08:16:16 | Araq | 'cast' is not exactly under-used in Nim. |
08:16:45 | FromGitter | <dom96> Araq: Big crown? The one in the readme is normal sized for me. |
08:17:51 | FromGitter | <andreaferretti> is it something I need to fix in the library or is it a compiler side issue? |
08:20:03 | Araq | dom96: well for me it's huge |
08:23:35 | FromGitter | <andreaferretti> I also see it correctly |
08:24:15 | FromGitter | <ftsf> huge for me too |
08:24:35 | Araq | refresh browser cache? |
08:24:53 | Araq | andreaferretti a compiler bug |
08:28:18 | cheatfate | I see big crown |
08:28:54 | cheatfate | firefox/chrome on windows10 shows big crown |
08:29:09 | flyx | Safari on iOS and chromium on NixOS do too |
08:30:42 | FromGitter | <Varriount> Android doesn't. |
08:31:02 | FromGitter | <Varriount> Well, Chrome on android |
08:32:36 | euantor | Firefox on windows 10 for me shows the small crown |
08:33:18 | FromGitter | <Varriount> Perhaps Github is doing A/B testing on new servers? |
08:34:31 | FromGitter | <dom96> Araq: now that I think about it... regarding andrea's issue. How often do you write tests for features that you have just implemented? |
08:34:44 | FromGitter | <dom96> It seems that a lost of tests are written as a reaction to bugs |
08:34:56 | FromGitter | <dom96> Maybe that's why our test suite is not catching so many regressions |
08:36:27 | Araq | 99% of the stuff that I do comes with a test. |
08:38:54 | FromGitter | <dom96> Then we all need to think about possible edge cases and write tests for them |
08:39:51 | FromGitter | <dom96> Regarding the huge Nim crown, try going into #github to report it |
08:48:29 | FromGitter | <andreaferretti> I think the best thing would be to set up a jenkins job or similar for each library (on a opt in basis) |
08:48:40 | FromGitter | <andreaferretti> that just does git clone and nimble test |
08:49:06 | FromGitter | <andreaferretti> then one can run a suite of jenkins test before making a big change |
08:50:04 | FromGitter | <andreaferretti> it may be a little primitive than, say, https://github.com/scala/community-builds |
08:50:34 | FromGitter | <andreaferretti> but it could help catch many bugs and notify library mantainers when something needs to be updated |
08:55:17 | * | nhywyll joined #nim |
09:05:42 | Araq | andreaferretti: got a snippet for me that reproduces the problem? |
09:09:01 | Araq | oh never mind, I'm cloning teafiles |
09:09:52 | * | Sembei joined #nim |
09:11:39 | FromGitter | <andreaferretti> I tried to reproduce it in the small, but I was not able |
09:15:49 | * | ftsf quit (Remote host closed the connection) |
09:27:59 | Araq | ok, fixed it |
09:33:36 | FromGitter | <dom96> what was the problem? |
09:34:04 | FromGitter | <dom96> @andreaferretti yeah, we need something that tests packages nightly. |
09:34:17 | * | chemist69_ quit (Ping timeout: 258 seconds) |
09:34:32 | FromGitter | <dom96> well, actually, doesn't federico's project do that? |
09:36:55 | * | chemist69 joined #nim |
10:11:04 | * | libman quit (Quit: Connection closed for inactivity) |
10:17:07 | FromGitter | <andreaferretti> once again |
10:17:13 | FromGitter | <andreaferretti> no, it doesn't |
10:17:23 | FromGitter | <andreaferretti> what is does is `nimble install` |
10:17:40 | FromGitter | <andreaferretti> I have explained here and on the forum why such thing makes no sense at all |
10:18:09 | FromGitter | <andreaferretti> all failures reported by federico's project on my libraries were actually failures of `git clone` |
10:18:28 | FromGitter | <andreaferretti> and that is because `nimble install` on libraries is just `cp` |
10:18:47 | FromGitter | <andreaferretti> there are other issues |
10:19:08 | FromGitter | <andreaferretti> the mantainer has no idea of the failure because there is no contact information |
10:19:36 | FromGitter | <andreaferretti> nobody looks at failures because doing the tests by default on every library includes libraries that are not mantained |
10:19:48 | FromGitter | <andreaferretti> and so many failures are expected |
10:19:56 | FromGitter | <andreaferretti> the only sensible thing to do |
10:20:33 | FromGitter | <andreaferretti> is to allow people to register, provide contact information, and tell what command is actually needed to test the thing |
10:21:40 | FromGitter | <andreaferretti> @araq great, let me know what the fix lands in devel |
10:24:37 | FromGitter | <andreaferretti> @dom96 the easiest way to test packages nightly is to open a jenkins instance (or other CI) - on private request for now, and allow library mantainers to submit jobs for their own libraries |
10:24:48 | FromGitter | <andreaferretti> it is not perfect in terms of security |
10:25:15 | FromGitter | <andreaferretti> but as long as it is only open to people participating in the community actively, I think the gains outweigh the risks |
10:41:35 | Araq | andreaferretti: well I have a custom testing setup testing also our commercial code bases that are not open source. |
10:42:17 | Araq | it's not perfect (nim-teafiles was missing ;-) ) but it's a start and I'm not sure what jenkins would give me |
10:42:31 | Araq | apart from the JVM dependency |
10:43:15 | Araq | also it means I get feedback within minutes rather than hours because my CPU is a crazy bitch |
10:44:14 | cheatfate | Araq, you passing nim tests in minutes? |
10:45:24 | Araq | cheatfate: no, I only test what is not covered by travis/appveyor already |
10:45:32 | cheatfate | ahh ok |
10:45:57 | Araq | never measured 'koch tests', let's see |
10:57:00 | * | BitPuffin|osx joined #nim |
10:59:06 | Araq | sux, should have bought an SSD. |
10:59:20 | Araq | and the tester should run stuff in parallel. oh well. |
11:02:05 | * | Vladar joined #nim |
11:09:42 | cheatfate | so how much time it takes? |
11:15:55 | * | nhywyll quit (Quit: nhywyll) |
11:17:13 | Araq | 27 minutes |
11:17:58 | cheatfate | so looks like your PC is equal to travis/appveyor |
11:20:16 | cheatfate | it takes 19 minutes for travis to run tests |
11:21:45 | Araq | yeah, but my cpu is underused and blocked by the HD |
11:27:55 | * | samuell_ joined #nim |
11:28:14 | FromGitter | <dom96> @andreaferretti i'm happy with whatever works. I agree that what we have isn't perfect, but maybe we could build up on it. |
11:33:36 | * | fastrom1 quit (Quit: Leaving.) |
11:40:09 | * | chemist69 quit (Ping timeout: 246 seconds) |
11:41:10 | * | PMunch joined #nim |
11:43:26 | * | chemist69 joined #nim |
11:47:14 | FromGitter | <andreaferretti> sure, I think we could build upon what is currently there |
11:47:29 | FromGitter | <andreaferretti> I had understood that you had an internal jenkins |
11:47:53 | FromGitter | <andreaferretti> that is why I suggested to just let people create jobs in there for their own libraries |
11:52:04 | * | bjz joined #nim |
11:54:42 | FromGitter | <andreaferretti> most of my libraries work with `nimble test`, but maybe other people have other workflows for testing libraries |
11:55:18 | FromGitter | <andreaferretti> that is why I suggested an opt-in mechanism by which people are asked to explicitly tell how to test them |
11:57:01 | Arrrr | That sounds about right |
12:01:54 | FromGitter | <andreaferretti> @Araq by the way, if you want to test my libraries, this is the full list - they should all work with `nimble test` ⏎ ⏎ https://github.com/andreaferretti/memo ⏎ https://github.com/andreaferretti/patty ⏎ https://github.com/andreaferretti/rosencrantz ... [https://gitter.im/nim-lang/Nim?at=58e4dcb3408f90be668e6bbe] |
12:18:07 | * | couven92 joined #nim |
12:27:39 | Arrrr | min used to work with uint8, what happened? |
12:52:23 | * | couven92 quit (Ping timeout: 260 seconds) |
12:55:33 | * | Arrrr quit (Ping timeout: 264 seconds) |
13:12:52 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
13:14:24 | * | Sembei quit (Ping timeout: 260 seconds) |
13:16:42 | * | suswombat__ quit (Remote host closed the connection) |
13:19:49 | * | wan quit (Quit: WeeChat 1.7) |
13:24:05 | * | SusWombat joined #nim |
13:24:09 | * | SusWombat quit (Client Quit) |
13:24:30 | * | SusWombat joined #nim |
13:32:18 | * | Sembei joined #nim |
13:41:03 | * | smt_ joined #nim |
13:42:56 | * | smt quit (Ping timeout: 240 seconds) |
13:43:42 | FromGitter | <TiberiumPY> hmm, can I use something like a marshal to parse big json-schema file (describing web api)? yes, I know marshal isn't made for this, but still |
13:44:08 | * | smt_ is now known as smt |
13:45:43 | * | Tiberium joined #nim |
13:46:54 | * | chemist69 quit (Ping timeout: 258 seconds) |
13:47:01 | FromGitter | <Varriount> @TiberiumPY Only if marshal produced the file originally |
13:47:43 | FromGitter | <Varriount> Otherwise, use NimYAML |
13:48:18 | FromGitter | <Danielez> @andreaferretti So nim actually has corporate backing lol. https://en.wikipedia.org/wiki/UniCredit |
13:48:27 | FromGitter | <Varriount> (Which I hope grows a strict JSON mode someday) |
13:49:57 | FromGitter | <Varriount> @Danielez I don't see Nim mentioned in that article. |
13:50:04 | FromGitter | <TiberiumPY> But parsing same file at every run isn't the best? |
13:50:40 | FromGitter | <Varriount> @TiberiumPY You want to do it at compile time? |
13:50:40 | FromGitter | <Danielez> I'm kidding andrea linked a unicredit repository on github. |
13:50:57 | FromGitter | <Varriount> Why not use the JSON module then? |
13:51:20 | * | chemist69 joined #nim |
13:51:28 | FromGitter | <Danielez> (that contains nim code) |
13:51:53 | * | flyx is pretty sure that NimYAML doesn't work at compile time |
13:52:10 | flyx | I never tested it though. parsing strings *might* work |
13:52:28 | FromGitter | <TiberiumPY> JSON module supports compile time parsing? |
13:52:57 | FromGitter | <Varriount> Possibly. |
13:53:42 | * | Vladar quit (Remote host closed the connection) |
13:54:00 | FromGitter | <Varriount> Worst case, you can compile and invoke a separate utility to parse a json file and output a Nim file |
13:54:29 | Tiberium | but I'll need to generate Nim code myself then :D |
13:54:33 | Tiberium | without AST |
13:55:14 | FromGitter | <Varriount> Why without AST? We have the macros module. |
13:57:41 | flyx | afaik it is not possible to use the macro module at runtime, because the type NimNode is missing |
13:57:47 | flyx | but I might be wrong |
14:00:52 | FromGitter | <Varriount> Tiberium: I think it would be best to first try using the JSON module during compilation. If that doesn't work, write a utility script. |
14:01:50 | Tiberium | "Error: VM is not allowed to 'cast'" so no, no json at compile-time :( |
14:02:05 | flyx | heh, the same problem will arise with NimYAML |
14:04:25 | FromGitter | <Varriount> I wonder what is being casted |
14:05:37 | FromGitter | <andreaferretti> @Danielez it is where I work |
14:05:45 | FromGitter | <andreaferretti> and I sometimes write Nim libraries |
14:06:00 | FromGitter | <andreaferretti> that is more or less all of the endorsement :-) |
14:06:13 | FromGitter | <Danielez> :D |
14:06:22 | FromGitter | <andreaferretti> another colleague of mine also started using Nim |
14:06:35 | FromGitter | <andreaferretti> but for now only for private use (on his own github) |
14:06:46 | FromGitter | <andreaferretti> https://github.com/evacchi/nimoy/ |
14:06:55 | FromGitter | <Danielez> nimoy lol |
14:07:09 | FromGitter | <andreaferretti> :-) |
14:10:00 | * | devted joined #nim |
14:10:20 | * | Vladar joined #nim |
14:11:56 | * | libman joined #nim |
14:12:30 | FromGitter | <Danielez> "Hey boss don't worry It's just a strange python that run faster we should use it" |
14:13:22 | FromGitter | <Danielez> https://en.wikipedia.org/wiki/Pointy-haired_Boss |
14:23:41 | FromGitter | <dom96> @TiberiumPY Why do you need JSON parsing at compile-time? |
14:26:13 | * | aziz joined #nim |
14:31:23 | * | rauss joined #nim |
14:32:08 | * | BitPuffin joined #nim |
14:32:30 | FromGitter | <Varriount> He's reading in some sort of schema |
14:32:49 | FromGitter | <Varriount> And doesn't want to have to re-parse it each time the program is run. |
14:33:21 | FromGitter | <andreaferretti> also could be useful for something like this http://fsharp.github.io/FSharp.Data/library/JsonProvider.html |
14:37:42 | * | krux02 joined #nim |
14:39:03 | * | krux02 quit (Remote host closed the connection) |
14:39:58 | * | krux02 joined #nim |
14:40:31 | * | vlad1777d quit (Quit: Leaving) |
14:42:09 | * | Vladar quit (Quit: Leaving) |
14:47:18 | * | Vladar joined #nim |
14:52:35 | * | devted quit (Quit: IRC Client has quit.) |
15:03:41 | * | Tiberium quit (Remote host closed the connection) |
15:03:56 | * | Tiberium joined #nim |
15:05:39 | * | rauss quit (Quit: WeeChat 1.7) |
15:06:14 | * | bjz joined #nim |
15:14:28 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
15:15:09 | * | Vladar quit (Remote host closed the connection) |
15:19:07 | * | rauss joined #nim |
15:20:31 | * | bjz joined #nim |
15:24:18 | euantor | Using JSON at compile time might be nice to wrap JSON based web APIs. It would probably be possible to write a macro that takes a lsit of endpoints to hit and generates required procs for each API endpoint with suitable object return types |
15:24:26 | euantor | That would be pretty impressive |
15:25:05 | FromGitter | <andreaferretti> although it may be more useful to do that once and just write the generated types out once and for all |
15:26:39 | FromGitter | <Varriount> It's too bad there's not something like SOAP's WSDL documents for JSON apis |
15:26:58 | euantor | Yeah, it is rather |
15:30:25 | flyx | what about this Swagger/OpenAPI stuff |
15:34:17 | * | Trustable joined #nim |
15:34:36 | demi- | yeah, swagger is supposed to do stuff like that for you |
15:36:27 | PMunch | Ugh |
15:36:51 | PMunch | I once got a hand-written swagger which was full of spelling mistakes and straight up errors.. |
15:36:59 | PMunch | But a good swagger is great :) |
15:37:47 | * | krux02 quit (Remote host closed the connection) |
15:38:15 | * | krux02 joined #nim |
15:41:01 | krux02 | I now restarted my emacs, and all the log is gone |
15:51:32 | * | Andris_zbx quit (Remote host closed the connection) |
15:53:55 | * | mwbrown joined #nim |
15:54:01 | * | chemist69 quit (Ping timeout: 256 seconds) |
15:56:01 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
15:59:40 | * | brson joined #nim |
16:08:34 | * | shashlick quit (Ping timeout: 240 seconds) |
16:10:00 | * | shashlick joined #nim |
16:12:21 | * | arnetheduck quit (Ping timeout: 264 seconds) |
16:30:48 | * | nsf quit (Quit: WeeChat 1.7) |
16:46:04 | * | PMunch quit (Quit: leaving) |
16:50:42 | * | winnebagel left #nim ("ii - 500 SLOC are too much") |
16:53:07 | * | yglukhov quit (Remote host closed the connection) |
16:56:08 | * | Vladar joined #nim |
16:56:49 | * | yglukhov joined #nim |
16:57:35 | * | yglukhov quit (Read error: Connection reset by peer) |
16:57:45 | * | yglukhov joined #nim |
17:02:20 | * | yglukhov quit (Ping timeout: 268 seconds) |
17:04:35 | * | huonw quit (K-Lined) |
17:04:41 | * | couven92 joined #nim |
17:05:20 | * | huonw joined #nim |
17:09:06 | * | couven92 quit (Client Quit) |
17:19:33 | * | vlad1777d joined #nim |
17:20:06 | Tiberium | can I know if it's the last iteration over pairs() of some object? |
17:20:10 | Tiberium | (over JsonNode object) |
17:27:23 | FromGitter | <Varriount> Tiberium: Nope. |
17:27:38 | Tiberium | oh |
17:27:58 | ldlework | lol well you can |
17:28:01 | ldlework | you just have to do it yourself |
17:28:08 | FromGitter | <Varriount> Well, yes |
17:28:35 | ldlework | hi Varriount |
17:28:39 | FromGitter | <Varriount> In general, iteration is like a data stream - you either need a marker to signal the end (or in this case, close to the end) or some other mechanism. |
17:28:46 | ldlework | Do you want to see my friend's Rust take on that problem we worked on the other day? |
17:29:28 | FromGitter | <Varriount> ldlework: Only if I can send you the bill for any high blood-pressure medication I need. |
17:29:48 | ldlework | Varriount they did a pretty good job |
17:30:00 | ldlework | I expected a shit show but they impressed me good |
17:30:25 | FromGitter | <Varriount> ldlework: What was the problem again? |
17:30:52 | ldlework | Its hard to describe, its pretty abstract. |
17:31:00 | ldlework | Its the concept problem we were working on. I think you helped. |
17:31:09 | * | Sembei quit (Ping timeout: 258 seconds) |
17:32:01 | ldlework | Here was my version: https://gist.github.com/dustinlacewell/6b97b658c2db44e1b22fa021873fe133/33cd47934fbf814504d121b509f90d3da542f5f0 |
17:32:12 | ldlework | Here's my friend's version: https://gist.github.com/ajhager/63d7509692e6bcdcea9ca96e18628615 |
17:32:39 | FromGitter | <Varriount> Doesn't look nearly as readable. |
17:33:02 | ldlework | Not even close |
17:33:14 | ldlework | But I expected it to be far far worse |
17:33:22 | ldlework | So when they presented this I went WOW! |
17:33:50 | ldlework | its nearly exactly as long |
17:33:53 | FromGitter | <Varriount> I mean, it has a certain cleanliness, I have to give him that, but to someone used to reading Python, it takes some reading. |
17:34:15 | ldlework | They claim that the approaches are essentially functionaly isomorphic but I'm not 100% sure |
17:34:30 | ldlework | But I'm not a rust expert |
17:34:36 | FromGitter | <Varriount> Isomorphic? |
17:34:49 | ldlework | the same |
17:39:20 | zachcarter | are thread channels bidirectional? |
17:39:53 | FromGitter | <Varriount> zachcarter: No. |
17:40:02 | zachcarter | thx Varriount |
17:40:48 | FromGitter | <Varriount> Or wait, maybe it is. I don't know. |
17:40:57 | FromGitter | <Varriount> The channels module doesn't even have examples. :/ |
17:41:26 | zachcarter | yeah |
17:41:44 | * | yglukhov joined #nim |
17:41:58 | zachcarter | I’m trying to load assets with sdl2 async |
17:42:07 | FromGitter | <Varriount> zachcarter: I would try using it bidirectionally and see what happens. |
17:42:27 | zachcarter | I gave that a shot, but I may very well have done something wrong |
17:42:32 | zachcarter | I’m going to attempt with two channels now |
17:43:34 | zachcarter | two channels seem to work |
17:43:55 | ldlework | I need to learn how to use channels |
17:45:50 | * | vivus joined #nim |
17:46:13 | FromGitter | <Varriount> zachcarter: If you have time, submit an example to the documentation. |
17:46:21 | zachcarter | sure |
17:46:23 | * | yglukhov quit (Ping timeout: 260 seconds) |
17:46:46 | krux02 | what is the latest hash of Nim what all tests pass? |
17:49:19 | Tiberium | 88c4d6aabed415150068b440ce8860644aa56152 |
17:49:21 | Tiberium | latest commit |
17:49:35 | Tiberium | because all checks are passed (it shows on travis) |
17:50:09 | Tiberium | but there's skips |
17:50:50 | zachcarter | Varriount. Idlework: https://gist.github.com/zacharycarter/ba978bfadd6fc9834aa5b6d687cff6eb |
17:50:57 | krux02 | http://ix.io/pIS |
17:51:07 | krux02 | I get a compilation error here on the latest Nim version |
17:51:24 | krux02 | Error: type mismatch: got (ptr TextRenderer) but expected 'ptr None' |
17:53:06 | krux02 | actually the error comis in system.nim in the create proc |
17:53:11 | krux02 | how can that happen? |
17:53:23 | dom96 | ldlework: huh, your code is compile-time whereas the Rust version appears to work at runtime |
17:53:38 | krux02 | I thought it had to do with the fact that I modified the computeSize proc in the compiler, but I undid that |
17:53:58 | zachcarter | krux02 there’s a bug in create / createShared |
17:54:08 | zachcarter | there’s an issue for it already let me find it |
17:54:17 | dom96 | ldlework: So I don't think those are equivalent. Your friend appears to be using the equivalent of object variants. |
17:54:19 | zachcarter | https://github.com/nim-lang/Nim/issues/5648 |
17:54:31 | FromGitter | <Varriount> We have a 'None' type? |
17:54:45 | dom96 | Varriount: Probably only in the compiler. |
17:54:49 | dom96 | To prevent crashes |
17:57:05 | krux02 | the calcSize also has an illegal recursion constant it can return |
17:57:45 | krux02 | meaning just because it is illegal to have recursive types, doesn't mean that people can define them |
17:58:01 | krux02 | and then this needs to be handled somehow |
17:58:08 | krux02 | but anyway |
17:59:43 | krux02 | zachcarter: thanks for the link the workaround works |
17:59:51 | zachcarter | np |
17:59:55 | zachcarter | yeah I’m using it atm as well |
18:00:51 | dom96 | zachcarter: You might have an easier time using `spawn` |
18:01:33 | dom96 | Just return the surface from your spawned procedure |
18:02:06 | zachcarter | hmm okay I’ll play around with that thanks dom96 :) |
18:10:36 | Tiberium | am I missing something? https://gist.github.com/TiberiumN/9bc820dc2fe69b1e25963bc41a0b380f |
18:10:53 | Tiberium | latest nim devel |
18:11:10 | krux02 | hmm I play around with computeSize and now in my own game the C code generator does not generate an & operator thit it previously did |
18:11:21 | krux02 | how is that related? |
18:12:20 | ldlework | dom96: what do you mean the rust works at runtime? |
18:12:52 | dom96 | ldlework: I mean, the resulting executable will check the type of the enum at runtime |
18:13:11 | krux02 | Tiberium: that looks weird |
18:13:34 | dom96 | ldlework: So you'll have an if branch in the resulting executable |
18:13:39 | krux02 | I think it has to do with the fact that split might be it's own iterator |
18:13:45 | ldlework | dom96: well I know that's what you meant, I was really asking what makes you think that? |
18:14:07 | krux02 | so whenever you have a call in a for loop nim looks up if that might be an iterator call |
18:14:28 | ldlework | dom96: is it the `match`? |
18:14:33 | dom96 | ldlework: AFAIK `match` happens at runtime |
18:14:34 | krux02 | and therefore you can get defferent behaviour depending on whether you call it in a for loop out outside of it |
18:14:59 | Tiberium | krux02, hmm, ok |
18:15:06 | krux02 | despite that difference I don't think whoever writs different versions of iterator and procs that they should behave different |
18:15:46 | krux02 | so It is worth a bug report, but before you do it, you should investigate a bit further what exactly causes the difference is the split proc and the split iterator |
18:16:30 | krux02 | the split proc should be identical to toSeq(split(#[ iterator versio ]#)) |
18:16:42 | dom96 | ldlework: isn't that the case? |
18:17:27 | ldlework | dom96: I presented them your theory |
18:18:28 | dom96 | krux02: yeah, your theory is correct. |
18:18:46 | dom96 | The first for loop uses the `pairs` iterator implicitly |
18:19:07 | Tiberium | dom96, ah, thanks for clarification |
18:19:07 | dom96 | The second uses the `split` iterator explicitly (which only yields one value) |
18:19:27 | dom96 | ldlework: cool, let me know what they say |
18:20:58 | ldlework | dom96: all they said is Rock On |
18:21:01 | ldlework | I think they admit defeat |
18:21:10 | ldlework | dom96: we need a strong rust programmer |
18:21:18 | ldlework | concepts are crazy powerful! |
18:21:34 | dom96 | :D |
18:21:38 | ldlework | think about it like this |
18:21:48 | ldlework | nim not only has stronger generics than a language like C# |
18:21:59 | ldlework | making it so that you can express denser isomorphs in the core language |
18:22:13 | ldlework | but also provides the metaprogramming facilities for when you need to go past even that |
18:22:23 | ldlework | I should have presented those two in the opposite order for more dramatic effect |
18:22:26 | ldlework | but you get what I mean |
18:22:37 | dom96 | Yep, Nim is awesome :) |
18:22:43 | dom96 | We just need to advertise it better |
18:22:48 | ldlework | it moves the bar, but also has the best system for serving you after you cross the boundry generic capabilities |
18:22:57 | ldlework | boundry of* |
18:23:42 | ldlework | dom96: Maybe we should start collecting these wierd "well what's the usecase" pl-k-holes I come up with |
18:24:01 | ldlework | they may have no usecase but they do show the power of expression |
18:24:25 | * | sz0 quit (Quit: Connection closed for inactivity) |
18:24:27 | ldlework | though that might not be the best way to advertise I guess haha |
18:24:48 | dom96 | heh, I do want to show a bunch of Nim features on Nim's new website. |
18:25:16 | dom96 | If you or anyone else wants to come up with a short but awesome concepts example I would be very grateful :) |
18:25:19 | Tiberium | can I see how does new nim website looks like? |
18:25:41 | dom96 | You can clone https://github.com/nim-lang/website and run it locally |
18:26:04 | ldlework | I've heard that one before |
18:26:11 | Tiberium | ok I will |
18:26:21 | ldlework | dom96: dockerize it |
18:26:22 | dom96 | Still a bunch of things to do, and I really lack the motivation to work on it :\ |
18:26:34 | ldlework | so all I have to do is docker run dom96/nim-website or whatever |
18:26:36 | dom96 | ldlework: no thanks |
18:26:44 | Tiberium | ah, it's html? static website? even cooler |
18:26:51 | ldlework | oh nice |
18:26:57 | ldlework | I figured it'd be jester |
18:27:04 | Tiberium | I can use python's http server :D |
18:27:06 | ldlework | ya |
18:27:11 | dom96 | it's jekyll |
18:27:17 | Tiberium | python3 -m http.server 8080 |
18:27:20 | dom96 | You can't just do that |
18:27:25 | * | Matthias247 joined #nim |
18:27:31 | dom96 | You need to have Jekyll generate the HTML |
18:27:31 | ldlework | Tiberium: ya you gotta generate it |
18:27:42 | Tiberium | ah |
18:27:43 | Tiberium | :D |
18:27:58 | ldlework | dom96: Doesn't github do that for you? |
18:28:19 | dom96 | dunno, does it? |
18:28:30 | ldlework | pretty sure they've run a jekyll service from the start |
18:28:39 | dom96 | Honestly though, if I truly wanted people to see the website I would host it somewhere. |
18:28:42 | ldlework | https://help.github.com/articles/using-jekyll-as-a-static-site-generator-with-github-pages/ |
18:28:43 | dom96 | It's not ready to be viewed yet |
18:29:23 | ldlework | so technically you could have github host the nim site and just have dns point there |
18:30:15 | vivus | github doesn't have a build process. gitlab does |
18:30:55 | ldlework | vivus: wrong |
18:31:02 | vivus | although if you try hard enough, 1 of those CI-tools could build the site for you |
18:31:17 | ldlework | github does infact have a jekyll build service |
18:31:42 | Tiberium | wow |
18:31:44 | ldlework | you push jekyll source files to github, it will build and host the result |
18:31:56 | ldlework | btw, if you have docker easy way to run a jekyll site: |
18:31:57 | Tiberium | this new website already looks like modern one :) |
18:31:58 | ldlework | sudo docker run -d -v "$PWD:/src" -p 4000:4000 grahamc/jekyll serve -H 0.0.0.0 |
18:32:03 | vivus | I remember someone saying everything concerning nim should be dogfooded (is that even a word?). so using jekyll is ... ? |
18:33:00 | dom96 | Tiberium: glad that the reaction is "wow" :) |
18:33:00 | Tiberium | lol, there's still windows installers on that new nim website :) |
18:33:21 | dom96 | Yeah... I'll need to rewrite something in my book thanks to the removal of these installers... *sigh* |
18:33:22 | Tiberium | dom96, at least it doesn't contain tons of JS |
18:33:55 | krux02 | that's the problem with books about tools, tools change over time |
18:33:57 | ldlework | dom96: doh |
18:34:08 | Tiberium | btw, you can look an nim website by my ip now :) |
18:34:20 | ldlework | hah someone just asked if we could write a nim -> golang compiler |
18:34:21 | vivus | Tiberium: link? |
18:34:38 | Tiberium | wait a sec |
18:34:41 | krux02 | tools, technology all is moving, but the theory guys, they just stay up to date |
18:34:47 | Tiberium | 178.204.228.212 |
18:34:54 | Tiberium | should work |
18:35:08 | dom96 | that's an older version actually |
18:35:26 | Tiberium | but I cloned git repo and made "jekyll build" |
18:35:32 | dom96 | switch to my 'front-page' branch |
18:35:41 | Tiberium | ok :) |
18:36:06 | vivus | git branches = <3 (/s) |
18:37:15 | Tiberium | done it seems http://178.204.228.212/ |
18:37:49 | Tiberium | or you can use this: http://tiberium.hldns.ru |
18:37:51 | ldlework | http://ldlework.com:4000/ |
18:37:59 | ldlework | I had to download the jekyll image so I'm a little late |
18:38:11 | Tiberium | or not, you can't use tiberium.hldns.ru :D |
18:38:52 | Tiberium | ldlework, your didn't change the branch |
18:38:59 | Tiberium | you need "front-page" one :) |
18:39:00 | ldlework | updated |
18:39:13 | Tiberium | nice |
18:39:29 | vivus | Tiberium: where is your site hosted? it loads really slow |
18:39:31 | ldlework | <3 docker |
18:39:35 | Tiberium | vivus, it's on my PC :D |
18:39:44 | vivus | 0.o |
18:39:45 | dom96 | Okay, please don't host it for too long. |
18:39:51 | Tiberium | I live in Russia |
18:39:54 | Tiberium | dom96, ok |
18:40:01 | * | dom96 dislikes having unfinished work visible |
18:40:07 | vivus | <insert putin joke> |
18:41:06 | Tiberium | "There are all sorts of jokes on this matter…as in, no matter how you act on your wedding night, the result should always be the same. Get it?" |
18:41:35 | vivus | I actually don't |
18:41:59 | Tiberium | http://rbth.com/politics_and_society/2016/10/21/the-spy-who-couldnt-surrender-7-of-putins-jokes_640907 4th |
18:43:34 | * | aziz quit (Remote host closed the connection) |
18:45:40 | krux02 | I also don't get it |
18:45:54 | Tiberium | it's out of context |
18:46:10 | ldlework | I wonder if there is any real reason that object variant fields need to be uniquely named |
18:46:19 | ldlework | in nim |
18:47:25 | dom96 | It's the same reason why a procedure cannot have a `string or int` return type |
18:47:56 | ldlework | dom96: it seems like the compiler should be able to 'namespace' the fields given that in any use-context the compiler has discriminated the value to one of the variants |
18:48:08 | dom96 | That said, if the fields with the same name have all the same type then it should be allowed. |
18:48:25 | dom96 | I'm sure both are possible, it's just they are not exactly easy to implement. |
18:48:26 | vivus | this 1 was humorous: A spy goes to Lubyanka (headquarters of the Soviet secret police in Moscow) and says: ... |
18:49:08 | ldlework | dom96: couldn't each name uniquely refer to a field in the cases the compiler know which type is being utilized? |
18:49:32 | dom96 | no idea |
18:49:34 | zachcarter | Nim has a builtin thread pool that can be used for CPU intensive tasks. For IO intensive tasks the async and await features should be used instead. Both parallel and spawn need the threadpool module to work. |
18:49:35 | ldlework | like in a case statement, the compiler should know that `foo` means the second string field on VariantA but `foo` means the third float on VariantB |
18:49:38 | dom96 | If you really want this feature then write an RFC :) |
18:49:46 | zachcarter | dom96: does that mean I should be using async / await for what I was trying to do earlier? |
18:49:49 | zachcarter | and not threads? |
18:50:02 | ldlework | threads are never the answer |
18:50:08 | ldlework | except when they are :( |
18:50:10 | dom96 | zachcarter: probably, but I doubt sdl supports async |
18:50:26 | zachcarter | yeah I figured a worker thread was probably my only answer |
18:50:41 | zachcarter | thank you |
18:50:59 | zachcarter | actually one hacky thing I did try |
18:51:03 | zachcarter | was using asyncfile to load the file |
18:51:12 | zachcarter | and then pass the data in memory to SDL |
18:51:26 | zachcarter | but that didn’t work out either :/ libpng rejected the string representation of the data |
18:52:16 | dom96 | hrm, maybe a bug in asyncfile? |
18:52:23 | dom96 | dunno, but spawn should work |
18:52:34 | zachcarter | yeah I’m looking at spawn now |
18:52:43 | dom96 | and if needs be it can be integrated with async |
18:52:47 | dom96 | Albeit a bit hackishly. |
18:52:56 | ldlework | dom96: seems like in the rust the same name is used |
18:52:59 | ldlework | 'value' |
18:56:03 | dom96 | Yes, I found myself annoyed with this restriction as well. |
18:56:20 | dom96 | Like I said, RFC please. |
19:01:56 | * | yglukhov joined #nim |
19:02:28 | zachcarter | dom96: you’re right, much simpler - https://gist.github.com/zacharycarter/f2032df26536b0d58aff9e7ca7d3cf27 |
19:02:54 | zachcarter | whoops |
19:03:10 | zachcarter | fixed |
19:04:12 | * | rauss quit (Quit: WeeChat 1.7) |
19:05:31 | dom96 | zachcarter: you don't need the channel |
19:05:45 | zachcarter | oh haha |
19:06:26 | zachcarter | even better! |
19:07:30 | * | brson quit (Quit: leaving) |
19:12:11 | * | mwbrown quit (Remote host closed the connection) |
19:14:19 | ldlework | I have been thinking about my port problem. I think I'm getting confused. |
19:16:41 | zachcarter | dom96: if I”m using spawn like : https://gist.github.com/zacharycarter/b7abf5ee5b9ca2054b62760298a0456c |
19:16:51 | zachcarter | how do I check if the spawned threads are finished? |
19:17:02 | zachcarter | does sync automatically complete their work? |
19:17:19 | dom96 | not sure |
19:17:42 | * | yglukhov quit (Remote host closed the connection) |
19:17:42 | dom96 | there is a way to check if a FlowVar has finished though |
19:17:46 | zachcarter | sounds like it - a simple barrier to wait for all spawn'ed tasks. If you need more elaborate waiting, you have to use an explicit barrier. |
19:17:54 | ldlework | that's what it does yeah |
19:18:07 | zachcarter | hmm okay |
19:18:16 | zachcarter | ah isReady |
19:18:17 | * | yglukhov joined #nim |
19:18:52 | zachcarter | thx |
19:20:08 | ldlework | dom96: My basic idea is to have a Inlet/Outlet objects that can hold any kind of internal value. Given that requirement is it flawed thinking that I will ever have an array that can hold Inlets or Outlets as if they were homogenous given that internally they hold arbitrary types? |
19:21:14 | * | yglukhov quit (Remote host closed the connection) |
19:21:53 | dom96 | You would need to create an object variant for that |
19:22:03 | dom96 | or use inheritance |
19:22:12 | * | rauss joined #nim |
19:22:16 | * | rokups quit (Quit: Connection closed for inactivity) |
19:22:22 | dom96 | That makes me wonder whether we will be able to specify a concept as an array/seq type in the future though. |
19:22:39 | dom96 | zahary: ^ ? |
19:23:49 | ldlework | dom96: but like, how could I create a singular interface for the Inlets/Outlets if each of their values are on a different field? |
19:23:58 | ldlework | It kind a blows away the utility... |
19:24:09 | ldlework | each client to that varying type needsd to be riddled with case statements |
19:24:51 | dom96 | yeah, it sorta sucks. |
19:24:56 | dom96 | Not sure. |
19:27:03 | * | yglukhov joined #nim |
19:27:10 | ldlework | I also recently realized that you can't define types who's fields are typed as a concept |
19:27:15 | ldlework | Of course you can't. hehe |
19:27:27 | ldlework | makes no sense but took me a while to realize why |
19:27:35 | krux02 | working on computeSize a bug in times.nim got aparent that I wonder could ever work |
19:27:46 | krux02 | I have no idea how that could ever relate |
19:28:44 | ldlework | the problem of a typed port/plug model is an interesting one |
19:28:56 | ldlework | I think I might be getting weary of it though |
19:29:31 | * | brson joined #nim |
19:31:40 | dom96 | Argh, the JS code gen fails on the code in marshal because it does a lot of pointer casts/derefs. |
19:32:08 | dom96 | and I have no idea what the compiler should be doing in that situation :\ |
19:47:26 | * | Sembei joined #nim |
19:49:21 | Tiberium | "Connection was closed before full request has been made" hmm, this is why I'm getting 100% cpu |
19:50:40 | Tiberium | maybe I can add 100ms sleep in except |
19:52:40 | Tiberium | does nim's httpclient handle long http requests without any issues? |
19:53:54 | * | yglukhov quit (Remote host closed the connection) |
19:54:17 | * | yglukhov joined #nim |
19:57:22 | krux02 | I am a but puzzled with the skipTypes proc in the compiler |
19:57:40 | krux02 | what is its result value supposed to mean? |
20:00:45 | ldlework | I forget does nim have proc overloading? |
20:01:10 | ldlework | yeha it does ok |
20:02:59 | krux02 | Araq: this seems very cryptic to me: while result.kind in kinds: result = lastSon(result) |
20:03:13 | * | nsf joined #nim |
20:05:47 | krux02 | ah ok I think I get it. it unpacks all non-interesting wrappers around a type |
20:06:06 | ldlework | Inlet[T] = ref object of RootObj |
20:06:08 | ldlework | name: string |
20:06:10 | ldlework | module: Module |
20:06:12 | ldlework | value: T |
20:06:14 | ldlework | sorry :( |
20:06:21 | ldlework | I meant to paste link |
20:06:28 | ldlework | but it says "cannot instantiate: Inlet" |
20:06:30 | ldlework | why? |
20:06:45 | krux02 | I don't know |
20:06:59 | krux02 | is Module knowen |
20:07:22 | dom96 | how are you constructing the type? |
20:07:39 | krux02 | do you have a type parameter for Inlet, or are you just declaring: var myvar: Inlet |
20:09:09 | ldlework | dom96: oh the error pointed to the declaration |
20:09:19 | dom96 | indeed |
20:09:21 | dom96 | :) |
20:09:35 | ldlework | (so I thought the problem was with the declaration) |
20:09:54 | ldlework | I don't think I'm smart enough to solve this design problem |
20:18:58 | * | Tiberium quit (Remote host closed the connection) |
20:19:38 | * | yglukhov quit (Remote host closed the connection) |
20:31:46 | dom96 | Araq: How do I handle this in the jsgen? result = cast[ptr bool](x.value)[] |
20:31:53 | dom96 | https://gist.github.com/dom96/63557b5e5a2357c46c1a4d845bc4af5c |
20:32:11 | dom96 | I printed the 'a' and 'n'. |
20:33:21 | Araq | where is this line from? streams? |
20:33:29 | dom96 | typeinfo |
20:33:33 | Araq | there just is no way to write it this way for JS |
20:33:36 | dom96 | line 513 |
20:36:21 | dom96 | what is the state of support for 'ptr', 'pointer' etc. in the JS backend |
20:38:23 | Araq | it's JS |
20:38:31 | Araq | it doesn't have pointers. |
20:38:48 | Araq | proc foo(x: pointer) is mapped to function foo(x) |
20:38:52 | dom96 | I thought they were maybe being emulated somehow. |
20:39:12 | Araq | ptr T is mapped to an array of size 1 of T |
20:39:38 | Araq | but you think you can cast pointer to ptr T and deref and shit. |
20:39:58 | Araq | that's not how it works. you think on the completely wrong level about this thing |
20:40:50 | dom96 | I don't think that |
20:41:03 | dom96 | I was just guessing |
20:41:22 | ldlework | jeeze dom96 get with it |
20:41:46 | * | BitPuffin quit (Read error: Connection reset by peer) |
20:41:54 | Araq | result = cast[ptr bool](x.value)[] # result = x.value[0] != 0 |
20:42:07 | dom96 | so I should modify marshal instead? |
20:42:14 | Araq | yep. |
20:42:26 | Araq | the higher levels are easier to map to Js. |
20:42:46 | dom96 | Okay, but the fact that the compiler throws an internal error with that code is still an error. |
20:43:06 | dom96 | *a bug |
20:43:26 | ldlework | yeah Araq get with it |
20:46:20 | dom96 | Low priority so i'll just create an issue for it. |
20:47:33 | dom96 | Araq: Did you mean that "result = x.value[0] != 0" will work for the JS backend? because it doesn't |
20:47:39 | dom96 | There is no `[]` for `pointer` |
20:49:16 | demi- | i'm making another nim wrapper for a c library; and creating first class iterators from the collection boiler-plate is so awesome |
20:51:07 | ldlework | which lib |
20:51:36 | demi- | notmuch (mail client) |
20:52:27 | ldlework | sounds cool! is your thing on github? |
20:52:38 | dom96 | oh, I guess once again I should just emit this. |
20:53:12 | * | zaquest quit (Ping timeout: 256 seconds) |
20:53:52 | Araq | dom96: I mean that a stream is an array of bytes for JS |
20:53:55 | demi- | it is, but i am still refining it; will submit to nimble once i'm done |
20:54:11 | Araq | and you need to interpret the bytes appropriately and then it might work out |
20:54:24 | Araq | so pointer == array of byte |
20:54:44 | Araq | p[] == a[i] |
20:54:45 | ldlework | demi-: I'd just like to take a look to see more examples of wrappers that's all |
20:55:37 | demi- | sure, one sec and i can push my latest changes |
20:55:41 | dom96 | Araq: right... |
20:56:40 | dom96 | Araq: I don't see how streams are relevant in typeinfo |
20:56:58 | * | Vladar quit (Quit: Leaving) |
20:58:04 | demi- | ldlework: https://github.com/samdmarshall/notmuch.nim/blob/master/src/notmuch.nim |
20:58:55 | demi- | ldlework: for the initial pass i use `c2nim` to convert the header then went through and cleaned it up to be a bit nicer |
21:00:43 | * | zaquest joined #nim |
21:00:54 | dom96 | Araq: Assigning a pointer to another pointer also fails, should it work? |
21:02:09 | Araq | dunno |
21:07:44 | * | Sembei quit (Quit: WeeChat 1.5-dev) |
21:09:47 | zachcarter | hrm this is what I’ve come up with : https://gist.github.com/zacharycarter/c19ac66511580ee3040e57b7459dd626 |
21:09:54 | zachcarter | half the time it freezes |
21:09:57 | zachcarter | half the time it works :D |
21:10:16 | ldlework | zachcarter: off to the races |
21:10:22 | zachcarter | oh yeah |
21:11:14 | FromGitter | <Varriount> zachcarter: I've sent you some information in Gitter |
21:11:25 | zachcarter | thank you Varriount I will check it out |
21:24:38 | dom96 | Araq: I feel like this essentially boils down to `cast[T](x)` -> {.emit: "x".}. i.e. casting should just work in the JS backend. |
21:25:38 | Araq | 'cast[T](x)' is mapped to 'x' in the JS backend already |
21:26:35 | dom96 | And what is x[] mapped to? `x[0]` right? |
21:26:51 | dom96 | so shouldn't `cast[T](x)[]` -> `x[0]`? |
21:27:17 | * | Sembei joined #nim |
21:28:11 | * | fastrom joined #nim |
21:28:59 | Araq | maybe |
21:29:01 | FromGitter | <gokr> @rosshadden Ehm, dunno :) |
21:29:49 | dom96 | Araq: easy to implement? |
21:30:02 | * | samuell_ quit (Ping timeout: 256 seconds) |
21:30:20 | * | samuell quit (Ping timeout: 264 seconds) |
21:30:39 | Araq | I doubt it. the easy things have all been done. |
21:30:58 | Araq | the hard parts remain. |
21:31:36 | * | bjz joined #nim |
21:36:28 | * | Trustable quit (Remote host closed the connection) |
21:40:04 | dom96 | https://github.com/nim-lang/Nim/issues/5667 |
21:40:16 | ldlework | is there a way to change this to a case statement? https://gist.github.com/dustinlacewell/345bc4d37be762118123aea6f029ad96 |
21:43:23 | ldlework | pls |
21:43:35 | ldlework | oh it can't be |
21:44:09 | krux02 | ldlework: no it can'b be a case statement, but you can use elif |
21:44:55 | dom96 | Araq: Surely mapping it can't be that hard :\ |
21:45:06 | krux02 | it doesn't do anthing in the generated source, but it alse tells semantically that there can only be one branch active |
21:45:17 | dom96 | I'm trying to just do it in typeinfo but the amount of changes is just too much |
21:45:52 | dom96 | I created a universalCast proc that either emits on JS or casts and have to replace each `cast` with that... |
21:50:13 | Araq | cast[ptr uint16](x)[] --> x[i] or x[i+1] shl 8 |
21:51:56 | * | BitPuffin|osx quit (Ping timeout: 240 seconds) |
21:52:03 | dom96 | Araq: `i`? |
21:52:30 | Araq | i==0 |
21:52:53 | dom96 | i see |
21:53:12 | dom96 | That makes things more complex :\ |
21:54:48 | * | rauss quit (Quit: WeeChat 1.7) |
21:59:34 | dom96 | is it possible nowadays to use metaprogramming to achieve the same thing as marshal? |
22:00:18 | Araq | yes |
22:00:37 | Araq | via macros.getType |
22:00:50 | dom96 | awesome |
22:01:18 | ldlework | this is passing: https://gist.github.com/dustinlacewell/7b3c609b22f4f157a3304027f9555b93 :D |
22:02:21 | dom96 | ldlework: yay, you accidentally a letter there though :) |
22:03:08 | ldlework | lol |
22:03:32 | ldlework | dom96: as expected though, case/when statements everywhere |
22:10:45 | Araq | it's not the 90ies anymore. exhaustive cases rule for correctness and virtual function calls lost. ;-) |
22:11:10 | dom96 | I think I will create a nice JSON macro marshal-type thing. |
22:11:15 | dom96 | But tomorrow |
22:17:06 | FromGitter | <hcorion> Hey, so what character should I use instead of \n ? |
22:17:26 | FromGitter | <hcorion> when detecting if a character is a new line |
22:18:18 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:18:51 | dom96 | hcorion: a new line is OS-dependent, which one do you want to detect? |
22:19:44 | dom96 | If either, then use `if character in NewLines:` (NewLines defined in strutils) |
22:20:56 | FromGitter | <hcorion> Okay, strutils might be too heavy a dependency for me, I'll have to see |
22:23:23 | zachcarter | dom96: any idea why this code fails to complete - https://gist.github.com/zacharycarter/c19ac66511580ee3040e57b7459dd626 ? |
22:23:41 | zachcarter | sometimes it does exit with a succesful exit code |
22:23:43 | zachcarter | othertimes it just hangs |
22:23:55 | ldlework | how do I create an instance of a basic non-ref 'object' type? |
22:24:13 | ldlework | like I defined a type Foo = object |
22:24:15 | FromGitter | <hcorion> Yeah, it's too heavy, but I'll just copy it over, thanks |
22:24:16 | ldlework | how do I create one? |
22:24:29 | zachcarter | var f = Foo() |
22:24:32 | zachcarter | I think? |
22:24:51 | ldlework | Error: attempting to call undeclared routine: 'Parameter' |
22:25:39 | zachcarter | https://glot.io/snippets/eoo206ynav |
22:27:15 | ldlework | https://glot.io/snippets/eoo21sdhjc |
22:28:14 | zachcarter | https://glot.io/snippets/eoo22rrgim |
22:28:39 | ldlework | I see |
22:28:45 | ldlework | thank you |
22:28:48 | FromGitter | <stisa> https://nim-lang.org/docs/manual.html#types-object-construction |
22:28:48 | zachcarter | sure thing |
22:29:29 | ldlework | too bad it can't infer the generic type |
22:29:31 | ldlework | :( |
22:29:40 | dom96 | hcorion: too heavy? whaaat? |
22:29:51 | zachcarter | haha yeah that confused me too it’s part of the stdlib |
22:29:53 | FromGitter | <hcorion> Game Boy Advanced baby |
22:30:16 | * | bjz joined #nim |
22:30:34 | * | Sembei quit (Ping timeout: 240 seconds) |
22:30:46 | FromGitter | <hcorion> Can't handle none of that fancy schmancy GC or seq |
22:31:17 | FromGitter | <hcorion> and I'm too lazy to bother fixing them to make it work |
22:31:25 | ldlework | hcorion you're using nim without the gc? |
22:32:14 | FromGitter | <hcorion> Yep, As far as I understand it, as long as I don't use ref objects, it should work fine |
22:33:05 | ldlework | fascinating |
22:33:19 | ldlework | hcorion, are you building a new stdlib |
22:34:17 | FromGitter | <hcorion> Yes and no, I just don't import anything, so I don't really need to build anything. |
22:35:45 | dom96 | hcorion: even if you import strutils, the nim compiler is intelligent enough to only import what you use from it. |
22:36:25 | dom96 | zachcarter: no idea I'm afraid |
22:36:34 | zachcarter | I think I figured it out |
22:36:37 | zachcarter | bad looping |
22:36:57 | FromGitter | <hcorion> Yeah, but it throws an error, ⏎ lib/pure/strutils.nim(1177, 14) Error: type mismatch: got (string, Slice[system.int]) |
22:38:30 | FromGitter | <hcorion> It's probably got something to do with using setting OS as standalone |
22:41:08 | dom96 | yes, well, string itself is GC'd |
22:41:15 | dom96 | slicing it creates a copy |
22:45:40 | * | vlad1777d quit (Remote host closed the connection) |
22:47:09 | * | Senketsu_ quit (Quit: Leaving) |
22:50:20 | ldlework | haha I got the compiler to segfault |
22:50:22 | ldlework | ø/ |
22:51:44 | ldlework | https://glot.io/snippets/eoo2q1ygd6 |
22:55:11 | ldlework | what did I do wrong? |
22:57:30 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
22:57:39 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:58:08 | * | nightmared quit (Ping timeout: 258 seconds) |
23:00:20 | * | nsf quit (Quit: WeeChat 1.7) |
23:00:46 | ldlework | seems having either of these two functions in the code causes the segfault |
23:00:48 | ldlework | proc newParameter[T: PortType](name: string, value: T): Parameter[T] = |
23:00:50 | ldlework | result = Parameter(name:name, value:value) |
23:00:52 | ldlework | proc newParameter[T: NumericPort](name: string, value, min, max: T): Parameter[T] = |
23:00:54 | ldlework | result = Parameter(name:name, value:value, minVal:min, maxVal:max) |
23:03:32 | * | nightmared joined #nim |
23:05:22 | ldlework | if I remove the concept restrictions it compiles |
23:05:39 | ldlework | dom96: Araq should I open a bug with this snippet? |
23:08:02 | dom96 | of corse |
23:08:09 | dom96 | *course |
23:08:27 | dom96 | btw why are you guys using glot.io so much? |
23:08:39 | * | rauss joined #nim |
23:09:10 | dom96 | the tiny 10 line code window is incredibly annoying |
23:09:51 | dom96 | anyway, 'night |
23:15:19 | ldlework | dom96: haha I agree |
23:22:01 | * | arnetheduck joined #nim |
23:24:20 | * | brson quit (Quit: leaving) |
23:24:35 | * | brson joined #nim |
23:40:32 | ldlework | anyway to create a variant that doesn't provide a field? |
23:51:18 | * | nightmared quit (Ping timeout: 246 seconds) |
23:54:05 | FromGitter | <Varriount> dom96: It lets you run Nim code online |
23:56:12 | * | SusWombat_ joined #nim |
23:56:52 | ldlework | Varriount, whens the last time you segfaulted the compiler |
23:58:42 | * | SusWombat quit (Ping timeout: 258 seconds) |
23:59:37 | * | nightmared joined #nim |