<< 13-07-2013 >>

00:01:02Max00355Wow, nice :P
00:01:03*Sergio965 joined #nimrod
00:01:08Max00355http://github.com/Max00355
00:01:12Max00355That's mine.
00:02:19dom96yeah, some of my projects are also in https://github.com/nimrod-code
00:02:43Max00355Oh, wow, awesome.
00:05:29dom96hrm, BlooCoin sounds familiar.
00:05:46dom96so many *coin nowadays though heh
00:33:39Araqgood night
00:36:26DAddYEhey there, another noob question
00:36:36DAddYEI'm unable to find any doc about that
00:36:46DAddYEif I've: proc poll_init*(loop: ptr TLoop)
00:37:09DAddYEwhat the best way to provide a pointer of TLoop
00:37:14DAddYE(allocated)
00:37:17DAddYE?
00:37:47dom96addr loop
00:38:02dom96But unless you are interfacing with C you shouldn't be using 'ptr'
00:38:13dom96use var or 'ref'
00:39:05DAddYEdom96: I'm interfacing with c
00:39:24DAddYEdom96: so you mean some: var loop = TLoop.new
00:39:40DAddYEpool(addr(loop))
00:39:41DAddYE?
00:39:42dom96new() only works for 'ref' I think
00:39:48DAddYEdom96: exaclty
00:40:48DAddYEso how I can get a pointer of a object?
00:44:08dom96DOesn't the C lib have a way to init this TLoop structure?
00:44:09dom96oh yeah
00:44:09dom96poll_init does the initing.
00:44:09dom96Is that a function from the C lib?
00:44:09dom96if so then:
00:44:09dom96var loop: TLoop
00:44:09dom96poll_init(addr loop)
00:44:44DAddYEdom96: lemme try
00:45:05dom96by doing 'addr obj'
00:45:11dom96or addr(obj)
00:46:24DAddYESIGSEGV: Illegal storage access. (Attempt to read from nil?)
00:46:34DAddYEso should be allocated before
00:49:12dom96show me your code
00:51:51DAddYEhttps://github.com/DAddYE/gist/blob/master/uv.nim
00:53:39dom96where is the code where you are using the uv wrapper?
00:54:06DAddYEright now, I'm writing a test so
00:54:10DAddYEI'm initializing a timer
00:54:18DAddYEno more than one line
00:54:28DAddYEvar timer = TTimer.new
00:54:37DAddYElet Loop = default_loop()
00:54:58DAddYEerr = timer_init(loop, addr timer[])
00:55:04DAddYE ^^^
00:55:20dom96huh?
00:55:26dom96You're not even using poll_init?
00:55:44dom96TTimer.new doesn't look right
00:56:23DAddYEdom96: was a copy/paste issue but the problem is the same
00:56:24dom96ok, so default_loop returns a ptr TLoop
00:56:37DAddYEdom96: exactly
00:56:42dom96I think you'd be safer using 'var' there
00:56:50DAddYEok
00:57:22dom96and then remove the []
00:57:38dom96on which line does the segfault happen?
00:58:13DAddYEthis was a try since addr(TTimer.new) => pointer to => ref TTimer
00:58:27DAddYE[] is a dereference so a pointer to pointer
00:58:30DAddYE(I guess)
00:58:45dom96lol, yeah. I don't think doing that is a good idea :P
00:58:55dom96var timer: TTimer
00:59:01dom96var loop = default_loop()
00:59:04DAddYEokj
00:59:10dom96err = timer_init(loop, addr timer)
00:59:12dom96Should work.
00:59:21dom96But i'm not familiar with libuv
01:00:36DAddYEyep, it does
01:00:38DAddYEthanks man
01:00:52DAddYEjust because is day 2 for me in Nimrod
01:01:23DAddYEvar timer: TTimer means => var timer = null of TTimer type ?
01:02:33DAddYEvar timer: TTimer means => declares timer to have type TTimer
01:02:44DAddYEand timer is NULL
01:02:45DAddYEright?
01:03:11dom96kinda
01:03:42dom96var timer: TTimer # declares a variable of name `timer` and type `TTimer`
01:04:10dom96Each of the fields of the object are initialised to their defaults.
01:04:25DAddYEdom96: so after timer_init(loop, addr timer)
01:04:27dom96i.e. if TTimer object has an int field it is '0' (IIRC) not nil.
01:04:32dom96timer itself is not nil
01:04:47DAddYEwhat happen to the original timer var?
01:04:56DAddYEhow I can see fields populated ?
01:05:09dom96I dunno what libuv does, but it possibly sets the fields to some values.
01:05:13dom96repr may work
01:06:02*Associat0r quit (Quit: Associat0r)
01:06:02DAddYEecho repr(timer)
01:06:04DAddYESIGSEGV: Illegal storage access. (Attempt to read from nil?)
01:06:07DAddYE-.-
01:06:19DAddYEfrom the manual should fill fields
01:08:38dom96maybe it doesn't.
01:08:49dom96why do you want to see all the fields?
01:12:37DAddYEdom96: just for testing
01:13:09dom96I still feel that repr should never just crash.
01:13:31dom96Not sure what Araq's take was on that.
01:13:47DAddYEecho repr(timer)
01:13:51DAddYEbefore timer_init
01:14:02DAddYEreport correctly all fields to their default value
01:14:06DAddYEafter timer_init
01:14:09DAddYEjust crash
01:22:11*q66 quit (Quit: Leaving)
01:29:12*DAddYE quit (Remote host closed the connection)
01:29:46*DAddYE joined #nimrod
01:33:05dom96anyway, I have to sleep.
01:33:07dom96Good night
01:34:19*DAddYE quit (Ping timeout: 256 seconds)
02:13:26*Sergio965 quit (Ping timeout: 240 seconds)
02:30:21*DAddYE joined #nimrod
02:34:48*DAddYE quit (Ping timeout: 245 seconds)
03:10:11*DAddYE joined #nimrod
03:33:19*Trix[a]r_za is now known as Trixar_za
03:56:16DAddYEAraq: big question, why nimrod is not case sensitive
03:56:46DAddYE?
04:36:32*OrionPK quit (Read error: Connection reset by peer)
04:40:08Max00355Because it isn't Java
04:43:45Max00355dom96: BLC sounds famiular you say? They were popular about two months ago. I created it myself frm scratch.
05:00:57DAddYEMax00355: what does it means?
05:01:05DAddYEMax00355: every language I know is sensible case
05:01:12DAddYEmaybe Visual Basic isn't
05:58:37*comex quit (Quit: Coyote finally caught me)
05:58:45*comex joined #nimrod
07:07:44*Associat0r joined #nimrod
07:07:44*Associat0r quit (Changing host)
07:07:44*Associat0r joined #nimrod
07:26:02*zahary joined #nimrod
07:34:15AraqDAddYE: Lisp, Pascal, Ada, Eiffel, Basic are case insensitive
07:34:49Araqit's mostly some historic thing as keyboards only supported upper case
07:36:52Araqthat said, nimrod is style insensitive because people spend too much time about underscore_crap vs camelCase vs PascalCase
07:37:01Araq*arguing about
07:39:08DAddYEAraq: I can agree, but let's say that modern language are case sensitive
07:39:18DAddYEthen u can dictate your stile
07:39:22DAddYEthen u can dictate your stYle
07:39:31DAddYElike we do with T and P
07:39:46DAddYEhaving a sensible case will help me a lot
07:39:55DAddYEso I can avoid TIo
07:40:08Araqyes but the idea is that your IDE/editor can render the identifiers as you prefer
07:40:26Araqthough no editor does that yet ;-)
07:40:41DAddYEAraq: not at all we use and Ide like Eclipse/VS
07:40:50DAddYEI'm a poor man with vim
07:40:52DAddYE:D
07:41:03Araqconsistency is better left to tools IME
07:41:12DAddYEI agree
07:41:14DAddYEbut say that
07:41:20DAddYETIo
07:41:38DAddYEif isn't written by you isn't under stable at first look
07:41:42DAddYEIO
07:41:49Araq*shrug* I can deal with your nick here, DAddYE
07:41:55DAddYEAraq: hahahah
07:41:57*Trixar_za is now known as Trix[a]r_za
07:42:04DAddYEI mean, I'm for freedom
07:42:17DAddYEbut _ and camel case are for me the opposite
07:42:26DAddYEI've a style where
07:42:33DAddYETypes are CamelCase
07:42:37DAddYEconstant CONSTANT
07:42:41DAddYEbut
07:42:46DAddYEtimer_start
07:42:49AraqI've programmed in enough languages to not give a shit about these things
07:42:53DAddYEshouldn't be the same of timerstart
07:43:13*Trix[a]r_za is now known as Trixar_za
07:43:50Araqusing case to distinguish between different entities is just another form of hungarian notation
07:43:54DAddYEthat's a thing, but consider that I need to spend time to figure out a different name
07:44:12AraqI agree it causes problems for wrappers
07:45:02Araqconstants are CONSTANT because of the preprocessor
07:45:08DAddYETime = object; TIME = enum; [1 .. 60];
07:45:14Araqwe have no preprocessor so it doesn't make sense
07:45:40DAddYEproc time() = Time.now
07:46:02DAddYEis easier (remember that I'm super new)
07:46:05DAddYEto
07:46:17DAddYETTime = object; ETIME = enum; [1 .. 60];
07:46:37DAddYEproc time() = TTime.now
07:46:41Araqthere is no ETIME
07:47:08DAddYEI saw that in some wrappers
07:47:15DAddYEotherwise (like I've)
07:47:20DAddYETTime = object; TIME = enum; [1 .. 60];
07:47:35DAddYEproc time2() = Time.now
07:47:49Araqand then we use TiMe for a time represented as a float?
07:48:00Araqand why is that a good idea?
07:48:16DAddYEAraq: I'm not a super expert to say that
07:48:17DAddYEbut
07:48:33DAddYEruby, python, go, clojure,
07:48:36DAddYEscala
07:48:40DAddYEjava
07:48:45DAddYEand so on are in that way
07:48:52DAddYEso programmers like me
07:48:59DAddYEthat have code for 10 years
07:49:17DAddYEhave some difficulties to learn a different way
07:49:54DAddYETIO, TTIME, TOS, looks more weird than Io Time TimeFloat
07:50:05DAddYEor OS
07:50:50Araqyou can do 'var time: time' btw
07:51:05Araqthe T vs P is about value vs reference types
07:51:35Araqwhich require different coding styles so I thought it is a good idea to keep that convention from delphi
07:51:37DAddYEbut if I omit T/P
07:51:50DAddYEthen when I need a procedure
07:51:57DAddYEI should invent a name
07:52:26Araqyeah I figured inventing names is a big problem for many people
07:53:28Araqbtw Go -- does something special with case too
07:53:35DAddYEyes
07:53:41*Trixar_za is now known as Trix[a]r_za
07:53:50Araqpython -- likes to be case insensitive
07:54:03Araqat least Guido wanted that once
07:54:24DAddYEgo, has Camel for public
07:54:39DAddYEgo is very strict about those things and people seems to like it
07:54:41AraqJava, Scala, Ruby - I don't think the creators of these languages really thought about it
07:54:51DAddYEhahahah, totally agree
07:55:40DAddYEcan we argue that 90% of common used languages are case sensitive?
07:55:44DAddYEisn't a thing of style
07:55:53DAddYEI mean, you know that better than me
07:56:07DAddYEis more as a habit that we haven't
07:56:17DAddYEand sensible case reduce at least by 3
07:56:25DAddYEour naming rules
07:57:10Araq*shrug* 90% use {} too
07:57:33DAddYEnot using it
07:57:41DAddYEis different to say
07:57:49DAddYEuse ∫∫
08:00:07Araqhttp://www.reddit.com/r/programming/comments/1i3qi9/cereal_a_c11_library_for_serialization_binary_xml/cb0sijv
08:01:18Araqbtw experiments showed snake_case to be more readable and yet I hate it
08:03:06DAddYEI'm for it in procedures
08:03:16DAddYEhelps your readability
08:03:19DAddYEbut like in javashit
08:03:26DAddYEI've no problems with CamelCase
08:03:41Araqso what do you do as a language designer? design for the Right Thing (TM) or design for yourself? ;-)
08:03:43DAddYEcamelCase for functions
08:04:07DAddYEgive up the choice
08:04:14DAddYEto do whatever u what
08:04:25DAddYEBUT
08:04:39DAddYEif you want to contribute in my repo, please read my code style guide
08:04:54DAddYEsimple good and okay for most of us
08:05:05DAddYEhttp://uscilab.github.io/cereal/index.html
08:05:12DAddYEwrote in camel case he can
08:05:22DAddYEif he like it that's okay
08:05:28DAddYEbut I can't
08:05:33DAddYEand that's my problem :D
08:05:52Araqbut that problem is mitigated in Nimrod ;-)
08:05:53DAddYEonly STUPID that should NO CODE
08:06:01DAddYEonly STUPID that should write NO CODE
08:06:16DAddYEcan do: timer_start then timerstart then TimerStart
08:06:34DAddYEfortunately never seen that code
08:06:35Araqyou know ... it's all the same to me
08:06:50Araqit's something like timer-start
08:07:00DAddYEis lispy
08:07:05DAddYEI don't like it that much
08:07:15DAddYEbut I wrote a lot of code in clojure
08:07:27DAddYEand it's okay... for lisp languages
08:07:54DAddYEmaybe you can consider it stupid
08:07:57DAddYEbut like lua
08:08:15DAddYEpeople complain about index that start from 1
08:08:26DAddYEthere are good reason behind it
08:08:33DAddYE(index of array)
08:08:36Araqbtw psychology tells us people remember the sound of words, not their spelling
08:09:01DAddYEinfact here we came
08:09:07DAddYETTime
08:09:20DAddYEtitime?
08:09:28DAddYEttime?
08:09:36Araqt_time ?
08:09:44DAddYEsame
08:09:46Araqoh wait t_time is bad but time_t is fine
08:10:03DAddYEor _s if is a struct
08:10:05Araqbecause time_t comes from C so it's a classic
08:10:22DAddYEhonestly I hate a lot prefixes
08:10:25DAddYEand suffixes
08:10:32DAddYEI prefer camelcase
08:10:42DAddYEUPPER => I know is a constant
08:10:59DAddYECapitalize => That's is a type or a Object
08:11:03Araqwhat if it's read from a config file?
08:11:23DAddYElower_maybe_underscore => method/procedure
08:11:34Araqis a "conceptually" constant CONST for you?
08:12:01DAddYEunless is a crappy json thing
08:12:03DAddYEyes
08:12:21Araqfair enough but then the compiler can't enforce your naming scheme
08:12:28Araqand that sucks imho
08:12:36DAddYEwait
08:13:10DAddYEare u sure that CIO is a constant?
08:13:20Araqno
08:13:20DAddYEso is the same
08:13:35Araqbut then I don't program by guessing around in the first place
08:14:20Araqmy mouse cursor should tell me what it is when moving over it
08:15:00DAddYEunless again is a config file
08:15:00DAddYEor like a lot of us
08:15:10AraqI know, I know, people don't use/have the proper tools
08:15:10DAddYEyou code in vim/emacs
08:15:40DAddYEnever tried aporia but
08:16:00DAddYEEclipse sucks in all sense
08:16:00Araqso?
08:16:20DAddYEVS is good but I prefer lost an hand before using again windows
08:16:20AraqVisual Studio is bearable, Delphi was great
08:16:40DAddYEdon't know that much on linux
08:16:55DAddYEbut on mac stylish tools like sublime
08:16:55DAddYEpython powered
08:17:10DAddYEor Texmate Ruby+c++
08:17:35DAddYEboth good but again unless some weird plugin is a vanilla text editor
08:17:45DAddYEI mean
08:17:45DAddYEthe point is
08:17:55DAddYEif you make nimrod case sensitive
08:17:55DAddYEyou can dictate your coding style
08:18:20DAddYEyou can still write PTime => The only case where I totally agree
08:18:30DAddYEif you like TTime you can write it
08:18:40DAddYEbut if another one would like to use Time and time
08:18:50DAddYEshould be free to do it
08:19:15DAddYEisn't a critique
08:19:15DAddYEbut trust me
08:19:30DAddYEyou are saying me
08:19:40DAddYEhey bro, you are right handed but now start to write with the left
08:20:10Araqtype Time = TTime
08:20:10Araqand you're free again
08:20:30DAddYEno
08:20:40DAddYEproc time():
08:20:50DAddYEwill be raise a redefined problem
08:21:15Araqwe could change that, it's a bit buggy already
08:21:15DAddYEanother important thing
08:21:25DAddYEis that in this way
08:21:25DAddYEIMHO
08:21:35DAddYEyou are archiving the opposite problem
08:21:45DAddYEsome code itself in nimrod
08:21:45DAddYEis written in CamelCase
08:22:00DAddYEsome in snake_case
08:22:10DAddYEsome without any of them
08:22:30DAddYEsome like the lua wrapper
08:22:30Araqyeah and I can import it and write it so that it adheres to my style
08:22:40DAddYEeven without T/P/E
08:23:00Araqlua_usesthisstyle
08:23:20Araqso ... how do you fix that in C?
08:23:20Araqyou can't
08:23:30DAddYEinfact
08:23:30Araqyou're stuck with their bad taste
08:23:50DAddYEyou're case sensitive
08:24:15DAddYEif you want to rename UV_Time function (all of them are lowercase btw)
08:24:30Araqalso ... me/the compiler enforcing a naming scheme is a nice idea
08:24:30Araqhowever
08:24:40AraqI don't know of a working naming scheme
08:24:40DAddYEproc myCoolName: {.importc "lua_cool_name"}
08:25:20DAddYEI can't argue for procedures
08:25:20DAddYEwhatever is okay to me
08:25:30DAddYEbut types Imho
08:25:40DAddYEshould start for CapitalLetter
08:25:50DAddYEconst UPPER
08:25:50DAddYEthen, IMHO up to the coder
08:26:15DAddYE99% know that code is like the os (unix)
08:26:15DAddYEcase sensitive
08:26:25DAddYE1% don't know that isn't
08:27:35DAddYEand trust me we can see some differences between snake or camel but ONLY in procedures/methods/functions
08:27:35DAddYEnever seen in my life
08:27:50DAddYEclass foo < Bar; end
08:28:00DAddYEor type my_type
08:28:10Araqtime_t
08:28:35DAddYEstruct
08:28:35DAddYEor type
08:28:45DAddYEsorry type
08:28:55DAddYEbut again
08:29:10DAddYEthat's is up to the coder
08:29:10DAddYEpython codebase
08:29:20DAddYEis in CamelCase
08:29:20DAddYEand is c
08:29:35DAddYEpreventing case sensitive
08:29:55DAddYEyou aren't avoiding those exception
08:30:11DAddYEbut allowing TiMeIsNow
08:30:11Araqwell
08:30:41AraqC doesn't prevent TiMeIsNow either it's just that you're stuck with it
08:31:01Araqshould the guy writing the definition be drunk
08:31:16DAddYEexactly for the same reason
08:31:26DAddYEcase insensitive should be unnecessary
08:31:36DAddYEother than a bit confusing
08:31:46DAddYEmostly removed 3 choices
08:31:46DAddYEfor naming
08:31:56DAddYEthat is 90% of the problem
08:32:11AraqI'm sorry but you don't make sense
08:32:36Araqok, so it's myIdent in Python and in C it's my_ident
08:32:36Araqand I mix these languages
08:32:51Araqand it's no problem
08:32:51Araqbut when I have the same thing all in Nimrod
08:33:01Araqit starts to be a problem
08:33:01Araqfor you
08:33:11Araqand I have no idea why that is
08:33:21DAddYEthe fact that I need to prefix everything
08:33:36Araqyou don't
08:33:36Araqbut it's the convention in the stdlib
08:33:51Araqoh wait, you don't like conventions that are not your own
08:33:51DAddYEotherwise I've redefinition problem
08:34:11DAddYEenum HOUR, MINUTE, SECOND
08:34:11DAddYEconflict with
08:34:11Araqyou could give different things different names
08:34:21DAddYEproc hour
08:34:21Araqalso there is .pure for enums
08:34:36DAddYEyea thanks to you I figure out the problem
08:34:51DAddYEbut I spent 1 hour gsubbing last day
08:34:51DAddYE:D
08:35:41DAddYEin C I can write struct Foo {}; function foo(){};
08:35:41DAddYEin nimrod not
08:36:01DAddYEin python again class Foo:
08:36:01DAddYEdef foo
08:36:11DAddYEnimrod not
08:36:11DAddYEthat's the thing
08:36:31Araqsome say functions should be verbs and types should be nouns ...
08:37:01DAddYEin C I can write struct Time {}; function time(){};
08:37:11DAddYEor I should
08:37:11DAddYEin C I can write struct TheTime {}; function time(){};
08:37:21Araqin nimrod I can type allinlowercasefordebugging
08:37:31Araqand I surely don't want to miss *that*
08:38:21Araqyou know ... for the people who have no proper tools like a debugger ;-)
08:38:21DAddYEI think a macro/template debug allinlowercasefordebugging could work
08:38:36AraqI don't think so
08:38:56DAddYEor even better: autocomplete :D
08:39:16AraqI have no intellisense for the conditions in breakpoints
08:39:16Araqin visual studio
08:39:36Araqmakes you realize how much case sensitivity does suck
08:40:01Araqit's only bearable due to autocomplete IMHO
08:40:21Araqof course the autocomplete itself is case insensitive
08:40:21Araqproving my point :P
08:40:41DAddYEAraq: the point is that u use windows
08:40:51*XAMPP_ joined #nimrod
08:41:11DAddYEand the system itself told you
08:41:11DAddYEin years that is insensitive
08:41:31DAddYEunix guys
08:41:31DAddYEis the opposite
08:42:01*Araq despises Unix
08:44:01DAddYEbtw up to you, at end is your language :D
08:44:31DAddYEquick info, do u really like windows?
08:44:31DAddYE0.0
08:44:41*XAMPP quit (Ping timeout: 264 seconds)
08:45:36AraqI'm typing this on a Linux ...
08:46:21*Araq doesn't like any OS really
08:46:41DAddYEwow, for I moment I was scared :D
08:46:51Associat0rDAddYE: I use windows
08:48:01DAddYEAssociat0r: we are talking about like/dislike os'es
08:48:16DAddYEAraq: back to a real code
08:49:01AraqDAddYE: there is 'repr' in the language and I have mRepr that is the magic value for it and opcRepr is its opcode in the VM I'm writing
08:49:16DAddYEhttps://github.com/DAddYE/gist/blob/master/uv.nim#L806-L807
08:49:16Araqwith your way I'd have REPR for the magic and then need opcRepr anyway
08:49:41Araqor use .pure enums which I don't like
08:50:21*Araq doesn't mind prefixes, they always sneak into Araq's world
08:51:01DAddYEproc repr; const/enum M_REP, O_REP
08:51:21DAddYEbut again turning on case sensitive will never change your stile
08:51:36Araqyeah prefixes ftw ;-)
08:51:36DAddYEturning of yes
08:51:46DAddYEturning off yes
08:51:56*DAddYE can't spell today
08:52:41DAddYEbut I can create a type: Rep
08:53:11AraqI'm willing to implement something to lessen your pain but you'd better come with something that works
08:53:11DAddYEwhich 99.8% of coder should know that in c'ish language starting with Capital means class/struct/object/type
08:53:11Araq*come up
08:53:31Araqand why is that important?
08:53:41Araqwe have the ':' to indicate "type following here"
08:53:56DAddYEfor me is:
08:54:16DAddYEdoes that guy who wrote that wrapper used the prefix
08:54:36Araqagain the convention is to skip the C prefixes
08:54:56Araqbecause you can do uv.setInterval()
08:54:56DAddYEbut you can't create types without prefixes
08:55:06Araqyes you can
08:55:06DAddYEuv.ttimer
08:55:41Araqand you can also write tTime which may read better for you as it emphasizes the Time aspect better
08:56:01DAddYEI will kill my self before
08:56:01Araqbut as I said
08:56:16Araqcome up with a good proposal to "fix" this language wart
08:56:26DAddYEtype/classes/etc in modern languages should be throated with Capital
08:56:26DAddYEAraq: okay
08:56:36Araqwhich it obviously is because I spent too much time arguing about it
08:56:36DAddYEwill do this weekend
08:56:51AraqI have to go, see you later
08:56:51DAddYEAraq: https://github.com/DAddYE/gist/blob/master/uv.nim#L806-L807
08:57:21Araqwhat about it?
08:57:21DAddYEbeside the fact I don't need do:
08:57:31DAddYE(was just a try)
08:57:41DAddYEdoesn't work
08:58:01Araqwrite a bug report then
08:58:16DAddYEu're right
08:58:16DAddYEbut not sure if is a bug
08:58:26DAddYESIGSEGV: Illegal storage access. (Attempt to read from nil?)
08:58:56DAddYEsince you talk about repr
08:58:56DAddYEon line https://github.com/DAddYE/gist/blob/master/uv.nim#L794
08:59:06DAddYErepr(time) raises the same problem
08:59:16DAddYEbut
08:59:26DAddYE*timer
08:59:36DAddYEbut I checked and is populated
08:59:36DAddYEso timer.timout => 1000
08:59:46DAddYEtimer.data => pointer
08:59:46DAddYEand so on
08:59:56DAddYEI guess is GC thing
09:01:51DAddYEusing discard works well
09:02:21AraqI don't think it's a Gc thing
09:02:31Araqbut I'm away
09:02:41DAddYEoki
09:19:11*Associat0r quit (Quit: Associat0r)
09:53:11*DAddYE quit (Remote host closed the connection)
09:53:41*DAddYE joined #nimrod
09:57:51*DAddYE quit (Ping timeout: 245 seconds)
10:09:41*fowl quit (Quit: EliteBNC free bnc service - http://elitebnc.org)
10:29:16*fowl joined #nimrod
10:34:31*EXetoC joined #nimrod
10:36:31*q66 joined #nimrod
10:41:56*fowl quit (Quit: EliteBNC free bnc service - http://elitebnc.org)
10:55:42*DAddYE joined #nimrod
11:00:52*DAddYE quit (Ping timeout: 264 seconds)
11:12:37*Amrykid quit (Changing host)
11:12:37*Amrykid joined #nimrod
11:19:52*jbe_ joined #nimrod
11:21:42dom96hi jbe_
11:23:37jbe_hi dom96
11:23:57jbe_was just looking at your code
11:24:12jbe_what's the state of the sdl2 wrapper?
11:24:32jbe_or actually, sdl/sfml support in general
11:24:42dom96The state is pretty good I think.
11:25:57jbe_just started messing with Nimrod yesterday, love it so far
11:27:22dom96I haven't personally used fowl's sdl2 wrapper but i've used the sdl wrapper that is in the stdlib and it worked well. I think it wraps an older sdl version though.
11:27:42jbe_yeah
11:28:02dom96I've created a game using SFML for Ludum Dare and didn't have any problems with the wrapper
11:28:17jbe_cool, which one?
11:29:02dom96https://github.com/fowlmouth/nimrod-sfml
11:29:22*zahary quit (Quit: Leaving.)
11:29:52dom96jbe_: how did you find out about Nimrod?
11:30:02*nihathrael quit (Quit: Unknown Horizons - Open Source real-time strategy with the comfy 1602 feeling!)
11:30:22*nihathrael joined #nimrod
11:31:32jbe_hmm let me think... it was something very very random, i don't remember, i think i heard it mentioned somewhere and googled it :P
11:32:22dom96I see. I'm asking because i'm wondering what the best way to advertise nimrod is :P
11:36:22jbe_hmm.. i'm surprised the language isn't more famous, but i guess maybe that can be a good thing in the beginning..
11:36:52jbe_as soon as some awesome software gets written using it, perhaps...
11:37:22dom96I think most people don't use it because there is no big company behind it.
11:37:57jbe_good point :|
11:39:02jbe_could you help me understand a compile error?
11:39:22jbe_was just trying to use sdl_ttf from std
11:40:02jbe_scene/root.nim(45, 40) Error: type mismatch: got (PFont, cstring, TColor)
11:40:02jbe_but expected one of:
11:40:02jbe_sdl_ttf.RenderText_Blended(font: PFont, text: cstring, fg: TColor): PSurface
11:40:22*zahary joined #nimrod
11:41:42dom96yeah, that error is confusing.
11:41:52dom96(I've submitted an issue about on github IIRC)
11:42:02dom96in any case, I bet the problem is that you are passing a colors.TColor not a sdl.TColor
11:42:22jbe_oh man, of course.. thanks!
11:43:22jbe_i'm getting a little confused by module names some times
11:52:22*fowl joined #nimrod
11:52:52*zahary quit (Read error: Connection reset by peer)
11:53:02*zahary joined #nimrod
11:56:57*DAddYE joined #nimrod
11:57:22*q66 quit (Quit: Leaving)
11:58:22*q66 joined #nimrod
12:00:42*q66 quit (Client Quit)
12:01:22*q66 joined #nimrod
12:53:42*jbe_ quit (Read error: Operation timed out)
13:27:58*OrionPK joined #nimrod
13:31:53*Araq0 joined #nimrod
13:33:43Araq0Dom96 fix the logs
13:35:03Araq0People now depend on them
13:35:43*Araq0 only has a phone here...
13:35:43dom96I know
13:37:03*Associat0r joined #nimrod
13:37:03*Associat0r quit (Changing host)
13:37:03*Associat0r joined #nimrod
13:37:58Araq0Well? Whats the problem?
13:38:23dom96There is a bug.
13:38:33dom96I'm fixing it.
13:38:33dom96Chill man.
13:38:53Araq0Ok
13:38:53Araq0Bbl
13:39:03*Araq0 quit (Quit: Bye)
13:52:23dom96done
13:58:45*zahary quit (Quit: Leaving.)
14:01:14*gradha joined #nimrod
14:15:13*jbe_ joined #nimrod
14:26:14*zahary joined #nimrod
14:31:33gradhaI'm trying to package a regex' parameters into a const tuple, to later create the object through re
14:31:56gradhaso I have R_BLAH = (s: "somestring", flag: {reExtended})
14:32:22gradhathen I want to write "let regex = re(R_BLAH)"
14:32:41gradhabut it says the R_BLAH can't be called
14:33:18gradhais there any way to unpack it or do I suck it and pass R_BLAH[0] and R_BLAH[1]?
14:37:20gradhameh, [] doesn't do what I want it to do here, pity
15:03:11gradhaoh, forgot, NimBot: high five!
15:04:32dom96I think you have to suck it up and do it the verbose way
15:04:52gradhamaybe if I pester Araq enough...
15:05:56gradhain python you can do this prefixing the packed variable with *, maybe nimrod could figure this out at compile time and prevent the *, but then what if there's ambiguity
15:06:28gradhahuh, maybe an unpack macro in stdlib?
15:07:05gradhathe macro would replace PARAM with PARAM[0], ..., PARAM[n]
15:07:38gradhaof course, how could I doubt the awesome nimrod, it's all there for me to play with
15:07:50dom96yeah, write a macro :P
15:08:43gradhahmm... the unpack would work for tuples and arrays with fixed lenght, but how to do it for seqs?
15:09:09gradhahmm... maybe if the macro could "know" it's being used inside a proc, and statically gather the input parameters, so it would us 0..n reading the proc's parameters...
15:11:21gradhais it possible for a macro to know it's parent in the AST where it is being invoked?
15:11:47gradhaif that's possible you could write macros which modify outer scopes, scary
15:18:05gradhathings that scare you more than death: you touch the power cord and the laptop suddenly says it's not plugged in
15:28:45EXetoCdon't worry, we'll have immortality pills soon
15:29:21gradhashould feed one to my laptop
15:31:08EXetoCget your priorities straight, man
15:31:42gradharight, download porn
15:31:55EXetoCgive one to your freezer first
15:31:57EXetoClol
15:45:15Max00355Can someone explain to me how to use os.walkDir()
15:45:30Max00355I can not seem to figure it out.
15:47:07gradhawhat kind of trouble you have?
15:47:24gradhahere's an usage example of mine https://github.com/gradha/awesome_rmdir/blob/master/awesome_rmdir.nim#L42
15:48:32Max00355When you import os you don't call the function by doing os.walkDir?
15:49:01gradhathat's only needed if you also imported something else or defined your own walkDir locally, so you need to desambiguate the call
15:49:23gradhaif both modules a and b define the same proc, you would need to use a.proc b.proc if you import both
15:49:30gradhabut if you only import a, it's fine without prefix
15:49:55Max00355Oh, cool
15:50:01Max00355Didn't know that.
15:50:10gradhathe system module is imported by default, so you don't need to system.whatever for everything, unless you have a conflict
15:50:22Max00355Okay, I see.
15:50:42Max00355For Python is .split() or whatever for everything.
15:52:50Max00355So you can not echo within a function?
15:53:11gradhaplease ellaborate on that
15:53:38Max00355proc walk(path: string):
15:53:48Max00355 for x in walkDir(path):
15:53:52Max00355 echo(x)
15:54:02Max00355discard walk("/")
15:54:09Max00355You must return?
15:54:28gradhaas you defined proc, it doesn't return anything, so no need for discard
15:54:40gradhashould be "proc wal(path: string) =" though
15:54:40Max00355Ohhh, that's what discard is for
15:54:54Max00355Ah, another point, why =?
15:54:59gradhaalso, you can use the {.discardable.} pragma to tell the compiler not be stingy
15:55:12gradhathe = is used for the proc body, the : is used for the return type
15:55:13Max00355Gotcha
15:55:25Max00355Sorry I am so noobish... I am just starting to really pick up Nimrod...
15:55:37Max00355I am not used to this static programming stuff and what not..
15:55:49gradhano problem, it's not hard really
15:56:17Max00355I know, but it is different.
15:56:25gradhaI'm refactoring now some nimrod code and it's a *pleasure* to change a type and have the compiler tell you all the places its wrong, rather than fail at runtime some time later
15:56:46Max00355So the compiler is throwing an error that I have no return type declared/
15:57:08gradhalikely due to the colon
15:57:09Max00355But I am not returning anything
15:57:20Max00355I took the colon away
15:57:28gradhadid you replace it with the equal sign?
15:57:32Max00355I did
15:57:43gradhahmm.. something else is wrong then, can you post a snippet?
15:58:02gradhaor is it just that proc walk as you wrote?
15:58:24Max00355Oh wait, I fixed it, my bad.
15:58:31*DAddYE quit (Ping timeout: 276 seconds)
15:58:32Max00355I was trying to return something.
15:58:46Max00355Okay, so when do you use a colon and when do you use an equal sign?
15:59:00gradhaif your proc doesn't return, use an equal sign
15:59:14Max00355Ahhh, okay.
15:59:17Max00355Awesome.
15:59:18gradhaif you return anything, you need "proc name(foo: type): return_type = body"
15:59:33Max00355Awesome
15:59:37dom96It's also a pleasure to see the types in the docs. It's annoying to have to scan the function's docstring to determine what should be passed to a function in Python.
16:00:04gradhadom96: when will Aporia display that info when completing something?
16:00:53dom96gradha: once I get some free time and get rid of my laziness :P
16:01:29gradhaah, cool, then don't buy deus ex fallen for ios, it's on sale now
16:01:45dom96I bought The Last of Us instead lol
16:02:59gradhacordyceps fungus, sounds like a programmer illness
16:03:10Max00355Does the developer of Nimrod ever come into this channel?
16:03:21gradhaMax00355: nah, not gonna happen
16:03:42Max00355Haha
16:04:07gradhahe never comes into this channel because he's always here (Araq)
16:04:41dom96Some say that the developer of Bitcoin has left the development of Bitcoin to pursue creating his own programming language :P
16:05:03gradhaprogramming languages are clearly more profitable
16:05:35Max00355I really can't believe how much bitcoin exploded.
16:05:38Max00355It's incredible.
16:05:44gradhaI wonder if his language will use the $ sign for something...
16:05:55Max00355PHP
16:05:57Max00355PERL
16:05:59Max00355GAY
16:06:08Max00355$_POST['name']
16:06:12Max00355I mean waht the fuck is that?!
16:06:19Max00355Global variables are nasty..
16:06:22gradhainteresting, didn't know about the GAY programming language
16:06:30Max00355Really?
16:07:58Max00355Okay, so something I could never understand in any other language because I was spoiled by Python is random numbers.
16:08:50gradhawhat is to understand about random numbers? they are... random, so, like 4
16:09:02Max00355rand(100) returns 83 every time
16:09:13gradhamine is m/221/
16:09:20gradhasorry, https://xkcd.com/221/
16:09:47Max00355LOL
16:10:06gradhacalled rand(100) right now three times and got 7, 49, 73
16:10:13gradhaclearly a poorer implementation of 4
16:10:24dom96gradha: Speaking of The Last of Us, it's pretty interesting that the zombie infection is caused by a fungus.
16:10:53gradhadom96: why is that interesting?
16:10:59Max00355Hey, that exists in the ant world!
16:11:22gradhain the human world it's maria which creates zombies, albeit temporarily
16:11:32Max00355Boom
16:12:38Max00355Malaria* btw
16:12:47dom96gradha: Dunno, never heard a zombie story which said that the infection is caused by a fungus.
16:13:17gradhanever understood the people who try to rationalize zombies through pseudo science, it just doesn't make sense, better to think of zombies like something magic
16:13:33Max00355http://www.livescience.com/5631-zombie-ants-controlled-fungus.html
16:13:35gradhafungus, bacteria, virus, whatever
16:13:56gradhait's all just a gimmick to tell people "look, it's too complicated, treat it like magic", so better think it's magic anyway
16:14:12dom96Max00355: oh yeah. I remember reading that, forgot that it's caused by a fungus.
16:14:24Max00355Messed up shit isn't it?
16:15:54dom96gradha: Meh, magic. It's perfectly reasonable to consider this science fiction.
16:16:16dom96And if it can happen to ants, perhaps it can to humans as well?
16:16:48Max00355Let's hope it cant
16:16:56Max00355can't8
16:17:58dom96yeah, I prefer an apocalypse in the style of the Terminator.
16:18:09dom96Then maybe I can use my computer skills to fight the AI :P
16:18:36gradhaor independence day, but you don't have a mac, so you would die
16:18:39Max00355Nimrod vs Skynet :P
16:18:55dom96lol independence day
16:19:03gradhaor a dog, in independence day dogs survive impressive explosions
16:19:04Max00355gradha: Only the hipsters would be left.. my god..
16:19:11*Associat0r quit (Quit: Associat0r)
16:19:38dom96"let me just code this quick virus in Nimrod and upload it to the alien mothership!"
16:20:02gradha"darn, I didn't git pull before coming here, I'm doomed with this bug!"
16:20:48dom96"screw it, this segfaulting app will do well to disable the alien mothership"
16:21:48gradhaoh, speaking about bugs, why don't you askubuntu how to compile nimrod?
16:22:19gradhayou could ask like "hey, this compiles in other linux, why is ubuntu such crap?"
16:22:32gradhathen you answer yourself how to solve it, like a sir
16:23:09gradhadidn't know http://askubuntu.com was just stackoverflow disguised, heard about it the other day in their podcast
16:23:20dom96and then I would get banned
16:24:01gradhatry to be polite then, "can somebody help me fix this shit, please?"
16:25:56Max00355What are you guys running
16:25:59Max00355?
16:26:19gradhaI run with macosx, born hipster
16:26:28Max00355Oh my god...
16:26:35Max00355Disgusting
16:26:39Max00355dom96: You?
16:26:39gradhawhen macs become mainstream I'll jump to hurd
16:26:41dom96Arch Linux.
16:26:56Max00355gradha: They have been maib stream.
16:27:01Max00355dom96: Real men use Arch
16:27:10dom96:D
16:27:15Max00355So I am not a real man because I use Mint :P
16:27:23dom96lol
16:27:24gradhaios devices are mainstream, macs not so much, they are just a tiny drop of total computer machines
16:27:33dom96You'd be happy to hear that Araq uses Mint too :P
16:27:43Max00355Hahaha, well it is awesome.
16:27:59dom96I consider switching to a different distro sometimes though
16:28:10Max00355I tried Arch and hated it.
16:28:39Max00355It took me 4 hours to get everything the way I wanted, then I switched back to Mint in that same day :P
16:28:56Max00355I like stuff out of the box.
16:30:51*Associat0r joined #nimrod
16:30:51*Associat0r quit (Changing host)
16:30:51*Associat0r joined #nimrod
16:31:51gradhadidn't nimrod have any proc to expand ~ in paths under unix?
16:32:22dom96getHomeDir()? :P
16:32:36gradhathat's what I would call to replace the ~ in the string
16:33:05dom96dunno, look around in os.nim, if it doesn't exist there it likely doesn't exist at all
16:34:14Max00355I don't understand how Nimrod hasn't gotten more popularity.
16:34:36gradhapeople love crap
16:34:44Max00355Simple syntax that compiles to C...
16:34:54Max00355I wish I had heard about it when I started programming..
16:34:57dom96gradha: well put :P
16:35:09Max00355I would have made some really nice shit.
16:35:15Max00355I have hit a wall with Python.
16:35:20Max00355I can't do anything anymore.
16:35:36gradhadid they ban you from programming?
16:35:38dom96Yep, you should rewrite all your projects in Nimrod.
16:35:52Max00355Heh, that's a lot of programs :P
16:36:07Max00355gradha: Yes, the Python community has shunned me.
16:37:00gradhaMax00355: you are welcome here, we shun the python community instead
16:37:21gradhaI'm also rewriting my python programs in nimrod
16:37:24Max00355Haha, I plan on staying for a bit.
16:37:33Max00355gradha: Do you have a github?
16:37:42dom96Max00355: You should tell all your friends about Nimrod!
16:37:47Max00355I have
16:37:51Max00355they laugh at me
16:37:56dom96what, why?
16:38:48gradhanot hard to figure, https://github.com/gradha
16:40:22gradhanakefiles are nice, but the constant recompiling is really slow, to run a task it compiles twice
16:40:50dom96why twice?
16:40:51gradhawell, I'm sure fowl will like me spamming issues
16:40:54gradhano idea
16:41:04dom96are you compiling the nakefile
16:41:07gradhaI guess first nake compiles the nakefile, but then I see another compilation going on
16:41:17dom96and then running the nakefile which compiles something else?
16:41:32gradhayes, the first compilation is not needed
16:41:37dom96just compile the nakefile once?
16:41:49gradhaand then use ./nakefile instead of nake? surely you jest
16:42:29dom96yep :P
16:42:54gradhaI guess I'll replace nake in my path with a bash function which compares the date of nakefile.nim and nakefile and runs it or compiles it
16:45:43gradhaouch, copyFile doesn't preserve the execution bit for installation of binaries
16:52:14EXetoCmost programmers obviously don't prioritize language features
16:55:10*DAddYE joined #nimrod
16:57:23gradhaI've heard programmers prioritize java over alternatives due to having eclipse, which to me sounds so wrong on many levels
16:57:57gradha"here, this language is crap, but if you use these crutches, which are crap too, it suddenly becomes wonderful!"
16:59:38EXetoCmost people probably just use whatever will get them employed some day
17:00:01gradhaOTOH bundling language and IDE is a nice strategy, you get one holy war for the price of two
17:00:15gradhaclever dom96, now I understand the meaning of Aporia...
17:00:16*DAddYE quit (Ping timeout: 276 seconds)
17:01:26EXetoCput it in a box together with a couple of OOP pamphlets
17:04:43dom96gradha: oh?
17:05:25Max00355dom96: They laugh because Pythonistas don't like static typing.
17:05:53EXetoCI got tired of dynamic typing after only a couple of days
17:06:10Max00355It is so much easier
17:06:23gradhadom96: a new planguage is pain, so better make it lang+ide so it is painful only once?
17:06:48dom96oh, I thought you were referring to the name
17:07:43gradhaMax00355: it's only easier because it doesn't force you to think ahead of the data, yet that's what makes programs more efficient, or prevents out of range bugs and such
17:08:12gradhain fact, it's delying the inevitable
17:08:23gradhaconsider a python program which serializes to a database
17:08:39gradhayou use a field to store integer values, and python will happily accept anything integer like, so a big number
17:08:56gradhabut then you have to store it in sqlite, and wait, your table only accepts integers in a specific range...
17:10:23gradhathen, dynamic typing is fine when you are writing programs, but can be a pain when you write libraries for other people
17:10:46gradhasuddenly you have people not reading docs and calling your lib with parameters which are just not right, but due to coercion they kind of work and fail in obscure ways
17:11:02gradhaso now you have to add to your functions manual parameter checks for the type, assertions and such
17:11:14gradhabasically, manually implementing a type system
17:11:32gradhabut of course, people who don't mind writing crappy code for others thing its ok to not care
17:13:19gradhaI've yet to talk to a ruby programmer who checks input parameters for correctness or to avoid weird behaviours, they are like "what, why would I check the parameters?", lol
17:13:35dom96because Nimrod is so flexible with some hacky macro work you could probably actually implement dynamic typing :P
17:13:56dom96but it's probably not the best idea to be writing code like that.
17:14:15gradhathe difference is allowing vs everything is dynamic
17:14:40gradhain objc you can never be sure of the type of input parameters, so to write really solid code you have to ask your parameters if they actually are the type they say to be
17:15:01gradhabecause everything is an object, and objects are wonderful things
17:43:56Max00355To each his own.
17:44:02Max00355I don't mind manual type checking.
17:44:12Max00355try:
17:44:25Max00355 inp = input("> ")
17:44:30Max00355except TypeError:
17:44:35Max00355 continue
17:44:37Max00355Not hard
17:45:46gradhawell, string input sanitization doesn't have much to do with it
17:46:02gradhaconsider "def do_something(text):" in python
17:46:11gradhayou can pass anything as text
17:46:12Max00355input() only take integers
17:47:32Max00355gradha: You can
17:47:33gradhaMax00355: python docs say you are wrong, it returns whatever the string evals to
17:47:56Max00355Python3 docs say I am wrong, yes.
17:48:03Max00355Python 2.7 docs say otherwise
17:48:10gradhareally? I'm on 2.7 here
17:48:17gradhainput([prompt]) -> value
17:48:21gradhaEquivalent to eval(raw_input(prompt)).
17:48:26gradhaso no type information for value
17:48:34gradharaw_input returns a string
17:48:40Max00355input() returns an integer
17:48:53Max00355eval(raw_input(prompt)) is just silly
17:49:00gradhaIn [8]: repr(input(""))
17:49:00gradha"something"
17:49:00gradhaOut[8]: "'something'"
17:49:06gradhathat returned a string, AFAICS
17:49:27Max00355I gtg, i'll be on later, Bye!
17:49:32gradhasee ya
17:56:01*DAddYE joined #nimrod
18:02:34*DAddYE quit (Ping timeout: 257 seconds)
18:08:54*jbe_ quit (Quit: Leaving)
18:24:11*Associat0r quit (Quit: Associat0r)
18:24:31AraqMax00355: I use the debian edition of mint though ;-)
18:24:54Araqand enjoy my X11 crashes ...
18:25:17*Araq just restarted X11 to get back a working mouse cursor
18:31:15*Associat0r joined #nimrod
18:31:15*Associat0r quit (Changing host)
18:31:15*Associat0r joined #nimrod
18:39:09gradhahah, found a but in parseHex
18:39:30gradhaor rather, a weird behaviour, the proc depends on the input value of the temporal variable
18:39:44gradhaso if I initialize the integer to something else, the resulting parsed value has nothing to do with input
18:41:02gradhaAraq: how do you want me to "fix" that, document the behaviour or make parseHex initialize number before writing to it?
18:41:40Araqwhat's the difference between "fix" and "initialize number before writing to it"?
18:42:23AraqI think it shouldn't touch it in case of error; this way a default value is kept when a parsing error occurs
18:42:59gradhathere's also a side benefit, you can concatenate several calls to parseHex and it works, though you quickly overflow
18:43:10gradhaI'll document it
18:43:59Araqparseutils.parsehex, right?
18:44:05gradhayep
18:45:02Araqhow does concatenate produce any meaningful result?
18:45:14Araqyou need to shift it at least
18:45:24gradhaparseHex("c3", temporal); parseHex("68", temporal) == parseHex("c368", temporal)
18:45:43Araqoh right
18:46:33Araqhmm
18:47:00gradhaawesome, even parsing hex is fun in nimrod
18:48:10Araqwell if it makes you happy, document it
18:48:24AraqI can't see a value in this "feature" for now though
18:48:54Araqon the other hand ... garbage in, garbage out is not too bad for a low level stdlib routine
18:51:51gradhaoh, another unexpected behaviour in re.findAll
18:52:02gradhasince it's an iterator, you shouldn't modify the string you are iterating over
18:52:17gradhafor that it's better to toSeq the result
18:52:25gradharesult was funny
18:54:07Araqhmm the compiler could easily warn about this
18:54:38*OrionPKM joined #nimrod
18:55:18gradhahow can the compile detect such behaviour http://pastebin.com/1mhkQE6w ? usage of match variable?
18:55:44gradhaaw, should use parseHex's start parameter instead of range
18:55:44*DAddYE joined #nimrod
19:02:48Araqgradha: simple: 'dest' is passed to an iterator so it's "const" for the for loop body
19:03:15Araqit's a very easy analysis
19:03:50gradhaok, doit
19:05:02Araqmake a feature request :P
19:05:23gradhaI thought people got irritated with me spamming issues
19:05:33*OrionPKM quit (Remote host closed the connection)
19:05:41gradhaso I keep them now in my todo
19:11:20Araqwhat about closing issues and making a new issue "improve idetools"?
19:11:42gradhayeah, there's also that, unfulfilled expectations
19:12:31DAddYEAraq: do you think is the correct way to "instantiate" a pointer ?
19:12:33DAddYEAraq: proc timer_init*(a2: ptr TLoop; handle: ref TTimer)
19:12:35DAddYEsorry
19:12:41DAddYEAraq: https://github.com/DAddYE/gist/blob/master/uv.nim#L790-L794
19:13:01Araqref TTimer is most certainly wrong
19:13:43DAddYEAraq: so, what do you suggest?
19:13:59DAddYE(unable to find any doc and I read 80% of all wrappers)
19:14:00DAddYE:D
19:14:07Araqdunno perhaps 'var TTimer'
19:14:19DAddYEAraq: here https://github.com/DAddYE/gist/blob/master/uv.nim#L677 ?
19:14:53DAddYEand then var t: TTimer = TTimer.new ?
19:15:02DAddYEtimer_init(loop, t)
19:15:07Araq'new' is for 'ref' only
19:15:14Araqno 'ref', no 'new'
19:15:34Araqso it's only:
19:15:44Araqvar t: ttimer; timer_init(loop, t)
19:15:58Araqthough I would name it initTimer I think
19:16:22Araqbut then you lose even more guessability in your wrapper
19:17:16Araqwhether you can transform 'ptr T' to 'var T' mostly depends onto whether C allows for NULL
19:19:51DAddYEAraq: ok, thanks lemme try
19:22:41DAddYEAraq: in your way: type mismatch: got (TTimer) but expected 'ref TTimer'
19:22:55DAddYEproc timer_init*(a2: ptr TLoop; handle: var TTimer): cint {.libuv.}
19:24:25Araqdon't declare your timer 'ref ttimer' then
19:24:46DAddYEAraq: I didn't var timer: TTimer
19:25:51Araqdon't use TTimer.new then
19:26:51DAddYEAraq: I didn't!
19:27:18Araqwell your gist doesn't contain any 'ref'
19:27:40Araqand if your example code doesn't either I can't see why the compiler would say "expected 'ref TTimer'"
19:30:55DAddYEAraq: https://gist.github.com/DAddYE/9f2ec7a876164d8fe93f
19:31:05DAddYEfuck
19:31:06DAddYEfound
19:31:07DAddYE:D
19:32:44Araqbtw you shouldn't use "block" in a template unless you know what you're doing and know about a codegen bug
19:33:01DAddYEAraq: infact SIGSEGV: Illegal storage access. (Attempt to read from nil?)
19:33:11DAddYEI don't what to share with the rest of my code
19:33:13DAddYEmy vars
19:33:34Araqbut since you don't use a dirty template it isn't
19:33:59Araqno need for 'block' here anymore
19:34:13Araqmaybe we need to update the docs somewhere ...
19:35:04DAddYEAraq: haaaaaaaaaaaaa
19:35:45DAddYEAraq: http://build.nimrod-code.org/docs/manual.html#scoping-in-templates_toc
19:36:02DAddYEhttp://build.nimrod-code.org/docs/manual.html#scoping-in-templates
19:36:23DAddYEblock only when is immediate
19:36:26DAddYEor dirty?
19:36:42DAddYEalso there is no enough doc about {.dirty.} and {.inject.}
19:36:54DAddYEso I've few ideas what they really are
19:37:18Araqwell if you use .dirty everything is injected
19:37:50Araqif you don't use dirty you need to explicitly inject symbols (unless in certain contexts)
19:38:27Araqimmediate refers to overloading resolution, you can't overload an immediate template
19:38:33DAddYEbtw removed block:
19:38:41Araqthis however enables other possibilities
19:38:55Araqlike passing a non existing symbol to the template
19:39:19DAddYEcool
19:39:33Araqmost people use .immediate, dirty and call it a day though
19:39:47Araqthis way you get quite C-like macros
19:40:02DAddYEAraq: removing block still have same sigsev illegal storage access
19:40:15DAddYEseems timer var get gc'd
19:40:44Araqso it fails at runtime?
19:41:31Araqbe careful with the "proc" type please, you want "proc ()" instead
19:41:50Araqand yeah we should fix that, zahary
19:42:03DAddYEvar t = set_timer(1000, 1000) do:
19:42:31DAddYESIGSEGV: Illegal storage access. (Attempt to read from nil?)
19:42:35DAddYEat runtime
19:42:50Araqhmm
19:42:51DAddYEif I'll change it with discard set_timer ... works
19:43:45Araqwell ... you got rid of the 'block', right?
19:44:00DAddYEyep removed
19:44:36DAddYEAraq: https://gist.github.com/DAddYE/9f2ec7a876164d8fe93f
19:49:23DAddYEtried also returning var TTimer but no luck
19:50:04DAddYEaaaaaaaaaaarg
19:50:07DAddYEI think I found
19:50:17DAddYElooks the compiler think timer is still NULL
19:50:20DAddYEor some weird
19:50:26DAddYEecho repr(timer)
19:50:38DAddYE=> crash
19:51:00DAddYEbut echo timer.my_fields works
19:51:05DAddYEwith updated results
19:51:42DAddYEthat's why I did in past example TTimer.new
19:51:45DAddYEto avoid that problem
19:52:00Araqdunno it's weird
19:52:28Araqmake a bug report
19:52:44Araqworkaround should be to change your set_timer template
19:53:15Araqso that it takes the ttimer to declare
19:54:27Araqhowever ...
19:54:39Araqyou do copy the ttimer maybe that doesn't work
19:55:40DAddYEAraq: here my example
19:55:41DAddYEhttps://gist.github.com/DAddYE/9f2ec7a876164d8fe93f
19:55:45DAddYEwith the output
20:00:24Araqrepr(timer) crashing doesn't mean much I think
20:00:38Araqit follows some pointer it shouldn't follow or something like that
20:01:01DAddYEok
20:01:21DAddYElast to things and I'll stop to boring you
20:01:22DAddYE:D
20:01:41DAddYEcan I have templates / procs with same name but different signature ?
20:01:49Araqyes
20:02:06DAddYElike template set_timer(timeout: uint64, repeat: uint64, timer: expr, actions: proc ()) =
20:02:12DAddYEand template set_timer(timeout: uint64, repeat: uint64, actions: proc ()) =
20:02:16DAddYE?
20:05:30DAddYEuv.nim(803, 12) Error: wrong number of arguments
20:09:14Araqthey both can't be immediate for this to work
20:09:48DAddYEthey aren't
20:12:18Araqworks for me
20:13:58DAddYEAraq: https://gist.github.com/DAddYE/9f2ec7a876164d8fe93f
20:14:37AraqDAddYE: firstly one IS immediate
20:14:47DAddYEtried now
20:14:48DAddYEwithout
20:14:52Araqsecondly you use set_timer version 2 before it's been declared
20:15:01DAddYEuv.nim(789, 32) Error: undeclared identifier: 't'
20:15:23Araqwell yeah it can't work
20:15:35DAddYE0-0
20:15:59DAddYEok I see why
20:16:04DAddYEI need to dup the code
20:16:10DAddYEinside my template
20:16:14Araqyou know ... for overloading resolution to work the compiler needs *types*, an undeclared identifier has no type
20:16:44Araqso it can't work for your use case
20:17:00DAddYEsorry but
20:17:03DAddYEso why here works
20:17:05DAddYEset_timer(1000, 1000, t) do:
20:17:07DAddYE?
20:17:29Araqyou can get lucky thanks to a somewhat hard to fix compiler bug ...
20:17:53DAddYEhaaaaaaaa
20:18:00DAddYEokay here I'm
20:20:37DAddYEyour compiler doesn't like me
20:20:53DAddYEif I put {.immediate.} on the second template
20:20:54DAddYE echo("Interval every 1s")()' cannot be called
20:20:57DAddYE-.-
20:24:08Araqyou need to do 'actions' for immediate and actions() for non-immediate I think
20:24:27DAddYEAraq: yep figured now
20:24:58DAddYEdoest it looks okay to you now
20:25:00DAddYEhttps://gist.github.com/DAddYE/9f2ec7a876164d8fe93f ?
20:26:24Araqno; as I said you merely get lucky if it works
20:26:45Araqthe compiler shouldn't allow immediate and non-immediate overloads
20:27:31DAddYEok
20:30:18DAddYEAraq: why in some example you returns stmt ?
20:30:25DAddYElike here http://build.nimrod-code.org/docs/manual.html#scoping-in-templates
20:30:34DAddYEthere is a particular reason behind ?
20:31:58DAddYEmaybe you can chain
20:39:53Araqit's mostly for historical reasons
20:40:18Araq': stmt' and ': void' and nothing all mean the same for template declarations
20:41:28DAddYEAraq: haaaaa ok
20:41:28DAddYEAraq: https://gist.github.com/DAddYE/9f2ec7a876164d8fe93f
20:41:28DAddYEthis works
20:41:38DAddYEtell me that looks so good
20:41:38DAddYEto you
20:41:53DAddYEthat you want to start coding in UV
20:41:53DAddYE:D
20:42:28AraqI would simply rename the one set_timer to decl_timer which makes more sense anyway
20:42:49DAddYEAraq: yep, totally agree
20:42:59DAddYEAraq: thanks for your time
20:44:39Araqyou're welcome
20:44:54Araqnow push your wrapper to babel
20:45:19*DAddYE quit (Remote host closed the connection)
20:49:59gradhadom96: nimbuild is having problems with the ftp upload, has something changed on the server?
20:50:29gradhaI can telnet into port 21, but trying to use any ftp client just times out
20:50:49gradhaI wonder if this is one of those ftp port thingies which have firewall problems
20:51:19gradhaOTOH I don't have any problems connecting to an italian ftp I manage
20:52:49Araqport 21 for FTP is the standard though, right?
20:52:59dom96that's odd
20:52:59gradhayes, but ftp always opens a secondary port for data
20:53:34dom96the secondary port is only opened when data transfer begins
20:53:54dom96But you can't even connect with an ftp client, right?
20:54:04gradhaI can't ls into it
20:54:14gradhanimbuild fails with Error: unhandled exception: Socket is not connected [EOS]
20:54:14gradhaor Error: unhandled exception: Expected reply '226' got: 421 Data timeout. Reconnect. Sorry. [EInvalidReply]
20:54:29*DAddYE joined #nimrod
20:54:39DAddYEAraq: since u have a wrapper in the code base
20:54:49DAddYEisn't better update it
20:54:49DAddYE?
20:54:59Araqdo I?
20:55:09dom96well I just noticed that nimbuild crashed
20:55:09gradhaI'd understand if I could not connect to any ftp, but being able to connect to some makes it strange
20:55:59AraqDAddYE: but your wrapper might be incompatible, better make the stdlib's deprecated and refer to your babel package instead
20:56:14DAddYEAraq: okay make sense
20:56:14Araqwe have this problem for other things too
20:56:39AraqIUP, GTK come to mind
20:56:39gradhadom96: looks like I can log in and ls with the ftp command, but the fancy lftp times out
20:56:59dom96lftp?
20:57:09gradhalftp - Sophisticated file transfer program
20:57:29dom96oh
20:57:39gradhaso much for sophistication that it breaks connections
20:58:14gradhabut yeah, something is preventing nimbuild from uploading the data, which is weird
20:59:19dom96ugh
20:59:19gradhausing ftp I was able to upload a zero bytes log.txt file, though I can't remove it
20:59:39gradhaduring the ftp upload it said "entering passive mode"
20:59:39dom96Nimbuild doesn't deal well with builders reconnecting during a build
21:00:19DAddYEAraq: in my gist can't I change templates to be proc instead?
21:01:19Araqyou can for the non-immediate one but it might cost you a closure
21:03:09DAddYEok
21:03:34dom96In fact, nimbuild should never crash because the builder's send some incorrect data.
21:03:44*dom96 adds a try except and calls it a day
21:03:59gradhasince you are at it add another one around the ftp data upload part
21:04:09Araqdom96: what about the raises: [] annotation?
21:04:39dom96gradha: ok
21:04:39*Araq slaps dom96 for adding try except and calling it a day
21:04:54dom96Araq: It's better than creating a restart script
21:05:04dom96which ignores ALL crashes
21:05:04AraqI disagree
21:05:19Araqa restart script can log the error reliably at least
21:05:49Araqand the memory protection of processes is nothing to give up easily
21:06:14dom96And Nimbuild can't?
21:06:39Araqwell
21:06:59Araq*I* would write a nimrod restart program instead of a crappy shell script
21:07:14dom96Actually my plan isn't ideal. The builder should really terminate when this occurs.
21:07:29dom96Otherwise it may continuously be sending the same bad data.
21:07:59dom96Araq: ok, write me one then :P
21:09:19AraqI'm too busy with other things
21:09:29dom96yeah, me too.
21:14:19dom96oh cool, you get a watcher count on github now.
21:14:39dom96"Account for Github research", interesting.
21:15:29Araqhu? "watcher count"?
21:15:39Araqshouldn't that be a "stargazers count"?
21:16:09dom96There is a difference
21:16:39Araqyeah; there is no such thing as a "stargazer"
21:17:34EXetoCbeep beep
21:17:54Araqoh wait ... there is ... lol
21:18:09Araqit's a real english word ... interesting
21:28:19dom96gradha: I'm guessing you want the builder to continue even when ftp upload fails
21:29:19dom96not sure I can do that.
21:29:49dom96I would have to tell the website that ftp upload succeeded even though it hasn't
21:30:34gradhawouldn't it be better if it tried to retry? or notify you of the error somehow
21:30:55*DAddYE quit (Remote host closed the connection)
21:31:33dom96yeah, well currently it crashes right?
21:31:43gradhayes, uncaught exception
21:31:59gradhaI don't mind really, I use the infinite shell script approach
21:32:20gradhabut maybe if the upload was kept it wouldn't try to recompile it, or advance it further
21:32:30gradhait seems that compilation and upload are separate things
21:33:02dom96yeah, but then you don't get the testresults
21:34:08gradhadon't understand, imagine instead of ftp you used dropbox, putting files in a shared folder. nimbuild compiles, then moves the files somewhere, and keeps going
21:34:23gradhawith the ftp it would keep going, and the upload would be left to a secondary nimbuild helper
21:35:00dom96yes, but that requires many changes to the code.
21:35:51gradhaso I have now 33MB in the builds directory, useless?
21:36:08dom96yeah
21:36:24dom96there is no point in keeping the old builds
21:37:09gradhaI guess there's no point in me starting nimbuild again since ftp upload doesn't work now
21:37:16gradhacurse you FTTH!
21:40:19dom96hrm, I wonder what happens if I put a proc definition in a try except?
21:41:19Araqnothing? a proc definition is not executable code
21:41:58dom96well just in case I left it out of my try block
21:42:33NimBotnimrod-code/nimbuild master 3378960 Dominik Picheta [+0 ±1 -0]: Builder will no longer crash if FTP upload failed.
21:48:07dom96gradha: well I can successfully connect to the ftp server
21:48:57gradhaI can too, with passive ftp, but nimbuild does something else which doesn't work for me now
21:50:13dom96perhaps nimrod's ftpclient module does not support passive ftp
21:50:21*dom96 can't remember
21:51:07gradhathe thing is, I can still use lftp with an italian ftp, so it's not the passive stuff, but maybe something related
21:51:31gradhaif suddenly "active" ftp was problematic I would be unable to connect to that other server too
21:53:46gradhaok, so lftp works when I specify a username in the login, but not if I first open the server then try to authenticate
21:54:48gradhaso now the question remains: why is nimbuild refusing to upload if all other ftp tools work?
21:55:35gradhaok, recompiled the builder and starting another try
21:55:38*EXetoC quit (Read error: Connection reset by peer)
21:59:14Araqgradha: [23:58] NimBot macosx-x86_64: Build OK.
21:59:25Araqyou should join #nimbuild
22:00:18*EXetoC joined #nimrod
22:20:36*gradha quit (Quit: bbl, need to watch https://www.youtube.com/watch?v=1ZZC82dgJr8 again)
22:30:59fowlGradha
22:31:35fowlPut that nake stuff into nake.nim not a new bash script
22:31:58fowlWth son.. lol
22:32:07fowlI don't know if ur even here
23:34:11*Associat0r quit (Quit: Associat0r)
23:48:16*Trix[a]r_za is now known as Trixar_za