<< 26-01-2015 >>

00:01:33sdwHmm, I don't think this does what I thought it did
00:11:51flaviuThey still haven't taken down that page :/
00:11:52*Var|Mobile quit (Read error: Connection reset by peer)
00:14:18*Demon_Fox quit (Ping timeout: 276 seconds)
00:15:25dom96I'm curious why mit has Nim docs.
00:17:25flaviuThey seem to have some sort of internal package manager.
00:17:46flaviuSo I assume they got built while creating the internal package.
00:19:43*cjbest quit (Quit: My Mac has gone to sleep. ZZZzzz…)
00:20:46flaviuNim has pretty high per-invocation overhead.
00:21:01flaviuI can only do ~9 invocations/sec
00:25:08*Demon_Fox joined #nim
00:25:21reactormonkflaviu, only? ^^
00:26:03flaviuThat's high. My small virtual machine can do ~4000 invocations/sec.
00:26:56flaviuFuzz testers aren't practical unless it's possible to keep things in the thousands of invocations per second.
00:31:31dom96invocations?
00:32:54flaviuLiterally invoking the compiler.
00:33:43dom96Ahh yes. It does have to go through gcc after all.
00:36:52def-flaviu: you want to fuzz nim?
00:37:03def-I've had a lot of fun fuzzing a few weeks ago
00:37:39*Trustable1 quit (Quit: Leaving)
00:38:02flaviudef-: Yep, I am. Have you seen AFL? It's amazing.
00:38:34def-flaviu: yes: http://felsin9.de/nnis/software/#fuzzing-open-source-software-(2014)
00:38:44*adam_s joined #nim
00:38:56def-Actually that reminds me that I should disclose a vulnerability soon because it's not getting fixed
00:39:34flaviuNice! I've only been using it for a pet project, but I like that you've been doing productive work with it :P
00:39:51flaviudom96: skipping GCC makes it ~2% faster, not too big a difference.
00:40:20def-flaviu: clearly, make nim faster, then fuzz it
00:40:48flaviuLooks like lots of the time is in dynamic memory management, so that might not be so easy.
00:42:10dom96def-: vulnerability? In Nim?
00:42:54def-dom96: nono, in a commonly used library
00:43:53dom96def-: i'm curious, tell me more.
00:44:27flaviudom96: He just posted a link: (http://felsin9.de/nnis/software/#fuzzing-open-source-software-(2014))
00:44:41def-better not about the undisclosed one
00:44:57dom96def-: PM?
00:45:22flaviudef-: Don't do it, dom96 is looking to sell it on the black market :P
00:45:43def-haha
00:46:44dom96I've got some buyers already lined up.
00:52:31*bpr quit (Ping timeout: 246 seconds)
01:02:15*Mat4 left #nim (#nim)
01:10:38*darkf joined #nim
01:10:53gmpreussner_def-, flaviu: that's an interesting tool. thanks for the link!
01:14:23BlaXpiritwow, my IRC client is amazing
01:14:38*cjbest joined #nim
01:15:05BlaXpiritdid it really just match the parentheses and include only the first of the ")" brackets of that last message with a link?
01:15:44gmpreussner_yeah
01:18:09*Var|Mobile joined #nim
01:22:09*BlaXpirit quit (Quit: Quit Konversation)
01:28:11*tttt quit (Quit: Connection closed for inactivity)
01:30:34*Outlander quit (Ping timeout: 264 seconds)
01:38:43*rational quit (Quit: Lost terminal)
01:38:46*davidhq joined #nim
01:43:52*skyfex__ joined #nim
01:44:54*skyfex_ quit (Ping timeout: 272 seconds)
01:45:13*fubarred joined #nim
01:49:57Triplefoxwhew, got 32-bit bmps writing now...sdl is kinda evil for only having the 24-bit bmps when i wanted to save alpha .-.
01:50:58*vendethiel quit (Quit: q+)
01:57:58*fubarred quit (Ping timeout: 246 seconds)
02:02:50*barosl_ quit (Ping timeout: 276 seconds)
02:03:09*EXetoC quit (Ping timeout: 245 seconds)
02:04:16*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
02:04:52*davidhq joined #nim
02:05:33*davidhq quit (Client Quit)
02:33:40*cjbest quit (Quit: My Mac has gone to sleep. ZZZzzz…)
02:45:55*flaviu quit (Remote host closed the connection)
02:46:06*flaviu joined #nim
02:51:35*cjbest joined #nim
02:58:31*barosl joined #nim
03:02:49cjbestnoob question: if I need a buffer to pass into a c function like proc ReadStream*(stream: ptr TStream; buffer: pointer; frames: culong): TError {.pa, importc: "Pa_ReadStream".}
03:03:14cjbestwhat's the best way to create/do that? Can I use a nim array?
03:04:46*adam_s quit (Quit: Leaving)
03:07:17Triplefoxcjbest: Nim array is a good idea, you get the pointer of it from "addr(array[0])"
03:09:29cjbestTriplefox: ahh that makes sense, thanks. If I just declare the array myArray:array[256, int], will that allocate the space?
03:11:00cjbestsorry for dumb questions, have been through the tutorial and the only assignment it shows is literal [1,2,3,..] style
03:14:20cjbestnm array is value so it allocates. got it.
03:15:13*kapil__ joined #nim
03:17:31*VinceAddons quit (Read error: Connection reset by peer)
03:17:44*meanfish` joined #nim
03:18:00*Etheco- quit (Read error: Connection reset by peer)
03:18:38*brson quit (Ping timeout: 272 seconds)
03:18:49*meanfish quit (Ping timeout: 256 seconds)
03:22:02*Boscop_ joined #nim
03:26:03*Boscop quit (Ping timeout: 276 seconds)
03:28:05asdfghjklSo, for the people who have experience with c2nim, are there any immediate problems with this C source file?
03:28:07asdfghjklhttp://tweetnacl.cr.yp.to/20140427/tweetnacl.c
03:28:56asdfghjklIt's a minimalistic implementation of the NaCl library so it should (hopefully) be easier to make a wrapper for.
03:57:29*barosl_ joined #nim
04:00:39*barosl quit (Ping timeout: 264 seconds)
04:01:17*barosl__ joined #nim
04:02:58*barosl_ quit (Ping timeout: 272 seconds)
04:08:40*barosl__ quit (Ping timeout: 272 seconds)
04:17:49*vbtt joined #nim
04:17:51*vbtt quit (Client Quit)
04:18:44*barosl joined #nim
04:20:19*vbtt joined #nim
04:20:42vbttHi
04:21:08vbttNom is getting so much positive attention these days
04:21:15vbttNim
04:25:08*barosl quit (Ping timeout: 272 seconds)
04:35:07cjbestthe nim GC should totally be called nom
04:35:26*barosl joined #nim
04:44:58*SplinterOfChaos quit (Ping timeout: 255 seconds)
04:50:27*fizzbooze quit (Quit: WeeChat 1.1)
04:50:43*fizzbooze joined #nim
05:00:03fizzboozehow do i print without newline?
05:00:43Demoscjbest, I support this idea
05:01:32*Var|Mobile quit (Ping timeout: 246 seconds)
05:09:15fizzboozeare there documentations on async/await? i couldn't find any in the docs?
05:10:06vbttOm nom nom
05:10:29cjbestOOM nom
05:11:10vbttHehe
05:31:35fizzboozeare there documentations on async/await? i couldn't find any in the docs?
05:45:20*cjbest quit (Quit: My Mac has gone to sleep. ZZZzzz…)
05:45:43asdfghjklfizzbooze: I think the people who would know about that are based out of European time zones, so maybe try back later.
05:46:10fizzboozeok
05:46:27fizzboozelib/pure/asyncdispatch.nim(1080, 8) Error: can raise an unlisted exception:
05:46:52fizzboozei got that as the last message in the compilation error. it doesnt tell me what exception is unlisted :(
05:46:53asdfghjklYeah, I have no idea: I'm still learning Nim myself.
05:59:07fowlmouthfizzbooze, stdout.write(str) to print without newline
06:03:18fizzboozefowlmouth thanks
06:08:04fowlmouthfizzbooze, look at asyncdispatch, asyncnet and asynchttpserver, http://nim-lang.org/lib.html#internet-protocols-and-support
06:13:45fizzboozethank you :)
06:19:49*gmpreussner__ joined #nim
06:20:09*gmpreussner_ quit (Ping timeout: 244 seconds)
06:22:17*vbtt quit (Read error: Connection reset by peer)
06:31:35*Demos quit (Read error: Connection reset by peer)
06:41:32*fizzbooze quit (Quit: WeeChat 1.1)
06:52:11*gmpreussner__ quit (Ping timeout: 244 seconds)
06:52:17*gmpreussner___ joined #nim
06:57:54asdfghjklNim should apply as a Google Summer of Code project.
06:58:03asdfghjklFree labor.
07:39:02*Demon_Fox quit (Quit: Leaving)
07:48:45*yehuju joined #nim
07:49:23*yehuju left #nim ("Leaving")
07:54:36reactormonkasdfghjkl, already did, gotta try again
08:02:03*Jesin quit (Ping timeout: 245 seconds)
08:29:01*Sphax joined #nim
08:36:58ekarlsohttps://github.com/deuterium-orm/deuterium/blob/master/src/field.rs#L101-L125 < how would one do that in rust ?
08:37:01ekarlsoehm, nim
08:45:55*Jesin joined #nim
08:53:40*Trustable joined #nim
08:59:36*dymk quit (Ping timeout: 244 seconds)
09:04:05*xeizlif quit (Ping timeout: 246 seconds)
09:04:56*dymk joined #nim
09:05:57*xeizlif joined #nim
09:21:39*Outlander joined #nim
09:22:06*sillesta joined #nim
09:28:43*BitPuffin quit (Ping timeout: 245 seconds)
09:33:40*asdfghjkl quit (Ping timeout: 246 seconds)
09:44:15*d3m1gd joined #nim
10:21:26*dumdum joined #nim
10:34:50*kapil__ quit (Quit: Connection closed for inactivity)
10:35:30*VinceAddons joined #nim
10:37:59*BlaXpirit joined #nim
10:48:49*sillesta quit (Ping timeout: 265 seconds)
10:51:43*Outlander quit (Ping timeout: 255 seconds)
10:56:52*vendethiel joined #nim
10:59:22novistis there a way for nim object to inherit c++ class and then overload a pure virtual method? c++ class might even use multiple inheritance.
11:04:47*gokr_ joined #nim
11:10:50*MajorWork joined #nim
11:12:47*MajorWork quit (Changing host)
11:12:47*MajorWork joined #nim
11:18:12reactormonknovist, Not natively. nim objects are way simpler. You can hack something with importcpp and necessarily emit
11:18:15reactormonkbut it's kinda ugly
11:18:45reactormonkekarlso, there's no option type per se. The rest you can do with generics
11:19:49reactormonkNot sure how to iterate over types.
11:29:37dumdumRunning: [nim idetools --track:suggest.nim,17,3 --suggest aporia.nim ] in aporia src directory returns no results (Nim Compiler Version 0.10.2 (2014-12-29))
11:29:45dumdumam I doing something wrong?
11:29:59*davidhq joined #nim
11:30:43dumdum17,3--> "".
11:36:08reactormonkdumdum, I've had trouble with the idetools too
11:37:56*Sphax quit (Quit: ZZZZZzzzzz)
11:38:17dumdumdo you know a nim version in which it works?
11:39:08*gokr_ quit (Ping timeout: 245 seconds)
11:39:23reactormonkdumdum, check the tests, might have some
11:44:08dumdumif you mean: https://github.com/Araq/Nim/tree/devel/tests/caas , last commit was 2 years ago
11:46:38*gokr_ joined #nim
11:57:23*Outlander joined #nim
12:01:57*Outlander quit (Ping timeout: 245 seconds)
12:02:46gokr_fyi, Araq was working on idetools this weekend
12:04:44*EXetoC joined #nim
12:38:11*Sphax joined #nim
12:50:11*noam_ joined #nim
12:50:51dumdumgreat!
12:51:27*cyraxjoe quit (Quit: No Ping reply in 180 seconds.)
12:51:42*jez0990_ quit (Quit: No Ping reply in 180 seconds.)
12:51:54*jez0990 joined #nim
12:51:55*dv- quit (Ping timeout: 252 seconds)
12:51:58*MightyJoe joined #nim
12:52:31*BlaXpirit_ joined #nim
12:52:39*noam quit (Ping timeout: 252 seconds)
12:55:41*BlaXpirit quit (Ping timeout: 256 seconds)
13:01:04*matkuki joined #nim
13:04:39*BitPuffin joined #nim
13:09:22*dv- joined #nim
13:11:20ekarlsoreactormonk: how you mean to iterate over types ?
13:11:38reactormonkekarlso, so you wouldn't have to copy/paste. I suppose you could just go with a template
13:14:14ekarlsoreactormonk: never used templates but always time to learn I guess :p
13:14:21EXetoCreactormonk: with fieldPairs and typeinfo?
13:14:46reactormonkEXetoC, now that's something I would have to look up
13:15:30EXetoCthe typeinfo module that is. the marshal module uses it
13:16:06ekarlsoEXetoC: ? ^
13:18:57EXetoCekarlso: for doing type reflection
13:19:23ekarlsohmm k
13:20:32ekarlsohmmms
13:20:46ekarlsoso in rust they store T for what type the field is gonna be
13:20:52ekarlsohow the stuffs u do that in nim ?
13:22:59EXetoCreactormonk: have you seen the maybe_t (option) module?
13:23:10EXetoCekarlso: the typeinfo modules allows you to iterate through the fields of a type and get their names and types
13:23:23ekarlsoEXetoC: oh, awesome
13:23:38ekarlsoEXetoC: but wondering for a "Field" type how to store what type that field is supposed to be
13:24:57reactormonkekarlso, nope, link plz
13:25:15ekarlsoreactormonk: ?
13:25:20reactormonk@ EXetoC
13:25:21EXetoCreactormonk: you mean me? https://github.com/fowlmouth/nimlibs/blob/master/fowltek/maybe_t.nim
13:25:39EXetoCekarlso: do you need to? if so then with a table perhaps
13:25:54ekarlsoEXetoC: why a table ?
13:26:33reactormonkEXetoC, any map around?
13:26:45reactormonkI'd expect at least an iterator ^^
13:26:52*SplinterOfChaos joined #nim
13:26:59EXetoCekarlso: for field-type mapping
13:27:18ekarlsoEXetoC: so key string val typedesc or ?
13:36:13ekarlsohttps://bpaste.net/show/92649a582340 < why am I failing on #12 there ?
13:36:18ekarlsodb_utils.nim(12, 8) Error: 'Column' is not a concrete type.
13:36:25*kapil__ joined #nim
13:36:30*ehaliewicz joined #nim
13:36:39reactormonkekarlso, Column[T]
13:36:54ekarlsoisn't that valid for generics ?
13:37:08EXetoCekarlso: the name rather than the typedesc (typetraits.name), if you really need it
13:37:26ekarlsodb_utils.nim(12, 41) Error: undeclared identifier: 'T'
13:37:30ekarlsothen :/
13:37:43reactormonkekarlso, O.o
13:37:57ekarlsodo you need to pass T for table as well ?
13:38:04reactormonkekarlso, btw, check do_* for sql stuff
13:38:07ekarlsodoesn't exactly make sense
13:38:16EXetoCekarlso: either you make Table generic too (Table[T]) or you instantiate Column there and then (Column[int]) for example
13:38:38ekarlsosigh, u can't have a Table of just string :p
13:38:50EXetoCinstantiations cannot happen at runtime. if you want something along those lines then perhaps you want to rely on object variants instead
13:39:27ekarlsosigh, so generics aint allowed for tables...
13:39:30ekarlsodoh
13:40:03reactormonkekarlso, yes, they are. Just don't make name collisions
13:40:12EXetoCperhaps there's some obscure way of getting it to work, at *compile time*
13:40:24EXetoCreally. ok
13:40:49ekarlsoreactormonk: sorry ?
13:41:01EXetoCreactormonk: I think he means Table[string, typedesc]
13:41:15ekarlsodb_utils.nim(12, 22) Error: no generic parameters allowed for Table
13:41:17ekarlso-,,-
13:41:23ekarlsobelieve me I tried :p
13:42:13ekarlsoreactormonk: how you mean name collisions ?
13:42:23EXetoCit's not directly related to tables. you can't do "foo: Column" either
13:42:50EXetoCtypeinfo might be what you want as I said, and the marshal module shows how it can be used
13:43:18ekarlsoI wanna be able to define how a table looks in nim-lang with columns basically
13:44:18reactormonkekarlso, you're importing tables, which defines Table
13:44:25ekarlsoahhh
13:44:27ekarlsohah
13:45:36EXetoCis it causing problems? if so, qualify those symbols or rename your type
13:45:37*ehaliewicz quit (Read error: Connection reset by peer)
13:46:31EXetoCqualify with the module name containing the type that you want
13:47:00ekarlsonono, just so stupid that I forgot that there's Table already defined ;)
13:47:02ekarlsodb_utils.nim(16, 16) Error: invalid type: 'None' in this context: 'proc (string, string): DbTable'
13:47:05ekarlsohmm
13:47:30ekarlsodont get it what's None there
13:47:41reactormonksomething, give code
13:48:04ekarlsoreactormonk: sure thing: https://bpaste.net/show/beb998b801ac
13:49:13ekarlsobut I guess a generic is kinda weird too since the "data" field is never gonna be used :/
13:49:49ekarlsowhat they're doing in rust is storing what type the field is gonna be loaded as
13:50:54reactormonkekarlso, sooo what exactly are you trying to achieve?
13:51:27ekarlsoreactormonk: defined a DbTable and it's DbColumns
13:52:09ekarlsobut store the type that a column is eventually going to be
13:53:03reactormonkekarlso, so you want to store the type information of a table?
13:53:16ekarlsoreactormonk: yea
13:53:18*gokr_ quit (Ping timeout: 245 seconds)
13:53:27ekarlsorather speaking I wanna store what type a column is
13:53:37ekarlsois it a string, float, int or whatever
13:53:59reactormonkDo you know that at compiletime or runtime?
13:54:28ekarlsocompiletime, database doesn't change when you're running typically :P
13:54:39reactormonkit might change when you're altering
13:55:04ekarlsotrue enough
13:56:06reactormonkHow do you want to propagate the types into the typesystem?
13:56:27ekarlsohow you mean ? :)
13:57:03EXetoCis this an ORM you're creating?
13:57:04reactormonkYou gotta tell nim somehow which type something is, so you can e.g. var foo: int = <some expression that fetches it from the table>
13:57:53ekarlsoEXetoC: more like a way to build queries at first was the plan..
13:59:04reactormonkEXetoC, typedesc is runtime or compiletime?
13:59:45EXetoCreactormonk: compile time. generic parameters are typedescs
14:00:36reactormonkEXetoC, so what happens when I have var t: Table[string, typedesc] and go t["foo"]?
14:02:42EXetoCreactormonk: it doesn't work
14:03:33reactormonkekarlso, that's where the None comes from - you can't use typedesc because that's None after compiling it
14:04:07*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 35.0/20150108202552])
14:05:17ekarlsodarn :)
14:05:44reactormonkekarlso, I think you might want to go with templates here and think on how exactly you want to deal with it
14:05:44EXetoCekarlso: rust is storing the type of what exactly?
14:06:29ekarlsoEXetoC: the db column
14:06:52EXetoCyou need that for query *building*?
14:07:51ekarlsoguess not ..
14:08:08ekarlsonot sure why they store the type info
14:08:11ekarlsoi'll dig into that
14:11:22ekarlsobut wouldn't be wrong to have a thing that could help marshal db rows to objects..
14:12:43EXetoCthat's more than just querying then, but shouldn't you just rely on the SQL API in order to perform type validations at run-time?
14:13:16ekarlsoEXetoC: eh, well atm it doesn't ..
14:13:26ekarlsoTRow is just a seq of strings..
14:15:04EXetoCyou can attempt to convert to int then for example, and see if it works
14:15:35ekarlsothat's what I'm doing atm... parseInt(row[0])
14:18:14ekarlsostill would be kinda nice to have a util that generated the sql programmatically then you executed a query, fed it the row and your object or smth like that and returned a instance of the object populated
14:18:32ekarlsobut that's 2 sept. libraries
14:20:16Araq_hey guys. I'm back
14:23:05ekarlsoEXetoC: or is that wishful thinking ? :)
14:25:19*barosl quit (Quit: Leaving)
14:25:55ekarlsoreactormonk: regarding alter table, yeah but stuff like sqla core still defined the table in a python file like "this is my table" so if you change a column type underneath it will blow up
14:26:25reactormonkAraq_, time for some coding?
14:27:09Araq_reactormonk: what makes you think I'm not coding all the time?
14:27:37reactormonkAraq_, that you have to announce you're back
14:28:14ekarlsoreactormonk: you think my usecase is weird ?
14:29:01reactormonkekarlso, no, buy your approach is incorrect.
14:29:13ekarlsohmmms
14:30:11ekarlsoreactormonk: sugestions ?
14:30:28Araq_ekarlso: IMO an ORM should read the database model from the database and generate type safe Nim code to access it. but you need to have LINQ-like query building and it's lots of work
14:30:32reactormonkekarlso, you could make an ORM by using said fieldPairs and templates to generate the procs
14:30:53reactormonkAraq_, so you wanna read the DB at compiletime?
14:31:36Araq_no. it's an external tool that generates Nim code. you *can* do it at compiletime but I don't see the point
14:31:39EXetoCekarlso: what I suggested would be the basis for that, since some kind of type information must be available
14:32:09Araq_it's likely a slowish operation so you either cache it or you don't do it at compile-time
14:32:22ekarlsomeh, i give up :p
14:33:27ekarlsosounds like something that's above my knowledge grade atm for nim :)
14:33:43Araq_ekarlso: it's not Nim specific really.
14:33:58Araq_it's just a code generator
14:34:23ekarlsoAraq_: well never done those either :)
14:36:25ekarlsoAraq_: but most libraries like that doesn't do it that way ?
14:36:36EXetoCjust start small and add things incrementally if you want to learn. it should be much easier to start with only the type matching
14:38:29Araq_ekarlso: LinqToSql does it this way.
14:39:24*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:40:26Araq_and it's the right way to do it.
14:42:26*threewood joined #nim
14:42:54EXetoCekarlso: "for name, val in obj.fieldPairs: if name == columnName: if areCompatible(val.type.toKind, columnKind): val = columnValue else: <handle type mismatch>"
14:42:59Araq_for static typing
14:44:02Araq_EXetoC: that is a nice 70% solution :-)
14:44:11EXetoCI don't know how far you can go with fieldPairs though. recursive iteration might work
14:45:34Araq_EXetoC: that's an implementation for getColumns[MyObjType](query), right?
14:45:42EXetoCnot that standard SQL can yield trees or anything
14:46:12Araq_if you do the join implicitly, it can
14:47:32EXetoCok
14:55:00ekarlsoAraq_: tree what ?
14:55:45EXetoCekarlso: me?
14:56:05ekarlsonah I mean the join stuff
14:56:40EXetoCSQL JOIN I assume
14:57:22ekarlsodoes it return trees in that cae ?
14:57:24ekarlsocase..
15:00:56*gmpreussner___ is now known as gmpreussner|afk
15:05:18*saml joined #nim
15:10:36dumdumcompiler hangs when I do : type
15:10:36dumdum Cat = generic cat
15:10:36dumdum var x = meow(cat)
15:10:36dumdum x is Cat
15:10:59*reem joined #nim
15:10:59Araq_dumdum: please report it properly
15:11:34*Varriount|Busy joined #nim
15:11:40dumdumOk, but I am not sure, if I am doing something wrong
15:12:19Varriount|Busy*yawn* Good morning everyone!
15:15:56Araq_dumdum: 'generic' is in .experimental or will be soon. that said, a hanging compiler is always a bug
15:16:22*davidhq joined #nim
15:16:27*gmpreussner|afk quit (Ping timeout: 244 seconds)
15:19:28*gmpreussner|afk joined #nim
15:19:35dumdumOk, created: https://github.com/Araq/Nim/issues/2013
15:19:37*mrordinaire joined #nim
15:34:38*darkf quit (Quit: Leaving)
15:36:43ekarlsoEXetoC: I guess a way to generate queries atm would be the best :P
15:38:52*BitPuffin quit (Ping timeout: 240 seconds)
15:39:19ekarlsoso you could do smth like
15:39:54ekarlsounvm
15:42:03*endou______ quit ()
15:42:19*endou______ joined #nim
15:44:50*kapil__ quit (Quit: Connection closed for inactivity)
15:50:01*sillesta joined #nim
15:56:34*irrequietus joined #nim
16:06:19*dumdum quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:06:20*MyMind joined #nim
16:06:22*Sembei quit (Read error: Connection reset by peer)
16:07:39*gmpreussner|afk is now known as gmpreussner
16:12:29*sampwing joined #nim
16:14:22*Sphax quit (Read error: Connection reset by peer)
16:15:20*Sphax joined #nim
16:19:05*sampwing quit (Ping timeout: 252 seconds)
16:23:39*BitPuffin joined #nim
16:35:58*SneakySnake joined #nim
16:43:14*gmpreussner is now known as gmpreussner|afk
16:55:39*gmpreussner|afk quit (Ping timeout: 244 seconds)
16:56:56*sampwing joined #nim
17:24:46*Sphax quit (Quit: CYA!!)
17:24:57*CARAM__ quit ()
17:25:12*CARAM__ joined #nim
17:30:30novistis there a way to have a conditional checking if specific function overload exists? like call init(obj) only if valid init is defined.
17:31:09Araq_when compiles(init(obj))
17:31:33*Matthias247 joined #nim
17:31:43novistthank you
17:32:47*mrordinaire quit (Read error: Connection reset by peer)
17:33:16*mrordinaire joined #nim
17:33:33novisti bet nim is like only lang that can do this. it can do weirdest things one can think of apparently
17:35:02Araq_D can do the same but I can never rember the syntax for it
17:35:14*sillesta quit (Ping timeout: 245 seconds)
17:35:19Araq___is(typetraits, init(obj)) ?
17:35:58Araq_nah, but it's something ugly
17:36:59*sillesta joined #nim
17:37:01novistwell that bit surely was ugly. and totally not intuitive
17:38:22novistsince you here Araq_.. can virtual c++ class methods be overloaded in nim easily? reactormonk that not rly. but i was thinking maybe you would know some magic trick
17:38:47*MajorWork quit (Quit: Leaving)
17:39:03Araq_you mean 'override', right? overloading is different
17:39:43novistactually i mean pure virtual, sorry
17:39:50Araq_and yeah, you cannot. C++ support has been improved tremendously in the devel version of the compiler. for instance Nim can generate template instantiations
17:39:59Araq_now
17:40:12Araq_but overriding a virtual method is still not possible.
17:40:43novistthink it will come before 1.0? its pretty much mandatory for using serious c++ stuff. be it game engines or even Qt.
17:40:59Araq_what you can do is to generate a class that overrides it via .emit and takes a closure
17:42:08*mrordinaire quit ()
17:42:15Araq_I thought about mapping 'method' that operates on a type that is importcpp'ed to a real C++ method so that overriding works
17:43:18*sillesta quit (Ping timeout: 245 seconds)
17:43:54Araq_but usually these things have their own event system on top of that, making wrapping easier. (or harder)
17:47:12*sillesta joined #nim
17:50:40*renesac quit (Ping timeout: 246 seconds)
17:56:36*dumdum joined #nim
18:08:06*BitPuffin quit (Ping timeout: 276 seconds)
18:13:29ekarlsoAraq_: sugguestions for query builder ? :)
18:13:57*polde joined #nim
18:15:21*polde quit (Quit: WeeChat 1.2-dev)
18:17:42*sampwing_ joined #nim
18:18:15*sampwing quit (Ping timeout: 252 seconds)
18:26:53*polde joined #nim
18:26:59novisti want my init() (constructor) be usable on both ref and non-ref types. is there a way to do this while having single proc doing initialization?
18:28:06*polde quit (Quit: WeeChat 1.2-dev)
18:28:56*gmpreussner joined #nim
18:29:11*gmpreussner is now known as gmpreussner|work
18:29:33EXetoCnovist: with a var argument taking a plain object
18:32:05novistoh that works. thanks
18:32:10EXetoCinvoking it in the case of a ref: "var x = new(T); init(x[])" and with an object allocated on the stack: "var x: T; init(x)"
18:33:18novistx[]? it works just fine without []. what is [] for?
18:35:11EXetoCnovist: it won't if the proc doesn't take a ref. [] dereferences
18:36:16novistdang right. worked because i created two objs on stack. i see now
18:44:50*UberLambda joined #nim
18:48:41*rational joined #nim
19:02:01*pep__ joined #nim
19:02:11*gnzh joined #nim
19:02:27*pep__ quit (Client Quit)
19:02:38*gnzh quit (Client Quit)
19:02:42dumdumsorry, I dont get it, I thought var just made param mutable, so init(x) where x is on stack, gets passed as a copy of x to init and should not mutate original x?
19:03:29dumdumbut I coded it and it works :S
19:03:51Varriount|Busydumdum: Nope.
19:04:14Varriount|Busydumdum: A 'var' type in a procedure means 'pass an implicit pointer to this type'
19:05:38Varriount|Busy'proc foo(s: var string)' means 'a procedure named foo which takes an implicit pointer to a string object'
19:05:53Varriount|BusyOr rather, an implicit reference, but w/e
19:06:17*reem quit (Remote host closed the connection)
19:07:36dumdumok so foo gets passed a pointer to stack object but how come I am able to write: s.some_prop = somevalue inside foo?
19:08:03dumdumshouldnt i write s[].some_prop = val, (as u say 's' is a pointer now)
19:08:20def-that's why Varriount|Busy said "implicit reference"
19:08:22*ehaliewicz joined #nim
19:08:47Varriount|Busydumdum: The compiler takes the address for you.
19:10:20Varriount|Busydumdum: You can look at the generated C code if you want. It's not too hard to read.
19:13:48*perturbation joined #nim
19:15:58dumdumunderstood, thank you!
19:24:40Varriount|BusyHrm... Does anyone know if the unicode module actually *works*? The number of usages of 'int' instead of 'int64' or 'int32' worries me, since all those bit operations could get wonky.
19:26:43EXetoCVarriount|Busy: I've been told it doesn't matter
19:26:56EXetoCI was confused by it too, but that's that
19:29:43ekarlsoEXetoC: so what's the fieldpairs stuff ? :)
19:30:27EXetoCVarriount|Busy: actually, that was specifically about RuneImpl, but the other cases are just for indexing, right? and then it follows the usual pattern
19:30:50EXetoCekarlso: the documentation for the system module has an example
19:33:28ekarlsoEXetoC: so generics approach won't work ? :D
19:34:58EXetoCVarriount|Busy: it has worked, in the few cases where I've used it. some things are unintuitive, but I haven't heard of any actual bugs
19:35:17EXetoCekarlso: this approach would involve generics
19:36:02ekarlsoEXetoC: yeah but I guess not with a map or so
19:36:50EXetoCa map?
19:37:09ekarlsothe column / table stuff I did
19:37:10EXetoCright, hash map
19:37:12ekarlsowhich was foobar
19:38:08*polde joined #nim
19:38:27EXetoCit's more about the fact that you're trying to use typedesc at run time
19:39:20ekarlsonoone's done similar stuf fbefore ?
19:41:12*BitPuffin joined #nim
19:41:25*perturbation quit (Ping timeout: 256 seconds)
19:42:04*irrequietus quit ()
19:45:09EXetoCI don't know, but we have already discussed the things that seem to be of relevance. start doing basic things if there's something you need to learn
19:48:08*ronny joined #nim
19:48:12ronnyhi
19:48:21EXetoCthat's my suggestion, but if you still want to find someone who has done similar things then you might have better luck asking on the forum
19:48:27ronnywhats the testing toolkit of choice for nim?
19:49:07*brson joined #nim
19:49:08EXetoCasserts inside a "when isMainModule:" block for now
19:49:46EXetoCor doAssert, since it works in release mode too
19:49:52ronnyouch, then its not usable for what i want to do ^^
19:50:59EXetoCronny: you could try the unittest module, but it has some issues still. what exactly is it that you want to do?
19:52:26ronnyEXetoC: the targets is minimal json api to maildir/mails sotred in a sql database + serving my frontend rich client
19:53:13ronnyatm im doing the backend in python, but i'd prefer to make it comletely async
19:54:29EXetoCI'm not sure what features you're looking for
19:54:50ronnyme neither
19:55:06ronnybut i either need sane threading or sane async
19:58:19ronnyand my current backend language has neither
19:58:43*sampwing_ quit (Ping timeout: 252 seconds)
19:58:50EXetoCI don't know what that has to do with unit testing
19:59:05EXetoCbut we have threading and async facilities
19:59:57ekarlsoEXetoC: btw I think the type matters in some cases
20:01:00ronnyEXetoC: well, if i cant nicely test muti backend apis at unit and acceptance level, i'll skip the language
20:01:16*reem joined #nim
20:01:23EXetoCekarlso: did I say otherwise?
20:01:31ekarlsolike if you're doing say SELECT id, x, y FROM foo WHERE id = 1 AND x = 'foo'
20:01:57ekarlsohmmms, I guess u define the table as a object then instead ?
20:03:13EXetoCronny: I'm just saying that I don't understand what you're looking for, and you couldn't answer that yourself
20:04:00*reem quit (Remote host closed the connection)
20:04:31*reem joined #nim
20:04:36ronnyEXetoC: basiclly im loogin for a language with sound threading/async primitives and a good unit/acceptance testing toolkit
20:05:30ronny*looking
20:06:49*Varriount|Busy quit (Ping timeout: 246 seconds)
20:08:15ekarlsoEXetoC: hmms, I suck at these things -,,-
20:09:21ronnyEXetoC: so even if the rest of nim fits, if the testing utilities arent there i'll have to skip it
20:13:20EXetoCronny: I haven't seen anything related to acceptance testing, but feel free to ask on the forum too
20:14:14*dumdum quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
20:14:39ronnyEXetoC: if im going to spend more time on figuring the testing, than on testing and actual code i'll be ery unhappy
20:15:06ekarlsodom96: is it not possible to halt() outside a get: ?
20:15:43dom96ekarlso: It's not.
20:16:10ekarlsohmmms
20:16:28ekarlsohaving to write 10+ lines to handle a simple exception each time is boring
20:18:35ronnyhmm
20:18:37*ronny left #nim ("WeeChat 0.3.9.2")
20:19:11EXetoChuh
20:20:33ekarlsodom96: not a eas way to make a custom error handler ?
20:24:33dom96ekarlso: not right now
20:25:41*Gonzih joined #nim
20:25:54Araq_hi Gonzih welcome
20:26:46Gonzihhello
20:29:07ekarlsoEXetoC: as in to catch and raise a error properly I need to declare a error var, wrap a call in a try and if there's a exception set the error val to the exception in the except then below halt the request if error != nil
20:29:20ekarlsovs being able to just do the call and make diff halt's
20:35:34*bjz_ quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
20:36:03Araq_ekarlso: I'm quite sure you can at least use a template to extract the pattern
20:36:05EXetoCekarlso: an object? Table *is* an object. you really need to write more code for the sake of learning. I'm guilty of overthinking things myself and it's just unproductive
20:36:28EXetoCwith that said, I might create an example if I can think of something, but I don't know when I have the time
20:36:45Araq_but I also think async/jester has a better way to do error handling
20:37:14*perturbation joined #nim
20:46:07ekarlsowell https://bpaste.net/show/3e6ff4b47504 is long just to do a simple error
20:47:30dom96it's not that long
20:48:27dom96but I guess it is annoying if you have to handle the errors multiple times
20:48:57ekarlsowould be nicer if you could just have your own toplevel error handling proc or smth
20:49:39Araq_yeah something like system.onRaiseHook ...
20:50:00ekarlsoAraq_: you mean that is applicable here ?
20:50:07Araq_dunno
20:50:38Araq_I'd wrap it in a template, I think
20:53:36dom96Wrapping it in a template might not work because of 'halt'
20:54:22ekarlso*doh*
20:55:18dom96ekarlso: I will add a error handler at some point to jester.
20:55:19ekarlsodom96: 2 inches away from "nimble register" in a folder with a .nimble file ..
20:55:31dom96bbl
20:55:47ekarlsoit registers the package now just the version left
20:55:58perturbationekarlso: what type of project are you using jester for? (curious)
20:56:10ekarlsoperturbation: npm a'la nim
20:56:34perturbationcool
20:57:13ekarlsohttps://nim-pkg.svcs.io/#/tags/list < example of how it'll be
20:57:19ekarlsorelease part is missing there though
20:57:38perturbationI've been playing around with using jester for building a JSON REST API with db_sqlite as the data store
20:57:50ekarlsoperturbation: that's what this is :p
20:57:58ekarlsogetting *fairly* big as well atm :|
20:58:00*skyfex__ quit (Quit: (null))
20:58:05perturbationoh awesome
20:58:16ekarlso800+ lines ish atm
20:58:20ekarlsobut needs a cleanup soon
21:00:17perturbationone thing I was going to try (after digging a bit into how jester does its macro magic) was adding some sort of middleware for authentication, etc. - is that already a solved problem?
21:00:39ekarlsoperturbation: I've added JWT to this stuff
21:00:50ekarlsoor at least a basic version of it, still need to add claim checking
21:01:03ekarlsohttp://github.com/ekarlso/nim-jwt
21:01:43ekarlsoperturbation: the packages website uses satellizer for auth with local / github as alternatives
21:02:59perturbationyeah I'm totally stealing^W integrating nim-jwt
21:03:07perturbationyou're using angular as the frontend?
21:03:18ekarlsoperturbation: ye
21:03:28*sampwing joined #nim
21:03:53perturbationI need to check that out... I've heard it's really nice
21:05:54ekarlsoperturbation: meh, one of the dudes behind it just started a new framework hah
21:06:00ekarlsoangular in one awy with the scope stuff is messed up
21:07:45perturbationI've heard 2.0 kind of breaks everything... I'm really new to front-end stuff but I started a project in Dart and I love the amount of structure/discoverability that it brings over Javascript
21:10:29*Matthias247 quit (Quit: Matthias247)
21:21:16*Matthias247 joined #nim
21:24:55*irrequietus joined #nim
21:26:49*perturbation quit (Ping timeout: 256 seconds)
21:57:47*UberLambda quit (Quit: Leaving the Matrix)
21:59:53*Trustable quit (Quit: Leaving)
22:01:22*Sergio965 joined #nim
22:18:06*cow_2001 joined #nim
22:18:52cow_2001woah :|
22:19:19dom96hi cow_2001
22:19:26cow_2001hi! :)
22:19:46cow_2001so there are so many new languages popping all around
22:19:54cow_2001I am curious
22:22:33*lkg joined #nim
22:23:14lkgmy cmd isn't finding the term nim. I installed the binary and through github. What should I do?
22:25:52wtwyour nim executable is not in your path, do something like "export PATH=$PATH:/your/nim/path"
22:26:24EXetoCseems like he's on windows
22:26:38wtwar, right
22:26:40wtw;)
22:27:01lkgyeah i am
22:27:10EXetoChttp://stackoverflow.com/questions/6832496/command-prompt-how-to-add-a-set-path-only-for-that-batch-file-executing
22:27:22EXetoCit can be done temporarily, but locate the binary and try that
22:27:29wtwset PATH=%PATH%;c:\your\nim\path
22:27:43lkgjust the nim folder?
22:28:03wtwyep
22:28:29*jasondotstar joined #nim
22:28:30wtwyou may also add this to your environment variables if it works, to make it permanent
22:29:49*Synatra joined #nim
22:29:59EXetoCwhere the binary is located
22:30:09Synatrasup
22:30:14lkgnot doing it right. is %PATH% supposed to be something? can you give me an example
22:30:15wtwvia "system properties" -> advanced system settings -> advanced -> environment variables -> path
22:30:21lkgah
22:30:30wtwtry echo %PATH%
22:32:01EXetoClkg: no that's the existing path variable, and so you have that first and then you append a path at the end
22:32:05*keyle joined #nim
22:32:21keylemorning.
22:32:51lkgim not understanding. I added C:\Nim to the PATH variable, which isn't working
22:33:07keyleyou want nim\bin probably
22:33:11keylewhere the binary resides
22:33:19lkgokay
22:33:58lkgthere we go
22:34:00wtw:)
22:34:02lkgthanks
22:34:27wtwnow make it permanent :)
22:34:34wtwor did you do that already?
22:34:43*gmpreussner|work quit (Read error: Connection reset by peer)
22:34:45lkgi think so. I added it to the environment var
22:34:51wtwok :)
22:35:15lkgfriendlier than the rust community here XD
22:35:25EXetoCyeah?
22:35:30SynatraIm from the rust community :(
22:35:41wtwme too, more or less, but mostly lurking
22:36:00lkgi find rust pretty busy
22:36:02Synatrawe are very friendly
22:36:52SynatraYeah our IRC can be hectic :I
22:37:01lkgi dont disagree, it's just that i don't see this many ":)" in #rust
22:37:38EXetoCapathic bastards :p
22:37:41wtwhehe
22:38:00SynatraYOull most likely see alot of <T> in #rust
22:38:40wtw<T> :)
22:38:48lkguh oh "could not load: ll"
22:40:17*d3m1gd quit (Ping timeout: 245 seconds)
22:40:48*Gonzih quit (Quit: Lost terminal)
22:41:53*chroem joined #nim
22:42:28lkganyone know what error code 11 does?
22:42:49EXetoC*ll ;)
22:43:08EXetoCor was it a typo the first time?
22:43:25lkgit printed out ll
22:43:30*Demon_Fox joined #nim
22:43:47lkgyeah, ll not 11
22:44:25EXetoCodd error message
22:44:50lkgim running with aporia
22:46:28lkgoh it's l should not be used warning.
22:46:29*skyfex__ joined #nim
22:47:25*Outlander joined #nim
22:48:21Synatrahave any of you guys done any projecteuler with Nim?
22:51:24*skyfex__ quit (Ping timeout: 265 seconds)
22:53:00EXetoClkg: where did the message in quotes come from then?
22:53:53lkgthe thing at the bottom of aporia. forgot what it's called
22:54:04lkgim trying to run the nim sdl example
22:55:23def-lkg: where is that example?
22:57:19lkghttps://github.com/nim-lang/sdl2
22:59:01lkgi put everything in the src file in a workspace folder along with nim opengl, etc
22:59:43def-what's the exact error you're getting?
23:00:00lkgcould not load: ll > Process terminated with exit code 1
23:00:34def-huh, what is ll?
23:03:08*gmpreussner joined #nim
23:03:19*gmpreussner is now known as gmpreussner|work
23:04:30def-ah, ll is some dll you're missing?
23:05:13def-googling makes me believe it's something with directx
23:05:29SynatraQuestion
23:05:38Synatradoes Nim have these types of pointers?
23:05:39Synatrahttp://prntscr.com/5xhiih
23:08:42def-Nim has traced pointers (ref) and untraced pointes (ptr). I would say that's about it
23:08:45def-http://nim-lang.org/manual.html#reference-and-pointer-types
23:09:18Synatraokay
23:09:34EXetoC"lent pointers" is in the roadmap. not sure what it means
23:10:51lkghm i thought i had the right dlls
23:11:00def-lkg: you have directx 10?
23:11:19lkgim not sure, im trying to use opengl right now
23:11:59def-seems like sdl2 links against ll.dll from directx though
23:17:10chroemSo, uh, c2nim depends on 0.10.3, and the latest version is 0.10.2...
23:17:13*davidhq quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:17:34keylechroem: best to use the devel branch
23:17:34def-chroem: the devel branch from github should work: https://github.com/araq/nim
23:18:22chroemAlright, I'll give it a shot.
23:18:22keylebottom of the page indicates how to build the devel branch http://nim-lang.org/download.html
23:18:44chroemkeyle: That's what i just did.
23:19:09keylesee the text under the code block
23:19:13chroemErr
23:19:15chroemNevermind
23:19:16chroemYeah
23:19:29keyle-b devel :)
23:19:49keyledef-: Nim really needs nightly builds imho
23:20:43*Matthias247 quit (Read error: Connection reset by peer)
23:21:06def-keyle: yeah, would be nice to have the builders build them
23:21:28keylewhat do you mean by builders?
23:22:33def-there are some automated build systems running
23:23:07*Demon_Fox quit (Quit: Leaving)
23:23:44*lkg quit (Quit: Page closed)
23:23:49keyleah, yes that'd be good.
23:23:51def-http://buildbot.nim-lang.org/waterfall
23:25:41keyleyeah it'd be neat if you could link a zipped version of the succesful builds imho
23:25:56keylethe last one of the day or something
23:26:13keylelast successful*
23:26:24*sillesta quit (Ping timeout: 272 seconds)
23:26:38def-especially since 0.10.2 has some problems people run into, like c2nim not working or httpclient and async* being broken
23:26:56keyleyeah I ran into httpclient issues myself
23:29:07*Demon_Fox joined #nim
23:30:24keylethe freebsd build should be an easy fix? (build.sh: gcc: not found)
23:34:25chroemSo is c2nim incompatible with C's "#define" syntax?
23:34:45chroemI don't know C, so...
23:35:51chroemI'm getting errors saying that it's getting unexpected newlines after #define 's
23:37:35*ehaliewicz quit (Remote host closed the connection)
23:38:05def-keyle: it's not just that, there's a PR to fix freebsd build
23:40:18*reem quit (Remote host closed the connection)
23:41:04EXetoCchroem: sometimes it fails, in which case the macro has to be modified
23:41:17EXetoCit might be a good idea to run the preprocessor over it
23:41:30chroemOkay
23:48:29chroemYaaaaayyyyyyyyyyy
23:48:37chroemDecent crypto support for nim
23:48:40chroem*confetti*
23:51:53EXetoCas in hashing?
23:52:00EXetoCsomeone wanted more things yesterday
23:52:07chroemAs in public and private key.
23:52:16chroemThat was me
23:52:40EXetoCoh
23:52:59chroemIt'll be a while before I can test everything and make it look purdy, though.
23:53:16EXetoCgreat
23:53:49*Outlander quit (Ping timeout: 255 seconds)
23:55:32*Sergio965 quit (Ping timeout: 272 seconds)
23:56:51*rational quit (Quit: Lost terminal)
23:57:17*Outlander joined #nim
23:59:05*irrequietus quit ()