<< 25-03-2015 >>

00:01:44EXetoCI meant, carry on as normal if not explicitly caught. --optimism would be fitting too. or would exception handling have to be omitted completely?
00:04:58*jholland quit (Quit: Connection closed for inactivity)
00:07:19*gsingh93 quit (Ping timeout: 255 seconds)
00:13:14*bretthart quit (Ping timeout: 265 seconds)
00:16:59*dhasenan joined #nim
00:19:26BlaXpirit_amazing
00:19:44def-BlaXpirit_: what's amazing?
00:19:50BlaXpirit_Jehan gives amazing ideas
00:20:20*boydgreenfield joined #nim
00:22:02boydgreenfieldHas anyone else had trouble with threads and passing a ptr to a channel to them? (as in here: http://forum.nim-lang.org/t/959#5825) I’m having an issue where I get segfaults on ubuntu but everything works very nicely with no warnings on OS X. Are there any known issues here?
00:23:41*HakanD________ joined #nim
00:24:53fowlboydgreenfield, it works on the web repl thing
00:25:31fowlit also works for me (windows)
00:25:58*irrequietus quit ()
00:27:37boydgreenfieldfowl: What’s the web repl thing!?
00:27:40boydgreenfield(that sounds fantastic)
00:27:44fowlhttp://185.56.186.94/#/
00:27:51boydgreenfieldYa… it works for me on OS X too, but it crashes on CircleCI
00:27:53fowlekarlso's project
00:28:07*HakanD________ quit (Ping timeout: 256 seconds)
00:28:12*gokr quit (Quit: Leaving.)
00:28:26def-boydgreenfield: same Nim compiler version on CircleCI?
00:28:58*CryptoToad quit (Quit: Leaving)
00:29:00boydgreenfielddef-: Appears to be, though I can’t find the exact commit on my local install. 0.10.2.
00:30:07boydgreenfieldIncidentally, the linked to ptr example does work… but mine doesn’t and that’s the only place I use a ptr, and the addition of the channel is the only change. Error is the following: `*** Error in `./mg': free(): invalid pointer: 0x00007fff358829a0 ***`
00:30:15boydgreenfieldi’ll try installing the latest devel to see what happens
00:36:13*a5i joined #nim
00:37:23*gsingh93 joined #nim
00:38:18*brson quit (Quit: leaving)
00:47:26boydgreenfieldWell, definitely segfaults reliably on Ubuntu (just reproduced locally in a Docker container). Now for some debugging… Is there a recommended best practice for passing Channels to Threads?
00:57:39*BlaXpirit_ quit (Quit: Quit Konversation)
00:58:32*brson joined #nim
00:59:51*brson quit (Client Quit)
01:21:57*johnsoft quit (Ping timeout: 256 seconds)
01:22:17*johnsoft joined #nim
01:23:42boydgreenfieldis this more detail on how `joinThreads` works internally, or best to just dive into the source? appears that my free() error is occurring there.
01:37:58boydgreenfielddef- / fowl: Any good recommendations on how to try to debug a double free issue? Fairly certain it relates to these channels, but having trouble pin-pointing it.
01:38:48*Demos joined #nim
01:43:39*bretthart joined #nim
01:51:38*saml_ joined #nim
02:08:16*bretthart quit (Ping timeout: 265 seconds)
02:11:42*banisterfiend quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
02:12:33*HakanD________ joined #nim
02:17:04*HakanD________ quit (Ping timeout: 252 seconds)
02:17:06*bcinman_ joined #nim
02:18:37*bcinman quit (Ping timeout: 256 seconds)
02:22:20*darkf joined #nim
02:36:24fowlboydgreenfield, sauce?
02:38:40fowlboydgreenfield, you can pass the channel id to the thread https://gist.github.com/fowlmouth/5cd8e28d513cd5b6ca20
02:45:49*ChrisMAN quit (Remote host closed the connection)
02:46:32*ChrisMAN joined #nim
03:09:14*jefus_ joined #nim
03:10:59*reem quit (Remote host closed the connection)
03:11:16*reem joined #nim
03:11:20*jefus quit (Ping timeout: 252 seconds)
03:12:53*reem quit (Remote host closed the connection)
03:28:25*Woflox quit (Ping timeout: 252 seconds)
03:28:38*untitaker quit (Ping timeout: 246 seconds)
03:28:38*federico3 quit (Ping timeout: 246 seconds)
03:28:55*federico3 joined #nim
03:29:33*dv- quit (Remote host closed the connection)
03:29:50*dv- joined #nim
03:30:12*untitaker joined #nim
03:44:46*fizzbooze joined #nim
03:58:22*HakanD________ joined #nim
04:02:35*HakanD________ quit (Ping timeout: 244 seconds)
04:39:50*Demos quit (Read error: Connection reset by peer)
04:53:11*a5i quit (Quit: Connection closed for inactivity)
04:59:06*HakanD________ joined #nim
05:03:30*HakanD________ quit (Ping timeout: 250 seconds)
05:21:27reactormonkany way to make an API like parse[int] vs. parseInt?
05:27:25*fizzbooze quit (Ping timeout: 264 seconds)
05:30:44boydgreenfieldfowl: That’s useful, maybe I can get that to work. Oddly just letting the program exit is fine on Linux, but when I try to terminate the thread by passing a special “abort” message and then calling joinThreads is when I get the segfault. Perhaps refactoring to use the IDs vs. thread pointers will help. (I have a bunch of complicated other objects getting passed, but I believe they’re all being properly deep copied, so I
05:30:45boydgreenfieldhope that’s not the issue)
05:39:53*silven joined #nim
05:54:17fowlreactormonk, implying you can parse an arbitrary T from a string?
05:54:27reactormonkfowl, yup
05:54:46reactormonkfowl, something similar to return type overloading, except explicitly
06:00:28*boydgreenfield quit (Quit: boydgreenfield)
06:05:19reactormonkkinda like haskell read "[1,2,3,4]" :: [Int]
06:08:38*saml_ quit (Quit: Leaving)
06:13:10*reem joined #nim
06:17:40*reem quit (Ping timeout: 265 seconds)
06:23:01fowlreactormonk, we can do better than typeinfo and marshal now with macros.getType
06:23:19reactormonkfowl, go on...
06:23:34fowlyou know how `==` doesnt work for variant objects
06:23:40reactormonknope
06:24:25fowlwell it doesnt, though it seems like it should right
06:25:46reactormonkgimme sample code
06:26:57fowl.eval type maybe[t] = object case has:bool of true: val: t else: nil; var m1: maybe[int]; echo m1 == m1
06:28:51*charmander is now known as dtscode
06:29:06reactormonkError: parallel 'fields' iterator does not work for 'case' objects
06:29:08reactormonkthat's what I get
06:29:16fowlreactormonk, that wont compile, but its easy to fix if a macro can look up an object type, get its field names and types... https://gist.github.com/fowlmouth/9b9010397ad5fe4b9872#file-xeq-nim
06:31:25reactormonkfowl, I remember macro.getType appearing somewhere last week?
06:32:02fowli dunno, its very new
06:32:08*bretthart joined #nim
06:32:44*Woflox joined #nim
06:47:44*HakanD________ joined #nim
06:52:17*HakanD________ quit (Ping timeout: 252 seconds)
07:21:32*bcinman_ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
07:32:29*reem joined #nim
07:33:30*dv- quit (Changing host)
07:33:30*dv- joined #nim
07:33:53*phira quit (Quit: ZNC - http://znc.sourceforge.net)
07:35:41*phira joined #nim
07:36:00*BlaXpirit joined #nim
07:40:16*HakanD________ joined #nim
07:40:19*bjz joined #nim
07:44:19*reem quit (Remote host closed the connection)
07:48:56*reem joined #nim
07:53:07*dashed joined #nim
07:55:31*dyu joined #nim
07:55:58*reem quit (Remote host closed the connection)
07:56:55*reem joined #nim
07:59:23*gokr joined #nim
08:00:25*bjz quit (Ping timeout: 264 seconds)
08:08:46*Trustable joined #nim
08:15:51*gsingh93 quit (Quit: WeeChat 1.1.1)
08:21:48*Ven joined #nim
08:24:32BlaXpiriti don't know why i assumed marshal.store would be a binary format
08:29:33*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
08:32:08*Ven joined #nim
08:54:12*BlaXpirit_ joined #nim
08:54:54*BlaXpirit quit (Ping timeout: 252 seconds)
08:56:01*BlaXpirit_ quit (Client Quit)
08:56:17*BlaXpirit joined #nim
09:08:31*reem quit (Remote host closed the connection)
09:08:44*bretthart quit (Ping timeout: 256 seconds)
09:13:46*bretthart joined #nim
09:17:10*Sembei joined #nim
09:21:46*bretthart quit (Ping timeout: 256 seconds)
09:26:10dtscodeto throw off future BlaXpirit
09:28:30*reem joined #nim
09:31:33EXetoC:o
09:46:07*reem quit (Remote host closed the connection)
09:46:42*bretthart joined #nim
09:47:17*reem joined #nim
09:50:49*irrequietus joined #nim
10:01:01BlaXpiritlib/system.nim(143, 40) Warning: unknown magic 'Addr' might crash the compiler [UnknownMagic]
10:01:03BlaXpiritokaaaaay
10:07:28*matkuki joined #nim
10:11:45BlaXpiriti know i'm pushing against the boundaries of the compiler
10:12:32EXetoCwhat are you doing?
10:12:43BlaXpiritstill working on nim-random...
10:13:24EXetoCok
10:13:29EXetoCthat warning can appear with a bad compiler/csources combination
10:13:58BlaXpirithm that's possible
10:16:49BlaXpiritwelp, i updated to the latest devel
10:16:56BlaXpiritnow it doesn't compile at all T_T
10:17:26BlaXpiritcompiler crashes
10:17:58gokrfowl: There?
10:18:36*MyMind quit (Read error: Connection reset by peer)
10:18:38gokrI think you did some slick macro thingy the other day, was it something with tuples? I just recall it looked neat
10:19:16EXetoCBlaXpirit: works for me. how old is your csources?
10:19:34*MyMind joined #nim
10:19:34BlaXpiritno, everything is up to date and good
10:19:40BlaXpiritjust that my program doesnt compile
10:19:47EXetoCok
10:20:03BlaXpiritdoesnt compile because compiler crashes Error: execution of an external program failed; rerun with --parallelBuild:1 to see the error message
10:21:15EXetoCand if you include that? did you build the compiler without -d:release?
10:21:27EXetoC"./koch temp" will generate bin/nim_temp
10:21:47BlaXpiritwhat's that do?
10:22:46EXetoCthat's the only difference compared to "./koch boot", in case you built with -d:release and want to test without it in order to get a compiler stack trace
10:22:55BlaXpiritah, first time i see --parallelBuild:1 actually do something
10:23:11BlaXpiritrequest for member ‘ClEnv’ in something not a structure or union
10:23:26EXetoCit usually does something for me. having to add it all the time is annoying though
10:23:48EXetoCinvalid C code generated?
10:24:02*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 36.0.4/20150320202338])
10:24:10BlaXpiritthis definitely looks like a regression
10:24:23BlaXpiritmay be hard to reproduce
10:25:21EXetoCthere's no need to try too hard
10:31:55*reem quit (Ping timeout: 255 seconds)
10:32:06EXetoCin contrast with bug reports for certain other projects where said test case must be reduced as much as possible almost. that's just pedantic
10:32:34BlaXpiritnah dude, my lib is crazy convoluted, can't just link to it
10:32:50BlaXpiriti'm having success reproducing, it's definitely related to generic/concept
10:34:30EXetoCit's fine, if you can't reproduce. I think I still have an unfinished widget toolkit in the tests directory
10:42:37*bjz joined #nim
10:44:14*dashed quit (Quit: Connection closed for inactivity)
10:47:18*Sembei quit (Max SendQ exceeded)
10:48:57*Sembei joined #nim
10:53:57*matkuki joined #nim
10:54:46*arnetheduck joined #nim
10:54:49matkukiDo non-ref objects have any performance penalty vs tuples?
10:55:49BlaXpiritno
10:56:18matkukiBlaXpirit: Thanks.
10:57:34matkukiHave a tuple Line(x, y: Position) that needs extra fields, so was wondering.
10:58:41*bjz quit (Ping timeout: 252 seconds)
11:01:58*HakanD_________ joined #nim
11:01:58*HakanD________ quit (Read error: Connection reset by peer)
11:02:36EXetoCok well the difference is purely syntactical
11:06:36EXetoCbasically
11:10:11matkukiGot it.
11:27:52*bjz joined #nim
11:44:34*bretthart quit (Ping timeout: 256 seconds)
12:08:34*Woflox quit (Read error: Connection reset by peer)
12:16:36BlaXpiritwhat's wrong with iteration here? https://bpaste.net/show/997dbf299e7d
12:18:11def-BlaXpirit: You can only know that an iterator is finished after it is finished
12:18:23BlaXpirit???
12:18:43BlaXpiritso i need to account for that zero
12:18:45def-no
12:19:01EXetoCit also yields 'result'
12:19:12EXetoCapparently
12:19:21BlaXpiriti see what you mean
12:19:39BlaXpiritfixed: https://bpaste.net/show/941557c9a5ca
12:19:53def-or just like this: for x in iter(): result.add(x)
12:20:12BlaXpiriti know but this is a contrived example, i actually need to partially iterate
12:20:15def-ok
12:20:37BlaXpiritthanks
12:20:53EXetoCa userland iterator trait would be nice
12:21:23BlaXpiritbut damn, this behavior sucks
12:25:41def-BlaXpirit: i don't see how it could be done differently in a reasonable way
12:26:02def-BlaXpirit: you'd have to look one step ahead in the iterator and buffer the result
12:26:10BlaXpiritwell the only reasonable way i can imagine is like in my first paste
12:26:16BlaXpiritno, def-
12:26:37BlaXpiriti am checking for finished after the iterator is finished
12:26:39def-how do you know the iterator is finished without running it again after a yield?
12:26:49BlaXpiritbut it doesn't work
12:27:00def-maybe there will be another yield?
12:27:02BlaXpiritit says finished only after i get one fake item
12:27:15EXetoCyes in your example
12:27:19BlaXpiritdef-, please, i'm not stupid. consider the first example again.
12:27:49def-BlaXpirit: but I'm stupid and don't see how that would work
12:27:58BlaXpirithow what would work
12:28:06BlaXpirititerator gives 1 2 3
12:28:32BlaXpiritstart. finished? no. get 1. finished? no. get 2. finished? no. get 3. finished? no. get fake 0. finished? yes.
12:28:40BlaXpiritthat's how the first example works
12:31:03EXetoCit's very unintuitive
12:32:26BlaXpiriti'm pretty sure this is a bug
12:32:41BlaXpiriteven the manual has it like in my first example
12:35:24BlaXpiritdamn now i get it
12:35:34BlaXpiritok i am, after all, stupid
12:38:03EXetoCbut why retrieve an "item" for no reason?
12:38:23BlaXpiritthere may be some actions after the final yield
12:38:32BlaXpirititerator has not yet ended after the final yield
12:39:18BlaXpiritthe final yield, like all other yields, pauses execution
12:39:49BlaXpiritso u need to bump the iterator again, but you can't know if will be finished before you bump it
12:40:46BlaXpiritwelp, now i ran into Error: internal error: (filename: compiler/lowerings.nim, line: 128) for which parallelbuild doesn't help
12:41:23EXetoCit still seems odd to me, and I'd like to have a go at a userland implementation.
12:42:12EXetoCare there any benefits of having it in the form of a language feature though? assuming that "traits" are working
12:43:14BlaXpiritno idea how you want to pause execution without a language feature
12:46:27EXetoCjust, stop advancing the iterator at any given moment
12:47:35*matkuki quit (Quit: ChatZilla 0.9.91.1 [Firefox 36.0.4/20150320202338])
12:50:02*jefus_ is now known as jefus
12:51:45EXetoC1. add an iterator interface 2. expand "for x in stuff: ..." to "__iter = stuff.iter; while !iter.done: x = __iter(); ..." ??
12:53:14EXetoCnot that Araq seemed to care, but I'll give it ago anyway
12:53:15*mwbrown joined #nim
12:53:33BlaXpirityou can't pause execution
12:54:08BlaXpiritalthough
12:54:16BlaXpirityah, it may be possible, ok
12:55:39*Stefan_____ joined #nim
12:59:02*mpthrapp joined #nim
12:59:41*a5i joined #nim
12:59:48Stefan_____I have a multiline string. I want to indent that text block, that is insert a number of spaces at the beginning of each line. There is strutils.unindent and strutils.replace. Does that help. And I do not see an insert(), i.e. insert a substring at position 7?
13:02:48EXetoCStefan_____: insert is defined in system
13:04:11BlaXpiritStefan_____, regex is an option
13:04:25BlaXpiritreplace "^" with " "
13:04:42BlaXpiritexcept stdlib re will probably infinitely loop on that :|
13:05:08Stefan_____Ah thanks. So I may replace "\n" with "\n " and insert " " at the beginning of the string. Yes regex is possible, but maybe not the fastest.
13:05:14EXetoC.eval
13:05:41EXetoCjust prepend spaces to each line?
13:05:56EXetoCnvm I was thinking of string literals
13:06:40BlaXpiritoh right, no need for regex
13:06:55EXetoCa for loop iterating over the lines?
13:08:38Stefan_____Maybe I should tell what I am doing: It is related to macro construction (glib macro) -- I have to insert some lines of code in the middle of the macro. That code needs well defined indent.
13:08:38EXetoC'map' can't be used for strings apparently
13:08:59Stefan_____Thanks for your suggestions, that should work.
13:09:38EXetoCa recursive proc that takes an integer representing the indentation level?
13:11:48*Stefan_____ quit ()
13:29:07*jfchevrette joined #nim
13:29:08*TEttinger quit (Ping timeout: 246 seconds)
13:35:07*reem joined #nim
13:37:38*nimnoob123 joined #nim
13:39:20nimnoob123Quick question: https://github.com/nim-lang/sdl2/blob/master/src/sdl2.nim#L661, how come I can call the close proc on RWopsPtr as: myrwop.close, but not as myrwop.close() ?
13:39:39*reem quit (Ping timeout: 252 seconds)
13:39:39*mwbrown quit (Ping timeout: 252 seconds)
13:39:53BlaXpiritnimnoob123, you must be mistaken
13:40:04nimnoob123enlighten me
13:40:22BlaXpiritwait what
13:40:25BlaXpiritthis is not a proc
13:40:26EXetoCmyrwop[].close()?
13:40:32BlaXpiritwait, it is
13:40:36nimnoob123it is a proc
13:41:05BlaXpiritthis is actually interesting
13:41:30nimnoob123i get a compiler error if i call it with parenthesis w/ the latest devel
13:42:03BlaXpiritreport
13:42:09nimnoob123let me show you my source maybe it's something to do w/ my code
13:42:16BlaXpiritwithout parentheses you are not actually calling it
13:42:25BlaXpiritnimnoob123, or i can report it if u want
13:42:37nimnoob123ill report it, but let me show you this code
13:42:41BlaXpiritexample is
13:42:42BlaXpirittype T = ref object; close*: proc (context: T);T().close()
13:43:26nimnoob123https://gist.github.com/G4MR/327074ceb2b8c7a04826
13:43:45nimnoob123near the bottom
13:44:56BlaXpiritso?
13:45:29nimnoob123sorry, so?
13:45:39BlaXpirit.eval type T = ref object; f: proc(t: T)
13:46:20nimnoob123actually, go ahead and report it. I have some things to do. <BlaXpirit> nimnoob123, or i can report it if u want
13:46:24BlaXpiritthis code causes compiler crash
13:46:26BlaXpiritwhat the.
13:46:46EXetoCbugs. weird innit
13:47:13BlaXpiriti don't even need to call close
13:47:15BlaXpiritor whatever
13:47:24BlaXpiritit just crashes as is
13:48:46EXetoCok so the compiler *does* accept code from stdin
13:49:48EXetoCwith the usual '-' convention
13:50:05BlaXpiritEXetoC, that was a recent change
13:50:20BlaXpiritby def?
13:50:23def-yes
13:50:51EXetoCoh ok. I think that was the first time I tried it, and it was by accident. weird innit
13:51:02EXetoCdef-: great d(:)|<
13:51:09BlaXpiritnimnoob123, you aren't providing an argument :o
13:51:19nimnoob123it doesn't require one?
13:51:49EXetoChuh
13:52:00nimnoob123I'd love to stay and chat, but I have to get some work done.
13:52:02BlaXpiritclose*: proc (context: RWopsPtr): cint
13:52:15EXetoCI didn't pay attention to that, since he claimed that "foo.bar" compiled
13:52:16BlaXpiritthere is clearly an argument it wants
13:52:23EXetoCI wonder which 'close' is invoked then
13:52:28BlaXpiritit is not invoked
13:52:35BlaXpirithe just obtains the proc and doesnt call it
13:52:47nimnoob123yeah it wants the rwop which i call as self.rw.close() is that not how I'm supposed to call it?
13:53:04BlaXpiritclose takes argument
13:53:07EXetoCok so he assigned to a var then
13:53:30BlaXpirit(self.rw.close)(self)
13:53:43BlaXpiritno idea which of them should be self and which shouldn't
13:53:45nimnoob123i'm fairly certain im not retarded
13:53:55BlaXpiritSDL is fun -_-
13:53:59nimnoob123close*: proc (context: RWopsPtr): cint, but that should be callable from the rwop object itself
13:54:14BlaXpiritit's a variable
13:55:01nimnoob123it's a variable function similar to how I do it here: https://gist.github.com/G4MR/195693539e9ee6bae852 w/out issue here https://gist.github.com/G4MR/be9951d312bebebc8fbb
13:55:24nimnoob123vtable is what i think they call it or w/e
13:55:25*banister joined #nim
13:55:37BlaXpiritwhy do people keep bothering with sdl, i have no idea
13:55:45nimnoob123what's wrong with sdl?
13:56:00EXetoCrwopsPtr.close(rwopsPtr)?
13:56:34nimnoob123so how come I can call it without an argument and w/o parenthesis?
13:56:40BlaXpirityou are not calling it
13:56:43BlaXpiritit's a variable
13:56:47BlaXpirityou're reading a variable
13:56:48nimnoob123lol like I said, i'd love to stay and chat, but I have 4 minutes to get ready for work :D
13:56:56EXetoC"rwops.close" should yield "proc (context: RWopsPtr): cint"
13:57:03EXetoCok later
13:57:12nimnoob123im reading a variable which so happens to be a proc
13:57:16nimnoob123what
13:57:21*nimnoob123 quit (Quit: Page closed)
13:57:56EXetoCjust wait until after work then -.-
14:05:56arnetheduckif I have a seq[int], what's the easiest way to convert that into a seq[string] (applying $ to each element)..?
14:06:12def-arnetheduck: xs.map(`$`)?
14:06:58arnetheduckthanks, I keep looking for a list comprehension operator :/
14:07:18def-right, $ is not procvar. I really think it would be nice to have everything as procvar by default
14:07:24def-arnetheduck: list comprehensions are in the future module
14:08:00arnetheduckmm,.. map doesn't work
14:08:19def-yes, because `$` is not a procvar (but I think Araq considers making everything a procvar by default soon)
14:08:28def-var ys = xs.map(proc (x: int): string = $x)
14:09:21EXetoCdef-: so there'll still be something called procvar. will it be possible to omit it then? and why was it introduced in the first place?
14:09:25def-var ys = lc[$x | (x <- xs), string]
14:09:30BlaXpiritvar ys = xs.map((x: int) => $x)
14:09:43BlaXpiritlc is just lame :|
14:10:43def-EXetoC: It was introduced because having procvars over module boundaries causes problems with adding optional parameters to a proc later on
14:10:49def-I think
14:11:24arnetheduck=>, is that from some non-default module? getting undeclared indentifier
14:11:29def-arnetheduck: future module
14:11:43def-it's nicer syntax for what I wrote
14:11:51EXetoCsweet sugar
14:21:34arnetheduckok, that worked, thanks!
14:22:41def-I think we really need two things in this direction, procvar by default and a shorter way for anonymous procs, something like xs.map($_) where _ is a special symbol (there's an issue about both I believe)
14:30:33*bcinman joined #nim
14:31:34*Jehan_ joined #nim
14:33:26*brson joined #nim
14:41:22*untitaker quit (Ping timeout: 256 seconds)
14:47:02gokrToo late for filwit to get me a paper cutout crown...
14:47:02*untitaker joined #nim
14:52:13BlaXpirit:s
14:53:15EXetoChow did he die?
15:00:14BlaXpirithmm how to turn seq to set?
15:01:20BlaXpiriti guess with an incl loop
15:01:54def-toSet if you're talking about the sets module
15:02:22BlaXpiriti'd use that module but its sets are unhashable
15:02:37def-can't you implement hash for them?
15:02:45BlaXpiritit would probably require sort
15:02:51BlaXpiritif you think about it
15:02:53def-right
15:03:09BlaXpiritso it's horribly costly, so it makes sense it's not there
15:03:19BlaXpiriti dont need it here anyway
15:05:09*gokr quit (Ping timeout: 250 seconds)
15:09:34*jefus_ joined #nim
15:13:36*jefus quit (Ping timeout: 264 seconds)
15:13:47*brson quit (Quit: leaving)
15:14:03*brson joined #nim
15:29:00*Sembei quit (Max SendQ exceeded)
15:30:07BlaXpiritflaviu, randomPrecise seems to be failing chi square test more often than any other part of the lib
15:30:17*Sembei joined #nim
15:33:28Jehan_BlaXpirit: Just so you know, I did get your email, but am kinda busy this week, so probably not going to respond in any detail for a while.
15:33:43BlaXpiritok, Jehan_
15:33:59BlaXpiriti basically sticked to the old algorithm but without sorting
15:35:28Jehan_BlaXpirit: *nod*
15:38:30*brson quit (Quit: leaving)
15:39:13EXetoChow do I pass an undeclared identifier to a macro? I can do only it with a template by using immediate as shown in the manual
15:41:06EXetoCwait
15:41:08BlaXpiritEXetoC, sure you can pass it
15:41:12BlaXpiritit's an error somewhere else
15:41:48EXetoCyep
15:44:05Jehan_Macros can be immediate, too.
15:44:31Jehan_Though Araq has mentioned redoing those semantics, so I'm not sure how future-proof that is.
15:47:50*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
15:57:04EXetoCyes it works now
16:03:43*Ven joined #nim
16:07:40*darkf quit (Quit: Leaving)
16:13:34*jefus_ is now known as jefus
16:22:35*pregressive joined #nim
16:25:42*gokr joined #nim
16:25:52*gokr left #nim (#nim)
16:50:35*gokr joined #nim
16:50:46*gokr left #nim (#nim)
16:53:37*sampwing joined #nim
16:59:36*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:09:09*fizzbooze joined #nim
17:13:22*Jehan_ quit (Quit: Leaving)
17:17:32*gsingh93 joined #nim
17:42:54*CryptoToad joined #nim
17:47:30*shodan45 quit (Quit: Konversation terminated!)
17:52:49EXetoCAraq: so, two of these should not cause a collison? "newVarStmt(newIdentNode($genSym()), newIntLitNode(0))"
17:56:27EXetoCwait
17:56:29*fizzbooze quit (Ping timeout: 244 seconds)
17:57:12EXetoCgetting more confused than usual. it's just difficult to figure out how to convert to the right type at times
17:58:49EXetoCI need to get myself a rubber duck already
18:00:27*Trustable quit (Remote host closed the connection)
18:02:48BlaXpiriteven using this channel as a rubber duck can be useful for others if u write the solution
18:10:28*Sembei quit (Ping timeout: 256 seconds)
18:11:57*wink-s joined #nim
18:12:58*emilsp quit (Remote host closed the connection)
18:15:48*jholland joined #nim
18:17:25wink-sI created a module which makes a Table public I then tried to use the module printing out the public Table, I got an obscure error: "lib/system.nim(1952, 16) Error: undeclared identifier: 'data'"
18:17:53*buMPnet_ quit (Read error: Connection reset by peer)
18:18:42*buMPnet joined #nim
18:18:56wink-sTurns out the problem was I has to import Table as well as my module in the test app. That surprised me, is there a way have the user of a module automatically get the dependent modules imported?
18:20:44EXetoCexport <module>
18:20:49EXetoCor a list of symbols from that module
18:21:26EXetoCit seems to be a rare thing to do. I don't know if this is a convention
18:24:07flyxhow do I generate a "static:" section in a macro?
18:24:34flyxnnkStaticStmt seems to be something different
18:24:38flyxisn't it?
18:25:16*totz joined #nim
18:25:40*totz left #nim (#nim)
18:25:55*ghfdj joined #nim
18:27:51*ghfdj left #nim (#nim)
18:28:56BlaXpiritif i had to guess, the name indicates that it's exactly it
18:29:20BlaXpirityou seem to be forgetting that you can generate the tree for a piece of code and just see
18:29:34EXetoCyep
18:30:20EXetoCmacro m(e: expr): stmt = echo e[0].kind
18:30:28CryptoToadCan anyone see how I'm being an idiot with function pointers? http://hastebin.com/kutemorile.pas
18:30:38EXetoCthen you can do "m: static: echo 1"
18:30:42BlaXpiritno, i actually can't see
18:30:55EXetoCwith some newlines and indents thrown in
18:31:01BlaXpiritanything in that lame pastebin
18:31:05def-CryptoToad: findFirstFileW()?
18:31:54CryptoToadlel i'll use real pastebin then. def- it just gives me another error sec
18:32:01flyxI tried with treeRepr, but it outputs a DiscardStmt
18:32:04BlaXpiritwhy dont you give the definition of findfirstfilew
18:32:04EXetoCthough the output of treeRepr should be logical, but I thought I'd try that
18:32:17EXetoCflyx: huh
18:32:32EXetoCwith that exact code? and how recent is your compiler build?
18:33:15def-flyx: works on the current devel branch
18:34:06flyxhttps://gist.github.com/flyx/40784d17c99f02e1dda1
18:34:19def-flyx: nono, use dumpTree:
18:34:24def-flyx: or make the macro immediate
18:34:28flyxah
18:34:40def-because the macro is probably invoked after the static block is done
18:35:07EXetoCworks with expr
18:35:25CryptoToadhttp://pastebin.com/R45r5q9v when i use parernthesis, and when using the type it says in the error i get Error: type expected
18:35:31flyxokay, works now. I guess I need to make the macro creating the node also immediate then
18:35:40EXetoCok. good to know
18:35:49EXetoCgotta grind these things
18:36:00BlaXpirittime to learn macros
18:36:03BlaXpiritany good resources?
18:36:23flyxtrial & error
18:36:39flyxI wrote all my macros like that
18:36:50def-I started a macro tutorial, but never finished
18:36:58wink-sEXetoc: txs, using export worked!
18:40:03def-flyx: Here's 3 ways to do this: https://gist.github.com/def-/f3121f0d4c0e8a294b67
18:41:15EXetoCalways such trivial mistakes
18:41:25EXetoCAraq: nevermind
18:42:52def-CryptoToad: sorry, don't have windows to try this, but looks like no () after all if you want a procvar
18:43:25def-type fptrFF = proc(lpFileName: string, lpFindFileData: LPWIN32_FIND_DATA): THandle
18:44:35EXetoCthere we go, simple forEach macro
18:44:53EXetoCno need for error handling, right? can't spoonfeed too much
18:45:37EXetoCforEach for userland iterators that is
18:47:23*fizzbooze joined #nim
18:47:41CryptoToadError: ambiguous identifier: 'THandle' -- use a qualifier < this seems like a compiler bug?
18:48:37CryptoToadusing nevermind that worked for that line
18:49:54CryptoToadError: type mismatch: got (proc (WideCString, var TWIN32_FIND_DATA): THandle{.stdcall.}) but expected 'fptrFF'
18:50:28CryptoToadoh weird the args are different types
18:52:45CryptoToadMay be easier to just do this part in C.
18:54:55BlaXpiritmay be easier to give enough information for someone to help you
18:55:00*emilsp joined #nim
18:55:38EXetoCBlaXpirit: http://nim-by-example.github.io/oop_macro/ await in the standard lib, and so on
18:55:43CryptoToadit's literally 2 lines of code i'm having an issue with, not much else to it. I've sent everything that's causing problems.
18:56:12EXetoCresult.repr, macros.dumpTree, macros.treeRepr, macros.lispRepr
18:56:35EXetoCCryptoToad: ok
18:57:16flyxhmm. there was a proc to generate a new unique identifier, right? I'm too dumb to find it
18:57:46EXetoCCryptoToad: there's newWideCString
18:58:05EXetoCwait
18:59:08EXetoCcall the proc and you get a THandle
18:59:31*HakanD_________ quit (Ping timeout: 255 seconds)
19:00:15CryptoToadyes but i'm looking for a pointer to findFirstFile, all i found on nim func pointers was one quite old post here http://stackoverflow.com/questions/23479655/how-can-i-use-function-pointers-in-nimrod
19:00:17EXetoCstring != WideCString, and T != "var T"
19:00:40CryptoToadthe reason i got those is because it told me to use that type at first in another error lol
19:02:25EXetoCeither it was misleading or it was unrelated
19:03:12EXetoCwhat about "type fptrFF = proc(WideCString, var LPWIN32_FIND_DATA)"?
19:03:28EXetoC* "type fptrFF = proc(WideCString, var LPWIN32_FIND_DATA): THandle
19:04:43EXetoCapparently the argument names cannot be omitted, so keep them
19:06:19EXetoCminimal proc type example: "type P = proc(int); proc p(x: int) = discard; var x: P = p"
19:09:34CryptoToadtype fptrFF = proc(WideCString, var LPWIN32_FIND_DATA): THandle throws "Error: ')' expected" probably due to the "var" statement
19:10:55EXetoCCryptoToad: as I said previously, the argument names cannot be omitted, so add them back. I made a mistake there
19:14:51CryptoToadtype fptrFF = proc(lpFileName: WideCString, var lpFindFileData: LPWIN32_FIND_DATA): THandle throws the ) expected error, and without it tells me it needs a var statement
19:17:59EXetoCCryptoToad: 'var' comes after ':' for parameters
19:18:41CryptoToadahh that makes sense. Sorry to pollute this channel with all my noob lol.
19:22:02*HakanD_________ joined #nim
19:22:04EXetoCjust don't do that in #nim-offtopic. there we talk about lolcats and stuff
19:22:34*ChrisMAN quit (Remote host closed the connection)
19:23:37flyxare there examples on how to use genSym? can I just replace ident nodes with a result of gensym?
19:26:37EXetoChere's one: newVarStmt(genSym(nskVar, "foo"), newIntLitNode(0))
19:27:40flyxwhat does the second parameter do?
19:27:57flyxI mean, if I give it an ident, how can I assure that it's not used anywhere else?
19:28:15EXetoCno idea, but I left it at the default
19:28:18EXetoCflyx: yep
19:33:42flyxthis gets me a segfault, not sure why: https://gist.github.com/flyx/ed2c724da28c273a795c
19:34:01flyxwell actually, adding that to the result syntax tree of my macro does.
19:43:05EXetoCI don't know what the AST is supposed to be
19:44:48flyxwell, usually there should be an ident where I put the sym
19:45:08EXetoC"dumpTree: type T = object of U" is that the AST you're after?
19:45:19flyxyes
19:46:54EXetoCdumpTree can help you figure out what to do. I think it needs to be the second child, but you're making it the first child
19:48:16flyxwhat would be the first child then? dumpTree gives the Ident T as first child
19:48:51EXetoCyes, that part is correct, but not the ObjectTy part
19:49:17EXetoCif you compare it with the output of objectInherit.repr
19:51:07*fizzbooze quit (Ping timeout: 265 seconds)
19:51:42flyxah yes
19:51:49flyxwhen I add all the empty nodes, it works
19:51:56flyxI didn't think that would be necessary
19:57:38EXetoCI suppose the order could be arbitrary in some cases, except then it doesn't correspond to the order required in source code
20:00:34*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
20:00:37*sampwing quit (Ping timeout: 252 seconds)
20:01:09*bcinman joined #nim
20:02:35*fizzbooze joined #nim
20:02:55*sampwing joined #nim
20:08:08*jfchevrette quit (Ping timeout: 246 seconds)
20:09:12*milosn quit (Read error: Connection reset by peer)
20:12:59*milosn joined #nim
20:13:11*a5i quit (Quit: Connection closed for inactivity)
20:18:23*BlaXpirit_ joined #nim
20:19:17*reem joined #nim
20:19:55*Matthias247 joined #nim
20:25:56BlaXpirit_there is some bug in aporia@#HEAD
20:26:05BlaXpirit_Unable to determine what action to take for nim
20:26:12BlaXpirit_because it has predefined name "nimrod"
20:34:21BlaXpirit_i asked a long time ago "Is there a way to invoke a macro on an include?"
20:34:31BlaXpirit_m: include f does NOT work
20:37:48EXetoCBlaXpirit_: it does seem to work
20:38:14BlaXpirit_nnkIncludeStmt very nice
20:38:27BlaXpirit_you mean it does seem to compile
20:38:32EXetoCdump it bra. check them outputz
20:38:41BlaXpirit_well i did
20:38:43BlaXpirit_nnkIncludeStmt
20:38:58EXetoC2. write usable macro 3. ??????? 4. wealth
20:39:34BlaXpirit_what are u talking about
20:39:36BlaXpirit_if it's impossible
20:40:01dom96EXetoC is right. I am bathing in gold after writing the async macro.
20:40:08EXetoCBlaXpirit_: what is?
20:40:18BlaXpirit_invoke a macro on a file/include
20:42:48BlaXpirit_ok something works
20:42:52BlaXpirit_if macro is not immediate
20:43:24BlaXpirit_gives nnkIncludeStmt then nnkStmtList
20:43:41EXetoCI was confused by that example of yours. you mean "m: <all code of a module>"?
20:44:16fowldom96, that thing is a beast
20:44:23BlaXpirit_that's basically what i want, EXetoC
20:44:32dom96fowl: :)
20:46:46fowlflyx, empty nodes dont just show up in the ast because someone was sloppy, they are necessary, usually things like pragmas will take their place
20:47:04BlaXpirit_yeah, looking great actually. just needed to not use immediate. thanks, fowl.
20:47:19EXetoCfowl: you never see my responses :p
20:47:30fowli did
20:47:35fowlthe order is never arbitrary
20:49:28flyxI'm slowly getting back into it
20:49:29EXetoCok. I think you misread then, but that was all speculative
20:51:31*BlaXpirit-UA joined #nim
20:53:15*brson joined #nim
20:55:15*sampwing quit (Ping timeout: 252 seconds)
20:55:37*BlaXpirit_ quit (Ping timeout: 264 seconds)
20:55:45*reem quit (Remote host closed the connection)
20:56:06*BlaXpirit-UA quit (Client Quit)
20:56:25*BlaXpirit_ joined #nim
20:57:03BlaXpirit_something isn't right though
20:57:04*mpthrapp quit (Remote host closed the connection)
20:57:28BlaXpirit_procs in the macro-ed include lose their asterisk
21:00:16*reem joined #nim
21:01:55*BlaXpirit_ quit (Quit: Quit Konversation)
21:04:01*wink-s quit (Ping timeout: 246 seconds)
21:06:15*sampwing joined #nim
21:06:49dom96BlaXpirit: That aporia bug is fixed in the new-suggest branch
21:11:04BlaXpirityeah, guys, this non-immediate macro messes everything up
21:11:33BlaXpiritsomemacro: include x is definitely not the same as somemacro: <paste contents of x.nim here>
21:11:48BlaXpiritfirst of all, it requires the macro to be not immediate
21:12:00BlaXpiritso the node tree is subject to transformations
21:12:15BlaXpiritand it's pretty much too messed up at that point to do anything
21:12:21BlaXpiritasterisks are lost
21:12:27BlaXpiritmultiple procs with the same name are lost
21:12:38fowlgl with that
21:12:56BlaXpiritwell it's pretty much impossible
21:13:08BlaXpiritto achieve somemacro: <paste contents of x.nim here>
21:13:50*NimBot joined #nim
21:14:07dom96someMacro(parseStmt(slurp(file)))
21:14:19*Mimbus joined #nim
21:14:37BlaXpiritwell yeah
21:14:53BlaXpiritbut then there is the problem of achieving the semantics of include's path lookup
21:16:58fowlif the postfix *s werent removed what would be the issue BlaXpirit
21:17:29BlaXpirittransform(parseStmt(slurp("common.nim"))) i'm getting Call Sym "parseStmt" etc
21:19:45fowlfr
21:20:07fowlmacro incl (module:string): stmt =
21:20:07fowl result = parseStmt(slurp(module.strval))
21:21:11BlaXpiritfowl, it works! thanks
21:21:52fowli cant condone what you're doing though
21:22:18*fizzbooze quit (Ping timeout: 272 seconds)
21:22:34*bcinman quit (Quit: My Mac has gone to sleep. ZZZzzz…)
21:22:58BlaXpiritcreate https://github.com/BlaXpirit/nim-random/blob/master/src/random.nim#L53 based on https://github.com/BlaXpirit/nim-random/blob/master/src/random/common.nim#L68
21:23:19*bcinman joined #nim
21:24:09BlaXpiritwow, i think duplicate/overloaded procs are lost here
21:25:30fowlthisi s the module i tested on and both foos came through http://pastebin.com/Wy4QLrWS
21:29:08BlaXpiritomg
21:29:16BlaXpiritit was grabbing the old version of my lib
21:29:19BlaXpiritsorry
21:29:34BlaXpiritso does slurp actually have the semantics of include?
21:29:48BlaXpiritit slurped the file in ~/.nimble whatever
21:30:35fowli doubt it
21:30:48fowlits not intended to read modules from the include path
21:31:10BlaXpiritdude i'm telling you
21:31:21BlaXpiriti'm in my home dir
21:31:35BlaXpiritnim i slurp("random/common.nim")
21:32:13BlaXpiritheck, slurp("intsets.nim")
21:32:15BlaXpirittry it out
21:32:30BlaXpirit.eval echo slurp("intsets.nim")
21:32:31MimbusBlaXpirit: eval.nim(3, 10) Error: 'slurp' can only be used in compile-time context
21:32:41fowllol wtf
21:32:53fowlthats useful
21:33:55EXetoC.eval static:; echo slurp("intsets.nim")
21:33:56MimbusEXetoC: eval.nim(4, 4) Error: invalid indentation
21:33:58fowlyea i can slurp any module installed by nimble
21:34:02EXetoC.eval static:; echo slurp("intsets.nim")
21:34:03MimbusEXetoC: #
21:34:03*Mimbus quit (Excess Flood)
21:34:09*Mimbus joined #nim
21:34:27fowl.eval import strutils; echo '\L'.repeat(42)
21:34:29Mimbusfowl:
21:34:47BlaXpirit.eval const x = slurp("intsets.nim"); echo x[4..x.high]
21:34:48MimbusBlaXpirit: # Nim's Runtime Library
21:34:48*Mimbus quit (Excess Flood)
21:34:54*Mimbus joined #nim
21:35:22fowlBlaXpirit, i know what this is for
21:35:42fowlits so that a module can slurp something from its own dir
21:35:52BlaXpiritwell yeah
21:36:00BlaXpiriti knew that
21:36:07BlaXpiritbut this craziness
21:38:12*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
21:39:12*reem quit (Remote host closed the connection)
21:40:21*jfchevrette joined #nim
21:41:30*jfchevrette quit (Client Quit)
21:41:49*reem joined #nim
21:43:04*wink-s joined #nim
21:46:27*pregressive quit (Remote host closed the connection)
21:49:04*reem quit (Remote host closed the connection)
21:50:07EXetoCBlaXpirit: use it wisely
21:50:24*reem joined #nim
21:50:30EXetoCit's much more convenient than any other approach?
21:51:30wink-sI see references to ".eval blah ..." is this short and for executing "nim i" (interactive mode) or is it something else?
21:51:59fowlwink-s, no it gets compiled and ran
21:52:24fowl"nim i" would be spitting out errors and not work for anything useful
21:52:42BlaXpirit"; "->"\n" and compile
21:52:55EXetoCin a secure sandbox, but try to break it if you want ;)
21:53:07BlaXpiriti dont think it's secure
21:53:42EXetoCbreak it then :p
21:53:46EXetoC"; " -> "\n "
21:54:57flaviuBlaXpirit: ask google for a 10 thousand dollar bounty if you break it.
21:55:07wink-sok, so it just means take the code following the .eval put it in a file and compile with "nim c" ?
21:55:08BlaXpiritoh ok
21:55:19BlaXpiritpretty much
21:55:21EXetoC.eval echo"yo"
21:55:22MimbusEXetoC: yo
21:55:30flaviuIt's linux accounts, pretty much all shared hosting depends on it being safe.
21:56:42flaviuwink-s: There are a couple extra imports, but yep.
21:57:56reactormonklib/system.nim(143, 40) Warning: unknown magic 'Addr' might crash the compiler [UnknownMagic]
21:57:59reactormonkO.o?
21:58:56BlaXpiritreactormonk, fixed already
21:59:11BlaXpiritwait
21:59:19BlaXpiritno it's not, i'm confusing something
21:59:44BlaXpiritbut i got it when i compiled nim without compiling koch or something
22:00:34EXetoCyes just update everything
22:00:39BlaXpiritscratch all that. what i should've said:
22:00:48BlaXpiritI had this error today but don't seem to get it anymore after i recompiled properly
22:00:55EXetoCreactormonk: more language features as procs \o/
22:01:17reactormonkEXetoC, sweet
22:03:31*wink-s quit (Ping timeout: 246 seconds)
22:04:32reactormonkI'm tinkering on merge for CountTable https://gist.github.com/reactormonk/3ea31e6a5e03195ce294 I get Error: type mismatch: got (CountTable[system.string], CountTableRef[system.string])
22:05:24BlaXpiritwell dude
22:05:28BlaXpirits[].merge(t[])
22:05:36BlaXpiritreactormonk^
22:05:51reactormonkBlaXpirit, nope, I want double CountTableRef
22:06:23BlaXpiritk
22:06:58reactormonkwtf did I get CountTable and not CountTableRef there?
22:08:04reactormonkBlaXpirit, oh, fuck. you're right.
22:08:10BlaXpiritk
22:08:25fowllol thats what merge() does already
22:09:25reactormonkfowl, didn't see it, somwhere else?
22:09:28*reem quit (Remote host closed the connection)
22:09:39fowlln 991
22:09:44EXetoCcan the user be notified of unused vars in macros?
22:09:48*zahary1 quit (Ping timeout: 272 seconds)
22:10:17reactormonkfowl, hm, not sure about var semantics
22:10:27reactormonkdoes a ref convert to a var?
22:10:43fowlyea
22:10:46reactormonknope
22:10:48fowlthat line should be a[].merge(b[])
22:10:55fowler s[].merge(t[])
22:10:56reactormonkyeah, fixed it
22:12:30*reem joined #nim
22:13:13reactormonkError: ambiguous call; both tables.merge(s: var CountTable[merge.A], t: CountTable[merge.A]) and tables.merge(s: CountTable[merge.A], t: CountTable[merge.A]) match for: (CountTable[system.string], CountTable[system.string])
22:13:15reactormonkaww
22:13:23reactormonkso I can't overload based on var?
22:13:42BlaXpirityou can
22:14:00BlaXpiritreactormonk, http://blaxpirit.com/blog/7/interesting-proc-overloads-with-parameter-constraints-in-nim.html#overloading-on-var
22:14:20*Trustable joined #nim
22:14:54def-but still not on return type unfortunately
22:15:03fowlah {lvalue} smart
22:15:16BlaXpiritobviously i didnt come up with this myself :|
22:15:19EXetoCyou think foo.bar() should be able to expand to foo[].bar()? I think people would get annoyed by allocation-agnosticity otherwise
22:15:23reactormonkdef-, yeah, but that would make type inference interesting
22:15:26def-i don't think you need the lvalue anymore
22:15:33EXetoCunless of course multiple overloads are defined, but that's clearly a waste
22:15:35def-at least i did it without lvalue and it worked
22:15:53BlaXpiriti thought it was recently added, too
22:16:22EXetoCI don't bother with ptr/ref parameters
22:16:26fowlit was a couple weeks ago iirc
22:17:25EXetoCfowl: did you want to make a game with me before?
22:17:33EXetoCit'd be nice to try urhonimo
22:17:44reactormonkI've never heard of parameter contraints before O.o
22:17:58EXetoCwhat?
22:17:59*reem quit (Remote host closed the connection)
22:18:21fowlyea EXetoC but i dont have any ideas :<
22:18:28reactormonkI might have skimmed over them but I don't remember them
22:18:47fowlurho is nice, networking and physics are really easy to do
22:19:02EXetoCreactormonk: what do you mean? "x: int" is a constraint, isn't it?
22:19:22reactormonkEXetoC, this part: http://nim-lang.org/manual.html#parameter-constraints
22:19:38EXetoCright ok
22:20:24*fizzbooze joined #nim
22:20:31def-I've only seen them used with tr macros
22:20:50EXetoCfowl: physics from scratch?
22:21:20BlaXpiriti don't understand what I can do with nnkCommentStmt
22:21:33BlaXpiriti can't divine any of its fields
22:21:34reactormonkWhat's an `lvalue` exactly?
22:21:51BlaXpiritsomething that can be assigned to
22:22:04BlaXpiritmitems gives lvalues
22:22:33reactormonkneat
22:22:55*reem joined #nim
22:23:36BlaXpiritnnkCommentStmt node doesn't have string value, doesn't have children
22:23:41BlaXpiritso what are u supposed to do with it
22:24:32def-BlaXpirit: nothing probably, i guess it's just used by the compiler internally and a remnant of comments belonging to the AST
22:24:57BlaXpiritso u cant access a comment in macros?????
22:25:08BlaXpiritand, worse, can't write comments in macros
22:25:30BlaXpiritbecause how awesome would it be if nim doc could read comments from procs made by macros
22:25:42def-yes, that would be nice
22:25:52def-Go ahead and work on the compiler I guess!
22:26:32BlaXpiritnope nope nope
22:26:38reactormonkBlaXpirit, it's not hard
22:26:41def-Maybe this has something you need: https://github.com/jboy/nim-docstrings
22:26:45reactormonkI'm a nim scrub and I still can do it :-)
22:27:11EXetoCindenting comments isn't really a big deal...
22:27:51EXetoCthere were some annoying issues though, but couldn't those be fixed? "# enummember," for example
22:28:11reactormonkBlaXpirit, I'd say you have to add a field to nnkCommentStmt and modify the parser to fill it - take a look at nim doc and how it grabs the docstrings
22:28:17EXetoCdef-: so, make them part of the AST again? or something else?
22:29:11def-EXetoC: at least make them optionally part of the AST, maybe
22:29:12*gokr joined #nim
22:29:15BlaXpiritcomments are not part of ast, i dont think
22:29:17EXetoCtime for forum discussion?
22:29:20BlaXpiritthese are doc comments
22:29:27BlaXpiriti cant get doc comments in macros
22:29:31BlaXpiritoutrageous
22:29:48EXetoCright. just having doc comments in the AST might be good enough
22:31:10reactormonkjust patch them in there and see what araq says in the PR
22:33:04reactormonkdundundidun my laptop is slow -.-
22:34:41reactormonkBlaXpirit, fixed, no need for the lvalue hack anymore
22:34:48BlaXpiritok
22:41:24def-the ARM Nim buildbots are pretty slow, 10 hours to run the tests
22:41:44gokrSo just got back home from doing a talk on Nim
22:41:49reactormonkuh-oh
22:41:49gokrThink it went well.
22:41:50def-They're basically running tests all day, every day: http://buildbot.nim-lang.org/waterfall
22:41:55reactormonkgokr, got video?
22:41:56def-gokr: nice!
22:42:08gokrNo, it wasn't taped - and it was in swedish. But I do have the slides :)
22:42:12EXetoCfowl: pitch: the player controls a due who can shoot differently coloured projectiles which bounce as long as they don't hit an obstacle that destroys said bullet type, and collisions involving other combinations will alter the world in certain ways
22:42:23EXetoCsounds awesome, yeah?
22:42:30def-gokr: slides please!
22:42:44def-They're trying to delete the Nim wiki article again, need more sources!
22:42:58BlaXpirit:s
22:43:21gokrdef-: Ok, our company just made a press release
22:45:02gokrhttp://3dicc.com/terf-news/2015/3/25/terf-rendering-power-upgrade-announced
22:45:02gokrNot sure if that qualifies as a source - since we also hired Andreas ;)
22:45:02EXetoCoh
22:45:13BlaXpiritlol who would've thought there could be a downside
22:45:17EXetoCA nim related job would be great
22:45:21BlaXpiritbut nobody's gonna know
22:46:14gokrBlaXpirit: But it says so in the press release ;)
22:48:16reactormonkgokr, should do
22:48:28gokrhttp://files.krampe.se/3dicc-nim-2015.odp
22:49:10gokrSo... I also did a lot of code snippets in Aporia - so... that's not on the slides.
22:49:47reactormonkBlaXpirit, most important tool for hacking the compiler: ./koch temp
22:50:05reactormonkand a fast computer -.-
22:51:47EXetoCI thought it could be sped up
22:52:21reactormonkgokr, the python syntax from nim is more due to accident IIRC - initially it was planned to be agnostic to that one too, so you could go algol. The python one was hardest to implement, so he went for that one first. And then didn't get to do the others ^^
22:52:33*Trustable quit (Quit: Leaving)
22:52:35gokrHa!
22:52:39EXetoClibreoffice choked on it after some time -.-
22:52:44gokrReally?
22:52:49EXetoCthere we go
22:52:54gokrThere is an mp4 movie in it.
22:53:02gokrThat shows a bit of what we do.
22:53:23fowlEXetoC, 2d or 3d
22:53:32gokrNot sure the slides are that easy to follow - since I interleaved with quite a lot of silly snippets in Aporia
22:53:32reactormonkgokr, just to add some trivia :-)
22:53:40gokrreactormonk: Yeah, great!
22:53:58reactormonkgokr, you could ask him how true that one is :-)
22:54:22gokrI am probably going to follow up with a blog article, was quite a few "loose ends" I missed that would be nice to mention/explain.
22:55:29EXetoCfowl: might as well go with 3d. I assume it won't be difficult with that engine
22:55:58fowlgokr, hey the tuple macro you're referring to takes an array with any indices (-2..2 for ex) and generates an expression to index it correctly into a tuple (obj[-2], obj[-1], ..)
22:56:14fowland it is here http://forum.nim-lang.org/t/1044
22:56:16gokrAh! That was it
22:56:33reactormonkhttps://gist.github.com/6dc8bfd3d41afc9ef851 should run everything at compiletime, correct?
22:56:47dom96def-: nooo, not again :(
22:57:03gokrHehe https://twitter.com/wgren/status/580799666910031873
22:57:05def-dom96: your fault for putting the old text back!
22:57:29def-(if you hadn't done that, we would get deleted for being a stub instead)
22:57:31BlaXpiritomg i did it
22:57:42BlaXpiritwhat i wrote 1.5 hours ago [:22:57]
22:58:22reactormonkBlaXpirit, I think I missed out
22:58:39BlaXpiritcreate https://github.com/BlaXpirit/nim-random/blob/master/src/random.nim#L53 based on https://github.com/BlaXpirit/nim-random/blob/master/src/random/common.nim#L68 using macros
22:58:56fowlreactormonk, ugh i had that working then i lost the tab
22:59:17reactormonkfowl, "that"?
22:59:25fowlyour code
22:59:35reactormonkfowl, don't bother
22:59:41EXetoCfowl: then sell it and get rich?
22:59:54reactormonkfowl, https://github.com/Araq/Nim/pull/2411/files
22:59:55dom96def-: :(
23:00:41*reem quit (Remote host closed the connection)
23:00:55def-dom96: maybe the 3dicc press release can save us
23:00:58reactormonkan immediate macro should be executed at compile time, correct?
23:01:14def-reactormonk: all macros are executed at compile time I hope
23:01:44fowlreactormonk, immediate just lets you use symbols in the arguments that arent defined yet
23:02:02fowlso it runs before overload resolution, you can't get symbols in an immediate macro, only idents
23:03:40reactormonkdef-, then why the fuck does https://github.com/reactormonk/nim/blob/tablesandmacros/tests/macros/ttableandmacros.nim generate an error in the ccgexprs.nim
23:03:54*reem joined #nim
23:04:05reactormonkfowl, got me an example for the difference?
23:04:09def-reactormonk: doesn't for me
23:04:10EXetoCICE?
23:04:16fowllib/pure/collections/tables.nim(786, 21) Error: cannot generate code for '=='
23:04:24reactormonkfowl, exactly.
23:04:37reactormonkEXetoC, ICE?
23:05:06fowlprobably because there is no `==` for nimnode
23:05:59reactormonkfowl, hm. strange. I tried your new `==`, didn't help
23:06:40EXetoC"(system.not|system.not|system.not|system.not|system.not|system.not|...) :tmp.advance:" ah yes, that again :-)
23:07:05fowli got an interesting error when i defined == lol
23:08:19reactormonkfowl, let's see
23:08:53fowlno wait it did work but then failed at linking
23:08:58dhasenan_When I realized that all parameters in Nim are named parameters: http://media0.giphy.com/media/vSSdLSLbGIXio/200_s.gif
23:09:10reactormonkError: unhandled exception: false Invalid node kind nnkIntLit for macros.`$`
23:09:24fowlchange that to repr reactormonk
23:10:00reactormonkfowl, yup, works now
23:11:26dom96def-: let me know if you contest the speedy deletion
23:11:29dom96def-: and I will back you
23:11:32EXetoCreminder of the day: #!strongSpaces
23:11:57def-dom96: not planning anything
23:11:58reactormonkfowl, well, == is defined for NimNode in lib/core/macros.nim
23:12:25fowlreactormonk, yea i cant get this to work
23:12:41dom96def-: why not? Are you just going to let it be deleted?
23:12:45fowlwhat are you trying to do though? i have before built a table[string,nimnode] and stored ast in it
23:13:02def-dom96: I have no experience with Wikipedia stuff, don't know how this works
23:13:57reactormonkfowl, found it
23:14:11reactormonkfowl, https://github.com/Araq/Nim/issues/1679
23:14:56*CryptoToad quit (Read error: Connection reset by peer)
23:15:04fowldom96, i'll make a comment
23:15:09reactormonkfowl, well, why to fuck do the macro instructions end up in ccgexprs
23:15:28reactormonksomething went wrong somewhere
23:15:29dom96i'll contest it as well
23:15:46fowlhow do you link to an article in wiki markup
23:16:39dom96fowl: click the little chain in the editor and it will do it for you :)
23:17:00fowlah
23:17:13fowlwhat other programming languages have pages but no references, i only know of ooc
23:17:35dom96That won't work as an excuse
23:17:51dom96https://en.wikipedia.org/wiki/Wikipedia:Other_stuff_exists
23:17:56fowlin that case i'm marking them all for deletion
23:18:08fowlnvm i dont know how to do that
23:18:10def-fowl: don't do that please
23:18:49def-I prefer this excuse: https://en.wikipedia.org/wiki/Wikipedia:Ignore_all_rules
23:18:51fowldom96, its not that they exist, its that they exist without references
23:19:33def-dom96: it's known that async/await with try-except fails with a 50k line stack trace?
23:19:45*reem quit (Remote host closed the connection)
23:20:05dom96def-: there are some try-except async/await bugs left in there. But I haven't seen such a huge stack trace :O
23:21:21def-dom96: https://github.com/Araq/Nim/issues/2412
23:21:44*reem joined #nim
23:21:57dom96def-: ahh, they are omitted thankfully :P
23:23:44*reem quit (Remote host closed the connection)
23:24:48reactormonkin the compiler, macros are execute before or with the cgen?
23:25:49dom96likely before
23:27:06reactormonkok
23:27:16fowlso how do i request an article be deleted
23:27:38fowlwe should try to get rid of these unnoteworthy programming languages which only link to their website
23:28:09*reem joined #nim
23:28:53reactormonkfowl, >:)
23:29:16def-fowl: hurting other languages doesn't help us
23:29:31reactormonkfowl, yeah, go for that spree after we got ours
23:29:35fowldef-, how is it hurting other languages? its helping wikipedia
23:29:36*reem quit (Remote host closed the connection)
23:30:29fowlhow burdenous they are to be taking up bytes for their project which by wikipedias standards does not exist until other people talk about it
23:31:07fowlmaybe if we clean up wikipedia jimbo whales will stop begging for donations
23:31:39flaviufowl: Being an ass won't solve anything.
23:35:35EXetoCis it possible to get an ident from a sym?
23:36:55BlaXpiritnewIdentNode($sym)
23:36:58BlaXpiritis my guess
23:39:46reactormonkshould you be able to use NimNode instances at runtime?
23:40:02EXetoCI'm trying to use it in a template and I want to pass that template to getAst, but then I get "undeclared identifier: tmp"
23:41:11EXetoCreactormonk: I don't know, but it seems pointless
23:41:50reactormonkEXetoC, hmm, I see your point
23:42:43EXetoCI think I tried to create nodes outside a macro, and I got an ICE (Internal Compiler Error)
23:44:27reactormonkanyone knows where macro processing starts in the compiler?
23:45:21dom96In relation to WP: I will contest it with gokr's article.
23:46:15gokrdom96: What about nimio.us - isn't that also a legal entity using Nim?
23:46:34gokrAnd feel free to point to 3dicc.com and the press release etc.
23:46:37dom96oh wow, cool.
23:46:40dom96Didn't see that site yet.
23:46:48gokrIts gmpreussner|work :)
23:47:03gokrOk, now really time to sleep, cya
23:47:05reactormonkhm, so it never actually gets there :-(
23:48:26dom96gmpreussner|work: nice work :)
23:49:38*reem joined #nim
23:52:06dom96really wish I could play with those gadgets
23:53:28BlaXpirithow to do {.hint[Deprecated]: off.}
23:53:42*Matthias247 quit (Read error: Connection reset by peer)
23:54:54BlaXpiritactually is {.warning[Deprecated]: off.}
23:57:04Araqreactormonk: entry point is in sem.nim iirc, but it all ends up in the VM
23:57:11def-Welcome back, Araq
23:57:27Araqit's refreshing to take a break from #nim :P
23:57:28reactormonkAraq, thanks. I'm trying to debug https://github.com/Araq/Nim/issues/1679
23:57:43*TEttinger joined #nim
23:58:06reactormonksomehow the tables don't end up in the vm
23:58:57BlaXpiritLOL macros https://github.com/BlaXpirit/nim-random/commit/d745045d7a15dee58f980afa494fdf5d0675340c