<< 05-04-2017 >>

00:21:04*BitPuffin|osx quit (Ping timeout: 240 seconds)
00:39:27*Nobabs27 quit (Quit: Leaving)
00:40:59krux02why is getSize from tuple and object so different?
00:41:49krux02Araq: why is getSize from tuple and object so different?
00:45:05*Nobabs27 joined #nim
01:06:09krux02no answer needed, staring at code long enoguh solves any problem
01:07:22FromGitter<Varriount> krux02: So? Why *are* they different?
01:07:32FromGitter<Varriount> Don't leave us in suspense!
01:07:45krux02object is much more complex than tuple
01:07:56krux02object has a lot of different cases
01:08:18krux02for example it has a hidden type field for objects inheriting RootObj
01:08:50krux02it has interesting type layout of case of objects (tagged unions)
01:09:44FromGitter<Varriount> I'd always imagined the case-objects were composed of unions
01:10:01krux02well they are
01:11:31ldleworkdom96: he came up with a nice implementation!
01:12:13krux02ldlework: ???
01:14:00krux02is that an old conversation?
01:14:40ldleworkkrux02: yeah I think he knows what I mean
01:15:04krux02ok, because I have no idea what you are talking about, but that is ok it was not addressed at me
01:17:12FromGitter<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:19ldleworkuh oh my concepts example is falling apart now that I'm trying to use those types
02:16:29ftsf=(
02:20:52*chatter29 joined #nim
02:20:56chatter29hey guys
02:20:58chatter29allah is doing
02:21:03chatter29sun is not doing allah is doing
02:21:06chatter29to 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:00ftsfaww 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:55raussLol
03:59:27FromGitter<Varriount> ftsf: Ugh, I don't know if I could have resisted arguing, if faced with that particular temptation.
04:06:12FromGitter<Varriount> zachcarter: How are things going?
04:06:39zachcarterVarriount: 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:07zachcarterIm trying to finish up one of the sample games too
04:07:51FromGitter<Varriount> zachcarter: If you want inspiration, I suggest something based on https://jayisgames.com/review/spybot-the-nightfall-incident.php
04:08:31zachcarterOoo thank you I’ll check this out
04:12:05ftsf\o/ 1 week left of work before i start full time nim coding :3
04:12:16FromGitter<Varriount> O:
04:12:28FromGitter<Varriount> ftsf: How did you manage that?
04:12:44ftsfi quit my job =p
04:12:49FromGitter<Varriount> Oh.
04:14:11demi-ha
04:15:09ftsfgonna focus on developing my own projects and hopefully get some stuff out there before i run out of savings :3
04:15:15zachcarterliving the dream
04:16:33FromGitter<Varriount> ftsf: If you don't mind me asking, where do you live?
04:16:41ftsfSydney, AU
04:17:13FromGitter<Varriount> Ah. Well, if you ever move to US, plan very carefully where you live.
04:17:20ftsfhmm no plans to ever move to the US
04:17:28FromGitter<Varriount> The rent in my area is atrocious
04:17:28ftsfi visited once
04:17:34ftsfwhich area?
04:17:38ftsfSydney rent is terrible too
04:17:42FromGitter<Varriount> Virgnia
04:18:14ftsfAUD 630/week for a 2 bedroom house here
04:18:29demi-yeah aus market is v bad
04:18:42FromGitter<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:58FromGitter<Varriount> Although, it's not as bad as San Francisco
04:19:08*Nobabs27 quit (Quit: Leaving)
04:19:12zachcarterspeaking of plenty of jobs i need to get on that job hunt this weekend
04:20:25ftsfgood luck!
04:20:29ftsfwhere are you zachcarter?
04:20:38zachcarterthanks!
04:20:44zachcarterlike 30 mins from Varriount :P
04:21:25zachcarterI have a gig currently, just not the biggest fan of it
04:21:34ftsf*nods*
04:21:36FromGitter<Varriount> zachcarter: See PM in gitter
04:21:40zachcarterokay
04:22:02ftsfmy 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:57zachcarterwell I wish you the best of luck ftsf, brave move man
04:32:48*vlad1777d joined #nim
04:44:52FromGitter<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:01zachcarterwhat ^ said
04:50:01*Serenit0r quit (Quit: Leaving)
04:51:15ftsfcheers =)
04:51:19ftsfthat's the plan!
04:52:23ftsfhttps://twitter.com/hashtag/vektor2089 making this atm pretty niche, but once that's done i'll try something more marketable.
04:54:37FromGitter<Varriount> ftsf: Is that written in Nim? Very slick!
04:55:01ftsfyep, 100% nim
04:55:13ftsfwell, except for libSDL which isn't written in nim
04:56:04FromGitter<Varriount> ftsf: That's fine.
04:56:54*krux02 quit (Remote host closed the connection)
05:13:52FromGitter<Varriount> ftsf: Any builds for Mac?
05:20:00ftsfyes, have a working cross compile toolchain for building for mac from linux
05:21:43FromGitter<Varriount> ftsf: What horrible contortions did you have to go through to get that working?
05:22:40ftsfusing https://github.com/tpoechtrager/osxcross
05:23:25ftsfwas a bit of a pain to set up, but now it seems to work pretty nicely
05:28:33ftsfwould 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:54Araqnow look at this: https://github.com/nim-lang/Nim
08:05:13Araqbig crown. github update? who enjoys to fix it?
08:05:30FromGitter<ftsf> needs to be bigger!
08:12:38FromGitter<andreaferretti> I have an issue with latest updates
08:12:44FromGitter<andreaferretti> I cannot find what I am doing wrong
08:13:03FromGitter<andreaferretti> https://github.com/unicredit/nim-teafiles no more compiles
08:13:28FromGitter<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:45FromGitter<andreaferretti> but I do not see anything that passes a char to anything
08:14:20AraqI need to add more of your stuff to my testsuite
08:14:29FromGitter<andreaferretti> :-P
08:14:38AraqI test your linalg and concepts stuff iirc
08:14:38FromGitter<andreaferretti> I am trying to keep everything up to date
08:14:43FromGitter<andreaferretti> thank you
08:14:50Araqbefore merging.
08:14:54FromGitter<andreaferretti> still, I am trying to fix this
08:15:15FromGitter<andreaferretti> it must be something introduced yersterday
08:15:27Araqno, this morning.
08:15:31FromGitter<andreaferretti> ah ok
08:15:33AraqI merged my .procvar changes
08:16:03Araqseems also easy to fix but as usual makes me wonder why it wasn't triggered by something else already
08:16:14FromGitter<andreaferretti> what is this about? maybe it can help to debug this
08:16:16Araq'cast' is not exactly under-used in Nim.
08:16:45FromGitter<dom96> Araq: Big crown? The one in the readme is normal sized for me.
08:17:51FromGitter<andreaferretti> is it something I need to fix in the library or is it a compiler side issue?
08:20:03Araqdom96: well for me it's huge
08:23:35FromGitter<andreaferretti> I also see it correctly
08:24:15FromGitter<ftsf> huge for me too
08:24:35Araqrefresh browser cache?
08:24:53Araqandreaferretti a compiler bug
08:28:18cheatfateI see big crown
08:28:54cheatfatefirefox/chrome on windows10 shows big crown
08:29:09flyxSafari on iOS and chromium on NixOS do too
08:30:42FromGitter<Varriount> Android doesn't.
08:31:02FromGitter<Varriount> Well, Chrome on android
08:32:36euantorFirefox on windows 10 for me shows the small crown
08:33:18FromGitter<Varriount> Perhaps Github is doing A/B testing on new servers?
08:34:31FromGitter<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:44FromGitter<dom96> It seems that a lost of tests are written as a reaction to bugs
08:34:56FromGitter<dom96> Maybe that's why our test suite is not catching so many regressions
08:36:27Araq99% of the stuff that I do comes with a test.
08:38:54FromGitter<dom96> Then we all need to think about possible edge cases and write tests for them
08:39:51FromGitter<dom96> Regarding the huge Nim crown, try going into #github to report it
08:48:29FromGitter<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:40FromGitter<andreaferretti> that just does git clone and nimble test
08:49:06FromGitter<andreaferretti> then one can run a suite of jenkins test before making a big change
08:50:04FromGitter<andreaferretti> it may be a little primitive than, say, https://github.com/scala/community-builds
08:50:34FromGitter<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:42Araqandreaferretti: got a snippet for me that reproduces the problem?
09:09:01Araqoh never mind, I'm cloning teafiles
09:09:52*Sembei joined #nim
09:11:39FromGitter<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:59Araqok, fixed it
09:33:36FromGitter<dom96> what was the problem?
09:34:04FromGitter<dom96> @andreaferretti yeah, we need something that tests packages nightly.
09:34:17*chemist69_ quit (Ping timeout: 258 seconds)
09:34:32FromGitter<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:07FromGitter<andreaferretti> once again
10:17:13FromGitter<andreaferretti> no, it doesn't
10:17:23FromGitter<andreaferretti> what is does is `nimble install`
10:17:40FromGitter<andreaferretti> I have explained here and on the forum why such thing makes no sense at all
10:18:09FromGitter<andreaferretti> all failures reported by federico's project on my libraries were actually failures of `git clone`
10:18:28FromGitter<andreaferretti> and that is because `nimble install` on libraries is just `cp`
10:18:47FromGitter<andreaferretti> there are other issues
10:19:08FromGitter<andreaferretti> the mantainer has no idea of the failure because there is no contact information
10:19:36FromGitter<andreaferretti> nobody looks at failures because doing the tests by default on every library includes libraries that are not mantained
10:19:48FromGitter<andreaferretti> and so many failures are expected
10:19:56FromGitter<andreaferretti> the only sensible thing to do
10:20:33FromGitter<andreaferretti> is to allow people to register, provide contact information, and tell what command is actually needed to test the thing
10:21:40FromGitter<andreaferretti> @araq great, let me know what the fix lands in devel
10:24:37FromGitter<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:48FromGitter<andreaferretti> it is not perfect in terms of security
10:25:15FromGitter<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:35Araqandreaferretti: well I have a custom testing setup testing also our commercial code bases that are not open source.
10:42:17Araqit's not perfect (nim-teafiles was missing ;-) ) but it's a start and I'm not sure what jenkins would give me
10:42:31Araqapart from the JVM dependency
10:43:15Araqalso it means I get feedback within minutes rather than hours because my CPU is a crazy bitch
10:44:14cheatfateAraq, you passing nim tests in minutes?
10:45:24Araqcheatfate: no, I only test what is not covered by travis/appveyor already
10:45:32cheatfateahh ok
10:45:57Araqnever measured 'koch tests', let's see
10:57:00*BitPuffin|osx joined #nim
10:59:06Araqsux, should have bought an SSD.
10:59:20Araqand the tester should run stuff in parallel. oh well.
11:02:05*Vladar joined #nim
11:09:42cheatfateso how much time it takes?
11:15:55*nhywyll quit (Quit: nhywyll)
11:17:13Araq27 minutes
11:17:58cheatfateso looks like your PC is equal to travis/appveyor
11:20:16cheatfateit takes 19 minutes for travis to run tests
11:21:45Araqyeah, but my cpu is underused and blocked by the HD
11:27:55*samuell_ joined #nim
11:28:14FromGitter<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:14FromGitter<andreaferretti> sure, I think we could build upon what is currently there
11:47:29FromGitter<andreaferretti> I had understood that you had an internal jenkins
11:47:53FromGitter<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:42FromGitter<andreaferretti> most of my libraries work with `nimble test`, but maybe other people have other workflows for testing libraries
11:55:18FromGitter<andreaferretti> that is why I suggested an opt-in mechanism by which people are asked to explicitly tell how to test them
11:57:01ArrrrThat sounds about right
12:01:54FromGitter<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/memohttps://github.com/andreaferretti/pattyhttps://github.com/andreaferretti/rosencrantz ... [https://gitter.im/nim-lang/Nim?at=58e4dcb3408f90be668e6bbe]
12:18:07*couven92 joined #nim
12:27:39Arrrrmin 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:42FromGitter<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:01FromGitter<Varriount> @TiberiumPY Only if marshal produced the file originally
13:47:43FromGitter<Varriount> Otherwise, use NimYAML
13:48:18FromGitter<Danielez> @andreaferretti So nim actually has corporate backing lol. https://en.wikipedia.org/wiki/UniCredit
13:48:27FromGitter<Varriount> (Which I hope grows a strict JSON mode someday)
13:49:57FromGitter<Varriount> @Danielez I don't see Nim mentioned in that article.
13:50:04FromGitter<TiberiumPY> But parsing same file at every run isn't the best?
13:50:40FromGitter<Varriount> @TiberiumPY You want to do it at compile time?
13:50:40FromGitter<Danielez> I'm kidding andrea linked a unicredit repository on github.
13:50:57FromGitter<Varriount> Why not use the JSON module then?
13:51:20*chemist69 joined #nim
13:51:28FromGitter<Danielez> (that contains nim code)
13:51:53*flyx is pretty sure that NimYAML doesn't work at compile time
13:52:10flyxI never tested it though. parsing strings *might* work
13:52:28FromGitter<TiberiumPY> JSON module supports compile time parsing?
13:52:57FromGitter<Varriount> Possibly.
13:53:42*Vladar quit (Remote host closed the connection)
13:54:00FromGitter<Varriount> Worst case, you can compile and invoke a separate utility to parse a json file and output a Nim file
13:54:29Tiberiumbut I'll need to generate Nim code myself then :D
13:54:33Tiberiumwithout AST
13:55:14FromGitter<Varriount> Why without AST? We have the macros module.
13:57:41flyxafaik it is not possible to use the macro module at runtime, because the type NimNode is missing
13:57:47flyxbut I might be wrong
14:00:52FromGitter<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:50Tiberium"Error: VM is not allowed to 'cast'" so no, no json at compile-time :(
14:02:05flyxheh, the same problem will arise with NimYAML
14:04:25FromGitter<Varriount> I wonder what is being casted
14:05:37FromGitter<andreaferretti> @Danielez it is where I work
14:05:45FromGitter<andreaferretti> and I sometimes write Nim libraries
14:06:00FromGitter<andreaferretti> that is more or less all of the endorsement :-)
14:06:13FromGitter<Danielez> :D
14:06:22FromGitter<andreaferretti> another colleague of mine also started using Nim
14:06:35FromGitter<andreaferretti> but for now only for private use (on his own github)
14:06:46FromGitter<andreaferretti> https://github.com/evacchi/nimoy/
14:06:55FromGitter<Danielez> nimoy lol
14:07:09FromGitter<andreaferretti> :-)
14:10:00*devted joined #nim
14:10:20*Vladar joined #nim
14:11:56*libman joined #nim
14:12:30FromGitter<Danielez> "Hey boss don't worry It's just a strange python that run faster we should use it"
14:13:22FromGitter<Danielez> https://en.wikipedia.org/wiki/Pointy-haired_Boss
14:23:41FromGitter<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:30FromGitter<Varriount> He's reading in some sort of schema
14:32:49FromGitter<Varriount> And doesn't want to have to re-parse it each time the program is run.
14:33:21FromGitter<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:18euantorUsing 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:26euantorThat would be pretty impressive
15:25:05FromGitter<andreaferretti> although it may be more useful to do that once and just write the generated types out once and for all
15:26:39FromGitter<Varriount> It's too bad there's not something like SOAP's WSDL documents for JSON apis
15:26:58euantorYeah, it is rather
15:30:25flyxwhat about this Swagger/OpenAPI stuff
15:34:17*Trustable joined #nim
15:34:36demi-yeah, swagger is supposed to do stuff like that for you
15:36:27PMunchUgh
15:36:51PMunchI once got a hand-written swagger which was full of spelling mistakes and straight up errors..
15:36:59PMunchBut a good swagger is great :)
15:37:47*krux02 quit (Remote host closed the connection)
15:38:15*krux02 joined #nim
15:41:01krux02I 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:06Tiberiumcan I know if it's the last iteration over pairs() of some object?
17:20:10Tiberium(over JsonNode object)
17:27:23FromGitter<Varriount> Tiberium: Nope.
17:27:38Tiberiumoh
17:27:58ldleworklol well you can
17:28:01ldleworkyou just have to do it yourself
17:28:08FromGitter<Varriount> Well, yes
17:28:35ldleworkhi Varriount
17:28:39FromGitter<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:46ldleworkDo you want to see my friend's Rust take on that problem we worked on the other day?
17:29:28FromGitter<Varriount> ldlework: Only if I can send you the bill for any high blood-pressure medication I need.
17:29:48ldleworkVarriount they did a pretty good job
17:30:00ldleworkI expected a shit show but they impressed me good
17:30:25FromGitter<Varriount> ldlework: What was the problem again?
17:30:52ldleworkIts hard to describe, its pretty abstract.
17:31:00ldleworkIts the concept problem we were working on. I think you helped.
17:31:09*Sembei quit (Ping timeout: 258 seconds)
17:32:01ldleworkHere was my version: https://gist.github.com/dustinlacewell/6b97b658c2db44e1b22fa021873fe133/33cd47934fbf814504d121b509f90d3da542f5f0
17:32:12ldleworkHere's my friend's version: https://gist.github.com/ajhager/63d7509692e6bcdcea9ca96e18628615
17:32:39FromGitter<Varriount> Doesn't look nearly as readable.
17:33:02ldleworkNot even close
17:33:14ldleworkBut I expected it to be far far worse
17:33:22ldleworkSo when they presented this I went WOW!
17:33:50ldleworkits nearly exactly as long
17:33:53FromGitter<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:15ldleworkThey claim that the approaches are essentially functionaly isomorphic but I'm not 100% sure
17:34:30ldleworkBut I'm not a rust expert
17:34:36FromGitter<Varriount> Isomorphic?
17:34:49ldleworkthe same
17:39:20zachcarterare thread channels bidirectional?
17:39:53FromGitter<Varriount> zachcarter: No.
17:40:02zachcarterthx Varriount
17:40:48FromGitter<Varriount> Or wait, maybe it is. I don't know.
17:40:57FromGitter<Varriount> The channels module doesn't even have examples. :/
17:41:26zachcarteryeah
17:41:44*yglukhov joined #nim
17:41:58zachcarterI’m trying to load assets with sdl2 async
17:42:07FromGitter<Varriount> zachcarter: I would try using it bidirectionally and see what happens.
17:42:27zachcarterI gave that a shot, but I may very well have done something wrong
17:42:32zachcarterI’m going to attempt with two channels now
17:43:34zachcartertwo channels seem to work
17:43:55ldleworkI need to learn how to use channels
17:45:50*vivus joined #nim
17:46:13FromGitter<Varriount> zachcarter: If you have time, submit an example to the documentation.
17:46:21zachcartersure
17:46:23*yglukhov quit (Ping timeout: 260 seconds)
17:46:46krux02what is the latest hash of Nim what all tests pass?
17:49:19Tiberium88c4d6aabed415150068b440ce8860644aa56152
17:49:21Tiberiumlatest commit
17:49:35Tiberiumbecause all checks are passed (it shows on travis)
17:50:09Tiberiumbut there's skips
17:50:50zachcarterVarriount. Idlework: https://gist.github.com/zacharycarter/ba978bfadd6fc9834aa5b6d687cff6eb
17:50:57krux02http://ix.io/pIS
17:51:07krux02I get a compilation error here on the latest Nim version
17:51:24krux02Error: type mismatch: got (ptr TextRenderer) but expected 'ptr None'
17:53:06krux02actually the error comis in system.nim in the create proc
17:53:11krux02how can that happen?
17:53:23dom96ldlework: huh, your code is compile-time whereas the Rust version appears to work at runtime
17:53:38krux02I thought it had to do with the fact that I modified the computeSize proc in the compiler, but I undid that
17:53:58zachcarterkrux02 there’s a bug in create / createShared
17:54:08zachcarterthere’s an issue for it already let me find it
17:54:17dom96ldlework: So I don't think those are equivalent. Your friend appears to be using the equivalent of object variants.
17:54:19zachcarterhttps://github.com/nim-lang/Nim/issues/5648
17:54:31FromGitter<Varriount> We have a 'None' type?
17:54:45dom96Varriount: Probably only in the compiler.
17:54:49dom96To prevent crashes
17:57:05krux02the calcSize also has an illegal recursion constant it can return
17:57:45krux02meaning just because it is illegal to have recursive types, doesn't mean that people can define them
17:58:01krux02and then this needs to be handled somehow
17:58:08krux02but anyway
17:59:43krux02zachcarter: thanks for the link the workaround works
17:59:51zachcarternp
17:59:55zachcarteryeah I’m using it atm as well
18:00:51dom96zachcarter: You might have an easier time using `spawn`
18:01:33dom96Just return the surface from your spawned procedure
18:02:06zachcarterhmm okay I’ll play around with that thanks dom96 :)
18:10:36Tiberiumam I missing something? https://gist.github.com/TiberiumN/9bc820dc2fe69b1e25963bc41a0b380f
18:10:53Tiberiumlatest nim devel
18:11:10krux02hmm 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:21krux02how is that related?
18:12:20ldleworkdom96: what do you mean the rust works at runtime?
18:12:52dom96ldlework: I mean, the resulting executable will check the type of the enum at runtime
18:13:11krux02Tiberium: that looks weird
18:13:34dom96ldlework: So you'll have an if branch in the resulting executable
18:13:39krux02I think it has to do with the fact that split might be it's own iterator
18:13:45ldleworkdom96: well I know that's what you meant, I was really asking what makes you think that?
18:14:07krux02so whenever you have a call in a for loop nim looks up if that might be an iterator call
18:14:28ldleworkdom96: is it the `match`?
18:14:33dom96ldlework: AFAIK `match` happens at runtime
18:14:34krux02and therefore you can get defferent behaviour depending on whether you call it in a for loop out outside of it
18:14:59Tiberiumkrux02, hmm, ok
18:15:06krux02despite that difference I don't think whoever writs different versions of iterator and procs that they should behave different
18:15:46krux02so 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:30krux02the split proc should be identical to toSeq(split(#[ iterator versio ]#))
18:16:42dom96ldlework: isn't that the case?
18:17:27ldleworkdom96: I presented them your theory
18:18:28dom96krux02: yeah, your theory is correct.
18:18:46dom96The first for loop uses the `pairs` iterator implicitly
18:19:07Tiberiumdom96, ah, thanks for clarification
18:19:07dom96The second uses the `split` iterator explicitly (which only yields one value)
18:19:27dom96ldlework: cool, let me know what they say
18:20:58ldleworkdom96: all they said is Rock On
18:21:01ldleworkI think they admit defeat
18:21:10ldleworkdom96: we need a strong rust programmer
18:21:18ldleworkconcepts are crazy powerful!
18:21:34dom96:D
18:21:38ldleworkthink about it like this
18:21:48ldleworknim not only has stronger generics than a language like C#
18:21:59ldleworkmaking it so that you can express denser isomorphs in the core language
18:22:13ldleworkbut also provides the metaprogramming facilities for when you need to go past even that
18:22:23ldleworkI should have presented those two in the opposite order for more dramatic effect
18:22:26ldleworkbut you get what I mean
18:22:37dom96Yep, Nim is awesome :)
18:22:43dom96We just need to advertise it better
18:22:48ldleworkit moves the bar, but also has the best system for serving you after you cross the boundry generic capabilities
18:22:57ldleworkboundry of*
18:23:42ldleworkdom96: Maybe we should start collecting these wierd "well what's the usecase" pl-k-holes I come up with
18:24:01ldleworkthey may have no usecase but they do show the power of expression
18:24:25*sz0 quit (Quit: Connection closed for inactivity)
18:24:27ldleworkthough that might not be the best way to advertise I guess haha
18:24:48dom96heh, I do want to show a bunch of Nim features on Nim's new website.
18:25:16dom96If you or anyone else wants to come up with a short but awesome concepts example I would be very grateful :)
18:25:19Tiberiumcan I see how does new nim website looks like?
18:25:41dom96You can clone https://github.com/nim-lang/website and run it locally
18:26:04ldleworkI've heard that one before
18:26:11Tiberiumok I will
18:26:21ldleworkdom96: dockerize it
18:26:22dom96Still a bunch of things to do, and I really lack the motivation to work on it :\
18:26:34ldleworkso all I have to do is docker run dom96/nim-website or whatever
18:26:36dom96ldlework: no thanks
18:26:44Tiberiumah, it's html? static website? even cooler
18:26:51ldleworkoh nice
18:26:57ldleworkI figured it'd be jester
18:27:04TiberiumI can use python's http server :D
18:27:06ldleworkya
18:27:11dom96it's jekyll
18:27:17Tiberiumpython3 -m http.server 8080
18:27:20dom96You can't just do that
18:27:25*Matthias247 joined #nim
18:27:31dom96You need to have Jekyll generate the HTML
18:27:31ldleworkTiberium: ya you gotta generate it
18:27:42Tiberiumah
18:27:43Tiberium:D
18:27:58ldleworkdom96: Doesn't github do that for you?
18:28:19dom96dunno, does it?
18:28:30ldleworkpretty sure they've run a jekyll service from the start
18:28:39dom96Honestly though, if I truly wanted people to see the website I would host it somewhere.
18:28:42ldleworkhttps://help.github.com/articles/using-jekyll-as-a-static-site-generator-with-github-pages/
18:28:43dom96It's not ready to be viewed yet
18:29:23ldleworkso technically you could have github host the nim site and just have dns point there
18:30:15vivusgithub doesn't have a build process. gitlab does
18:30:55ldleworkvivus: wrong
18:31:02vivusalthough if you try hard enough, 1 of those CI-tools could build the site for you
18:31:17ldleworkgithub does infact have a jekyll build service
18:31:42Tiberiumwow
18:31:44ldleworkyou push jekyll source files to github, it will build and host the result
18:31:56ldleworkbtw, if you have docker easy way to run a jekyll site:
18:31:57Tiberiumthis new website already looks like modern one :)
18:31:58ldleworksudo docker run -d -v "$PWD:/src" -p 4000:4000 grahamc/jekyll serve -H 0.0.0.0
18:32:03vivusI remember someone saying everything concerning nim should be dogfooded (is that even a word?). so using jekyll is ... ?
18:33:00dom96Tiberium: glad that the reaction is "wow" :)
18:33:00Tiberiumlol, there's still windows installers on that new nim website :)
18:33:21dom96Yeah... I'll need to rewrite something in my book thanks to the removal of these installers... *sigh*
18:33:22Tiberiumdom96, at least it doesn't contain tons of JS
18:33:55krux02that's the problem with books about tools, tools change over time
18:33:57ldleworkdom96: doh
18:34:08Tiberiumbtw, you can look an nim website by my ip now :)
18:34:20ldleworkhah someone just asked if we could write a nim -> golang compiler
18:34:21vivusTiberium: link?
18:34:38Tiberiumwait a sec
18:34:41krux02tools, technology all is moving, but the theory guys, they just stay up to date
18:34:47Tiberium178.204.228.212
18:34:54Tiberiumshould work
18:35:08dom96that's an older version actually
18:35:26Tiberiumbut I cloned git repo and made "jekyll build"
18:35:32dom96switch to my 'front-page' branch
18:35:41Tiberiumok :)
18:36:06vivusgit branches = <3 (/s)
18:37:15Tiberiumdone it seems http://178.204.228.212/
18:37:49Tiberiumor you can use this: http://tiberium.hldns.ru
18:37:51ldleworkhttp://ldlework.com:4000/
18:37:59ldleworkI had to download the jekyll image so I'm a little late
18:38:11Tiberiumor not, you can't use tiberium.hldns.ru :D
18:38:52Tiberiumldlework, your didn't change the branch
18:38:59Tiberiumyou need "front-page" one :)
18:39:00ldleworkupdated
18:39:13Tiberiumnice
18:39:29vivusTiberium: where is your site hosted? it loads really slow
18:39:31ldlework<3 docker
18:39:35Tiberiumvivus, it's on my PC :D
18:39:44vivus0.o
18:39:45dom96Okay, please don't host it for too long.
18:39:51TiberiumI live in Russia
18:39:54Tiberiumdom96, ok
18:40:01*dom96 dislikes having unfinished work visible
18:40:07vivus<insert putin joke>
18:41:06Tiberium"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:35vivusI actually don't
18:41:59Tiberiumhttp://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:40krux02I also don't get it
18:45:54Tiberiumit's out of context
18:46:10ldleworkI wonder if there is any real reason that object variant fields need to be uniquely named
18:46:19ldleworkin nim
18:47:25dom96It's the same reason why a procedure cannot have a `string or int` return type
18:47:56ldleworkdom96: 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:08dom96That said, if the fields with the same name have all the same type then it should be allowed.
18:48:25dom96I'm sure both are possible, it's just they are not exactly easy to implement.
18:48:26vivusthis 1 was humorous: A spy goes to Lubyanka (headquarters of the Soviet secret police in Moscow) and says: ...
18:49:08ldleworkdom96: couldn't each name uniquely refer to a field in the cases the compiler know which type is being utilized?
18:49:32dom96no idea
18:49:34zachcarterNim 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:35ldleworklike 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:38dom96If you really want this feature then write an RFC :)
18:49:46zachcarterdom96: does that mean I should be using async / await for what I was trying to do earlier?
18:49:49zachcarterand not threads?
18:50:02ldleworkthreads are never the answer
18:50:08ldleworkexcept when they are :(
18:50:10dom96zachcarter: probably, but I doubt sdl supports async
18:50:26zachcarteryeah I figured a worker thread was probably my only answer
18:50:41zachcarterthank you
18:50:59zachcarteractually one hacky thing I did try
18:51:03zachcarterwas using asyncfile to load the file
18:51:12zachcarterand then pass the data in memory to SDL
18:51:26zachcarterbut that didn’t work out either :/ libpng rejected the string representation of the data
18:52:16dom96hrm, maybe a bug in asyncfile?
18:52:23dom96dunno, but spawn should work
18:52:34zachcarteryeah I’m looking at spawn now
18:52:43dom96and if needs be it can be integrated with async
18:52:47dom96Albeit a bit hackishly.
18:52:56ldleworkdom96: seems like in the rust the same name is used
18:52:59ldlework'value'
18:56:03dom96Yes, I found myself annoyed with this restriction as well.
18:56:20dom96Like I said, RFC please.
19:01:56*yglukhov joined #nim
19:02:28zachcarterdom96: you’re right, much simpler - https://gist.github.com/zacharycarter/f2032df26536b0d58aff9e7ca7d3cf27
19:02:54zachcarterwhoops
19:03:10zachcarterfixed
19:04:12*rauss quit (Quit: WeeChat 1.7)
19:05:31dom96zachcarter: you don't need the channel
19:05:45zachcarteroh haha
19:06:26zachcartereven better!
19:07:30*brson quit (Quit: leaving)
19:12:11*mwbrown quit (Remote host closed the connection)
19:14:19ldleworkI have been thinking about my port problem. I think I'm getting confused.
19:16:41zachcarterdom96: if I”m using spawn like : https://gist.github.com/zacharycarter/b7abf5ee5b9ca2054b62760298a0456c
19:16:51zachcarterhow do I check if the spawned threads are finished?
19:17:02zachcarterdoes sync automatically complete their work?
19:17:19dom96not sure
19:17:42*yglukhov quit (Remote host closed the connection)
19:17:42dom96there is a way to check if a FlowVar has finished though
19:17:46zachcartersounds 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:54ldleworkthat's what it does yeah
19:18:07zachcarterhmm okay
19:18:16zachcarterah isReady
19:18:17*yglukhov joined #nim
19:18:52zachcarterthx
19:20:08ldleworkdom96: 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:53dom96You would need to create an object variant for that
19:22:03dom96or use inheritance
19:22:12*rauss joined #nim
19:22:16*rokups quit (Quit: Connection closed for inactivity)
19:22:22dom96That makes me wonder whether we will be able to specify a concept as an array/seq type in the future though.
19:22:39dom96zahary: ^ ?
19:23:49ldleworkdom96: 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:58ldleworkIt kind a blows away the utility...
19:24:09ldleworkeach client to that varying type needsd to be riddled with case statements
19:24:51dom96yeah, it sorta sucks.
19:24:56dom96Not sure.
19:27:03*yglukhov joined #nim
19:27:10ldleworkI also recently realized that you can't define types who's fields are typed as a concept
19:27:15ldleworkOf course you can't. hehe
19:27:27ldleworkmakes no sense but took me a while to realize why
19:27:35krux02working on computeSize a bug in times.nim got aparent that I wonder could ever work
19:27:46krux02I have no idea how that could ever relate
19:28:44ldleworkthe problem of a typed port/plug model is an interesting one
19:28:56ldleworkI think I might be getting weary of it though
19:29:31*brson joined #nim
19:31:40dom96Argh, the JS code gen fails on the code in marshal because it does a lot of pointer casts/derefs.
19:32:08dom96and I have no idea what the compiler should be doing in that situation :\
19:47:26*Sembei joined #nim
19:49:21Tiberium"Connection was closed before full request has been made" hmm, this is why I'm getting 100% cpu
19:50:40Tiberiummaybe I can add 100ms sleep in except
19:52:40Tiberiumdoes 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:22krux02I am a but puzzled with the skipTypes proc in the compiler
19:57:40krux02what is its result value supposed to mean?
20:00:45ldleworkI forget does nim have proc overloading?
20:01:10ldleworkyeha it does ok
20:02:59krux02Araq: this seems very cryptic to me: while result.kind in kinds: result = lastSon(result)
20:03:13*nsf joined #nim
20:05:47krux02ah ok I think I get it. it unpacks all non-interesting wrappers around a type
20:06:06ldlework Inlet[T] = ref object of RootObj
20:06:08ldlework name: string
20:06:10ldlework module: Module
20:06:12ldlework value: T
20:06:14ldleworksorry :(
20:06:21ldleworkI meant to paste link
20:06:28ldleworkbut it says "cannot instantiate: Inlet"
20:06:30ldleworkwhy?
20:06:45krux02I don't know
20:06:59krux02is Module knowen
20:07:22dom96how are you constructing the type?
20:07:39krux02do you have a type parameter for Inlet, or are you just declaring: var myvar: Inlet
20:09:09ldleworkdom96: oh the error pointed to the declaration
20:09:19dom96indeed
20:09:21dom96:)
20:09:35ldlework(so I thought the problem was with the declaration)
20:09:54ldleworkI 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:46dom96Araq: How do I handle this in the jsgen? result = cast[ptr bool](x.value)[]
20:31:53dom96https://gist.github.com/dom96/63557b5e5a2357c46c1a4d845bc4af5c
20:32:11dom96I printed the 'a' and 'n'.
20:33:21Araqwhere is this line from? streams?
20:33:29dom96typeinfo
20:33:33Araqthere just is no way to write it this way for JS
20:33:36dom96line 513
20:36:21dom96what is the state of support for 'ptr', 'pointer' etc. in the JS backend
20:38:23Araqit's JS
20:38:31Araqit doesn't have pointers.
20:38:48Araqproc foo(x: pointer) is mapped to function foo(x)
20:38:52dom96I thought they were maybe being emulated somehow.
20:39:12Araqptr T is mapped to an array of size 1 of T
20:39:38Araqbut you think you can cast pointer to ptr T and deref and shit.
20:39:58Araqthat's not how it works. you think on the completely wrong level about this thing
20:40:50dom96I don't think that
20:41:03dom96I was just guessing
20:41:22ldleworkjeeze dom96 get with it
20:41:46*BitPuffin quit (Read error: Connection reset by peer)
20:41:54Araqresult = cast[ptr bool](x.value)[] # result = x.value[0] != 0
20:42:07dom96so I should modify marshal instead?
20:42:14Araqyep.
20:42:26Araqthe higher levels are easier to map to Js.
20:42:46dom96Okay, but the fact that the compiler throws an internal error with that code is still an error.
20:43:06dom96*a bug
20:43:26ldleworkyeah Araq get with it
20:46:20dom96Low priority so i'll just create an issue for it.
20:47:33dom96Araq: Did you mean that "result = x.value[0] != 0" will work for the JS backend? because it doesn't
20:47:39dom96There is no `[]` for `pointer`
20:49:16demi-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:07ldleworkwhich lib
20:51:36demi-notmuch (mail client)
20:52:27ldleworksounds cool! is your thing on github?
20:52:38dom96oh, I guess once again I should just emit this.
20:53:12*zaquest quit (Ping timeout: 256 seconds)
20:53:52Araqdom96: I mean that a stream is an array of bytes for JS
20:53:55demi-it is, but i am still refining it; will submit to nimble once i'm done
20:54:11Araqand you need to interpret the bytes appropriately and then it might work out
20:54:24Araqso pointer == array of byte
20:54:44Araqp[] == a[i]
20:54:45ldleworkdemi-: I'd just like to take a look to see more examples of wrappers that's all
20:55:37demi-sure, one sec and i can push my latest changes
20:55:41dom96Araq: right...
20:56:40dom96Araq: I don't see how streams are relevant in typeinfo
20:56:58*Vladar quit (Quit: Leaving)
20:58:04demi-ldlework: https://github.com/samdmarshall/notmuch.nim/blob/master/src/notmuch.nim
20:58:55demi-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:54dom96Araq: Assigning a pointer to another pointer also fails, should it work?
21:02:09Araqdunno
21:07:44*Sembei quit (Quit: WeeChat 1.5-dev)
21:09:47zachcarterhrm this is what I’ve come up with : https://gist.github.com/zacharycarter/c19ac66511580ee3040e57b7459dd626
21:09:54zachcarterhalf the time it freezes
21:09:57zachcarterhalf the time it works :D
21:10:16ldleworkzachcarter: off to the races
21:10:22zachcarteroh yeah
21:11:14FromGitter<Varriount> zachcarter: I've sent you some information in Gitter
21:11:25zachcarterthank you Varriount I will check it out
21:24:38dom96Araq: 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:38Araq'cast[T](x)' is mapped to 'x' in the JS backend already
21:26:35dom96And what is x[] mapped to? `x[0]` right?
21:26:51dom96so shouldn't `cast[T](x)[]` -> `x[0]`?
21:27:17*Sembei joined #nim
21:28:11*fastrom joined #nim
21:28:59Araqmaybe
21:29:01FromGitter<gokr> @rosshadden Ehm, dunno :)
21:29:49dom96Araq: easy to implement?
21:30:02*samuell_ quit (Ping timeout: 256 seconds)
21:30:20*samuell quit (Ping timeout: 264 seconds)
21:30:39AraqI doubt it. the easy things have all been done.
21:30:58Araqthe hard parts remain.
21:31:36*bjz joined #nim
21:36:28*Trustable quit (Remote host closed the connection)
21:40:04dom96https://github.com/nim-lang/Nim/issues/5667
21:40:16ldleworkis there a way to change this to a case statement? https://gist.github.com/dustinlacewell/345bc4d37be762118123aea6f029ad96
21:43:23ldleworkpls
21:43:35ldleworkoh it can't be
21:44:09krux02ldlework: no it can'b be a case statement, but you can use elif
21:44:55dom96Araq: Surely mapping it can't be that hard :\
21:45:06krux02it doesn't do anthing in the generated source, but it alse tells semantically that there can only be one branch active
21:45:17dom96I'm trying to just do it in typeinfo but the amount of changes is just too much
21:45:52dom96I created a universalCast proc that either emits on JS or casts and have to replace each `cast` with that...
21:50:13Araqcast[ptr uint16](x)[] --> x[i] or x[i+1] shl 8
21:51:56*BitPuffin|osx quit (Ping timeout: 240 seconds)
21:52:03dom96Araq: `i`?
21:52:30Araqi==0
21:52:53dom96i see
21:53:12dom96That makes things more complex :\
21:54:48*rauss quit (Quit: WeeChat 1.7)
21:59:34dom96is it possible nowadays to use metaprogramming to achieve the same thing as marshal?
22:00:18Araqyes
22:00:37Araqvia macros.getType
22:00:50dom96awesome
22:01:18ldleworkthis is passing: https://gist.github.com/dustinlacewell/7b3c609b22f4f157a3304027f9555b93 :D
22:02:21dom96ldlework: yay, you accidentally a letter there though :)
22:03:08ldleworklol
22:03:32ldleworkdom96: as expected though, case/when statements everywhere
22:10:45Araqit's not the 90ies anymore. exhaustive cases rule for correctness and virtual function calls lost. ;-)
22:11:10dom96I think I will create a nice JSON macro marshal-type thing.
22:11:15dom96But tomorrow
22:17:06FromGitter<hcorion> Hey, so what character should I use instead of \n ?
22:17:26FromGitter<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:51dom96hcorion: a new line is OS-dependent, which one do you want to detect?
22:19:44dom96If either, then use `if character in NewLines:` (NewLines defined in strutils)
22:20:56FromGitter<hcorion> Okay, strutils might be too heavy a dependency for me, I'll have to see
22:23:23zachcarterdom96: any idea why this code fails to complete - https://gist.github.com/zacharycarter/c19ac66511580ee3040e57b7459dd626 ?
22:23:41zachcartersometimes it does exit with a succesful exit code
22:23:43zachcarterothertimes it just hangs
22:23:55ldleworkhow do I create an instance of a basic non-ref 'object' type?
22:24:13ldleworklike I defined a type Foo = object
22:24:15FromGitter<hcorion> Yeah, it's too heavy, but I'll just copy it over, thanks
22:24:16ldleworkhow do I create one?
22:24:29zachcartervar f = Foo()
22:24:32zachcarterI think?
22:24:51ldleworkError: attempting to call undeclared routine: 'Parameter'
22:25:39zachcarterhttps://glot.io/snippets/eoo206ynav
22:27:15ldleworkhttps://glot.io/snippets/eoo21sdhjc
22:28:14zachcarterhttps://glot.io/snippets/eoo22rrgim
22:28:39ldleworkI see
22:28:45ldleworkthank you
22:28:48FromGitter<stisa> https://nim-lang.org/docs/manual.html#types-object-construction
22:28:48zachcartersure thing
22:29:29ldleworktoo bad it can't infer the generic type
22:29:31ldlework:(
22:29:40dom96hcorion: too heavy? whaaat?
22:29:51zachcarterhaha yeah that confused me too it’s part of the stdlib
22:29:53FromGitter<hcorion> Game Boy Advanced baby
22:30:16*bjz joined #nim
22:30:34*Sembei quit (Ping timeout: 240 seconds)
22:30:46FromGitter<hcorion> Can't handle none of that fancy schmancy GC or seq
22:31:17FromGitter<hcorion> and I'm too lazy to bother fixing them to make it work
22:31:25ldleworkhcorion you're using nim without the gc?
22:32:14FromGitter<hcorion> Yep, As far as I understand it, as long as I don't use ref objects, it should work fine
22:33:05ldleworkfascinating
22:33:19ldleworkhcorion, are you building a new stdlib
22:34:17FromGitter<hcorion> Yes and no, I just don't import anything, so I don't really need to build anything.
22:35:45dom96hcorion: even if you import strutils, the nim compiler is intelligent enough to only import what you use from it.
22:36:25dom96zachcarter: no idea I'm afraid
22:36:34zachcarterI think I figured it out
22:36:37zachcarterbad looping
22:36:57FromGitter<hcorion> Yeah, but it throws an error, ⏎ lib/pure/strutils.nim(1177, 14) Error: type mismatch: got (string, Slice[system.int])
22:38:30FromGitter<hcorion> It's probably got something to do with using setting OS as standalone
22:41:08dom96yes, well, string itself is GC'd
22:41:15dom96slicing it creates a copy
22:45:40*vlad1777d quit (Remote host closed the connection)
22:47:09*Senketsu_ quit (Quit: Leaving)
22:50:20ldleworkhaha I got the compiler to segfault
22:50:22ldleworkø/
22:51:44ldleworkhttps://glot.io/snippets/eoo2q1ygd6
22:55:11ldleworkwhat 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:46ldleworkseems having either of these two functions in the code causes the segfault
23:00:48ldleworkproc newParameter[T: PortType](name: string, value: T): Parameter[T] =
23:00:50ldlework result = Parameter(name:name, value:value)
23:00:52ldleworkproc newParameter[T: NumericPort](name: string, value, min, max: T): Parameter[T] =
23:00:54ldlework result = Parameter(name:name, value:value, minVal:min, maxVal:max)
23:03:32*nightmared joined #nim
23:05:22ldleworkif I remove the concept restrictions it compiles
23:05:39ldleworkdom96: Araq should I open a bug with this snippet?
23:08:02dom96of corse
23:08:09dom96*course
23:08:27dom96btw why are you guys using glot.io so much?
23:08:39*rauss joined #nim
23:09:10dom96the tiny 10 line code window is incredibly annoying
23:09:51dom96anyway, 'night
23:15:19ldleworkdom96: haha I agree
23:22:01*arnetheduck joined #nim
23:24:20*brson quit (Quit: leaving)
23:24:35*brson joined #nim
23:40:32ldleworkanyway to create a variant that doesn't provide a field?
23:51:18*nightmared quit (Ping timeout: 246 seconds)
23:54:05FromGitter<Varriount> dom96: It lets you run Nim code online
23:56:12*SusWombat_ joined #nim
23:56:52ldleworkVarriount, whens the last time you segfaulted the compiler
23:58:42*SusWombat quit (Ping timeout: 258 seconds)
23:59:37*nightmared joined #nim