<< 04-04-2015 >>

00:06:38*Demos quit (Quit: Lost terminal)
00:44:01*jefus__ is now known as jefus
00:50:13*BitPuffin quit (Ping timeout: 264 seconds)
00:51:41*arnetheduck joined #nim
01:29:35*desal joined #nim
01:35:53*rational quit (Quit: Lost terminal)
01:41:30*saml_ joined #nim
01:55:50*Kingsquee quit (Quit: Konversation terminated!)
02:02:14*coopernurse quit ()
02:02:46*untitaker quit (Ping timeout: 272 seconds)
02:09:12*untitaker joined #nim
02:09:44*polde quit (Ping timeout: 272 seconds)
02:12:45*polde joined #nim
02:15:09*n1ftyn8 joined #nim
02:31:51*saml_ quit (Quit: Leaving)
02:32:58*saml_ joined #nim
02:40:58*darkf joined #nim
02:45:01*jholland quit (Quit: Connection closed for inactivity)
02:47:59*Varriount joined #nim
03:27:48*brson joined #nim
03:32:42*polde quit (Ping timeout: 272 seconds)
03:33:10*reem joined #nim
03:33:16*Kingsquee joined #nim
03:41:17*gsingh93 joined #nim
03:47:23*reem quit (Read error: Connection reset by peer)
03:47:51*reem joined #nim
03:50:52*reem quit (Remote host closed the connection)
03:54:55*reem joined #nim
04:01:56*polde joined #nim
04:13:31*TEttinger joined #nim
04:16:24*polde quit (Ping timeout: 272 seconds)
04:16:39*lorxu joined #nim
04:16:56*reem quit (Remote host closed the connection)
04:18:12*reem joined #nim
04:19:16*reem quit (Remote host closed the connection)
04:20:11*dashed joined #nim
04:21:07*reem joined #nim
04:24:16*reem quit (Remote host closed the connection)
04:25:29*polde joined #nim
04:34:46*polde quit (Ping timeout: 272 seconds)
04:36:57*reem joined #nim
04:37:26*reem quit (Remote host closed the connection)
04:37:57*reem joined #nim
04:38:39*saml_ quit (Quit: Leaving)
04:42:29*reem quit (Ping timeout: 246 seconds)
04:50:21*reem joined #nim
04:51:56*reem quit (Remote host closed the connection)
05:01:44*pipitone joined #nim
05:02:26*polde joined #nim
05:02:28pipitone /join #lesswrong
05:02:36*pipitone left #nim (#nim)
05:14:40*polde quit (Ping timeout: 272 seconds)
05:23:08*polde joined #nim
05:34:11*pregressive joined #nim
05:39:12*pregressive quit (Ping timeout: 246 seconds)
06:14:50*polde quit (Ping timeout: 272 seconds)
06:26:57*cyraxjoe quit (Ping timeout: 256 seconds)
06:27:47*MightyJoe joined #nim
06:44:52*polde joined #nim
06:47:15*clynamen_ is now known as clynamen
06:56:00*polde quit (Ping timeout: 272 seconds)
07:00:24*yglukhov_ joined #nim
07:04:41*yglukhov_ quit (Ping timeout: 250 seconds)
07:18:34*brson quit (Quit: leaving)
07:31:11*ChrisMAN quit (Ping timeout: 264 seconds)
07:39:08*polde joined #nim
07:41:10*desal quit (Ping timeout: 246 seconds)
07:46:19*gsingh93 quit (Ping timeout: 255 seconds)
07:49:11*Ven joined #nim
07:57:26*polde quit (Ping timeout: 272 seconds)
08:09:22*BlaXpirit joined #nim
08:12:57*lorxu quit (Remote host closed the connection)
08:15:34*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:29:07*pafmaf joined #nim
08:42:25*polde joined #nim
08:45:45*yglukhov_ joined #nim
08:46:58*polde quit (Ping timeout: 265 seconds)
08:47:29*Ven joined #nim
09:02:37*pafmaf quit (Quit: This computer has gone to sleep)
09:16:54*polde joined #nim
09:20:20*yglukhov_ quit (Quit: Lingo: www.lingoirc.com)
09:29:55BlaXpirithow to do method dynamic dispatch at compile time?
09:30:32dtscodei dont think you can
09:31:05BlaXpiritwell yeah, ref types don't work and all that jazz
09:31:23BlaXpiritbut i mean maybe there is some way to simulate this concept otherwise
09:31:58BlaXpiritso one option is to give each object a member that says what class is it
09:32:01*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:32:11BlaXpiritand then instead of many methods have one proc with a condition on type :| :| :|
09:37:45*polde quit (Ping timeout: 276 seconds)
09:56:37*EXetoC quit (Ping timeout: 248 seconds)
09:59:12*pafmaf_ joined #nim
10:04:37*polde joined #nim
10:08:51*dtscode left #nim ("Leaving")
10:08:57*dtscode joined #nim
10:12:39*TEttinger quit (Read error: Connection reset by peer)
10:13:10*TEttinger joined #nim
10:13:39*TEttinger quit (Read error: Connection reset by peer)
10:14:49*pafmaf_ quit (Ping timeout: 264 seconds)
10:15:15*pafmaf joined #nim
10:28:56*banister joined #nim
10:29:26*polde quit (Ping timeout: 272 seconds)
10:30:54*Ven joined #nim
10:34:11*milosn quit (Ping timeout: 264 seconds)
10:35:40*milosn joined #nim
10:38:30*banister quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:38:38*eigenlicht joined #nim
10:39:48*polde joined #nim
10:43:53*eigenlicht quit (Quit: WeeChat 0.3.2)
10:47:48*polde quit (Ping timeout: 265 seconds)
10:48:15*Trustable joined #nim
10:51:33def-BlaXpirit: there should be an internal field already, because that's what methods do. Not sure if you can access it easily though
10:54:18*dashed quit (Quit: Connection closed for inactivity)
10:55:35*Matthias247 joined #nim
10:56:23BlaXpiritbut gee, ref types really should work
10:57:02BlaXpiriteven without garbage collection
11:07:47*Strikecarl joined #nim
11:08:45StrikecarlIf i want to copy all files in x folder to x folder using copyFIle
11:08:48StrikecarlcopyFile*
11:08:51Strikecarlhow would i do that+
11:10:04*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:11:29*Ven joined #nim
11:16:38*polde joined #nim
11:21:22*polde quit (Ping timeout: 272 seconds)
11:28:30*endragor joined #nim
11:29:14*polde joined #nim
11:37:25*johnsoft quit (Ping timeout: 248 seconds)
11:37:50*polde quit (Ping timeout: 272 seconds)
11:41:33endragorIs there a template in Nim's standard library similar to Python's "with" or Java's try-with-resources? Basically, I want file/resource to be closed automatically either when a block ends or an exception happens. I've seen such template in tutorial, but can't find it in standard library. And code examples seem to explicitly open/close files.
11:43:40*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
11:46:19BlaXpiritendragor, http://nim-lang.org/manual.html#defer-statement
11:50:18endragorthanks!
12:02:30*johnsoft joined #nim
12:06:17*meeeee3 joined #nim
12:06:27meeeee3iup help anyone?
12:07:07*polde joined #nim
12:07:57def-meeeee3: you have iup installed?
12:08:16meeeee3how
12:08:27meeeee3nimble installed
12:08:29def-http://webserver2.tecgraf.puc-rio.br/iup/
12:08:38def-I guess you have to install that also
12:08:42def-I've never used IUP
12:09:03def-if you can compile C programs with IUP, then it should also work with Nim
12:10:33def-hm, compilation of iup fails for me on linux, no idea
12:12:12meeeee3dont get it
12:12:20def-I guess you can get precompiled libraries from here: http://sourceforge.net/projects/iup/files/3.13/
12:12:23def-meeeee3: what OS do you use?
12:12:28meeeee3i downlaoded 13mb with iuptest.exe iupview.exe
12:12:30meeeee3win
12:13:03meeeee3shouldnt it be a lib or something
12:13:13meeeee3which i install with nimble
12:14:02def-nimble only installs nim libraries
12:14:30def-but iup is a c library and we have a nim wrapper for that
12:15:00def-so you need to get the c library, and probably put it in the same directory as your .nim file
12:15:01*BlaXpirit quit (Read error: Connection reset by peer)
12:15:22meeeee3iup-3.13_Win32_mingw4_lib.zip
12:15:25meeeee3this
12:15:51def-no, the dynamic library
12:15:52meeeee3many.a files
12:15:54*BlaXpirit joined #nim
12:15:56meeeee3ok
12:16:27def-are you building 32bit binaries?
12:17:12meeeee3yes
12:17:34def-iup-3.13_Win32_dllw4_lib.zip should work then
12:17:41meeeee3do i need the "include" folder or the 84 dll files
12:17:42def-but probably the other win32 dlls too
12:17:49def-i think you just need one dll
12:17:59def-iup31.dll
12:18:10def-and I see that you'll have to fix the iup nim wrapper because it only goes to iup30.dll
12:18:49def-I guess you could just call the iup.dll iup30.dll as a workaround
12:19:19meeeee3i just see iup.dll - shouldnt that be right?
12:19:37def-in the end the nim wrapper should work with iup.dll, but it doesn't right now
12:19:58def-you can fix it in the wrapper with const dllname = "iup(|30|27|26|25|24).dll"
12:20:20meeeee3should i dl an older version which works with the wrapper
12:20:36meeeee3or just that
12:20:56meeeee3where is the wrapper
12:20:58def-i think it will work with that one
12:21:09def-the wrapper is in lib/wrappers/iup.nim
12:21:25meeeee3oh lol
12:21:34meeeee3should have searched my system
12:22:10*polde quit (Ping timeout: 272 seconds)
12:23:39meeeee3so now i open nimble and create a new project?
12:23:45meeeee3init ..
12:23:52def-you could do that
12:23:53meeeee3?
12:24:12def-or just create a new foo.nim file and worry about nimble later
12:24:17meeeee3ok
12:24:19meeeee3already
12:24:26meeeee3:)
12:24:37meeeee3*thinking*
12:25:09meeeee3place dll file in the same dir as my.nim file?
12:25:12def-yes
12:25:23def-the documentation is here: http://nim-lang.org/iup.html
12:26:14def-but it should be easy to port C iup code to nim
12:26:27def-if this is your first nim project, i guess it would be easier to start with something non-graphical
12:27:10meeeee3messagebox would be fine ^^
12:27:32meeeee3import lib/iup?
12:27:50def-You just want to show message boxes?
12:27:53def-just "import iup"
12:28:30def-you should use the dialogs module then, it works with winapi on windows and gtk on the rest: http://nim-lang.org/dialogs.html
12:28:32meeeee3no, i will go for the window with listview
12:28:59meeeee3no, just as a test. should be a real gui.
12:29:39*polde joined #nim
12:30:16endragorIs there a clean way to remove elements of a sequence while iterating? Something like "filter" doesn't work for me, because deletion criteria is based on other items of the seq (I have nested for-loops)
12:30:48def-endragor: I guess creating a new seq and replacing the other one with that later would be "clean"
12:31:19def-meeeee3: example for iup here: https://github.com/Araq/Nim/blob/devel/examples/iupex1.nim
12:32:01meeeee3thx, was stuck with an 180 lines cairo canvas example
12:32:07def-meeeee3: this also works for me: https://gist.github.com/def-/45efb8d57cb2985c6d58
12:33:05meeeee3works
12:33:11meeeee3thx :)
12:34:01meeeee3dllname = "iup.dll"
12:34:08*polde quit (Ping timeout: 265 seconds)
12:38:54*pafmaf quit (Quit: Verlassend)
12:39:33endragorthanks, def-. I've realized that what I need is linked list, not seq. Then iterating with nodes() and using remove() would work
12:39:48def-endragor: and removing is much faster then
12:40:06endragorsure
12:41:37*polde joined #nim
12:44:00meeeee3is there a way to avoid writing iup.open( but just open( without triggering error -> ambiguous call; both system.open(...
12:44:10meeeee3dont want to mix it
12:44:20meeeee3some iup. some without
12:46:09meeeee3also system.open and iup.open dont have the same paramers
12:46:19meeeee3wat da heww
12:46:34endragorI personally would not do so. "iup" is short enough, and it's better if reader of the code can quickly distinguish whether that is system proc or iup proc without having to think. (I don't know the answer to your question though)
12:47:59meeeee3ok, but why does the compiler think i want to call a function that takes 4 parameters with a call with two parameters
12:48:02def-meeeee3: discard open(nil, nil) works for me
12:48:14def-meeeee3: maybe it's just a compiler bug in an old Nim version
12:48:21meeeee3i hope ^^
12:48:34meeeee3latest installer
12:48:46*polde quit (Ping timeout: 272 seconds)
12:49:53def-right, that was a bug in 0.10.2, it's fixed now
12:50:56*polde joined #nim
12:54:04meeeee3endragor: i thought in that direction, because i like oop style.calls()
12:55:15meeeee3dont know if par.iup.call() is or should be a thing ..
12:56:31meeeee3no
13:01:20*saml_ joined #nim
13:06:20*meeeee3 left #nim (#nim)
13:11:34*polde quit (Ping timeout: 272 seconds)
13:28:41*HakanD_ joined #nim
13:30:14*BitPuffin joined #nim
13:35:06*Kingsquee quit (Quit: Konversation terminated!)
14:02:12*polde joined #nim
14:13:42*irrequietus joined #nim
14:19:20*polde quit (Ping timeout: 272 seconds)
14:26:28*polde joined #nim
14:36:08*flaviu quit (Remote host closed the connection)
14:36:23*flaviu joined #nim
14:38:06*Senketsu quit (Ping timeout: 244 seconds)
14:43:59*darkf quit (Quit: Leaving)
14:51:39*HakanD_ quit (Quit: Be back later ...)
14:53:26endragoris there a standard iterator to iterate sequence in reversed order?
14:55:04def-endragor: don't think so
14:59:07*HakanD_ joined #nim
15:01:56*mpthrapp joined #nim
15:02:39*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:03:21*BitPuffin quit (Ping timeout: 252 seconds)
15:09:03*nima joined #nim
15:15:04*wan quit (Ping timeout: 272 seconds)
15:15:18*nima quit (Quit: Page closed)
15:17:07*mpthrapp quit (Remote host closed the connection)
15:23:23gmpreussner|worki'm having trouble compiling c2nim @ head today (with nim @ head in Devel)
15:23:33gmpreussner|workit can't find 'compiler/llstream' even though the file is there
15:23:52gmpreussner|workdid something change with how module paths are resolved?
15:24:22gmpreussner|workthis is on Windows btw
15:29:45*wan joined #nim
15:32:21*BitPuffin joined #nim
15:38:20*Ven joined #nim
15:38:48def-gmpreussner|work: works for me on linux
15:49:00*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:52:05*Ven joined #nim
15:57:42*BitPuffin quit (Remote host closed the connection)
16:00:40*irrequietus quit (Remote host closed the connection)
16:00:57*irrequietus joined #nim
16:02:37*BitPuffin joined #nim
16:19:12*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:19:30*Ven joined #nim
16:23:54*Ven quit (Ping timeout: 246 seconds)
16:26:01*ChrisMAN joined #nim
16:26:40*reem joined #nim
16:28:38*coopernurse joined #nim
16:29:46*Ven joined #nim
16:30:32*EXetoC joined #nim
16:37:46Araqgmpreussner|work: not sure what your problem is but path handling didn't change
16:41:50*reem quit (Remote host closed the connection)
16:48:30*irrequietus quit ()
16:57:29*Strikecarl joined #nim
16:57:34StrikecarlUhm.
16:57:37Strikecarlhttp://nim-lang.org/hashes.html
16:57:44StrikecarlA way i can dehash the hash?
17:00:45dom96Strikecarl: most hashing functions are one-way.
17:00:59StrikecarlAh, okay!
17:03:24*HakanD_ quit (Read error: Connection reset by peer)
17:03:59*dtscode is now known as charmander
17:04:05*charmander is now known as mewtwo
17:04:30*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:05:15*brson joined #nim
17:06:44*endragor quit (Ping timeout: 265 seconds)
17:06:48Strikecarldom96 I just tried making a simple case statement
17:06:50Strikecarllike ths
17:07:21Strikecarlhttp://pastebin.com/qzHBGG0Q
17:07:52dom96what error do you get?
17:07:55Strikecarldont mind me that forgot echo inside the statements
17:07:57Strikecarli get the error
17:08:02Strikecarle:\nim\nim.nim(6, 5) Error: type mismatch: got (string) but expected 'THash'
17:08:09Strikecarlwhich is line 5
17:08:13Strikecarlcause i just added a extra int
17:08:18Strikecarlline 5 in the pastebin
17:08:52*Ven joined #nim
17:09:04dom96Strikecarl: So what can you see on line 5?
17:09:13dom96' of "33479340351518853":'
17:09:14dom96Right?
17:09:17Strikecarlyes
17:09:23dom96You've got a String in there.
17:09:28dom96not a 'THash'
17:09:30dom96hence the error.
17:09:43StrikecarlHow do i convert the string
17:09:46Strikecarlto a THash?
17:10:21dom96You shouldn't do that.
17:10:30dom96You should instead of convert the THash into a string.
17:10:34dom96in the line above
17:10:58StrikecarlError: conversion from THash to string is invalid
17:11:06StrikecarlI guess i dont do case string wordhashed:
17:11:32dom96Are you trying to convert it via string()?
17:11:47StrikecarlNope
17:11:49Strikecarli just did
17:11:52Strikecarlcase string wordhashed:
17:11:53Strikecarlinstead of
17:11:55Strikecarlcase wordhashed:
17:12:00Strikecarl-_-
17:12:18dom96that's equivalent to 'case string(wordhashed)'
17:12:38Strikecarlneither works.
17:12:42dom96In Nim, when you want to convert something to a string ALWAYS use `$`.
17:12:55Strikecarloh
17:12:58dom96Yes, I know. I'm trying to explain things to you.
17:13:05dom96i.e.
17:13:10dom96case $wordhashed:
17:13:12dom96is what you want
17:13:20Strikecarlso using $ just makes it to a string
17:13:23dom96Yes.
17:13:37dom96The dollar sign is the "stringification" operator.
17:13:37StrikecarlWoops, that was easy.
17:13:41StrikecarlThanks alot dom96!
17:13:49dom96np
17:16:32*endragor joined #nim
17:19:38flaviuStrikecarl: You can often dehash the "hash" here.
17:19:46flaviuhttps://github.com/Araq/Nim/blob/master/lib/pure/hashes.nim#L113
17:19:53flaviusince it isn't actually a hash.
17:20:42Strikecarlso like,
17:20:47BlaXpiritpretty sure it is a hash
17:20:49Strikecarlecho hash*(longnumberofhashhere)
17:21:35Strikecarlalso is there commenters that do multiple lines at once
17:21:38Strikecarllike in c++ theres /*
17:21:42Strikecarland to end it */
17:21:52dom96discard """ """
17:21:59Strikecarl?
17:22:23BlaXpirituse a good text editor
17:25:20flaviuBlaXpirit: Only in the strict definition of the term, and then only for datatypes > 4 bytes.
17:26:14*UberLambda joined #nim
17:27:41*reem joined #nim
17:31:13*UberLambda quit (Quit: Leaving)
17:32:15*UberLambda joined #nim
17:33:10*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
17:34:09gmpreussner|workis "{.push hint[XDeclaredButNotUsed]:off.}" still the right way to disable hints for unused const declarations in binding modules?
17:34:55BlaXpirithm, gmpreussner|work, i recently used the same but without push
17:35:09BlaXpiritwould like to know too
17:35:28BlaXpiritgmpreussner|work, deadcodeelim works well
17:35:40BlaXpiritseems to achieve the same effect
17:35:45gmpreussner|worki thought "{.deadCodeElim: on.}" would do the trick, but it didn't for const
17:36:33gmpreussner|workactually, i should be more specific: it doesn't work for const arrays
17:36:37gmpreussner|workmaybe this is a bug
17:36:49gmpreussner|worki have: const foo = [1, 2, 3]
17:37:23gmpreussner|workoh nevermind, the following wasn't caught either: const bar = 9
17:37:53gmpreussner|work'bar' is declared but not used [XDeclaredButNotUsed]
17:45:05*reem quit (Quit: Leaving...)
17:47:21Araqwhat has deadCodeElim to do with that?
17:47:46Araqand why is it a bug when the compiler properly complains about artifacts in your code?
17:48:26BlaXpiritread again then
17:49:13AraqI read it again. nothing changed. now what?
17:49:25gmpreussner|workAraq, what is the correct way to disable this warning?
17:49:49Araqyour push way.
17:50:12Araqbut I would simply remove the unused const in the wrapper
17:50:21gmpreussner|work?
17:50:35BlaXpirit...
17:50:36Araqconst unUsed = 4 # well? remove it then?
17:50:47gmpreussner|worksigh
17:50:51BlaXpiritsigh indeed
17:51:02gmpreussner|workok, those const values are actually important to consumers of the wrapper :)
17:51:12BlaXpirit"what has deadCodeElim to do with that?" well it silences XDeclaredButNotUsed warnings too
17:51:16Araqwhy are they not exported then?
17:51:24AraqBlaXpirit: no it doesn't.
17:51:34gmpreussner|workAraq, alright, that is the actual problem
17:51:36gmpreussner|workthank you :)
17:52:09BlaXpirit"why is it a bug when the compiler properly complains about artifacts in your code?" he mistakenly thought it may not work only for arrays
17:52:30gmpreussner|workit's all good. my bad.
17:54:20*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:58:52VarriountAraq: Which revision should I build the installer from?
17:59:30*mewtwo is now known as dtscode
17:59:59AraqVarriount: first please fix our "minimal mingw" stuff. we need to test somthing which uses --app:ui works too.
18:00:19Araqor we abandon the "minimal mingw" idea
18:00:49Araqsince it's an optional download now, maybe we should?
18:01:40*brson quit (Quit: leaving)
18:04:54*johnsoft quit (Read error: Connection reset by peer)
18:09:59VarriountHm, probably
18:12:27Araqbut people want to use Nim from USB sticks, so a small selfcontained package is nice
18:23:11endragorhow do you fill array with same values, but different from type defaults? Searching index by "fill" didn't reveal anything, and no other synonyms come to my mind.
18:25:21BlaXpirithttps://github.com/Araq/Nim/blob/e7d709791942480cc60afc5e34ec75ec26402b9e/lib/pure/collections/sequtils.nim#L50
18:25:39endragorthat's seq, not array
18:25:44BlaXpiritriiigh...
18:25:46BlaXpiritt
18:25:48BlaXpirituse a loop
18:25:54endragor:(
18:27:27BlaXpirityou're gonna have to live with this
18:28:03BlaXpiritnim's standard library wasn't designed, it was grown
18:31:36BlaXpirithm
18:31:59renesacit just has to be refined more
18:32:02renesacrepeat could be generalized for arrays
18:32:25renesacand that is not an iterator anyway
18:32:44BlaXpiritendragor, a.map_it(6)
18:33:07BlaXpirit(sequtils)
18:35:55*BitPuffin quit (Remote host closed the connection)
18:37:23renesachttps://github.com/Araq/Nim/pull/2461 <-- quick pull request
18:37:52*BitPuffin joined #nim
18:38:20*BitPuffin quit (Remote host closed the connection)
18:39:19renesac[06:30:16] <BlaXpirit> how to do method dynamic dispatch at compile time? <-- the compile time alternative is using concepts and composition, I think
18:39:23*BitPuffin joined #nim
18:39:39BlaXpiritthat is not an alternative
18:40:01BlaXpiriti don't see how that provides polymorphism
18:41:30AraqI don't see what's wrong with 'case' at compile-time. This is 2015, nobody gives a shit about "OO design" anymore.
18:41:44renesachttps://en.wikipedia.org/wiki/Polymorphism_%28computer_science%29 <-- it is the second type of polimorphism there
18:41:45EXetoCoh really? :p
18:41:48BlaXpiritproblem is rewriting everything -____-
18:42:36renesacbut you can mention some specific type requeriments (kinda like a base class) with concepts
18:43:07BlaXpiriti want a seq of objects
18:43:22BlaXpiritthat act differently when a function is called
18:44:14*BitPuffin quit (Remote host closed the connection)
18:44:58*BitPuffin joined #nim
18:44:59EXetoCAraq: except most programmers? or was there really a shift?
18:45:30EXetoCBlaXpirit: what about callbacks?
18:45:36renesacrust don't supports classical OO design and seems to be getting quite a following
18:46:00BlaXpiritphp got quite a following
18:46:02BlaXpiritpls
18:46:04*johnsoft joined #nim
18:46:11renesacjust saying
18:46:12renesacXD
18:46:26AraqEXetoC: "most programmers" never understood OO to begin with.
18:47:25*irrequietus joined #nim
18:50:04renesacquick question: can macros be used to create and import artificial modules on the fly?
18:50:25Araqyes, I think so.
18:50:37Araqvia writeFile which works at compile-time
18:50:37renesacto get that conflict resolution on variable names
18:50:56renesachum
18:52:03flaviuBlaXpirit: struct of function pointers?
18:52:25BlaXpiritsomeone is gonna make a library that uses artificial modules to make namespaces
18:52:36renesacBlaXpirit: you already know for what
18:53:00BlaXpiritflaviu, hmmmm
18:54:03BlaXpiritlet's just hope function pointers work at compile time
18:54:19Araquh oh ...
18:54:27BlaXpirit:|
18:54:32Araqwell they *should* work
18:54:56Araqspent some time thinking about them so that they can work
18:55:03EXetoCAraq: that's a different thing but ok
18:55:22BlaXpiritsuch silly workarounds
18:56:07EXetoCjust play the waiting game then
18:56:13AraqBlaXpirit: feel free to fix the VM so that 'method' and 'ref' works
18:56:54BlaXpirithow can i feel free when i've never seen vm code
18:57:06BlaXpiritrenesac, if you are talking about docopt, i don't see how namespaces can be useful
18:57:32BlaXpiriti mean, if you're gonna use namespaces, just use square brackets instead
18:57:38renesacBlaXpirit: instead of emulating namespaces via prefixes
18:58:02BlaXpiriti have quite a different vision of this stuff
18:58:42*BitPuffin quit (Remote host closed the connection)
18:58:51renesacand being like a module, you can ommit the module name (flags, cmd, arg) if there is no conflict
18:59:02*BitPuffin joined #nim
18:59:06BlaXpirithm that's actually an interesting idea
19:00:00BlaXpiritwhat i'm (hopefully) gonna do first is make it work at compile time
19:00:14BlaXpiritthen maybe nothing else is needed
19:00:22renesacoh, now I understood your problem
19:00:40renesacwith compile time OOP
19:00:58BlaXpiritgonna make the lib ugly as heck
19:01:09BlaXpiritwait till you see how i replaced regexes with rudimentary code
19:01:32renesacdo python uses regex?
19:01:42BlaXpirityes
19:01:50renesac:/
19:02:01renesacyeah... that is gonna be ugly
19:02:23*BlaXpirit_ joined #nim
19:03:09*vendethiel- quit (Ping timeout: 245 seconds)
19:03:10*vendethiel joined #nim
19:03:29renesacwhy regex don't work at compile time?
19:03:34renesacbecause it is an impure module?
19:04:09BlaXpirit_yes
19:04:34*BitPuffin quit (Remote host closed the connection)
19:04:35renesacisn't better to re-write the parts of the regex module you need
19:04:41renesacand keep the code like it is
19:04:52BlaXpirit_i tried that first
19:05:05BlaXpirit_dived nose-first into writing a regex implementation
19:05:11BlaXpirit_forgetting the most important difficulty of it
19:05:17renesaceven an non-optimized one is difficult?
19:05:30BlaXpirit_i forgot about backtracking
19:05:36*renesac never looked into that
19:06:12BlaXpirit_.*abc zxcabc .* consumes everything and abc can't be matched
19:06:31BlaXpirit_that's my fail
19:06:54*gsingh93 joined #nim
19:07:12AraqBlaXpirit_: take a look at my lexim project
19:07:13BlaXpirit_then Arаq said he got some regex implementation
19:07:19Araqyup
19:07:24*BitPuffin joined #nim
19:07:39Araqbut it's built as the base for a lexer generator
19:08:03BlaXpirit_i don't know what to look at :
19:08:18Araqa real regex impl needs years of work since regexes are a horrible clusterfuck
19:09:16BlaXpirit_naaah
19:09:33Araqbut hey, my implementation does handle * and beats PCRE by a factor of 8
19:09:34BlaXpirit_maybe if it involves unicode
19:09:58Araq* vs *? non-capturnig groups, capturing groups, unicode classes
19:10:11Araq. sometimes matches \n, sometimes it doesn't
19:10:24Araq\a and \z and \b
19:10:32Araqzero length matches
19:10:36Araqback references
19:10:56Araqtrust me, full fledged regexes are horrible to support
19:11:53Araqand at the end a lexer generator is far more useful :P
19:12:13*BitPuffin quit (Read error: Connection reset by peer)
19:12:26BlaXpirit_just make it accessible please :|
19:13:20Araqwell I'm building a lexer generator out of it
19:13:36renesacwell, it is indeed a lexer that is needed to parse the docopt DSL
19:13:50Araqyou can use it as a base for a proper regex implementation, but I won't do that
19:14:34renesacbut BlaXpirit code is already written based on regex
19:15:04renesacI don't know if the interface is too different
19:15:32Araqas soon as it's useful some BlaXpirit will come along and say "but this doesn't support XYZ" and some FUD campaign starts and everybody will use the pcre based stuff anyway
19:15:49BlaXpirit_well sure
19:16:01BlaXpirit_there is absolutely no reason to make a regex implementation
19:16:12renesacthe main requeriment is that it should work at compile time
19:16:15renesac:P
19:16:30Araqsee above, I beat PCRE by a facter of 8 without trying hard.
19:16:42Araqbut yes, "no reason"
19:16:45BlaXpirit_you may be forgetting something important
19:17:25renesacfactor of 8 for small things, or asymptotically?
19:17:42Araqfor a benchmark where pcre doesn't cheat :P
19:17:56Araq(but then we can easily cheat too)
19:18:08flaviuAraq: Keep in mind PCRE is interpreted.
19:18:13flaviuDoes it still beat the JIT?
19:18:30Araqflaviu: dunno but my implemention is interpreted too
19:18:41Araqfor this benchmark
19:18:56flaviuah, ok.
19:36:59endragorin which memory do arrays get allocated?
19:38:43endragorI get segementation fault when trying to allocate large array (100mil elements) from a function, but no problem when I do the same from top level scope
19:42:27flaviuendragor: if something like var foo: array[1000000, bar], on the stack
19:42:46flaviuIf you'd like to be sure, use clang and --passC:-fsanitize=address --passL:-fsanitize=address
19:47:51*HakanD_ joined #nim
19:49:22Araqendragor: 100 million elements array sounds like you want to use a 'seq' or maybe a saner data structure
19:51:39endragoryeah, I know I'm doing crazy stuff. Just was surprised it worked from top level
19:55:55*brson joined #nim
19:56:08def-endragor: inside a proc it will be on the stack, global arrays in the data segment
19:56:28endragorI see
20:15:49*endragor quit (Remote host closed the connection)
20:16:27*UberLambda quit (Quit: Leaving)
20:17:01*BlaXpirit_ quit (Quit: Quit Konversation)
20:35:12BlaXpiritlol
20:35:46BlaXpiritrefs accomplish so much more than dynamic dispatch
20:36:01BlaXpiritthis is futile
20:37:48VarriountBlaXpirit: Howso?
20:38:19BlaXpiritdo u know what i'm talking about
20:38:44VarriountWell, I know what a reference is, and I know what dynamic dispatch is.
20:39:16BlaXpiritok so I thought all I needed is dynamic dispatch at compile time
20:39:36BlaXpiritso i replaced it with lame conditionals
20:39:38BlaXpiritbut apparently I also need a seq of refs
20:40:28dom96BlaXpirit: what are you writing?
20:40:51BlaXpiritdid another push to make docopt work at compile time
20:44:09*Kingsquee joined #nim
20:49:17AraqBlaXpirit: well sometimes 'ref' works :P
20:50:15*BitPuffin joined #nim
20:51:42VarriountAraq: Anything besides --app:gui ?
21:07:17AraqVarriount: well ... let me go through the list of PRs
21:07:48*repax joined #nim
21:15:28*NimBot joined #nim
21:22:36*irrequietus quit ()
21:27:02*Strikecarl joined #nim
21:28:12StrikecarlAraq you here?
21:28:16*repax quit (Quit: repax)
21:28:35Araqyes
21:28:42Strikecarluhm
21:28:45Strikecarlhash()
21:28:49Strikecarlcan i dehash the THash?
21:30:14Strikecarlor is it final?
21:30:15reactormonkStrikecarl, nope, impossible by definition
21:30:23StrikecarlDamnit.
21:30:34reactormonka hash is a one-way operation. hashtabels 101 :-)
21:30:40*flaviu quit (Remote host closed the connection)
21:30:53reactormonkBut I think we have an XY problem. What are you trying to do?
21:31:06StrikecarlIdk, was just wondering.
21:31:14StrikecarlMessing around with the hash()
21:31:41BlaXpirit-_-
21:31:51*flaviu joined #nim
21:32:18reactormonkStrikecarl, https://en.wikipedia.org/wiki/Hash_table
21:32:39reactormonkjust read the first half and you'll see why
21:34:12StrikecarlDoes NIM support MD5?
21:36:12def-Strikecarl: you can search for libraries here: http://nim-lang.org/lib.html
21:36:37flaviuStrikecarl: That isn't really a useful question. It's a general purpose language, so MD5 can be implemented in Nim.
21:37:01flaviuBut there is an MD5 implementation in the stdlib: http://nim-lang.org/md5.html
21:38:05StrikecarlFound it.
21:41:04*HakanD_ quit (Ping timeout: 255 seconds)
21:47:35*irrequietus joined #nim
21:47:39*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
21:52:01*gsingh93 quit (Ping timeout: 264 seconds)
21:59:40reactormonkwhere's the definition which flags are used by the compiler by default?
21:59:48reactormonkstuff like stacktrace:on
22:00:22VarriountCompiler user guide?
22:00:44reactormonkVarriount, that's the documentation. I'm looking for the code definition
22:00:53reactormonkI wanna add another one
22:02:18def-reactormonk: nim.cfg i guess
22:02:21Varriountreactormonk: options.nim and nim.nim
22:02:33reactormonkdef-, nope, only overrides in there
22:02:35def-(nope, varriound is right
22:02:35def-)
22:02:44reactormonkVarriount, I'm currently at commands.nim, I'll go take a look
22:07:03*Matthias247 quit (Read error: Connection reset by peer)
22:10:04*Jehan_ joined #nim
22:10:33*wink-s joined #nim
22:11:24*wink-s quit (Client Quit)
22:17:57*BlaXpirit quit (Quit: Quit Konversation)
22:30:17*gsingh93 joined #nim
22:34:36*xet7 quit (Ping timeout: 272 seconds)
22:58:58*coopernurse quit (Remote host closed the connection)
23:01:37*coopernurse joined #nim
23:07:25*jefus_ joined #nim
23:11:03*Demon_Fox joined #nim
23:11:39*jefus quit (Ping timeout: 265 seconds)
23:28:11Jehan_Is it me or is the csources master out of sync with the Nim master branch?
23:29:47def-Jehan_: maybe the problem is that devel is the default branch of csources?
23:30:03Jehan_def-: I used -b master
23:30:16def-ok, I'm trying currently
23:31:13Jehan_I'm usually working off devel (not necessarily bleeding edge devel, but some point on devel), so I didn't notice it until now.
23:31:33def-apparently no one noticed. I don't see any changes in the master branches for quite some time
23:32:32*irrequietus quit ()
23:33:12def-master branch bootstraps fine for me from master csources
23:35:26*johnsoft quit (Ping timeout: 244 seconds)
23:36:14*johnsoft joined #nim
23:39:50*Demon_Fox quit (Ping timeout: 256 seconds)
23:43:25*Demon_Fox joined #nim
23:43:30Jehan_Hmm. Let me check what I did wrong.
23:44:03flaviuJehan_: Try gcc if you've been using clang.
23:46:06Jehan_Ugh, I think I see. devel is the default branch for Nim, too, not just csources.
23:46:44Jehan_So I was building the devel branch with the csources from master without realizing it.
23:50:03VarriountI really wish we had a better way of warning people about that.
23:50:22Jehan_I hadn't realized that master already didn't typecheck `expr` arguments of templates/macros. Interesting.
23:51:06Jehan_Unless it does and I'm just not thinking straight on account of the time of night. :)
23:51:27Araqthat change is quite old, yes
23:52:53Jehan_I'm writing a response to winksaville w.r.t. immediate and wanted to make sure that I get it right.
23:53:12Jehan_So, essentially, a template/macro with all `expr` arguments is already equivalent to {.immediate.}?