<< 31-12-2014 >>

00:01:20gokrI wonder slightly how Nimmers go about a question like "What can I do with a RootObj?"
00:01:57*yglukhov__ quit (Quit: Be back later ...)
00:02:12gokrI mean, as a Smalltalker I do miss my browsers.
00:02:32*yglukhov__ joined #nim
00:02:34gokrOh well, time for bed, gnite
00:05:53*Matthias247 quit (Read error: Connection reset by peer)
00:06:40*yglukhov__ quit (Ping timeout: 244 seconds)
00:11:10*gokr quit (Quit: Leaving.)
00:15:00Triplefoxthe link to the "how to install Nimble README" is outdated nim-lang.org/lib.html
00:15:09Triplefox* http://nim-lang.org/lib.html
00:16:28dom96why the hell is github not redirecting that?
00:17:37jpoirierAre the valid/tested --cpu and --os options listed somewhere. platform.nim has an all inclusive list but there's no info on what has been tested and status?
00:18:10flaviujpoirier: arm seems to work, and I think powerpc worked last time I spun up an emulator
00:18:21dts|pokeball:D created a .desktop file for aporia
00:18:35flaviui386, amd64 clearly should work
00:19:06flaviuNim is in the the ports repository for some BSD, I don't remember which, so it should work there.
00:19:36flaviuSomeone made an iphone app and OSX program, so it works there.
00:19:44flaviuIt works on windows, linux
00:20:02jpoirier...figured the common ones worked
00:20:09flaviuhttp://buildbot.nim-lang.org/grid
00:20:19flaviuAlthough that grid doesn't look too good atm
00:20:58dom96ppc should also work
00:21:05flaviuyep, mentioned that
00:21:06jpoiriernice. who runs the builders?
00:21:09*Buttons840 joined #nim
00:21:10flaviulots of green on the waterfall: http://buildbot.nim-lang.org/waterfall before recent
00:21:22jpoiriermips?
00:21:23flaviujpoirier: The master is run on the Nim VPS
00:21:32flaviuand the builders are run by volunteers
00:21:54Araqjpoirier: Varriount_ is responsible for this but unfortunately he's very busy these days
00:21:59dom96flaviu: looks like everything is failing to me?
00:22:00flaviujpoirier: dunno, my router doesn't have enough memory to compile Nim
00:22:11flaviudom96: yep
00:22:11dom96oh, before recent
00:22:41flaviuIf you have mips, please report your findings. It'll probably work though.
00:22:58Araqjpoirier: I think somebody did run it on a mips
00:23:38dts|pokeballcan i run it on a mips emulator?
00:23:49jpoirierWe use mips64 processors (Octeon) running linux at work I could try nim on.
00:24:37dom96I think I might have tried it on mips at some point.
00:24:52flaviujpoirier: Please do. If you can convince your work to donate a processor core or so's time to the build bot, that'd also be good.
00:26:29*Buttons840 quit (Ping timeout: 245 seconds)
00:26:51*Buttons840 joined #nim
00:26:56dts|pokeballdom96, you use ubuntu right?
00:27:05jpoirierthey're mostly proprietary boards (basestations)
00:27:08dom96dts|pokeball: only on my chromebook
00:27:08def-jpoirier: Intel MIC (Xeon Phi) even works
00:27:23dts|pokeballdo you know how to set aporia as the default for nim files?
00:28:47Araqdef-: please make a feature request for the better C code for xeon phi that we should generate
00:28:59*Varriount|Remote joined #nim
00:29:04dom96dts|pokeball: Right click nim file -> Properties? I'm not sure but I bet google knows.
00:29:10def-Araq: oh right, will do
00:29:12AraqVarriount|Remote: there is work to do
00:29:12*yglukhov__ joined #nim
00:29:19Varriount|RemoteAraq: ?
00:29:30Araqthe 64bit installer uses mingw32
00:29:34dom96Varriount|Remote: Are you aware that the builds on the buildbot are failing?
00:29:47dts|pokeballdom96, hmmm i was hoping for all of nim files automatically, but i guess ill try google again
00:29:56Varriount|RemoteAraq: Odd. I thought koch was supposed to take care of that?
00:30:00*brson quit (Ping timeout: 258 seconds)
00:30:10dom96dts|pokeball: Yeah... that's what I meant.
00:30:13Varriount|Remotedom96: Yes, I've been trying to get multi-codebases working
00:31:28AraqVarriount|Remote: no, it always passes mingw32
00:31:51AraqI thought you don't use it anyway
00:32:02Araqand so I only made it to work for niminst
00:32:06Varriount|RemoteAraq: Use what? Mingw32?
00:32:32*lumo_e_ quit (Quit: Leaving)
00:32:38Araqwhich always requires some --var:mingw but none in particular
00:32:55Varriount|RemoteAraq: I'll revert the buildbot changes for now, and then work on the installers
00:33:13AraqVarriount|Remote: installer is more important
00:33:22*yglukhov__ quit (Ping timeout: 240 seconds)
00:39:09flaviuVarriount|Remote: Aren't the installers automated?
00:39:20Varriount|Remoteflaviu: Automated in what sense?
00:39:37flaviupush a button, out come the installers
00:39:39Varriount|Remoteflaviu: If you mean the buildbot has builds for them, no
00:39:49Araqyeah, that *IS* the question here really
00:39:56flaviuno, doing it every time would be wasteful
00:40:26flaviuVarriount|Remote: I can build for windows on linux
00:40:30Triplefoxnimble crashed when i used the current win x64 build, everything works when i reinstalled it with x86 build
00:40:36Triplefoxcrashed on install*
00:40:48Varriount|RemoteTriplefox: Nimbe has an x64 build?
00:40:52Varriount|Remote*Nimble
00:40:54Triplefoxno, nim does
00:41:08Triplefoxbut there is some bootstrapping in nimble's installer
00:41:43Varriount|RemoteTriplefox: Yes, and Nimble only has x32 dlls
00:42:26Triplefoxhmm...well then idk how i even had it working previously
00:53:09*eskatrem quit (Remote host closed the connection)
00:56:07Triplefoxit tells me about open arrays and gives no example of syntax http://nim-lang.org/tut1.html#open-arrays
00:58:02Triplefox(fortunately it's not hard to guess)
00:59:56Varriount|Remotehttps://drive.google.com/file/d/0B077nrrf63xtVWQydEpyZVZ6WW8/view?usp=sharing
01:00:02Varriount|RemoteAraq: ^
01:00:04AraqVarriount|Remote: I pushed some update to koch.nim that should help you
01:00:23Araqit's more obvious now and it uses mingw$bitwidth
01:00:24Varriount|RemoteAraq: Which would be nice... If I wasn't using the release revisions.
01:00:38Araqok
01:00:43Araqyeah ...
01:00:49Varriount|RemoteAraq: I appreciate the change though, thanks.
01:00:55Araqbut next release will come and koch will be ready
01:01:07*wrl left #nim (#nim)
01:01:32Araqbut beware that it uses the bitwidth that koch itself has been compiled with
01:01:45dts|pokeballwhere do i report aporia crashes? on the repo as an issue?
01:02:02Varriount|RemoteAraq: I wouldn't expect anything different.
01:02:09Varriount|Remotedts|pokeball: Yes
01:02:13dts|pokeballok
01:02:18dts|pokeballthink i might have found a bug
01:02:20AraqVarriount|Remote: did you test it?
01:02:36Araqdts|pokeball: crash sounds like a bug
01:02:37flaviuVarriount|Remote: What does the installer do besides extract the files?
01:02:42Varriount|RemoteAraq: I'm on a slow internet connect
01:02:54Varriount|Remoteflaviu: Download stuff
01:03:25flaviucan you be more specific? I don't have windows, and windows doesn't have strace anyway.
01:04:00Varriount|RemoteAraq: I manually changed the mingw url in the ini file, and I tested that the URL leads to a downloadable resource
01:04:11Varriount|Remoteflaviu: Uh... What?
01:04:22flaviuWhat stuff does it download?
01:04:48Varriount|Remoteflaviu: It uses http to download optional components - aporia, mingw32/mingw64, etc
01:05:01flaviuah, I see. Thanks!
01:05:43Varriount|Remoteflaviu: http://technet.microsoft.com/en-us/sysinternals/bb897437
01:06:14flaviuIt's more limited than strace, but I suppose it's good enough for 90% of network strace usage.
01:06:22Varriount|RemoteThat will work for TCP/UDP connections. You can also use process monitor (located on the same site) to get strace-like functionality
01:08:24flaviuYou said you use a customized version of mingw32/mingw64. Can you elaborate on that too?
01:10:19Varriount|Remoteflaviu: I downloaded 32 and 64 bit versions of Mingw-w64, and ran the trimcc utility in the tools directory
01:11:02Varriount|Remoteflaviu: It essentially removes files from a mingw installation, using heuristics to remove only those files that don't prevent compilation of Nim and certain other tools
01:11:09flaviutrimcc?
01:11:19flaviuoh, it's a nim tool
01:11:25Varriount|RemoteYep.
01:12:41flaviuYou use the pthreads version of mingw?
01:13:18*Guest22806 is now known as adam12
01:13:21*yglukhov__ joined #nim
01:14:23Varriount|Remoteflaviu: I can't remember... I think I use the win32 thread version
01:15:02Varriount|Remoteflaviu: Anyway, there's no need to generate another compiler distribution, it's already hosted on the website
01:15:12flaviuI want to automate it fully
01:15:46Varriount|Remoteflaviu: It's the dwarf exception version, using pthreads ( I think)
01:16:06Varriount|Remoteflaviu: That's looking at the files in the distribution's binary directory
01:16:14flaviuok
01:17:17flaviuWell, I can't run trimcc on linux. Is it really necessary? Is it sill needed after Nim has been built?
01:17:54Varriount|Remoteflaviu: No. It is only needed if the mingw-w64 compiler distribution needs updating
01:18:05*yglukhov__ quit (Ping timeout: 264 seconds)
01:18:20flaviuOh, great!
01:18:30Varriount|Remoteflaviu: I was trying to tell you that.
01:18:45AraqVarriount|Remote: well I tested it and uploaded
01:18:58Araqchecked my environment vars as well
01:19:19Araqthough it actually looks weird
01:19:37AraqI don't have my local nim in my path
01:20:02Araqbut that has nothing to do with the installer, so it's fine
01:20:13flaviuVarriount|Remote: I don't have windows, are aporia and mingw the only optional components?
01:20:54Varriount|Remoteflaviu: Documentation
01:21:06*Trustable quit (Quit: Leaving)
01:22:44EXetoCare all those .c, .asm and .h files in 'wrappers' used?
01:22:55Varriount|Remotegmpreussner: For some reason, your arm6 slave's login info is incorrect. It's been trying connect to the server for a while
01:23:35EXetoCand nimcache was included. oops
01:23:38flaviuVarriount|Remote: I had him use my password, it worked for a while.
01:23:48flaviuI guess you gave him his own password?
01:24:18Varriount|Remoteflaviu: Yeah
01:24:28*ARCADIVS joined #nim
01:24:45Varriount|Remoteflaviu, gmpreussner: I accidentally forgot to edit the password index for the new builder
01:25:21Varriount|Remotethat's why your password worked flaviu, it was trying to use your own password for auth. I fixed it when adding the arm7 builder and slave.
01:26:05AraqI guess these discussions should be in #nimbuild
01:26:48AraqVarriount|Remote: thank you for your work! good night.
01:38:13*Buttons840 quit (Ping timeout: 255 seconds)
01:42:09*flaviu quit (Remote host closed the connection)
01:42:22*flaviu joined #nim
01:45:12*BitPuffin joined #nim
01:46:14*VinceAddons quit (Read error: Connection reset by peer)
01:51:27*Demon_Fox joined #nim
01:53:45onionhammerhttp://www.reddit.com/r/nim/comments/2qvgc7/_/
01:55:01def-onionhammer: your post?
01:57:58def-12.29.14 looks like a weird date format. Apart from that, sounds like this post addresses some of the concerns with not having newcomer-friendly tutorials
01:58:31def-Araq: finally the xeon phi issue: https://github.com/Araq/Nim/issues/1797
02:01:27*brson joined #nim
02:05:51*gmpreussner_ joined #nim
02:05:52*gmpreussner quit (Ping timeout: 250 seconds)
02:06:20*z1y joined #nim
02:06:51*brson quit (Quit: leaving)
02:12:50dts|pokeballi was thinking of writing an intro tut for nim when i had some time
02:13:48*superfunc joined #nim
02:13:57def-dts|pokeball: Yes, sounds like we need more of those: https://news.ycombinator.com/item?id=8815965
02:14:21EXetoCaur/nimrod-git -> aur/nim-git
02:14:39dts|pokeballonionhammer, is that your blog post?
02:15:21dts|pokeball>Learning the syntax/features of the language should be part of documentation, not a tutorial.
02:15:25dts|pokeballthis noob
02:20:20dts|pokeballi might create an hn account to actually correct this guy
02:21:48Triplefoxit's not worth it
02:22:37dts|pokeballanyways, the issue with me creating a tutorial is that i only know about 40% of the language, since i treat nim as a procedural language. however, this might be a good thing since i would be able to write a gentle introduction to a small subset of the language
02:22:56Varriount|RemoteTriplefox: Aww, but I've already gotten out the pitchforks and torches...
02:23:31Triplefoxright now i'm working on something that has led me to (gasp) manually allocate memory...a little bit of a challenge to figure out how to write c in nim but so far the docs have sufficed
02:24:06*gmpreussner_ quit (Ping timeout: 244 seconds)
02:24:28dts|pokeballffi's :D
02:25:06Triplefoxactually, following up on a problem with the example sdl2 audio callback program
02:25:11dts|pokeballnim ffis are the one thing i regret not learning yet.
02:25:24Triplefoxit assumed that the size of the stream buffer you request = the size you actually get
02:27:02Varriount|Remotedts|pokeball: ffi's aren't that hard.. at least, not if the ffi in question is designed correctly, and doesn't do weird things with given parameters.
02:27:07Triplefoxit was just making a array of the requested size, but if you want to do it right...you still want an array but the size has to be figured at runtime
02:28:01dts|pokeballVarriount|Remote, im sure. i just havent gotten around to it yet. my c is also extremely rusty :/
02:28:28Varriount|RemoteTriplefox: unsafeNew(sizeof(int)*n)?
02:29:43Triplefoxi found {.unchecked.} and it seems to be doing what i want...except i'm getting an artifact in the resulting sound
02:30:30Varriount|Remotedts|pokeball: You just have to be careful about types, as you get obscure errors if the types in procedure wrappers don't fit with the types in the actual C procedure.
02:31:35Varriount|RemoteThere used to be a major bug in Nim's socket code, because the actual types didn't match up with the types the wraper gave.
02:32:34*superfunc quit (Ping timeout: 244 seconds)
02:34:57Triplefoxokay, i got it to work in the simpler case where i write to the stream directly without actually using my own buffer...the problem is in how i use MixAudio() i guess
02:35:04*superfunc joined #nim
02:39:50onionhammerdts|pokeball yeah
02:40:29onionhammerdef- its month.day
02:40:35Triplefoxerror 1: i was looping with an off-by-one (but that didn't fix the main thing)
02:40:57def-onionhammer: should be 12/29/14 then I think
02:41:21*superfunc quit (Ping timeout: 244 seconds)
02:44:41onionhammerdef- its a stylistic choice :p
02:45:11Triplefoxerror 2: i was clearing the stream buffer wrong...and now it's fine, yay
02:48:22Varriount|RemoteTriplefox: This is for the SDL wrapper?
02:48:26Triplefoxyeah
02:48:35Triplefoxsdl2, specifically
02:49:30Triplefoxit's just an example, but it was wrong on my machine
02:52:19Triplefoxthis is my modified version https://gist.github.com/triplefox/62529b0463b852031121
02:52:43*Varriount|Remote quit (Ping timeout: 246 seconds)
02:53:16*darkf joined #nim
02:54:38dts|pokeballyay! fix aporia!
02:54:45dts|pokeballgonna work on nimbus now
02:55:03*gmpreussner_ joined #nim
02:58:34*BitPuffin quit (Ping timeout: 245 seconds)
03:02:11*yglukhov__ joined #nim
03:06:17*yglukhov__ quit (Ping timeout: 240 seconds)
03:20:56*superfunc joined #nim
03:31:15*Nimbus joined #nim
03:31:41*Nimbus quit (Remote host closed the connection)
03:32:36*Nimbus joined #nim
03:34:03*Nimbus quit (Remote host closed the connection)
03:34:23*Nimbus joined #nim
03:37:36*Nimbus quit (Remote host closed the connection)
03:38:41*kapil__ joined #nim
03:39:59*Mimbus quit (Remote host closed the connection)
03:40:05*Mimbus joined #nim
03:40:33*superfunc quit (Quit: Lost terminal)
03:55:44*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
03:58:45*Pimpus joined #nim
03:59:04*Pimpus quit (Remote host closed the connection)
03:59:42*Pimpus joined #nim
04:04:10*Pimpus quit (Ping timeout: 250 seconds)
04:13:33dts|pokeballhey araq, i might have found a bug
04:27:11*Pimpus joined #nim
04:27:20*Pimpus quit (Remote host closed the connection)
04:27:39*Pimpus joined #nim
04:27:40*Pimpus quit (Excess Flood)
04:28:34*Pimpus joined #nim
04:29:18*Pimpus quit (Remote host closed the connection)
04:33:40*Pimpus joined #nim
04:35:09*Pimpus quit (Remote host closed the connection)
04:36:19flaviudts|pokeball: Post it on github
04:37:06dts|pokeballok
04:43:19*ARCADIVS quit (Quit: ARCADIVS)
04:51:02*yglukhov__ joined #nim
04:55:54*yglukhov__ quit (Ping timeout: 264 seconds)
04:56:41dts|pokeballis it possible to call python code from nim?
04:59:40notfowldts|pokeball, there is a C api
04:59:55dts|pokeballyeah :/ but github doesnt have a c api
04:59:57notfowland wra[[er for it
05:00:34dts|pokeballok, new question. how good are you at sending raw HTTP requests notfowl ?
05:00:35notfowldts|pokeball, what about libgit?
05:00:43dts|pokeballlike do you unders... theres a libgit?
05:00:46dts|pokeballthank god
05:01:32notfowldunno dts i purposefully stay away from web development
05:02:02dts|pokeballdamn :/ im trying to create a gist of the output if its longer than 3 lines but i guess thats not easy
05:02:32notfowli use the rubygem jist for that
05:21:11*Guest76716 joined #nim
05:26:07*Guest76716 quit (Quit: Leaving)
05:32:51jpoirier Does "nimble install XYZ" just *fetch* source code from a repo and puts it in the .nimble/pkgs folder? Also, how does "nimble build" work?
06:23:15notfowljpoirier, if the package has a binary it will compile it and link it in .nimble/bin
06:39:23notfowlgood night
06:39:55*yglukhov__ joined #nim
06:44:11*yglukhov__ quit (Ping timeout: 244 seconds)
06:52:16*yglukhov__ joined #nim
06:52:58*noam quit (Ping timeout: 244 seconds)
06:56:50*yglukhov__ quit (Ping timeout: 265 seconds)
07:02:47dts|pokeballnight notfowl
07:22:42*BlaXpirit joined #nim
07:46:01*dyu joined #nim
07:50:15*rpag joined #nim
07:54:36*VinceAddons joined #nim
07:55:41*loz joined #nim
07:56:27*Demon_Fox quit (Quit: Leaving)
07:58:33BlaXpiritnotfowl (if you are not not fowl), why is there no license in nimrod-sfml?
07:59:41dts|pokeballit would just inherit sfml's wouldnt it?
08:00:09BlaXpiriti don't know what it "would", i just know that no license is sketchy
08:02:57*rpag quit (Ping timeout: 240 seconds)
08:18:26*BlaXpirit-UA joined #nim
08:42:18*BlaXpirit-UA is now known as BlaXpirit_
08:45:09*BlaXpirit_ is now known as BlaXpirit_UA
08:46:41*BlaXpirit_UA quit (Quit: Quit Konversation)
09:07:55lozhi, did anybody have problem with httpclient requesting url with get parameters?
09:08:06ldlework:3 is there no generalized 'in' for arrays and sequences?
09:10:11ldleworkoh nm
09:10:36ldleworkhmm the documentation should inform me of pretty much everything I can do with a sequence or array
09:11:09ldleworkI guess you just go to the docs for system.nim for that
09:11:56gmpreussner_i agree, it should be in the online docs
09:12:20Araqloz: I don't even know if httpclient is not deprecated with this whole new async stuff
09:12:47gmpreussner_Araq: zah checked in some static[T] fixes. looking pretty good so far - haven't found any issues yet :)
09:13:51Araqsee you later
09:14:21lozAraq: looks like it sends something wierd in requests, i'll have to update my gtk to be able to run wireshark to find out what happens
09:15:53*loz left #nim (#nim)
09:16:10*loz joined #nim
09:46:30*noam joined #nim
09:48:06BlaXpirit"async stuff" has almost become the official name for the... async stuff
09:48:35Triplefoxi approve of this marketing term
09:48:56TriplefoxNim's New Async Stuff: You Won't Believe What Happens Next
09:49:31lozhow can i ran tests in module, placed after isMainModule?
09:51:54lozhm, it can be compiled and ran like a distinct program, nice
09:52:30*vegai joined #nim
10:03:49*VinceAddons quit (Read error: Connection reset by peer)
10:04:07gmpreussner_loz: yes. and there is also the 'unittest' module that has some macros to make everything look nicer and print pretty output.
10:05:13lozgmpreussner_: i see, thanks
10:06:31gmpreussner_personally, i like to throw all my tests into a separate file. i follow the convention that nim itself uses, i.e. a 't' prefix for test files. many of my modules therefore have a corresponding unittest file, i.e. mymodule.nim --> tmymodule.nim
10:06:54gmpreussner_and then i have a separate build target that includes all the test files
10:07:35gmpreussner_this way you don't have to parse (and possibly compile) all the tests if you merely want to build your project
10:10:18lozhm, doesn't when isMainModele help with skipping tests on compiling?
10:14:40BlaXpiritloz, that can be used if you write tests in the same file
10:23:10gmpreussner_yeah, it won't compile, but still needs to be parsed
10:23:24gmpreussner_5:22 am here... time for some sleep. gnite :)
10:34:57novistdoes nim support coroutines? (in a way like fibers on windows)
10:36:13BlaXpiritnovist, iterators
10:36:20BlaXpiritare exactly coroutines
10:36:48novistis stack properly preserved? because in say python somehow its not
10:38:43*jefus__ joined #nim
10:39:17BlaXpiriti don't know what you mean
10:39:25BlaXpiritbut there are even 2 different kinds of those things
10:39:45BlaXpiritcoroutines in Python are flawless FYI :p
10:42:01novisti vaguely remember that when i tried getting coroutines on python using iterators then variables declared at start of iterator proc (before while loop) were loosing state somehow
10:42:24Triplefoxcolored cube field (in nim and gl) https://vine.co/v/OwpBVAVzBjK
10:42:34novistthen i figured maybe thats what is fixed by stackless, otherwise it could easily have been simple python module instead of fork
10:42:37BlaXpiritnovist, nope, you made a mistake somewhere
10:42:42*jefus_ quit (Ping timeout: 264 seconds)
10:44:02novisthmm okay.. weird. ^_^
10:44:15novistcan i pop one item from iterator in nim then?
10:44:41BlaXpiritclosure iterator, yes
10:44:43novistah actually manual has just an example i need
10:45:30BlaXpiritthere are so many gotchas in these iterators if you're coming from python
10:45:55novistactually im looking for something that would fit windows fibers
10:46:25novistthey pretty much are coroutines, do stack switching in user-land
10:46:57*Matthias247 joined #nim
10:50:26novistlib/nim/system.nim(2445, 21) Error: redefinition of 'fileHandle'
10:50:32novisti suppose it should not be happening
11:03:08*gokr joined #nim
11:08:19*Ven joined #nim
11:15:55*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:16:29*z1y quit (Ping timeout: 245 seconds)
11:18:05*gour joined #nim
11:18:50*minciue joined #nim
11:24:21*milosn quit (Ping timeout: 258 seconds)
11:33:10novistwho would tell me whats the secret to converting integer to string?
11:33:27BlaXpirit$
11:33:33BlaXpirit$5 == '5'
11:33:47novistweird! but thanks! :)
11:33:57*milosn joined #nim
11:34:09BlaXpiritwait.. single quotes is not correct :|
11:34:22BlaXpiritbut yeah, $ will convert anything to string
11:34:56novistthats great. looks like i could get nim to do what i failed in python.
11:35:18novistso i suppose closure iterators cant yield a value by design? because it errors
11:35:32novistcoro.nim(12, 8) Error: current routine cannot return an expression
11:35:56BlaXpiritare u using return or what
11:36:00BlaXpiritit's supposed to be yield
11:36:05novistyield 1000
11:36:09BlaXpiritshow code
11:36:26novisthttps://paste2box.com/6/#/BpnWGQ/PGPeYaywuU-XOupGVUkqwf0ud-5PVV1v94loRm894IY/vG5X9Jc5.txt
11:36:47*filcuc joined #nim
11:37:05BlaXpirithmmm
11:37:07novistthat could be very useful for specifying how long coroutine should sleep before next execution. so yield 1000 would be like coroutine way of sleeping
11:37:18novistand runTasks would handle that sleeping
11:37:23novistthats my plan heh
11:38:43BlaXpiriti don't see anything wrong with the code :(
11:39:25*Ven joined #nim
11:39:26*filcuc is now known as filcuc_
11:39:26def-novist: iterator a1(ticker: int): int {.closure.} =
11:39:30*filcuc_ is now known as filcuc
11:39:35gokrreturn types missing
11:39:48novist/facepalm
11:39:54*filcuc is now known as filcuc_
11:40:26*filcuc_ is now known as filcuc
11:40:57BlaXpirittype Task is not even close to reality
11:41:02def-a2 should also yield an int
11:41:09def-and type Task = iterator (ticker: int): int
11:41:17novistyeah works indeed, thanks
11:41:39*filcuc is now known as cuke
11:42:04*cuke is now known as filcuc
11:48:18*z1y joined #nim
12:08:17minciueis there any way to make the contents of a reference object immutable in nim?
12:12:12*vbtt joined #nim
12:12:15vbtthello
12:12:41vbttstupid question - where does the windows install put the mingw compiler?
12:13:37*filcuc quit (Ping timeout: 245 seconds)
12:13:55*filcuc joined #nim
12:14:24*kws joined #nim
12:25:11*vbtt quit (Ping timeout: 244 seconds)
12:29:01*kws quit (Quit: Page closed)
13:04:31*minciue quit (Quit: minciue)
13:11:13*z1y quit (Ping timeout: 255 seconds)
13:11:38Araqsome macro wizard should help this guy: http://forum.nim-lang.org/t/692
13:13:55*vbtt joined #nim
13:15:05BlaXpiritI don't understand what can be done with QML alone
13:16:26Araqvbtt: in $nim/dist
13:17:22*vbtt_ joined #nim
13:17:46filcuchi
13:17:52filcucAraq: i'm that guy :)
13:18:12*vbtt quit (Ping timeout: 258 seconds)
13:18:20Araqoh hi filcuc
13:18:39Araqwhat you want works pretty much the way you described it
13:19:57AraqI'm not a fan of global .compileTime tables though. (these will bite us soon enough when we get symbolfiles to work)
13:21:40filcucah ok
13:21:45filcucso i can be doable
13:21:49filcucso it can
13:24:35filcucanother option for not using a compile time table is to use a different syntax
13:25:07*vbtt_ quit (Ping timeout: 244 seconds)
13:25:11filcuci mean something like this one http://nim-by-example.github.io/oop_macro/
13:25:53filcucif i use that syntax i can generate a custom "create" method
13:26:03*vbtt joined #nim
13:26:16filcucand so basically generating all the stuff i wanted to remove from the example
13:26:31filcuchowever this impose a different syntax
13:26:59*gokr quit (Quit: Leaving.)
13:28:52Araqfilcuc: I'm not telling you what to do. I only said "I'm not a fan".
13:30:24filcuci know but given that you're the creator of the language your opinion (for me) is important
13:31:03filcucfrom my message however there're lots of open points. First how to get the type of an object at runtime
13:31:25filcucsome sort of RTTI
13:31:50Araqtypeinfo.nim has RTTI
13:35:51filcucAraq: is there an order of evaluation of statement in the global scope?
13:36:24Araqdepends on what you mean
13:37:03filcucbecause i'll need to put somewhere the globalSlotTable["myObject"] =
13:37:23filcucso the statement where i insert the information i need in the global table
13:37:44Araqjust do it in a top level statement
13:38:03filcucso in the global scope
13:38:14Araqyes
13:38:16filcucright?
13:39:07filcucok given this and a main proc which is the order of execution?
13:39:26Araqthe main proc gets called when you invoke i
13:39:34Araq*it
13:39:53Araqthere is no question here as there is no concept of a "main proc"
13:40:08Araqyou call it explicitly, the order it clear this way
13:41:01filcucok so let's put it in another way. Given two global statements one in File1.nim and File2.nim which is executed first?
13:41:10filcucunpredictable?
13:41:32Araqwhat you imported first
13:41:50filcucah ok
13:42:11*Araq should write a test to ensure that ...
13:43:38filcucso all the global table register statements (ie. globalSlotTable["myQObject"]) must be done before the invokation of my main proc (the one i use to start the Qt event loop)
13:43:44filcuccorrect?
13:44:56Araqcorrect
13:45:58*BitPuffin joined #nim
13:46:48filcucok talking about the "property" macro i wrote in the message forum, is it doable?
13:47:02filcuci mean a macro that takes an arguments and also open a block
13:47:27filcucproperty("name"):
13:50:39def-filcuc: sure, macro(x: string, y: stmt): stmt = ...
13:51:07filcucdef-: thank you
13:52:18filcucok so i think i've most all the bits for starting to implement this custom syntax
13:52:39def-nice. I've only skimmed the forum post, but looks interesting
13:53:49filcucdef-: help is wellcome :) with help i mean suggestion on the syntax or advices
13:54:46filcucone open point is the RTTI i looked at the typeinfo module but i didn't see how to get the supertype of an object
13:55:24def-you need to get the supertype or check whether it's of a specific type?
13:56:02filcuci've to get the supertype as string
13:56:18filcucbecause i've to do some things at runtime
13:56:19def-I'll try to do that
13:56:56filcucbasically given an QObject derived class
13:57:04filcucgiven a subclass instance
13:57:13filcuci must get its type
13:57:34filcucand than extract the slots and signals from the global table
13:57:52filcucthe global table have the object type name as key
13:58:15filcucso for example if MyQObject is a subtype of QObject
13:58:37filcucin the globalSlotTable[
13:58:52filcucin the globalSlotTable there'll be some records for MyQObject
13:59:00filcucglobalSlotTable["MyQObject"]
13:59:36filcucif you look at the post on the forum
13:59:54filcuci'm talking about the implementation of the "create" method of the QObject base class
14:00:03filcucthat must call the register methods
14:00:04vbttAraq: thanks, figured that out btw. 0.10.2 didn't work out of the box on windows because it couldn't find CC. Adding the mingw\bin to the system path fixed that.
14:03:02novistcompiling following https://paste2box.com/6/#/AJnWGQ/xhL0BawhXPNyzhEuhRJVae9KCpVn7coLaFrnapy3mXo/eqpRlp4e.py i get error coro.nim(18, 8) Error: for a 'var' type a variable needs to be passed. Halp?
14:03:03def-filcuc: hm, i guess you can't switch to object variants, would be easy with them
14:03:59def-novist: proc start(this: var Scheduler, task: TaskFn) =
14:04:25novistwhat does var in proc definition mean? cant find it anywhere in docs
14:04:35*vbtt quit (Ping timeout: 258 seconds)
14:04:35def-it means that you can modify the value
14:04:44def-otherwise passed parameters are immutable
14:04:57novistoh i see, thank you
14:05:13novistconst by default i like
14:05:36filcucdef-: i didn't get it :|
14:06:15def-filcuc: instead of an object hierarchy object variants can be used in Nim, but I guess you have to conform to some Qml interface here, so that probably won't work
14:06:32def-and you might want object hierarchies anyway
14:06:39def-I didn't find a solution for object hierarchies yet
14:07:53*gokr_ joined #nim
14:09:48filcucdef-: thank you anyway! i think that i'll start codings something and moving toward that syntax i posted, maybe by doing some compromises
14:10:09def-filcuc: import typetraits, then you can at least use name() to get the string of a type
14:10:42filcucok thank you
14:12:34filcucbrb
14:15:32*filcuc quit (Quit: Konversation terminated!)
14:17:12novistcan i safely delete things from seq while iterating (for loop)?
14:17:35def-novist: no
14:19:23novistis there some idiom to aid this situation maybe? just restarting loop until nothing is deleted is like worst thing
14:19:54def-ehm, i think I had something for this
14:23:11def-delete seems to work in a for loop, but I'm not sure
14:23:33novistor i could make new seq and store indexes to be deleted
14:23:55novistbut then i need something like enumerate() in python to get current index. is that available?
14:27:22*voldern quit (Ping timeout: 240 seconds)
14:31:04*gokr joined #nim
14:34:09*Trustable joined #nim
14:35:15*gokr_ quit (Ping timeout: 258 seconds)
14:37:56*z1y joined #nim
14:44:48novistwhy would "for task in this.tasks: task.next_run = getTime() + Time(task.coro())" result in "Error: 'task.next_run' cannot be assigned to"? Thats like most vague error ever..
14:50:46def-novist: for index, value in mySeq: ...
14:51:09novistohh. thanks (once again)
14:51:47def-i'm not sure about the other error
14:51:55novisthey nooo, "for i, task in this.tasks:" still yields same error
14:51:56def-I'd need the full code
14:52:04def-nono, that was for your first question
14:52:15def-15:23 < novist> but then i need something like enumerate() in python to get current index. is that available?
14:52:30novistah kk. well full code is this. see run() proc https://paste2box.com/6/#/A5nWGQ/t8ZiAritCNBcNnyZMFOZ-fvv_pBrwR64SpeNf4vsPzM/C1MxCeKJ.txt
14:52:40novistfk sec
14:52:44def-doesn't look like the code :P
14:52:59novisthttps://paste2box.com/6/#/ApnWGQ/mEbbaYhqj5THqJZYRx3f99aPpZSiaxgllk0tGG1mZu8/f0i3E0he.txt
14:53:04novistat times clipboard does not obey :|
14:53:13dv-Error: unhandled exception: value out of range: 800 [RangeError], the 800 is the value that's out of range?
14:53:57novistthat what i would assume (though i dont know for a fact)
14:54:48dv-the traceback points to a line that's just an assignment though, so i don't understand what's out of range about it
14:57:51def-yeah, task is immutable in a for loop, you could just loop with "for i in this.tasks.low .. this.tasks.high". Not sure if there is a better solution
14:59:32novistthats odd. guess we have a feature request heh
15:05:25*gokr_ joined #nim
15:07:00def-you could just write your own iterator to work like that
15:07:57*gokr quit (Ping timeout: 240 seconds)
15:09:11dv-oh i get it, nim infered a bool type because i was and'ing it
15:10:25notfowlBlaXpirit, consider nimrod-sfml's license to be MIT, CC0, or anything that implies you will never be prosecuted for using it in any way
15:10:57BlaXpiritnotfowl, I can consider whatever I want
15:11:04BlaXpiritbut
15:11:06BlaXpirithttp://choosealicense.com/no-license/
15:11:32*kapil__ quit (Quit: Connection closed for inactivity)
15:13:22notfowlBlaXpirit, according to the .babel file its MIT
15:14:37BlaXpirithm I haven't considered THAT
15:14:52BlaXpiritstill may be better to have a LICENSE file
15:14:56BlaXpiritwhatever
15:15:47BlaXpiritnotfowl, do you think there is any point of having the T-types when P-types are present? (in context of nimrod-sfml)
15:16:01notfowli'll never remember to add a license file to it
15:16:41notfowlBlaXpirit, no, they dont need to both exist
15:16:47BlaXpiriti was thinking of at least removing the P from types
15:17:01BlaXpiriti'm also in the process of autogenerating an API from c header files
15:18:35notfowlBlaXpirit, i'd rather not make superfluous changes like to remove T/P
15:18:58BlaXpiritnotfowl, you mean you're planning to never remove T/P in your library?
15:19:04notfowlright
15:19:11notfowlchanging old code is not fun
15:19:13BlaXpirit:/
15:19:36BlaXpiriti'm just gonna make a new one then
15:19:50notfowlBlaXpirit, if you're working on a wrapper for 2.2 you can do it and we'll tag the old release
15:20:09BlaXpiritnotfowl, 2.2 is actually not even available yet
15:20:13BlaXpiritbecause there is no CSFML 2.2
15:20:40BlaXpiritand i had to downgrade SFML to 2.1 to even have CSFML work
15:21:02notfowlyou mean its not available for your platform?
15:21:15BlaXpiritno
15:21:25BlaXpiritCSFML hasn't been updated at all as far as i see
15:21:43*darkf_ joined #nim
15:21:45notfowllast time on nov 22
15:21:53BlaXpiritno 2.2 tag, that's for sure
15:22:46*darkf_ quit (Read error: Connection reset by peer)
15:24:42*darkf quit (Ping timeout: 258 seconds)
15:26:48notfowlBlaXpirit, it doesnt look like a lot was added in 2.2 http://www.sfml-dev.org/changelog.php#sfml-2.2
15:27:06BlaXpiritnotfowl, ok
15:27:18notfowldid you try to compile csfml or install a package for it?
15:27:52BlaXpiritnotfowl, I didn't try to compile csfml
15:28:04BlaXpiritwhat's the point, anyway
15:28:15BlaXpiritif it's gonna look exactly the same to me
15:28:33BlaXpiritAPI-wise
15:28:37notfowli think it should work with the newer SFML
15:28:44BlaXpirityes, it might
15:29:23BlaXpiritbut again, it makes no difference for what I'm doing
15:30:58*yglukhov__ joined #nim
15:31:35notfowlif you want to remove T/P i'll accept the PR
15:32:00notfowli dont recommend waiting for me to do it though because its super low priority
15:32:09notfowlbbl, working
15:32:52BlaXpiritbye
15:35:14lozcan i somehow specify default value with table type? params = var initTable[string,string]() says type expected
15:36:15def-params = initTable[string,string]()
15:37:54lozdef-: so it can't be var?
15:39:19def-loz: i don't think that makes sense. where would your changes to the table end up if you don't pass a parameter?
15:39:26flaviuloz: What are you expecting that `var` to do?
15:39:30*gour quit (Remote host closed the connection)
15:40:11lozwell, i want to add some values to this table
15:40:14def-var myDefaultTable = initTable[string, string]()
15:40:14def-proc foo(params: var Table[string,string] = myDefaultTable) =
15:40:23*Trustable quit (Remote host closed the connection)
15:40:46flaviuThe var goes before the declaration, you can add elements to the table if you move it there
15:41:04lozbut it will be same for all foo calls?
15:41:06flaviu.eval var params = initTable[string,string]();params["asd"] = "sada"
15:41:10Mimbusflaviu: eval.nim(3, 13) Error: undeclared identifier: 'initTable'
15:41:36flaviuGood point, I'm not really sure
15:41:42flaviu.eval import tables;var params = initTable[string,string]();params["asd"] = "sada"
15:41:46Mimbusflaviu: <no output>
15:42:06*yglukhov__ quit (Quit: Be back later ...)
15:44:14*voldern joined #nim
15:46:29*gour joined #nim
15:49:14novisthey guys.. no multiline comments?
15:49:38*zahary1 quit (Ping timeout: 250 seconds)
15:50:42*Matthias247 quit (Read error: Connection reset by peer)
15:50:45*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:51:48*z1y quit (Ping timeout: 250 seconds)
15:52:22*dts|pokeball quit (Ping timeout: 245 seconds)
15:53:34*zahary1 joined #nim
15:54:25def-novist: discard """multiline-comment here"""
15:54:43def-http://nim-lang.org/tut1.html#comments
15:55:06novistwas relying on manual for this one. so verbose..
15:56:02novistand i think i found bug in coroutines heh
15:56:36novistmaybe if you are bored could you run this and see if printed numbers (k) are wrong? https://paste2box.com/6/#/DZnWGQ/85Drk_wsD-HHj2uQDbjfPPJdpJKAASGQvjYQuqKeto4/hGzbVeB4.py
15:57:09novistthey start increasing in big jumps instead of decreasing one by one
16:02:17*Varriount|Mobile joined #nim
16:02:39*gokr_ quit (Ping timeout: 258 seconds)
16:02:50*gokr_ joined #nim
16:05:29*endou______ quit (Ping timeout: 272 seconds)
16:05:50*saml quit (Quit: Leaving)
16:06:07*clone1018 quit (Ping timeout: 272 seconds)
16:07:51*saml joined #nim
16:08:11*endou______ joined #nim
16:09:03*clone1018 joined #nim
16:12:21*rpag joined #nim
16:19:21def-novist: that's weird
16:25:44*Ven joined #nim
16:26:13def-novist: without the sort it's ok
16:27:51novistyeah, i think its because iterators get swapped when executing
16:27:55noviststill should not matter
16:28:05def-yep, looks like a bug to me
16:28:55novisti better get my ass to github then hehe
16:30:28def-hm, if i just swap the tasks, it seems fine
16:33:02def-novist: ok, it's the shallowCopy in merge() of sort()
16:33:22def-if you set onlySafeCode = false in lib/pure/algorithm.nim it works
16:33:27*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:35:45novistuh this is confusing. still qualifies like a bug right?
16:36:09Varriount|MobileProbably
16:36:14def-yes, this should work in my opinion
16:36:30def-i think shallowCopy with closure iterators is broken
16:37:12Varriount|Mobiledef-: How ?
16:41:09def-Varriount|Mobile: in this example sort is using shallowCopy, if you make it memcopy instead, it works
16:44:45novistwell then thats how ill call bug report. when Araq gets back from real life (shame on him) he can have fun with it.
16:45:53def-I'll make a minimal example
16:47:52def-oh, or maybe this is one of the cases where you have to encapsulate the iterators once more
16:48:22novisthuh? they already are contained in Task object
16:49:34def-nope, it's ok
16:49:41def-just misremembered from implementing iterutils
16:52:29def-My minimal example: https://gist.github.com/def-/177290281185d8dd9358
16:53:35novistgreat thanks, ill post that
16:53:38lozwhy did $ stop work after i changed my type from object to ref object?
16:53:49def-loz: probably $myObj[]
16:54:15lozdef-: what is this?)
16:54:53Varriount|Mobileloz: [] is the dereference operator
16:55:18lozmm i have seq of my objects
16:55:39Varriount|MobileIt's not normally needed, as the compiler will auto dereference in most cases
16:56:52*gmpreussner_ quit (Ping timeout: 240 seconds)
16:57:06*gmpreussner_ joined #nim
16:57:33lozwell, actual error is Error: type mismatch: got (SlackChannel)
16:57:33lozbut expected one of: ...
16:57:33loz$.$(x: seq[SlackChannel]): string
16:58:48novistdef- could you review? https://github.com/Araq/Nim/issues/1803
16:58:54novisti hope i got expected output right
17:00:57*vbtt joined #nim
17:01:23def-I would expect a1 10; a1 9
17:02:02novistright right, somehow i understood last line as calling z. fail.
17:04:57*vbtt quit (Ping timeout: 240 seconds)
17:05:36*Ven joined #nim
17:08:54novistso back to noob questions.. how do i define object constructor?
17:14:56*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:17:15def-proc newObj(x: int): MyObj = ...
17:23:43*Ven joined #nim
17:23:44Varriount|Mobilenovist: Technically, there's no such thing
17:24:09Varriount|MobileYou just have procedures that create objects
17:28:08*dymk quit (Ping timeout: 258 seconds)
17:28:15*dymk joined #nim
17:29:12novistthats kind of lame..
17:29:45novistone can use makeObj(), another newObj(), another createObj()..
17:30:07novistif there is destructor i think it would be sane thing to provide a constructor that gets called when initializing type
17:31:04*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:33:17Varriount|Mobilenovist: Bring it up on the forum, or with araq
17:34:06Varriount|Mobilenovist: I won't say that I totally disagree with your sentiment....
17:36:54novisti will bring it up when man gets around.
17:38:02*dts|pokeball joined #nim
17:39:21BlaXpiriti've seen at least new, create, init
17:39:22BlaXpiritthis bothers me
17:40:35*dts|pokeball quit (Read error: Connection reset by peer)
17:41:02flaviunew, init are the conventions
17:41:09flaviuI don't like it either though
17:41:30flaviuI have my own proposal: https://github.com/Araq/Nim/issues/1693
17:41:37*dts|pokeball joined #nim
17:42:09flaviuI think that any `create` should be considered a bug and fixed.
17:50:39*brson joined #nim
17:54:15*StefanSalewski joined #nim
17:54:41StefanSalewskiI have finally uploaded latest pango.nim: https://github.com/StefanSalewski/nim-pango
17:54:51StefanSalewskiNow I will update my GDK3/GTK3 to new Nim naming scheme and latest GTK 3.15.3 -- that one seems to have much better GL support,
17:55:01StefanSalewskiso using the latest unstable headers makes sense I guess. And I think 3.15.3 should be already very close to stable 3.16.
17:55:08StefanSalewskiBye...
17:55:11*StefanSalewski quit (Client Quit)
17:56:31*jasoka joined #nim
17:57:30BlaXpiritflaviu, what is the difference new/init?
17:57:53flaviunew creates a reference, init creates a value.
17:58:05BlaXpiritok
18:01:56dts|pokeballflaviu, guess what!
18:02:03flaviuwhat?
18:02:22dts|pokeballi literally just need to fix how im calling one function and Nimbus 1.0 is done!
18:02:44dts|pokeballand i have done the smart thing and decided to just use system compilers for now
18:02:51flaviugreat! After that, I want `.give foo command`
18:03:07*dyu quit (Quit: HNY!)
18:04:29flaviuAlso, here is a trick I learned from Perl: proc shift[T]*(input: var seq[T]): T =; result = input[0]; input.delete(0)
18:04:53dts|pokeballoh the perl shift
18:05:32flaviuyep, it should make your code significantly cleaner.
18:06:04dts|pokeballwhat would i need to be shifting?
18:06:11dts|pokeballoh wait. shift out the :?
18:06:22flaviuyeah, shift the parameters one by one
18:06:40flaviueach time you do irccmd[n], that could be replaced with a shift
18:07:10dts|pokeballoh i didnt see that its popping it
18:09:29dts|pokeballwhat is .give supposed to do?
18:09:32dts|pokeballoh wait
18:09:41dts|pokeballlike this?
18:09:51dts|pokeball,lmgtfy at flaviu nim lang
18:09:51BillsPCflaviu: http://lmgtfy.com/?q=nim+lang
18:10:00flaviuyep
18:10:10dts|pokeballalright
18:10:13dts|pokeballsimple enough
18:19:42*rpag quit (Quit: Leaving)
18:22:22*Var|Mobile joined #nim
18:26:22*Varriount|Mobile quit (Ping timeout: 240 seconds)
18:27:30*nimrod__ joined #nim
18:30:10*nimrod__ quit (Client Quit)
18:34:27*gokr_ quit (Ping timeout: 258 seconds)
18:38:28Araqflaviu: how does your proposal help with the "factory" problem?
18:39:11Araqtying the constructor to the type is the very reason people need to come up with factories
18:41:51flaviuAraq: A constructor to an abstract type would also be valid.
18:42:09flaviuAnd what is a factory besides a constructor for an abstract type?
18:43:25Araqand once we have that ultimate consistent construction in the language (except where we don't due to factories see C#/Java) what is really gained? can I then use the API without knowing anything? should we perhaps also get rid of the other operations and call it "accumulate" or "performAction" everywhere?
18:44:55*petantik joined #nim
18:46:05flaviuThen you stop caring about whether a type is an object or a reference. You can get rid of the newFoo, initFoo business, and simplify the API.
18:46:39flaviuI wouldn't name anything accumulate, I'd name it fold
18:46:41lozwhat is a correct way to return seq of objects from function? i create objects with new() and then add them to result, but after function call i get SIGSEGV: Illegal storage access. on any access to this seq..
18:46:59flaviuloz: Please post your code
18:47:25notfowlloz, seq has to be created with newseq()
18:47:39lozit is, ill post the code, sec
18:48:56gmpreussner_loz: "result = @[]" also works
18:49:21lozgmpreussner_: it says it cannot determine seq type for me
18:49:24lozhttps://gist.github.com/maximvl/0a26bd192b4e0e059c98
18:50:31lozeverything is ok at the end of channels_list, but when i try to echo(len(r)) i get illegal storage access
18:50:43gmpreussner_loz: try moving 'result' out of the var block
18:50:49gmpreussner_result is automatically defined
18:51:01gmpreussner_you might be shadowing it?
18:51:06notfowlloz, there is a result variable already defined but you shadow it by defining another 'result'
18:51:20notfowlloz, that is OK to do but you must now have 'return result'
18:51:49lozgmpreussner_: notfowl yeah, thanks, i'm kinda stupid)
18:52:12gmpreussner_i doubt that's true
18:52:14lozand result = @[] works now
18:52:54notfowlloz, its a bug imo, you either shouldn't be able to shadow result or it should see that you are and use that as the return value
18:53:37Araqyeah, the language should disallow shadowing 'result', I agree. it's such a common gotcha.
18:53:52lozthis 'result' feature is just new to me, have to get used to it
18:54:23notfowlloz, by the way, instead of building a new `members` seq you can simply assign it to c.members and it will be copied
18:55:13loznotfowl: hm, members are seq[JsonNode], i need seq[string]
18:55:18Araqflaviu: that said, your proposal indeed is much better than "new T".
18:55:57notfowlloz, ah i didnt see that
18:56:20flaviuAraq: "new T"? Is that referring to my old idea of overloading new? If so, I have a new proposal related to that too.
18:57:51*dts|pokeball quit (Ping timeout: 244 seconds)
19:00:22*vbtt joined #nim
19:00:42Araqvbtt: you can tell the installer to set the PATH for you
19:01:58vbttAraq: ah i see. maybe I missed that checkbox.
19:03:03vbttaporia fonts are a bit fuzzy on windows. maybe it's a gtk thing.
19:03:45vbttbut overall a good experience out of the box. it's great that aporia is packaged with nim.
19:05:02vbttaporia should have a 'show compiled c code' feature :)
19:05:56*Var|Mobile quit (Ping timeout: 250 seconds)
19:10:56AraqI don't really see why. by that logic you might as well show the assembler code
19:10:57*vbtt quit (Ping timeout: 240 seconds)
19:12:35*gour_ joined #nim
19:14:15flaviuAraq: Your point? People do sometimes look at assembler code.
19:15:27Araqflaviu: my point is that our docs are good enough that you don't have to learn the language by looking at the generated C code
19:15:35Araq(which is messy anyway)
19:15:46flaviuIt's useful when the output c code is buggy
19:16:11flaviuand sometimes it's eaiser to see code than to find and read words
19:16:14*gour quit (Ping timeout: 258 seconds)
19:16:42Araqyou don't have to read words, you only have to look at the examples :P
19:16:52*gour_ is now known as gour
19:18:56*gsingh93 joined #nim
19:27:24*Varriount|Remote joined #nim
19:29:34*Sphax joined #nim
19:29:39BlaXpiritis forward declaration of object types possible?
19:30:38Araqno. but we'll make that possible for 1.0.
19:30:59BlaXpirit:s
19:31:07BlaXpiritthanks
19:31:33Araqyou can work around by using generics, or closures or RootRef
19:31:40BlaXpirituhhhhh
19:31:43Araqdepending on your situation
19:31:44*rpag joined #nim
19:31:57*rpag quit (Remote host closed the connection)
19:32:12BlaXpirittypical situation
19:32:32BlaXpiritwell not really
19:32:42BlaXpiritbasically I could just rearrange the code, but let's just say I can't
19:32:55Araq"typical situation" is that you don't know how to design your modules :P
19:33:02BlaXpiritI simply have usage of the type earlier in code and then declaration of the type
19:33:26Araqoh you can access it in the same type section before it's declared
19:33:37BlaXpiritit is not in the same type section
19:33:51Araqwell then it would better be :P
19:33:56*Sphax quit (Client Quit)
19:34:14BlaXpiriti'll confess. i'm using include
19:34:38*BitPuffin quit (Ping timeout: 258 seconds)
19:36:04Varriount|RemoteBlaXpirit: *gasp*
19:36:34*perturbation joined #nim
19:36:41BlaXpiriti got a great idea of having an autogenerated file and then include it in a manually written file
19:36:56flaviuBlaXpirit: Use macros to do your code generation
19:37:02flaviuyou can use parseStmt
19:37:22BlaXpiritI'm parsing C
19:37:31flaviuah, ok
19:38:06BlaXpirithttp://nim-lang.org/system.html#RootRef thx docs
19:38:51BlaXpiritwell RootObj is explained, whatever.
19:52:25perturbationanyone know how $nim is defined? Currently ungreppable in config files (but I see references to it in nim.cfg)
19:55:17Araqperturbation: commands.nim:239
19:55:57perturbationthanks Araq
20:03:24*BlaXpirit_ joined #nim
20:06:03*BlaXpirit quit (Ping timeout: 244 seconds)
20:10:04*loz quit (Ping timeout: 250 seconds)
20:10:26*loz joined #nim
20:20:43*loz quit (Ping timeout: 272 seconds)
20:23:45jpoirierThe compiler user guide states that my dll/so needs to link against nimrtl.dll/so. What happens if I don't?
20:24:35Araqit crashes or worse
20:27:46jpoirierlol I built my x-plane plugin (just a dll/so and used --define:useRealtimeGC) but didn't link against nimrtl.dll/so and it seemed to run okay. Although I only ran x-plane for about 35 minutes.
20:28:22Araqwell
20:28:39Araqdepending on how you do it, it may indeed end up being fine I think
20:29:18Araqand a run for 35 minutes is usually long enough to show any issues
20:31:33jpoirieryeah, all seemed okay, was looking at getTotalMem/OccupiedMem/FreeMem, but I think I'll do it properly and link against nimrtl in the future.
20:32:42*loz joined #nim
20:33:00AraqI'd prefer if you could submit a test for this instead so we can officially support it
20:37:38jpoirierA test for running a dll/so built using RealTime GC without linking nimrtl?
20:38:41*smeady joined #nim
20:39:03Araqyes
20:39:37*smeady left #nim ("Textual IRC Client: www.textualapp.com")
20:39:51*smeady joined #nim
20:40:20jpoirierK. Will do.
20:40:26*smeady quit (Quit: Textual IRC Client: www.textualapp.com)
20:41:05*gour quit (Quit: Leaving)
20:41:28Araqthanks
20:45:24*saml quit (Quit: Leaving)
20:56:38ldlework:)
21:17:14BlaXpirit_I import a module, and I want names from it to be visible if the importing module is imported
21:18:20BlaXpirit_pls don't tell me this is impossible :/
21:18:23Araq'export'
21:18:55BlaXpirit_export import
21:18:57BlaXpirit_i don't get it
21:19:42BlaXpirit_import m;export m seems to do the trick
21:19:43ldleworkBlaXpirit_: import foobar; export foobar.delegate
21:19:46ldleworkyeah
21:19:52BlaXpirit_thanks
21:20:05ldleworkcould probably have some sort of syntax for that
21:20:07ldleworklike *
21:20:19BlaXpirit_import* seemed so familier
21:20:21BlaXpirit_a
21:20:23ldleworkimport a*, b, c
21:23:04*NimBot joined #nim
21:23:33AraqDelphi lived without 'export' for decades and millions of lines of code have been written successfully in it. Nim copied that module system, improved over it and gets all the blame.
21:24:41BlaXpirit_I don't blame anything, I just can't find information that I need so I ahve to bother people all the time
21:24:52BlaXpirit_I'm not usually like that :|
21:25:10TriplefoxAs long as it's not the python module system i think i can handle it
21:25:25BlaXpirit_it's the best tho
21:26:02TriplefoxThe scoping rules on it drive me nuts
21:26:27AraqBlaXpirit_: it's perfectly fine to bother us with your questions here.
21:27:43Araqand my remark was more directed to ldlework ;-)
21:29:33ldleworkAraq: did you mean "Lived with 'export'" ?
21:30:03Araqldlework: no. Delphi has nothing like that.
21:38:58flaviuldlework: a bit of uglyness brings soul into a language ;)
21:39:51flaviuthat statement isn't sarcastic btw
21:40:52*gsingh93 quit (Quit: Connection closed for inactivity)
21:44:05*loz quit (Quit: Leaving.)
21:44:56ldleworkexport is fine, I was making a micro-suggestion
21:45:08ldleworkI'm here, looking at the channel, might as well emit my thought :)
21:48:00*gsingh93 joined #nim
21:50:34*Varriount|Remote quit (Ping timeout: 246 seconds)
21:51:56Araqldlework: it's not even 'export' alone. the type lookup rules (recursive within a single type section) are the same in Delphi too
21:53:14ldleworkcool
21:53:47Araqlol
21:58:48perturbationflaviu: If that's true, then Mumps has, a um... uncomfortably large amount of soul ;)
21:59:43flaviuhaha
22:00:23flaviuMumps is the one that some hospitals use, right?
22:00:56flaviuyep, lol
22:00:59perturbationyes (also some banks)
22:03:40jpoirierI'm confused about ctypes requirements (not cstring and char*) for wrappers and when casting should/must be used.
22:04:05jpoirierE.g. if a c func is "void myFunc(int a, float b);" can the wrapper just use plain vanilla nim types like "proc myFunc(int a, float b) {.cdecl, importc: "myFunc", dynlib: mylib}
22:04:38flaviuC's int = 16 bits or something
22:04:44flaviuNim's int = size_t
22:04:52*Boscop joined #nim
22:05:23flaviuNim's float is also implementation defined IIRC
22:05:52BlaXpirit_it's defined to be processor's fastest, but always float64 for now -_-
22:08:29*gokr_ joined #nim
22:08:56gokr_Happy new year ninmers!
22:10:09jpoirierOkay, based on the nim-lang/opengl wrapper, as long as the types in the wrapped procedure are equivalent to the ctypes all should be good and no type casting should be required.
22:11:40BlaXpirit_what is the difference in having ref vs ptr as function parameter?
22:13:51perturbationref is managed by GC, ptr you have to manage yourself
22:14:47BlaXpirit_I don't understand what that means for a function parameter
22:17:23*dts|pokeball joined #nim
22:17:25perturbationref is the type that you should be using most of the time (not FFI, etc.)
22:17:51perturbationif you're just calling some function with a ptr parameter then you shouldn't allocate with new (use alloc/alloc0 instead)
22:18:19BlaXpirit_well i see that this guy https://github.com/fowlmouth/nimrod-sfml/blob/master/csfml.nim never uses ref
22:18:31BlaXpirit_(this is FFI obviously)
22:18:54flaviuWhich is why he never uses ref
22:18:59perturbationI've looked at that before - IIRC that's a wrapper for the C SFML bindings
22:20:25perturbationnim-lang.org/manual.html#reference-and-pointer-types has some more information about ref/ptr and the difference between the two
22:22:03BlaXpirit_i've read that
22:22:16dts|pokeballis ref/ptr used the same in nim as it is in c?
22:22:24BlaXpirit_not a single word about function arguments
22:22:29dts|pokeballjust with ref instead of & and ptr instead of *?
22:24:03AraqBlaXpirit_: use 'ptr' for the FFI unless you control object creation
22:24:15Araqwhich means that you can 'new' it
22:24:16BlaXpirit_ok, I don't create object creation
22:24:21Araqthen you can use 'ref'
22:24:21BlaXpirit_this is obvious, okay
22:24:29BlaXpirit_I can't 'new' it
22:24:34*fowlmouth joined #nim
22:24:46BlaXpirit_I have a small inconvenience here
22:24:57BlaXpirit_there is a type that is passed both by value and by pointer in the API
22:25:02BlaXpirit_i think
22:25:09BlaXpirit_so how should I expose it to nim?
22:25:18BlaXpirit_make users use ptr?
22:25:22BlaXpirit_addr rather
22:25:47*zahary2 joined #nim
22:25:54BlaXpirit_I was thinking about adding implicit conversion to pointer if it is possible
22:26:20BlaXpirit_or override with var and addr
22:26:23Araqit is but I don't think it's a good idea
22:26:55TriplefoxI was working with gl apis last night and it felt pretty messy in the user code, but i don't think it needs to be hidden
22:28:03TriplefoxMost of it was just the typechecker inferring a literal as "int" or "float" forcing me to specify more
22:29:27*brson_ joined #nim
22:30:25BlaXpirit_I am still looking for an answer on how to not make users of library use addr
22:32:13perturbationdts: in most cases you don't need to explicitly de-reference (if var a: RefToSomeObj = new(ObjItRefersTo), you can access a.field1 just fine). ref/ptr don't correspond to */&
22:33:02BlaXpirit_perturbation, this doesn't help me
22:33:12BlaXpirit_i have a simple struct type
22:33:22BlaXpirit_and sometimes i want to use a C function that accepts pointer to that type
22:33:30BlaXpirit_const pointer, if that matters
22:33:39*gokr joined #nim
22:33:56dts|pokeballthanks perturbation
22:34:03dts|pokeballhaillo gokr
22:34:20*gokr_ quit (*.net *.split)
22:34:21*brson quit (*.net *.split)
22:34:21*dymk quit (*.net *.split)
22:34:21*zahary1 quit (*.net *.split)
22:34:21*jpoirier quit (*.net *.split)
22:34:25*notfowl quit (*.net *.split)
22:34:25*CARAM__ quit (*.net *.split)
22:34:25*petantik quit (*.net *.split)
22:34:44BlaXpirit_oh wait, i thought...
22:34:44fowlmouthBlaXpirit_, for functions like SDL_PollEvent(SDL_Event *) the nimrod version should be `var Event`
22:34:58BlaXpirit_fowlmouth, ah that's interesting
22:35:18BlaXpirit_fowlmouth, well there are functions like that in CSFML
22:35:49BlaXpirit_and you seem to just use P-types in your examples, so it is not a problem
22:36:36BlaXpirit_ah, it's for non-const pointer
22:36:40fowlmouthBlaXpirit_, var T and ptr T are both "T*" at the c level
22:36:49BlaXpirit_that's good
22:38:42fowlmouthBlaXpirit_, and you can disregard any 'const' when writing a wrapper
22:38:43*jefus_ joined #nim
22:39:07fowlmouthconst char * const is still cstring in nim
22:40:48*jpoirier joined #nim
22:41:14jpoirierNim's built-in "char" is an 8-bit character type (unsigned).
22:42:17*jefus__ quit (Ping timeout: 240 seconds)
22:45:17*BitPuffin joined #nim
22:49:02*petantik joined #nim
22:49:50*dymk joined #nim
22:50:49*CARAM__ joined #nim
22:52:58*Varriount|Mobile joined #nim
22:53:14BlaXpirit_hah, no, if C accepts const pointer, I can't just make that var
22:53:31BlaXpirit_I mean, I can, but it's wrong
22:56:36*jasoka quit (Quit: Page closed)
22:58:12*perturbation quit (Quit: Happy New Year (IRC + drinking don't mix, so I'm out))
23:01:49*jux joined #nim
23:04:46gmpreussner_Araq: happy new year :)
23:09:10*BillsPC quit (Remote host closed the connection)
23:10:02ldleworkI need forward type declarations so bad
23:12:32BlaXpirit_use generics
23:12:34BlaXpirit_:|
23:12:40BlaXpirit_i actually couldn't do that in my case
23:12:57dts|pokeballnim doesnt support that yet ldlework ?
23:14:11*AFKMorpork is now known as AMorpork
23:14:27ldleworkdts|pokeball: no :(
23:14:36ldleworkBlaXpirit_: generics don't help
23:14:38dts|pokeballlame sauce
23:14:53BlaXpirit_ldlework, why not
23:15:04dts|pokeballone day i might learn the rest of nim, but atm it works great for me treating it as a procedural language
23:15:17ldleworkBlaXpirit_: its an issue with two objects needing to refer to each other
23:15:30ldleworklike, as in have references to each other
23:15:36BlaXpirit_ldlework, it all works if they're in the same type block
23:15:41BlaXpirit_and generics can indeed help
23:15:44ldleworkBlaXpirit_: which is terrible for organizing your project
23:15:51BlaXpirit_one object can have a generic reference :|
23:17:48ldleworkI truly don't understand how generics can help
23:18:30ldleworkLets say you have mututal types A and B
23:18:47ldleworkB needs to store different subclasses of A on a field
23:18:58ldleworkgenerics only allow me to initialize B for a specific kind of A
23:19:25BlaXpirit_okay, that's a good explanation
23:19:48*Varriount|Mobile quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com ))
23:20:28ldleworkmaybe typeclasses?
23:20:45BlaXpirit_why don't you just use a single type block
23:21:12ldleworkI'm so fucking close
23:21:18ldleworkI hate the idea tho
23:21:20ldleworktypes.nim
23:21:21ldleworkugh
23:21:31BlaXpirit_include? anyone?
23:21:36*Varriount|Remote joined #nim
23:21:51BlaXpirit_although i'm not even sure how it would work with indentation and it would suck in any case probably
23:21:58ldleworkI mean
23:22:06ldleworkat least if I just throw ALL my types in a single module
23:22:09ldleworkto bypass this issue
23:22:19ldleworkthat wouldn't be terrible to refactor once forward type declarations show up
23:22:24BlaXpirit_ldlework, you can maybe have them in separate files
23:22:30ldlework::chin rubbing intensifies::
23:22:35BlaXpirit_and then
23:22:44BlaXpirit_type; include a; include b; include c
23:22:51BlaXpirit_xD i'm evil
23:23:01ldleworkwell the only thing we care about this at all
23:23:11ldleworkis so that the types are available from the same module that the methods are defined
23:23:20AraqBlaXpirit_: doesn't work, but I'm beginning to like the idea
23:23:31BlaXpirit_Araq, no, it was a stupid idea
23:23:32ldleworkso just spitting up the type definitions for the hell of it doesn't really accomplish anything
23:23:36BlaXpirit_because of methods indeed
23:23:46ldleworksplitting*
23:23:55BlaXpirit_there is nothing to like, because include is evil
23:24:21ldleworkI could just make types.nim a compiler include
23:24:35ldleworkmagic module like consts god I'm gonna need a hot shower after this
23:25:17Araqgmpreussner_: thanks! to you too!
23:32:55*BlaXpirit_ quit (Quit: Quit Konversation)
23:33:11*BlaXpirit joined #nim
23:35:05jpoirierAraq: system.nim has cuchar and cchar both defined as a nim char, "cchar* {.importc: "char", nodecl.} = char" and "cuchar* {.importc: "unsigned char", nodecl.} = char"
23:35:50Araqyeah. I was against all of these.
23:35:59Araqpointless crap.
23:37:53jpoirieraren't they necessary/helpful for C wrappers?
23:38:20fowlmouth<BlaXpirit_> I mean, I can, but it's wrong -- why? nimrod semantics are not c semantics
23:39:16Araqjpoirier: we have char/byte/int8 which is perfectly understandable
23:39:20gokrI think 2015 will be a good Nim year ;)
23:39:29Araqbyte being an alias for uint8
23:39:35Araqwhich also makes perfect sense
23:39:43*dts|pokeball quit (Ping timeout: 264 seconds)
23:39:57Araqcuchar? why bother? that's 'byte' then
23:40:11*gokr_ joined #nim
23:43:42*gokr quit (Ping timeout: 250 seconds)
23:44:13Varriount|RemoteAraq: How do you plan to deal with https://github.com/Araq/Nim/issues/1802 ?
23:46:23AraqVarriount|Remote: what is the problem?
23:47:01Araqproc makeFn(s: string): proc (i: int) {..} {.pragmax.} = ... should do the trick
23:47:16Varriount|RemoteAraq: Syntactic ambiguity. What does the pragma in 'proc foo(): proc bar {.pragma.}' refer to?
23:48:02Araqwe can also change the parsing
23:49:04Araqproc makeFn(s: string): (proc (i: int) {.pragmasHere.}) # when the pragmas belong to the return type
23:49:50AraqI guess that's more intuitive