<< 27-06-2015 >>

00:10:23*nande quit (Read error: Connection reset by peer)
00:33:55*ddl_smurf joined #nim
00:34:36*askatasuna joined #nim
01:02:16*Jehan` quit (Quit: Leaving)
01:25:24*wuehlmaus quit (Quit: Lost terminal)
01:31:13*ozra quit (Ping timeout: 246 seconds)
01:43:00*jaco60 quit (Ping timeout: 256 seconds)
02:34:16*Jesin quit (Quit: Leaving)
02:37:32*Jesin joined #nim
02:40:47*darkf joined #nim
02:44:34*vendethiel quit (Ping timeout: 264 seconds)
02:57:49*AtticusMB joined #nim
02:58:36*AtticusMB left #nim ("Leaving")
03:13:50*Jesin quit (Quit: Leaving)
03:18:44*Guest62169 quit (Quit: Leaving)
03:39:06*elbow_jason quit (Read error: Connection reset by peer)
03:39:21*elbow_jason joined #nim
03:55:27*apense quit (Ping timeout: 248 seconds)
03:59:52*ddl_smurf quit (Quit: ddl_smurf)
04:29:54*saml_ quit (Remote host closed the connection)
04:58:35*dalarmmst quit (Ping timeout: 246 seconds)
05:20:53*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
05:46:04*bjz joined #nim
05:46:34*bjz quit (Client Quit)
06:04:00*Guest18776 quit (Ping timeout: 246 seconds)
07:01:58*woadwarrior joined #nim
07:06:57*woadwarrior quit (Ping timeout: 265 seconds)
07:07:39*woadwarrior joined #nim
07:21:37*wuehlmaus joined #nim
07:35:36*woadwarrior quit (Quit: My Mac has gone to sleep. ZZZzzz…)
07:42:48*dalarmmst joined #nim
07:48:45*MatrixBridge quit (Remote host closed the connection)
07:48:53*MatrixBridge joined #nim
08:08:22*vendethiel joined #nim
08:30:09*woadwarrior joined #nim
08:39:26*woadwarrior quit (Quit: My Mac has gone to sleep. ZZZzzz…)
08:46:25*yglukhov__ joined #nim
08:49:02*zezba9000 joined #nim
08:51:12zezba9000I've got a simple Nim app running on Arduino but would like to use the GC. I get a compile error of "system module needs 'copyStringRC1'" when I try using strings
08:51:45zezba9000Anyway to enable the GC (refc) with --os:standalone
08:52:43zezba9000I'm using --cpu:avr with --os:standalone
08:54:10*Kingsquee quit (Ping timeout: 276 seconds)
08:54:54*Kingsquee joined #nim
08:59:36*milosn quit (Quit: leaving)
09:05:49*gokr joined #nim
09:17:16*yglukhov__ quit (Quit: Be back later ...)
09:17:51*yglukhov__ joined #nim
09:22:33*yglukhov__ quit (Ping timeout: 252 seconds)
09:44:21*woadwarrior joined #nim
09:56:44*jaco60 joined #nim
09:58:46Araqzezba9000: don't use --os:standalone then ;-)
10:07:33*vasher_ joined #nim
10:14:54zezba9000Araq: Can't. If I take it away then I get the error: "lib/system/mmdisp.nim(37, 22) Error: type mismatch"
10:16:10zezba9000The compiler args are: "nim c -c -d:release --cpu:avr --genscript --nomain --gc:refc main"
10:16:22Araqah, replace the 1000_0000 by ArrayDummySize please
10:20:00zezba9000Is it possible to enable the GC on platforms that use "avr-gcc" like Arduino? Does the refc GC require special stuff not on thos?
10:20:25pigmejreactormonk: pull request done. I think it's ok, but check it please before we will merge it ;)
10:20:40zezba9000Probably not a typical use case I know.
10:23:28Araqzezba9000: the GC requires mmap or similar but if you have no OS, there are workarounds. Not sure why we never did it.
10:25:47zezba9000So if a workaround was made the GC could world in standalone?
10:25:53zezba9000**could work
10:26:41Araqyup
10:27:23zezba9000How much memory does the GC require with no objects in memory? Like its basline do you think
10:30:10Araqgood question
10:30:21Araqlet's find out
10:32:30zezba9000I'm just asking if you knew off the top of your head... There is overhead when running an app on a OS I would think that could give misleading numbers
10:32:59pigmejAraq: why async socket doesn't have timeout ?
10:33:12Araqinteresting. Go GC support uses .dynlib and codegenDecl at the same time. I wasn't aware that we support that. :P
10:33:38pigmejor maybe even more direct question dom96.
10:33:42Araqpigmej: pretty sure there is timeout support for async
10:33:58pigmejAraq: docs doesn't mention it at atl
10:34:02pigmejall*
10:34:26Araqthe select stuff supports a timeout and so does async http server
10:34:27zezba9000Where is the nim GC source code located? One file or multiple. I'm looking in "Nim/compiler" but cant seem to find it.
10:34:41Araqzezba9000: lib/system/gc.nim
10:34:47dom96pigmej: Use sleepAsync and `or` for timeouts
10:35:03pigmejoch why that strange ?
10:35:25dom96why is that strange?
10:35:25zezba9000k tnx
10:35:51pigmejdom96: because socket timeout is socket timeout
10:36:02Araqzezba9000: but you also need to touch lib/system/alloc.nim
10:36:14pigmejI mean, I would really expect recv()/send() to crash when timeout given
10:36:14Araqwhich contains the allocator and which is what uses mmap
10:36:27zezba9000aww was just going to ask that
10:36:52dom96pigmej: It's easy to write a recvTimeout with this.
10:37:24pigmejok, but I still wonder why it cant be 'pure' socket timeout
10:37:26dom96the timeouts in httpclient are done via the timeout param in recv
10:37:29dom96and they suck
10:37:41pigmejwhy ?
10:37:57dom96because the timeout applies to each recv call
10:38:02*Trustable joined #nim
10:38:07dom96so get("google.com", timeout = 5000)
10:38:09pigmejand it's ok
10:38:13dom96might take longer than 5 seconds
10:38:18dom96which is not what most people want.
10:38:37pigmejok, but there we talk about sokects not about http requests which might be redirected or sth
10:39:05pigmejbut sockets are just fds, I would *really* expect to use timeouts on them, instead of emulating it in library / language code
10:39:09zezba9000Where is the code that auto disables the GC when standalone is passed in as an arg. That would have to be disabled as well or accept an override
10:39:28dom96pigmej: If you mean OS support for timeouts then I'm sure it's there.
10:39:35zezba9000...for the GC to work with an mmap fix
10:39:44pigmejah see, yeah I mean't exactly this
10:39:46pigmejdom96: where?
10:40:01pigmejbecause I was starting to wonder what the heck
10:40:51dom96Although this won't work for async sockets.
10:40:54dom96http://linux.die.net/man/3/setsockopt
10:41:02dom96search for 'SO_RCVTIMEO '
10:41:07pigmejdom96: yeah I know this
10:41:11pigmejbut "Although this won't work for async sockets."
10:41:12pigmej;-)
10:41:20dom96You just need to set this option on the socket
10:41:37dom96rawsockets module has a setsockopt proc (or something named close to that)
10:41:55pigmejdom96: but I"m interested in async sokcets
10:42:28dom96well then why are you complaining?
10:43:25pigmejso, setSockOpt + async socket will give me timeouts for recv() on async sokets ?
10:43:40pigmejor should I use that sleepAsync thingy?
10:45:07dom96No. I just said that it won't work for async sockets.
10:45:16dom96It will only work for blocking sockets.
10:45:29pigmejok, so only way in async sockets is sleepAsync
10:45:32dom96yes
10:46:33*thaless joined #nim
10:46:54pigmejdom96: sounds a bit 'hacky' for me, but I will check it later ;-)
10:47:08*dddddd joined #nim
10:47:37dom96If you have a better idea do tell.
10:48:06pigmejI will check, but I would certainly expect timeout on socket
10:48:32dom96Why!?
10:48:37Araqzezba9000: search for "standalone" in lib/system.nim
10:48:45pigmejdom96: I have to go off now, (i'm in the train)
10:48:48pigmejwill talk to you in ~2h
10:48:49zezba9000k
10:57:59*miglo joined #nim
11:12:58miglohow can I get the ip address an AsyncSocket is associated with?
11:13:45dom96miglo: use acceptAddr
11:19:28miglohmm, I see but if the socket gets passed around from proc to proc the address isn't available so the tuple needs to be passed instead
11:20:09miglowouldn't it be better if AsyncSocket would have access to an address property?
11:20:40migloat least that's what I'm used to from other API's
11:31:04*ddl_smurf joined #nim
11:35:39*Matthias247 joined #nim
11:51:44*milosn joined #nim
11:53:11wuehlmauscan someone point me to the proc with graphical input GUI? the dialog model doesn't have a proc so i bet it's in gtk2
11:53:46wuehlmauss/model/module/
11:53:54Araqwuehlmaus: you mean a simple window with a text edit field?
11:54:00wuehlmausyes
11:54:07Araqnot sure if that comes with GTK out of the box
11:54:10*xificurC quit (Quit: WeeChat 1.2)
11:54:28wuehlmausi wonder why dialogs doesn't have one, i would guess that it should be in there
11:58:15Araqit's not a common dialog, that's why.
11:58:30Araqalso dialogs.nim has been written for Aporia.
11:58:37wuehlmausah
11:58:55wuehlmausi love the simplicity of dialogs.
11:59:45Araqyeah unfortunately it doesn't scale for real UIs
12:00:09*xificurC joined #nim
12:00:30Araqtools/nimrepl.nim is some old GTK based code that is a nice starting point
12:00:57Araqit doesn't compile because it never was ported to later Nim versions
12:06:10*thotypous quit (Ping timeout: 264 seconds)
12:06:19migloI'm still playing with the chat server example of module asyncnet. I've a slightly modified version where the global variable that holds the clients doesn't use the pragma 'threadvar' and initializes the sequence. This version gives some warnings by the compiler. To get rid of them I have added threadvar but than the program crashes when a new client gets added to the sequence.
12:08:02migloIn the official version clients are getting added within proc serve. In my version within proc processClient.
12:09:41Araqasycnc doesn't work yet with threads
12:12:34migloso does it mean that the pragma threadvar has to be avoided in comination with async?
12:13:06Araqno, threadvar is fine
12:21:21*kas joined #nim
12:23:05*boopsiesisaway is now known as boopsies
12:24:47*woadwarr_ joined #nim
12:25:32wuehlmausAraq: thanks for pointing me to nimrepl.nim which sadly i cannot find
12:25:49Araqnot in tools?
12:26:40wuehlmausi don't have a tools directory
12:26:55Araqlook at github
12:27:16*thotypous joined #nim
12:28:01*woadwarrior quit (Ping timeout: 276 seconds)
12:33:09*bjz joined #nim
12:33:26wuehlmausthanks, found it
12:34:12*Kingsquee quit (Quit: Konversation terminated!)
12:35:50*miglo left #nim ("http://quassel-irc.org - Chat comfortably. Anywhere.")
12:37:46*NimBot joined #nim
12:51:09*askatasuna quit (Ping timeout: 250 seconds)
12:51:26Araqzezba9000: I'll push a proper distinction between --gc:none and --os:standalone soon, stay tuned
13:05:19*ozra joined #nim
13:19:49zezba9000Araq: Ok so you mean like the --os:standalone wont just auto disable the GC?
13:25:12*kas quit (Ping timeout: 272 seconds)
13:27:32*yglukhov__ joined #nim
13:37:22*woadwarr_ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
13:40:47*yglukhov__ quit (Quit: Be back later ...)
13:43:19r-kuwhat would be correct way to create string from pointer + len?
13:46:16r-kui should point out that buffer to which pointer is pointing is not necessarily ending with \0
14:00:53*woadwarrior joined #nim
14:01:00*kas joined #nim
14:03:52*woadwarr_ joined #nim
14:05:20*woadwarrior quit (Ping timeout: 256 seconds)
14:10:49Araqzezba9000: exactly
14:11:09Araqr-ku: newString(length); copyMem(...)
14:11:22Araqthere is no shortcut for this yet
14:11:23r-kuthank you
14:11:43*flaviu quit (Ping timeout: 256 seconds)
14:12:45*yglukhov__ joined #nim
14:13:00zezba9000Awesome! :)
14:16:44*flaviu joined #nim
14:18:48*thepreacher joined #nim
14:22:11Araqzezba9000: how much RAM does the device have?
14:22:32zezba9000The one I have is 2kb ram
14:23:02zezba9000https://www.arduino.cc/en/Main/ArduinoBoardDuemilanove
14:24:34zezba9000Araq: This cool one that just passed Kickstarter is 2.5kb: https://www.kickstarter.com/projects/903888394/arduboy-card-sized-gaming/description
14:25:13zezba9000They range from 1 to 2.5kb on average: https://www.arduino.cc/en/Products.Compare
14:26:31Araqer... I can make things compile but there is no way the gc will run with 2kb
14:28:32zezba9000I thought the GC just used refCounting in a way that didn't require to much overhead. To the extent it could work on that
14:28:45*vasher_ quit (Quit: Connection closed for inactivity)
14:29:10Araqno
14:29:24Araqyou don't even have memory for a heap
14:29:46zezba9000When the GC boots up does it create a lump of for the heap?
14:30:53Araqsomething like that, yes
14:31:06zezba9000k I thought it might just need a refCount the size of an int for each object owner.
14:31:45Araqyes, the GC doesn't need much more than that
14:31:54Araqbut the heap allocator does.
14:32:46zezba9000Why does the allocator need more?
14:33:32Araqbecause it's been designed to manage memory from 4MB up to Gigabytes
14:33:43Araqnot to "manage" 2K.
14:34:50Araqfor 2K you use entirely different algorithms
14:35:06zezba9000So it allocates memeory in chuncks, kinda like .NET?
14:35:36Araqyup
14:36:00pigmejreactormonk: ping
14:36:14zezba9000ic, is it hard to make a GC like that work in smaller chunks?
14:36:36zezba9000I know you do that for performance as most devices have Gigs not KB
14:37:18Araqmanaging 2K is not hard but the overheads are big enough that programs then don't use alloc/new to begin with
14:37:52*darkf quit (Quit: Leaving)
14:37:53Araqwhich leads us to the question: What do you use that requires copyStringRC1?
14:38:21zezba9000Just creating a simple string and getting its .len would give that error
14:38:53Araqwell just "creating a simple string" puts it on the heap
14:39:10zezba9000Ya I figured
14:39:18Araqyou need to use array[12, char] instead of string
14:39:52zezba9000I know but at that point you might as well right in c++
14:40:32zezba9000I was hoping the GC had a refCount only mode that would allocate only what was needed
14:41:03Araqnot true. C and to a less extend C++'s type system suck and are inherently unsafe. With Nim you get at least bounds checking and stronger type checking
14:41:20*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
14:41:33zezba9000ya true
14:41:35Araq"you might as well use C then" is simply never an argument just because C is so poorly designed.
14:42:01zezba9000Well on those things it might be valid ;)
14:43:11zezba9000Its just I was hoping to write some logic that could function on an Arduino and Desktop without refactoring objects ect as you can create a ref object without a GC
14:44:48zezba9000But its ok, I do appreciate you taking a look at its feasibility. I understand its one of those nich things
14:45:22ozrazezba9000: There are several GC's for Nim, you might even want to try taking a stab at writing an 'embedded small RAM GC'? :-)
14:45:56zezba9000I have a GC in mind that would be able to run on those.
14:45:56*gokr_ quit (Read error: Connection reset by peer)
14:46:13zezba9000Only take up 1 extra byte per ref object
14:46:18ozrazezba9000: Someone ported the Go GC a while ago, so you can see there's potential..
14:47:02zezba9000Idk if i'm familiar enough with Nim to do that though.
14:47:49zezba9000It would require things to be de-referenced when they leave a scope. Wouldn't be super fast but would use almost no memory
14:48:17Araqyou don't have to do that, just GC when the memory is tight
14:48:55zezba9000But do have a GC like that requires more memory overhead correct?
14:49:26zezba9000If I don't handle stuff within scope I must have extra reference to it
14:49:52zezba9000man can't type sorry been up a long time
14:50:07zezba9000**But to have a...
14:50:50Araqwe're talking about 2048 bytes.
14:51:28zezba9000Ya and if you only need 1 extra byte per ref object "not" value types it would work out pretty good.
14:51:35Araqthe real question here is "can you afford to scan stack conservatively"
14:51:54Araqand the answer is: no, you can't.
14:52:03zezba9000Probably not, but theres not much ram to scan
14:53:03Araqso ... no conservative stack scanning --> requires the codegen to emit precise stack maps --> big effort.
14:53:23Araqwell "big" is relative
14:53:46*fffdfdfdf quit (Ping timeout: 246 seconds)
14:54:17zezba9000By conservative do you mean stop the world?
14:54:34Araqbut you cannot port the existing GC at all in this scenario, you need to write a new one and adapt the codegen too.
14:54:38zezba9000Or incremental collection over multiple frames
14:54:55Araqno, something entirely different, please look it up
14:55:54*gfdgfdh joined #nim
14:57:04ozrazezba9000: Had to look at the thing. Cool. Reminds me of coding on the Gameboy Color. But then I did parts of the code in ASM, parts in C. And still that one had 32kB memory... 2kB!!! Woa.
14:57:32zezba9000Araq: Ok no its not going to be conservative but rather precise from my understanding
14:57:55*thepreacher quit (Remote host closed the connection)
14:58:30zezba9000ozra: lol, Gameboy color only had 32kb. Well some Arduino devices have that
15:01:04ozrazezba9000: Seriously, at 2kB, you want to manage memory very specifically. Not to discourage, but you'll probably not get away with making a reasonable GC in any form. Just setup hard zones of heaps for different objs of the game, set limits for what can happen, etc. It's tricky. But... it's 2K!
15:03:29ozraYou'll use constants for different memory locations, list starts etc. Fixed adressing.
15:04:32zezba9000Araq: Say you had each ref object on the heap have a 8bit-byte refCounter, or 16-64bits ect. Then each time an object references an existing heap object its refCount goes up. Once any object goes out of scope it first runs through all of its childeren objects in a tree fashion and de-refs then if you're the last owner of the heap object. If not it leaves theres refs alone and just does cyclic detection to doulbe check if it really
15:04:32zezba9000is the last owner even if its refCount says he's not.
15:05:35Araqzezba9000: thanks but I'm well aware of how a purely RC'ing GC works.
15:06:50zezba9000ozra: I know normal people would probably just do that but thats no fun.
15:06:59Araqnot sure if that's the best design for 2K, more likely mark and sweep with special exploits so that you save some memory over malloc/free
15:07:08Araqbbl
15:07:15zezba9000Araq: I'm sure you do, I was pointing out how that kind of GC could run in 2KB of ram
15:07:42ozrazezba9000: I dunno, it _is_ kinda fun - it's like doing a jigzaw puzzle, with bytes :-P
15:09:02zezba9000Araq: I had made a test mark/sweep GC but doesn't that require a lot more memory then only 1 extra byte per ref object?
15:09:08*woadwarrior joined #nim
15:09:14zezba9000Thats why I started thinking of alternatives
15:10:02zezba9000ozra: Ya I know it is but i'm going for a different kind of fun :)
15:10:45*thepreacher joined #nim
15:10:46ozrazezba9000: Haha, yeah, I hear you. It's cool trying to pull off something seemingly impossible :)
15:10:47zezba9000My test GC wasn't very optamized on ram.
15:11:04*woadwarr_ quit (Ping timeout: 256 seconds)
15:11:04zezba9000ozra: Exactly!
15:15:11*flaviu quit (Ping timeout: 256 seconds)
15:15:44*perturbation joined #nim
15:17:28*woadwarr_ joined #nim
15:17:48zezba9000Anyway I know GC stuff is a big topic and don't pretend to be an expert like Mr Araq. Just been thinking about it a bit on and off.
15:18:05*thepreacher quit ()
15:19:43zezba9000I plan on taking a stab with my 2kb GC idea when I have more time to think it through. Now I think i'm going to sleep
15:19:52perturbationHi all - I did a base 62 (by default) encoder/decoder in Nim for a side project (utility) at work. If there's any interest I'll submit it to the nimble package list.
15:20:23perturbation...I notice now that there's already a base 32 encoder/decoder.
15:20:35*woadwarrior quit (Ping timeout: 252 seconds)
15:20:44perturbationanyway, project is https://github.com/singularperturbation/base62-encode
15:29:44*flaviu joined #nim
15:47:53*woadwarrior joined #nim
15:49:45*woadwarr_ quit (Ping timeout: 256 seconds)
15:52:01*Ven joined #nim
15:53:48*dtscodefish joined #nim
15:54:37*dtscodefish is now known as dtscode
15:55:51*strcmp1 joined #nim
16:00:22*Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
16:02:19*Sembei joined #nim
16:04:27*Arrrr joined #nim
16:04:37*Pisuke quit (Ping timeout: 264 seconds)
16:05:57dom96perturbation: Add everything to Nimble's package list!
16:07:00perturbationdom96: alright, will do :)
16:08:16*Matthias247 quit (Read error: Connection reset by peer)
16:11:11*Arrrr quit (Quit: WeeChat 1.2)
16:11:44*Arrrr joined #nim
16:13:12r-kuvar a = newSeq[int](); curl_easy_setopt(curl, CURLOPT_WRITEDATA, addr a) <-- can i do this? pass seq by pointer to callback? in the callback i do: var dest = cast[ptr seq[int]](userp)[]. does not quite work though. it behaves as if dest being new copy every time. maybe i messed up with casts/dereferencing?
16:19:21*woadwarr_ joined #nim
16:22:00*woadwarrior quit (Ping timeout: 252 seconds)
16:25:38*perturbation quit (Remote host closed the connection)
16:27:28*woadwarrior joined #nim
16:28:47*woadwarr_ quit (Ping timeout: 252 seconds)
16:31:06*woadwarr_ joined #nim
16:31:12*perturbation joined #nim
16:33:46*woadwarrior quit (Ping timeout: 264 seconds)
16:36:17*perturbation quit (Remote host closed the connection)
16:37:03*jszymanski joined #nim
16:40:39pigmejhmm, is there any way to suppress /home/pigmej/.nimble/pkgs/docopt-0.6.1/docopt.nim(538, 30) template/generic instantiation from here
16:40:39pigmejclient.nim(21, 34) template/generic instantiation from here
16:40:39pigmej this messages from nimsuggest ?
16:44:39*filcuc joined #nim
16:53:46*perturbation joined #nim
16:55:34*gfdgfdh quit (Ping timeout: 246 seconds)
16:58:24fowlr-ku you're doing it right but when you dereference and assign it you're creatng copies
16:59:17fowlr-ku remove the deref on assignment, instead deref if when you use it (dest[].len or w/e)
17:02:19*Sembei quit (Ping timeout: 276 seconds)
17:04:56reactormonkpigmej, morning
17:05:19pigmejreactormonk: hey :)
17:05:26pigmejwe have problem with nimsuggest / epc
17:05:56pigmejhttp://wklej.to/EPPg4
17:06:02pigmejepc expects port in first line...
17:07:17*drewsrem joined #nim
17:12:51reactormonkpigmej, that's why I put in verbose zero...
17:13:35pigmejyou mean?
17:13:43pigmejit crashes for me exactly like this
17:14:29reactormonkpigmej, so apparently we need to return the port first...
17:14:34*filcuc quit (Ping timeout: 264 seconds)
17:14:48pigmejyeah that would be cool, I checked nimsuggest source
17:15:35reactormonkmaybe drag compileProject() after the echo and just put it in every of <mode>?
17:15:36pigmejand that would be easy fix BUT
17:15:50pigmejI don't know what are other usages of nimsuggest etc
17:15:58pigmejreactormonk: well not even needed in fact
17:16:06pigmejwe would just need to bind before compileProject
17:16:10pigmejif mode is mepc
17:16:23reactormonkHum
17:16:36pigmejthen pass it to serve
17:16:40reactormonkwe might have race condition here
17:16:58pigmejwhere? it's single thread
17:17:12pigmejah no
17:17:13reactormonkyou need to run compileProject before serving the first request
17:17:22pigmejhmm
17:17:46pigmejthen we will need to refuse all commands before compilation occurs
17:18:51pigmejor return something like 'not yet ready'
17:18:53pigmejto epc
17:19:07reactormonkYup, or simply stall
17:19:15reactormonkbut I think not ready is the correct call here
17:19:45pigmejbut that would mean that we have to check for that 'not yet ready' everywhere
17:20:13*Sembei joined #nim
17:20:31pigmejthere is also other way of doing it
17:20:45pigmejwe're not yet using output of compileProject
17:20:46reactormonkhttps://github.com/ensime/ensime-emacs/blob/master/ensime-client.el#L796-L808 <- also if you have some time :D
17:21:01pigmejso, the solution would be also to supress output of compileProject
17:21:11pigmej(redirect it to /dev/null)
17:21:20pigmejand then after compileProject bring it back
17:21:28pigmejthough hacky(tm)
17:21:28pigmej;D
17:21:38reactormonkworks for me
17:22:08*yglukhov__ quit (Ping timeout: 252 seconds)
17:22:27reactormonklisp-style lexical binding? (let *stdout* "/dev/null" ... )? :D
17:22:29pigmejyeah, I think that would be good solution as long as we will not use compile output
17:22:47*yglukhov__ joined #nim
17:22:47pigmejreactormonk: I think it has to be done in nimsuggest
17:22:54reactormonkpigmej, yup
17:23:12reactormonkI just think that would be a perfect application of said code ;-)
17:23:29pigmej;D
17:28:04r-kuthanks fowl, that worked. be nice if there was a way to put reference to variable and not have to deref it all the time though
17:30:37reactormonkpigmej, and btw, I really like my tests. You think you can tinker one for thing-at-point? :-)
17:31:18fowlr-ku string and seq have value semantics
17:31:20pigmejI will try :)
17:32:11fowlr-ku imagine if you were passing an array of something and then let x = ptr[] it would make a copy
17:38:37pigmejreactormonk: I have no idea how to do it multiplatform ;/
17:41:27ArrrrHow can i get the lowest value from a slice (ej: '1..10' i expect '1')
17:41:40reactormonkpigmej, emacs on windows?
17:41:45reactormonkI mean it's not a problem on mac
17:42:21pigmejreactormonk: I do know how to do it with posix, just backup, dup, open, close, open backup
17:42:23pigmejbut... ;D
17:42:41pigmejAraq: likes windows ;p
17:44:58perturbationanyone else having difficulty with koch web with HEAD (17f852c769078f) on devel?
17:45:14perturbationgetting "lib/system.nim(284, 53) Error: '`' expected" as error
17:45:15reactormonkpigmej, and there's at least one guy with emacs on windows
17:45:39pigmejehs ;/
17:46:07pigmejanyway, https://github.com/nim-lang/nim-mode/pull/35 this is super cool I think
17:46:25reactormonkdom96, edited your issue @ https://github.com/nim-lang/Nim/issues/635
18:02:13federico3Can I use selectors on a file?
18:09:55dom96reactormonk: what?
18:18:46*fioco joined #nim
18:18:49fiocoHello
18:20:35fiocoI'm building a server with nim. I need a socket for this, yet I'm unsure how to setup a socket to recieve connections and send to a specific client out of a bunch. How can I create a server socket and view connected addresses AND send to a specific address?
18:21:12dom96fioco: asyncnet docs have a good example
18:21:23dom96use acceptAddr to get the address
18:21:38dom96create a hash table from address to socket
18:21:42fiocoWhy would I use asyncnet over net?
18:21:50dom96then use hash[address].send("data")
18:22:10dom96because it allows you to handle multiple clients in a single thread asynchronously
18:22:22fiocoOk
18:22:27fiocoThanks dom96
18:22:43dtscode<3 async
18:27:47*filcuc joined #nim
18:32:27reactormonkdom96, corrected the link in your original post.
18:32:54dom96right... thanks.
18:38:40*drewsrem quit (Quit: Leaving)
18:43:20*BitPuffin|osx joined #nim
18:56:12*Matthias247 joined #nim
18:59:49*filcuc quit (Ping timeout: 264 seconds)
19:00:35*Jehan` joined #nim
19:02:42dtscode?
19:02:43dtscodeoops
19:12:47ekarlsomeh, wonder what I should do in nim these days :p
19:13:31Araqekarlso: fix the bugs?
19:13:48ekarlsoAraq: i dunno compiler stuff :p
19:14:08Araqyou said you abandoned the website for nimble due to bugs
19:14:41ekarlsohmmms, I dont remember what that was though :P
19:15:19dtscodea nimble website?
19:17:19perturbationis there a point to doing an option type since for most primitives I can return nil anyway? I.e., type OptionalString = string or type(nil) vs. proc foo(): string = nil
19:18:07ekarlsoAraq: any new usecases for nim atm ?
19:18:18reactormonkekarlso, you could somehow make packages.json to match nodejs tools so we could use that one
19:18:37ekarlsoreactormonk: nodejs tools ?
19:18:45reactormonkekarlso, for browsing packages etc.
19:18:51reactormonkdunno if there are any
19:19:04ekarlsoreactormonk: there already is a nim written tool ..
19:19:08ekarlsothat more or the less works :p
19:19:30Araqperturbation: not really but if you prefer hype over ratio go with the option type.
19:20:19Araqekarlso: we already cover every use case :P
19:20:38ekarlsoAraq: tssk :p
19:20:50ekarlsoAraq: u should bring http2 / grpc support ot nim
19:20:56ekarlsothat would make stuff interesting
19:21:19*Strikecarl joined #nim
19:22:01StrikecarlI tried --app:gui
19:22:03Strikecarlbut i get this
19:22:07StrikecarlError: execution of an external program failed
19:22:07Strikecarl> Process terminated with exit code 1
19:22:23Strikecarlthis is my custom command
19:22:23Strikecarl$findExe(nim) c --threads:on --opt:size --d:release --gc:none --deadCodeElim:on --checks:off --app:gui $#
19:22:45AraqStrikecarl: known bug with the windows installer, use a mingw from somewhere else
19:23:11Araqor maybe not?
19:23:16Strikecarlwell
19:23:20StrikecarlMy friends that code nim
19:23:22Strikecarlis on windows
19:23:26StrikecarlAporia, just as me.
19:23:37Strikecarland they can use --app:gui just fine
19:23:38perturbationAraq: My only motivation in doing so would be to have callers be forced to check type... but I think you are right that it's probably overkill
19:23:45Araqwhat does nim say with --parallelBuild:1 ?
19:24:57Strikecarlsame shit
19:24:57StrikecarlError: execution of an external program failed
19:24:57Strikecarl> Process terminated with exit code 1
19:25:18Araqah so it doesn't find gcc
19:25:32Araqcheck your PATH
19:25:59Araqor maybe it cannot even find Nim
19:26:04StrikecarlIt can find nim
19:26:14StrikecarlI can compile with ease without --app:gui
19:26:29StrikecarlWhat do i have to look for in PATH
19:26:36Strikecarlas i have a shitton in it
19:26:54Araqinvoke the command from the command line please and see what happens
19:27:13Strikecarlwut
19:27:21StrikecarlCan i get that in "not so good to english" mode
19:27:49Strikecarlu mean to see what happens if i remove --app:gui?
19:28:05AraqI mean don't compile from Aporia
19:28:22StrikecarlYeaaa, never tried that before.
19:28:24Strikecarllemme try
19:28:29Araqbut via that black box
19:28:34StrikecarlYea
19:28:40StrikecarlxD
19:29:27Araqcommonly called 20x80 7 baud console. Sometimes with color support, sometimes (but more rarely) with "up arrow key" support
19:30:01StrikecarlHow the fuck do i compile via nim.exe
19:30:27Strikecarloh
19:31:28StrikecarlE:/Programming/Nim/dist/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.9.1/../../../.
19:31:28Strikecarl./x86_64-w64-mingw32/bin/ld.exe: cannot find -lgdi32
19:31:28StrikecarlE:/Programming/Nim/dist/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.9.1/../../../.
19:31:28Strikecarl./x86_64-w64-mingw32/bin/ld.exe: cannot find -lcomdlg32
19:31:28StrikecarlError: execution of an external program failed
19:31:29Strikecarlwoopsie
19:31:34Strikecarlthat ^
19:33:20StrikecarlMingw problem?
19:35:27Strikecarllemme download an other mingw version
19:37:57*yglukhov__ quit (Quit: Be back later ...)
19:38:33*yglukhov__ joined #nim
19:38:33fiocoBbl
19:38:44*fioco quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
19:40:04*Arrrr quit (Quit: WeeChat 1.2)
19:41:25AraqStrikecarl: see? it's the problem I mentioned. use a different mingw version
19:41:35StrikecarlYe, already installing.
19:45:11StrikecarlAlso
19:45:15Strikecarlcompiling related question
19:45:33Strikecarlthe $# at the end of the custom command
19:45:35Strikecarlwhat is that for?
19:46:20fowlSee strutils.format
19:47:00fowl$# is replaced with the module you're compiling
19:47:13Strikecarloh
19:47:27Strikecarlwell fuck this, installed a newer mingw, i get .dll errors
19:47:34Strikecarli'll just hang myself in my LAN cable
19:48:40*Strikecarl quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client)
19:53:00*perturbation quit ()
19:58:23*filcuc joined #nim
20:04:45*Strikecarl joined #nim
20:09:18*Strikecarl quit (Client Quit)
20:11:41EastByteI have a small question, how can I restrict a generic type parameter to int32?
20:11:52EastByte[T: int32] accepts integers of any size
20:14:35federico3anybody willing to give some advice on coding style? https://github.com/FedericoCeratto/gyrofocus
20:15:06AraqEastByte: that's a bug I think. That said, if you want int32 why use a generic type for it?
20:20:26EastBytewell, when I pass a simple number it would be int64
20:20:33EastByteI wanted it to throw an error in that case
20:21:23def-so [T: int8|int16|int32]?
20:21:31EastByte^ basically
20:27:31Araqno, only numbers that have a valid int32 representation can be passed to proc p(x: int32)
20:28:00Araqalso the type for integer literals is 'int', not int64
20:30:47EastByteah, well I said int64 because T is of size 8 when passing a literal
20:30:52EastByteeven with [T: int8|int16|int32]
20:31:21EastByteor shouldn't I use sizeof in that case?
20:31:43Araqwell as I said, that's a well known bug.
20:31:49EastByteokay
20:32:00Araqbut you still haven't answered why you cannot just use proc p(x: int32)
20:32:32EastByteI wanted to be able to add additional sizes in the future
20:32:36EastByteso I used generics
20:32:52Araqyou can always add an overload later
20:33:06Araqor wait for a later that includes a fixed compiler
20:33:16EastByteright
20:33:30*yglukhov__ quit (Quit: Be back later ...)
20:34:13*Ven joined #nim
20:34:34*yglukhov__ joined #nim
20:50:32*yglukhov__ quit (Quit: Be back later ...)
20:52:43*woadwarr_ quit (Quit: My Mac has gone to sleep. ZZZzzz…)
21:02:53*vikaton joined #nim
21:21:25*kas quit (Ping timeout: 264 seconds)
21:35:13*vasher_ joined #nim
21:42:13*dtscode is now known as charmander
21:44:48*filcuc quit (Ping timeout: 244 seconds)
21:57:44Araqozra: I don't consider a nicer pragma syntax essential for version 1. The current syntax needs to be supported for years to come anyway and at the same time doesn't prevent nicer solutions at all.
21:59:23ozraYeah, I think the possibility to place the pragma differently like Varriount_ also noted on is more important. Even though I find it a bit noisy, I think the placement is what cause most of it for me. Would that be possible without ambiguities?
22:01:08AraqVarriount_: uses the [. token which is reserved but not used.
22:01:50Araq@ are harder to retrofit if you don't like the current position
22:01:50ozraI was thinking about the placement before proc def / first in body...
22:02:04ozraah, I see
22:03:12Araqfirst {. .} statement in body is cool, not sure what that will break though
22:06:10Araqbut i like this better than alternative ultimately pointless syntactic alternatives
22:06:50Araqproc p(...) =
22:06:54Araq ## documentation.
22:06:59Araq {.crap.}
22:07:04Araq body
22:07:36Araqor maybe even after 'body'
22:09:50*vendethiel- joined #nim
22:10:09ekarlsoAraq: when's the scope for 1.0 :p
22:10:26Araqafter OSCON :P
22:10:33Araqyou do have a ticket, right?
22:11:41*vendethiel quit (Ping timeout: 256 seconds)
22:11:59*Ven quit (Ping timeout: 252 seconds)
22:13:44ekarlsoAraq: nope :p
22:14:21Araqgo and get one then. it'll be awesome. I will tell you everything I know about Nim.
22:14:33Araqin 3 hours.
22:14:33ekarlsoAraq: hah :p
22:14:51fowlekarlso nim play is great please put it online
22:14:52ekarlsoAraq: if you pay the 1k in plane ticket and the x $ in hotels sure :p
22:15:12ekarlsofowl: once the issues are fixed sure :p
22:15:15AraqI will pay you a beer, how about that?
22:15:29fowlekarlso it works well enough
22:15:49ekarlsoAraq: I tend to get those for free at conferences :p
22:15:54fowlOr is it a security risk right now?
22:16:24Araqekarlso: damn. good point
22:16:55AraqI'll pay you a banana then. I heard these are radioactive
22:17:46ozraAraq: Yeah, first in body ties to the left still (like in the other cases), it's easy to line up - gets out of the way of the signature. And the `{.` should disambiguate from other '{' uses... Seems workable.
22:18:41dom96Araq: what about before proc def?
22:18:55Jehan`What's wrong with the way it currently works?
22:19:41*Trustable quit (Remote host closed the connection)
22:20:30Araqdom96: before proc def doesn't feel nimrodic
22:20:46Araq("nimic" doesn't work, does it?)
22:21:14Jehan`nim-like?
22:21:29AraqJehan`: the current way has been designed by me and so people don't like it.
22:21:47Araqwhich raises all sorts of questions ... :P
22:21:55Jehan`Araq: I think some people think they are more constrained by the layout than they actually are?
22:22:40Araqno their point is that the '=' ends up in a weird position
22:22:44Araqproc p(args)
22:22:48Jehan`You can't put the pragma after the `=` sign, but that's all, and it's part of the proc's type signature, so it should really be part of the header, syntactically.
22:22:56Araq {.pragmas.} =
22:23:08Araq same indentation for body
22:23:14Jehan`Varriount_ was talking about the header block being visually inseparable?
22:23:19ekarlsofowl: it has some funky concurrency issues...
22:23:29ekarlsolike falling on itself when there's too many runs
22:24:11Araqfowl: please help ekarlso or depending on what ekarlso wants, take over this project
22:25:18ekarlsoAraq: ... why is it so hard to help fix the issue..
22:26:26fowlekarlso, which issue is it? nim-play-frontend has no issues and nim-playpen has 2, both are features
22:26:45*Ven joined #nim
22:26:46Araqexactly. what issue?
22:26:52ekarlsofowl: after what I talked with dom96 about it is to make the asyncproc work correctly...
22:27:34Araqjust use CGI. asyncproc won't improve anything
22:27:54Araqyou need to run an external process anyway (the compiler)
22:28:14AraqI wish I knew why that is so hard to swallow
22:29:01ekarlsoaccording to dom96 fowl switch stuff to use epoll on the process streams
22:29:31Araqit takes less time to use CGI than discussing it here
22:29:34fowlnot sure i can help much with anything async, i dont have any experience with it
22:43:27*bjz joined #nim
22:56:56*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
22:57:28*bjz joined #nim
23:12:27*johnsoft quit (Read error: Connection reset by peer)
23:14:07*boopsies quit (Ping timeout: 276 seconds)
23:26:36*boopsies joined #nim
23:36:24*boopsies is now known as boopsiesisaway
23:46:00*bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…)
23:52:43*bjz joined #nim
23:53:52*Matthias247 quit (Read error: Connection reset by peer)
23:58:40*gokr quit (Quit: Leaving.)