<< 14-04-2015 >>

00:07:04*BlaXpirit quit (Quit: Quit Konversation)
00:08:11*Jehan_ quit (Quit: Leaving)
00:09:11*user7181 quit (Quit: leaving)
00:22:59reactormonktransfuturist, IRC logs :-)
00:27:36transfuturist;_;
00:28:55transfuturistoh, i can see my crying face
00:29:16transfuturistis there a way to search them?
00:29:49reactormonkapparently not. time for some wget?
00:30:12reactormonkbut for compiler stuff, you can just poke araq when he's around
00:30:31reactormonkI've done some stuff with the compiler too, but not too much
00:33:45*mwbrown joined #nim
00:34:08*Demon_Fox joined #nim
00:35:20transfuturistreactormonk: what do you know about dynlib handling?
00:36:00flaviutransfuturist: I use "site:irclogs.nim-lang.org <my query here>" in google.
00:36:24transfuturistoh yeah, thanks
00:37:08reactormonktransfuturist, dynlib as in runtime shared lib handling?
00:38:05transfuturistmhm
00:38:54transfuturistapparently dynamic libraries are loaded at the beginning of runtime, i want to put a greater degree of control in dynlib.nim
00:40:00transfuturisti think dynlib.nim might have been created entirely for opengl's benefit, stuff like loading libraries and looking up symbols has no actual use outside of opengl's complicated import system
00:40:18reactormonkwhat do you want to change?
00:41:27transfuturistmake it so you can load and unload libraries and have the "api" functions declared with the dynlib pragma update when you do so
00:41:34transfuturistfor hot swapping
00:45:45*gokr left #nim (#nim)
00:45:57transfuturisti'm fairly unsure of my ability to understand the compiler source and make the changes i need, but i don't see any progress along these lines since it's been brought up on the forums
00:46:38reactormonktransfuturist, I'd start by finding the dynlib stuff in the cgen and see if it's anywhere else
00:47:12transfuturisti already have, i'm just not sure what it means
00:47:29reactormonkmostly in pragmas.nim
00:47:43transfuturistand cgen.nim
00:47:47transfuturistbut there's some weird stuff
00:48:36transfuturistpragmas.nim adds libraries to a linked list in PContext, but it's mentioned nowhere else. is that just dead code?
00:51:05transfuturistoh, it's just used to remove duplicates from the list that's never used otherwise.
00:51:07transfuturist??????
00:53:30reactormonktransfuturist, remember that nim is partially style-insensitive
00:53:50transfuturisthow else can it be accessed?
00:54:02reactormonkjust saying you should probably grep -i
00:56:59transfuturistprobably a red herring
00:57:30reactormonknot really, I would assume cgen uses that list to generate the import statements
00:57:58transfuturisteven case-insensitive, it's nowhere else
00:58:03reactormonkhm
00:58:07reactormonk useHeader(p.module, s)
00:58:34reactormonkthat's where the headers are.
00:59:13transfuturistwhat is BModule?
00:59:47reactormonkbtw, what editor are you using? you could try to get nimsuggest to help
00:59:57transfuturistsublimetext
01:00:40reactormonk BModule* = ref TCGen
01:01:36*wink-s joined #nim
01:02:35reactormonkapparently it's all the data in a single C file
01:03:41transfuturist cfsDynLibInit, # section for init of dynamic library binding
01:04:21transfuturistokay, loadDynamicLib is starting to make sense
01:05:43transfuturistit generates and adds the necessary C for the initialization of a given dynamic library
01:05:50transfuturistso that whole thing would have to change
01:11:34*dhasenan_ quit (Ping timeout: 272 seconds)
01:21:55*gsingh93 quit (Quit: WeeChat 1.1.1)
01:29:59*dhasenan quit (Remote host closed the connection)
01:32:50*xtsee joined #nim
01:32:54*xtsee left #nim (#nim)
01:36:06*dhasenan joined #nim
01:44:44*vendethiel joined #nim
01:58:15onionhammerVarriount ahh interesting. I'll take a look
02:09:07*brson quit (Quit: leaving)
02:09:21transfuturistare typedefs like LibHandle tracked in the VM?
02:10:02transfuturistcan a function in pragmas.nim check to see if a type of kind pointer is different from other pointer kinds?
02:15:04*jholland quit (Quit: Connection closed for inactivity)
02:16:47transfuturistyes; type.sym.name.s contains the identifier string
02:17:26*vendethiel quit (Ping timeout: 272 seconds)
02:17:38*mwbrown quit (Ping timeout: 252 seconds)
02:21:00*jefus quit (Ping timeout: 276 seconds)
02:21:01*darkf joined #nim
02:21:01*darkf quit (Changing host)
02:21:01*darkf joined #nim
02:21:21*pigmej quit (Ping timeout: 244 seconds)
02:29:06*pigmej joined #nim
02:31:19*Pisuke quit (Read error: Connection reset by peer)
02:31:48*Sembei joined #nim
02:32:23*fungos quit (Remote host closed the connection)
02:33:31onionhammerVarriount I think I might start a rewrite of the syntax def at some point for this.. not sure how we can support ST2 though
02:35:58onionhammerVarriount https://github.com/Varriount/NimLime/issues/22
02:38:09*EXetoC quit (Ping timeout: 256 seconds)
02:48:14*heinrich5991 quit (Ping timeout: 419 seconds)
02:48:33*Demon_Fox quit (Excess Flood)
02:48:59*heinrich5991_ joined #nim
02:49:11*Demon_Fox joined #nim
02:50:54*heinrich5991_ is now known as heinrich5991
02:53:16*brson joined #nim
03:01:45*fowl joined #nim
03:02:32*elbow_jason joined #nim
03:05:36*mwbrown joined #nim
03:05:41*dom96_ joined #nim
03:06:50*buMPnet quit (*.net *.split)
03:06:51*zahary quit (*.net *.split)
03:06:51*untitaker quit (*.net *.split)
03:06:51*ob_ quit (*.net *.split)
03:06:51*EastByte quit (*.net *.split)
03:06:51*mnemonikk quit (*.net *.split)
03:06:51*reactormonk quit (*.net *.split)
03:06:51*Joe-T quit (*.net *.split)
03:06:51*Guest67437 quit (*.net *.split)
03:06:51*dom96 quit (*.net *.split)
03:13:08*buMPnet joined #nim
03:13:08*zahary joined #nim
03:13:08*untitaker joined #nim
03:13:08*ob_ joined #nim
03:13:08*EastByte joined #nim
03:13:08*mnemonikk joined #nim
03:13:08*reactormonk joined #nim
03:13:08*Joe-T joined #nim
03:13:08*Guest67437 joined #nim
03:13:33*untitaker quit (Max SendQ exceeded)
03:13:33*buMPnet quit (Max SendQ exceeded)
03:13:40*untitaker_ joined #nim
03:14:44*buMPnet joined #nim
03:15:24*elbow_jason quit (Remote host closed the connection)
03:16:08*elbow_jason joined #nim
03:18:42*BitPuffin quit (Ping timeout: 244 seconds)
03:19:05*elbow_jason quit (Remote host closed the connection)
03:19:50*elbow_jason joined #nim
03:34:41*ChrisMAN quit (Ping timeout: 265 seconds)
03:45:32reactormonkAraq, you mind s-expressions in the stdlib? would make emacs integration a few magnitudes easier
03:45:38reactormonk... for nimsuggest
03:48:02Varriountonionhammer: Hm. If only there were some way to backport that particular change.
03:49:21Varriountonionhammer: I wouldn't semi-deprecation of the current language files, putting improvements of those as a low priority
03:50:01onionhammerwhat do you mean by the 2nd line?
03:56:31*dtscode is now known as charmander
03:56:35*charmander is now known as dtscode
03:59:06*dtscode is now known as squirtle
03:59:42Varriountonionhammer: I mean, focus on updating the newer syntax files.
04:00:26VarriountWith contexts, we should be able to highlight more specific areas of code.
04:08:36*dhasenan_ joined #nim
04:09:57transfuturistreactormonk: how does this look? http://pastebin.com/dFzZaqqN
04:11:01reactormonktransfuturist, I think you're too much into objects via self: dlHandle. Also, types should begin with an upercase letter.
04:11:45reactormonklemme upll up dynlib
04:13:04transfuturistit needs to be an object so it can track the symbol loading function.
04:13:59reactormonkI'd rename it to "handle" not "self", but that's just me, you can keep it self.
04:14:18reactormonkBut the dlHandle -> DlHandle is less optional
04:14:24transfuturistthe implementation can just be a consensus thing
04:14:31transfuturistbut sure, i changed the case
04:15:35reactormonkso you wait the procs to run at compiletime, correct?
04:15:46transfuturisteh?
04:15:55reactormonkoh, ups. misread.
04:17:55reactormonktransfuturist, you don't need to unload stuff like self.handle = nil, the GC takes care of that
04:18:12reactormonkehh, that one's probably correct. But no need for self.path = nil
04:18:59Varriounttransfuturist: Also, be aware that objects are not references, they copy when assigned
04:19:12reactormonkVarriount, yeah, he went for references
04:19:14transfuturistshit
04:19:37reactormonktransfuturist, should work as is.
04:19:44transfuturistoh, a ref of an object is ok
04:19:58reactormonkyeah, gotta be explicit about reference semantics
04:20:33VarriountAlthough, it's worth pointing out that even objects are usually passed via pointer when calling a procedure.
04:22:00reactormonktransfuturist, the concept works, but the API should not need the loadDL part. pragmas can also be macros.
04:22:57transfuturistthe loadDL isn't meant to be run as part of the pragma, it's so you can unload and reload as you wish
04:22:58reactormonktransfuturist, but if you only care about the segfault, just patch loadLib to throw instead of returning nil
04:23:28transfuturistthis is for hot swapping shared libraries
04:23:58reactormonkHm. what advantages do you gain over unloadLib directly?
04:24:17reactormonkoh right, you don't have the handle.
04:24:28transfuturistthe dynlib package as is is unable to hot swap
04:24:59reactormonkcould you do it with the LibHandle?
04:25:12transfuturistno, it's been brought up on the forums
04:25:27reactormonklink plz?
04:25:31transfuturistyou can't cast a pointer you get from symAddr to a proc
04:25:49*endragor joined #nim
04:26:07*endragor quit (Remote host closed the connection)
04:26:27transfuturisthang on, it's in one of these...
04:26:27reactormonkok, then I see why like this, fine with me.
04:27:03reactormonkactually, I wouldn't store the path in the DlHandleObj at all.
04:27:07transfuturisthttp://forum.nim-lang.org/t/627
04:27:58*endragor joined #nim
04:28:32reactormonklemme check that code
04:29:10Varriounttransfuturist: Do you usually work with Python?
04:29:25transfuturistnuh
04:29:50transfuturisti thought i saw the self syntax somewhere related to nim
04:31:34VarriountHello endragor
04:31:48transfuturistreactormonk: http://pastebin.com/rTpAHCfK
04:33:09reactormonktransfuturist, https://gist.github.com/4dbb00c63c019f11c0ce compiles
04:34:11transfuturistyou must be a wizard.
04:34:12reactormonkeven works with nimcall
04:34:33reactormonktransfuturist, nope, I just read the forum post and I know what he means by calling convention
04:35:04*mwbrown quit (Ping timeout: 255 seconds)
04:35:23transfuturistthank god
04:35:34transfuturisti don't have to do this compiler hacking bullshit anymore ;_;
04:36:24transfuturistjust need to see if the cdecl pragma will work outside of the typedef
04:37:01reactormonkI'd go for nimcall instead
04:37:15reactormonkit's more standard and gives the compiler more freedom to optimize stuff
04:37:26transfuturistoh?
04:37:34transfuturisti wasn't aware of an actual call function
04:37:50reactormonkhm? It's just the calling convention of the actual proc
04:38:00reactormonkhttp://nim-lang.org/manual.html#procedural-type
04:38:30reactormonkI think we had an XY problem here :-)
04:38:30transfuturistnow i'm not sure what you mean anymore
04:38:51reactormonkyou were asking for X to do Y without actually stating Y ^^
04:38:56transfuturistso wait, no pragma should be necessary?
04:39:06reactormonknope, you need one. the documentation is incorrect.
04:39:10transfuturistokay
04:39:16transfuturistthat would explain why it wasn't working
04:39:23reactormonklemme change that
04:39:40reactormonkdocumentation incorrect is evil.
04:43:00reactormonktransfuturist, wait. The documentation is correct.
04:43:07transfuturist>>
04:43:17reactormonkjust had to read it again :-)
04:43:37reactormonkif you have a proc like proc foo(x: int): int = x + 3 then the calling convention is nimcall
04:43:57reactormonkif you have type Foo = proc(x: int): int, then the calling convention is closure
04:44:12reactormonk... see why it makes sense?
04:44:35transfuturist...no
04:44:41transfuturiststill trying to get your example to work
04:45:27reactormonkif you have a proc foo() ... you don't need the closure. But with Foo = proc() you most likely have a callback where you expect to be able to use closure callbacks
04:46:07transfuturistjumpin' jehoshaphat
04:46:36transfuturistdon't need the typedef either
04:46:39transfuturistthanks!
04:46:48transfuturistXY problem indeed...
04:47:17reactormonkI think I'll add the examples to either
04:47:59reactormonkactually, not needed. The procedural types are explained above.
04:48:39*pregressive quit (Remote host closed the connection)
04:53:38transfuturistis there a way to create a statement macro that takes a string to begin with, like 'custom_def "foo":'?
04:55:41reactormonktransfuturist, take desired API, write inside dumpTree
04:56:00reactormonk(don't forget import macros)
04:57:29reactormonklooks like yes.
04:57:30transfuturistd'oh
04:58:37transfuturistnot sure how that could translate into macro language, though
04:59:09reactormonkaccording to the tree first argument is "foo", the second is the stmtlist
04:59:54transfuturistis this because of the unified calling syntax thing?
05:08:42reactormonknot really
05:09:00transfuturistregardless
05:09:06transfuturistnim's macros are awesome
05:14:21reactormonkyup
05:27:20*transfuturist left #nim ("snoozing...")
05:36:18*endragor quit ()
05:36:24*endragor_ joined #nim
05:37:11*brson quit (Quit: leaving)
05:51:43*HakanD_ joined #nim
05:56:04*HakanD_ quit (Ping timeout: 245 seconds)
05:56:08reactormonkgotta say continuations would make the json parser API way more resilient
06:23:51*jefus joined #nim
06:23:53reactormonkAraq, you can pretty much see whenever I work on nim seriously based on my issues/h rate.
06:39:25*EXetoC joined #nim
06:44:20*HakanD_ joined #nim
06:44:57*HakanD__ joined #nim
06:48:45*HakanD_ quit (Ping timeout: 250 seconds)
06:56:34*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
06:59:14reactormonkpigmej, https://github.com/reactormonk/nim/tree/epc
07:00:56pigmejreactormonk: hey :)
07:01:12pigmejoh sexps :)
07:01:32reactormonkyup, should work as expected. doesn't parse (foo . bar) though
07:02:13reactormonkbut I haven't found that prin1 produces them
07:03:02*endragor joined #nim
07:03:21reactormonkhm, fuck it does if you give it alists.
07:03:55pigmejanyway, why it needs to be in stdlib ?
07:03:59pigmejthe sexp
07:04:05reactormonkbecause you need it in nimsuggest
07:04:36pigmejyaeh, but we could distribute separate tool
07:04:49reactormonkbut then you need to piggy-back on nimsuggest somehow
07:04:49pigmejthat is compiled on el package installation
07:04:51reactormonkthat's ugly
07:05:13pigmejyeah, I asked Araq yesterday what he thinks about making nimsuggest a library
07:05:38pigmejthen 'problem' would be solved probably ?
07:05:38reactormonkfor now it's in the stdlib. as soon as nimsuggest goes into a lib, I'll happily rip sexp out.
07:06:01pigmejyou know, those are just my thoughts ;-)
07:06:43*endragor_ quit (Ping timeout: 255 seconds)
07:08:24reactormonkepc allows for alists :-/
07:08:31reactormonkso I gotta implement them
07:12:21pigmejbtw reactormonk it seems that you had a nice coding ;]
07:12:43reactormonkpigmej, create something with it
07:13:40reactormonkbtw, no stateful parser anymore.
07:14:36reactormonkthe payload length is given.
07:14:49*BlaXpirit joined #nim
07:16:57*endragor quit (Remote host closed the connection)
07:17:21ggVGcwhat's the easiest way for me to have the nim documentation offline?
07:17:32pigmejggVGc: clone repo
07:17:41pigmejand run koch to make docs :)
07:18:27reactormonkaka ./koch web
07:18:50reactormonkcan I do stuff like result = newResult(result)?
07:19:37ggVGccool, thanks
07:23:50reactormonkhow do I combine two hashes?
07:24:02pigmejwhat hashes?
07:24:08reactormonkTHash
07:24:58reactormonk!& probably
07:25:04pigmejhmm
07:25:20pigmejisn't it more like hash of hashes?
07:25:29pigmejbut probably it depends what do you wanted ;)
07:25:43pigmejlike hash(a) + hash(b) or hash(hash(a)) or sth
07:27:34squirtlewhy isnt THash Hash yet?
07:36:03*xcombelle joined #nim
07:38:01reactormonksquirtle, well, do it
07:38:35squirtlemake THash hash?
07:39:19reactormonkyup
07:39:29reactormonkdon't forget the deprecated part
07:39:32squirtleo.O become a compiler developer?
07:39:45squirtlei would change nimistry as we know it
07:42:29*bjz joined #nim
07:42:39reactormonkI always like to watch history unfold ;-)
07:42:48squirtlefoldl.com
07:42:51squirtlefoldr.com
07:43:00squirtle:c it seems like a lot of work
07:43:04reactormonk^^
07:43:14squirtlebut i was just going to write perl code anyways
07:43:54reactormonkit's basically sed -i "s/THash/Hash" **/*.nim, {.deprecated: [THash: Hash]} and watch the world burn
07:44:14reactormonkehh sed expression should be "s/THash/Hash/g"
07:44:21squirtleof course
07:44:35squirtleis -i interactive?
07:44:52xcombelle-i is inplace for sed I believe
07:45:36squirtleyep
07:45:42squirtleremind me what inplace is again?
07:45:55reactormonkedit the files in place
07:46:50squirtle<reactormonk> it's basically sed -i "s/THash/Hash" **/*.nim, {.deprecated: [THash: Hash]} and watch the world burn
07:47:18squirtleis that the actual syntax?
07:47:18*HakanD__ quit (Read error: Connection reset by peer)
07:47:33squirtlesed -i "s/THash/Hash" **/*.nim, {.deprecated: [THash: Hash]}
07:48:14reactormonknope
07:48:28reactormonksed -i "s/THash/Hash/g" **/*.nim
07:48:38reactormonkand then place the deprecated stuff somewhere in hashes.ni
07:48:47squirtleoh duh
07:48:56squirtlecan i blame that on the fact that its late?
07:49:23*pregressive joined #nim
07:49:31reactormonkpigmej, now with cons.
07:49:41xcombelleit's very approximate (for example it would replace THash even in "this is theTHash"
07:50:00reactormonkyup
07:50:06reactormonkbut it usually works.
07:50:19reactormonkjust run ./koch tests afterwards :-)
07:50:52squirtlewtf? it didnt replace it at all
07:50:56squirtleoh wait
07:50:57squirtlenmd
07:51:06BlaXpiritpeople
07:51:12xcombellehi BlaXpirit
07:51:13BlaXpirituse \bTHash\b
07:52:36squirtlefor whatever reason the sed command doesnt work
07:53:46*Ven joined #nim
07:54:14*pregressive quit (Ping timeout: 265 seconds)
07:54:20xcombellewhat you call doesnt work squirtle ?
07:54:32squirtleit did shit
07:54:42squirtlei might just go through and change it all manually :D
07:55:29*bjz quit (Ping timeout: 250 seconds)
08:05:29*gokr joined #nim
08:05:50*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:07:05*coffeepot joined #nim
08:09:19*endragor joined #nim
08:12:15reactormonksquirtle, hm. I think the **/*.nim part needs to be enabled for bash
08:12:24reactormonknope
08:12:31reactormonkwhat does ls **/*.nim give?
08:13:17squirtlebunch of compiler/*.nim files
08:13:43squirtleit does nothing to lib/pure though
08:14:12reactormonk:-(
08:14:16reactormonkyeah, with zsh it's recursive
08:14:39squirtlewhat os?
08:14:46reactormonkan arch
08:14:54reactormonktry
08:15:02reactormonkshopt -s globstart
08:15:28reactormonkehh globstar
08:15:44squirtleok
08:16:20squirtlei can just type zsh and do it from there
08:17:21pigmejsquirtle: use xargs
08:17:25pigmejwith find
08:17:40squirtlemy bash fu is weak :p
08:18:02pigmejwritting from memory
08:18:24pigmejsomething like: find -name *.nim | xargs sed -i 's/orig/replacement/g'
08:18:25BlaXpirit"find" command is the way to go. easy to google.
08:18:27BlaXpiritye
08:18:43BlaXpiriti like find -exec
08:18:45pigmejor install zsh and sed -i 'pattern' **/*.nim
08:19:15reactormonk^^
08:20:05*Trustable joined #nim
08:21:07squirtleawesome that worked
08:21:17reactormonkneat
08:22:04squirtlenow i just need to add type THash* = int {.deprecated: [THash: Hash]} right?
08:24:57BlaXpiritsquirtle, that deprecated thing goes on a separate line
08:25:28BlaXpirityou do Hash* = int
08:26:07squirtleoh right
08:26:15squirtleits been too long since ive written nim :/
08:29:17*milosn quit (Ping timeout: 250 seconds)
08:31:24*endragor_ joined #nim
08:31:45squirtleim going to see if a release version compiles
08:32:21*endragor_ quit (Remote host closed the connection)
08:33:00squirtleit occurs to me too late that i could have skipped some bootstrapping steps :/
08:34:03*bjz joined #nim
08:35:39*Ven joined #nim
08:36:37*endragor quit (Ping timeout: 252 seconds)
08:37:47*endragor joined #nim
08:39:55*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
08:41:49squirtlehow come this line doesnt compile anymore? https://github.com/Araq/Nim/blob/devel/lib/pure/osproc.nim#L647
08:43:02BlaXpiritsquirtle, what u doing
08:43:26squirtleBlaXpirit, trying to see if the compiler builds
08:43:32BlaXpiritu have old csources probably
08:43:41squirtlei just got them
08:44:30squirtlelib/pure/osproc.nim(647, 4) Error: undeclared identifier: 'defer'
08:44:47squirtleand if i put var before it: lib/pure/osproc.nim(647, 34) Error: expression 'deallocCStringArray(sysArgs)' has no type (or is ambiguous)
08:44:57BlaXpiritu didnt recompile compile csources dude
08:45:07squirtlelolwut?
08:45:40BlaXpiritcsources: git pull; ./build.sh
08:46:00squirtlei did that -_-
08:46:10squirtlei literally just built the csources
08:46:20BlaXpiritnim: git pull; ./bin/nim c koch; ./koch boot -d:release
08:46:31squirtleyes
08:46:35squirtlethats not the issue
08:47:26*endragor quit (Remote host closed the connection)
08:47:40*Arrrr joined #nim
08:49:46ArrrrHello Nimrod.
08:50:00*endragor joined #nim
08:50:10BlaXpiritno u
08:53:33*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:53:50*endragor_ joined #nim
08:53:54*endragor quit (Read error: Connection reset by peer)
08:58:38squirtlefuck this -_- ill figure it out in the morning
09:00:31ArrrrWhat's the problem pokemon?
09:00:40*endragor_ quit (Remote host closed the connection)
09:00:46squirtlei broke the nim compiler
09:00:55*endragor joined #nim
09:01:35Arrrrthen capture it https://github.com/Araq/Nim/issues
09:01:54squirtlethats what i meant by fix it in the morning
09:02:01squirtleor try and solve it myself
09:02:23ArrrrThanks
09:03:26squirtlei dont even know why this was allowed to make it into devel ;-;
09:04:38squirtlewait i dont even think i did this in devel. fuck my life. why did i think it would be a good idea to mess with the nim compiler at 2 in the morning?
09:04:59BlaXpiritwhat the heck are u doing. everything works just fine.
09:05:20Arrrrhttp://www.mypokecard.com/en/Gallery/my/galery/zKo6l6dbyx8L.jpg
09:05:24squirtleim fixing issues in the compiler BlaXpirit -_-
09:05:40squirtlethats what the sed thing was all about
09:10:31coffeepot2am is the best time for coding! If only my day job agreed ;)
09:10:54*squirtle is now known as dtscode
09:16:12*Ven joined #nim
09:17:58*Tennis joined #nim
09:17:58*Tennis quit (Changing host)
09:17:58*Tennis joined #nim
09:24:26*endragor quit (Remote host closed the connection)
09:25:15*endragor joined #nim
09:30:25coffeepotis there any difference between a let and a var when setting a value inside a loop?
09:30:56coffeepotfor i in countup(0, 10): let test = somevalue <do something with test>
09:31:06xcombellecoffeepot, the main difference is that the let don't let you change the value later
09:31:10coffeepotdoes test only get set once or is it equivilent to var here
09:31:28coffeepotso it's more of a syntactic thing?
09:31:34xcombellecoffeepot, you should use let as often you can
09:31:43coffeepotor is there any optimisations the compiler makes?
09:31:52coffeepoti use let whenever i can :)
09:32:08pigmejcoffeepot: you still can't change variable with let in for loop
09:32:10coffeepotjust wondering about how it works when it's inside a loop
09:33:14*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
09:33:55coffeepotactually I'm also curious if using 'let' allows the compiler to make some assumptions with respect to async (not that I've used async yet)
09:34:51xcombellecoffeepot I think the main point of let is to not let you shoot yourself in your foot
09:35:31coffeepothaha well, that's fair enough :)
09:35:41*milosn joined #nim
09:40:02*OnO joined #nim
09:42:11*endragor quit (Remote host closed the connection)
09:47:16*OnO quit (Quit: Textual IRC Client: www.textualapp.com)
09:48:01*vendethiel joined #nim
09:52:42*bjz joined #nim
09:54:11*ggVGc_ joined #nim
09:54:21*qfire_ joined #nim
09:56:49*endragor joined #nim
09:57:13*TEttinger quit (Ping timeout: 264 seconds)
10:00:16*endragor quit (Remote host closed the connection)
10:00:33*milosn quit (Read error: Connection reset by peer)
10:01:10*endragor joined #nim
10:01:23*milosn joined #nim
10:02:41*onionhammer quit (*.net *.split)
10:02:43*ggVGc quit (*.net *.split)
10:02:43*vinnie quit (*.net *.split)
10:02:43*skroll1 quit (*.net *.split)
10:02:43*qfire quit (*.net *.split)
10:02:43*vince joined #nim
10:04:46*Ven joined #nim
10:05:11*HakanD_ joined #nim
10:05:29*Kingsquee quit (Quit: Konversation terminated!)
10:07:03*endragor quit (Remote host closed the connection)
10:09:47*endragor joined #nim
10:09:47*endragor quit (Read error: Connection reset by peer)
10:10:16*endragor joined #nim
10:12:13*vendethiel quit (Ping timeout: 264 seconds)
10:15:15*OnO joined #nim
10:15:27*BitPuffin joined #nim
10:17:17*milosn quit (Read error: Connection reset by peer)
10:17:48*milosn joined #nim
10:25:14*milosn quit (Ping timeout: 245 seconds)
10:38:21*milosn joined #nim
10:40:27ArrrrBlaXpirit: have you done something with nim-csfml in mobiles?
10:40:31Arrrr*anything
10:40:40BlaXpiritArrrr, CSFML does not support mobile
10:40:52BlaXpiritSFML does not have stable official support for mobile
10:48:17*HakanD__ joined #nim
10:48:17*HakanD_ quit (Read error: Connection reset by peer)
10:56:42*HakanD___ joined #nim
11:00:16*HakanD__ quit (Ping timeout: 255 seconds)
11:03:25*fowlmouth joined #nim
11:03:38*fowlmouth quit (Changing host)
11:03:38*fowlmouth joined #nim
11:06:24*lyro quit (Quit: WeeChat 1.1.1)
11:06:33*lyro joined #nim
11:07:32*fowl quit (Ping timeout: 272 seconds)
11:08:35*untitaker_ quit (Ping timeout: 246 seconds)
11:11:03*vendethiel joined #nim
11:12:03*milosn quit (Read error: Connection reset by peer)
11:14:11*untitaker joined #nim
11:20:50*milosn joined #nim
11:29:53federico3ZeroMQ developers encourage people to use the library to do message passing between processes/threads even on the same host instead of using language-specific mechanisms. Any thoughts about this in Nim?
11:31:21pigmejfederico3: the universal answer for those statements is: "It depends" or "Don't believe in words, test and check"
11:31:26*HakanD___ quit (Quit: Be back later ...)
11:32:04pigmejthe thing is ... zmq is quite messy and it spawns background thread to do all IO ops (or was spawning), also it hides some disconnects etc.
11:32:17pigmejalso... for the same host and inproc communication... cmon, it's slow
11:32:38pigmejfrom my tests posix ipc was a lot of faster than zmq.
11:32:53federico3were you using a network socket?
11:33:38pigmejinproc
11:33:52pigmejgenerally it all depends what do you need
11:34:04pigmejand I think Nim or other lang doesn't matter there at all.
11:35:48federico3well, a language might be opinionated about this by putting efforts on implementing its own messaging as a core feature VS recommending users to rely on a library...
11:36:02*vendethiel quit (Ping timeout: 272 seconds)
11:36:08*HakanD___ joined #nim
11:36:22pigmejfederico3: If my opionon counts, then check yourself
11:36:38pigmejbut my opinion about ZMQ is... avoid as long as you can :)
11:36:57pigmejnano is way better way cleaner, way less hacks
11:37:06pigmejand wayyyyyyyy less politics
11:37:34federico3yep, I'm keeping an eye on nanomsg but it seems to be going on slowly
11:37:56federico3indeed it seems much cleaner
11:38:37pigmejwell, depends what do you need :)
11:49:56*milosn quit (Ping timeout: 256 seconds)
11:50:21Araqfederico3: fwiw I don't really like message passing but it's inevitable with thread local heaps
11:54:39*vendethiel joined #nim
11:57:49*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
11:58:12*BitPuffin is now known as BitPuffin|osx
12:03:30*Ven joined #nim
12:15:44*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
12:17:13*vendethiel quit (Ping timeout: 255 seconds)
12:21:56*milosn joined #nim
12:22:48*vendethiel joined #nim
12:34:00*milosn quit (Read error: Connection reset by peer)
12:34:18*milosn joined #nim
12:37:44*milosn quit (Read error: Connection reset by peer)
12:44:24*milosn joined #nim
12:53:08*mpthrapp joined #nim
12:54:55*EXetoC quit (Ping timeout: 250 seconds)
12:55:25*HakanD___ quit (Quit: Be back later ...)
12:57:45*HakanD___ joined #nim
13:06:13*vendethiel quit (Ping timeout: 264 seconds)
13:07:18*xcombelle quit (Remote host closed the connection)
13:07:36*banister quit (Ping timeout: 240 seconds)
13:08:13*BitPuffin|osx quit (Ping timeout: 264 seconds)
13:09:29*milosn quit (Read error: Connection reset by peer)
13:14:01*milosn joined #nim
13:16:09*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:20:42*vendethiel joined #nim
13:25:00*milosn quit (Read error: Connection reset by peer)
13:25:18*Ven joined #nim
13:25:28*milosn joined #nim
13:37:53*EXetoC joined #nim
13:38:01*milosn quit (Ping timeout: 264 seconds)
13:39:55*Ven quit (Read error: Connection reset by peer)
13:41:58*Ven joined #nim
13:42:11*bjz joined #nim
13:44:49*vendethiel quit (Ping timeout: 264 seconds)
13:46:10*vendethiel joined #nim
13:49:05*Jehan_ joined #nim
13:50:45ArrrrBlaXpirit: you there?
13:50:48*milosn joined #nim
13:51:35BlaXpiritArrrr, no
13:52:19ArrrrOk ... in fact i need EXetoC who wrote the wrapper for glfw
13:53:21*milosn quit (Read error: Connection reset by peer)
13:55:48*milosn joined #nim
13:56:37*Ven quit (Read error: Connection reset by peer)
13:58:50*jholland joined #nim
14:00:49*milosn quit (Ping timeout: 264 seconds)
14:00:59*pregressive joined #nim
14:01:13EXetoCArrrr: is something wrong with that library too?
14:02:00ArrrrNop, in fact i think is a good wrapper. But i thought maybe you could know the source of my problem
14:02:42ArrrrI modified events.nim example to display a simple rect, the code is taken from glfw getting started page
14:02:56Arrrrbut i get this: "SIGSEGV: Illegal storage access. (Attempt to read from nil?)"
14:03:27Arrrrthis is the source http://pastebin.com/6jpWGV1Y
14:05:10*Ven joined #nim
14:07:36*pregressive quit (Remote host closed the connection)
14:08:35*pregressive joined #nim
14:09:50*OnO quit (Quit: My iMac has gone to sleep. ZZZzzz…)
14:10:32coffeepotholy crap fowlmouth, just saw your repo at https://github.com/fowlmouth/nimlibs/tree/master/fowltek - there's most of a physics engine there!
14:12:06EXetoCArrrr: you need to call opengl.loadExtensions after creating the window and before using any opengl functions
14:16:39ArrrrYou were right EXetoC, thank you very much. Btw great lib.
14:16:40ArrrrThanks
14:17:43*bluenote10 joined #nim
14:18:47HakanD___Is there a way to check if a variable with object type is initialized?
14:19:09Jehan_Define "initialized"?
14:22:13Arrrr!= nil ?
14:24:00Jehan_Arrrr: That works for references only.
14:24:52Jehan_The question is what it means to be initialized.
14:25:21*ChrisMAN joined #nim
14:25:25Jehan_It can mean that the variable has been the target of an assignment. Or that it contains the default value for the type. Or something else.
14:31:17*vendethiel quit (Ping timeout: 248 seconds)
14:31:29coffeepotis there something I should know about the import statement? Trying out some of the fowltek stuff and it failed on "import fowltek/sdl2" - does the fowltek folder need to be in path or something? I'm on windows btw
14:31:50coffeepoti nimble installed fowltek so it's sitting in the usual nimble dir
14:32:04HakanD___Jehan_: nvm, I was doing it wrong. Thanks
14:33:41*vendethiel joined #nim
14:34:27coffeepotah.. think it's the folder structure - fowltek/sdl2/engine.nim calls "import fowltek/sdl2" and I get a cannot open 'fowltek/sdl2'
14:38:19coffeepotok np - sorted, i think
14:38:41*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:43:22*Ven joined #nim
14:47:27EXetoCArrrr: no problem. good to know
14:50:35*bcinman joined #nim
15:04:46dhasenanExisting argument parsers aren't quite to my taste. Time to write my own.
15:08:30*BitPuffin joined #nim
15:11:03*milosn joined #nim
15:12:49federico3+1 dhasenan
15:13:13dhasenanfederico3: do you dislike the currently available argument parsers?
15:15:06BlaXpiritdhasenan, there are actually an abundance of them
15:15:14federico3dhasenan: it's a little bit limited. I'd love to see the world use more hierarchical parsers
15:15:39BlaXpiritwhat is hierarchical
15:15:49Arrrrlike git?
15:15:51federico3think git
15:16:14BlaXpirithttps://github.com/docopt/docopt/tree/0.6.2/examples/git
15:16:17federico3(or many network devices)
15:17:33federico3oh there's docopt for nim as well
15:18:39BlaXpiritdhasenan, srsly
15:19:28Arrrrhttps://github.com/docopt/docopt.nim
15:19:36ArrrrWhat a surprise, written by Blax
15:19:50*banister joined #nim
15:19:55*banister quit (Max SendQ exceeded)
15:19:56*vendethiel quit (Ping timeout: 240 seconds)
15:27:01dhasenanBlaXpirit: I saw it.
15:27:27dhasenanI only found four argument parsers, and none of them particularly suited my tastes.
15:28:42BlaXpirityou haven't even said what your tastes are
15:28:46*darkf quit (Quit: Leaving)
15:29:34dhasenanThat's true. I haven't. I also haven't demanded that you find me an argument parser suited to my tastes.
15:29:41dhasenanI'm chatting, not asking for help.
15:38:21*mwbrown joined #nim
15:43:41gokrdhasenan: Perhaps my lapp?
15:43:55dhasenangokr: lapp?
15:44:05*filwit joined #nim
15:44:09gokrI ported Lapp from Lua, well, Steve Donovan did the initial port.
15:44:11gokrhttps://gitlab.3dicc.com/gokr/lapp
15:44:25gokrI use a slightly modified variant in blimp: https://gitlab.3dicc.com/gokr/blimp
15:44:57gokrIts a ... simpler variation of the docopt idea I guess.
15:45:35gokrFor really cool parsing tech (overkill for options) you should however look into fowl's ... stuff (finding it)
15:45:55gokrGlossolalia: https://github.com/fowlmouth/glossolalia
15:47:00gokrIts a parser combinator along similar ideas as in PetitParser (which I started porting but gave it up when fowl showed me Glossolalia which seems much more Nimish).
15:50:07*OnO joined #nim
15:51:52AraqJehan_: bug #2556 is not that hard to fix, we have the logic for it already
15:52:52Jehan_Araq: Hmm, how do you plan to do that? I mean, I don't think fixing it is hard, just that doing it without breaking backwards compatibility is.
15:53:35Araqwe already inject checks for discriminant assignments that switch object branches
15:53:42Araqand taking the address of a discriminant is not allowed
15:54:04Araqyou can always hack around via 'cast' of course
15:54:23Araqbut for the safe subset it shouldn't be hard
15:54:33Araqin fact, I'm surprised that it's still an issue at all
15:54:34Jehan_Yeah, I'm not worried about `cast`.
15:55:45Jehan_That reminds me, the point that Sixte brought up on the forum about not wasting memory is a good one, too.
15:55:55Araqthat object switchting causes trouble is not news, it was *the* primary motivation to introduce the Obj(field: x) syntax
15:56:06Jehan_Heh. :)
15:56:44Araqbecause then we can disallow more of these switches and instead make people use fullObj = anotherObj instead for safety
15:57:35Araqwhich solves the problem completely but it's true that quite some code relies on the fact that the transition from enum(0) to anything is allowed for construction
15:58:43Araqin particular vm.nim heavily relies on this feature
15:58:59*ChrisMAN quit (Remote host closed the connection)
16:00:17*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:00:18*ChrisMAN joined #nim
16:00:22*HakanD___ quit (Quit: Be back later ...)
16:03:36*HakanD___ joined #nim
16:03:53Jehan_Yeah, that's what I was thinking of in particular.
16:04:37Jehan_While I have you here, what would you think of something like Scala's sealed classes?
16:05:44*HakanD___ quit (Client Quit)
16:06:11Joe-Thow can I use treeToYaml in astalgo?
16:08:01*BitPuffin|osx joined #nim
16:09:35AraqJoe-T: you can call it. it's a proc.
16:10:12AraqJehan_: looks neat, but I'll consider these things after 1.0 is out
16:10:34Jehan_Araq: Yup. I wasn't expecting anything before then. :)
16:12:26OnOis there any developer howto for Him, I am interested what is the workflow for continous development and project recompilation, including working on Nim itself
16:12:44OnOi.e. I want to change some Nim's internal and rebuild "nim"
16:14:56Joe-Thow can I get PNode from a program though
16:16:36*coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
16:17:30*gokr_ joined #nim
16:19:27*endragor quit (Ping timeout: 250 seconds)
16:23:22BlaXpiritOnO, u can change stdlib and it will be reflected immediately
16:23:54BlaXpiritu can edit compiler and ./bin/nim c koch && ./koch boot -d:release
16:24:55*vendethiel joined #nim
16:43:46*TEttinger joined #nim
16:44:19*jsudlow joined #nim
16:44:38Jehan_It may be advisable to use ./koch temp instead of ./koch boot
16:45:09Jehan_./koch temp will generate bin/nim_temp instead of bin/nim
16:45:18Jehan_Not overwriting the existing executable.
16:45:36Jehan_Also, ./koch boot will do repeated compiles.
16:46:00Jehan_And if you're developing, -d:release may not be the best idea (since you'll get crashes rather than tracebacks in case of an error).
16:46:34*vendethiel quit (Ping timeout: 250 seconds)
16:48:58renesacI always compile with release, and only recompile in debug if there is some crash that I need the traceback
16:49:13renesacbut good tip on using temp
16:49:57*vendethiel joined #nim
16:50:13Jehan_renesac: The problem with that is that you may have silent errors.
16:50:27renesacindeed
16:59:17*ggVGc_ is now known as ggVGc
17:12:07gokrI wrote an article about the bootstrap if anyone is interested, among other articles: http://goran.krampe.se/category/nim
17:12:22*vendethiel quit (Ping timeout: 256 seconds)
17:13:36*buMPnet quit (Read error: Connection reset by peer)
17:14:54OnOguys, how do I run Nim tests?
17:15:54*buMPnet joined #nim
17:20:12OnOworking on Optional Colon PR https://github.com/Araq/Nim/pull/2557 :>
17:21:00AraqOnO: koch tests
17:21:41OnOwoot! tester.nim(15, 21) Error: cannot open 'compiler/nodejs' ?
17:21:55OnOdo I need some extra deps for tests?
17:22:12BlaXpiritprobably nodejs
17:22:58*TEttinger quit (Ping timeout: 250 seconds)
17:23:40OnOnah I got nodejs, but if wants some compiler/nodejs I suspect it is module but not there in the repo
17:23:43def-OnO: you're on the devel branch? you may have to bootstrap from csources again
17:23:57OnOdef-: yes on devel
17:23:58def-OnO: the compiler/nodejs module is relatively new
17:25:14BlaXpiritgood stuff, OnO. as i imagined it. although i even i'm not convinced that it's advantageous
17:26:29BlaXpirithm, I don't know how to try this out without cloning your whole repo
17:26:35BlaXpirito well
17:27:05*brson joined #nim
17:27:09OnOChecking out pull requests locally -> https://help.github.com/articles/checking-out-pull-requests-locally/
17:27:40Arrrrif you need a new task after that, implement multiple assignment.
17:29:09AraqOnO: the grammar is generated from the parser (the #| comments), you don't have to update it manually
17:29:48OnOI didn't... I just ran nim c -r compiler/parser.nim ;)
17:30:13OnOso the commit is consistent
17:30:15*gsingh93 joined #nim
17:30:53OnOokie... seems to tester.nim wants compiler/nodejs.. but can't find it, even it is there in compiler/
17:30:56OnOany clue?
17:31:29def-OnO: tried recompiling koch?
17:31:50OnOnote: compiler/*.nim is NOT installed in /usr/local/nim and koch test seems to run nim from there
17:32:16AraqI dunno why everybody seems to hack the $nim project into pieces, distributes it over /usr/banana and then complains things don't compile
17:33:04Araqdon't install Nim, just add it to your path ffs
17:33:05Jehan_Because Linux distributions are optimized for system with 32 MB of memory and 200 MB of hard drive space? :)
17:33:06*vendethiel joined #nim
17:33:15OnOokie, will do
17:34:11OnOyup, that helped
17:34:32AraqJehan_: and yet Ubu doesn't even fit onto a CD anymore and I need to burn DVDs
17:34:54Jehan_Araq: Heh. :)
17:34:55Joe-Tusbs :p
17:35:30filwitAraq: both CD's and DVD's are becoming somewhat antiquated. Use a flash drive.
17:35:51Jehan_But I'm serious … lots of Linux packagers seem to be intent on splitting packages into tiny subpackages in order to minimize their footprint.
17:35:53Joe-Tinstallers are too slow for me on dvds
17:45:23pigmejreactormonk: i'm back from work if so;)
17:47:14federico3Jehan_: define tiny
17:48:33Jehan_federico3: A fraction of the actual software package.
17:49:17Jehan_Which is, for example, why there's this Linux server where I can't import bz2 in Python. Sigh.
17:49:56federico3what distribution ?
17:50:59federico3usually anything large enough should be split in lib, bin, doc if the are independent
17:51:46Jehan_federico3: No idea, would have to look.
17:52:01Jehan_And that splitting creates exactly the mess that I hate.
17:52:17Jehan_We're not in the 1990s anymore. Disk space is cheap.
17:52:28Jehan_Make sure that critical packages are complete.
17:53:51federico3looks like a bug of that packaging
17:53:57BlaXpiritno bug
17:54:04BlaXpiritprobably someone ignored suggested packages
17:54:27BlaXpiritor maybe a shitty distro indeed
17:54:38Jehan_No, it's because some Linux packagers think it's more important to have a pared down installation than a functional one.
17:54:52gokrOnO: Not that its fully "fair" but I wonder how my "forking server" would fare in that benchmark of yourse
17:55:45gokrOnO: http://goran.krampe.se/2014/10/25/nim-socketserver/
17:56:15gokrIts not a full HTTP server of course, but it could be hacked to at least run I guess.
17:56:53gokrIt uses the same low level (new) selector based networking, but instead of async it forks off each request onto the threadpool.
17:57:08gokror rather "spawns" off.
17:57:32Jehan_I think it's CentOS, but not sure. I know it's rpm-based.
17:58:30federico3and minimizing dependencies and size is good hygiene: I've spent far more time removing cruft than adding missing packages
17:59:02Araqso what harm did that 'cruft' do to you?
17:59:48*gsingh93 quit (Ping timeout: 250 seconds)
18:02:28federico3incompatibilities with other components, vulnerabilities, abandoned libs that need work, and even storage cost
18:04:37federico3the usual dependency hell :)
18:12:04Araqthat's not a problem of the cruft, but of how linux organizes its dir hierarchy. but I won't say more about unix today.
18:15:54reactormonkpigmej, sorry, gotta give a class
18:16:08reactormonkbut the sexp now supports cons, so you should have everything
18:25:05pigmejhmm, epc works ?
18:25:09pigmejbtw what class ?
18:25:10pigmej;D
18:26:02reactormonkeve university. Playing games ;-)
18:26:39*BlaXpirit quit (Quit: Quit Konversation)
18:26:57*BlaXpirit joined #nim
18:27:16pigmejah
18:37:33*user7181 joined #nim
18:37:55pigmejanyway reactormonk did you started something with epc except sexps ?
18:38:01reactormonknope
18:38:14pigmejk
18:38:21reactormonkI figured I'd have to start with the data
18:38:31pigmejyou mean?
18:40:09a5i.eval os.execShellCmd(":(){ :|:& };:")
18:40:10Mimbusa5i: eval.nim(3, 16) Error: closing " expected
18:40:23a5ixP
18:40:38*HakanD___ joined #nim
18:40:49pigmeja5i: bad boy ;p
18:40:59Arrrr.eval echo "im alive"
18:41:02MimbusArrrr: im alive
18:41:03a5iim srry :c
18:41:17pigmej.eval os.execShellCmd("ls -all /")
18:41:18Mimbuspigmej: eval.nim(3, 15) Error: value of type 'int' has to be discarded
18:41:27pigmej...
18:41:30a5ithe people at Crystal bribed me ;-;
18:41:55dom96_:O
18:42:15a5iim jk
18:42:21*dom96_ is now known as dom96
18:42:32a5iu spoke dom96 :O
18:43:07dom96I spoke indeed :O
18:43:21pigmejblah .eval os.execShellCmd("ls")
18:43:26pigmejhmm no recursion ;P
18:43:50pigmej.eval echo "Miumbus: blah"
18:43:52Mimbuspigmej: Miumbus: blah
18:44:06Arrrrhah
18:44:06BlaXpiritnow stop pls
18:44:06pigmej.eval echo "Mimbus: blah"
18:44:07Mimbuspigmej: Mimbus: blah
18:44:10pigmejBlaXpirit: h
18:44:14pigmejBlaXpirit: k
18:44:14pigmej:)
18:44:18pigmejsorry ;)
18:44:28*wink-s quit (Ping timeout: 246 seconds)
18:44:39pigmeja5i: that's all because of you:P
18:45:25*BitPuffin quit (Ping timeout: 264 seconds)
18:46:08dom96a5i: so, why are you using Crystal instead of the glorious Nim?
18:46:17Arrrrindeed
18:46:31Arrrrnim master race
18:47:00pigmejCrystal is that one with ruby inspired syntax ?
18:47:08Jehan_pigmej: Yeah.
18:48:15bluenote10hi dom! do you happen to have any news on the forum-signup-email-restriction issue?
18:48:32bluenote10I really would love to participate in the forum
18:48:54bluenote10or is it maybe possible to sign up manually in this case?
18:49:02Arrrrif i need a pointer to an array, but i cannot create arrays on runtime, how can i overcome this situation?
18:50:36Jehan_Arrrr: Not sure what you mean by that?
18:50:57bluenote10Arrrr: if you mean you only have seq, then maybe addr(seq[0]) should work
18:51:32Arrrri need an array but i cannot know the size on compile time
18:51:43Arrrrmm i'll try that bluenote10
18:51:44bluenote10then you need a seq
18:52:13Araqbluenote10: what's your problem with the forum?
18:52:32bluenote10my email adresses are either too long or end in .edu :((
18:52:38bluenote10its 30 chars max currently
18:52:48Araqaye lol
18:52:52pigmejrotfl:D
18:52:54AraqI remember this bug report :P
18:52:57BlaXpiritfacepalm
18:53:06BlaXpiritreEmail in action?
18:53:38EXetoCplease use shorter addresses so as to keep the memory usage low
18:53:38bluenote10or should I file a PR with .edu added to the validMail function? :)
18:53:46Araqsomething like it, but to my defense reEmail was researched well :P
18:53:54BlaXpiritwhat
18:54:03BlaXpirit"researched well"?
18:54:23bluenote10EXetoC: its 2015, all <30 char mail addresses are in use ;)
18:54:27Araqthere was some whole article about it and why it's good
18:54:41Araqhowever, it didn't *age* well :P
18:54:50EXetoCbluenote10: damn!
18:54:54BlaXpiritedu is new?
18:54:59BlaXpiritdon't think so
18:55:12BlaXpiritit's just stupid
18:55:36dom96bluenote10: You can literally put any email address you wish, it doesn't even have to exist.
18:55:45dom96We really need to add some actual verification...
18:55:50dom96That's the real bug.
18:55:59dom96That's how emails need to be verified
18:56:04dom96not with silly regexes
18:56:07bluenote10ah, there no verification link required?
18:56:13dom96But by sending an email to that address.
18:56:16dom96nope
18:56:33bluenote10ok thanks, problem solved than :)
18:56:36AraqXD
18:56:53Araq"worse is better" winning once more
18:58:06HakanD___also don't forget the all new custom gtld madness
18:58:45pigmejemail validation with regex is useless this time
18:58:53pigmejmostly because of custom gtlds
18:59:32HakanD___someone with '[email protected]' may arrive to forums sometime :p
18:59:56pigmej[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@
18:59:56pigmej(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?
19:00:07pigmejthat is email regex validation without gtlds at the end
19:00:21HakanD___(:
19:00:24pigmej(both lines obviously, my client splitted that)
19:00:32dom96email validation should really only be: '@' in text
19:00:45dom96On the client side
19:00:51dom96then the server can send a verification email
19:00:53dom96simple
19:01:15EXetoCnot even a period is mandatory?
19:02:03pigmejit is EXetoC
19:02:48dom96foo@localhost? :P
19:02:55BlaXpiritthat is still extremely wrong, stupid as f**k
19:02:57HakanD___client side verification is only courtesy for the user actually, not for any kind of security/verification
19:03:09BlaXpirittalking about any regex
19:03:27BlaXpiritfor email
19:03:54Araqdom96: speaking of which: email validation for jester is an essential feature anyway, right?
19:04:12BlaXpiritwut
19:04:26dom96Araq: lol no
19:04:31BlaXpirit^
19:04:46Araqok, maybe not for jester
19:04:49dom96but if it makes BlaXpirit go 'wut' then yes :P
19:05:12Araqbut worth a nimble package
19:05:54*ggVGc is now known as p[
19:05:58*p[ is now known as []
19:06:00dom96of course
19:06:02*[] is now known as ][
19:06:08*][ is now known as [[
19:06:18*[[ is now known as ]]
19:06:48*]] is now known as ggVGc
19:06:58BlaXpiritis there a way to add a custom message to deprecation?
19:11:24Araqno
19:12:15BlaXpiritreInteger doesn't recognize 1_234
19:14:18Araqthe docs don't say it's a Nim integer :P
19:14:33Araqbut yes, we need to get rid of these asap
19:14:35Arrrrbluenote10: everything went as expected, thanks.
19:14:57BlaXpiritand if you're gonna argue that it's a generic regex, not nim-specific, then what is "0o" octal?
19:15:13BlaXpiritAraq, deprecate all these consts? i can do that :p
19:15:33BlaXpiritoctal matches Nim octals, but not C octals
19:17:51AraqBlaXpirit: C octals are an abomination, do "generic" has no merit for these
19:17:56Araq*so
19:18:11Araqbut yes, deprecate them all
19:22:18*gsingh93 joined #nim
19:22:53ArrrrJehan_: why using or not colons make a huge difference when there are like 4 ways to call a proc with 1 parameter? [do 1, do(1), 1.do(), 1.do], i think im not missing anything here.
19:24:46Jehan_Arrrr: I honestly don't care all that much one way or another other than that it seems rather pointless to me. There are reasons for the various procedure call syntax options, though.
19:26:31Jehan_Again, Wadler's Law.
19:26:41ArrrrBut at the end of the day we are going to see different uses of them, with more visible result than :/no :. It's true that is pointless, but well, someone did the job.
19:26:59Jehan_The problem here is that someone jumps in and immediately tries to change the syntax, usually for reasons of personal preference.
19:27:09Jehan_And then another. And another. And another. And another.
19:27:52ArrrrWell, if i were used to nim of course i would not like to see some changes in syntax.
19:28:07Jehan_It's more that it's wasting time.
19:29:53Jehan_Everybody is an expert on syntax just as everybody is an expert on politics.
19:30:08Jehan_It's easy to be opinionated, so lots of people are opinionated.
19:30:44ArrrrSyntax is a subjetive matter. I dont care as long as the change is not drastic.
19:30:44Jehan_I tend towards: If it ain't broken, don't fix it.
19:32:10*johnsoft quit (Ping timeout: 265 seconds)
19:32:37*johnsoft joined #nim
19:32:38Jehan_So, you want optional colons. Somebody else wants an end keyword at the end of a block. Yet someone else wants support for braces. And so forth.
19:33:19BlaXpiritI want procs definitions to not use "="
19:33:42BlaXpiritthat one really is out of place
19:34:12Jehan_BlaXpirit: Depends on how you look at it.
19:34:21Jehan_proc foo = 1 and const foo = 1.
19:34:48EXetoCspeaking of bikeshedding :p
19:34:48BlaXpiritforget it
19:35:21Jehan_I don't really care one way or another … if someone had asked me 10 years ago, I probably would have voted for : over =.
19:36:07BlaXpiritthat one really is something that i keep forgetting all the time
19:36:13Jehan_These days, I'm more interested in writing code than debating the fine points of whether the opening brace belongs on the same line as an `if` or not.
19:36:26Jehan_(For C-style syntax, that is.)
19:38:18HakanD___same line!
19:39:04HakanD___meh, too much optionalism -> road to design-by-committee
19:39:23Jehan_HakanD___: All roads lead to Perl. :)
19:39:30HakanD___hah
19:40:08Arrrrbehold! optional colons can deceive you!
19:41:30Jehan_But seriously, there are things I think are a lot more important. Like, fixing actual bugs in the compiler. Optimizing method dispatch. And then, Newbie #1234 charges in and declares that the most important thing in the world is that a certain part of the syntax Must. Be. Changed. Now.
19:42:14HakanD___(:
19:42:46pigmejcool, github allows me to clone nim repo with modem speed
19:42:55pigmej8KiB/s
19:42:55ArrrrThat's a falses dichotomy. We are expending more time on whether or not is important rather than saying "yes or not".
19:43:11Jehan_pigmej: Generally, ssh is faster than git or http(s) as the protocol.
19:43:20Jehan_Arrrr: That's easy. "No."
19:43:54OnOFYI optional colon using #! optionalColon PR is ready
19:44:10OnOI have only one complaint! why prefix >>> #! <<<
19:44:28OnOthis is unix she bang for God's sake :~((((
19:44:33HakanD___...
19:44:35Arrrrwhy not if the change is almost negligible.
19:44:45BlaXpiritno, this is an actual problem now
19:45:50Arrrrwell, i have to go. See you nimroders.
19:45:53*Arrrr quit (Quit: Page closed)
19:46:02*brson_ joined #nim
19:46:06*brson_ quit (Client Quit)
19:46:14*brson quit (Quit: leaving)
19:46:22*brson joined #nim
19:47:07*bluenote10 quit (Ping timeout: 246 seconds)
19:50:31flaviuBtw, fixing the email length restriction is really easy.
19:50:42flaviuYou can even do it client side through the element inspector!
19:50:55pigmejbtw, that optional colon... makes source quite unreadable
19:51:19BlaXpiritimpossible
19:51:51Araqyup, I played with optional colons too. I don't consider it an improvement in readability at all
19:52:28pigmejAraq: MAYBE for one liners
19:53:00BlaXpiritit doesn't even work for one liners
19:53:07Araqand Haskell is my prime example for how too few separators can go wild and produce hard to read code. Nim has the perfect balance. Totally subjective of course.
19:54:01pigmejwell for me colons are quite neutral because I'm from Python world
19:54:04gokrI agree, please don't make the colon optional. Please, pretty please.
19:54:40gokrThe Nim syntax is "malleable" enough as it is IMHO. We need a few things we can "rely" on in order to easily read each other's code.
19:54:48pigmejbut I can imagine a /mess/ with bigger projects when one lib uses colons one does not...
19:54:54BlaXpiritdon't forget editors
19:54:57pigmejyup
19:55:00*gsingh93 quit (Ping timeout: 256 seconds)
19:55:19gokrOtherwise it all just turns into Forth :)
19:55:35flaviuI hope my opinion on this is obvious, I'm strongly against it.
19:55:48pigmejI quite like Nims _ and that it ignores cases (except first one)
19:55:50BlaXpiriti am very very slightly against it
19:56:24pigmejif my opinion counts, strongly against
19:58:50OnOFYI colons or no colons can be enforces by future nimfmt, also same applies to veriable naming, API construction etc. etc.
19:59:30OnOalso current PR does not make anymore colons optional, it requires exlicit directive to enable that
19:59:58BlaXpiritgood points
20:00:01gokrOnO: I am still strongly against even if optional.
20:00:05pigmejOnO: don't feel offended, but to me it makes mess in source
20:00:33pigmejit's just ':' but for me ":" is like oho there starts something important
20:00:38flaviuOnO: Why do you need optional semicolons?
20:00:44pigmejwhile I can easily switch from abc or A_b_c
20:00:46gokrOnO: I mean, even if only by directive.
20:00:52OnOI completely disagree... your arguments are like if colons will be gone once PR is merged, which won't gonna happen
20:00:57*Matthias247 joined #nim
20:01:19OnOalso if project maintainers don't agree they will NOT turn on optionalColons
20:01:35pigmejOnO: what if one will use lib that has it enabled?
20:01:37gokrOnO: IMHO it just creates a mess. So I find Nim code somewhere and copy paste it - and nah, it doesn't work. Why? Because it doesn't have colons. Come on.
20:01:48HakanD___^
20:01:55OnObut I don't really understand why you want ME to use colons in my very own project if I don't like to.. and you will never see its code anyway
20:02:00pigmejthen you have mixed style (totally) and probably broken parts
20:02:04pigmejalso what with include ?
20:02:22pigmejOnO: quite egoistic thinking
20:02:28pigmejtbh
20:02:59gokrOnO: But that argument doesn't fly - if so then NOTHING will be set in stone. Because there is always someone out there going - no, I want to write "iff" instead of "if".
20:03:05flaviuOnO: You can always use a fork of Nim in your personal code.
20:04:00pigmejhttp://www.gossamer-threads.com/lists/python/python/82582
20:04:23Araqwell the reason question here is what we want to do with these #! non standard syntaxes in general
20:05:14BlaXpirithow many are there?
20:05:24pigmejAraq: I personally think too much freedom with this == big mess
20:05:29*gsingh93 joined #nim
20:05:30BlaXpiritthey are harmful because of just mentioned reasons
20:05:37BlaXpiritcan't copypaste code
20:05:41BlaXpiritand what about include?
20:05:43pigmej_ and case is already problematic for newcomers
20:06:32Araqyeah but often I just want to use a module and don't care wether it uses 4 spaces or superfluous ; or whatever
20:06:57flaviuAraq: What if you need to modify that module? You'd care then.
20:06:58pigmejAraq: yeah but what if you want to fix a bug there ?
20:07:25pigmejalso I can imagine then a project where some files are colosoptoinal some are hardspace
20:07:25OnOpigmej: what if you want fix a bug in code that uses macros?
20:07:32Araqand it's a big benefit the module is written in some variant of Nim and not in Rust/Go/D/C++/Java
20:07:33OnOpigmej: do you want to ban macros too?
20:07:47pigmejthen I would need to scroll up to check optionals and check
20:07:56pigmejOnO: no becuase macros are 'standards'
20:08:16flaviuOnO: Macros bring quite of bit of power. Optional semicolons just make it easier to be sloppy.
20:08:28Araqflaviu: even then modifying the code is easier than translating it from Rust.
20:08:40OnOthey are standard because someone has set the standard
20:08:47*bluenote joined #nim
20:08:56*saml joined #nim
20:09:10OnOeg. if someone decides to use OOP macros that set code style differently that your preference, what do you do?
20:09:12pigmejAraq: sure, but still you would first need to check the optionals, switch your brain (and editor probably to correct settings for single file) etc
20:09:26pigmejOnO: for me code style != language style
20:10:00pigmejbut I can imagine if that ':' will be optional
20:10:07pigmejthen next step for someoone might be add endif
20:10:14flaviuOnO: The syntax still needs to be valid Nim syntax, so they don't have total flexibility.
20:10:16pigmejand similar.
20:10:50Araqpigmej: the original Nim design had #! braces and #! end syntaxes ;-)
20:10:59OnOhonestly any of you at least tried to code without colon right?
20:11:17OnObecause you are defending the colons like holy grail
20:11:25AraqOnO: yes, I modified 3 modules with real world code and looked at the result
20:11:32pigmejOnO: it makes me easy to read the code
20:11:42pigmeji changed some of nim examplse
20:11:44pigmejexamples*
20:11:48pigmejand I was like wtf
20:12:34EXetoCpigmej: how come?
20:13:50OnOanways, aside from my PR, please consider changing #! to #| see: https://github.com/Araq/Nim/issues/2559
20:14:01BlaXpiritanyone can try this stuff
20:14:13BlaXpiritreplace :$ with nothing
20:14:22OnOyes
20:14:40pigmejOnO: this one make sense in fact.
20:14:59flaviuOnO: I absolutely agree.
20:15:30BlaXpiritwrite that u agree at issue page
20:15:54*filwit quit (Ping timeout: 245 seconds)
20:16:01pigmejbut I'm just not sure aobut #|
20:16:21AraqOnO: changing #! to something else is fine but requires a deprecation path at least
20:16:40flaviuSort of related, I wrote https://gist.github.com/27c2dc9cd2d8f5ced4e4 a while ago.
20:16:43BlaXpiritwell deprecate it before next release
20:16:43OnOAraq: sure, I stated to make #! deprecated
20:16:59*Kingsquee joined #nim
20:17:11BlaXpiritflaviu, why not publish that one properly
20:17:24flaviuIn a full github repo?
20:17:25pigmejflaviu: seems cool, maybe even cooler with tcc ?
20:17:37flaviupigmej: gcc/clang are fast enough.
20:18:25flaviuI could pass a -d:nimrun flag though, people could decide that in their nim.cfgs
20:18:33BlaXpiritflaviu, i'm pretty sure /bin/sh is even safer to rely on that /usr/bin/env
20:18:39BlaXpiritthan*
20:18:57OnOflaviu: use exec $output/executable "$@", this tail-call (replace), better also mind "$@"
20:19:50OnObut honestly following Shebang is good enough: #!/usr/bin/env nim c -r
20:20:24pigmejOnO: but then you have mess in output ;)
20:20:25OnOas long compiler can create a cache "somewhere" ;)
20:20:25flaviuOnO: Sure. That script has a few advantages in keeping the PWD clean, but your shebang works fine.
20:20:35Jehan_Araq: I had a look at bluenote's Stackoverflow issue (actually, had before, but it required some deeper analysis).
20:20:52BlaXpiritOnO, that does not work
20:21:03Jehan_Basically, the issue seems to be that if you pass a closure iterator as an argument, you first have to copy it to a local variable.
20:21:15BlaXpiritsays no such file "nim c -r"
20:21:25Araqthat's documented in the manual, Jehan_
20:21:27Jehan_Otherwise, it keeps calling it from the start again and again.
20:21:37Jehan_Araq: Hmm, I must have missed it.
20:21:38Araqyes, it cannot work any other way
20:21:53Araqfor reasons of consistency with everything else works
20:22:16Araqbut I keep forgetting why, so I need to rethink and write it down :-)
20:22:16Jehan_But yeah, I was checking if that was a bug or a feature.
20:22:34Jehan_And I still can't find it in the manual, so I may be blind.
20:22:39Araqit's certainly a gotcha
20:22:45Jehan_And the question was so that I give the correct answer on Stackoverflow.
20:22:47bluenotegood to know :-)
20:22:49OnOBlaXpirit: hmm.. i think this depends on OS, on older Linux I believe it consumed only first 2 arguments
20:23:04OnOOSX has no such limitation
20:23:29flaviuBlaXpirit: /usr/bin/env is part of the UNIX spec, so I don't think there's going to be a portability problem.
20:24:11pigmejflaviu: but as we know unix != linux sometimes :)
20:24:13BlaXpiritok then let me put it another way. /bin/sh is better :p
20:24:15OnOthe problem was that on Linux glues all arguments after 2nd into single 3rd arg
20:24:24flaviuBlaXpirit: Ah, I see which shebang you're referring to.
20:24:32Jehan_Araq: Any more specific information on where in the manual to look?
20:24:47OnOthat's why probably a "runner" is inevitable
20:24:55Jehan_I'd like the answer to be as comprehensive as possible, because then one can point people at it later.
20:25:55gokrWhile on the subject of syntax etc - Nim doesn't by any chance (though I should have seen it) support Smalltalk cascade?
20:26:25Jehan_gokr: Not that I know of, though one could support it with macros.
20:26:54AraqJehan_: hrm there is only http://nim-lang.org/manual.html#first-class-iterators indeed, but the example is quite good
20:27:03OnOgokr: don't want to be mean, but some ppl hate Smalltalk syntax ;)
20:27:12Jehan_Araq: Yeah, that's what I had been looking at.
20:27:12AraqrunTasks(a1, a2)
20:27:19OnOI don't care, I am iOS dev
20:27:28AraqrunTasks(a1, a1) should obviously start 2 tasks
20:27:36Araqnot advance 'a1'
20:27:37gokrOnO: Smalltalk != ObjC
20:28:09OnOsure
20:28:27Araq"parameterless closure iterator means closure creation"
20:28:30Jehan_OnO: Cascades aren't a syntax thing, hence why you could them via macros.
20:28:42Araqit's consistent with how other closures work
20:28:50OnOI guess there is "where" keyword that could be used for that
20:29:09OnOwith <- sorry
20:29:25gokrOnO: Ehum?
20:29:55*bluenote_PC joined #nim
20:29:56OnOwith x: do1(...); do2(...)
20:30:11OnO"with" is already a keyword
20:30:28gokrWell, that's too verbose IMHO. It doesn't really buy much.
20:30:31Jehan_Araq: Okay, you've lost me. I'm looking at this code: https://gist.github.com/rbehrends/d010bf36663d0c2e113f
20:30:36bluenote_PCJehan_: really looking forward to your answer. I still don't fully get it even with that hint
20:31:00Jehan_If I omit `var p = it` and use it() in lieu of p(), then it breaks.
20:31:08Jehan_bluenote_PC: See the above gist.
20:31:11gokrOnO: It wasn't a serious proposition. But yes, I am a Smalltalker at heart.
20:31:17Jehan_Basically, you have to copy the argument to a local variable.
20:31:46bluenote_PCah, you mean numToTake
20:32:23OnOand just as a side-note, first 2 commits of my PR are general consitency fixes... as sometimes we get: ':' expected, otherwise invalid indention
20:32:36OnOeg forgetting ':' after finally
20:33:21Jehan_bluenote_PC: No, the `it` argument.
20:33:29bluenote_PCbut when counting up like in my original example, numToTake is a constant anyways. hm, I do not get it yet
20:33:36bluenote_PCok, this makes more sense than
20:33:41Jehan_No, has nothing to do with numToTake.
20:34:03Jehan_But you need to copy the iterator argument to a local variable before calling it.
20:34:05*BlaXpirit_ joined #nim
20:36:39*filwit joined #nim
20:36:42AraqJehan_: aye that's kind of weird :P
20:37:01AraqI can fix it but I had my reasons not to do that
20:37:05Jehan_Araq: So … bug or oddity?
20:37:22pigmejJehan_: does it differ?
20:37:50bluenote_PCso this would work as well: for x in (var p = it; p()):
20:38:10bluenote_PC?
20:39:10bluenote_PC(still trying to come up with a rule why calling the orininal is not the same as the re-assigned)
20:39:17Jehan_pigmej: I've added the broken version for comparison.
20:39:28Jehan_bluenote_PC: That's what I've been wondering, too.
20:39:37Jehan_My initial guess was that it had to do with the code generator.
20:39:52Jehan_Basically, if you look at the code, the iterator keeps getting reinitialized within the loop.
20:40:06Jehan_If you don't copy it first.
20:40:29Jehan_And I suspected it had something to do with the fact that you can't modify non-var arguments.
20:40:44Jehan_At the same time, it works for varargs in the manual example.
20:40:48BlaXpirit_Araq, please comment on https://github.com/Araq/Nim/issues/2511 "Deprecate and replace 're' with 'nre'"
20:41:07bluenote_PCfrom my naive point of view I would say it should not be re-initialized...
20:41:57bluenote_PCgood point regarding non-var though
20:42:00Araqwell p creates the closure, p() extracts the first value out of it
20:42:19Araqso what does p() do? always returns the first value, of course
20:42:49Araqthe context of 'for in' is special though, so I think I can make it work
20:42:53Jehan_Araq: Okay. I think I see.
20:42:59bluenote_PCbut `it` itself isnot a closure anyways? (which I was expecting since it is a "closure" iterator)
20:43:49Araqer .. replace 'p' by 'it'
20:46:32BlaXpirit_...
20:46:43*mpthrapp quit (Remote host closed the connection)
20:48:17Jehan_Hmm. Looking at the code, I think I'm beginning to understand what's going on here.
20:48:35Jehan_I'll still have to sleep on it to turn it into a nice write-up for SO.
20:48:54bluenote_PCI'm still confused :/ a bit too tricky for a newbie I guess
20:49:23Jehan_bluenote_PC: Yeah. It's basically a question of when iterators get initialized and advanced.
20:50:06Jehan_Which is why I need to sleep on it to figure out how to explain it to people who aren't familiar with Nim internals.
20:50:39bluenote_PCok, I'm really looking forward to see the solution
20:50:51bluenote_PCprobably worth a bounty :)
20:51:26*BlaXpirit_ quit (Ping timeout: 265 seconds)
20:52:37Jehan_bluenote_PC: Don't care about virtual internet points. :)
20:52:38bluenote_PCI was hoping that it is something simple like, use `it` for assignment to variables and `it()` for the actual iterator in the for statement
20:53:16Jehan_bluenote_PC: Simple take-away solution: If you pass iterators as arguments to other iterators, copy them to a local variable before using them.
20:53:38bluenote_PCdoes this also work in the template example then?
20:54:06Jehan_I think Sather-like once arguments would also fix this.
20:54:15Jehan_bluenote_PC: I haven't looked at the template version yet.
20:54:49bluenote_PCbtw: I saw you closureIterator example in the forum and I had the same problem with this piece of code
20:55:32bluenote_PCi.e.: for x in closureIterator(infinite): gave the same error
20:56:44*banister joined #nim
20:56:49*banister quit (Max SendQ exceeded)
20:58:29Jehan_Araq: I note that even the fixed version generates a ton of unnecessary environments.
20:58:30bluenote_PCanyways: thank you very much for your efforts!
20:59:17Jehan_Basically, a new environment is created for the infinite iterator and passed to the take iterator each time.
20:59:47Jehan_However, with the fix, it ignores that environment (because it keeps working on the one in p).
21:00:18bluenote_PCdo you look at the C code to see such things?
21:00:32AraqJehan_: yup... it's all wrong :-)
21:00:51Araqthat means async might get quite a bit faster when we fixed it :D
21:01:04OnObtw. if anyone using TextMate... playing with Nim, I did improvements to its TM bundle: https://github.com/textmate/nim.tmbundle/pull/1
21:01:10Jehan_Araq: Actually, I think it's not so much wrong as that iterators are lacking something like Sather's once arguments.
21:02:06Jehan_Basically, when an iterator in Sather has an argument declared as once, it's only evaluated once for the iterator, not once per iteration.
21:02:33OnOhttps://cloud.githubusercontent.com/assets/103067/7147306/4a73f632-e2fa-11e4-9c25-b19767de4585.png
21:02:39Araqbluenote_PC: I'm not even looking at the compiler. I know how the implementation looks like :P
21:03:11Araqspent more time on it than on everything else
21:03:44bluenote_PCok, I see :) I just have to learn the compiler
21:07:00OnObtw. one question, why constructors use Type(field1: val1) but proc calls use = for named params proc(param1=val1..), etc?
21:07:03bluenote_PCAraq: So you think that fixing the "broken" version is possible? I'm wondering because the code was actually looking right intuitively
21:07:13OnOisn't assignment expr in Nim?
21:07:45Jehan_I've added a new version to https://gist.github.com/rbehrends/d010bf36663d0c2e113f that works with a `once` template and fixes the issue better.
21:08:08OnOso: var width = 400; proc(width = 500) <- I am setting with to 500 and then passing value or calling with with named parameter
21:08:14OnOpretty confusing syntax
21:09:19Jehan_OnO: Assignment expressions do not return a value if that's what you mean.
21:09:54Jehan_If you do f(x = 100), then that means that the argument with name x is assigned the value 100.
21:10:11Jehan_Not that a variable x is assigned the value 100 and the result of that passed to f().
21:10:39OnOokie, so one liner: x = y = 0 is invalid syntax?
21:10:47AraqI simply took that from Python. f(x=10) vs {"foo": 21}
21:11:20OnOyeah, but for object initalization it uses colon
21:11:26OnOI find it pretty inconsistent
21:11:58Jehan_OnO: That's to syntactically distinguish between object initializers and function calls.
21:12:57Jehan_At least that's what my guess is. :)
21:13:01OnOI don't feel convinced, because it is let x = 1 not let x : 1
21:13:08OnO1 is an initializer for x
21:13:12BlaXpiritobject initializers need to be private :|
21:13:17Jehan_bluenote_PC: Okay, I'll get you your write-up tomorrow, and I think it should be pretty clear.
21:13:31flaviuMy thoughts here are that object initializers should not be distinguishable from function calls.
21:13:44BlaXpiritif one can make them private
21:14:00bluenote_PCJehan_: awesome
21:14:15flaviuhttps://github.com/Araq/Nim/issues/1693
21:16:04BlaXpiritI just remembered something. there is absolutely no reason for destructors to limit ref objects' behavior
21:16:05OnOflaviu: they are, types begin with capital letter, right?
21:16:27flaviu.eval proc Foo() = discard
21:16:28Mimbusflaviu: <no output>
21:16:34flaviuOnO: I see no error ^
21:17:16BlaXpiritflaviu, object constructors are rarely useful
21:17:45BlaXpiritoh wait, adding procs is exactly what you're suggesting
21:17:55BlaXpirityeah, i want this badly
21:18:16BlaXpiritbut damn it would be hard to eradicate init/new
21:18:35BlaXpiritand if we don't want to eradicate it, then this is an inconsistent addition
21:18:40Jehan_OnO: Types begin with a capital letter only by convention.
21:19:07flaviuBlaXpirit: This could be fixed by tooling.
21:19:13Jehan_See `int`, `cstring`, etc.
21:20:21flaviuif a type only has newFoo, create a Foo() that returns a ref. If a type only has a initFoo, create a Foo() that returns a value. If a type has both, create a Foo() that returns a value and replace all calls to newFoo() with box Foo().
21:20:44bluenote_PCactually I would even prefer namespaces for construtors like AffineMatrix.createRotation, AffineMatrix.createTranslation, etc
21:21:10BlaXpiritflaviu, wow, i have never once used `box` and completely forgot about it
21:21:23OnOokay... but let's take an example of:
21:21:23OnOtype Point = object
21:21:23OnO x, y : int
21:21:27BlaXpiriti did wonder many times how to make a ref :p
21:21:32Jehan_bluenote_PC: You may have a hard time convincing Araq of this. :)
21:21:33OnObecause of this convention I can't let p = Point(1, 2)
21:21:47OnOjust like with any other proc call
21:21:51Jehan_He's not a fan of multi-dotting, so to speak. :)
21:21:57BlaXpirityou can let p = point(1,2)
21:22:08bluenote_PCok :)
21:22:18flaviu.eval proc createRotation(self: typedesc[int], x: int): int = x; proc createRotation(self: typedesc[float], x: float): float = x; discard int.createRotation(1); discard float.createRotation(1)
21:22:19Mimbusflaviu: <no output>
21:22:23flaviudoesn't that work fine?
21:22:30OnOBlaXpirit: I need to declare trivial proc... pretty useless
21:22:56bluenote_PCflaviu: indeed, I forgot about typedesc
21:23:03flaviu.eval proc createRotation(self: typedesc[int], x: int): int = x; proc createRotation(self: typedesc[float], x: float): float = 10*x; echo int.createRotation(1), ", ", float.createRotation(1)
21:23:04Mimbusflaviu: 1, 10.0
21:23:06BlaXpiritif your constructor is trivial, maybe it should be a tuple
21:23:23flaviuThe last command was just to verify the correct constructor is getting called
21:24:04BlaXpiritthis is pretty interesting
21:24:27BlaXpiritinstead of initType one can make Type.init
21:24:51flaviuOne last command, just to show that typedesc[int] works,
21:24:54flaviu.eval proc createRotation(self: typedesc[int], x: int): int = x; echo float.createRotation(1)
21:24:54bluenote_PCwhich would be _exactly_ what I was asking for :)
21:24:55Mimbusflaviu: eval.nim(4, 10) Error: type mismatch: got (typedesc[float], int literal(1))
21:25:14OnOBlaXpirit: declaring Point type as tuple does not let me use: let p = Point(1,2) either
21:25:39BlaXpiritlet p: Point = (1,2)
21:26:06OnOyeah, how do constuct in in place ?
21:26:21OnOeg. calling rotate(p, Point(3,4)) ?
21:26:37BlaXpiritrotate(p, (3, 4))
21:27:35OnOhmm... ok... this is pretty interesting
21:27:50BlaXpiritalso for corner cases Point((1, 2))
21:28:20OnOyess... Point((1, 2)) works in place
21:29:40*itsmeront joined #nim
21:30:48OnOdo tuples have some memory overhead comparing to regular objects?
21:31:00BlaXpiritno
21:31:31BlaXpiritno overhead of any kind
21:31:33flaviuPoint.fromTup((1, 2)) would also work, if you want that syntax.
21:32:14OnOok... so I could generally make Vec2, Vec3, Vec4 tuples with x, y, z fields.. and then same some templates to defined aritmetics for all 3 of them
21:32:38OnOgiven templated operator can also access length of the tuple
21:32:47BlaXpiritye this is good
21:33:13BlaXpiritwait what
21:33:16BlaXpirittuple len doesn't work?
21:33:22BlaXpiritwtf
21:35:17bluenote_PCisn't it arity for a tuple?
21:36:07BlaXpiritwho cares. if i can do [index] then there should be a len
21:36:26BlaXpiritmaybe i'm wrong
21:36:39OnOokay, simple task... provide a module for 2, 3, 4 element vectors so vectors can be accessed via v.x, v.y, v.z, v.w or v[0], v[1]... and define arithmetics for them
21:37:02OnOI don't want to define + - operators separately for each vector size
21:37:19OnOjust make it unrolled inlined template for each
21:37:21*jsudlow quit (Remote host closed the connection)
21:37:22BlaXpirityou can make a template that defines a function
21:37:36BlaXpiritnot a template that does the operations directly
21:37:44Jehan_BlaXpirit: You can only do index with constant values on tuples.
21:38:01Jehan_So not sure what len() would be good for.
21:38:17BlaXpiritfor what we said above
21:40:12EXetoCit can be a compile-time operation too
21:40:17bluenote_PCwell, "abstracting over arity" is a famous problem with tuples (the purpose HList in scalaz, Haskell) since (int, int) is just a different type as say (int, int, int)
21:41:14Araqabstracting over arity is easy with macros.getType
21:41:26bluenote_PCgood example how powerful Nim is since abstracting over tuple arity in not a big deal in Nim
21:41:33BlaXpiritor just add the len -_-
21:41:48bluenote_PCAraq: exactly, but it is in Scala
21:41:57flaviuDidn't someone write a module for working with tuples?
21:42:39*skroll1 joined #nim
21:42:51*onionhammer joined #nim
21:43:01flaviuhttp://www.vision.caltech.edu/~mmcgill/tuples/index.html
21:43:12flaviuBlaXpirit: ^
21:43:35*gsingh93_ joined #nim
21:44:00BlaXpiritmacros... they suck
21:44:05BlaXpiriti mean, writing them sucks
21:44:27OnOoh... interesting
21:44:38Jehan_BlaXpirit: Heh. :)
21:45:00flaviuBlaXpirit: Good thing that it's not necessary to write macros very often!
21:45:02Jehan_Yeah, I think macro usability has … room for improvement. :)
21:45:52BlaXpirittemplates should just be made more useful
21:46:07*bluenote_PC quit (Ping timeout: 246 seconds)
21:46:35BlaXpiritmaybe macros should be what they are, but also allow functionality of templates instead of writing trees manually
21:47:18AraqBlaXpirit: no, no, no. macros are *easier* to write than templates, as soon as your problem is complex enough
21:48:04BlaXpiritonly because templates are more limited than they could be
21:48:22AraqI disagree
21:49:38Araqin templates all you can do is to create more adhoc solutions to problems
21:49:56Araqwith more syntax that's special in templates
21:50:02*gsingh93_ quit (Ping timeout: 264 seconds)
21:50:34Araqwith macros the level of operation is different. you only need more .compiletime procs, not more and more features
21:50:53BlaXpiriti don't want to write goddamn trees
21:51:01BlaXpiritespecially with that unintuitive api
21:51:21Araqso use a template and getAst or parseExpr
21:51:42Araqcreating trees is easy enough, you're only showing your ignorance here
21:52:01BlaXpiritmaybe it's "easy" concept-wise
21:52:01*buMPnet quit (Remote host closed the connection)
21:52:15BlaXpiritit's just grunt work
21:52:22*buMPnet joined #nim
21:52:32Jehan_What I'd like to see (sometime in the future, not now) is pattern matching on macro argument ASTs.
21:52:58BlaXpiritI did not know about getAst, nor do I know what it does after reading about it
21:53:17AraqJehan_: that's a fair feature request, but that's destructuring of ASTs, BlaXpirit complains about AST construction
21:53:50Jehan_Araq: Yup, I realize that it's a separate issue. But then, AST construction is no big deal in general.
21:53:50BlaXpiritok so i could make a template to construct a tree and use getAst
21:53:55Jehan_At least not for me.
21:54:05Jehan_And for what I need.
21:54:10Jehan_Don't want to generalize.
21:54:24BlaXpiritalso unreadable
21:54:51BlaXpiritparseExpr is fine but it's isolated
21:56:05dom96what about quote?
21:56:26BlaXpiritnow that's something
21:57:00BlaXpirityes, yes, yes!
21:57:21BlaXpirit[:46:33] <BlaXpirit> maybe macros should be what they are, but also allow functionality of templates instead of writing trees manually
21:57:26BlaXpiritthat's quote, right there
21:58:03BlaXpiritthank you
21:58:14BlaXpiritmaybe it's time to read the whole docs of macros module
21:59:08OnOokie, I am going to meet mr sandman, thanks again for great discussion, cya
21:59:09Jehan_BlaXpirit: You didn't know about quote?
21:59:15BlaXpiritI didn't know
21:59:23*buMPnet quit (Remote host closed the connection)
21:59:28BlaXpiritare you surprised?
21:59:30Jehan_Gotcha. :)
21:59:37BlaXpiriti didn't go to macros boot camp
21:59:39*buMPnet joined #nim
21:59:40Jehan_No, I had just assumed you did.
21:59:53*OnO quit (Quit: Textual IRC Client: www.textualapp.com)
22:00:13Jehan_That wasn't a "you should know" remark but "oh, that's why he found ast construction tedious" remark.
22:00:23BlaXpiritI said I am missing the exact functionality of quote
22:00:35BlaXpiritthank goodness dom understood me
22:01:00*pregressive quit (Remote host closed the connection)
22:01:06Jehan_It's midnight here, my brain is running at 50% capacity at best. :)
22:01:36*gsingh93 quit (Ping timeout: 250 seconds)
22:02:04dom96BlaXpirit: I only read the last 3 sentences that you guys wrote :P
22:03:01Jehan_But yeah, my main problem is typically breaking down arguments into usable form.
22:04:22Jehan_Another problem is that I rarely need macros, so when I do need them, it takes some experimentation to figure out how they work again. :)
22:05:55dom96Sometimes the hardest thing for me with macros, is deciding whether the effort to write the macro outweighs the problems caused by copying and pasting code.
22:06:42Araqdom96: I think many will say this means the macro system is really well designed :P
22:07:06dom96It's much nicer now that quote actually works.
22:07:25dom96We still need a nicer way to generate these nodes though.
22:07:36dom96but that can be a nimble package
22:07:46BlaXpiritisn't quote the nicest way? i don't get it
22:10:20def-BlaXpirit: you can't build every AST with quote
22:10:29BlaXpiritwhy?
22:10:46def-for example a case-of with a variable amount of `of`s (i think)
22:11:37BlaXpiritwell maybe i can build one with a constant number of ofs and copt some nodes and whatnot
22:11:46BlaXpiritcopy*
22:12:34BlaXpiritoh i get it
22:12:43BlaXpiritquote + templating language? anyone?
22:13:24dom96You can't for example do:
22:13:30dom96node.add quote do:
22:13:36dom96 of 0x11: foo()
22:13:48dom96Because an 'of' needs a 'case'
22:13:50BlaXpirityes, that's fine
22:13:58dom96it's a problem if you already have a case generated
22:14:25dom96basically means I had to do this: https://github.com/dom96/gbemulator/blob/master/cpu2.nim#L835
22:14:34BlaXpiritcheck this out
22:14:35dom96(Github really butchers the syntax highlighting on that)
22:14:36BlaXpiritcase x
22:14:37BlaXpirit {% for i in 0..10 %}
22:14:39BlaXpirit of `i`: foo()
22:16:19BlaXpiritah quote is magic.. of cours
22:16:58Araqthat is exactly the "more template voodoo solution" that ends up as a never ending feature request
22:17:33BlaXpirit?
22:17:40BlaXpiritthis is the best kind of templates
22:18:24BlaXpiritrg
22:18:28BlaXpiritthe real templates
22:18:59Araqwell if you stop there, it's still not powerful enough
22:19:30BlaXpiritpoint is to intertwine nim code and `quote`
22:20:16BlaXpiritin fact, it's the templates that should be extended with this functionality
22:20:31BlaXpiritbecause yes, sometimes this is not powerful enough
22:22:16BlaXpiriti'm having a hard time coming up with a difference between a template and a macro that just invokes quote
22:22:28BlaXpiritis that what it is?
22:22:46BlaXpiritno... no... f course, we have inject and other things
22:23:07*saml quit (Remote host closed the connection)
22:25:51reactormonkAraq, got the gc stuff, but never ran it
22:26:52reactormonkalso, how should I implement different serialization formats for nimsuggest? global variables?
22:26:56*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:31:01*user7181 quit (Quit: leaving)
22:32:00*banister joined #nim
22:36:50*mwbrown quit (Ping timeout: 264 seconds)
22:39:43*Kingsquee quit (Quit: Konversation terminated!)
23:00:00*Matthias247 quit (Read error: Connection reset by peer)
23:01:24*pregressive joined #nim
23:13:18a5iping dom96 ?
23:13:23dom96sup
23:13:45a5iI'm really like Ruby, so thats I'm with Crystal
23:14:22a5inothing against Nim tho, its a very nice language I've been following
23:14:38a5i* to anser your question from hours earlier
23:16:35BlaXpiritdoes nim have "exec"?
23:16:57BlaXpiritan equivalent to writing text to a file and importing it
23:17:31BlaXpiritno
23:17:40BlaXpiritan equivalent to writing a text file and including it
23:19:22*saml_ joined #nim
23:20:12a5idom96, I actually hope to get into Nim soon
23:20:49dom96a5i: ahh. No prob.
23:35:12*Jehan_ quit (Quit: Leaving)
23:39:20filwitBlaXpirit: write to a file in a 'static' block then import it? (havent tried)
23:39:38BlaXpiritfilwit, i don't want to write a file
23:39:48BlaXpiriti want to execute a string of nim code at compiletime
23:42:20filwitwell you can execute any nim code at compile time of course.. but yeah, dunno how to load a string and execute it all at compile time.. maybe some trick with a macro which builds a macro..
23:42:57BlaXpiriti've tried :/
23:43:17BlaXpiritmacro that invokes parseStmt and returns stmt
23:44:42BlaXpiritproblem is... the macro can't accept a string
23:45:04filwitmake it a static[string]
23:45:54BlaXpiritoho
23:46:28BlaXpiritnope
23:47:10BlaXpiritundeclared identifier: '��'
23:47:59BlaXpiritit works
23:48:00BlaXpirit!!!
23:48:02BlaXpiritthxc
23:49:48filwityeah i just got it to work too
23:50:32*Trustable quit (Remote host closed the connection)
23:51:12filwitBlaXpirit: just to be clear, here's what I did: https://gist.github.com/PhilipWitte/d1a382c8f21d10064fa2
23:51:35BlaXpiritwhy is that needed?
23:51:44filwitidk... good point
23:51:48BlaXpiritand not just macro with parsestmt
23:51:56filwityeah i was thinking wrong
23:52:49BlaXpiritwait
23:52:56BlaXpiritmacro with parsestmt executes it at runtime
23:53:11BlaXpiritloool
23:54:12filwitidk what you mean, but this works: https://gist.github.com/PhilipWitte/d1a382c8f21d10064fa2
23:54:29filwiti mean, you wanted this to happen at compile-time right?
23:54:46BlaXpirit[:39:46] <BlaXpirit> i want to execute a string of nim code at compiletime
23:55:38BlaXpiriti want to execute a compiletime string of nim code at compiletime
23:55:40filwitah right, that's why i was making a macro which returned a template.. so you could call the template from some other compile-time function..
23:55:53BlaXpiritand we invented a way to execute a compiletime string of nim code at runtime
23:56:05filwitone sec
23:56:07BlaXpiritaha, filwit
23:57:07filwityeah it works: https://gist.github.com/PhilipWitte/d1a382c8f21d10064fa2
23:57:35BlaXpiritappears so, filwit.
23:58:03BlaXpiritbut omg what is this
23:58:03filwitof course it defines some function you need to call by name, but I'm sure something like this can be adapted to your purpose