00:10:24 | * | brechtm_ quit (Read error: Connection reset by peer) |
00:10:34 | * | brechtm joined #nim |
00:33:10 | * | yglukhov joined #nim |
00:39:23 | * | yglukhov quit (Ping timeout: 244 seconds) |
00:53:27 | * | Karma-Five-Ohm joined #nim |
00:56:03 | * | ftsf joined #nim |
01:06:38 | * | chemist69 quit (Ping timeout: 265 seconds) |
01:16:26 | * | yglukhov joined #nim |
01:17:43 | * | rtr_ quit (Remote host closed the connection) |
01:19:35 | * | chemist69 joined #nim |
01:20:43 | * | yglukhov quit (Ping timeout: 244 seconds) |
01:26:38 | * | ftsf quit (Ping timeout: 250 seconds) |
01:37:59 | * | ftsf joined #nim |
02:01:03 | * | Karma-Five-Ohm quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
02:11:13 | * | Karma-Five-Ohm joined #nim |
02:11:18 | * | krux02 quit (Remote host closed the connection) |
02:15:48 | * | brechtm quit (Read error: Connection reset by peer) |
02:15:54 | * | brechtm_ joined #nim |
02:19:30 | * | ftsf quit (Ping timeout: 250 seconds) |
02:19:48 | * | yglukhov joined #nim |
02:22:16 | * | desophos quit (Read error: Connection reset by peer) |
02:25:49 | * | yglukhov quit (Ping timeout: 244 seconds) |
02:30:56 | * | ftsf joined #nim |
02:50:04 | * | brechtm joined #nim |
02:50:33 | * | brechtm_ quit (Read error: Connection reset by peer) |
02:56:08 | * | bjz joined #nim |
03:09:25 | * | pie_ quit (Changing host) |
03:09:25 | * | pie_ joined #nim |
03:17:56 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
03:23:16 | * | yglukhov joined #nim |
03:27:49 | * | yglukhov quit (Ping timeout: 244 seconds) |
03:41:40 | * | Karma-Five-Ohm left #nim ("Textual IRC Client: www.textualapp.com") |
03:42:24 | * | spindle joined #nim |
03:58:42 | * | Sentreen quit (Ping timeout: 265 seconds) |
04:05:24 | * | yglukhov joined #nim |
04:09:40 | * | yglukhov quit (Ping timeout: 244 seconds) |
04:11:05 | * | Sentreen joined #nim |
04:17:45 | * | kulelu88 quit (Quit: Leaving) |
04:33:20 | ftsf | hmm, how would you make a registry of classes in nim? I want to make a list of subclasses that the user can instantiate at will |
04:34:36 | ftsf | can a variable be of type type? |
04:40:21 | ftsf | I guess i could make a seq of procs that return an instance of that class |
04:43:15 | * | spindle is now known as spindle_ |
04:44:19 | * | spindle_ is now known as spindle__ |
04:45:38 | * | spindle__ is now known as spindle |
04:46:10 | * | yglukhov joined #nim |
04:50:29 | * | yglukhov quit (Ping timeout: 244 seconds) |
05:04:00 | * | ARCADIVS joined #nim |
05:07:54 | * | chemist69 quit (Ping timeout: 260 seconds) |
05:14:14 | * | chemist69 joined #nim |
05:17:37 | * | space-wizard quit (Quit: My Mac has gone to sleep. ZZZzzz…) |
05:17:46 | * | rtr_ joined #nim |
05:25:27 | * | brechtm quit (Read error: Connection reset by peer) |
05:26:43 | mcc | ftsf: there's this typedesc thing, I do not fully understand what uses of it are allowed however |
05:28:20 | * | brechtm joined #nim |
05:28:31 | * | yglukhov joined #nim |
05:32:51 | * | yglukhov quit (Ping timeout: 244 seconds) |
05:40:20 | ftsf | mcc, hmm didn't see that before, but reading the docs for it hurts my head =\ |
05:40:20 | ftsf | but yes, sounds like it might be useful for such a thing |
05:41:08 | ftsf | but the seq of procs returning an instance works |
05:41:39 | * | brechtm quit (Read error: Connection reset by peer) |
05:42:15 | * | brechtm joined #nim |
05:47:29 | mcc | ftsf: my assumption is procs returning an instance would be better anyway because the builtin "constructors" for classes are just sorta field values |
05:47:34 | mcc | right? |
05:47:44 | mcc | so if you wanted any initialization at all, you'd have to write a constructor proc anyway |
05:48:26 | ftsf | yeah |
05:48:54 | ftsf | i use an init method that gets called on each thing though |
05:49:38 | ftsf | but yeah, proc returning instance seems like the nimmy solution |
05:49:43 | ftsf | nimonic? |
05:52:59 | mcc | it sounds sensible |
06:02:53 | * | rtr_ quit (Remote host closed the connection) |
06:19:06 | * | rtr_ joined #nim |
06:26:18 | * | rtr_ quit (Remote host closed the connection) |
06:31:34 | * | planhths joined #nim |
06:40:01 | * | filcuc joined #nim |
06:46:58 | * | Trustable joined #nim |
06:47:10 | flyx | ftsf: just out of curiosity, what is the use-case for such a registry? I mean, why not just provide a constructor proc for each subclass? what is this seq for? |
06:47:42 | ftsf | flyx, there is a constructor proc for each subclass. but I want the user to be able to select which one to instantiate from a list |
06:48:17 | ftsf | my use case is a music studio, they can instantiate different instruments and effects |
06:48:45 | flyx | hmm, okay. well, a seq of procs might be sensible then |
06:48:46 | ftsf | so i could hardcode the list, but i'd like for each instrument to be self contained and register itself |
06:49:33 | flyx | you could declare all the constructors within a block which is passed to a macro, and then have the macro generate all necessary code |
06:49:33 | * | pafmaf joined #nim |
06:50:57 | ftsf | seems to overcomplicate things |
06:51:49 | * | Arrrr joined #nim |
06:51:49 | * | Arrrr quit (Changing host) |
06:51:49 | * | Arrrr joined #nim |
06:54:48 | flyx | well, it would need to do litte more than to add a code line after the proc that adds it to the seq, |
06:55:40 | ftsf | mm i just do `registerMachine("foo", newFoo)` |
06:55:50 | ftsf | so a macro seems unnecessary |
07:09:19 | * | gokr joined #nim |
07:22:42 | * | Arrrr quit (Remote host closed the connection) |
07:29:59 | * | akaisora joined #nim |
07:33:24 | * | Andris_zbx joined #nim |
07:37:39 | * | chemist69 quit (Ping timeout: 265 seconds) |
07:39:40 | * | chemist69 joined #nim |
08:01:11 | * | ftsf quit (Quit: :q!) |
08:13:45 | * | mcc quit (Quit: Connection closed for inactivity) |
08:25:43 | * | fredrik92 joined #nim |
08:28:58 | * | bjz_ joined #nim |
08:32:40 | * | bjz quit (Ping timeout: 265 seconds) |
08:33:00 | * | fredrik92 quit (Quit: Leaving.) |
08:33:52 | * | fredrik92 joined #nim |
08:45:58 | * | bjz_ quit (Read error: Connection reset by peer) |
08:46:29 | * | yglukhov joined #nim |
08:47:14 | * | bjz joined #nim |
09:10:02 | * | Demon_Fox quit (Quit: Leaving) |
09:16:03 | * | ARCADIVS quit (Quit: ARCADIVS) |
09:26:21 | * | GangstaCat joined #nim |
09:36:01 | * | planhths quit (Quit: Konversation terminated!) |
09:42:47 | * | chemist69 quit (Ping timeout: 250 seconds) |
09:42:51 | * | nsf joined #nim |
09:45:45 | * | rtr_ joined #nim |
09:47:20 | * | fredrik92 quit (Read error: Connection reset by peer) |
09:47:44 | * | nicanaca0 quit (Remote host closed the connection) |
09:48:02 | * | chemist69 joined #nim |
09:49:56 | cheatfate | dom96, what do you think if i add function getSelector(disp: PDispatcher): pointer to asycndispatch? |
09:51:24 | * | nicanaca0 joined #nim |
10:04:31 | * | irrequietus joined #nim |
10:07:54 | * | Kaini quit (Remote host closed the connection) |
10:08:33 | * | Kaini joined #nim |
10:09:14 | * | Kaini quit (Remote host closed the connection) |
10:09:57 | * | Kaini joined #nim |
10:10:06 | * | xet7 quit (Quit: Leaving) |
10:11:18 | * | Kaini quit (Remote host closed the connection) |
10:17:20 | * | woggy joined #nim |
10:24:16 | * | opi quit (Quit: ZNC - http://znc.in) |
10:31:04 | * | irrequietus quit (Ping timeout: 264 seconds) |
10:34:38 | * | HollyRain joined #nim |
10:36:28 | * | Kaini joined #nim |
10:36:52 | * | brechtm_ joined #nim |
10:39:47 | * | fredrik92 joined #nim |
10:40:40 | * | brechtm quit (Ping timeout: 264 seconds) |
11:01:44 | HollyRain | is possible to use Nim to create a library to be able to be binded from different languages? |
11:02:10 | * | Snircle joined #nim |
11:02:47 | Araq | yes. |
11:03:17 | HollyRain | but isn't it problematic? mainly because everything relies on garbage collection |
11:04:41 | Araq | not particularly more problematic than anything else that uses its own memory manager. |
11:06:05 | Araq | you can also use --gc:stack (which we use in production) to build DLLs that don't have any GC whatsoever. |
11:06:38 | HollyRain | interesting |
11:06:52 | * | irrequietus joined #nim |
11:07:04 | HollyRain | and how does Nim compares to Crystal? |
11:09:59 | Araq | I don't really know. Crystal is single threaded with Boehm GC. |
11:10:31 | HollyRain | and nim is not also single threaded? |
11:10:44 | flyx | Araq: what actually happens with --gc:stack? without GC, wouldn't all allocated structures leak memory? |
11:11:58 | Araq | flyx: you free the entire region with a single proc call. |
11:12:05 | Araq | HollyRain: no, it's not. |
11:12:39 | flyx | Araq: hm okay, but that means, I actually need to modify the Nim code |
11:12:54 | * | krux02 joined #nim |
11:13:47 | Araq | flyx: var x: MemRegion; withRegion(x): .... not need to modify the stdlib, if that's what you mean |
11:13:56 | Araq | but it's really unsafe ;-) |
11:14:18 | flyx | Araq: no, I meant, I need to modify *my* code. so it is not as simple as compiling it with --gc:stack |
11:14:40 | flyx | (I with http://nim-lang.org/docs/gc.html would explain more about it) |
11:14:48 | HollyRain | Araq, then Nim is multi-threading? |
11:15:42 | * | nairobi joined #nim |
11:20:41 | * | HollyRain left #nim (#nim) |
11:23:57 | * | spindle quit (Quit: Leaving) |
11:36:37 | * | brechtm_ quit (Remote host closed the connection) |
11:37:12 | * | brechtm joined #nim |
11:39:53 | FromGitter | <endragor> HollyRain: see http://nim-lang.org/docs/manual.html#threads |
12:04:56 | * | pafmaf quit (Ping timeout: 265 seconds) |
12:10:39 | * | akaisora quit (Ping timeout: 265 seconds) |
12:13:32 | FromGitter | <BontaVlad> In nim do we have something similar to `dir` in python? |
12:14:42 | FromGitter | <BontaVlad> for those who don't know what `dir` is in python: `dir` will display private, public attributes, method of the object in question, super useful in checking out the object |
12:15:26 | cheatfate | BontaVlad: try `repr` |
12:17:30 | flyx | BontaVlad: since Nim is statically typed, you can just look at the source code (or the generated documentation) |
12:17:49 | FromGitter | <BontaVlad> what is the difference between `$` and `repr`? |
12:18:05 | FromGitter | <BontaVlad> @flyx I see |
12:18:26 | flyx | BontaVlad: in general, you do have the scenario where you have a variable and want to inspect its type, because you already know the type |
12:18:28 | FromGitter | <BontaVlad> @flyx, @cheatfate thx for the response |
12:18:38 | flyx | *you do not |
12:20:08 | flyx | BontaVlad: but it is possible to use the iterators fields() and fieldPairs() to iterate over fields of an object. this is mainly useful for generics and implementing serialization |
12:23:12 | flyx | BontaVlad: and lastly, there's the typeinfo module for inspection, but it is low-level and unsafe |
12:29:14 | FromGitter | <BontaVlad> great, thx again :) |
12:29:40 | flyx | BontaVlad: about `$` and `repr`: `$` is a toString operator which is defined for most basic Nim types. however, it is not available for all types, and if you want to have it on your own type, you have to implement it |
12:30:30 | flyx | BontaVlad: `repr` is a low-level proc which is available for every type and just displays a representation of its internal structure. useful for debugging purposes, but you usually would not want to generate end-user output with it |
12:30:57 | FromGitter | <endragor> iirc `$` is available for all types in `experimental` mode. the default implementation would print all fields |
12:31:29 | * | arnetheduck quit (Remote host closed the connection) |
12:31:46 | flyx | endragor: how does it handle pointer types? |
12:32:37 | hohlerde | I am working on some old nim code (worked with compiler 0.12.x). Actually it looks like that "ref object" types and var parameters of procedures don't work anymore? |
12:32:38 | hohlerde | https://zerobin.tarakis.de/?d1bad41c0ba97bc8#SDDHTSXq9tOai0bMRRvg5+14d/BDAoqkqdCFcAMw4kE= |
12:33:08 | * | arnetheduck joined #nim |
12:33:44 | * | coffeepot joined #nim |
12:33:56 | flyx | hohlerde: you do not need `var` for ref types, they are inherently modifyable |
12:33:58 | FromGitter | <endragor> @flyx: it dereferences them |
12:34:16 | flyx | endragor: wouldn't that be dangerous for cyclic structures |
12:36:38 | hohlerde | flyx: ok, but to me it looks like according to the compiler error that a "ref object" is not compatible with the same var definition in a procedure's signature. I mean, isn't a ref type also a var type? |
12:37:22 | FromGitter | <endragor> flyx: it seems it turns into noop for cyclic types. and, well, it’s in `experimental` for a reason |
12:38:01 | flyx | hohlerde: well that was just a note, not a problem solution. the problem is that you pass a CustomRequest but the proc expects a Request |
12:38:06 | flyx | these are different types |
12:38:29 | flyx | I guess using `method` will fix it |
12:40:23 | hohlerde | flyx: Unfortunately the compiler still complains with "method" |
12:40:55 | flyx | I am not sure whether the compiler should really reject the proc |
12:41:01 | flyx | this may be a bug |
12:41:35 | flyx | well you can always cast result to Request |
12:41:39 | flyx | err, convert |
12:41:51 | hohlerde | jep, I have done taht |
12:41:54 | hohlerde | that works |
12:42:13 | hohlerde | thanks for the clarification |
12:42:59 | flyx | it is not that obvious for me. maybe everything should work and this is a really basic bug |
12:43:22 | * | flyx seldom uses inheritance |
12:44:51 | hohlerde | I'll file a bug report |
12:46:43 | * | fredrik92 quit (Quit: Leaving.) |
12:48:55 | coffeepot | hey guys, this produces a cgen error, anyone know if there's an existing issue for this or does it need a new one https://gist.github.com/coffeepots/1122e6aeef686266c6d42861e47ae134 |
12:54:18 | arnetheduck | coffeepot, works with nlvm ;) |
12:58:02 | coffeepot | arnetheduck good stuff :) Any idea why it doesn't work on devel? Unless it's been updated over the weekend, my Nim is from friday |
12:58:11 | * | GustavoLapasta joined #nim |
12:58:28 | coffeepot | It's not a problem for me, just thought i better report cgen issues |
12:59:39 | arnetheduck | coffeepot, no idea, but coincidentally I'm adding support for that stuff right now ;) |
13:06:54 | coffeepot | awesome! :D |
13:09:45 | * | fredrik92 joined #nim |
13:11:41 | * | PMunch_ joined #nim |
13:11:59 | * | PMunch_ is now known as PMunch |
13:21:23 | yglukhov | dom96: ping |
13:21:40 | * | woggy quit (Disconnected by services) |
13:21:52 | cheatfate | yglukhov, hows your windows tests? |
13:22:09 | yglukhov | cheatfate: argh, havent done yet |
13:36:03 | * | nairobi quit (Remote host closed the connection) |
13:37:28 | * | ftsf joined #nim |
13:38:46 | ftsf | menu.items.add(item) Error: internal error: expr(skField); unknown symbol No stack traceback available |
13:38:55 | ftsf | anyone encountered this before? |
13:43:07 | ftsf | ahh, was using {.this:self.} and menu was self.menu, when i specified self.menu it worked |
13:47:25 | * | irrequietus quit (Ping timeout: 252 seconds) |
13:48:42 | * | gokr quit (Ping timeout: 244 seconds) |
13:58:09 | yglukhov | cheatfate: first bad commit: https://github.com/nim-lang/Nim/commit/87eb3a105d4a2b6f9e9fd18bc6cca18d458d1cca |
13:58:18 | yglukhov | ping dom96 as well |
13:59:54 | * | samuell joined #nim |
14:02:21 | hohlerde | mhmm, looks like asyncdispatch doesn't run in thread context at all |
14:03:22 | * | alexsystemf___ quit (Quit: Connection closed for inactivity) |
14:05:12 | cheatfate | yglukhov, so weird changes |
14:05:24 | cheatfate | yglukhov, i'm giving up |
14:05:38 | cheatfate | let people made this changes to fix their work |
14:12:45 | * | foocraft joined #nim |
14:14:01 | FromGitter | <endragor> @Araq is it by design that `marshal` expects each `string` in an object to be valid UTF-8 string? atm it either crashes or produces invalid results when string stores binary data, because `escapeJson` is used. Perhaps it would make sense to store strings as arrays of charcodes? that would produce stable results regardless of string contents |
14:17:47 | * | pregressive joined #nim |
14:18:50 | * | M-Quora quit (Read error: Connection reset by peer) |
14:18:51 | * | hohlerde quit (Read error: Connection reset by peer) |
14:18:51 | * | TheManiac quit (Read error: Connection reset by peer) |
14:19:47 | flyx | endragor: strings are UTF-8 strings by convention. if you store binary data in a string, you are using it against this convention. |
14:20:19 | flyx | endragor: I think string is just the wrong type to use for binary data |
14:29:06 | FromGitter | <endragor> flyx: even stdlib itself uses strings against this convention (e.g. system.readAll, asyncdispatch.send, asyncdispatch.recv). `seq[byte]` would probably make more sense for that, but I haven’t found a single mention of it in stdlib. |
14:32:14 | FromGitter | <endragor> so far stdlib just uses `string` as `seq[byte]` and assumes UTF-8 encoding whenever string semantics is actually required |
14:34:05 | Araq | yeah well, I remember this problem and have no solution. |
14:34:19 | FromGitter | <endragor> which problem, exactly? |
14:34:36 | Araq | marshal fucking up with my precious binary data :-) |
14:34:59 | FromGitter | <endragor> how about storing strings as arrays? |
14:36:10 | Araq | I don't know what marshal should do. your solution is cool but then marshal doesn't use JSON anymore or does it |
14:36:29 | Araq | and Nim's Json has the same problems anyway |
14:37:04 | Araq | Json has no real support for Blobs I guess and an array of byte codes is just too messy to work with |
14:42:22 | * | planhths joined #nim |
14:43:17 | * | samuell quit (Quit: Hejdå) |
14:46:33 | FromGitter | <endragor> I think it’s the cleanest solution JSON-wise. for `json` module it’s probably OK to assume `string` as UTF-8 encoded string |
14:48:58 | Araq | endragor: ok, PR welcome. |
14:49:20 | * | akaisora joined #nim |
14:49:21 | * | hohlerde joined #nim |
14:50:17 | * | csoriano_ joined #nim |
14:51:06 | * | space-wizard joined #nim |
14:51:24 | * | Sentreen quit (Ping timeout: 244 seconds) |
14:53:07 | * | chemist69 quit (Ping timeout: 255 seconds) |
14:54:19 | ftsf | what makes a capture legal or not? |
14:56:12 | * | chemist69 joined #nim |
14:58:54 | yglukhov | ftsf: from my observation - everything except `result` ;) |
14:59:43 | yglukhov | * everything is legal except `result` |
15:00:48 | ftsf | hmm i just encountered another instance |
15:00:51 | ftsf | i'll try and distill it |
15:02:24 | FromGitter | <endragor> Araq: hmm, on the second thought, this could be fixed on `json` level. There is no sense in escaping stuff the way it escapes. JSON is already UTF-8 so the Nim string could be written as-is. The only thing that should be escaped is control-characters. That should work both for binary and non-binary data, because control characters are < 0x20 and parts UTF-8 rune must never contain control characters (they are always > 0x7F). |
15:02:38 | ftsf | nope. no idea =\ |
15:03:32 | yglukhov | ftsf: gist? |
15:03:49 | Araq | ftsf: result and openarray and var parameters |
15:04:08 | yglukhov | right... |
15:04:23 | * | Sentreen joined #nim |
15:04:34 | Araq | endragor: json is not utf-8, it's unicode, so it requires \u<16 bit number> afaik |
15:06:35 | dom96 | cheatfate: yes, but maybe return something more concrete than just `pointer`. |
15:07:14 | ftsf | https://gist.github.com/ftsf/4a20a1d406982d3a37d545951d5f74b5 machines is a global var |
15:07:46 | cheatfate | dom96, pointer is the only way to be compatible on all OS, and pointer cause programmers to watch at source code, so when they start to use this function it will be not a problem for them... |
15:08:05 | ftsf | if i define a var targetMachine = machine outside the inner loop and use that it's fine |
15:09:02 | hohlerde | I am trying to use niv's websocket implementation in a thread. I have changed a global var definition to use a {.threadvar.} and could eliminate one compile error. however, I am getting a second one: |
15:09:03 | hohlerde | lib/pure/asyncdispatch.nim(1596, 8) Error: 'cb' is not GC-safe as it accesses 'nameIterVar' which is a global using GC'ed memory |
15:09:04 | hohlerde | is there a way to get some more information from the compiler? |
15:09:24 | FromGitter | <endragor> Araq: yeah, the RFC doesn’t strictly specify encoding, saying UTF-8 is the most widespread. But the current implementation of `json` module assumes it’s UTF-8 (or ASCII?), because it uses single-byte representation for everything |
15:10:14 | dom96 | cheatfate: you should return a different pointer for each OS, like when defined(linux): ptr EpollFd elif defined(bsd): ptr kselectFD |
15:10:18 | dom96 | or something similar |
15:10:20 | dom96 | at least |
15:10:20 | * | miere joined #nim |
15:10:37 | yglukhov | dom96: there you are |
15:10:39 | yglukhov | =) |
15:10:44 | dom96 | yglukhov: is it just my commit, or was it all the changes introduced by https://github.com/nim-lang/Nim/pull/4683 ? |
15:10:54 | planhths | hello I am currently taking the 6.00.1x course on edX, If you are interested, I posted code in nim here: https://github.com/konqoro/Course_6001x |
15:11:06 | yglukhov | dom96: can you review my pr to jester please? |
15:11:07 | cheatfate | dom96, but for posix compatible os there only one return value - `ptr Selector` |
15:11:19 | dom96 | planhths: that's awesome, thanks for sharing |
15:11:25 | dom96 | yglukhov: not right now, sorry |
15:11:36 | yglukhov | dom96: thats what git bisect showed on devel. so i guess its just your commit |
15:12:21 | dom96 | cheatfate: okay, then use `ptr Selector` |
15:12:37 | dom96 | still better than `pointer` |
15:13:03 | csoriano_ | if I understood correctly, a non ref object would need an init constructor, and a ref object a new constructor right? and onyl do the object() inside this init or new. |
15:13:06 | csoriano_ | ? |
15:13:51 | dom96 | yglukhov: any chance you could test https://github.com/nim-lang/Nim/commit/3760a8b973781ac3a9b06fa1c054c489f9c7ce3e ? |
15:15:15 | cheatfate | dom96, really don't understand you... all systems now have appropriate function declaration which are compatible. Mostly they are not usable, and even if somebody wants to use it they need to know what they want, so there will be not a problem to cast[ptr Selector](pointer) or cast[Handle](pointer) for this people. |
15:15:40 | yglukhov | dom96: lets trade. you merge my pr, i test the commit? ;) this pr is really important to me to say the least. were going production today. and theres no way in jester to observe the exceptions. |
15:16:13 | * | SunDwarf quit (Remote host closed the connection) |
15:16:39 | yglukhov | dom96: btw sending exception stack trace along with 502 response doesnt really work for ajax :( |
15:16:56 | hohlerde | csoriano_: those are best practices and yes, refs should be created by a newXXX(...) and value objects by a initXXX(...) procs |
15:17:11 | yglukhov | dom96: when cors is messed with |
15:17:23 | dom96 | yglukhov: merged |
15:17:33 | yglukhov | hey, thanks a bunch! |
15:17:38 | dom96 | I don't think any web frameworks handle this well |
15:17:46 | csoriano_ | hohlerde: I see thanks. I saw some code from some nim developer posted on nim twitter and was not following this practices, and confused me a little :) |
15:17:49 | dom96 | I guess a setting for it would be nice though |
15:17:57 | dom96 | Anyway, I need to go now. |
15:18:04 | yglukhov | dom96: ok, see you |
15:18:16 | hohlerde | csoriano_: you may want to take a look at http://nim-lang.org/docs/nep1.html |
15:18:32 | csoriano_ | hohlerde: ah cool, didn't see that. Thanks much |
15:18:33 | dom96 | I'll be back on Wednesday (might be around earlier for a bit) |
15:19:13 | csoriano_ | oh yeah this code https://github.com/nim-lang/Nim/blob/devel/web/bountysource.nim |
15:19:50 | csoriano_ | exactly https://github.com/nim-lang/Nim/blob/devel/web/bountysource.nim#L128 |
15:20:07 | csoriano_ | on the other hand was warned it was a little dirty code, so I guess that's it |
15:21:09 | * | gokr joined #nim |
15:24:12 | hohlerde | csoriano_: as I said, it is not a strict rule to use newXXX and initXXX, especially if you use your own objects internally. furthermore, if your objects don't need any "special" initialization, one may want to omit special constructor procs. |
15:25:01 | ftsf | something weird going on with my app =( memory corruption of some kind.. any advice on how to track it down? is it possible to get valgrind to show nim line numbers / function names? |
15:25:28 | csoriano_ | hohlerde: hm...experience taugh me to be consistent, or pay on maintenance. But yeah I understand it's not required. |
15:26:06 | * | SunDwarf joined #nim |
15:26:06 | hohlerde | csoriano_: I agree |
15:26:58 | cheatfate | yglukhov, let me know about your tests |
15:28:59 | yglukhov | cheatfate: ok, will take about an hour |
15:32:43 | yglukhov | dom96, cheatfate: done. everything is fine with 3760a8b973781ac3a9b06fa1c054c489f9c7ce3e |
15:34:55 | cheatfate | yglukhov, then i think this is new proxy `send()` problem |
15:38:04 | ftsf | do I need to run setupForeignThreadGc for SDL audio callback (which runs in an externally created thread)? if so, where do I run setupForeignThreadGc? |
15:39:24 | * | HollyRain joined #nim |
15:40:54 | * | coffeepot quit (Quit: http://www.kiwiirc.com/ - A hand crafted IRC client) |
15:41:21 | ftsf | GC seems to be clobbering something, when I disable the GC it seems to be stable (but leaking) |
15:41:26 | hohlerde | I guess yes |
15:41:46 | hohlerde | I had to use it in my proc which is called by a windows thread |
15:41:58 | hohlerde | ftsf: at the very beginning of the proc |
15:42:37 | * | gokr quit (Ping timeout: 255 seconds) |
15:43:08 | ftsf | hohlerde, hmm tried that, but still seeing memory issues. |
15:43:10 | hohlerde | are you running on windows or linux/mac? |
15:43:14 | ftsf | linux |
15:43:31 | hohlerde | ok, on windows I also had to set tlsEmulation to off |
15:43:35 | flyx | Araq, endragor: what about defining `type blob: distinct string`, provide a converter from string to blob and then replace the places in stdlib that use string as binary data with blob? |
15:43:52 | ftsf | hohlerde, yeah tested with that on and off |
15:44:49 | ftsf | ok, maybe it's something different and not the audio callback |
15:44:58 | ftsf | (just disabled that and it's still having issues) |
15:45:03 | flyx | then, the marshaler can differentiate between an actual string and some binary data |
15:49:15 | * | GustavoLapasta quit (Read error: Connection reset by peer) |
15:50:22 | * | filcuc quit (Read error: Connection reset by peer) |
16:00:14 | * | PMunch quit (Quit: leaving) |
16:01:51 | * | Andris_zbx quit (Remote host closed the connection) |
16:02:40 | * | akaisora quit (Ping timeout: 244 seconds) |
16:06:44 | * | HollyRain quit (Quit: Leaving) |
16:11:56 | * | vktec left #nim ("So long and thanks for all the fish") |
16:18:19 | * | desophos joined #nim |
16:21:16 | * | akaisora joined #nim |
16:32:19 | * | arnetheduck quit (Ping timeout: 250 seconds) |
16:39:08 | * | xet7 joined #nim |
16:42:49 | * | brechtm_ joined #nim |
16:43:04 | * | fredrik92 quit (Quit: Leaving.) |
16:46:04 | * | planhths quit (Remote host closed the connection) |
16:46:14 | niv | hohlerde: you called? :) |
16:46:43 | * | brechtm quit (Ping timeout: 265 seconds) |
16:47:04 | * | brechtm_ quit (Ping timeout: 240 seconds) |
16:51:24 | * | nairobi joined #nim |
16:53:36 | Sentreen | I see that the `func` keyword is reserved for use by the compiler. Does it indicate side-effect free procs (as discuced here: https://github.com/nim-lang/Nim/issues/2716) or is it just there for future use? |
16:55:31 | * | nairobi quit (Ping timeout: 252 seconds) |
17:08:50 | * | yglukhov quit (Ping timeout: 244 seconds) |
17:24:46 | * | fredrik92 joined #nim |
17:28:56 | * | fredrik92 quit (Client Quit) |
17:33:39 | hohlerde | Hi niv |
17:34:07 | hohlerde | niv: moment pls |
17:34:27 | niv | hohlerde: hi. havent looked into websockets.nim in a while. i suspect its broken on nim 0.14.2? |
17:36:35 | hohlerde | niv: a bit, but it's simple. randomize() has been moved to package random |
17:36:50 | hohlerde | niv: so adding that fixed the import error for me |
17:37:44 | hohlerde | niv: the other errors I encountered deal with threads, so probably not really errors of your websocket module |
17:38:19 | niv | ah. i'll look into updating it soon then. and yes, websockets.nim was never designed to be used in multiple threads, its based on that asyncnet stuff |
17:38:31 | hohlerde | niv: for instance shared.nim uses a global reqPing variable, which doens't work when using in a thread |
17:39:02 | niv | oops? i was a pretty big noob when writing it. i still am, but i was back then too :D |
17:39:05 | hohlerde | niv: and it looks like that the securehash module doesn't like threads |
17:39:27 | hohlerde | niv: nono, the websocket module is great. I am glad you wrote it :) |
17:39:49 | hohlerde | niv: I am just trying to get it running in one of my threads :-) |
17:40:31 | niv | i faintly remember seeing a unfixed bug where this assert ( https://github.com/niv/websocket.nim/blob/master/websocket/shared.nim#L74 ) triggers for masked frames |
17:40:37 | niv | in debug mode anyways. |
17:41:39 | * | rtr_ quit (Remote host closed the connection) |
17:42:07 | hohlerde | niv: I'll investigate securehash further and see if I can get it run in a thread and hopefully I'll be able then to use your websocket module. |
17:42:38 | niv | appreciate the effort. please let me know if you make it work (or run into issues) |
17:42:55 | hohlerde | niv: sure, will do. |
17:43:01 | niv | https://github.com/niv/websocket.nim/commit/e8effbeae5fd13278e8c71027b95a712700766ee |
17:43:08 | niv | might want to pull this in too |
17:43:16 | niv | otherwise client sockets will assert always, i think |
17:44:29 | flyx | so I am getting one of those pesky `type mismatch` errors on proc types that are identical |
17:45:02 | hohlerde | niv: thanks, missed that |
17:45:11 | flyx | what is the set of annotation I can add to my proc so that it conforms with „invisible“ pragmas that are expected on it? |
17:47:50 | niv | hohlerde: no you didnt, i just pushed it :) |
17:49:53 | * | rtr_ joined #nim |
17:50:08 | * | JustATest joined #nim |
17:51:22 | hohlerde | niv: alright :-) |
17:52:04 | * | yglukhov joined #nim |
17:52:23 | * | Matthias247 joined #nim |
17:52:33 | * | JustATest quit (Client Quit) |
17:54:12 | flyx | hmm, it says it expects the proc to have {.closure.}, but I cannot add that to my procs because apparently, that is invalid for top-level procs |
17:54:28 | flyx | why is it expecting {.closure.}? I did not add that to the proc type |
17:56:52 | * | yglukhov quit (Ping timeout: 264 seconds) |
18:00:35 | hohlerde | flyx: that sounds strange. I think I read somewhere on the forum that top level procs can never be closures |
18:08:20 | * | yglukhov joined #nim |
18:08:27 | * | M-Quora joined #nim |
18:08:34 | * | TheManiac joined #nim |
18:21:04 | flyx | hmm, the problem seems to be with generics |
18:21:34 | flyx | it fails because the proc is generic. it instantiates another generic proc, and the proc in its body instantiates the original proc again |
18:22:05 | flyx | this works if used without any pragmas on the proc type I assign to, but fails when I use {.raises: YamlLexerError.} |
18:31:47 | * | yglukhov quit (Remote host closed the connection) |
18:40:02 | * | nairobi joined #nim |
18:44:48 | * | nairobi quit (Ping timeout: 276 seconds) |
18:47:18 | * | akaisora quit (Read error: No route to host) |
18:53:13 | * | PMunch joined #nim |
18:57:08 | * | abeaumont_ joined #nim |
19:01:56 | FromGitter | <moigagoo> Possibly a silly question, but could we ditch IRC in favour of Gitter for good? Since this bot started posting messages from IRC to Gitter, this channel became a mess. I honestly stopped coming here because of how repelling the chat looks now: 90% of messages posted by the same account, visual garbage everywhere. ⏎ ⏎ I know a lot of people feel nostalgic and sentimental about IRC, but with all honesty, it is not proper medium for |
19:01:56 | FromGitter | ... 2016. ⏎ ⏎ Sorry for the rant, but I'm genuinely worried about this channel's attractiveness for the newcomers. [https://gitter.im/nim-lang/Nim?at=57d6fba4b8d4c1384089d049] |
19:04:16 | cheatfate | there is no nostalgic and sentiments about IRC, and there no need to have webbrowser to chat... |
19:14:12 | ehmry | what is the proper medium for 2016? is it not more visual garbage everywhere? |
19:17:18 | * | lenstr quit (Ping timeout: 244 seconds) |
19:17:45 | * | LeNsTR joined #nim |
19:18:14 | * | Ven joined #nim |
19:18:32 | FromGitter | <moigagoo> @ehmry Gitter is. There's persistent history, notifications about missed messages, MD, mentions, and apps for every platform. ⏎ ⏎ WRT visual garbage, compared to IRC within Gitter, vanilla Gitter is much cleaner :-) |
19:19:26 | FromGitter | <moigagoo> @cheatface Well, you don't need a browser to chat with Gitter as well. |
19:19:37 | cheatfate | moigagoo there no apps for every platform... thereis one more Google Chrome browser for every platform |
19:21:13 | FromGitter | <moigagoo> @cheatfate Sorry, I don't follow. Gitter apps are all built with Electron, so yeah, they all basically render the web version. But does that matter? I mean, does the technology behind the app matter as far as it does the job? |
19:21:21 | ehmry | lol, where are those ⏎ ⏎ coming from |
19:21:57 | cheatfate | moigagoo: its like using cannons to shoot flies... |
19:21:59 | FromGitter | <moigagoo> @ehmry Apparently, that's how this IRC bridge renders edited messages :-) |
19:22:50 | cheatfate | moigagoo: all other benefits you mentioned can be made inside of IRC client with plugins... |
19:23:52 | ehmry | I just had to hear the word electron |
19:24:01 | ehmry | my mind is made up |
19:24:49 | FromGitter | <moigagoo> Urgh :-) OK then :-) |
19:28:30 | cheatfate | moigagoo: you know, webbrowser as chat -> more electricity used -> more CO2 goes to atmosphere -> more warm summers -> more usage of conditioners -> more electricity used -> .... -> mankind is going to Mars :) |
19:30:02 | * | yglukhov joined #nim |
19:30:04 | * | PMunch quit (Quit: leaving) |
19:33:51 | ehmry | does the technology behind the app matter as far as it does the job? <-- now we know how you feel about security |
19:37:32 | * | elrood joined #nim |
19:58:05 | * | Ven quit (Read error: Connection reset by peer) |
19:58:34 | * | Ven joined #nim |
19:59:16 | * | Ven quit (Read error: Connection reset by peer) |
19:59:32 | * | irrequietus joined #nim |
20:00:14 | * | Ven joined #nim |
20:03:52 | hohlerde | is gitter open source? |
20:04:09 | hohlerde | or is it a walled garden like slack & co? |
20:05:09 | cheatfate | hohlerde, of course it closed source... and even with closed protocol, but i think it with xmpp inside |
20:05:58 | * | Ven quit (Read error: Connection reset by peer) |
20:06:29 | * | Ven joined #nim |
20:12:56 | * | foocraft quit (Quit: Leaving) |
20:16:58 | * | PMunch joined #nim |
20:17:56 | * | fredrik92 joined #nim |
20:18:57 | * | fredrik92 quit (Client Quit) |
20:19:54 | * | fredrik92 joined #nim |
20:20:07 | * | fredrik92 quit (Client Quit) |
20:20:32 | * | gokr joined #nim |
20:20:57 | * | fredrik92 joined #nim |
20:22:45 | cheatfate | Araq, how can i make with nimscript configuration file which first compiles module1.nim and module2.nim and then it compiles manager.nim |
20:22:46 | cheatfate | ? |
20:28:14 | * | nairobi joined #nim |
20:32:44 | * | nairobi quit (Ping timeout: 244 seconds) |
20:49:11 | * | miere quit (Read error: Connection reset by peer) |
20:53:24 | * | yglukhov quit (Remote host closed the connection) |
20:55:17 | * | yglukhov joined #nim |
20:55:43 | * | fredrik92 quit (Read error: Connection reset by peer) |
20:56:03 | * | Ven quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:57:46 | * | _stowa joined #nim |
20:59:43 | * | spindle joined #nim |
21:01:23 | Araq | cheatfate: you really shouldn't attempt this stunt |
21:01:49 | Araq | why hardcode compilation order? |
21:04:14 | krux02 | how can I eveluta a template from within a macro with a NimNode as argument |
21:04:43 | krux02 | something like getAst(myTemplate(nimNodeArg)) |
21:04:57 | * | yglukhov quit (Remote host closed the connection) |
21:05:08 | krux02 | nimNodeArg is local to the current scope, and myTemplate is in the same module as the macro |
21:05:08 | Araq | I don't think that's possible |
21:05:17 | krux02 | hmm / |
21:05:19 | * | PMunch quit (Read error: Connection reset by peer) |
21:05:24 | * | PMunch_ joined #nim |
21:05:50 | Araq | on the other hand ... I think that just works? |
21:06:01 | Araq | never thought about it, my getAst+templ always works |
21:06:10 | * | _stowa quit (K-Lined) |
21:06:23 | Araq | make the templ take 'untyped' parameters and it works |
21:06:43 | krux02 | I always get Error: wrong number of arguments |
21:07:04 | Araq | so give it the correct number of arguments |
21:07:07 | krux02 | ok that's something that I can't do sadly |
21:07:19 | Araq | lol |
21:07:47 | krux02 | because I use templates to simulate what I would do in c++ with typedefs in classes |
21:08:03 | * | nairobi joined #nim |
21:08:42 | Araq | https://blogs.msdn.microsoft.com/brada/2005/02/11/resource-management/ |
21:08:50 | krux02 | template glslName(t: typedesc[Texture2D]): string = "sampler2D" |
21:09:21 | * | yglukhov joined #nim |
21:10:00 | * | fredrik92 joined #nim |
21:10:39 | * | akaisora joined #nim |
21:10:40 | * | yglukhov quit (Remote host closed the connection) |
21:11:08 | krux02 | normally when I have the incorrect number of arguments it at least tells me what I was trying to call, and what the alternatives are, but this time I did get no information of that kind |
21:11:12 | krux02 | that was a bit sad |
21:11:26 | * | yglukhov joined #nim |
21:13:38 | krux02 | I guess I have to generate code again that calls a macro |
21:14:48 | Araq | getAst is specialized in the compiler |
21:14:58 | Araq | including its error reporting |
21:15:04 | Araq | maybe that's why |
21:17:45 | krux02 | now I have to think a bit how I can do it, when I can't use getAst, it seems like I have to restructure a bit of my code :/ |
21:18:00 | krux02 | not impossible |
21:18:41 | * | yglukhov quit (Remote host closed the connection) |
21:19:23 | * | PMunch_ is now known as PMunch |
21:20:23 | Araq | read the article please |
21:23:20 | * | Trustable quit (Remote host closed the connection) |
21:24:17 | * | yglukhov joined #nim |
21:30:52 | * | yglukhov quit (Remote host closed the connection) |
21:43:24 | * | yglukhov joined #nim |
21:52:35 | * | Jesin quit (Quit: Leaving) |
21:54:22 | * | fredrik92 quit (Quit: Leaving.) |
21:55:04 | * | fredrik92 joined #nim |
21:55:46 | * | pregressive quit (Remote host closed the connection) |
21:56:19 | * | pregressive joined #nim |
22:00:34 | * | pregressive quit (Ping timeout: 244 seconds) |
22:06:00 | * | nairobi quit (Remote host closed the connection) |
22:06:37 | * | nairobi joined #nim |
22:10:49 | * | Matthias247 quit (Read error: Connection reset by peer) |
22:11:02 | * | nairobi quit (Ping timeout: 265 seconds) |
22:21:30 | * | yglukhov_ joined #nim |
22:21:30 | * | yglukhov quit (Read error: Connection reset by peer) |
22:23:52 | * | yglukhov_ quit (Read error: Connection reset by peer) |
22:23:54 | * | yglukhov joined #nim |
22:30:28 | * | yglukhov quit (Ping timeout: 252 seconds) |
22:35:42 | * | yglukhov joined #nim |
22:36:56 | * | mcc joined #nim |
22:45:18 | * | yglukhov quit (Ping timeout: 276 seconds) |
22:49:17 | * | yglukhov joined #nim |
23:03:32 | * | CcxCZ quit (Ping timeout: 240 seconds) |
23:06:07 | * | elrood quit (Quit: Leaving) |
23:10:04 | * | chemist69 quit (Ping timeout: 264 seconds) |
23:11:05 | * | MyMind joined #nim |
23:14:33 | * | Sembei quit (Ping timeout: 276 seconds) |
23:14:50 | * | akaisora quit (Remote host closed the connection) |
23:15:33 | krux02 | Araq: I read the article now. |
23:17:15 | krux02 | If you want my opinion about it, I can only give you my very biased opinion about it, because I only see my use case and my way of programming, and I only have datastructures, wher the ownership of objects to other objects is clear. |
23:18:23 | krux02 | I realized that shared ownership is a very rare case, and only in case of shared ownership someone would need something like locked reference counting |
23:18:53 | krux02 | in most cases it is totally sufficint to embed the type by value in the owning datastructure |
23:19:02 | krux02 | so either it is a seq type, or another object |
23:19:38 | krux02 | I really like the c++ unique_ptr concept, even though I don't like it's verbose name |
23:20:36 | krux02 | but I realized that in modern c++ most pointers and references are still non owning, and they are still just pointers or reference types |
23:22:26 | krux02 | but when c++ is used well, I don't need to write a single destructor, because finalization is automatically bounded to the owner |
23:24:19 | krux02 | The problem is just, that c++ is very bad at encouraging the programmer to go the safe way. It let's the programmer make horrible mistakes that might be very painful in the end. |
23:26:07 | krux02 | I mean the c++ model is not perfect, I can still screw things up, for example I can pass a global variable as reference and then invalidate that reference from within the call |
23:26:13 | krux02 | there is no protection |
23:26:36 | * | irrequietus quit () |
23:27:02 | krux02 | I like the idea to have moveable types, that are non-copyable |
23:27:45 | * | CcxCZ joined #nim |
23:29:06 | * | bjz quit (Quit: My MacBook Pro has gone to sleep. ZZZzzz…) |
23:29:39 | krux02 | To sum it up, I was missing the concept of ownership mentioned in that article. Ok it is older, and maybe it wasn't that well understood or known back then, but I honestly don't agree that most objects need to be activated for garbage collection |
23:36:38 | * | chemist69 joined #nim |
23:38:43 | * | rtr_ quit (Remote host closed the connection) |