<< 10-03-2014 >>

00:00:03DemosYAY!
00:00:05Demosit wooooorks
00:00:25*Demos starts writing a better linear algebra library
00:01:49zaharyDemos, I planning only once small fix for matrix libraries - for generic types defined like this Matrix[N, M: range; T], the rules that apply to the built-in array type will apply as well
00:01:53*Matthias247 quit (Quit: Matthias247)
00:02:21zaharyso, you'll be able to say Matrix[4, 4, float] just like with static ints.
00:02:42zaharythe very small benefit is that you can use the range types in the cell accessor procs
00:03:10Demosmy matrix is going to be defined as type Matrix[T; N,M: static[int]] = array[0..N*M-1, T]
00:03:15zaharyproc `[]` (x: Matrix, a: Matrix.N, b: Matrix.M)
00:03:35zaharymake that at least distinct
00:03:40Demosyeah ofc
00:04:00Demosactually right now it is an object with an array member
00:04:45Demosactually I have an options param as well, but it is just so I can overload on stuff like storage order
00:05:22zaharydefault parameters should be supported as well
00:05:45Demoswonderful!
00:06:28Demosbtw the implicit generic style is really, really nice for this sort of stuff
00:07:57zaharyyeah, I don't know another language that is so slick when it comes to generics
00:09:09Demosmy favorite c++ linear algebra library returns something derived from the following for its operations:
00:09:11Demostypedef Matrix<typename internal::traits<Derived>::Scalar, internal::traits<Derived>::RowsAtCompileTime, internal::traits<Derived>::ColsAtCompileTime, AutoAlign | (internal::traits<Derived>::Flags&RowMajorBit ? RowMajor : ColMajor), internal::traits<Derived>::MaxRowsAtCompileTime, internal::traits<Derived>::MaxColsAtCompileTime > PlainObject
00:09:12EXetoCyeah, good stuff
00:11:01EXetoCDemos: holy shit
00:11:39Demosit is using something called expression templates to do lazy evaluation of the ops, so that infix operations and operations that return new matrices can be done quickly
00:12:09zaharyI know the drill - is it euler?
00:12:15DemosEigen
00:12:21zaharyah, yeah :)
00:13:34Demosit is awesome, and actually does not hurt compile time much.
00:15:35*DAddYE quit (Remote host closed the connection)
00:16:01*DAddYE joined #nimrod
00:17:43zaharywell, go after it - it's still not clear whether we'll be able to improve on the expression template techniques with the term rewriting macros - they can apply similar elimination of temporaries by collecting long expressions such m1 * m2 + m3 to be processed in a single macro
00:20:42*DAddYE quit (Ping timeout: 265 seconds)
00:42:21Skrylarmeep
00:42:55*darkf joined #nimrod
00:44:45EXetoCmeep
00:44:54EXetoCVarriount: meep?
00:50:05Demosoh EXetoC I was having problems with your GLFW wrapper
00:50:21Demosin particular glfw is glfw3.dll on my system
00:50:25*Varriount quit (Ping timeout: 240 seconds)
00:50:39Demosthis may only be the devel versions built from master though
00:57:56EXetoCDemos: no the same goes for the binaries apparently. will fix
00:58:06Demossweet, thanks
00:59:41Skrylarwell thats unawesome
00:59:43EXetoCthere
00:59:50SkrylarI updated to the latest devel and compile speed dropped 3fold
01:00:22EXetoCthat's not good
01:00:40DemosSkrylar, did you forget -d:release
01:00:56Skrylari rolled it with koch but i can go fiddle with it again
01:01:51SkrylarI'm not satisfied that using 'unittest' requires so many dependencies i will admit
01:01:58Skrylarusing asserts -> 8000 lines
01:02:02Skrylarusing unittest -> 30,000 lines
01:03:06Skrylaralright, re-rebootstrapped now its good
01:03:07Demoslooks like it only imports macros and os
01:03:44Skrylari import unittest and unsigned, the compiler logs macros, stdutils, parseutils, winlean, terminal and windows
01:03:47EXetoCit's a fine module
01:04:08DemosOK a lot of that is windows headers
01:16:34*DAddYE joined #nimrod
01:17:45EXetoCdid I break Varriount's internet?
01:18:18EXetoCDemos: is it working now?
01:21:07*DAddYE quit (Ping timeout: 265 seconds)
01:21:35*mangat quit (Remote host closed the connection)
01:21:35*pelevina quit (Remote host closed the connection)
01:25:10*askatasuna joined #nimrod
01:30:54*Demos_ joined #nimrod
01:33:22*zielmicha quit (Quit: Connection closed for inactivity)
01:38:18*askatasuna quit (Ping timeout: 240 seconds)
01:59:22*brson quit (Quit: leaving)
01:59:39*brson joined #nimrod
02:08:59*Demos_ quit (Ping timeout: 240 seconds)
02:09:40*Varriount joined #nimrod
02:17:13*olegbel joined #nimrod
02:28:58Skrylarwb Varriount
02:29:32VarriountMy internet connection to irc has been weird ever since that big netsplit.
02:33:31*q66 quit (Quit: Leaving)
02:34:36*xenagi joined #nimrod
02:34:49Demosah let me check EXetoC
02:36:07SkrylarI'm getting sorta sick of arranging people from different parts of the globe and timezones yet they all at the same time decide to just stop showing up at the same time :\
02:36:10Skrylarmeh
02:37:43Demosseems to work EXetoC
02:37:51VarriountSomething wrong?
02:39:49SkrylarNah I'm just an asshole since I don't know any better, so people off IRC walk off and leave when they can. A fun deathspiral of leaving someone to write code and rot which doesn't make them nicer people, but hey we have better hashing code now
02:39:54Skrylartonight its a hashtable
03:00:34SkrylarI don't suppose procedures can be used as generic parameters
03:02:22VarriountSkrylar: What do you mean?
03:11:24SkrylarVarriount something like X = Thistable[string, sometype, thisismyhashfunction]
03:12:21VarriountSkrylar: X = Thistable[string, sometype, type(thisismyhashfunction)]
03:13:35Demostry it!
03:14:17Demosyou should somehow be able to encode the hash function in the type, like c++ odes
03:14:28Demosexcept we have less insane first class functions
03:17:18VarriountDemos, Skrylar : https://gist.github.com/Varriount/9458869
03:17:37VarriountOf course that's with a seq, but you get the idea.
03:18:10Skrylari'm not really encoding the hash function to the type; i wanted the hash alg to be adjustable
03:18:25Demosone thing is that you don't really want to store the function pointer in the hash table anywhere
03:18:31Demosyou want it to be a phantom type
03:18:45Skrylarthats why i was asking about it being part of the generic
03:18:48Skrylarso it just gets compiled in
03:19:12*flaviu quit (Remote host closed the connection)
03:19:39SkrylarI sorta don't like when there is just a "hash" function like C#/Java does it
03:19:56Skrylarxblah.hash() # what does that mean? FNV? siphash? Is it secure? is it fast?
03:20:06VarriountSkrylar: One where you have to pass the kind of hash as a string/enum?
03:24:05Demoswelp I tried to make a test case and segfaulted the compiler
03:24:23VarriountDemos: Can I see?
03:24:52Demoshttps://gist.github.com/barcharcraz/6154649dab9033a776db
03:25:55VarriountDemos, 'T' is type - you can't perform a runtime proc on it :p
03:29:29Demoshttps://gist.github.com/barcharcraz/87799af057a39a934528
03:29:37DemosI heard that int.foo was short for foo[int]()
03:29:52Demosbut currently it seems to go to foo(typedesc[int])
03:29:57Demosanyway that second gist works
03:31:11VarriountYou know what would be an awesome project - Easy nimrod running and deployment on android.
03:32:58Demoswe need easy nimrod deployment in general, that means getting some kind of system for buildiing things that depend on the outside world
03:33:11Demosanyway that codee may have been wrong but the segfault is still a bug
03:33:13VarriountWell, there's nake
03:33:35DemosI am talking like CMake implemented in nimrd, heck we may even be able to use cmake
03:34:17Demoswe probably would not need the makefile generation stuff, but we would set the correct linker flags, find libraries, maybe even download, build, and install libs at compile time
03:34:26Demosthat would be sweet
03:34:30VarriountIsn't the whole point of nimrod's compile-time stage to mitigate the need for such measures?
03:36:27Demosyes, but it would be a nimrod lib not external program
03:36:45Demosso more sane
03:36:58Demoswe need to be able to deal with using external libs and assets
03:37:04Demosanyway ima go play ArmA
03:43:13*psquid_ quit (Ping timeout: 265 seconds)
03:44:35*psquid_ joined #nimrod
04:01:54*DAddYE joined #nimrod
04:05:07*DAddYE quit (Client Quit)
04:07:16Skrylarmeh, arma.
04:07:32Skrylari'm thinking about removing skype/teamspeak from my PC
04:09:24Demosheh whatever, arma requires a good few hours to really have fun in but it is /really/ fun
04:09:29*xenagi quit (Quit: Leaving)
04:09:49Demoslike if you die the teamspeak addon will make it so you are talking only to the other dead people
04:10:01Demosand everyone is watching the game as spectators
04:11:23Skrylari'm aware of how acre works
04:11:40Skrylarpeople regularly plug how awesome arma is at me even after i told them i don't enjoy games with 6 hour respawn times
04:14:32Demosyeah, it is not for a quick drop in game
04:14:55DemosI like CoD and friends as well
04:16:00runvnc_hello
04:16:06runvnc_is there a bcrypt library in babel or something
04:16:34runvnc_well not in babel
04:20:43Skrylari guess i could add bcrypt to my list of things to port
04:21:38runvnc_does it need to be ported or could it be like a wrapper for this http://bcrypt.sourceforge.net/
04:23:41runvnc_the wrappers all use dynamic libs or something? so can't be entirely static
04:23:59Skrylarwrappers can be static if you make them that way
04:24:23Demosusually the wrappers use dynamic libs by default
04:25:42Demosthe libraries are loaded with dlopen during program initialization, if you want the libraries to be loaded the "normal" way you use --dynlibOverride:libname if you want static linking you also use --dynlibOverride:libname. In both cases you may have to pass extra linker flags with --passl
04:26:43Demosit looks like bcrypt is an algorithm
04:26:56DemosI would say we should wrap a C implementation of that algorithm
04:28:18SkrylarDemos: the problem is (@the fps' earlier) i'm not a super-competitive-korean-y player at heart; i spent a lot of time the past two days thinking about it, and it really only takes a single "competitive" player to completely ruin any multiplayer experience for everyone else. there are more than a few articles that extend that even to casual social games, about how it only takes one min-maxer
04:28:18Skrylarwho's memorized half the sourcebooks to completely relegate the rest of a 6-man party completely unnecessary and out of having fun. So its a matter of one jackass shows up and makes a game 'competitive', and now everyone else has to sit and do four hours of accuracy training a day or memorize sourcebooks to prevent that guy ruining everything. And in effect, he's ruined the casual nature by
04:28:18Skrylarvirtue of making people *have* to do that in the first place. Which is why I've been somewhat disenfranchised with multiplayer-anything as of late
04:30:46Demosin my experience with arma people are totally fine as long as you are not derping around (like singing on the mic, melting faces with backblast, randomly stealing tanks and so on)
04:31:05Demosyou have to put some time in to learn how the teams work though
04:31:39Skrylari've been around a few; it doesn't solve the 'accuracy problem' though
04:31:52Skrylarnot everyone enjoys "well your DPS is bad, so 'teamwork' for you means you get to hide in the truck"
04:33:57SkrylarI have a lot of interest in how AI coding works to make better single/co-op experiences, because people can just have fun with those without one guy dragging everyone in to needing to do training missions
04:35:26SkrylarIt bothers me somewhat that the point of RPGs is to be immersed in a story as somebody/something else, but in reality they just allow calculus experts to engage in powerfantasies while relegating everyone else to the noob pile
04:35:29*Skrylar shrugs
04:36:17DemosI agree about RPG min-maxing but I enjoy the serious teamwork of ArmA, with a focus on fun ofc
04:36:54DemosI do /not/ like hypercompetitive dota clones
04:37:22Demosstarcraft is kinda fun but extremely stressful. I play games to relax and have fun. Starcraft is not that fun when you loose
04:37:27DemosI need to go to sleep now
04:37:30*Demos quit (Quit: Leaving)
04:37:34Skrylarlol. g'night
04:38:10Skrylarrunvnc_: no i don't think we have a pre-existing bcrypt lib
04:38:20runvnc_k
04:39:15runvnc_I'm looking at some code like https://github.com/ncb000gt/node.bcrypt.js/blob/master/src/bcrypt_node.cc or http://stuff.mit.edu/afs/sipb/project/freebsd/head/secure/lib/libcrypt/blowfish.c to see if its feasible for me to try to do it
04:39:22runvnc_to wrap it
04:39:39runvnc_the freebsd one seems to be missing the part where you actually compare to check if a password is right
04:41:23runvnc_although maybe thats pretty simple
04:56:35VarriountHm. I wonder how hard it would be to wrap Android's NDK with C2Nim
04:56:44runvnc_well yeah comparing strings is simple and this node one has a compare strings that uses a set length which makes it harder to hack
05:08:59renesacSkrylar, one would pass the hash function to the hash table at creation time, and then the hash table uses that hash function internally for the input?
05:12:35renesacan now you can use static[T] to implement different types of siphash
05:26:01*brson quit (Ping timeout: 240 seconds)
05:27:19*brson joined #nimrod
05:35:34*brson quit (Ping timeout: 264 seconds)
05:36:18*brson joined #nimrod
05:36:19*brson quit (Client Quit)
05:39:29*Demos joined #nimrod
05:43:37*Demos quit (Client Quit)
06:06:11SkrylarVarriount: probably not very, though you would need to augment the compile chain so it used the ARM-based gcc instead of the x86
06:08:28*respire quit (Ping timeout: 244 seconds)
06:15:46runvnc_well I have a test bcrypt c program that works on my computer now :)
06:24:41*nande quit (Remote host closed the connection)
06:27:05Skrylarrunvnc_: success
06:35:47*skyfex joined #nimrod
07:04:14*kserov quit (Remote host closed the connection)
07:04:15*olegbel quit (Remote host closed the connection)
07:11:07*Endy joined #nimrod
07:17:04*skyfex quit (Quit: Computer has gone to sleep.)
07:19:58*ninjin quit (Ping timeout: 264 seconds)
07:20:11*ninjin joined #nimrod
07:25:37*r0b1 quit (Ping timeout: 240 seconds)
07:45:53*Kelet quit (Read error: Connection reset by peer)
07:51:29*Kelet joined #nimrod
08:14:10*Kelet quit (Remote host closed the connection)
08:39:10*ninjin quit (Ping timeout: 264 seconds)
08:39:50*ninjin joined #nimrod
09:03:38*[1]Endy joined #nimrod
09:06:46*Endy quit (Ping timeout: 264 seconds)
09:06:46*[1]Endy is now known as Endy
09:28:15*BitPuffin joined #nimrod
09:33:38*zahary1 joined #nimrod
09:35:15*CarpNet joined #nimrod
09:39:40*zahary1 quit (Quit: Leaving.)
09:45:10*ninjin quit (Ping timeout: 264 seconds)
09:45:24*ninjin joined #nimrod
10:01:22*Endy quit (Ping timeout: 264 seconds)
10:25:30BitPuffinAraq: okay today I don't think I'll be tired as fuck so possibly I could try and do the thing you said and debug it :)
10:25:57BitPuffinat least that part because I also wanna play okami :P
10:26:06AraqBitPuffin: yay
10:26:18Araqokami only runs on macosx?
10:26:58BitPuffinAraq: lol no :P
10:27:08BitPuffinAraq: it runs on ps2, ps3 and Wii :P
10:27:22BitPuffinand it's amazing
10:27:58Araqlooks like an LSD trip
10:28:00BitPuffinhowever probably not your style of game I'd imagine, but what do I know about your taste really
10:28:03BitPuffinhahaha
10:28:06BitPuffinno u
10:28:08BitPuffinkidding
10:28:17BitPuffinI like the art direction very much
10:30:48BitPuffinAraq: you seem to know a lot about LSD trips
10:32:35BitPuffinAraq: does include pose any requirements on the file extension of a file?
10:32:44BitPuffinby the looks of it it doesn't
10:33:00Araqdunno but .tmpl gets special treatment
10:33:05BitPuffinah
10:33:38BitPuffinanyways I thought I'd put some cruft that people shouldn't include in a file like private.cruft
10:33:49BitPuffinwhich just contains nimrod, that is included by the binding
10:34:53*awestroke joined #nimrod
10:41:39BitPuffinAraq: hmm, seems like it would be really useful if there was a flag to c2nim to add importc to each function
10:42:31Araq#header ?
10:42:36Araq#dynlib ?
10:42:43Araqread the docs?
10:42:47BitPuffinAraq: ?
10:44:16EXetoCalso, there's pragma push/pop
10:44:29BitPuffinEXetoC: which doesn't help
10:44:46BitPuffinAraq: well why is header discouraged?
10:45:11BitPuffinI always skipped looking at it because I was like, oh, discouraged, guess I don't care about what it does then
10:46:17BitPuffindamn it, this header uses the #if defined style instead of #ifdef
10:47:13Araqask Discolod1 to improve c2nim then
10:47:28*Boscop_ joined #nimrod
10:47:37EXetoCBitPuffin: doesn't it, if you keep the original names?
10:47:54*zahary__ joined #nimrod
10:48:00EXetoCwhich some people think is a good idea for the actual 1:1 binding, but not everybody does it
10:49:05BitPuffinAraq: well I was just wondering why it's discouraged
10:49:18BitPuffinEXetoC: yeah but I don't keep the original names
10:49:26BitPuffinEXetoC: "some people" aka fowl
10:50:04AraqBitPuffin: I don't like to have the headers and import libraries around
10:50:29Araqthe DLL should suffice and has not as many PATH related problems
10:50:34*zahary_ quit (Ping timeout: 264 seconds)
10:50:34*Boscop quit (Ping timeout: 264 seconds)
10:51:43EXetoCBitPuffin: ok what about #mangle?
10:51:50BitPuffinAraq: ah I see. So what you really think c2nim should be used for is actually compiling .c no .nim files and not .h at all?
10:53:15Araqer ... what?
10:53:38BitPuffinAraq: yeah like you want us to translate entire libraries to nimrod instead of headers?
10:53:50Araqit's about translating .h files into nimrod modules that bind to the C via dynlib
10:53:58BitPuffinoh yeah
10:54:18BitPuffinwell I guess translating to nimrod to then be translated to c would be a bit off
10:54:36Araqa bit off perhaps, but very cool
10:54:40BitPuffintrue
10:54:56Araqyou get a type checker that's not stuck in the 70ies as a reward
10:55:13BitPuffinEXetoC: don't know shit about PEG stuff but it looks like learning it would save me a lot of time
10:55:14BitPuffinhrm
10:55:21EXetoCmacros containing ## are not supported. you think it'll be easy to support?
10:55:32BitPuffinAraq: well I just meant that the .c files will become .c files anyway
10:55:40BitPuffinso why not just include them in the project somehow
10:55:44*aftershave quit (Ping timeout: 244 seconds)
10:55:48EXetoCgonna report that, and yeah that nimgrep issue too :p
10:55:50BitPuffinplus you aren't really supposed to touch libraries
10:56:23BitPuffinI'm still confused and curious as to what the actual fuck Demos was talking about
10:56:39AraqEXetoC: ## seems easy, true
10:56:41BitPuffinI guess I'll notice over the coming days
11:00:49BitPuffinlinagl probably has aquired new errors with possible regressions in the compiler etc
11:02:57EXetoCthat's likely. meanwhile, Demos seems to be doing well with his matrix interface using bleeding-edge features
11:04:07BitPuffinwhat kind of bleeding edge features?
11:04:31*awestroke quit (Remote host closed the connection)
11:04:44BitPuffinEXetoC: where is his matrix library thing?
11:06:03BitPuffinor what's his github account :P
11:06:57NimBotAraq/Nimrod devel 5d33bda Zahary Karadjov [+0 ±2 -0]: fix #988... 2 more lines
11:08:10*askatasuna joined #nimrod
11:08:49EXetoCor maybe I'm wrong
11:09:44EXetoCBitPuffin: maybe just static[T] at the time being http://build.nimrod-lang.org/docs/manual.html#static-t
11:09:51EXetoCbut I don't remember him sharing anything yet
11:10:20BitPuffinah right
11:10:32BitPuffindidn't he say he was gonna do a PR that uses it?
11:10:37BitPuffinI'll probably add it myself tbh
11:11:35BitPuffinmaybe even today
11:11:40BitPuffinor like now
11:11:46EXetoCare you going to switch to devel then?
11:12:41BitPuffinoh this is on devel?
11:14:01EXetoCI'm pretty sure. Master was last updated a month ago
11:14:33BitPuffinonce again git being a fucking retard
11:14:41BitPuffinanyway
11:14:46BitPuffinokay
11:15:02BitPuffinbut hasn't static been around longer than a month
11:15:42BitPuffinlooks like devel built this time yay
11:16:06*Endy joined #nimrod
11:17:31EXetoCI think it was broken/buggy before
11:17:40BitPuffinis zahary zahary__ here?
11:18:04BitPuffinI guess the protocol i ping but whatever
11:18:29BitPuffinwe need to have a zahary pinger bot, since there is usually so many zaharies
11:18:38*zahary__ is now known as zahary_office
11:18:48zahary_officeI'm here
11:18:50BitPuffina sign of life!
11:19:06BitPuffinzahary_office: hey I was just wondering if generics can take other parameters than types and ranges yet
11:19:30zahary_officethe latest in the devel branch have some pretty rough test cases for them
11:19:46BitPuffinthat pass?
11:19:50zahary_officeyep
11:19:59BitPuffingood incentive enough to try it out I suppose
11:20:03BitPuffinI'll report back in a sec
11:24:14BitPuffinhmm
11:24:45BitPuffinSo putting static in a type signature doesn't let me not specify the value in a proc parameter?
11:25:06zahary_officewhat do you mean?
11:25:08BitPuffinie with TVector*[T; D: static[int]] = array[0..D-1, T]
11:25:31BitPuffinI can't do proc `*.`*[T, I](a, b: TVector[T, I]): T {.noSideEffect.} =
11:25:32BitPuffin?
11:25:34BitPuffinor oh
11:25:44BitPuffinI have to say static there too don't I?
11:26:09zahary_officeI guess, I'll try to improve it - go for implicit generics for now
11:27:24*aftershave joined #nimrod
11:27:34BitPuffingot: (typedesc[T], static[typedesc[I]])
11:27:36BitPuffinbut expected: (T, D)
11:27:38BitPuffinthat was the error btw
11:27:42BitPuffinproably relevant
11:28:20BitPuffinzahary_office: well I can't do proc `*.`*(a, b): a.type.T yet
11:28:45BitPuffinand (a, b: TVector): TVector.T doesn't work either
11:30:24BitPuffinlolwut
11:30:39EXetoCthe first one is a shortcut, while the second one refers to a generic type that hasn't been instantiated, right?
11:30:50BitPuffinwith: got: (typedesc[T], static[typedesc[I]])
11:30:52BitPuffinbut expected: (T, D)
11:30:54BitPuffinoops
11:31:09BitPuffinokay so that's what I get for: proc `*.`*[T, D: static[int]](a, b: TVector[T, D]): T {.noSideEffect.} =
11:31:28zahary_officehere is what works for me:
11:31:29zahary_officehttps://gist.github.com/zah/9463398
11:31:30EXetoCwhat about a.type.T or something?
11:31:31BitPuffinEXetoC: yeah, I assumed the second one wouldn't work either, anyways
11:31:45EXetoChm
11:31:58BitPuffin12:28:19 BitPuffin | zahary_office: well I can't do proc `*.`*(a, b): a.type.T yet
11:32:00BitPuffinEXetoC: ^
11:33:06EXetoCIt does seem a little magic, so I didn't expect it to work
11:33:53BitPuffinoh it worked
11:33:58BitPuffinjust that I got the same error on another line
11:34:00BitPuffindoh
11:36:05BitPuffinzahary_office: hmm but now I am getting vector.nim(147, 15) Error: cannot evaluate at compile time: a
11:36:27BitPuffinfor this proc: https://gist.github.com/BitPuffin/1bc3cb5f97c5372c551c
11:36:32EXetoCeither (x, y: V): V.T == (x: V, y: V): V.T or the latter is now ambiguous, which is fine I guess but I think I prefer the 'type' approach
11:37:03BitPuffinEXetoC: none of them are ambiguous
11:37:17BitPuffinbecause TVector can only mean one thing in that context
11:37:17EXetoCdoes that assertion hold true then?
11:37:21BitPuffinyes
11:37:23EXetoCok
11:37:34EXetoCfair enough
11:37:42BitPuffinah I thought you said that one of them where ambigous, need to learn english
11:38:58BitPuffinEXetoC: anyways as far as I can understand it, when instantiating the proc, the TVector can only mean one thing at that time, so if you have type D[T] and have (x, y: D) you can't pass x[int] and y[float]
11:39:05BitPuffintheir T need to match
11:39:09BitPuffinotherwise they aren't the same D
11:39:14BitPuffinso they get the D in the ass
11:40:22BitPuffinzahary_office: oh I see why it fails, not sure why it didn't fail before though, it can't know that $ is defined for all the T's for TVector
11:40:31BitPuffinhowever how the fuck do I assert that even
11:41:14EXetoCuser-defined type classes :>
11:41:49*zahary_office left #nimrod (#nimrod)
11:41:54BitPuffinseems kinda overkill
11:43:02BitPuffinjust for having a $ operator for a generic type
11:43:38BitPuffinalso now I suddenly got the urge to create a currency converter library where if you use $ on a TCurrency you get the dollar value back JUST to fuck with nimrod convention
11:44:27EXetoCis T restricted? though I don't know if the compiler is smart enough to infer something based on that
11:44:33BitPuffinactually it would be a pretty sweet library. You would do c.€= 38 and then do $c and get the dollar val
11:44:37EXetoCto integral types that is
11:45:13BitPuffinEXetoC: well isn't it supposed to not compile only when $ isn't defined
11:45:24BitPuffinand I'm not using any time where $ isn't defined
11:45:35BitPuffinin fact it doesn't fail just by looking at the proc
11:45:46BitPuffinwhen evaluating the proc it's like aight fine, looks good
11:45:58BitPuffinbut when I use it with a TVector[int, 3] it fucks out
11:46:27BitPuffingod I love being able to use TVector[int, 3] instead of TVector[int, range[0..2]]
11:47:34BitPuffinoh wow this error started happening everywhere
11:47:38BitPuffinwell I guess that's a given
11:47:39BitPuffinhrm
11:48:40*zahary_office joined #nimrod
11:48:49zahary_officeBitPuffin, https://gist.github.com/BitPuffin/1bc3cb5f97c5372c551c
11:49:57*psquid joined #nimrod
11:50:14BitPuffinzahary_office: well weird
11:50:22BitPuffinbecause non of my stuff seems to work
11:50:30*psquid_ quit (Ping timeout: 244 seconds)
11:50:31BitPuffinnot $, or ==
11:50:39BitPuffinI may aswell paste the whole file lol
11:50:40zahary_officewhere do you try to evaluate it at compile time
11:51:00zahary_officeare you sure you are not trying to do it with a run-time variable?
11:51:11BitPuffinhttps://gist.github.com/BitPuffin/9463633
11:51:13BitPuffinzahary_office: I am
11:51:26BitPuffinor what do you mean
11:51:37BitPuffinIt's not a static[TVector] anywhere
11:52:14BitPuffinor is it going GPL on my ass saying that just because the generic parameter is static making the whole type having to be static?
11:55:23zahary_officeno, I can't make sense of the error either
11:55:51BitPuffinso far 162, 163, 167, 168, 169, 173, 174 fails
11:56:04BitPuffinwell, 174 fails because 173 fails
11:56:09BitPuffinso I can't test it properly
11:56:25BitPuffinzahary_office: it works for you?
11:57:34zahary_officenope
11:57:46BitPuffinah
11:57:52BitPuffinwell that's good-ish news at least
11:59:33BitPuffinremoving the D-1 didn't do any good either
11:59:42BitPuffinso I can't see how it is any different from your code
11:59:55BitPuffinother than you naming it $$
12:00:12BitPuffinwhich shouldn't be relevant at all
12:00:52BitPuffinwell and you running the echo on compile time
12:01:19BitPuffinzahary_office: with the code that worked for you, does it still work if you don't do static: echo($$xx) and just do echo x instead
12:02:24*zahary_office left #nimrod (#nimrod)
12:02:43*zahary_office joined #nimrod
12:03:35zahary_officeI think I figured it out, I'll fix it tonight
12:03:50BitPuffinzahary_office: what seems to be the problem?
12:03:54zahary_officewatch out when I commit a fix for tsemistatic, it's related
12:04:16BitPuffinokay!
12:04:18BitPuffinsweet
12:04:35BitPuffinI'll refactor matrix.nim to be more up to date in the mean time
12:04:43BitPuffinwill just hold off the commit until it actually compiles :P
12:06:02BitPuffinnot having to use range[0..1] really shines through with TMatrix, wow, such nice
12:22:04*io2 joined #nimrod
12:38:14BitPuffinproc identity[T; D: static[int]](): TMatrix[T, D, D] {.noSideEffect.} =
12:38:24BitPuffinmatrix.nim(22, 47) Error: internal error: cannot generate code for: D
12:38:30BitPuffinzahary_office: ^ :s
12:39:09BitPuffinguess static might not be available in generic params?
12:39:31BitPuffinfor procs
12:44:22BitPuffinthe docs don't mention that it works in generics for procs but they really should
12:52:30*Endy quit (Ping timeout: 244 seconds)
13:03:06zahary_officeBitPuffin, static[int] as a regular param will work
13:04:03zahary_officebut I would make the identity proc parametrized on the type
13:04:03zahary_officeproc identity(T: type Matrix): Matrix = for i in 0 .. Matrix.N: result[i, i] = 1
13:04:29zahary_officethen, it can be used like this: Matrix4.identity
13:09:13Araqif type(Matrix) is the same as typedesc[Matrix] this needs to be documented
13:24:18BitPuffinzahary_office: problem is that if static[whatever] doesn't work as a generic parameter for a proc it is still gonna cause issues in many other places other than this
13:24:35BitPuffinand yes that's something I've considered too
13:24:42BitPuffinand might just do that
13:24:47BitPuffinbut that's beside the point
13:24:49zahary_officeproc foo(x: static[int]) # I meant that this should work
13:25:07BitPuffinright
13:25:10zahary_officeI agree that proc foo[T, I] is broken, when I is static
13:25:12BitPuffinit only works as a parameter
13:25:18zahary_officeI'll look into this tonight
13:25:24BitPuffincool
13:25:33*awestroke joined #nimrod
13:27:18BitPuffinit breaks ~= as well: proc `~=`*[T, R, C](a, b: TMatrix[T, R, C], tolerance: float = 1.0e-5): bool {.noSideEffect.} =
13:27:31BitPuffingot: (typedesc[T], static[typedesc[R]], typedesc[C])
13:27:33BitPuffinbut expected: (T, R, C)
13:27:58BitPuffinAraq: they don't seem the same, it seems like one is a typedesc and one is a type
13:28:06BitPuffinmakes me wonder why we should even have typedesc
13:28:26BitPuffinif type is a new thing that is the actual type maybe typedesc should be deprecated
13:38:29*askatasuna quit (Ping timeout: 252 seconds)
13:41:49zahary_officetype Matrix is the same as typedesc[Matrix] indeed. I adopted this style, because people complain about the verbosity of typedesc
13:41:49zahary_officeactually, maybe even this would work: proc foo(x: type, y: ...)
13:53:50Trixar_zaWe have an off topic channel now?
13:54:51EXetoCyes
13:59:44*darkf quit (Quit: Leaving)
14:06:50BitPuffinzahary_office: so why not deprecate typedesc then?
14:07:24BitPuffinif someone with an existing codebase whines about it it is their fault for using a non-stable language anyways
14:07:32BitPuffinsuch changes should be taken for granted
14:07:35BitPuffinI like my attitude
14:07:37BitPuffinbrb lunch
14:10:41EXetoCnot that many people will complain if there's a long deprecation period
14:12:07EXetoCafter all, deprecated != removed
14:12:31*Endy joined #nimrod
14:14:26*zielmicha joined #nimrod
14:35:43*OrionPK quit (Ping timeout: 252 seconds)
14:46:19AraqVarriount: since you asked for work, add a special test that check nimrod still bootstraps with visual c++
14:48:56*io2_ joined #nimrod
14:49:35*silven quit (Read error: Connection reset by peer)
14:49:35*io2 quit (Remote host closed the connection)
14:51:34*silven_ joined #nimrod
14:57:24*psquid quit (Quit: Math is hard, let's go shopping!)
14:58:27*awestroke quit (Quit: No Ping reply in 180 seconds.)
15:02:19BitPuffinEXetoC: exactly
15:02:27BitPuffinEXetoC: just a compiler warning that nags you until you get to it
15:18:19*askatasuna joined #nimrod
15:19:50*io2_ quit ()
15:43:18*silven_ is now known as silven
16:04:52*nequitans joined #nimrod
16:11:22nequitansHi all! Is there a way to convert a user-defined type to an openarray (e.g via a converter?)
16:13:38nequitans(e.g. i'd like to be able to use the 'sort' function in algorithms on my own type)
16:13:49*Demos joined #nimrod
16:14:16NimBotAraq/Nimrod devel 5fdbb4d Zahary Karadjov [+0 ±1 -0]: fix #971
16:18:29BitPuffinnequitans: how do you mean convert to an openarray?
16:18:46BitPuffinnequitans: openarrays are only used for taking variable amount of args afaik
16:18:53BitPuffinyou can't use them regularly in code
16:18:58dom96hello
16:19:07BitPuffinif you want to store something in a variably sized array use a sequence
16:19:08nequitansBitPuffin, so I have my own version of a sequence object, but i'd like to use the standard sort function
16:19:27BitPuffinnequitans: so you it is a distinct sequence?
16:19:35BitPuffins/you //
16:19:50BitPuffinheyo domboi
16:19:52dom96nequitans: You may need to overload the sort function for your type then
16:20:02nequitansit's actually it's own type
16:20:03dom96nequitans: btw, what ever happened to you making those corrections on your blog post?
16:20:13BitPuffindom96: isn't it enough if he implements the comparisation procs?
16:20:22BitPuffinkind of like when you implement == you get != for free?
16:20:23nequitansdom96, yea, i'll get to that today, i had family in town all weekend :)
16:21:02dom96BitPuffin: There should really be a type class called List or something.
16:21:11BitPuffinyou like echo can take any object that implements $
16:21:14dom96The current sort implementation is not generic like that I don't think.
16:21:35BitPuffinwhy do I say you without any reason
16:21:37dom96Only way you can convert to openarray is to convert to seq I guess
16:21:43BitPuffinIt's like I'm on drugs
16:21:45BitPuffinyou
16:21:57dom96BitPuffin: Too much dota.
16:22:02BitPuffinhahaha
16:22:11BitPuffinactually it's been mostly CS:GO lately
16:22:26BitPuffinbut I gues 262 hours of dota is a wee bit too much
16:22:29dom96BitPuffin: I wanna play that with you!
16:22:37dom96BitPuffin: Let me know when there is a CS: GO sale
16:22:39BitPuffindom96: you wanna play with me?
16:22:47dom96BitPuffin: Sure, why not.
16:22:50BitPuffinhot
16:22:51BitPuffinkidding
16:22:56BitPuffinno but why not just buy it as it is
16:23:00BitPuffinI was gonna wait for a sale too
16:23:04BitPuffinbut it wasn't really that expensive
16:23:08dom96Because i'm cheap
16:23:14BitPuffinprobably because of it's F2P natures sometimes
16:23:14dom96And I don't have time to play it NOW anyway
16:23:25BitPuffinwell me neither because I'm not home yet
16:23:42BitPuffinbut you should buy it within days
16:23:56BitPuffin14 euros is not that much
16:24:03BitPuffinwhat's the price in the uck?
16:24:05dom96It is to me.
16:24:15dom96BitPuffin: If it's not that much then buy it for me :P
16:24:25BitPuffinI could
16:24:47BitPuffinbut it's wasteful enough if I buy anything so probably not
16:25:05BitPuffinbut I would if I wasn't doing terrbly but still my best to save up for moving
16:27:44dom96well I will (hopefully) be starting uni soon.
16:27:55dom96I can't just throw money around
16:28:08dom96A new computer is looong overdue for me.
16:28:48BitPuffindom96: yeah same here
16:28:53BitPuffinwell not the uni part
16:28:55BitPuffinfuck that
16:28:57BitPuffin:P
16:29:07*aftersha_ joined #nimrod
16:31:00Demoscan someone try and compile https://gist.github.com/barcharcraz/8bb9f8dd63230288d6b4? I want to make sure that it is actually a bug and my compiler is not just stale or something
16:31:38BitPuffino/ Demos
16:31:48Demoshey
16:31:51dom96nequitans: Let me know when you do it, reddit needs to experience your brilliant article :)
16:32:04nequitanskk -- i updated the blog post with some of the suggestions that i remembered
16:32:14nequitansany other things you guys can rememmber? additional helpful examples?
16:32:37BitPuffinDemos: locally linagl has been updated because I can finally enable the var bla: TMatrik[int, 3, 3] thing instead of ranges, and it uses static[T], just waiting for a bug or two to be fixed before I commit
16:32:45nequitansoh, let me get rid of the *s
16:33:06Demosyeah BitPuffin! I have been fooling with those as well, still have some real problems, like that gist I posted
16:33:41BitPuffinDemos: yeah there is issues with using them in generic parameters for procs
16:34:39BitPuffinlike in your gist
16:34:55dom96nequitans: http://build.nimrod-lang.org/irclogs/06-03-2014.html 19:12
16:35:06BitPuffinbrb go home
16:35:21BitPuffinDemos: zahary said he'd look at it tonight though
16:35:24Demosso I can define the `[]` proc but not `[]=` since var auto does not work, maybe I could say result = cast[var self.T](addr bla)
16:36:39BitPuffinI'm supposed to watch for semistatic commits, if you see one shout at me if I don't react
16:36:42BitPuffinbrb
16:36:43nequitansdom96, thanks -- yea, i've been using that as a ref. I think I got everything except the logo change
16:37:18dom96nequitans: Alright. Let's ask Araq when he gets here one last time before we reddit it
16:37:19nequitansfilwit mentioned that he could provide a higher-res version that has the original dark background
16:37:30nequitansi was also thinking of adding a small paragraph
16:37:37*DAddYE joined #nimrod
16:37:51nequitansregarding memory allocation
16:38:20dom96sure
16:39:06dom96nequitans: perhaps you could use this: http://nimrod-lang.org/icons/logo.svg
16:41:24*BitPuffin quit (Ping timeout: 265 seconds)
16:43:06*icebattle quit (Quit: leaving)
16:45:00*icebattle joined #nimrod
16:45:08nequitanskk
16:45:11nequitanslogo changed
16:45:18nequitanssmall para on memory added
16:46:59nequitansbrb -- lunch
16:47:05dom96awesome :)
16:54:27*Demos quit (Ping timeout: 265 seconds)
17:03:26*aftersha_ quit (Quit: Textual IRC Client: www.textualapp.com)
17:04:39*brson joined #nimrod
17:05:49*aftershave quit (Quit: Textual IRC Client: www.textualapp.com)
17:06:08*aftershave joined #nimrod
17:34:32*psquid joined #nimrod
17:36:40EXetoCdom96: *user-defined* type class, right? :p
17:37:05EXetoCa container interface is indeed an obvious candidate for this new feature
17:37:50*carum joined #nimrod
17:49:08*flaviu joined #nimrod
17:49:10*flaviu quit (Read error: Connection reset by peer)
17:49:21*carum quit (Remote host closed the connection)
17:49:28*flaviu joined #nimrod
17:53:34shodan45I wonder if I could make a PHP "DSL" in nimrod
17:53:45*flaviu quit (Read error: Connection reset by peer)
17:56:31shodan45and, if I did, how much sanity would I have afterward?
17:57:06dom96EXetoC: What's the difference between writing "user-defined type class" and "type class"?
17:57:34dom96Oh, I guess 'proc' is a type class.
17:57:39dom96and it's not user-defined
17:57:49dom96oh well. You know what I mean anyway.
18:05:58*XAMPP quit (Ping timeout: 240 seconds)
18:08:24EXetoCshodan45: if you must :p
18:10:39*io2 joined #nimrod
18:38:40*q66 joined #nimrod
18:40:09Varriountnequitans: Use a converter?
18:40:21VarriountOh sory, was reading old logs.
18:40:25Varriount*sorry
18:40:52nequitansVarriout, np: yea was interested if I could easily adapt a user-defined type to an openarray since it is a special type
18:48:46*Matthias247 joined #nimrod
18:49:03*Matthias247 quit (Client Quit)
18:50:18*Matthias247 joined #nimrod
18:53:43EXetoCdom96: yeah sure
18:54:17EXetoCbut someone suggested the name traits, which is short, common and not ambiguous
18:55:31*xtagon joined #nimrod
18:55:32*carum joined #nimrod
18:56:34*brson quit (Ping timeout: 264 seconds)
19:03:06dom96EXetoC: the what?
19:03:22*brson joined #nimrod
19:06:08VarriountAraq: Nimrod fails to bootstrap with vcc - some bug in it's macro pre-processor causes a divide-by-zero error.
19:09:00*Varriount|Mobile joined #nimrod
19:09:34*flaviu joined #nimrod
19:09:41*flaviu quit (Client Quit)
19:09:53Araqnequitans: your can cast the underlying array to openArray, I think
19:09:58*flaviu joined #nimrod
19:10:24*flaviu quit (Client Quit)
19:10:32nequitansAraq, thanks -- i'll try that
19:10:42dom96Araq: Can we reddit nequitans' article now?
19:10:54AraqI have to read it again
19:10:57Araqlink?
19:11:16Varriount|MobileAraq: What is 'koch temp' supposed to do when given options/arguments after the 'temp' command?
19:11:29dom96Araq: http://geetduggal.wordpress.com/2014/03/03/consider-nimrod/
19:11:36AraqVarriount|Mobile: pass them to nimrod, of course
19:11:42dom96whoa, did Google just fail at its stylesheet or did the results page style change?
19:12:55Varriount|MobileAraq: Do you mean, pass them as an argument to the nimrod executable compiling the temp compiler, or pass them to the built temp compiler?
19:14:50Araqpass them to built temp compiler
19:15:26Araqkoch temp c temp.nim # compile temp.nim with nimrod_temp to see if the bug disappeared
19:15:50Varriount|MobileSo how would I influence the building of the temporary compiler itself?
19:16:24EXetoCdom96: UDTC -> traits
19:16:47EXetoCand "seq[int] is Container" is true, so time for some experimentation
19:16:55*Demos joined #nimrod
19:18:34AraqVarriount|Mobile: you can't with "koch temp"
19:18:53Araqyou need to type in the particular instructions on your own
19:21:18Araqnequitans: "Nimrod also supports multiple dispatch which allows dynamic binding to variables." <-- no, it allows dynamic binding of methods
19:22:52Araq"Nimrod’s type system and compile-time checks may be all the ‘traits’ I really need" -- maybe but nimrod's effect system puts it ahead of Scala's type safety anyway. Afaik Scala is about to get an effect system though.
19:24:16Araqreactormonk: please correct me if you know more
19:24:37nequitansAraq, thanks -- will make those mods as soon as i have a chance
19:24:57nequitansscala also supports type classes, although it seems it implements them via traits
19:25:55Araqthe difference afaict is in the defaults
19:26:16Araqcan you invoke '+' on a generic unconstrained 'T'?
19:26:23Araqyes for nimrod, no for scala
19:26:54nequitansic
19:27:30Demoswho the hell thought it was a good idea to munge linker options as much as GCC does?
19:27:32DemosI mean honestly
19:29:11Araqnequitans: nimrod allows you do specify the T needs a '+', but is happy without these details, Scala requires it.
19:30:57Demosby default nimrod is "any type where all versions of the template compile" right?
19:31:24Araqnot sure what you mean, but no
19:31:37*OrionPK joined #nimrod
19:31:52Araqby default nimrod is "who cares, I'll tell you at instantation time when it makes no sense"
19:32:15Araq"no need to write down twice that every field of obj requires a $ operator"
19:32:17nequitansAraq, interesting how do you specify that type T requires a '+'? (looking around in docs ...)
19:32:53DemosI posted an example where if you have two generics with the same name and you try and instantiate them with a type where one can compile and one can not you get an error
19:33:22AraqDemos: last time I looked at it, that was a bug
19:34:03DemosOh, I was told that was just the way it worked. I thought the bug was that it still failed if you used typeclasses to constrain the types to only those that compile
19:34:32Araqzahary and me disagree on this :P
19:36:24Demosfwiw c++ agrees with you...
19:37:09EXetoCok that's an insta-win
19:37:50Araqnequitans: http://build.nimrod-lang.org/docs/manual.html#user-defined-type-classes
19:38:06Araqand yes we know a release with these great features is overdue
19:40:08*BitPuffin joined #nimrod
19:40:46AraqDemos: what's the issue number for this?
19:41:09Demos#976
19:41:12nequitansAraq, very interesting...thx
19:41:21nequitansbrb
19:41:50Demosyou can remove the typeclass constraints and it still fails
19:42:48*Puff joined #nimrod
19:42:56*BitPuffin quit (Read error: Connection reset by peer)
19:45:23Araqso 'trait' instead of "user defined type classes" hmm? ping zahary, zahary_office
19:46:59Demosthings called traits usually involve dynamic dispatch though right?
19:47:23Araqright
19:47:44zaharyI think trait should be reserved for the meaning of "component" in component-entity systems - that's a nicer match for the term
19:48:13zaharymetatype, protocol, interface, contract - these work as a synonims for the type classes
19:48:20Araqok but since even I can't remember the names, they need to change :P
19:48:30OrionPKi like the word contract ;)
19:48:44Araqis it "type classes" vs "user defined type classes" currently?
19:49:15zaharythe whole family of generic types is called "type classes"
19:49:17EXetoCzahary: ok well there's an issue for it
19:49:26Demoserm... dare I suggest "concept"
19:49:41zaharyah, yeah, concept as well
19:49:48OrionPKcontract encapsulates the idea best imo
19:50:07EXetoCDemos: both static or dynamic in Rust, and static in C++ I think. maybe that's unusual
19:50:16Demosas far as I can tell our typeclasses are almost the same as concepts in c++
19:50:21*carum quit (Remote host closed the connection)
19:50:22EXetoCand yes I know it's not a distinct feature in C++
19:50:27Araq"generic" reads better than "contract" though, IMHO
19:50:28zaharyI have some other planned features that will also make the user defined type classes a viable replacement for existential types (a.k.a. haskell-style type classes(
19:50:32Demosand c++ does not have anything called a trait, there are type traits but those are more compiler magic
19:50:35zaharyso that's why I prefer to keep the name
19:51:43dom96How about we call "user defined type classes" "type classes", and "type classes" "built in type classes"?
19:52:07zaharyto explain the plans, you should remember that I've talked about a type class like "ConvertibleToString" as an alternative to the local conversion that we currently support
19:52:08EXetoCdom96: T|U|V
19:52:16EXetoCthat's not really built in
19:52:19EXetoCtype variants?
19:52:41zaharyyou say that "ConvertableToString" requires an $ operator and then you automatically invoke it everywhere where the type class is used as param
19:52:45EXetoCthat feature is much older though
19:52:58Demoswell T|U|V could be type Foo = generic x \n (x is T) or (x is U) or (x is V)
19:52:59EXetoCConvertible</pedantic>
19:53:15zaharyI'm just explaining myself - that's not the real name
19:53:40OrionPKshould there be a prefix for user defined type classes, for convention?
19:53:46zahary… now, the same logic can be applied to a type class called "MatchesDynamicInterface" that is automatically converted to a fat pointer carrying a Vtable
19:53:55DemosI like how typeclasses are implicit, I dont want to have to write like Enumerable, Frobable, Runnable, and so on everywhere
19:53:57AraqOrionPK: no we getting rid of prefixes.
19:54:03OrionPKI know that araq
19:54:10zaharyand viola, you get existential types and dynamic binding without vtables stuck in the objects
19:54:15OrionPKbut it makes sense for this case imo
19:54:18EXetoCDemos: they are often not aliased though (proc foo[T:x|y|z])
19:54:38OrionPKthe IPrefix of C# interfaces, helps keep things sane
19:55:12AraqOrionPK: it's better to look cute than to help the programmer
19:55:20DemosOrionPK: well I dont like haveing to list out all the interfaces I want to support, hurts interop as well
19:55:22OrionPKlol
19:55:32EXetoCand that's very common, so it would increase verbosity considerably
19:56:01OrionPKaraq I dont think anyone would bitch at you for having a style guide that includes prefix for user defined type classes
19:56:21OrionPKbut I guess there's always someone to bitch about everything
19:56:24EXetoCpeople always will
19:56:42EXetoCyeah you gotta measure the frequency :>
19:58:13AraqOrionPK: the type classes will all end in 'able' or similar, ToStringAble, Comparable, etc.
19:58:28fowlstringifyable
19:58:44OrionPKaraq that seems like it would make things difficult to name
19:59:03OrionPKwe'll see though
20:00:58Demosbut then you have stuff like Container and SquareMatrix and whatnot
20:01:11Demosthey define properties of the type, not really what you can do with it
20:01:16Araqzahary your plans align well with mine which are to ultimately get rid of 'method'
20:01:49zaharywell, that's still single-dispatch mechanism
20:02:24DemosI have been finding that it is actually easy to just use function pointers (closures whatever) when I really need dynamic dispatch. I am sure methods are great for some things though
20:02:52zaharybut the double dispatch is surely generetable in user space too
20:03:01AraqDemos: yeah and they play somewhat nicer with the effect system
20:03:26reactormonkAraq, monads are kinda effects
20:03:45EXetoCDemos: I don't know if it's that important to differentiate between that and normal types. So perhaps you can just use your judgement and append "Trait" when necessary
20:03:46*Demos remembers writing a visitor, never again
20:04:18DemosI dont think it is important either, I like the way typeclasses are currently implicit
20:04:31EXetoCComparable is alright, but ToStringAble is kinda ugly imo
20:04:51Demoscould be something like Convertable[string]
20:05:23fowlEXetoC, stringifyable
20:05:51Araqyeah stringifyable is better
20:06:08reactormonkthere's string as in serialize and there's string as in display
20:06:18reactormonkso I'm for serializable and displayable
20:06:38DemosI think I will probably end up writing most of my generic code without typeclass constraints and add them as needed to improve the interface and errors
20:06:48fowlstring isnt the right structure to use for serializing
20:06:52fowl\0 allowed and all
20:06:55reactormonkAraq, according to the scala channel, there are none planned
20:07:05fowlseq[byte] works better
20:07:22reactormonkfowl, so any `$` operator is inheritly non-parseable?
20:07:39Demosagain, we should make sure to keep the typeclass system from getting verbose and explicit
20:07:52dom96What does Haskell call its Stringifyable type class?
20:07:56dom96display or something?
20:08:08fowlreactormonk, nobody uses $ for serializing
20:08:08*dom96 doesn't like Stringifyable
20:08:19EXetoCfowl, Araq: ok that's fine I guess
20:08:21reactormonkfowl, good.
20:08:43reactormonkfowl, imho it should generate nimrod code though
20:08:45Demosdom96: show I think
20:09:01fowlreactormonk, wat
20:09:35dom96Perhaps it would make sense to call our type classes something like "Show" without the 'able' suffix?
20:09:38Araqzahary yeah I now want the classic dispatchTable[a.id * 10 + b.id](a, b) but generated via macros
20:09:53reactormonkfowl, `$` of an object should give you the nimrod literal corresponding to that object
20:10:16fowlreactormonk, then $ on a string "foo" gives you "\"foo\"" ?
20:10:17Demosreactormonk: we are not homoiconic so storing stuff as nimrod code is kinda pointless
20:10:58Demosreactormonk: I do not agree, I think $ is allowed to destroy information
20:11:25reactormonkDemos, example?
20:11:27reactormonkfowl, yup
20:12:04zaharyAraq, yes, that's how it's going to work - you use a macro in the type section - it generates the "fat pointer" abstract value type, generates proc working on that type that use the dispatch table and finally, it generates a user defined type class that populates the table
20:12:54zaharyin the second sentence, procs should be plural
20:13:05*skyfex joined #nimrod
20:13:06EXetoCreactormonk: countless types, including things like euclidean vectors
20:13:10Demoslike if I print a color I may output rgb values "0"-"255" but the color may not be RGB
20:13:24EXetoC"allowed" or not, that's the way it has been used in general
20:13:26zaharyI'll have to add support for nkStmtListTy or something
20:13:32Demosor it may not be 8_8_8 RGB
20:13:39dom96Also, wouldn't it be more clear to just use $ on a generic instead of creating some "Stringifyable" (oh god this is too hard to type, please don't choose this name) type class?
20:13:50Araqzahary that already exists
20:13:58reactormonkDemos, the idea is to get a literal that produces the same object, however it may be
20:14:06zaharyah, will check it out then when I get to there
20:14:13Demosand `$` should not do that
20:14:20dom96reactormonk: if anything repr should do that.
20:14:23reactormonkdom96, let's just go for haskell and call it `show`
20:14:25*Puff quit (Read error: Operation timed out)
20:14:27EXetoCdom96: Conv[string]?
20:14:30reactormonkdom96, ok.
20:14:40Demosif I serialize a int16 as "4" how am I supposed to know it is an int16?
20:14:45AraqnkStmtListType, # a statement list ending in a type; for macros
20:14:45reactormonkconv[string] is good too imho
20:14:56reactormonkDemos, ok, I see your point.
20:15:04dom96Personally I don't think this needs a type class.
20:15:08Araqexists since forever, but I don't think it has been tested :P
20:15:09Demosalso produceing a real "object" at runtime is probably possible, but extremely hard.
20:15:42dom96EXetoC: ConvertsTo[string] ?
20:16:06Demosand produceing a real object at runtime would make it hard to do dead code elim
20:16:38Demosso you do not even want like "pickle" style serialization
20:16:43fowlCONFLICT (content): Merge conflict in compiler/ropes.nim
20:16:55fowlguess i gotta delete nimrod and check it out again
20:16:56fowlthanks, git
20:17:08dom96How would that work with other types? There is no way to check if a proc exists with a signature such as: proc (x: MyType): int which would be required for ConvertsTo[int].
20:17:17dom96Unless you just check if MyType.int compiles.
20:17:23EXetoCdom96: wasn't easy-to-type part of the argument? :p
20:17:53dom96EXetoC: ConvertsTo is easy to type. It's a bit long but it's still easier to type than Stringifyable
20:17:57fowldom96, var x: T; x = value
20:18:03*flaviu joined #nimrod
20:18:28reactormonkzahary, cool bugsquash spree
20:18:51dom96fowl: git reset --hard origin/devel
20:19:31dom96fowl: But don't do it if you have made changes.
20:19:39dom96fowl: Unless you don't care about keeping them.
20:19:44fowlty
20:20:27flaviuYou'll still have them if you've sent a pull request though
20:20:49*fowl sends all his PRs through the web interface
20:21:10dom96or if you pushed your changes, but you wouldn't have if you have conflicts :P
20:23:02EXetoCfowl: You don't want to? I found this https://github.com/stephencelis/ghi
20:23:53Araqzahary what about bug #976 ? looks like a simple 'is' bug to me
20:24:24Araqproc take[T: int2g](vale: int2) =
20:24:25Araq when T is int1: # how can that ever be true?
20:24:27Araq static: error("killed in take(int2)")
20:25:49zaharyT here is not the input type, but something that he passed as a parameter
20:26:16Araqargh
20:26:30AraqI missed that
20:26:35zaharyit should return false indeed, because the type class is unbounded (it includes other types besides int)
20:26:54*samaryan quit (Remote host closed the connection)
20:26:59zaharybut there are at least 3 other things that are not supported here :)
20:27:34Araqyou need a blog and write about type classes
20:28:10zaharyI'll write an articles about the generics system after I add the mimic types - I'll attack the C++ community with it
20:29:29AraqI don't think that's a wise idea ;-) mimic types are inherently unsound
20:29:37*Endy quit (Ping timeout: 240 seconds)
20:30:28Demosmimic types also mean that you need full source for all libraries, which honestly is usually true in any case but still
20:30:38zaharyI think the idea that "every function is generic" will resonate well with some people
20:30:58Demosmimic types are more than that though
20:31:04Demosright?
20:31:19flaviuGoogle turns up nothing on mimic types, is there another query I should try?
20:31:30Araqand everything that is unsound is BAD for marketing
20:31:34zaharythey are just a means to achieve this goal
20:31:35Demossince you can relax the generic type constraints from anywhere
20:31:58Demosflaviu: I think they allow you to make a proc generic at the callsite
20:32:25Demosso if you have proc(x: float): int you could call it with an int and it would be as if the proc was generic
20:32:44zaharythat's not a particularly good example
20:32:55flaviuThat sounds neat, sort of like structural typing?
20:33:00zaharyif you have a proc like boyerMooreSearch(x: string, y: string)
20:33:32zaharyyou can call it with boyerMooreSearch(MyCopyOnWriteString)
20:34:19Araqzahary we can implement them and mark them experimental and be defensive as in "we know they have inherent problems but they solve an important real world problem"
20:34:44Araqbut I don't think we can market them as a killer feature this day and age
20:35:03Araqin 10 years perhaps when people realized "correctness" is not a boolean property
20:35:12*BitPuffin joined #nimrod
20:35:38zaharyI don't see them as particularly unsound - you can shoot yourself in the foot, but there is plenty of code written against the stable interfaces of types you can imitate easily
20:36:40zaharybut, they surely belong in the "and finally, if that's not enough…" section
20:38:46zaharyyour thinking about tyProxy got you to imagine how if we follow the code all-the-way down, we get to ugly implementation details
20:38:49*Demos quit (Ping timeout: 252 seconds)
20:39:18flaviuWouldn't it be better to have the programmer specify what functions he wants that feature on?
20:39:26zaharybut mimic types don't do that - after you instantiate the generic, it will get back to your code as soon as there is a call to proc that you are implementing yourself
20:39:33Araqflaviu: that defeats the purpose
20:40:06Araqzahary I see
20:40:28Araqit's still very fragile, or perhaps not
20:40:57zaharyas I said, it's pretty safe with code that is already using the public interface of something
20:41:16Araqif boyerMoore makes usage of a new helper proc, the instantation process will look into that as well and it will continue to work ... hmm
20:42:39Araqflaviu: the default needs to be "open for mimic types", we could introduce a "closed for mimic types" pragma but for now I can't see the value in that
20:42:55Araqconservative people will start to use it everywhere and moan about the verbosity
20:42:55flaviu`proc `*`(a,b) = if(b==0): 0 else: a*(b-1)` as the decleration
20:42:55flaviuThen the programmer can pass in anything for a that supports multiplication with a b, and anything for b that supports substraction
20:43:31Araqflaviu: that works already with exactly this syntax
20:43:32flaviu"a a", not "a b"
20:43:54Araqwell you forgot the 'auto' return type
20:44:17flaviuoh, I didn't think of checking the irc logs
20:44:37nequitansI modded the blog post to incorporate Araq's most recent suggestions
20:45:12dom96What would the syntax be for these mimic types? Surely there would be an operator which would tell the compiler "I want a mimic type here" right?
20:45:39zaharyyou postulate that your types mimics another type
20:45:49zaharythe first version will be ugly on purpose and it will use a pragma
20:45:59zahary{.mimic: my_string is string.}
20:47:15zaharygeneric types are also allowed here. you can say
20:47:15zahary{.mimic: bitset is seq[bool].}
20:47:22zaharyor myarray is seq
20:49:56*Demos joined #nimrod
20:49:56*Demos quit (Client Quit)
20:50:41*carum joined #nimrod
20:51:02*Tuned joined #nimrod
20:51:31*Demos joined #nimrod
20:51:37TunedIs multiple inheritance planned for Nimrod in the future?
20:54:56DemosProbably not Tuned. MI is not a very good idea
20:55:06flaviuTuned: I think you're looking for type classes: http://build.nimrod-lang.org/docs/manual.html#user-defined-type-classes
20:55:22Demosthere is a lot of stuff that c++ does behind the scenes to make MI and esp virtual inheratance work
20:56:18AraqTuned: I'm not opposed to MI but it's lots of work and we have much more important things to do
20:56:52AraqMI won't come before 1.0 is out
20:57:14Demoshow would MI work with miltimethods?
20:57:29Demosactually hold that I gotta go
20:58:40AraqMI with multi-methods is a solved problem
20:58:52TunedWould it be too hard if it was just implemented for the C++ compiling and not C?
20:59:37AraqTuned: the C++ target doesn't help much, the type checker needs to be taught that an object can have multiple direct parents
21:01:07Araqnequitans: 'zeros' is not necessary, alloc uses newSeq which initializes to 0 for you
21:01:56*Demos quit (Ping timeout: 265 seconds)
21:02:40Araq"also In addition, Nimrod also supports an effects system which allows for additional compile-time safety checks."
21:02:56Araq<-- "addition" used twice
21:04:22*BitPuffin quit (Ping timeout: 244 seconds)
21:06:22nequitansAraq, post updated
21:07:42Araqnequitans: I still think you should use (a: Matrix) instead of [T](a: Matrix[T])
21:07:43nequitansi am *this* close to doing static blog post generation
21:07:56nequitanskk
21:08:05Araquse ipsum genera, it's written in nimrod
21:08:20Araqthen you can say even this blog post has been created with nimrod
21:09:23nequitanslol, noted. I'm changing a buch of &quot; to actual quotes now -- it's 2014, and this is happening :)
21:09:37zaharynequitans: where is your blog, btw?
21:09:58nequitansit's hosted by wordpress.com
21:10:00flaviuzah: http://geetduggal.wordpress.com/author/nequitans/
21:12:25Tunedis := part of syntax in Nimrod? I was thinking for var a = 10, a := 10 could be a simpler way to do the same.
21:12:42flaviuTuned: Make a template for it
21:13:02nequitansAraq, for proc `[]`[T](A: Matrix[T], r,c: int): T, is there away to avoid using the T, or are you suggesting it just for the overall matrix type
21:14:36flaviuTuned: template `:=`(name:expr, value: expr): stmt = var name = value
21:14:46flaviunimrod now had syntax that does exactly that
21:15:27zaharynequitans: that would be proc `[]`(A: Matrix; r,c: int): Matrix.T
21:15:50Araqflaviu: you need to make that template 'dirty'
21:16:09nequitanszahary, thx
21:16:22Araqand 'immediate'
21:17:01nequitansso everytime i want to refer to the matrix's type, I just say Matrix.T
21:17:52Araqyeah
21:18:52Araqnequitans: instead of for i in 0 .. A.nrows-1
21:19:08Araqfor i in 0 .. <A.nrows is more idiomatic
21:19:13dom96nequitans: Would you be able to make the nimrod logo a hyperlink to the nimrod site?
21:19:52EXetoClinalg for all
21:22:20nequitansdom96, sure
21:23:18*Demos joined #nimrod
21:23:54NimBotAraq/Nimrod devel a3ca0d2 Araq [+0 ±1 -0]: minor additions to the manual
21:23:54NimBotAraq/Nimrod devel 54881b0 Araq [+1 ±2 -0]: osproc compiles again for haiku
21:23:54NimBotAraq/Nimrod devel 3a60d33 Araq [+5 ±29 -0]: Merge branch 'devel' of https://github.com/Araq/Nimrod into devel
21:24:00nequitansAraq, noted. zahary, i'm getting some compile time errors when changing the code to: proc `[]`(A: Matrix; r,c: int): Matrix.T like this uniformly everywhere
21:24:34Araqnequitans: do you use the devel version of the compiler?
21:24:52nequitansah, yea, i just switched machines that has a non-devel
21:25:18Araqgreat that you check the code compiles
21:25:25Araqwanted to tell you that :P
21:25:46Araqyou should also submit your code to tests/showoff so that it keeps working
21:26:21Araqwe're plagued by regressions unfortunately
21:26:54nequitanskk
21:28:53*filwit joined #nimrod
21:35:45nequitansI noticed the user defined classes are in the build.nimrod-lang.org -- should I avoid mentioning this in the post (was thinking about it)?
21:38:26Tunediff should be if, small typo "A type a is implicitly convertible to type b iff the following algorithm returns true:" http://build.nimrod-lang.org/docs/manual.html
21:38:58Tunedbiff sounds a bit aggressive.
21:39:17dom96No, that's not a typo.
21:39:50EXetoCTuned: iff means "if and only if"
21:48:58fowlhow big of a job is fixing all the case sensitive stuff
21:51:41fowlcompiler/vm.nim(718, 44) Error: type mismatch: got (PNode, PType, seq[TFullReg], range 1..256(int), range -1..254(int), TLineInfo)
21:54:08Araqfowl: nimrod pretty does it
21:54:49*Discolod1 left #nimrod (#nimrod)
21:59:46Varriount|Mobilenequitans: Or add a link to the build docs
22:00:23nequitansVarriount|Mobile, the version up right now does exactly that
22:01:43fowlAraq, i get that error on devel
22:05:13*filwit quit (Quit: Leaving)
22:06:07Araqfowl: nimbuild disagrees with you
22:06:20Araqand ofc it compiles on my machine too
22:07:55*filwit joined #nimrod
22:12:50*BitPuffin joined #nimrod
22:13:00BitPuffinoi
22:13:17BitPuffinAraq: got stuck doing some data recovery stuff which just ate up way too much time so I'm gonna have to postpone :(
22:13:35*filwit quit (Quit: Leaving)
22:15:19*filwit joined #nimrod
22:16:09*Tuned quit (Remote host closed the connection)
22:17:57*carum quit (Remote host closed the connection)
22:21:24nequitansthe compile times in nimrod are wicked fast
22:22:58*Demos quit (Ping timeout: 264 seconds)
22:25:17Varriountnequitans: And don't require autotools!
22:25:53nequitansWhen I first started playing w/ Nimrod, I was also impressed at how fast the lang compiled. Nobloat.
22:35:18dom96Are we redditing then!?
22:37:54fowlok
22:38:02fowlit must be broken then
22:38:06*carum joined #nimrod
22:38:36*DAddYE quit (Remote host closed the connection)
22:40:19*DAddYE joined #nimrod
22:47:41nequitansdom96, i'm cool w/ it if others are :)
22:49:51dom96Araq: well?
22:59:48NimBotAraq/Nimrod devel 9879ecb Zahary Karadjov [+0 ±4 -0]: fix tsemistatic
22:59:48NimBotAraq/Nimrod devel a262a92 Zahary Karadjov [+1 ±3 -0]: Merge branch 'devel' of github.com:Araq/Nimrod into devel
22:59:56flaviunequitans: Line 5 under *Quick start with Nimrod* has a minor bug, the error code can be anything but 0, not just 1
23:00:18nequitansflwit, thanks
23:01:01nequitansi'm headed out, but will be online l8r
23:02:11Araqnequitans: it's good
23:02:26*io2 quit ()
23:08:17*darkf joined #nimrod
23:12:28fowlAraq, i get the same error on a fresh repo
23:15:35Araqfowl: my vm.nim:718 contains if newValue.kind != nkEmpty:
23:15:48Araqah, do you compile with -d:useFFI ?
23:15:58Araqthat might indeed be broken right now
23:16:42fowlyea
23:17:00fowlthx
23:29:04*nande joined #nimrod
23:45:21*carum quit ()
23:48:06dom96well i'm away to sleep.
23:48:35dom96nequitans: You can reddit it if you want, but maybe it would be better to wait until tomorrow.
23:48:40dom96'night