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:12 | zezba9000 | I'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:45 | zezba9000 | Anyway to enable the GC (refc) with --os:standalone |
08:52:43 | zezba9000 | I'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:46 | Araq | zezba9000: don't use --os:standalone then ;-) |
10:07:33 | * | vasher_ joined #nim |
10:14:54 | zezba9000 | Araq: Can't. If I take it away then I get the error: "lib/system/mmdisp.nim(37, 22) Error: type mismatch" |
10:16:10 | zezba9000 | The compiler args are: "nim c -c -d:release --cpu:avr --genscript --nomain --gc:refc main" |
10:16:22 | Araq | ah, replace the 1000_0000 by ArrayDummySize please |
10:20:00 | zezba9000 | Is 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:25 | pigmej | reactormonk: pull request done. I think it's ok, but check it please before we will merge it ;) |
10:20:40 | zezba9000 | Probably not a typical use case I know. |
10:23:28 | Araq | zezba9000: the GC requires mmap or similar but if you have no OS, there are workarounds. Not sure why we never did it. |
10:25:47 | zezba9000 | So if a workaround was made the GC could world in standalone? |
10:25:53 | zezba9000 | **could work |
10:26:41 | Araq | yup |
10:27:23 | zezba9000 | How much memory does the GC require with no objects in memory? Like its basline do you think |
10:30:10 | Araq | good question |
10:30:21 | Araq | let's find out |
10:32:30 | zezba9000 | I'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:59 | pigmej | Araq: why async socket doesn't have timeout ? |
10:33:12 | Araq | interesting. Go GC support uses .dynlib and codegenDecl at the same time. I wasn't aware that we support that. :P |
10:33:38 | pigmej | or maybe even more direct question dom96. |
10:33:42 | Araq | pigmej: pretty sure there is timeout support for async |
10:33:58 | pigmej | Araq: docs doesn't mention it at atl |
10:34:02 | pigmej | all* |
10:34:26 | Araq | the select stuff supports a timeout and so does async http server |
10:34:27 | zezba9000 | Where 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:41 | Araq | zezba9000: lib/system/gc.nim |
10:34:47 | dom96 | pigmej: Use sleepAsync and `or` for timeouts |
10:35:03 | pigmej | och why that strange ? |
10:35:25 | dom96 | why is that strange? |
10:35:25 | zezba9000 | k tnx |
10:35:51 | pigmej | dom96: because socket timeout is socket timeout |
10:36:02 | Araq | zezba9000: but you also need to touch lib/system/alloc.nim |
10:36:14 | pigmej | I mean, I would really expect recv()/send() to crash when timeout given |
10:36:14 | Araq | which contains the allocator and which is what uses mmap |
10:36:27 | zezba9000 | aww was just going to ask that |
10:36:52 | dom96 | pigmej: It's easy to write a recvTimeout with this. |
10:37:24 | pigmej | ok, but I still wonder why it cant be 'pure' socket timeout |
10:37:26 | dom96 | the timeouts in httpclient are done via the timeout param in recv |
10:37:29 | dom96 | and they suck |
10:37:41 | pigmej | why ? |
10:37:57 | dom96 | because the timeout applies to each recv call |
10:38:02 | * | Trustable joined #nim |
10:38:07 | dom96 | so get("google.com", timeout = 5000) |
10:38:09 | pigmej | and it's ok |
10:38:13 | dom96 | might take longer than 5 seconds |
10:38:18 | dom96 | which is not what most people want. |
10:38:37 | pigmej | ok, but there we talk about sokects not about http requests which might be redirected or sth |
10:39:05 | pigmej | but sockets are just fds, I would *really* expect to use timeouts on them, instead of emulating it in library / language code |
10:39:09 | zezba9000 | Where 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:28 | dom96 | pigmej: If you mean OS support for timeouts then I'm sure it's there. |
10:39:35 | zezba9000 | ...for the GC to work with an mmap fix |
10:39:44 | pigmej | ah see, yeah I mean't exactly this |
10:39:46 | pigmej | dom96: where? |
10:40:01 | pigmej | because I was starting to wonder what the heck |
10:40:51 | dom96 | Although this won't work for async sockets. |
10:40:54 | dom96 | http://linux.die.net/man/3/setsockopt |
10:41:02 | dom96 | search for 'SO_RCVTIMEO ' |
10:41:07 | pigmej | dom96: yeah I know this |
10:41:11 | pigmej | but "Although this won't work for async sockets." |
10:41:12 | pigmej | ;-) |
10:41:20 | dom96 | You just need to set this option on the socket |
10:41:37 | dom96 | rawsockets module has a setsockopt proc (or something named close to that) |
10:41:55 | pigmej | dom96: but I"m interested in async sokcets |
10:42:28 | dom96 | well then why are you complaining? |
10:43:25 | pigmej | so, setSockOpt + async socket will give me timeouts for recv() on async sokets ? |
10:43:40 | pigmej | or should I use that sleepAsync thingy? |
10:45:07 | dom96 | No. I just said that it won't work for async sockets. |
10:45:16 | dom96 | It will only work for blocking sockets. |
10:45:29 | pigmej | ok, so only way in async sockets is sleepAsync |
10:45:32 | dom96 | yes |
10:46:33 | * | thaless joined #nim |
10:46:54 | pigmej | dom96: sounds a bit 'hacky' for me, but I will check it later ;-) |
10:47:08 | * | dddddd joined #nim |
10:47:37 | dom96 | If you have a better idea do tell. |
10:48:06 | pigmej | I will check, but I would certainly expect timeout on socket |
10:48:32 | dom96 | Why!? |
10:48:37 | Araq | zezba9000: search for "standalone" in lib/system.nim |
10:48:45 | pigmej | dom96: I have to go off now, (i'm in the train) |
10:48:48 | pigmej | will talk to you in ~2h |
10:48:49 | zezba9000 | k |
10:57:59 | * | miglo joined #nim |
11:12:58 | miglo | how can I get the ip address an AsyncSocket is associated with? |
11:13:45 | dom96 | miglo: use acceptAddr |
11:19:28 | miglo | hmm, 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:09 | miglo | wouldn't it be better if AsyncSocket would have access to an address property? |
11:20:40 | miglo | at 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:11 | wuehlmaus | can 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:46 | wuehlmaus | s/model/module/ |
11:53:54 | Araq | wuehlmaus: you mean a simple window with a text edit field? |
11:54:00 | wuehlmaus | yes |
11:54:07 | Araq | not sure if that comes with GTK out of the box |
11:54:10 | * | xificurC quit (Quit: WeeChat 1.2) |
11:54:28 | wuehlmaus | i wonder why dialogs doesn't have one, i would guess that it should be in there |
11:58:15 | Araq | it's not a common dialog, that's why. |
11:58:30 | Araq | also dialogs.nim has been written for Aporia. |
11:58:37 | wuehlmaus | ah |
11:58:55 | wuehlmaus | i love the simplicity of dialogs. |
11:59:45 | Araq | yeah unfortunately it doesn't scale for real UIs |
12:00:09 | * | xificurC joined #nim |
12:00:30 | Araq | tools/nimrepl.nim is some old GTK based code that is a nice starting point |
12:00:57 | Araq | it doesn't compile because it never was ported to later Nim versions |
12:06:10 | * | thotypous quit (Ping timeout: 264 seconds) |
12:06:19 | miglo | I'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:02 | miglo | In the official version clients are getting added within proc serve. In my version within proc processClient. |
12:09:41 | Araq | asycnc doesn't work yet with threads |
12:12:34 | miglo | so does it mean that the pragma threadvar has to be avoided in comination with async? |
12:13:06 | Araq | no, 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:32 | wuehlmaus | Araq: thanks for pointing me to nimrepl.nim which sadly i cannot find |
12:25:49 | Araq | not in tools? |
12:26:40 | wuehlmaus | i don't have a tools directory |
12:26:55 | Araq | look 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:26 | wuehlmaus | thanks, 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:26 | Araq | zezba9000: I'll push a proper distinction between --gc:none and --os:standalone soon, stay tuned |
13:05:19 | * | ozra joined #nim |
13:19:49 | zezba9000 | Araq: 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:19 | r-ku | what would be correct way to create string from pointer + len? |
13:46:16 | r-ku | i 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:49 | Araq | zezba9000: exactly |
14:11:09 | Araq | r-ku: newString(length); copyMem(...) |
14:11:22 | Araq | there is no shortcut for this yet |
14:11:23 | r-ku | thank you |
14:11:43 | * | flaviu quit (Ping timeout: 256 seconds) |
14:12:45 | * | yglukhov__ joined #nim |
14:13:00 | zezba9000 | Awesome! :) |
14:16:44 | * | flaviu joined #nim |
14:18:48 | * | thepreacher joined #nim |
14:22:11 | Araq | zezba9000: how much RAM does the device have? |
14:22:32 | zezba9000 | The one I have is 2kb ram |
14:23:02 | zezba9000 | https://www.arduino.cc/en/Main/ArduinoBoardDuemilanove |
14:24:34 | zezba9000 | Araq: This cool one that just passed Kickstarter is 2.5kb: https://www.kickstarter.com/projects/903888394/arduboy-card-sized-gaming/description |
14:25:13 | zezba9000 | They range from 1 to 2.5kb on average: https://www.arduino.cc/en/Products.Compare |
14:26:31 | Araq | er... I can make things compile but there is no way the gc will run with 2kb |
14:28:32 | zezba9000 | I 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:10 | Araq | no |
14:29:24 | Araq | you don't even have memory for a heap |
14:29:46 | zezba9000 | When the GC boots up does it create a lump of for the heap? |
14:30:53 | Araq | something like that, yes |
14:31:06 | zezba9000 | k I thought it might just need a refCount the size of an int for each object owner. |
14:31:45 | Araq | yes, the GC doesn't need much more than that |
14:31:54 | Araq | but the heap allocator does. |
14:32:46 | zezba9000 | Why does the allocator need more? |
14:33:32 | Araq | because it's been designed to manage memory from 4MB up to Gigabytes |
14:33:43 | Araq | not to "manage" 2K. |
14:34:50 | Araq | for 2K you use entirely different algorithms |
14:35:06 | zezba9000 | So it allocates memeory in chuncks, kinda like .NET? |
14:35:36 | Araq | yup |
14:36:00 | pigmej | reactormonk: ping |
14:36:14 | zezba9000 | ic, is it hard to make a GC like that work in smaller chunks? |
14:36:36 | zezba9000 | I know you do that for performance as most devices have Gigs not KB |
14:37:18 | Araq | managing 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:53 | Araq | which leads us to the question: What do you use that requires copyStringRC1? |
14:38:21 | zezba9000 | Just creating a simple string and getting its .len would give that error |
14:38:53 | Araq | well just "creating a simple string" puts it on the heap |
14:39:10 | zezba9000 | Ya I figured |
14:39:18 | Araq | you need to use array[12, char] instead of string |
14:39:52 | zezba9000 | I know but at that point you might as well right in c++ |
14:40:32 | zezba9000 | I was hoping the GC had a refCount only mode that would allocate only what was needed |
14:41:03 | Araq | not 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:33 | zezba9000 | ya true |
14:41:35 | Araq | "you might as well use C then" is simply never an argument just because C is so poorly designed. |
14:42:01 | zezba9000 | Well on those things it might be valid ;) |
14:43:11 | zezba9000 | Its 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:48 | zezba9000 | But its ok, I do appreciate you taking a look at its feasibility. I understand its one of those nich things |
14:45:22 | ozra | zezba9000: 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:56 | zezba9000 | I 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:13 | zezba9000 | Only take up 1 extra byte per ref object |
14:46:18 | ozra | zezba9000: Someone ported the Go GC a while ago, so you can see there's potential.. |
14:47:02 | zezba9000 | Idk if i'm familiar enough with Nim to do that though. |
14:47:49 | zezba9000 | It 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:17 | Araq | you don't have to do that, just GC when the memory is tight |
14:48:55 | zezba9000 | But do have a GC like that requires more memory overhead correct? |
14:49:26 | zezba9000 | If I don't handle stuff within scope I must have extra reference to it |
14:49:52 | zezba9000 | man can't type sorry been up a long time |
14:50:07 | zezba9000 | **But to have a... |
14:50:50 | Araq | we're talking about 2048 bytes. |
14:51:28 | zezba9000 | Ya and if you only need 1 extra byte per ref object "not" value types it would work out pretty good. |
14:51:35 | Araq | the real question here is "can you afford to scan stack conservatively" |
14:51:54 | Araq | and the answer is: no, you can't. |
14:52:03 | zezba9000 | Probably not, but theres not much ram to scan |
14:53:03 | Araq | so ... no conservative stack scanning --> requires the codegen to emit precise stack maps --> big effort. |
14:53:23 | Araq | well "big" is relative |
14:53:46 | * | fffdfdfdf quit (Ping timeout: 246 seconds) |
14:54:17 | zezba9000 | By conservative do you mean stop the world? |
14:54:34 | Araq | but 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:38 | zezba9000 | Or incremental collection over multiple frames |
14:54:55 | Araq | no, something entirely different, please look it up |
14:55:54 | * | gfdgfdh joined #nim |
14:57:04 | ozra | zezba9000: 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:32 | zezba9000 | Araq: 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:30 | zezba9000 | ozra: lol, Gameboy color only had 32kb. Well some Arduino devices have that |
15:01:04 | ozra | zezba9000: 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:29 | ozra | You'll use constants for different memory locations, list starts etc. Fixed adressing. |
15:04:32 | zezba9000 | Araq: 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:32 | zezba9000 | is the last owner even if its refCount says he's not. |
15:05:35 | Araq | zezba9000: thanks but I'm well aware of how a purely RC'ing GC works. |
15:06:50 | zezba9000 | ozra: I know normal people would probably just do that but thats no fun. |
15:06:59 | Araq | not 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:08 | Araq | bbl |
15:07:15 | zezba9000 | Araq: I'm sure you do, I was pointing out how that kind of GC could run in 2KB of ram |
15:07:42 | ozra | zezba9000: I dunno, it _is_ kinda fun - it's like doing a jigzaw puzzle, with bytes :-P |
15:09:02 | zezba9000 | Araq: 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:14 | zezba9000 | Thats why I started thinking of alternatives |
15:10:02 | zezba9000 | ozra: Ya I know it is but i'm going for a different kind of fun :) |
15:10:45 | * | thepreacher joined #nim |
15:10:46 | ozra | zezba9000: Haha, yeah, I hear you. It's cool trying to pull off something seemingly impossible :) |
15:10:47 | zezba9000 | My test GC wasn't very optamized on ram. |
15:11:04 | * | woadwarr_ quit (Ping timeout: 256 seconds) |
15:11:04 | zezba9000 | ozra: Exactly! |
15:15:11 | * | flaviu quit (Ping timeout: 256 seconds) |
15:15:44 | * | perturbation joined #nim |
15:17:28 | * | woadwarr_ joined #nim |
15:17:48 | zezba9000 | Anyway 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:43 | zezba9000 | I 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:52 | perturbation | Hi 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:23 | perturbation | ...I notice now that there's already a base 32 encoder/decoder. |
15:20:35 | * | woadwarrior quit (Ping timeout: 252 seconds) |
15:20:44 | perturbation | anyway, 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:57 | dom96 | perturbation: Add everything to Nimble's package list! |
16:07:00 | perturbation | dom96: 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:12 | r-ku | var 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:39 | pigmej | hmm, 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:39 | pigmej | client.nim(21, 34) template/generic instantiation from here |
16:40:39 | pigmej | 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:24 | fowl | r-ku you're doing it right but when you dereference and assign it you're creatng copies |
16:59:17 | fowl | r-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:56 | reactormonk | pigmej, morning |
17:05:19 | pigmej | reactormonk: hey :) |
17:05:26 | pigmej | we have problem with nimsuggest / epc |
17:05:56 | pigmej | http://wklej.to/EPPg4 |
17:06:02 | pigmej | epc expects port in first line... |
17:07:17 | * | drewsrem joined #nim |
17:12:51 | reactormonk | pigmej, that's why I put in verbose zero... |
17:13:35 | pigmej | you mean? |
17:13:43 | pigmej | it crashes for me exactly like this |
17:14:29 | reactormonk | pigmej, so apparently we need to return the port first... |
17:14:34 | * | filcuc quit (Ping timeout: 264 seconds) |
17:14:48 | pigmej | yeah that would be cool, I checked nimsuggest source |
17:15:35 | reactormonk | maybe drag compileProject() after the echo and just put it in every of <mode>? |
17:15:36 | pigmej | and that would be easy fix BUT |
17:15:50 | pigmej | I don't know what are other usages of nimsuggest etc |
17:15:58 | pigmej | reactormonk: well not even needed in fact |
17:16:06 | pigmej | we would just need to bind before compileProject |
17:16:10 | pigmej | if mode is mepc |
17:16:23 | reactormonk | Hum |
17:16:36 | pigmej | then pass it to serve |
17:16:40 | reactormonk | we might have race condition here |
17:16:58 | pigmej | where? it's single thread |
17:17:12 | pigmej | ah no |
17:17:13 | reactormonk | you need to run compileProject before serving the first request |
17:17:22 | pigmej | hmm |
17:17:46 | pigmej | then we will need to refuse all commands before compilation occurs |
17:18:51 | pigmej | or return something like 'not yet ready' |
17:18:53 | pigmej | to epc |
17:19:07 | reactormonk | Yup, or simply stall |
17:19:15 | reactormonk | but I think not ready is the correct call here |
17:19:45 | pigmej | but that would mean that we have to check for that 'not yet ready' everywhere |
17:20:13 | * | Sembei joined #nim |
17:20:31 | pigmej | there is also other way of doing it |
17:20:45 | pigmej | we're not yet using output of compileProject |
17:20:46 | reactormonk | https://github.com/ensime/ensime-emacs/blob/master/ensime-client.el#L796-L808 <- also if you have some time :D |
17:21:01 | pigmej | so, the solution would be also to supress output of compileProject |
17:21:11 | pigmej | (redirect it to /dev/null) |
17:21:20 | pigmej | and then after compileProject bring it back |
17:21:28 | pigmej | though hacky(tm) |
17:21:28 | pigmej | ;D |
17:21:38 | reactormonk | works for me |
17:22:08 | * | yglukhov__ quit (Ping timeout: 252 seconds) |
17:22:27 | reactormonk | lisp-style lexical binding? (let *stdout* "/dev/null" ... )? :D |
17:22:29 | pigmej | yeah, I think that would be good solution as long as we will not use compile output |
17:22:47 | * | yglukhov__ joined #nim |
17:22:47 | pigmej | reactormonk: I think it has to be done in nimsuggest |
17:22:54 | reactormonk | pigmej, yup |
17:23:12 | reactormonk | I just think that would be a perfect application of said code ;-) |
17:23:29 | pigmej | ;D |
17:28:04 | r-ku | thanks 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:37 | reactormonk | pigmej, and btw, I really like my tests. You think you can tinker one for thing-at-point? :-) |
17:31:18 | fowl | r-ku string and seq have value semantics |
17:31:20 | pigmej | I will try :) |
17:32:11 | fowl | r-ku imagine if you were passing an array of something and then let x = ptr[] it would make a copy |
17:38:37 | pigmej | reactormonk: I have no idea how to do it multiplatform ;/ |
17:41:27 | Arrrr | How can i get the lowest value from a slice (ej: '1..10' i expect '1') |
17:41:40 | reactormonk | pigmej, emacs on windows? |
17:41:45 | reactormonk | I mean it's not a problem on mac |
17:42:21 | pigmej | reactormonk: I do know how to do it with posix, just backup, dup, open, close, open backup |
17:42:23 | pigmej | but... ;D |
17:42:41 | pigmej | Araq: likes windows ;p |
17:44:58 | perturbation | anyone else having difficulty with koch web with HEAD (17f852c769078f) on devel? |
17:45:14 | perturbation | getting "lib/system.nim(284, 53) Error: '`' expected" as error |
17:45:15 | reactormonk | pigmej, and there's at least one guy with emacs on windows |
17:45:39 | pigmej | ehs ;/ |
17:46:07 | pigmej | anyway, https://github.com/nim-lang/nim-mode/pull/35 this is super cool I think |
17:46:25 | reactormonk | dom96, edited your issue @ https://github.com/nim-lang/Nim/issues/635 |
18:02:13 | federico3 | Can I use selectors on a file? |
18:09:55 | dom96 | reactormonk: what? |
18:18:46 | * | fioco joined #nim |
18:18:49 | fioco | Hello |
18:20:35 | fioco | I'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:12 | dom96 | fioco: asyncnet docs have a good example |
18:21:23 | dom96 | use acceptAddr to get the address |
18:21:38 | dom96 | create a hash table from address to socket |
18:21:42 | fioco | Why would I use asyncnet over net? |
18:21:50 | dom96 | then use hash[address].send("data") |
18:22:10 | dom96 | because it allows you to handle multiple clients in a single thread asynchronously |
18:22:22 | fioco | Ok |
18:22:27 | fioco | Thanks dom96 |
18:22:43 | dtscode | <3 async |
18:27:47 | * | filcuc joined #nim |
18:32:27 | reactormonk | dom96, corrected the link in your original post. |
18:32:54 | dom96 | right... 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:42 | dtscode | ? |
19:02:43 | dtscode | oops |
19:12:47 | ekarlso | meh, wonder what I should do in nim these days :p |
19:13:31 | Araq | ekarlso: fix the bugs? |
19:13:48 | ekarlso | Araq: i dunno compiler stuff :p |
19:14:08 | Araq | you said you abandoned the website for nimble due to bugs |
19:14:41 | ekarlso | hmmms, I dont remember what that was though :P |
19:15:19 | dtscode | a nimble website? |
19:17:19 | perturbation | is 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:07 | ekarlso | Araq: any new usecases for nim atm ? |
19:18:18 | reactormonk | ekarlso, you could somehow make packages.json to match nodejs tools so we could use that one |
19:18:37 | ekarlso | reactormonk: nodejs tools ? |
19:18:45 | reactormonk | ekarlso, for browsing packages etc. |
19:18:51 | reactormonk | dunno if there are any |
19:19:04 | ekarlso | reactormonk: there already is a nim written tool .. |
19:19:08 | ekarlso | that more or the less works :p |
19:19:30 | Araq | perturbation: not really but if you prefer hype over ratio go with the option type. |
19:20:19 | Araq | ekarlso: we already cover every use case :P |
19:20:38 | ekarlso | Araq: tssk :p |
19:20:50 | ekarlso | Araq: u should bring http2 / grpc support ot nim |
19:20:56 | ekarlso | that would make stuff interesting |
19:21:19 | * | Strikecarl joined #nim |
19:22:01 | Strikecarl | I tried --app:gui |
19:22:03 | Strikecarl | but i get this |
19:22:07 | Strikecarl | Error: execution of an external program failed |
19:22:07 | Strikecarl | > Process terminated with exit code 1 |
19:22:23 | Strikecarl | this is my custom command |
19:22:23 | Strikecarl | $findExe(nim) c --threads:on --opt:size --d:release --gc:none --deadCodeElim:on --checks:off --app:gui $# |
19:22:45 | Araq | Strikecarl: known bug with the windows installer, use a mingw from somewhere else |
19:23:11 | Araq | or maybe not? |
19:23:16 | Strikecarl | well |
19:23:20 | Strikecarl | My friends that code nim |
19:23:22 | Strikecarl | is on windows |
19:23:26 | Strikecarl | Aporia, just as me. |
19:23:37 | Strikecarl | and they can use --app:gui just fine |
19:23:38 | perturbation | Araq: 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:45 | Araq | what does nim say with --parallelBuild:1 ? |
19:24:57 | Strikecarl | same shit |
19:24:57 | Strikecarl | Error: execution of an external program failed |
19:24:57 | Strikecarl | > Process terminated with exit code 1 |
19:25:18 | Araq | ah so it doesn't find gcc |
19:25:32 | Araq | check your PATH |
19:25:59 | Araq | or maybe it cannot even find Nim |
19:26:04 | Strikecarl | It can find nim |
19:26:14 | Strikecarl | I can compile with ease without --app:gui |
19:26:29 | Strikecarl | What do i have to look for in PATH |
19:26:36 | Strikecarl | as i have a shitton in it |
19:26:54 | Araq | invoke the command from the command line please and see what happens |
19:27:13 | Strikecarl | wut |
19:27:21 | Strikecarl | Can i get that in "not so good to english" mode |
19:27:49 | Strikecarl | u mean to see what happens if i remove --app:gui? |
19:28:05 | Araq | I mean don't compile from Aporia |
19:28:22 | Strikecarl | Yeaaa, never tried that before. |
19:28:24 | Strikecarl | lemme try |
19:28:29 | Araq | but via that black box |
19:28:34 | Strikecarl | Yea |
19:28:40 | Strikecarl | xD |
19:29:27 | Araq | commonly called 20x80 7 baud console. Sometimes with color support, sometimes (but more rarely) with "up arrow key" support |
19:30:01 | Strikecarl | How the fuck do i compile via nim.exe |
19:30:27 | Strikecarl | oh |
19:31:28 | Strikecarl | E:/Programming/Nim/dist/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.9.1/../../../. |
19:31:28 | Strikecarl | ./x86_64-w64-mingw32/bin/ld.exe: cannot find -lgdi32 |
19:31:28 | Strikecarl | E:/Programming/Nim/dist/mingw/bin/../lib/gcc/x86_64-w64-mingw32/4.9.1/../../../. |
19:31:28 | Strikecarl | ./x86_64-w64-mingw32/bin/ld.exe: cannot find -lcomdlg32 |
19:31:28 | Strikecarl | Error: execution of an external program failed |
19:31:29 | Strikecarl | woopsie |
19:31:34 | Strikecarl | that ^ |
19:33:20 | Strikecarl | Mingw problem? |
19:35:27 | Strikecarl | lemme download an other mingw version |
19:37:57 | * | yglukhov__ quit (Quit: Be back later ...) |
19:38:33 | * | yglukhov__ joined #nim |
19:38:33 | fioco | Bbl |
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:25 | Araq | Strikecarl: see? it's the problem I mentioned. use a different mingw version |
19:41:35 | Strikecarl | Ye, already installing. |
19:45:11 | Strikecarl | Also |
19:45:15 | Strikecarl | compiling related question |
19:45:33 | Strikecarl | the $# at the end of the custom command |
19:45:35 | Strikecarl | what is that for? |
19:46:20 | fowl | See strutils.format |
19:47:00 | fowl | $# is replaced with the module you're compiling |
19:47:13 | Strikecarl | oh |
19:47:27 | Strikecarl | well fuck this, installed a newer mingw, i get .dll errors |
19:47:34 | Strikecarl | i'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:41 | EastByte | I have a small question, how can I restrict a generic type parameter to int32? |
20:11:52 | EastByte | [T: int32] accepts integers of any size |
20:14:35 | federico3 | anybody willing to give some advice on coding style? https://github.com/FedericoCeratto/gyrofocus |
20:15:06 | Araq | EastByte: that's a bug I think. That said, if you want int32 why use a generic type for it? |
20:20:26 | EastByte | well, when I pass a simple number it would be int64 |
20:20:33 | EastByte | I wanted it to throw an error in that case |
20:21:23 | def- | so [T: int8|int16|int32]? |
20:21:31 | EastByte | ^ basically |
20:27:31 | Araq | no, only numbers that have a valid int32 representation can be passed to proc p(x: int32) |
20:28:00 | Araq | also the type for integer literals is 'int', not int64 |
20:30:47 | EastByte | ah, well I said int64 because T is of size 8 when passing a literal |
20:30:52 | EastByte | even with [T: int8|int16|int32] |
20:31:21 | EastByte | or shouldn't I use sizeof in that case? |
20:31:43 | Araq | well as I said, that's a well known bug. |
20:31:49 | EastByte | okay |
20:32:00 | Araq | but you still haven't answered why you cannot just use proc p(x: int32) |
20:32:32 | EastByte | I wanted to be able to add additional sizes in the future |
20:32:36 | EastByte | so I used generics |
20:32:52 | Araq | you can always add an overload later |
20:33:06 | Araq | or wait for a later that includes a fixed compiler |
20:33:16 | EastByte | right |
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:44 | Araq | ozra: 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:23 | ozra | Yeah, 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:08 | Araq | Varriount_: uses the [. token which is reserved but not used. |
22:01:50 | Araq | @ are harder to retrofit if you don't like the current position |
22:01:50 | ozra | I was thinking about the placement before proc def / first in body... |
22:02:04 | ozra | ah, I see |
22:03:12 | Araq | first {. .} statement in body is cool, not sure what that will break though |
22:06:10 | Araq | but i like this better than alternative ultimately pointless syntactic alternatives |
22:06:50 | Araq | proc p(...) = |
22:06:54 | Araq | ## documentation. |
22:06:59 | Araq | {.crap.} |
22:07:04 | Araq | body |
22:07:36 | Araq | or maybe even after 'body' |
22:09:50 | * | vendethiel- joined #nim |
22:10:09 | ekarlso | Araq: when's the scope for 1.0 :p |
22:10:26 | Araq | after OSCON :P |
22:10:33 | Araq | you 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:44 | ekarlso | Araq: nope :p |
22:14:21 | Araq | go and get one then. it'll be awesome. I will tell you everything I know about Nim. |
22:14:33 | Araq | in 3 hours. |
22:14:33 | ekarlso | Araq: hah :p |
22:14:51 | fowl | ekarlso nim play is great please put it online |
22:14:52 | ekarlso | Araq: if you pay the 1k in plane ticket and the x $ in hotels sure :p |
22:15:12 | ekarlso | fowl: once the issues are fixed sure :p |
22:15:15 | Araq | I will pay you a beer, how about that? |
22:15:29 | fowl | ekarlso it works well enough |
22:15:49 | ekarlso | Araq: I tend to get those for free at conferences :p |
22:15:54 | fowl | Or is it a security risk right now? |
22:16:24 | Araq | ekarlso: damn. good point |
22:16:55 | Araq | I'll pay you a banana then. I heard these are radioactive |
22:17:46 | ozra | Araq: 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:41 | dom96 | Araq: what about before proc def? |
22:18:55 | Jehan` | What's wrong with the way it currently works? |
22:19:41 | * | Trustable quit (Remote host closed the connection) |
22:20:30 | Araq | dom96: before proc def doesn't feel nimrodic |
22:20:46 | Araq | ("nimic" doesn't work, does it?) |
22:21:14 | Jehan` | nim-like? |
22:21:29 | Araq | Jehan`: the current way has been designed by me and so people don't like it. |
22:21:47 | Araq | which raises all sorts of questions ... :P |
22:21:55 | Jehan` | Araq: I think some people think they are more constrained by the layout than they actually are? |
22:22:40 | Araq | no their point is that the '=' ends up in a weird position |
22:22:44 | Araq | proc p(args) |
22:22:48 | Jehan` | 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:56 | Araq | {.pragmas.} = |
22:23:08 | Araq | same indentation for body |
22:23:14 | Jehan` | Varriount_ was talking about the header block being visually inseparable? |
22:23:19 | ekarlso | fowl: it has some funky concurrency issues... |
22:23:29 | ekarlso | like falling on itself when there's too many runs |
22:24:11 | Araq | fowl: please help ekarlso or depending on what ekarlso wants, take over this project |
22:25:18 | ekarlso | Araq: ... why is it so hard to help fix the issue.. |
22:26:26 | fowl | ekarlso, 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:46 | Araq | exactly. what issue? |
22:26:52 | ekarlso | fowl: after what I talked with dom96 about it is to make the asyncproc work correctly... |
22:27:34 | Araq | just use CGI. asyncproc won't improve anything |
22:27:54 | Araq | you need to run an external process anyway (the compiler) |
22:28:14 | Araq | I wish I knew why that is so hard to swallow |
22:29:01 | ekarlso | according to dom96 fowl switch stuff to use epoll on the process streams |
22:29:31 | Araq | it takes less time to use CGI than discussing it here |
22:29:34 | fowl | not 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.) |