00:01:20 | gokr | I 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:12 | gokr | I mean, as a Smalltalker I do miss my browsers. |
00:02:32 | * | yglukhov__ joined #nim |
00:02:34 | gokr | Oh 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:00 | Triplefox | the link to the "how to install Nimble README" is outdated nim-lang.org/lib.html |
00:15:09 | Triplefox | * http://nim-lang.org/lib.html |
00:16:28 | dom96 | why the hell is github not redirecting that? |
00:17:37 | jpoirier | Are 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:10 | flaviu | jpoirier: arm seems to work, and I think powerpc worked last time I spun up an emulator |
00:18:21 | dts|pokeball | :D created a .desktop file for aporia |
00:18:35 | flaviu | i386, amd64 clearly should work |
00:19:06 | flaviu | Nim is in the the ports repository for some BSD, I don't remember which, so it should work there. |
00:19:36 | flaviu | Someone made an iphone app and OSX program, so it works there. |
00:19:44 | flaviu | It works on windows, linux |
00:20:02 | jpoirier | ...figured the common ones worked |
00:20:09 | flaviu | http://buildbot.nim-lang.org/grid |
00:20:19 | flaviu | Although that grid doesn't look too good atm |
00:20:58 | dom96 | ppc should also work |
00:21:05 | flaviu | yep, mentioned that |
00:21:06 | jpoirier | nice. who runs the builders? |
00:21:09 | * | Buttons840 joined #nim |
00:21:10 | flaviu | lots of green on the waterfall: http://buildbot.nim-lang.org/waterfall before recent |
00:21:22 | jpoirier | mips? |
00:21:23 | flaviu | jpoirier: The master is run on the Nim VPS |
00:21:32 | flaviu | and the builders are run by volunteers |
00:21:54 | Araq | jpoirier: Varriount_ is responsible for this but unfortunately he's very busy these days |
00:21:59 | dom96 | flaviu: looks like everything is failing to me? |
00:22:00 | flaviu | jpoirier: dunno, my router doesn't have enough memory to compile Nim |
00:22:11 | flaviu | dom96: yep |
00:22:11 | dom96 | oh, before recent |
00:22:41 | flaviu | If you have mips, please report your findings. It'll probably work though. |
00:22:58 | Araq | jpoirier: I think somebody did run it on a mips |
00:23:38 | dts|pokeball | can i run it on a mips emulator? |
00:23:49 | jpoirier | We use mips64 processors (Octeon) running linux at work I could try nim on. |
00:24:37 | dom96 | I think I might have tried it on mips at some point. |
00:24:52 | flaviu | jpoirier: 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:56 | dts|pokeball | dom96, you use ubuntu right? |
00:27:05 | jpoirier | they're mostly proprietary boards (basestations) |
00:27:08 | dom96 | dts|pokeball: only on my chromebook |
00:27:08 | def- | jpoirier: Intel MIC (Xeon Phi) even works |
00:27:23 | dts|pokeball | do you know how to set aporia as the default for nim files? |
00:28:47 | Araq | def-: 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:04 | dom96 | dts|pokeball: Right click nim file -> Properties? I'm not sure but I bet google knows. |
00:29:10 | def- | Araq: oh right, will do |
00:29:12 | Araq | Varriount|Remote: there is work to do |
00:29:12 | * | yglukhov__ joined #nim |
00:29:19 | Varriount|Remote | Araq: ? |
00:29:30 | Araq | the 64bit installer uses mingw32 |
00:29:34 | dom96 | Varriount|Remote: Are you aware that the builds on the buildbot are failing? |
00:29:47 | dts|pokeball | dom96, hmmm i was hoping for all of nim files automatically, but i guess ill try google again |
00:29:56 | Varriount|Remote | Araq: Odd. I thought koch was supposed to take care of that? |
00:30:00 | * | brson quit (Ping timeout: 258 seconds) |
00:30:10 | dom96 | dts|pokeball: Yeah... that's what I meant. |
00:30:13 | Varriount|Remote | dom96: Yes, I've been trying to get multi-codebases working |
00:31:28 | Araq | Varriount|Remote: no, it always passes mingw32 |
00:31:51 | Araq | I thought you don't use it anyway |
00:32:02 | Araq | and so I only made it to work for niminst |
00:32:06 | Varriount|Remote | Araq: Use what? Mingw32? |
00:32:32 | * | lumo_e_ quit (Quit: Leaving) |
00:32:38 | Araq | which always requires some --var:mingw but none in particular |
00:32:55 | Varriount|Remote | Araq: I'll revert the buildbot changes for now, and then work on the installers |
00:33:13 | Araq | Varriount|Remote: installer is more important |
00:33:22 | * | yglukhov__ quit (Ping timeout: 240 seconds) |
00:39:09 | flaviu | Varriount|Remote: Aren't the installers automated? |
00:39:20 | Varriount|Remote | flaviu: Automated in what sense? |
00:39:37 | flaviu | push a button, out come the installers |
00:39:39 | Varriount|Remote | flaviu: If you mean the buildbot has builds for them, no |
00:39:49 | Araq | yeah, that *IS* the question here really |
00:39:56 | flaviu | no, doing it every time would be wasteful |
00:40:26 | flaviu | Varriount|Remote: I can build for windows on linux |
00:40:30 | Triplefox | nimble crashed when i used the current win x64 build, everything works when i reinstalled it with x86 build |
00:40:36 | Triplefox | crashed on install* |
00:40:48 | Varriount|Remote | Triplefox: Nimbe has an x64 build? |
00:40:52 | Varriount|Remote | *Nimble |
00:40:54 | Triplefox | no, nim does |
00:41:08 | Triplefox | but there is some bootstrapping in nimble's installer |
00:41:43 | Varriount|Remote | Triplefox: Yes, and Nimble only has x32 dlls |
00:42:26 | Triplefox | hmm...well then idk how i even had it working previously |
00:53:09 | * | eskatrem quit (Remote host closed the connection) |
00:56:07 | Triplefox | it tells me about open arrays and gives no example of syntax http://nim-lang.org/tut1.html#open-arrays |
00:58:02 | Triplefox | (fortunately it's not hard to guess) |
00:59:56 | Varriount|Remote | https://drive.google.com/file/d/0B077nrrf63xtVWQydEpyZVZ6WW8/view?usp=sharing |
01:00:02 | Varriount|Remote | Araq: ^ |
01:00:04 | Araq | Varriount|Remote: I pushed some update to koch.nim that should help you |
01:00:23 | Araq | it's more obvious now and it uses mingw$bitwidth |
01:00:24 | Varriount|Remote | Araq: Which would be nice... If I wasn't using the release revisions. |
01:00:38 | Araq | ok |
01:00:43 | Araq | yeah ... |
01:00:49 | Varriount|Remote | Araq: I appreciate the change though, thanks. |
01:00:55 | Araq | but next release will come and koch will be ready |
01:01:07 | * | wrl left #nim (#nim) |
01:01:32 | Araq | but beware that it uses the bitwidth that koch itself has been compiled with |
01:01:45 | dts|pokeball | where do i report aporia crashes? on the repo as an issue? |
01:02:02 | Varriount|Remote | Araq: I wouldn't expect anything different. |
01:02:09 | Varriount|Remote | dts|pokeball: Yes |
01:02:13 | dts|pokeball | ok |
01:02:18 | dts|pokeball | think i might have found a bug |
01:02:20 | Araq | Varriount|Remote: did you test it? |
01:02:36 | Araq | dts|pokeball: crash sounds like a bug |
01:02:37 | flaviu | Varriount|Remote: What does the installer do besides extract the files? |
01:02:42 | Varriount|Remote | Araq: I'm on a slow internet connect |
01:02:54 | Varriount|Remote | flaviu: Download stuff |
01:03:25 | flaviu | can you be more specific? I don't have windows, and windows doesn't have strace anyway. |
01:04:00 | Varriount|Remote | Araq: I manually changed the mingw url in the ini file, and I tested that the URL leads to a downloadable resource |
01:04:11 | Varriount|Remote | flaviu: Uh... What? |
01:04:22 | flaviu | What stuff does it download? |
01:04:48 | Varriount|Remote | flaviu: It uses http to download optional components - aporia, mingw32/mingw64, etc |
01:05:01 | flaviu | ah, I see. Thanks! |
01:05:43 | Varriount|Remote | flaviu: http://technet.microsoft.com/en-us/sysinternals/bb897437 |
01:06:14 | flaviu | It's more limited than strace, but I suppose it's good enough for 90% of network strace usage. |
01:06:22 | Varriount|Remote | That will work for TCP/UDP connections. You can also use process monitor (located on the same site) to get strace-like functionality |
01:08:24 | flaviu | You said you use a customized version of mingw32/mingw64. Can you elaborate on that too? |
01:10:19 | Varriount|Remote | flaviu: I downloaded 32 and 64 bit versions of Mingw-w64, and ran the trimcc utility in the tools directory |
01:11:02 | Varriount|Remote | flaviu: 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:09 | flaviu | trimcc? |
01:11:19 | flaviu | oh, it's a nim tool |
01:11:25 | Varriount|Remote | Yep. |
01:12:41 | flaviu | You use the pthreads version of mingw? |
01:13:18 | * | Guest22806 is now known as adam12 |
01:13:21 | * | yglukhov__ joined #nim |
01:14:23 | Varriount|Remote | flaviu: I can't remember... I think I use the win32 thread version |
01:15:02 | Varriount|Remote | flaviu: Anyway, there's no need to generate another compiler distribution, it's already hosted on the website |
01:15:12 | flaviu | I want to automate it fully |
01:15:46 | Varriount|Remote | flaviu: It's the dwarf exception version, using pthreads ( I think) |
01:16:06 | Varriount|Remote | flaviu: That's looking at the files in the distribution's binary directory |
01:16:14 | flaviu | ok |
01:17:17 | flaviu | Well, I can't run trimcc on linux. Is it really necessary? Is it sill needed after Nim has been built? |
01:17:54 | Varriount|Remote | flaviu: No. It is only needed if the mingw-w64 compiler distribution needs updating |
01:18:05 | * | yglukhov__ quit (Ping timeout: 264 seconds) |
01:18:20 | flaviu | Oh, great! |
01:18:30 | Varriount|Remote | flaviu: I was trying to tell you that. |
01:18:45 | Araq | Varriount|Remote: well I tested it and uploaded |
01:18:58 | Araq | checked my environment vars as well |
01:19:19 | Araq | though it actually looks weird |
01:19:37 | Araq | I don't have my local nim in my path |
01:20:02 | Araq | but that has nothing to do with the installer, so it's fine |
01:20:13 | flaviu | Varriount|Remote: I don't have windows, are aporia and mingw the only optional components? |
01:20:54 | Varriount|Remote | flaviu: Documentation |
01:21:06 | * | Trustable quit (Quit: Leaving) |
01:22:44 | EXetoC | are all those .c, .asm and .h files in 'wrappers' used? |
01:22:55 | Varriount|Remote | gmpreussner: For some reason, your arm6 slave's login info is incorrect. It's been trying connect to the server for a while |
01:23:35 | EXetoC | and nimcache was included. oops |
01:23:38 | flaviu | Varriount|Remote: I had him use my password, it worked for a while. |
01:23:48 | flaviu | I guess you gave him his own password? |
01:24:18 | Varriount|Remote | flaviu: Yeah |
01:24:28 | * | ARCADIVS joined #nim |
01:24:45 | Varriount|Remote | flaviu, gmpreussner: I accidentally forgot to edit the password index for the new builder |
01:25:21 | Varriount|Remote | that'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:05 | Araq | I guess these discussions should be in #nimbuild |
01:26:48 | Araq | Varriount|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:45 | onionhammer | http://www.reddit.com/r/nim/comments/2qvgc7/_/ |
01:55:01 | def- | onionhammer: your post? |
01:57:58 | def- | 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:31 | def- | 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:50 | dts|pokeball | i was thinking of writing an intro tut for nim when i had some time |
02:13:48 | * | superfunc joined #nim |
02:13:57 | def- | dts|pokeball: Yes, sounds like we need more of those: https://news.ycombinator.com/item?id=8815965 |
02:14:21 | EXetoC | aur/nimrod-git -> aur/nim-git |
02:14:39 | dts|pokeball | onionhammer, is that your blog post? |
02:15:21 | dts|pokeball | >Learning the syntax/features of the language should be part of documentation, not a tutorial. |
02:15:25 | dts|pokeball | this noob |
02:20:20 | dts|pokeball | i might create an hn account to actually correct this guy |
02:21:48 | Triplefox | it's not worth it |
02:22:37 | dts|pokeball | anyways, 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:56 | Varriount|Remote | Triplefox: Aww, but I've already gotten out the pitchforks and torches... |
02:23:31 | Triplefox | right 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:28 | dts|pokeball | ffi's :D |
02:25:06 | Triplefox | actually, following up on a problem with the example sdl2 audio callback program |
02:25:11 | dts|pokeball | nim ffis are the one thing i regret not learning yet. |
02:25:24 | Triplefox | it assumed that the size of the stream buffer you request = the size you actually get |
02:27:02 | Varriount|Remote | dts|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:07 | Triplefox | it 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:01 | dts|pokeball | Varriount|Remote, im sure. i just havent gotten around to it yet. my c is also extremely rusty :/ |
02:28:28 | Varriount|Remote | Triplefox: unsafeNew(sizeof(int)*n)? |
02:29:43 | Triplefox | i found {.unchecked.} and it seems to be doing what i want...except i'm getting an artifact in the resulting sound |
02:30:30 | Varriount|Remote | dts|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:35 | Varriount|Remote | There 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:57 | Triplefox | okay, 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:50 | onionhammer | dts|pokeball yeah |
02:40:29 | onionhammer | def- its month.day |
02:40:35 | Triplefox | error 1: i was looping with an off-by-one (but that didn't fix the main thing) |
02:40:57 | def- | onionhammer: should be 12/29/14 then I think |
02:41:21 | * | superfunc quit (Ping timeout: 244 seconds) |
02:44:41 | onionhammer | def- its a stylistic choice :p |
02:45:11 | Triplefox | error 2: i was clearing the stream buffer wrong...and now it's fine, yay |
02:48:22 | Varriount|Remote | Triplefox: This is for the SDL wrapper? |
02:48:26 | Triplefox | yeah |
02:48:35 | Triplefox | sdl2, specifically |
02:49:30 | Triplefox | it's just an example, but it was wrong on my machine |
02:52:19 | Triplefox | this 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:38 | dts|pokeball | yay! fix aporia! |
02:54:45 | dts|pokeball | gonna 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:33 | dts|pokeball | hey 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:19 | flaviu | dts|pokeball: Post it on github |
04:37:06 | dts|pokeball | ok |
04:43:19 | * | ARCADIVS quit (Quit: ARCADIVS) |
04:51:02 | * | yglukhov__ joined #nim |
04:55:54 | * | yglukhov__ quit (Ping timeout: 264 seconds) |
04:56:41 | dts|pokeball | is it possible to call python code from nim? |
04:59:40 | notfowl | dts|pokeball, there is a C api |
04:59:55 | dts|pokeball | yeah :/ but github doesnt have a c api |
04:59:57 | notfowl | and wra[[er for it |
05:00:34 | dts|pokeball | ok, new question. how good are you at sending raw HTTP requests notfowl ? |
05:00:35 | notfowl | dts|pokeball, what about libgit? |
05:00:43 | dts|pokeball | like do you unders... theres a libgit? |
05:00:46 | dts|pokeball | thank god |
05:01:32 | notfowl | dunno dts i purposefully stay away from web development |
05:02:02 | dts|pokeball | damn :/ im trying to create a gist of the output if its longer than 3 lines but i guess thats not easy |
05:02:32 | notfowl | i use the rubygem jist for that |
05:21:11 | * | Guest76716 joined #nim |
05:26:07 | * | Guest76716 quit (Quit: Leaving) |
05:32:51 | jpoirier | 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:15 | notfowl | jpoirier, if the package has a binary it will compile it and link it in .nimble/bin |
06:39:23 | notfowl | good 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:47 | dts|pokeball | night 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:33 | BlaXpirit | notfowl (if you are not not fowl), why is there no license in nimrod-sfml? |
07:59:41 | dts|pokeball | it would just inherit sfml's wouldnt it? |
08:00:09 | BlaXpirit | i 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:55 | loz | hi, did anybody have problem with httpclient requesting url with get parameters? |
09:08:06 | ldlework | :3 is there no generalized 'in' for arrays and sequences? |
09:10:11 | ldlework | oh nm |
09:10:36 | ldlework | hmm the documentation should inform me of pretty much everything I can do with a sequence or array |
09:11:09 | ldlework | I guess you just go to the docs for system.nim for that |
09:11:56 | gmpreussner_ | i agree, it should be in the online docs |
09:12:20 | Araq | loz: I don't even know if httpclient is not deprecated with this whole new async stuff |
09:12:47 | gmpreussner_ | Araq: zah checked in some static[T] fixes. looking pretty good so far - haven't found any issues yet :) |
09:13:51 | Araq | see you later |
09:14:21 | loz | Araq: 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:06 | BlaXpirit | "async stuff" has almost become the official name for the... async stuff |
09:48:35 | Triplefox | i approve of this marketing term |
09:48:56 | Triplefox | Nim's New Async Stuff: You Won't Believe What Happens Next |
09:49:31 | loz | how can i ran tests in module, placed after isMainModule? |
09:51:54 | loz | hm, 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:07 | gmpreussner_ | loz: yes. and there is also the 'unittest' module that has some macros to make everything look nicer and print pretty output. |
10:05:13 | loz | gmpreussner_: i see, thanks |
10:06:31 | gmpreussner_ | 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:54 | gmpreussner_ | and then i have a separate build target that includes all the test files |
10:07:35 | gmpreussner_ | this way you don't have to parse (and possibly compile) all the tests if you merely want to build your project |
10:10:18 | loz | hm, doesn't when isMainModele help with skipping tests on compiling? |
10:14:40 | BlaXpirit | loz, that can be used if you write tests in the same file |
10:23:10 | gmpreussner_ | yeah, it won't compile, but still needs to be parsed |
10:23:24 | gmpreussner_ | 5:22 am here... time for some sleep. gnite :) |
10:34:57 | novist | does nim support coroutines? (in a way like fibers on windows) |
10:36:13 | BlaXpirit | novist, iterators |
10:36:20 | BlaXpirit | are exactly coroutines |
10:36:48 | novist | is stack properly preserved? because in say python somehow its not |
10:38:43 | * | jefus__ joined #nim |
10:39:17 | BlaXpirit | i don't know what you mean |
10:39:25 | BlaXpirit | but there are even 2 different kinds of those things |
10:39:45 | BlaXpirit | coroutines in Python are flawless FYI :p |
10:42:01 | novist | i 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:24 | Triplefox | colored cube field (in nim and gl) https://vine.co/v/OwpBVAVzBjK |
10:42:34 | novist | then i figured maybe thats what is fixed by stackless, otherwise it could easily have been simple python module instead of fork |
10:42:37 | BlaXpirit | novist, nope, you made a mistake somewhere |
10:42:42 | * | jefus_ quit (Ping timeout: 264 seconds) |
10:44:02 | novist | hmm okay.. weird. ^_^ |
10:44:15 | novist | can i pop one item from iterator in nim then? |
10:44:41 | BlaXpirit | closure iterator, yes |
10:44:43 | novist | ah actually manual has just an example i need |
10:45:30 | BlaXpirit | there are so many gotchas in these iterators if you're coming from python |
10:45:55 | novist | actually im looking for something that would fit windows fibers |
10:46:25 | novist | they pretty much are coroutines, do stack switching in user-land |
10:46:57 | * | Matthias247 joined #nim |
10:50:26 | novist | lib/nim/system.nim(2445, 21) Error: redefinition of 'fileHandle' |
10:50:32 | novist | i 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:10 | novist | who would tell me whats the secret to converting integer to string? |
11:33:27 | BlaXpirit | $ |
11:33:33 | BlaXpirit | $5 == '5' |
11:33:47 | novist | weird! but thanks! :) |
11:33:57 | * | milosn joined #nim |
11:34:09 | BlaXpirit | wait.. single quotes is not correct :| |
11:34:22 | BlaXpirit | but yeah, $ will convert anything to string |
11:34:56 | novist | thats great. looks like i could get nim to do what i failed in python. |
11:35:18 | novist | so i suppose closure iterators cant yield a value by design? because it errors |
11:35:32 | novist | coro.nim(12, 8) Error: current routine cannot return an expression |
11:35:56 | BlaXpirit | are u using return or what |
11:36:00 | BlaXpirit | it's supposed to be yield |
11:36:05 | novist | yield 1000 |
11:36:09 | BlaXpirit | show code |
11:36:26 | novist | https://paste2box.com/6/#/BpnWGQ/PGPeYaywuU-XOupGVUkqwf0ud-5PVV1v94loRm894IY/vG5X9Jc5.txt |
11:36:47 | * | filcuc joined #nim |
11:37:05 | BlaXpirit | hmmm |
11:37:07 | novist | that 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:18 | novist | and runTasks would handle that sleeping |
11:37:23 | novist | thats my plan heh |
11:38:43 | BlaXpirit | i 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:26 | def- | novist: iterator a1(ticker: int): int {.closure.} = |
11:39:30 | * | filcuc_ is now known as filcuc |
11:39:35 | gokr | return types missing |
11:39:48 | novist | /facepalm |
11:39:54 | * | filcuc is now known as filcuc_ |
11:40:26 | * | filcuc_ is now known as filcuc |
11:40:57 | BlaXpirit | type Task is not even close to reality |
11:41:02 | def- | a2 should also yield an int |
11:41:09 | def- | and type Task = iterator (ticker: int): int |
11:41:17 | novist | yeah 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:17 | minciue | is there any way to make the contents of a reference object immutable in nim? |
12:12:12 | * | vbtt joined #nim |
12:12:15 | vbtt | hello |
12:12:41 | vbtt | stupid 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:38 | Araq | some macro wizard should help this guy: http://forum.nim-lang.org/t/692 |
13:13:55 | * | vbtt joined #nim |
13:15:05 | BlaXpirit | I don't understand what can be done with QML alone |
13:16:26 | Araq | vbtt: in $nim/dist |
13:17:22 | * | vbtt_ joined #nim |
13:17:46 | filcuc | hi |
13:17:52 | filcuc | Araq: i'm that guy :) |
13:18:12 | * | vbtt quit (Ping timeout: 258 seconds) |
13:18:20 | Araq | oh hi filcuc |
13:18:39 | Araq | what you want works pretty much the way you described it |
13:19:57 | Araq | I'm not a fan of global .compileTime tables though. (these will bite us soon enough when we get symbolfiles to work) |
13:21:40 | filcuc | ah ok |
13:21:45 | filcuc | so i can be doable |
13:21:49 | filcuc | so it can |
13:24:35 | filcuc | another 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:11 | filcuc | i mean something like this one http://nim-by-example.github.io/oop_macro/ |
13:25:53 | filcuc | if i use that syntax i can generate a custom "create" method |
13:26:03 | * | vbtt joined #nim |
13:26:16 | filcuc | and so basically generating all the stuff i wanted to remove from the example |
13:26:31 | filcuc | however this impose a different syntax |
13:26:59 | * | gokr quit (Quit: Leaving.) |
13:28:52 | Araq | filcuc: I'm not telling you what to do. I only said "I'm not a fan". |
13:30:24 | filcuc | i know but given that you're the creator of the language your opinion (for me) is important |
13:31:03 | filcuc | from my message however there're lots of open points. First how to get the type of an object at runtime |
13:31:25 | filcuc | some sort of RTTI |
13:31:50 | Araq | typeinfo.nim has RTTI |
13:35:51 | filcuc | Araq: is there an order of evaluation of statement in the global scope? |
13:36:24 | Araq | depends on what you mean |
13:37:03 | filcuc | because i'll need to put somewhere the globalSlotTable["myObject"] = |
13:37:23 | filcuc | so the statement where i insert the information i need in the global table |
13:37:44 | Araq | just do it in a top level statement |
13:38:03 | filcuc | so in the global scope |
13:38:14 | Araq | yes |
13:38:16 | filcuc | right? |
13:39:07 | filcuc | ok given this and a main proc which is the order of execution? |
13:39:26 | Araq | the main proc gets called when you invoke i |
13:39:34 | Araq | *it |
13:39:53 | Araq | there is no question here as there is no concept of a "main proc" |
13:40:08 | Araq | you call it explicitly, the order it clear this way |
13:41:01 | filcuc | ok 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:10 | filcuc | unpredictable? |
13:41:32 | Araq | what you imported first |
13:41:50 | filcuc | ah ok |
13:42:11 | * | Araq should write a test to ensure that ... |
13:43:38 | filcuc | so 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:44 | filcuc | correct? |
13:44:56 | Araq | correct |
13:45:58 | * | BitPuffin joined #nim |
13:46:48 | filcuc | ok talking about the "property" macro i wrote in the message forum, is it doable? |
13:47:02 | filcuc | i mean a macro that takes an arguments and also open a block |
13:47:27 | filcuc | property("name"): |
13:50:39 | def- | filcuc: sure, macro(x: string, y: stmt): stmt = ... |
13:51:07 | filcuc | def-: thank you |
13:52:18 | filcuc | ok so i think i've most all the bits for starting to implement this custom syntax |
13:52:39 | def- | nice. I've only skimmed the forum post, but looks interesting |
13:53:49 | filcuc | def-: help is wellcome :) with help i mean suggestion on the syntax or advices |
13:54:46 | filcuc | one 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:24 | def- | you need to get the supertype or check whether it's of a specific type? |
13:56:02 | filcuc | i've to get the supertype as string |
13:56:18 | filcuc | because i've to do some things at runtime |
13:56:19 | def- | I'll try to do that |
13:56:56 | filcuc | basically given an QObject derived class |
13:57:04 | filcuc | given a subclass instance |
13:57:13 | filcuc | i must get its type |
13:57:34 | filcuc | and than extract the slots and signals from the global table |
13:57:52 | filcuc | the global table have the object type name as key |
13:58:15 | filcuc | so for example if MyQObject is a subtype of QObject |
13:58:37 | filcuc | in the globalSlotTable[ |
13:58:52 | filcuc | in the globalSlotTable there'll be some records for MyQObject |
13:59:00 | filcuc | globalSlotTable["MyQObject"] |
13:59:36 | filcuc | if you look at the post on the forum |
13:59:54 | filcuc | i'm talking about the implementation of the "create" method of the QObject base class |
14:00:03 | filcuc | that must call the register methods |
14:00:04 | vbtt | Araq: 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:02 | novist | compiling 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:03 | def- | filcuc: hm, i guess you can't switch to object variants, would be easy with them |
14:03:59 | def- | novist: proc start(this: var Scheduler, task: TaskFn) = |
14:04:25 | novist | what does var in proc definition mean? cant find it anywhere in docs |
14:04:35 | * | vbtt quit (Ping timeout: 258 seconds) |
14:04:35 | def- | it means that you can modify the value |
14:04:44 | def- | otherwise passed parameters are immutable |
14:04:57 | novist | oh i see, thank you |
14:05:13 | novist | const by default i like |
14:05:36 | filcuc | def-: i didn't get it :| |
14:06:15 | def- | 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:32 | def- | and you might want object hierarchies anyway |
14:06:39 | def- | I didn't find a solution for object hierarchies yet |
14:07:53 | * | gokr_ joined #nim |
14:09:48 | filcuc | def-: 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:09 | def- | filcuc: import typetraits, then you can at least use name() to get the string of a type |
14:10:42 | filcuc | ok thank you |
14:12:34 | filcuc | brb |
14:15:32 | * | filcuc quit (Quit: Konversation terminated!) |
14:17:12 | novist | can i safely delete things from seq while iterating (for loop)? |
14:17:35 | def- | novist: no |
14:19:23 | novist | is there some idiom to aid this situation maybe? just restarting loop until nothing is deleted is like worst thing |
14:19:54 | def- | ehm, i think I had something for this |
14:23:11 | def- | delete seems to work in a for loop, but I'm not sure |
14:23:33 | novist | or i could make new seq and store indexes to be deleted |
14:23:55 | novist | but 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:48 | novist | why 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:46 | def- | novist: for index, value in mySeq: ... |
14:51:09 | novist | ohh. thanks (once again) |
14:51:47 | def- | i'm not sure about the other error |
14:51:55 | novist | hey nooo, "for i, task in this.tasks:" still yields same error |
14:51:56 | def- | I'd need the full code |
14:52:04 | def- | nono, that was for your first question |
14:52:15 | def- | 15:23 < novist> but then i need something like enumerate() in python to get current index. is that available? |
14:52:30 | novist | ah kk. well full code is this. see run() proc https://paste2box.com/6/#/A5nWGQ/t8ZiAritCNBcNnyZMFOZ-fvv_pBrwR64SpeNf4vsPzM/C1MxCeKJ.txt |
14:52:40 | novist | fk sec |
14:52:44 | def- | doesn't look like the code :P |
14:52:59 | novist | https://paste2box.com/6/#/ApnWGQ/mEbbaYhqj5THqJZYRx3f99aPpZSiaxgllk0tGG1mZu8/f0i3E0he.txt |
14:53:04 | novist | at times clipboard does not obey :| |
14:53:13 | dv- | Error: unhandled exception: value out of range: 800 [RangeError], the 800 is the value that's out of range? |
14:53:57 | novist | that what i would assume (though i dont know for a fact) |
14:54:48 | dv- | 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:51 | def- | 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:32 | novist | thats odd. guess we have a feature request heh |
15:05:25 | * | gokr_ joined #nim |
15:07:00 | def- | you could just write your own iterator to work like that |
15:07:57 | * | gokr quit (Ping timeout: 240 seconds) |
15:09:11 | dv- | oh i get it, nim infered a bool type because i was and'ing it |
15:10:25 | notfowl | BlaXpirit, 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:57 | BlaXpirit | notfowl, I can consider whatever I want |
15:11:04 | BlaXpirit | but |
15:11:06 | BlaXpirit | http://choosealicense.com/no-license/ |
15:11:32 | * | kapil__ quit (Quit: Connection closed for inactivity) |
15:13:22 | notfowl | BlaXpirit, according to the .babel file its MIT |
15:14:37 | BlaXpirit | hm I haven't considered THAT |
15:14:52 | BlaXpirit | still may be better to have a LICENSE file |
15:14:56 | BlaXpirit | whatever |
15:15:47 | BlaXpirit | notfowl, do you think there is any point of having the T-types when P-types are present? (in context of nimrod-sfml) |
15:16:01 | notfowl | i'll never remember to add a license file to it |
15:16:41 | notfowl | BlaXpirit, no, they dont need to both exist |
15:16:47 | BlaXpirit | i was thinking of at least removing the P from types |
15:17:01 | BlaXpirit | i'm also in the process of autogenerating an API from c header files |
15:18:35 | notfowl | BlaXpirit, i'd rather not make superfluous changes like to remove T/P |
15:18:58 | BlaXpirit | notfowl, you mean you're planning to never remove T/P in your library? |
15:19:04 | notfowl | right |
15:19:11 | notfowl | changing old code is not fun |
15:19:13 | BlaXpirit | :/ |
15:19:36 | BlaXpirit | i'm just gonna make a new one then |
15:19:50 | notfowl | BlaXpirit, if you're working on a wrapper for 2.2 you can do it and we'll tag the old release |
15:20:09 | BlaXpirit | notfowl, 2.2 is actually not even available yet |
15:20:13 | BlaXpirit | because there is no CSFML 2.2 |
15:20:40 | BlaXpirit | and i had to downgrade SFML to 2.1 to even have CSFML work |
15:21:02 | notfowl | you mean its not available for your platform? |
15:21:15 | BlaXpirit | no |
15:21:25 | BlaXpirit | CSFML hasn't been updated at all as far as i see |
15:21:43 | * | darkf_ joined #nim |
15:21:45 | notfowl | last time on nov 22 |
15:21:53 | BlaXpirit | no 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:48 | notfowl | BlaXpirit, it doesnt look like a lot was added in 2.2 http://www.sfml-dev.org/changelog.php#sfml-2.2 |
15:27:06 | BlaXpirit | notfowl, ok |
15:27:18 | notfowl | did you try to compile csfml or install a package for it? |
15:27:52 | BlaXpirit | notfowl, I didn't try to compile csfml |
15:28:04 | BlaXpirit | what's the point, anyway |
15:28:15 | BlaXpirit | if it's gonna look exactly the same to me |
15:28:33 | BlaXpirit | API-wise |
15:28:37 | notfowl | i think it should work with the newer SFML |
15:28:44 | BlaXpirit | yes, it might |
15:29:23 | BlaXpirit | but again, it makes no difference for what I'm doing |
15:30:58 | * | yglukhov__ joined #nim |
15:31:35 | notfowl | if you want to remove T/P i'll accept the PR |
15:32:00 | notfowl | i dont recommend waiting for me to do it though because its super low priority |
15:32:09 | notfowl | bbl, working |
15:32:52 | BlaXpirit | bye |
15:35:14 | loz | can i somehow specify default value with table type? params = var initTable[string,string]() says type expected |
15:36:15 | def- | params = initTable[string,string]() |
15:37:54 | loz | def-: so it can't be var? |
15:39:19 | def- | 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:26 | flaviu | loz: What are you expecting that `var` to do? |
15:39:30 | * | gour quit (Remote host closed the connection) |
15:40:11 | loz | well, i want to add some values to this table |
15:40:14 | def- | var myDefaultTable = initTable[string, string]() |
15:40:14 | def- | proc foo(params: var Table[string,string] = myDefaultTable) = |
15:40:23 | * | Trustable quit (Remote host closed the connection) |
15:40:46 | flaviu | The var goes before the declaration, you can add elements to the table if you move it there |
15:41:04 | loz | but it will be same for all foo calls? |
15:41:06 | flaviu | .eval var params = initTable[string,string]();params["asd"] = "sada" |
15:41:10 | Mimbus | flaviu: eval.nim(3, 13) Error: undeclared identifier: 'initTable' |
15:41:36 | flaviu | Good point, I'm not really sure |
15:41:42 | flaviu | .eval import tables;var params = initTable[string,string]();params["asd"] = "sada" |
15:41:46 | Mimbus | flaviu: <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:14 | novist | hey 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:25 | def- | novist: discard """multiline-comment here""" |
15:54:43 | def- | http://nim-lang.org/tut1.html#comments |
15:55:06 | novist | was relying on manual for this one. so verbose.. |
15:56:02 | novist | and i think i found bug in coroutines heh |
15:56:36 | novist | maybe 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:09 | novist | they 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:21 | def- | novist: that's weird |
16:25:44 | * | Ven joined #nim |
16:26:13 | def- | novist: without the sort it's ok |
16:27:51 | novist | yeah, i think its because iterators get swapped when executing |
16:27:55 | novist | still should not matter |
16:28:05 | def- | yep, looks like a bug to me |
16:28:55 | novist | i better get my ass to github then hehe |
16:30:28 | def- | hm, if i just swap the tasks, it seems fine |
16:33:02 | def- | novist: ok, it's the shallowCopy in merge() of sort() |
16:33:22 | def- | 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:45 | novist | uh this is confusing. still qualifies like a bug right? |
16:36:09 | Varriount|Mobile | Probably |
16:36:14 | def- | yes, this should work in my opinion |
16:36:30 | def- | i think shallowCopy with closure iterators is broken |
16:37:12 | Varriount|Mobile | def-: How ? |
16:41:09 | def- | Varriount|Mobile: in this example sort is using shallowCopy, if you make it memcopy instead, it works |
16:44:45 | novist | well 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:53 | def- | I'll make a minimal example |
16:47:52 | def- | oh, or maybe this is one of the cases where you have to encapsulate the iterators once more |
16:48:22 | novist | huh? they already are contained in Task object |
16:49:34 | def- | nope, it's ok |
16:49:41 | def- | just misremembered from implementing iterutils |
16:52:29 | def- | My minimal example: https://gist.github.com/def-/177290281185d8dd9358 |
16:53:35 | novist | great thanks, ill post that |
16:53:38 | loz | why did $ stop work after i changed my type from object to ref object? |
16:53:49 | def- | loz: probably $myObj[] |
16:54:15 | loz | def-: what is this?) |
16:54:53 | Varriount|Mobile | loz: [] is the dereference operator |
16:55:18 | loz | mm i have seq of my objects |
16:55:39 | Varriount|Mobile | It'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:33 | loz | well, actual error is Error: type mismatch: got (SlackChannel) |
16:57:33 | loz | but expected one of: ... |
16:57:33 | loz | $.$(x: seq[SlackChannel]): string |
16:58:48 | novist | def- could you review? https://github.com/Araq/Nim/issues/1803 |
16:58:54 | novist | i hope i got expected output right |
17:00:57 | * | vbtt joined #nim |
17:01:23 | def- | I would expect a1 10; a1 9 |
17:02:02 | novist | right 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:54 | novist | so 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:15 | def- | proc newObj(x: int): MyObj = ... |
17:23:43 | * | Ven joined #nim |
17:23:44 | Varriount|Mobile | novist: Technically, there's no such thing |
17:24:09 | Varriount|Mobile | You just have procedures that create objects |
17:28:08 | * | dymk quit (Ping timeout: 258 seconds) |
17:28:15 | * | dymk joined #nim |
17:29:12 | novist | thats kind of lame.. |
17:29:45 | novist | one can use makeObj(), another newObj(), another createObj().. |
17:30:07 | novist | if 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:17 | Varriount|Mobile | novist: Bring it up on the forum, or with araq |
17:34:06 | Varriount|Mobile | novist: I won't say that I totally disagree with your sentiment.... |
17:36:54 | novist | i will bring it up when man gets around. |
17:38:02 | * | dts|pokeball joined #nim |
17:39:21 | BlaXpirit | i've seen at least new, create, init |
17:39:22 | BlaXpirit | this bothers me |
17:40:35 | * | dts|pokeball quit (Read error: Connection reset by peer) |
17:41:02 | flaviu | new, init are the conventions |
17:41:09 | flaviu | I don't like it either though |
17:41:30 | flaviu | I have my own proposal: https://github.com/Araq/Nim/issues/1693 |
17:41:37 | * | dts|pokeball joined #nim |
17:42:09 | flaviu | I 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:41 | StefanSalewski | I have finally uploaded latest pango.nim: https://github.com/StefanSalewski/nim-pango |
17:54:51 | StefanSalewski | Now 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:01 | StefanSalewski | so 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:08 | StefanSalewski | Bye... |
17:55:11 | * | StefanSalewski quit (Client Quit) |
17:56:31 | * | jasoka joined #nim |
17:57:30 | BlaXpirit | flaviu, what is the difference new/init? |
17:57:53 | flaviu | new creates a reference, init creates a value. |
17:58:05 | BlaXpirit | ok |
18:01:56 | dts|pokeball | flaviu, guess what! |
18:02:03 | flaviu | what? |
18:02:22 | dts|pokeball | i literally just need to fix how im calling one function and Nimbus 1.0 is done! |
18:02:44 | dts|pokeball | and i have done the smart thing and decided to just use system compilers for now |
18:02:51 | flaviu | great! After that, I want `.give foo command` |
18:03:07 | * | dyu quit (Quit: HNY!) |
18:04:29 | flaviu | Also, here is a trick I learned from Perl: proc shift[T]*(input: var seq[T]): T =; result = input[0]; input.delete(0) |
18:04:53 | dts|pokeball | oh the perl shift |
18:05:32 | flaviu | yep, it should make your code significantly cleaner. |
18:06:04 | dts|pokeball | what would i need to be shifting? |
18:06:11 | dts|pokeball | oh wait. shift out the :? |
18:06:22 | flaviu | yeah, shift the parameters one by one |
18:06:40 | flaviu | each time you do irccmd[n], that could be replaced with a shift |
18:07:10 | dts|pokeball | oh i didnt see that its popping it |
18:09:29 | dts|pokeball | what is .give supposed to do? |
18:09:32 | dts|pokeball | oh wait |
18:09:41 | dts|pokeball | like this? |
18:09:51 | dts|pokeball | ,lmgtfy at flaviu nim lang |
18:09:51 | BillsPC | flaviu: http://lmgtfy.com/?q=nim+lang |
18:10:00 | flaviu | yep |
18:10:10 | dts|pokeball | alright |
18:10:13 | dts|pokeball | simple 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:28 | Araq | flaviu: how does your proposal help with the "factory" problem? |
18:39:11 | Araq | tying the constructor to the type is the very reason people need to come up with factories |
18:41:51 | flaviu | Araq: A constructor to an abstract type would also be valid. |
18:42:09 | flaviu | And what is a factory besides a constructor for an abstract type? |
18:43:25 | Araq | and 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:05 | flaviu | Then 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:39 | flaviu | I wouldn't name anything accumulate, I'd name it fold |
18:46:41 | loz | what 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:59 | flaviu | loz: Please post your code |
18:47:25 | notfowl | loz, seq has to be created with newseq() |
18:47:39 | loz | it is, ill post the code, sec |
18:48:56 | gmpreussner_ | loz: "result = @[]" also works |
18:49:21 | loz | gmpreussner_: it says it cannot determine seq type for me |
18:49:24 | loz | https://gist.github.com/maximvl/0a26bd192b4e0e059c98 |
18:50:31 | loz | everything is ok at the end of channels_list, but when i try to echo(len(r)) i get illegal storage access |
18:50:43 | gmpreussner_ | loz: try moving 'result' out of the var block |
18:50:49 | gmpreussner_ | result is automatically defined |
18:51:01 | gmpreussner_ | you might be shadowing it? |
18:51:06 | notfowl | loz, there is a result variable already defined but you shadow it by defining another 'result' |
18:51:20 | notfowl | loz, that is OK to do but you must now have 'return result' |
18:51:49 | loz | gmpreussner_: notfowl yeah, thanks, i'm kinda stupid) |
18:52:12 | gmpreussner_ | i doubt that's true |
18:52:14 | loz | and result = @[] works now |
18:52:54 | notfowl | loz, 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:37 | Araq | yeah, the language should disallow shadowing 'result', I agree. it's such a common gotcha. |
18:53:52 | loz | this 'result' feature is just new to me, have to get used to it |
18:54:23 | notfowl | loz, 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:13 | loz | notfowl: hm, members are seq[JsonNode], i need seq[string] |
18:55:18 | Araq | flaviu: that said, your proposal indeed is much better than "new T". |
18:55:57 | notfowl | loz, ah i didnt see that |
18:56:20 | flaviu | Araq: "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:42 | Araq | vbtt: you can tell the installer to set the PATH for you |
19:01:58 | vbtt | Araq: ah i see. maybe I missed that checkbox. |
19:03:03 | vbtt | aporia fonts are a bit fuzzy on windows. maybe it's a gtk thing. |
19:03:45 | vbtt | but overall a good experience out of the box. it's great that aporia is packaged with nim. |
19:05:02 | vbtt | aporia should have a 'show compiled c code' feature :) |
19:05:56 | * | Var|Mobile quit (Ping timeout: 250 seconds) |
19:10:56 | Araq | I 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:15 | flaviu | Araq: Your point? People do sometimes look at assembler code. |
19:15:27 | Araq | flaviu: 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:35 | Araq | (which is messy anyway) |
19:15:46 | flaviu | It's useful when the output c code is buggy |
19:16:11 | flaviu | and sometimes it's eaiser to see code than to find and read words |
19:16:14 | * | gour quit (Ping timeout: 258 seconds) |
19:16:42 | Araq | you 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:39 | BlaXpirit | is forward declaration of object types possible? |
19:30:38 | Araq | no. but we'll make that possible for 1.0. |
19:30:59 | BlaXpirit | :s |
19:31:07 | BlaXpirit | thanks |
19:31:33 | Araq | you can work around by using generics, or closures or RootRef |
19:31:40 | BlaXpirit | uhhhhh |
19:31:43 | Araq | depending on your situation |
19:31:44 | * | rpag joined #nim |
19:31:57 | * | rpag quit (Remote host closed the connection) |
19:32:12 | BlaXpirit | typical situation |
19:32:32 | BlaXpirit | well not really |
19:32:42 | BlaXpirit | basically I could just rearrange the code, but let's just say I can't |
19:32:55 | Araq | "typical situation" is that you don't know how to design your modules :P |
19:33:02 | BlaXpirit | I simply have usage of the type earlier in code and then declaration of the type |
19:33:26 | Araq | oh you can access it in the same type section before it's declared |
19:33:37 | BlaXpirit | it is not in the same type section |
19:33:51 | Araq | well then it would better be :P |
19:33:56 | * | Sphax quit (Client Quit) |
19:34:14 | BlaXpirit | i'll confess. i'm using include |
19:34:38 | * | BitPuffin quit (Ping timeout: 258 seconds) |
19:36:04 | Varriount|Remote | BlaXpirit: *gasp* |
19:36:34 | * | perturbation joined #nim |
19:36:41 | BlaXpirit | i got a great idea of having an autogenerated file and then include it in a manually written file |
19:36:56 | flaviu | BlaXpirit: Use macros to do your code generation |
19:37:02 | flaviu | you can use parseStmt |
19:37:22 | BlaXpirit | I'm parsing C |
19:37:31 | flaviu | ah, ok |
19:38:06 | BlaXpirit | http://nim-lang.org/system.html#RootRef thx docs |
19:38:51 | BlaXpirit | well RootObj is explained, whatever. |
19:52:25 | perturbation | anyone know how $nim is defined? Currently ungreppable in config files (but I see references to it in nim.cfg) |
19:55:17 | Araq | perturbation: commands.nim:239 |
19:55:57 | perturbation | thanks 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:45 | jpoirier | The compiler user guide states that my dll/so needs to link against nimrtl.dll/so. What happens if I don't? |
20:24:35 | Araq | it crashes or worse |
20:27:46 | jpoirier | lol 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:22 | Araq | well |
20:28:39 | Araq | depending on how you do it, it may indeed end up being fine I think |
20:29:18 | Araq | and a run for 35 minutes is usually long enough to show any issues |
20:31:33 | jpoirier | yeah, 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:00 | Araq | I'd prefer if you could submit a test for this instead so we can officially support it |
20:37:38 | jpoirier | A test for running a dll/so built using RealTime GC without linking nimrtl? |
20:38:41 | * | smeady joined #nim |
20:39:03 | Araq | yes |
20:39:37 | * | smeady left #nim ("Textual IRC Client: www.textualapp.com") |
20:39:51 | * | smeady joined #nim |
20:40:20 | jpoirier | K. Will do. |
20:40:26 | * | smeady quit (Quit: Textual IRC Client: www.textualapp.com) |
20:41:05 | * | gour quit (Quit: Leaving) |
20:41:28 | Araq | thanks |
20:45:24 | * | saml quit (Quit: Leaving) |
20:56:38 | ldlework | :) |
21:17:14 | BlaXpirit_ | I import a module, and I want names from it to be visible if the importing module is imported |
21:18:20 | BlaXpirit_ | pls don't tell me this is impossible :/ |
21:18:23 | Araq | 'export' |
21:18:55 | BlaXpirit_ | export import |
21:18:57 | BlaXpirit_ | i don't get it |
21:19:42 | BlaXpirit_ | import m;export m seems to do the trick |
21:19:43 | ldlework | BlaXpirit_: import foobar; export foobar.delegate |
21:19:46 | ldlework | yeah |
21:19:52 | BlaXpirit_ | thanks |
21:20:05 | ldlework | could probably have some sort of syntax for that |
21:20:07 | ldlework | like * |
21:20:19 | BlaXpirit_ | import* seemed so familier |
21:20:21 | BlaXpirit_ | a |
21:20:23 | ldlework | import a*, b, c |
21:23:04 | * | NimBot joined #nim |
21:23:33 | Araq | Delphi 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:41 | BlaXpirit_ | 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:52 | BlaXpirit_ | I'm not usually like that :| |
21:25:10 | Triplefox | As long as it's not the python module system i think i can handle it |
21:25:25 | BlaXpirit_ | it's the best tho |
21:26:02 | Triplefox | The scoping rules on it drive me nuts |
21:26:27 | Araq | BlaXpirit_: it's perfectly fine to bother us with your questions here. |
21:27:43 | Araq | and my remark was more directed to ldlework ;-) |
21:29:33 | ldlework | Araq: did you mean "Lived with 'export'" ? |
21:30:03 | Araq | ldlework: no. Delphi has nothing like that. |
21:38:58 | flaviu | ldlework: a bit of uglyness brings soul into a language ;) |
21:39:51 | flaviu | that statement isn't sarcastic btw |
21:40:52 | * | gsingh93 quit (Quit: Connection closed for inactivity) |
21:44:05 | * | loz quit (Quit: Leaving.) |
21:44:56 | ldlework | export is fine, I was making a micro-suggestion |
21:45:08 | ldlework | I'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:56 | Araq | ldlework: it's not even 'export' alone. the type lookup rules (recursive within a single type section) are the same in Delphi too |
21:53:14 | ldlework | cool |
21:53:47 | Araq | lol |
21:58:48 | perturbation | flaviu: If that's true, then Mumps has, a um... uncomfortably large amount of soul ;) |
21:59:43 | flaviu | haha |
22:00:23 | flaviu | Mumps is the one that some hospitals use, right? |
22:00:56 | flaviu | yep, lol |
22:00:59 | perturbation | yes (also some banks) |
22:03:40 | jpoirier | I'm confused about ctypes requirements (not cstring and char*) for wrappers and when casting should/must be used. |
22:04:05 | jpoirier | E.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:38 | flaviu | C's int = 16 bits or something |
22:04:44 | flaviu | Nim's int = size_t |
22:04:52 | * | Boscop joined #nim |
22:05:23 | flaviu | Nim's float is also implementation defined IIRC |
22:05:52 | BlaXpirit_ | it's defined to be processor's fastest, but always float64 for now -_- |
22:08:29 | * | gokr_ joined #nim |
22:08:56 | gokr_ | Happy new year ninmers! |
22:10:09 | jpoirier | Okay, 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:40 | BlaXpirit_ | what is the difference in having ref vs ptr as function parameter? |
22:13:51 | perturbation | ref is managed by GC, ptr you have to manage yourself |
22:14:47 | BlaXpirit_ | I don't understand what that means for a function parameter |
22:17:23 | * | dts|pokeball joined #nim |
22:17:25 | perturbation | ref is the type that you should be using most of the time (not FFI, etc.) |
22:17:51 | perturbation | if you're just calling some function with a ptr parameter then you shouldn't allocate with new (use alloc/alloc0 instead) |
22:18:19 | BlaXpirit_ | well i see that this guy https://github.com/fowlmouth/nimrod-sfml/blob/master/csfml.nim never uses ref |
22:18:31 | BlaXpirit_ | (this is FFI obviously) |
22:18:54 | flaviu | Which is why he never uses ref |
22:18:59 | perturbation | I've looked at that before - IIRC that's a wrapper for the C SFML bindings |
22:20:25 | perturbation | nim-lang.org/manual.html#reference-and-pointer-types has some more information about ref/ptr and the difference between the two |
22:22:03 | BlaXpirit_ | i've read that |
22:22:16 | dts|pokeball | is ref/ptr used the same in nim as it is in c? |
22:22:24 | BlaXpirit_ | not a single word about function arguments |
22:22:29 | dts|pokeball | just with ref instead of & and ptr instead of *? |
22:24:03 | Araq | BlaXpirit_: use 'ptr' for the FFI unless you control object creation |
22:24:15 | Araq | which means that you can 'new' it |
22:24:16 | BlaXpirit_ | ok, I don't create object creation |
22:24:21 | Araq | then you can use 'ref' |
22:24:21 | BlaXpirit_ | this is obvious, okay |
22:24:29 | BlaXpirit_ | I can't 'new' it |
22:24:34 | * | fowlmouth joined #nim |
22:24:46 | BlaXpirit_ | I have a small inconvenience here |
22:24:57 | BlaXpirit_ | there is a type that is passed both by value and by pointer in the API |
22:25:02 | BlaXpirit_ | i think |
22:25:09 | BlaXpirit_ | so how should I expose it to nim? |
22:25:18 | BlaXpirit_ | make users use ptr? |
22:25:22 | BlaXpirit_ | addr rather |
22:25:47 | * | zahary2 joined #nim |
22:25:54 | BlaXpirit_ | I was thinking about adding implicit conversion to pointer if it is possible |
22:26:20 | BlaXpirit_ | or override with var and addr |
22:26:23 | Araq | it is but I don't think it's a good idea |
22:26:55 | Triplefox | I 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:03 | Triplefox | Most 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:25 | BlaXpirit_ | I am still looking for an answer on how to not make users of library use addr |
22:32:13 | perturbation | dts: 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:02 | BlaXpirit_ | perturbation, this doesn't help me |
22:33:12 | BlaXpirit_ | i have a simple struct type |
22:33:22 | BlaXpirit_ | and sometimes i want to use a C function that accepts pointer to that type |
22:33:30 | BlaXpirit_ | const pointer, if that matters |
22:33:39 | * | gokr joined #nim |
22:33:56 | dts|pokeball | thanks perturbation |
22:34:03 | dts|pokeball | haillo 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:44 | BlaXpirit_ | oh wait, i thought... |
22:34:44 | fowlmouth | BlaXpirit_, for functions like SDL_PollEvent(SDL_Event *) the nimrod version should be `var Event` |
22:34:58 | BlaXpirit_ | fowlmouth, ah that's interesting |
22:35:18 | BlaXpirit_ | fowlmouth, well there are functions like that in CSFML |
22:35:49 | BlaXpirit_ | and you seem to just use P-types in your examples, so it is not a problem |
22:36:36 | BlaXpirit_ | ah, it's for non-const pointer |
22:36:40 | fowlmouth | BlaXpirit_, var T and ptr T are both "T*" at the c level |
22:36:49 | BlaXpirit_ | that's good |
22:38:42 | fowlmouth | BlaXpirit_, and you can disregard any 'const' when writing a wrapper |
22:38:43 | * | jefus_ joined #nim |
22:39:07 | fowlmouth | const char * const is still cstring in nim |
22:40:48 | * | jpoirier joined #nim |
22:41:14 | jpoirier | Nim'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:14 | BlaXpirit_ | hah, no, if C accepts const pointer, I can't just make that var |
22:53:31 | BlaXpirit_ | 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:46 | gmpreussner_ | Araq: happy new year :) |
23:09:10 | * | BillsPC quit (Remote host closed the connection) |
23:10:02 | ldlework | I need forward type declarations so bad |
23:12:32 | BlaXpirit_ | use generics |
23:12:34 | BlaXpirit_ | :| |
23:12:40 | BlaXpirit_ | i actually couldn't do that in my case |
23:12:57 | dts|pokeball | nim doesnt support that yet ldlework ? |
23:14:11 | * | AFKMorpork is now known as AMorpork |
23:14:27 | ldlework | dts|pokeball: no :( |
23:14:36 | ldlework | BlaXpirit_: generics don't help |
23:14:38 | dts|pokeball | lame sauce |
23:14:53 | BlaXpirit_ | ldlework, why not |
23:15:04 | dts|pokeball | one day i might learn the rest of nim, but atm it works great for me treating it as a procedural language |
23:15:17 | ldlework | BlaXpirit_: its an issue with two objects needing to refer to each other |
23:15:30 | ldlework | like, as in have references to each other |
23:15:36 | BlaXpirit_ | ldlework, it all works if they're in the same type block |
23:15:41 | BlaXpirit_ | and generics can indeed help |
23:15:44 | ldlework | BlaXpirit_: which is terrible for organizing your project |
23:15:51 | BlaXpirit_ | one object can have a generic reference :| |
23:17:48 | ldlework | I truly don't understand how generics can help |
23:18:30 | ldlework | Lets say you have mututal types A and B |
23:18:47 | ldlework | B needs to store different subclasses of A on a field |
23:18:58 | ldlework | generics only allow me to initialize B for a specific kind of A |
23:19:25 | BlaXpirit_ | okay, that's a good explanation |
23:19:48 | * | Varriount|Mobile quit (Quit: AndroIRC - Android IRC Client ( http://www.androirc.com )) |
23:20:28 | ldlework | maybe typeclasses? |
23:20:45 | BlaXpirit_ | why don't you just use a single type block |
23:21:12 | ldlework | I'm so fucking close |
23:21:18 | ldlework | I hate the idea tho |
23:21:20 | ldlework | types.nim |
23:21:21 | ldlework | ugh |
23:21:31 | BlaXpirit_ | include? anyone? |
23:21:36 | * | Varriount|Remote joined #nim |
23:21:51 | BlaXpirit_ | although i'm not even sure how it would work with indentation and it would suck in any case probably |
23:21:58 | ldlework | I mean |
23:22:06 | ldlework | at least if I just throw ALL my types in a single module |
23:22:09 | ldlework | to bypass this issue |
23:22:19 | ldlework | that wouldn't be terrible to refactor once forward type declarations show up |
23:22:24 | BlaXpirit_ | ldlework, you can maybe have them in separate files |
23:22:30 | ldlework | ::chin rubbing intensifies:: |
23:22:35 | BlaXpirit_ | and then |
23:22:44 | BlaXpirit_ | type; include a; include b; include c |
23:22:51 | BlaXpirit_ | xD i'm evil |
23:23:01 | ldlework | well the only thing we care about this at all |
23:23:11 | ldlework | is so that the types are available from the same module that the methods are defined |
23:23:20 | Araq | BlaXpirit_: doesn't work, but I'm beginning to like the idea |
23:23:31 | BlaXpirit_ | Araq, no, it was a stupid idea |
23:23:32 | ldlework | so just spitting up the type definitions for the hell of it doesn't really accomplish anything |
23:23:36 | BlaXpirit_ | because of methods indeed |
23:23:46 | ldlework | splitting* |
23:23:55 | BlaXpirit_ | there is nothing to like, because include is evil |
23:24:21 | ldlework | I could just make types.nim a compiler include |
23:24:35 | ldlework | magic module like consts god I'm gonna need a hot shower after this |
23:25:17 | Araq | gmpreussner_: thanks! to you too! |
23:32:55 | * | BlaXpirit_ quit (Quit: Quit Konversation) |
23:33:11 | * | BlaXpirit joined #nim |
23:35:05 | jpoirier | Araq: 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:50 | Araq | yeah. I was against all of these. |
23:35:59 | Araq | pointless crap. |
23:37:53 | jpoirier | aren't they necessary/helpful for C wrappers? |
23:38:20 | fowlmouth | <BlaXpirit_> I mean, I can, but it's wrong -- why? nimrod semantics are not c semantics |
23:39:16 | Araq | jpoirier: we have char/byte/int8 which is perfectly understandable |
23:39:20 | gokr | I think 2015 will be a good Nim year ;) |
23:39:29 | Araq | byte being an alias for uint8 |
23:39:35 | Araq | which also makes perfect sense |
23:39:43 | * | dts|pokeball quit (Ping timeout: 264 seconds) |
23:39:57 | Araq | cuchar? why bother? that's 'byte' then |
23:40:11 | * | gokr_ joined #nim |
23:43:42 | * | gokr quit (Ping timeout: 250 seconds) |
23:44:13 | Varriount|Remote | Araq: How do you plan to deal with https://github.com/Araq/Nim/issues/1802 ? |
23:46:23 | Araq | Varriount|Remote: what is the problem? |
23:47:01 | Araq | proc makeFn(s: string): proc (i: int) {..} {.pragmax.} = ... should do the trick |
23:47:16 | Varriount|Remote | Araq: Syntactic ambiguity. What does the pragma in 'proc foo(): proc bar {.pragma.}' refer to? |
23:48:02 | Araq | we can also change the parsing |
23:49:04 | Araq | proc makeFn(s: string): (proc (i: int) {.pragmasHere.}) # when the pragmas belong to the return type |
23:49:50 | Araq | I guess that's more intuitive |