| 00:03:05 | * | jsgrant joined #nim | 
| 00:15:38 | * | MJCaley joined #nim | 
| 00:25:57 | * | MJCaley quit (Quit: MJCaley) | 
| 00:28:10 | * | skrylar joined #nim | 
| 00:30:24 | * | dddddd quit (Ping timeout: 248 seconds) | 
| 00:45:12 | * | cspar_ joined #nim | 
| 00:46:27 | * | cspar quit (Ping timeout: 240 seconds) | 
| 00:48:00 | * | craigger_ quit (Quit: bye) | 
| 00:48:19 | * | craigger joined #nim | 
| 00:48:33 | * | craigger quit (Client Quit) | 
| 00:48:49 | * | craigger joined #nim | 
| 00:55:43 | * | couven92 quit (Quit: Client Disconnecting) | 
| 01:03:44 | * | MJCaley joined #nim | 
| 01:07:46 | FromGitter | <raydf> hello guys | 
| 01:08:24 | FromGitter | <raydf> is there any example using the js backend with a function that has a callback as param? | 
| 01:09:52 | * | vivus joined #nim | 
| 01:13:56 | * | MJCaley quit (Quit: MJCaley) | 
| 01:17:39 | * | MJCaley joined #nim | 
| 01:19:14 | * | skrylar quit (Remote host closed the connection) | 
| 01:24:21 | * | endragor joined #nim | 
| 01:28:41 | * | endragor quit (Ping timeout: 240 seconds) | 
| 01:33:41 | FromGitter | <Varriount> @raydf Well, using a function as a callback on the JS backend should be no different from using a function as a callback on the other backends. | 
| 01:33:56 | Araq | raydf: read my karax examples perhaps | 
| 01:34:04 | FromGitter | <Varriount> Or look here: https://nim-lang.org/docs/manual.html#types-procedural-type | 
| 01:34:07 | Araq | https://nim-lang.org/araq/karax.html | 
| 01:35:01 | FromGitter | <raydf> i'm trying to use cordova with karax and all the plugins use callbacks | 
| 01:35:40 | FromGitter | <raydf> i'll experiment with both examples, thanks | 
| 01:38:07 | FromGitter | <raydf> @Araq where is the code for ``` from future import `=>` ```? | 
| 01:40:35 | FromGitter | <raydf> never mind | 
| 01:40:42 | FromGitter | <raydf> thanks | 
| 01:44:27 | * | yglukhov joined #nim | 
| 01:45:19 | * | yglukhov quit (Read error: Connection reset by peer) | 
| 01:45:44 | * | yglukhov joined #nim | 
| 01:52:03 | * | vivus quit (Quit: Leaving) | 
| 02:02:11 | * | mr_yogurt joined #nim | 
| 02:06:36 | * | cspar__ joined #nim | 
| 02:07:06 | mr_yogurt | Varriount: your plugin might be randomly inserting DELs (ascii character \127) into my code | 
| 02:09:22 | * | cspar_ quit (Ping timeout: 240 seconds) | 
| 02:10:04 | FromGitter | <Varriount> mr_yogurt: O_o | 
| 02:10:30 | FromGitter | <Varriount> When? | 
| 02:10:30 | mr_yogurt | either that or sublime text, or i have clumsy fingers and am accidentally hitting the hotkey for it | 
| 02:10:38 | mr_yogurt | i'm not even sure | 
| 02:11:04 | FromGitter | <Varriount> I've never had the plugin insert odd characters for me.. | 
| 02:11:07 | mr_yogurt | just, sometimes nim breaks because of unexpected character \127 | 
| 02:11:32 | mr_yogurt | i don't know if it's your plugin | 
| 02:11:37 | FromGitter | <Varriount> I'll add it to the list of things to look out for. | 
| 02:22:48 | * | chemist69 quit (Ping timeout: 240 seconds) | 
| 02:25:15 | alexday | I am trying to unmarshal json on a type, so I did a import json and then I am using the to(resp.body, SuccessResponse) . but when I compile with nim c -r then it says Error: undeclared identifier: 'to' | 
| 02:25:20 | alexday | what am I missing | 
| 02:35:43 | FromGitter | <Varriount> alexday: Could you show us your code? | 
| 02:35:59 | alexday | ok. let me gist it | 
| 02:36:08 | alexday | its pretty bad though :P | 
| 02:36:48 | * | chemist69 joined #nim | 
| 02:37:41 | alexday | https://gist.github.com/argentum47/ef27c93c1a4f96e60f25692141c3522c | 
| 02:38:04 | alexday | Nim Compiler Version 0.16.0 (2017-01-09) [MacOSX: amd64] | 
| 02:38:26 | alexday | apis.nim(35, 16) Error: undeclared identifier: 'to' | 
| 02:38:48 | * | MJCaley quit (Quit: MJCaley) | 
| 02:51:17 | * | vlad1777d quit (Ping timeout: 268 seconds) | 
| 02:59:50 | * | skrylar joined #nim | 
| 03:05:15 | * | Serenit0r joined #nim | 
| 03:07:40 | FromGitter | <Varriount> in.nim(35, 18) Error: type mismatch: got (string, type ApiResponseSuccess) ⏎ but expected one of:  ⏎ macro to(node: JsonNode; T: typedesc): untyped | 
| 03:26:15 | * | redlegion quit (Ping timeout: 255 seconds) | 
| 03:29:57 | * | redlegion joined #nim | 
| 03:29:58 | * | redlegion quit (Changing host) | 
| 03:29:58 | * | redlegion joined #nim | 
| 03:47:43 | * | marenz_ joined #nim | 
| 03:51:02 | alexday | how do I convert response body to json node? | 
| 03:51:28 | * | marenz__ quit (Ping timeout: 248 seconds) | 
| 03:51:53 | alexday | parseJson I think | 
| 03:52:07 | alexday | oh got it | 
| 03:55:13 | alexday | but I still get an undeclared keyword `to`. | 
| 03:57:58 | alexday | is this a version mismatch? | 
| 04:00:32 | * | sz0 quit (Quit: Connection closed for inactivity) | 
| 04:01:06 | alexday | updating to 0.17.2 fixes that. | 
| 04:01:17 | alexday | I have other errors now. cool | 
| 04:04:20 | * | mr_yogurt quit (Ping timeout: 260 seconds) | 
| 04:08:26 | * | endragor joined #nim | 
| 04:10:56 | alexday | using a tuple in my code example is ok? or is there a way to say like the function return type can be any of this two types? or what is the right way? | 
| 04:12:10 | * | dexterk joined #nim | 
| 04:44:21 | alexday | https://gist.github.com/argentum47/ef27c93c1a4f96e60f25692141c3522c I am getting this error: | 
| 04:44:23 | alexday | apis.nim(40, 18) template/generic instantiation from here | 
| 04:44:25 | alexday | lib/pure/json.nim(1692, 7) Error: attempting to call undeclared routine: 'val=' | 
| 04:44:28 | alexday | what does it mean? | 
| 04:45:54 | * | Yardanico joined #nim | 
| 04:46:39 | * | Yardanico quit (Remote host closed the connection) | 
| 04:49:23 | alexday | if I remove the Option[string] then everything works. but I need the next to be opional | 
| 04:52:05 | * | marenz_ quit (Ping timeout: 240 seconds) | 
| 05:00:08 | skrylar | mratsim: oi. do you have problems with NaNs in your neural nets? | 
| 05:00:36 | skrylar | i sometimes get them, but its usually when the hyperparameters are set very wrong; although i don't read people having the issue | 
| 05:04:32 | * | SenasOzys quit (Ping timeout: 248 seconds) | 
| 05:06:34 | * | noonien quit (Quit: Connection closed for inactivity) | 
| 05:07:06 | * | jsgrant_ joined #nim | 
| 05:08:47 | * | jsgrant quit (Ping timeout: 248 seconds) | 
| 05:16:46 | * | SenasOzys joined #nim | 
| 05:17:50 | * | cspar__ quit (Ping timeout: 255 seconds) | 
| 05:31:18 | * | JappleAck joined #nim | 
| 05:34:24 | * | jhope joined #nim | 
| 05:38:07 | jhope | Hello, we're looking to build out a remote team to port a Python project over to Nim, since the community is small, it's unclear what the best way to find/solicit Nim developers? are job posts welcome in the forums? | 
| 05:41:54 | * | SenasOzys quit (Remote host closed the connection) | 
| 05:42:06 | * | SenasOzys joined #nim | 
| 05:47:11 | FromGitter | <Varriount> jhope: How big is the project? | 
| 05:47:27 | FromGitter | <Varriount> And is this a commercial project, or an open-source one? | 
| 05:49:37 | jhope | Varriount, it's commercial (in the sense that it's paid), and open source, we're looking to implement an Ethereum Blockchain client in Nim | 
| 05:51:19 | jhope | It's rather large, we're looking to have an initial team size of 5 on it, | 
| 05:54:36 | jhope | The reason for Nim is it's portability, we want to run on resource-restricted devices. Currently we're using a Golang implementation go-ethereum on mobile devices and its rather hefty, in addition to this the latest research is currently done in Python, so having a Nim port being closer in style may serve in porting latest developments out faster. | 
| 05:57:22 | * | jsgrant_ quit (Ping timeout: 240 seconds) | 
| 05:59:36 | * | SenasOzys quit (Read error: Connection reset by peer) | 
| 05:59:43 | * | SenasOzys_ joined #nim | 
| 06:00:22 | FromGitter | <Varriount> jhope: I would post on the forum. I wish you luck! | 
| 06:01:30 | jhope | Thanks Varriount | 
| 06:01:42 | FromGitter | <Varriount> jhope: Feel free to post here and on the forum any questions you have.  The community is pretty helpful | 
| 06:09:37 | alexday | how do I marshal an object of a custom type? if I do %(someobject) it shows error. if I do $$someobject , then it wraps the hash structure in array with some random number as the first value. | 
| 06:10:20 | alexday | is there something like {.inheritable.} ? | 
| 06:10:57 | alexday | oh sorry my bad | 
| 06:11:07 | alexday | it works actually. | 
| 06:16:36 | alexday | how to stop comparing response.status to strings? can I have only integers? or are there constants in the language? | 
| 06:17:21 | alexday | oh got them. Http<Tab> I was doing http<tab> :P | 
| 06:18:02 | * | miran joined #nim | 
| 06:27:47 | * | dexterk quit (Quit: Konversation terminated!) | 
| 06:34:53 | skrylar | how many libs do we actually have for that stuff | 
| 06:35:04 | skrylar | doesn't etherium need some SECP curve crypto things | 
| 06:38:11 | skrylar | @qqtop well you can now get data out of firebird | 
| 06:43:22 | skrylar | there is also a new 'fun' landmine in that varchars are returned as pascal strings which means you have to decode a cshort when copying values out of the cursor | 
| 06:50:02 | * | JappleAck quit (Ping timeout: 240 seconds) | 
| 06:59:07 | jhope | skrylar: i imagine wrapping libgcrypt , also theres talk of moving to libp2p instead of devp2p, in thise case there is c-libp2p | 
| 07:00:48 | ipjk | Wrapping is so nice and smooth in Nim. | 
| 07:01:09 | jhope | there's already a wrapper for gmp | 
| 07:02:02 | jhope | that pretty much covers the majority of dependencies, except maybe database, most implementations use leveldb and i've seen a few wrappers for that | 
| 07:02:53 | skrylar | i looked at rocksdb once | 
| 07:02:56 | skrylar | it seemed okay | 
| 07:03:02 | skrylar | rocks is leveldb plus some stuff iirc | 
| 07:03:21 | skrylar | we have mysql/postgres stuff somewhere. i have a firebird wrapper | 
| 07:03:21 | * | JappleAck joined #nim | 
| 07:04:39 | jhope | Rocksdb would be really interesting | 
| 07:05:10 | jhope | the leveldb in memory requirement is not really ideal | 
| 07:05:14 | Xe | a remote nim job does sound good, you by chance based in canada? | 
| 07:05:23 | Xe | (looking to GTFO trumpland) | 
| 07:06:38 | jhope | We're based out of Switzerland, most of the team is remote but euro-centric | 
| 07:07:40 | skrylar | The last holdout for privacy laws =p | 
| 07:08:25 | skrylar | what do you actually need the database for; storing blockchain data? | 
| 07:09:31 | jhope | Indeed :) | 
| 07:09:40 | jhope | yeah for blockchain data | 
| 07:11:11 | * | jsgrant_ joined #nim | 
| 07:11:48 | skrylar | i looked in to that at one point for caching namecoin (and clones) for an altdns thing | 
| 07:12:25 | skrylar | i suppose leveldb is fine-ish? it works if you're just storing stacks of blocks, i'd just go with a normal db if you're doing something like the querying servers | 
| 07:12:31 | skrylar | Rethink DB was nice | 
| 07:14:55 | skrylar | though probably not appropriate for that as blockchains dont change schema. meh | 
| 07:15:30 | jhope | I dont think leveldb is actually ideal, iirc it's designed as a disk backed mem db, Blockchain is much larger than what can be held entirely in memory | 
| 07:15:46 | ipjk | Xe Europe is kind of messy atm | 
| 07:16:21 | skrylar | jhope, well, most of those servers are just using it as a data dump | 
| 07:16:44 | skrylar | they aren't making queries, they're just checking signatures | 
| 07:18:04 | skrylar | Since I don't know what you're actually doing (writing nodes?) i can only point you towards things like DruidDB (columnar, time-series data) Rethink (real-time, nosql) Sqlite/Firebird (embeddable, transactions) and such. | 
| 07:18:05 | Xe | ipjk: which is why i'm hoping to move to canada, at the very least i'll be insulated from the insanity | 
| 07:19:09 | skrylar | although you will probably still need the rocks/leveldb (or just a flat file store?) for raw blocks, since those are basically the transaction logs for the whole system x_x | 
| 07:24:33 | jhope | Our predominant use case is on mobile, so Rocksdb-lite is interesting for sure, having that said we have to have archival nodes also | 
| 07:26:07 | jhope | I notice the Parity implementation uses Hashdb on servers and Rocksdb for their light clients | 
| 07:26:08 | skrylar | Mmm. Mobile stuff tends to just use obelisk servers last i was involved | 
| 07:26:34 | jhope | they store blockchain headers from checkpoints | 
| 07:26:59 | jhope | they don't store state, except that which they cache when requesting it | 
| 07:27:03 | skrylar | on android, sqlite is ubiquitous (and part of the OS) | 
| 07:28:33 | skrylar | when i was last involved, the mobile clients would use obelisk or some internal thing (there was some popular light client at the time; although this was just for bitcoin) because they could just ask it 'show me all transactions for my wallet' | 
| 07:29:06 | skrylar | mobile clients don't really need much more than that, and since metering is the default its sort of costly to parse blockchains on the phone | 
| 07:30:03 | skrylar | unless you're making an app for fellow cypherpunks and not normies, in which case meh | 
| 07:30:22 | jhope | https://status.im/ | 
| 07:30:50 | jhope | for normies, but staying true to cypherpunk ideal as possible | 
| 07:31:16 | * | skrylar shakes head at ETH but no ETC | 
| 07:31:38 | skrylar | ETH is not trustworthy. The DAO rollback defeated the whole chain of trust ETH was supposed to engender. But its a product so. meh | 
| 07:31:58 | jhope | the problem is of trust, if you have to extend too much trust to servers theres some seirous problems. | 
| 07:32:07 | jhope | skrylar: i felt like that too when it happened | 
| 07:32:24 | skrylar | I will never use ETH personally for that reason | 
| 07:32:40 | skrylar | ETC is debatable. neat idea | 
| 07:32:40 | jhope | Blockchains are only immutable insofar is that there is not enough majority rule | 
| 07:32:54 | jhope | for ever the Parity hacks have't been unfrozen | 
| 07:32:59 | jhope | for example* | 
| 07:33:29 | skrylar | well the thing in this specific case is that the founders of eth had a conflict of interest in the decision | 
| 07:33:39 | skrylar | they did it to recover their own losses for their own careless mistakes in something they put on the platform | 
| 07:34:06 | skrylar | which sets a precedent that its only safe as long as nobody cares. which is pointless | 
| 07:34:48 | jhope | well, thats hard to deny, I think demonstrating that ETH can handle its problems is useful to demonstrate to the SEC | 
| 07:35:36 | skrylar | well. you can write safeties in to dapps | 
| 07:35:46 | skrylar | they just didn't, and then learned why orgs have chairmen lol | 
| 07:36:11 | jhope | We don't really have the tooling available to write ultra-reliable smart contracts | 
| 07:36:35 | jhope | We need formal verification solution thats easy to use and way better practices, ie multiple implementations checking state | 
| 07:36:41 | skrylar | i haven't seen that smart contracts can actually do much | 
| 07:37:30 | skrylar | i think they were working on that, because they really do need a signal layer for dapps to interact with non-dapps | 
| 07:37:38 | skrylar | same thing is biting IPFS right now | 
| 07:40:35 | skrylar | jhope, well let me know if you find a db system that is particularly interesting. some of them aren't hard to wrap | 
| 07:40:37 | jhope | for state changes on blockchain Logs work well, acts as signal, could be better though I agree | 
| 07:41:04 | jhope | will do, thanks skrylar! | 
| 07:41:40 | skrylar | Rocks and Level are probably simple since they are fundamentally memcached-esque, although i think rocks client lib is in C++ only | 
| 07:41:54 | skrylar | seem to recall that one is 3-4 core functions but more like 80 in total for weird things | 
| 07:45:00 | * | JappleAck quit (Remote host closed the connection) | 
| 07:45:43 | * | JappleAck joined #nim | 
| 07:54:41 | * | skrylar quit (Ping timeout: 248 seconds) | 
| 08:03:12 | * | SenasOzys_ quit (Ping timeout: 248 seconds) | 
| 08:03:52 | * | nsf joined #nim | 
| 08:06:55 | * | SenasOzys_ joined #nim | 
| 08:11:32 | * | SenasOzys_ quit (Ping timeout: 255 seconds) | 
| 08:12:46 | * | SenasOzys_ joined #nim | 
| 08:21:13 | crem | Is there nim's equivalent of C's ` while (MyObj* x = GetNextObj()) { /* do something with x */ } ` ? | 
| 08:23:20 | crem | Something shorter than `while true:  let x = getNextObj(); if x == nil: break` | 
| 08:26:40 | FromGitter | <mratsim> @skrylar I get them in Python sometimes --> vanishing gradients | 
| 08:26:55 | * | SenasOzys_ quit (Remote host closed the connection) | 
| 08:27:06 | * | SenasOzys_ joined #nim | 
| 08:27:27 | FromGitter | <mratsim> @crem we had this discussion like 8 hours ago alehander42 posted a macro that does Rust while let | 
| 08:28:20 | FromGitter | <mratsim> For iterators this works: https://gist.github.com/mratsim/e0c7f2eefb8fa91fb27f0cd9a97cff00 | 
| 08:29:22 | FromGitter | <mratsim> mratsim: Regarding loops, a construct I found useful is Rust “while let” in combo with their option type, especially for stack and queues. ⏎ while let Some(foo) = bar_seq.pop() ⏎ —> It assigns to foo as long as pop() returns something, and if it returns none it stops the loop | 
| 08:30:03 | FromGitter | <mratsim> Alehander42: <Arrrr> Would be nice to expose seq capacity for 1.0 ⏎  ⏎ From IRC (bridge bot) Nov 24 19:31 ⏎ <dom96> That's not a breaking change, is it? ⏎ <dom96> It can be exposed at any point after 1.0 too ... [https://gitter.im/nim-lang/Nim?at=5a192a0b232e79134dccc1c3] | 
| 08:30:20 | * | yglukhov quit (Read error: No route to host) | 
| 08:30:30 | FromGitter | <mratsim> Argh, >< gitter mobile ... | 
| 08:30:42 | * | yglukhov joined #nim | 
| 08:31:03 | crem | Hm, I'll do with "while true, if nil break" approach I guess, even though I don't like it much. But I'm not comfortable with macros even more. | 
| 08:31:59 | ipjk | crem: can't you do "if getNextObj() == nil: break"? | 
| 08:32:27 | crem | I need that obj. | 
| 08:32:36 | crem | if it's not nil. | 
| 08:33:10 | crem | I can do in 4 lines as I wrote. But it would be nicer to write that in 1. | 
| 08:33:46 | ipjk | let obj = getNextObj(); if obj == nil: break works in one line | 
| 08:34:42 | ipjk | is the function an iterrable? | 
| 08:34:48 | FromGitter | <kayabaNerve> Make get next obj an iterator? | 
| 08:35:12 | FromGitter | <kayabaNerve> for obj in getNextObj(): | 
| 08:35:13 | ipjk | kayab: Yeah, that's what I was thinking to | 
| 08:35:19 | FromGitter | <kayabaNerve> Yeah | 
| 08:36:21 | crem | Hm, yeah, that actually may be nice trick. | 
| 08:37:12 | ipjk | for ojb in getObjs(): is probably the most cleanest | 
| 08:38:02 | FromGitter | <stisa> crem: what about `while (let x = getNextObj(); not x.isnil): echo x` ? | 
| 08:38:33 | crem | My getObj() can sometimes throw an exception. Can iterator outlive it? | 
| 08:38:47 | crem | stisa, if that works, that's what I need. Let me try. | 
| 08:39:49 | crem | Works, thanks! | 
| 08:40:16 | crem | But for iterator approach, a question. My getNextObj() sometimes throws exception. Will iterator survive that? | 
| 08:40:26 | ipjk | I'm not sure about that | 
| 08:40:29 | ipjk | Trying to look it up | 
| 08:40:39 | FromGitter | <kayabaNerve> In try catch? | 
| 08:40:45 | ipjk | "exceptions a proc/iterator/method/converter is allowed to raise", looks like it | 
| 08:40:58 | ipjk | https://nim-lang.org/docs/manual.html#effect-system | 
| 08:45:51 | * | yglukhov quit (Remote host closed the connection) | 
| 08:57:20 | * | Vladar joined #nim | 
| 09:05:29 | crem | "type X = ref object discard    raise new(X)" crashes. How to raise exception? Do I have to use that newException always? | 
| 09:06:30 | FromGitter | <kayabaNerve> Did you just try to raise an object? | 
| 09:07:08 | crem | Like, in two lines?  let x = new(X);  raise x? | 
| 09:07:49 | crem | Or in three lines?   var x: X; new(x); raise x? | 
| 09:08:23 | crem | Neither works | 
| 09:09:44 | crem | https://play.nim-lang.org/?gist=f9efb940bd32980a30d86992eb2a993e | 
| 09:11:01 | * | claudiuinberlin joined #nim | 
| 09:13:45 | FromGitter | <alehander42> `Each exception has to inherit from `Exception`. ` | 
| 09:14:06 | FromGitter | <alehander42> why do you expect raising a custom object to work | 
| 09:14:26 | crem | Ah, will try that.  That worked in C++. :) And in python2 I guess. | 
| 09:14:35 | ipjk | type MyError = object of Exception | 
| 09:14:49 | crem | I'd expect it not to compile though if compiler can detect that. | 
| 09:15:07 | ipjk | Aren't exceptions runtime errors? | 
| 09:15:43 | crem | They are, but compiler sees "raise" with type which it not inherited from Exception. | 
| 09:15:59 | crem | Types are compile-time. | 
| 09:17:37 | FromGitter | <kayabaNerve> ^^ I didn't know how to correct it but | 
| 09:17:49 | FromGitter | <kayabaNerve> *but I knew something was wrong | 
| 09:18:12 | crem | With inheriting from Exception it worked, thanks! | 
| 09:18:32 | * | xkapastel quit (Quit: Connection closed for inactivity) | 
| 09:25:34 | ipjk | raise takes an expression, not a variable of exception type, guess that's why. | 
| 09:27:07 | crem | Expression also has type, known at compile time. | 
| 09:53:31 | * | couven92 joined #nim | 
| 09:55:32 | crem | What to do with "Warning: not GC-safe: 'Main()'"?  I suspect it doesn't like sdl's  window.getSurface() returning raw pointer and worries about it being hanging.  How to tell it that that's fine! | 
| 09:55:59 | crem | Hm, actually not. | 
| 09:57:34 | crem | It didn't like global variable. Alright, I can understand him. | 
| 09:58:36 | * | Trustable joined #nim | 
| 10:08:40 | * | yglukhov joined #nim | 
| 10:10:05 | * | Arrrr joined #nim | 
| 10:13:13 | * | yglukhov quit (Ping timeout: 252 seconds) | 
| 10:14:24 | * | SenasOzys_ quit (Remote host closed the connection) | 
| 10:14:40 | * | SenasOzys_ joined #nim | 
| 10:18:47 | FromGitter | <ephja> raise '\n' ;) | 
| 10:19:44 | crem | "Cannot prove new(MyObj) is not nil"... Do I really have to check result of new(MyObj) for being nil?.. | 
| 10:20:51 | FromGitter | <ephja> it's probably still not possible to get rid of all of those warnings | 
| 10:21:41 | crem | It's actually not even warning but error. (when I try to assign that to non-nil field) | 
| 10:22:31 | FromGitter | <ephja> the same goes for errors associated with 'not nil' | 
| 10:24:17 | FromGitter | <ephja> let me check if 'not nil' is even used for anything other than tests in the official distribution | 
| 10:25:07 | FromGitter | <ephja> here's a nice little search tool for windows, btw https://www.voidtools.com/support/everything/ | 
| 10:26:09 | * | SenasOzys_ quit (Ping timeout: 248 seconds) | 
| 10:29:20 | * | yglukhov joined #nim | 
| 10:33:47 | * | yglukhov quit (Ping timeout: 268 seconds) | 
| 10:36:20 | * | SenasOzys_ joined #nim | 
| 10:45:37 | FromGitter | <Varriount> @ephja I'll never understand why Windows search is always so slow | 
| 10:48:42 | FromGitter | <ephja> with indexing as well? | 
| 10:49:50 | FromGitter | <ephja> I mostly rely on other applications because of the lack of various search function, but it's possible that it has also been slow | 
| 10:49:55 | * | yglukhov joined #nim | 
| 10:50:43 | * | MJCaley joined #nim | 
| 10:54:45 | * | yglukhov quit (Ping timeout: 268 seconds) | 
| 10:56:14 | FromGitter | <Varriount> @ephja Rarely do I search for something using a term found in file contents. Usually it's the title I'm looking for. | 
| 10:57:03 | FromGitter | <Varriount> It still takes 1-2 seconds for my computer to bring up results. | 
| 11:00:56 | FromGitter | <ephja> doesn't seem *that* bad, but then again I don't know how many files you have :p | 
| 11:04:01 | * | MJCaley quit (Quit: MJCaley) | 
| 11:05:21 | * | BitPuffin|osx joined #nim | 
| 11:07:14 | * | sz0 joined #nim | 
| 11:08:01 | * | nsf quit (Quit: WeeChat 1.9.1) | 
| 11:10:35 | * | yglukhov joined #nim | 
| 11:15:06 | * | yglukhov quit (Ping timeout: 268 seconds) | 
| 11:23:43 | * | ofelas joined #nim | 
| 11:29:42 | * | BitPuffin|osx quit (Ping timeout: 240 seconds) | 
| 11:30:10 | FromGitter | <mratsim> @crem Alehander added a PR just for you: https://github.com/nim-lang/Nim/pull/6806 | 
| 11:32:59 | * | ofelas_ joined #nim | 
| 11:35:50 | * | ofelas quit (Ping timeout: 255 seconds) | 
| 11:41:27 | * | miran quit (Ping timeout: 240 seconds) | 
| 11:42:23 | FromGitter | <Varriount> @mratsim That macro seems a bit niche, and doesn't really save that many lines. | 
| 11:43:56 | * | ofelas_ quit (Quit: shutdown -h now) | 
| 11:44:16 | * | ofelas joined #nim | 
| 11:46:30 | FromGitter | <mratsim> The one in sequtils I agree it might be too much. The one in Option module I like | 
| 11:48:27 | crem | Actually `while (let x = nextObj(); not x.isnil):` is good enought for me. | 
| 11:49:02 | FromGitter | <mratsim> flatten proc coming soon: https://github.com/nim-lang/Nim/pull/6807 | 
| 11:53:31 | * | marenz_ joined #nim | 
| 11:57:43 | * | Arrrr quit (Ping timeout: 252 seconds) | 
| 12:18:27 | * | ofelas quit (Ping timeout: 240 seconds) | 
| 12:23:53 | * | Trustable quit (Remote host closed the connection) | 
| 12:35:55 | * | endragor quit (Remote host closed the connection) | 
| 12:49:29 | FromGitter | <dom96> @Yardanico you around? | 
| 12:55:57 | * | vlad1777d joined #nim | 
| 12:57:06 | FromGitter | <alehander42> @Varriount I agree, I just enjoy writing macros :D | 
| 12:58:28 | * | dddddd joined #nim | 
| 13:12:21 | * | zolk3ri joined #nim | 
| 13:17:16 | * | endragor joined #nim | 
| 13:23:23 | FromGitter | <mratsim> A chance to talk about Nim memory region: https://news.ycombinator.com/item?id=15773283 | 
| 13:30:22 | * | Sentreen quit (Ping timeout: 260 seconds) | 
| 13:40:32 | * | themagician joined #nim | 
| 13:43:04 | * | Sentreen joined #nim | 
| 13:50:03 | dom96 | Cool, we're getting spam on the forum from Neo himself | 
| 14:05:02 | dom96 | mratsim: cool, didn't know this was implemented already | 
| 14:07:16 | Araq | Neo? | 
| 14:13:53 | dom96 | https://upload.wikimedia.org/wikipedia/en/c/c6/NeoTheMatrix.jpg | 
| 14:13:59 | FromGitter | <mratsim> It’s the Mr Hide version of @andreaferretti | 
| 14:16:30 | * | Amrykid2 joined #nim | 
| 14:23:38 | * | miran joined #nim | 
| 14:25:04 | FromGitter | <Veladus> I'm currently making my first PR, which consists of moving the functions encodeUrl and decodeUrl to uri and deprecating to old one ⏎ Now my question the  test cases in the old cgi module use plain assert, but the testcases in uri all use doAssert, which one shall I use | 
| 14:35:11 | Araq | veladus: don't deprecate the old ones, forward them via 'export' | 
| 14:35:14 | * | Veladus joined #nim | 
| 14:35:26 | * | Veladus quit (Client Quit) | 
| 14:36:23 | dom96 | You should use doAssert | 
| 14:36:29 | dom96 | Araq: Why? | 
| 14:37:06 | dom96 | I mean, meh, I suppose that's fine too | 
| 14:37:29 | dom96 | Veladus: just add 'export encodeUrl, decodeUrl' in cgi.nim | 
| 14:37:41 | dom96 | but yeah, use doAssert | 
| 15:12:22 | miran | is there any official style how nimble package repo should look like? | 
| 15:14:05 | federico3 | miran: there's a link at https://github.com/nim-lang/nimble/issues/413 | 
| 15:14:09 | * | couven92 quit (Ping timeout: 250 seconds) | 
| 15:14:37 | miran | from what i've seen some packages have source files in `src` folder, some in `$packagename` folder, some other have no sub-folders at all | 
| 15:15:30 | miran | federico3: thanks for the lin | 
| 15:15:34 | miran | ...k | 
| 15:16:11 | FromGitter | <Veladus> @dom96 is adding a nexport enough to ensure js compatability? I don't know about the details of ``export`` | 
| 15:24:36 | dom96 | Veladus: well, that part is irrelevant to JS compat. | 
| 15:24:46 | dom96 | It's just so that users of cgi won't have to change their code | 
| 15:25:10 | dom96 | Move the proc into the uri module and then just add an `import uri` and export in the cgi module | 
| 15:30:32 | * | sz0 quit (Quit: Connection closed for inactivity) | 
| 15:31:02 | * | Snircle joined #nim | 
| 15:33:25 | FromGitter | <Veladus> @dom96 got it, thanks for your help :) | 
| 15:33:33 | dom96 | np :) | 
| 15:36:10 | Araq | ## A module that contains a macro ``runnableExamples`` you should use to mark | 
| 15:36:10 | Araq | ## `runnable example`:idx: code with. | 
| 15:36:10 | Araq | ## - In normal debug and release builds code within | 
| 15:36:10 | Araq | ##   a ``runnableExamples`` section is ignored. | 
| 15:36:11 | Araq | ## - The documentation generator is aware of these examples and considers them | 
| 15:36:12 | Araq | ##   part of the ``##`` doc comment. | 
| 15:36:13 | Araq | ## - A helper program that is built from this module when it is compiled as the | 
| 15:36:16 | Araq | ##   main module collects the runnable examples in a module file and ensures | 
| 15:36:18 | Araq | ##   they continue to compile and run. The collected examples are put into | 
| 15:36:20 | Araq | ##   their own module to ensure the examples do not refer to non-exported | 
| 15:36:22 | Araq | ##   symbols. | 
| 15:36:24 | Araq | complain now if there is something you don't agree with | 
| 15:36:34 | Araq | because I'm writing this module/tool. | 
| 15:38:43 | dom96 | It should be the other way around | 
| 15:39:03 | dom96 | Examples should be tested by default | 
| 15:39:05 | Araq | ? | 
| 15:39:12 | Araq | how so? | 
| 15:39:16 | dom96 | And a way to ask the tool not to test them should be provided | 
| 15:39:19 | Araq | that's stupid. | 
| 15:39:30 | dom96 | Thanks | 
| 15:39:44 | Araq | the tool is not called during compilations | 
| 15:40:24 | Araq | there is no "default". | 
| 15:40:37 | dom96 | We should test all code examples in doc comments | 
| 15:40:39 | dom96 | By default | 
| 15:40:48 | dom96 | That's not "stupid" | 
| 15:41:15 | Araq | which tool should test it? | 
| 15:41:22 | dom96 | testament | 
| 15:41:44 | Araq | that's not used by nimble packages. | 
| 15:43:00 | Araq | I'm writing something for everybody, not just for Nim's core. | 
| 15:44:17 | dom96 | okay, so why not test all examples? | 
| 15:45:10 | crem | Should I use Vladar4/sdl2_nim or nim-lang/sdl2 ?  First one says "I wouldn't create this one if I knew there was official one", and "official" one is outdated, doesn't even have functions of 2.0.5 which is 18 months old.. | 
| 15:45:11 | dom96 | oh good. @Yardanico is still around, just posted on my GitHub PR. Was getting worried there. | 
| 15:45:21 | Araq | that's not the topic. we can do that but it's some work and I'd rather patch the stdlib instead | 
| 15:45:42 | Araq | because runnable code in doc comments is annoying me | 
| 15:45:53 | Araq | ## .. code-block:: nim | 
| 15:45:56 | Araq | ## ... | 
| 15:45:59 | Araq | ## ... | 
| 15:46:20 | Araq | and then you probably have comments within comments | 
| 15:46:43 | Araq | I know Python and Rust do it this way so it cannot be improved upon, but I disagree. | 
| 15:46:54 | dom96 | oh, so you want a runnableExample section outside of the doc comment | 
| 15:47:00 | dom96 | like in the proc's body? | 
| 15:47:02 | Araq | yes! | 
| 15:47:30 | dom96 | Okay, fine, but you lose a lot of formatting capability | 
| 15:47:46 | Araq | huh? what do you mean? | 
| 15:47:49 | dom96 | Call it `runnableExample` and give it an id | 
| 15:48:07 | * | miran_ joined #nim | 
| 15:48:13 | * | miran quit (Ping timeout: 258 seconds) | 
| 15:48:18 | * | miran_ is now known as miran | 
| 15:48:24 | dom96 | so I can write "## My awesome example of doing this thing. **WArning:** This may be dangerous. .. runnable-example:: ID | 
| 15:48:26 | dom96 | or similar | 
| 15:48:31 | dom96 | and the doc gen knows to place that in there | 
| 15:48:35 | dom96 | we can implement that later | 
| 15:48:42 | dom96 | but future proof the macro so it accepts an ID | 
| 15:48:58 | miran | any way to use iterators outside for loop? something like `next(iterator)`? | 
| 15:49:10 | dom96 | crem: Good question. | 
| 15:52:10 | crem | It seems that sdl2_nim is much more up to date, so may be it's a good idea to deprecate the other. But they have a bit different interfaces. I'm trying to adapt what I wrote for nim-lang/sdl2 to sdl2_nim. | 
| 15:54:51 | crem | It seems to be a bit lower level. cint's everywhere, errors are returned as cints rather than "Sdl_return" enum.. | 
| 15:58:53 | crem | Is there maybe a centralized location of all `nim doc`-generated docs for all published packages? :) | 
| 16:01:32 | FromGitter | <stisa> crem I believe https://nimble.directory builds the docs of the packages it indexes | 
| 16:04:17 | * | JappleAck quit (Ping timeout: 248 seconds) | 
| 16:04:51 | crem | Thanks! Everything is so hidden and secret in nim. | 
| 16:07:05 | dom96 | Suggestions on how to make things less hidden welcome :) | 
| 16:07:23 | dom96 | I guess it's about time to point packages.nim-lang.org to nimble.directory | 
| 16:08:55 | federico3 | dom96: perhaps #6492 could help - I could take a stab at it but I need some pointers on where to add the right directives | 
| 16:12:11 | dom96 | Araq will have to help here. | 
| 16:16:44 | dom96 | miran: only if the iterator is a closure I think | 
| 16:17:34 | miran | ok, how to get one (next) value then? any special syntax for it? | 
| 16:21:38 | * | JappleAck joined #nim | 
| 16:29:27 | * | ofelas joined #nim | 
| 16:30:44 | * | xkapastel joined #nim | 
| 16:42:47 | dom96 | https://nim-lang.org/docs/manual.html#iterators-and-the-for-statement-first-class-iterators | 
| 16:44:11 | * | Amrykid2 quit (Ping timeout: 258 seconds) | 
| 16:44:19 | miran | i've read that but couldn't find what i was looking for | 
| 16:46:47 | dom96 | See the while loop examples | 
| 16:47:02 | dom96 | You instantiate the iterator | 
| 16:47:11 | dom96 | and then call the instantiation | 
| 16:47:39 | miran | ok, i'll try to implement that | 
| 16:48:46 | federico3 | ohh, what is this https://github.com/nim-lang/needed-libraries/issues/79 - using sphinx to generate Nim docs | 
| 16:50:30 | FromGitter | <mratsim> Feel free to use Karax for Sphinx like docs ;) | 
| 16:51:28 | FromGitter | <mratsim> Sphinx seemed like the low-hanging fruits. | 
| 16:54:08 | miran | dom96: i managed to do it! thanks! | 
| 17:00:19 | * | ofelas quit (Ping timeout: 250 seconds) | 
| 17:04:12 | * | ofelas joined #nim | 
| 17:10:52 | * | ofelas quit (Ping timeout: 260 seconds) | 
| 17:13:05 | crem | Is it possible to pass addr to a temporary object during the call in one line?  e.g.   fillRect(addr(Rect(x,y,h,w)))  (fillRect happened to accept  ptr Rect). | 
| 17:14:18 | crem | hold on, I have a problem elsewhere. | 
| 17:14:35 | crem | Seems that  Rect(x,y,h,w) is incorrect syntax. | 
| 17:15:59 | federico3 | mratsim: the generated doc is better that docgen and can be hosted by readthedocs. Quite handy. I wonder if there's an easy way to extract docstrigs and so on from Nim code. | 
| 17:18:19 | crem | asking again with corrected syntax: | 
| 17:18:31 | crem | Is it possible to pass addr to a temporary object during the call in one line?  e.g.   fillRect(addr(Rect(x:0,y:0,h:0,w:0)))  (fillRect happened to accept  ptr Rect). | 
| 17:18:49 | crem | Expected answer is -no- though.. | 
| 17:24:14 | * | ofelas joined #nim | 
| 17:28:10 | * | mwbrown quit (Quit: Exiting) | 
| 17:31:06 | crem | When I run package using `nimble build -r`, it doesn't output program's stdout to console. Any way to see it? | 
| 17:32:06 | * | MJCaley joined #nim | 
| 17:35:41 | FromGitter | <mratsim> @crem, does your object live long enough? | 
| 17:36:53 | FromGitter | <mratsim> try unsafeAddr in your second example | 
| 17:38:47 | crem | That object is only needed during the call. Thanks, will try. | 
| 17:39:11 | FromGitter | <nitely> Araq: would implementing items/pairs for closure iterator be a good idea? There was a conversation about creating an "iterable" type that would include iterators+openarray but I don't think that's possible | 
| 17:39:43 | crem | No it says "object has no address" for temporary objects. | 
| 17:42:53 | FromGitter | <mratsim> Then you need to assign it to a variable. (Nim constructs the temp directly in the addr call but since it’s done like this it has no address) | 
| 17:46:08 | * | mwbrown joined #nim | 
| 17:46:54 | FromGitter | <mratsim> You would have the same issue in C, or C++ (met that a lot while wrapping Nvidia libraries) | 
| 17:51:31 | * | nsf joined #nim | 
| 17:52:37 | FromGitter | <mratsim> @dom96, doAssert done https://github.com/nim-lang/Nim/pull/6807 | 
| 17:53:31 | FromGitter | <mratsim> I’m not really sure how to doAssert an iterator though | 
| 17:56:57 | dom96 | mratsim: create another flattened list above, add a counter and use `doAssert flatitems(s)[i] == flattenedResult[i]`. I dunno, maybe that's too far :) | 
| 17:58:14 | FromGitter | <mratsim> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5a19af36541a6f0337124054] | 
| 18:00:05 | * | chemist69 quit (Ping timeout: 258 seconds) | 
| 18:04:26 | FromGitter | <mratsim> updated. | 
| 18:05:27 | * | JappleAck quit (Quit: Leaving) | 
| 18:09:40 | * | ofelas quit (Ping timeout: 258 seconds) | 
| 18:10:01 | dom96 | crem: does that actually run a package? | 
| 18:10:15 | FromGitter | <mratsim> So Ethereum needs a new programming language: https://github.com/ethereum/viper | 
| 18:11:27 | dom96 | are they just re-modelling Python? | 
| 18:13:40 | * | chemist69 joined #nim | 
| 18:15:51 | FromGitter | <mratsim> vote for me: https://www.reddit.com/r/ethereum/comments/7fddey/is_there_any_reason_ethereum_cant_use_an_existing/dqbpqgx/ | 
| 18:18:27 | dom96 | Done :) | 
| 18:20:57 | FromGitter | <Yardanico> dom96: hi, just a lot of school/preparing for exams, so not a lot of time for games and programming :P but anyway I generally looked at a lot of new Nim PRs/commits | 
| 18:21:20 | dom96 | Yardanico: Ahh, that's what I thought, hope it's going well for you | 
| 18:23:42 | crem | dom96: yes it does, just stdin is not forwarded. | 
| 18:28:42 | * | couven92 joined #nim | 
| 18:31:00 | dom96 | crem: hrm, you mean stdout? | 
| 18:31:12 | dom96 | Try using the --verbose or --debug | 
| 18:31:13 | crem | yes | 
| 18:31:14 | dom96 | flag | 
| 18:31:30 | crem | I did use --verbose, will try --debug | 
| 18:31:44 | alexday | how can I have a Table type in nim | 
| 18:32:05 | couven92 | import tables | 
| 18:32:20 | couven92 | or strtabs for specialized string tables | 
| 18:33:16 | alexday | I did import tables. but when I do Request = type object name: string, config: Table it complained saying Table is not a conncrete type. This type system is a little new | 
| 18:33:18 | alexday | to me | 
| 18:33:49 | couven92 | https://nim-lang.org/docs/tables.html see for examples | 
| 18:33:54 | alexday | maybe its like Table[string, string] | 
| 18:33:56 | alexday | oh ok | 
| 18:33:58 | alexday | checking | 
| 18:44:04 | alexday | one more question. so the key value pairs that I will get from the api request can be like config: { name: 'a' } or say config: { id: 1 }. in this case to say something like Table[string, myType] . will this myType will be a variant kind of thing? like https://github.com/nim-lang/Nim/wiki/Common-Criticisms#sum-types-are-weird | 
| 18:46:58 | FromGitter | <mratsim> If your API is json you can use JSON directly: https://nim-lang.org/docs/json.html otherwise indeed you will need sum types (or inheritance but for int and strings it’s not worth it). | 
| 18:51:30 | alexday | I am trying to use `to` of the json module to a type. So if I don't want to get into the Table and sum kind, what can I say the type of config in my object definition? | 
| 18:52:00 | dom96 | Don't use `to`, just do: parseJson(json)["name"].getStr() | 
| 18:52:11 | dom96 | or parseJson(json)["id"].getInt() | 
| 18:52:32 | alexday | ok. yeah I can do that I guess. skip the type conversion. | 
| 18:52:51 | alexday | it just complicates things a little bit | 
| 18:53:31 | dom96 | the `to` macro needs improvements | 
| 18:53:48 | dom96 | it can't handle optional fields | 
| 18:54:19 | alexday | yeh faced that problem :P | 
| 19:10:08 | FromGitter | <alehander42> I had some weird problems with ref objects and `to` too | 
| 19:10:33 | FromGitter | <alehander42> so I had to write manually an additional convertion function | 
| 19:10:53 | FromGitter | <alehander42> sometimes you *have* to convert your json to full objects, so `to` is important | 
| 19:22:25 | dom96 | please submit issues for these cases | 
| 19:23:35 | * | demi- quit (Quit: Server shutdown in 3... 2... 1...) | 
| 19:23:49 | Araq | alehander42: yeah we know it's a pretty important feature that needs more love | 
| 19:24:16 | FromGitter | <Varriount> Araq: Does nimsuggest still have that TCP issue where it closes the connection after a single command? | 
| 19:24:50 | FromGitter | <alehander42> yep, I'll submit repro-s on monday | 
| 19:27:51 | Araq | varriount: I think so but EPC is now the preferred interface, I guess | 
| 19:30:50 | dom96 | We should get LSP | 
| 19:30:59 | FromGitter | <Varriount> LSP? | 
| 19:31:14 | dom96 | https://langserver.org/ | 
| 19:33:33 | FromGitter | <Varriount> And of course it was written by web developers. | 
| 19:33:37 | FromGitter | <Varriount> -_- | 
| 19:33:52 | federico3 | urgh | 
| 19:35:05 | * | nsf quit (Quit: WeeChat 1.9.1) | 
| 19:35:39 | Araq | LSP doesn't really fit Nim | 
| 19:35:54 | Araq | Nim has plenty of symbol kinds that LSP has no clue about | 
| 19:38:24 | dom96 | okay, we should at least write a proxy | 
| 19:38:41 | Araq | it's also not obvious why it tries to model classes, methods and enums to begin with, it should focus on the autocompletion aspect ffs | 
| 19:39:28 | FromGitter | <Varriount> dom96: A proxy for nimsuggest? Translating one connection method to another connection method? | 
| 19:40:27 | dom96 | sure | 
| 19:40:42 | Araq | EPC came first and should have got the adoption | 
| 19:40:52 | Araq | but *shrug* PRs are welcome | 
| 19:41:10 | FromGitter | <Varriount> Araq: It's probably so a correct list of symbols can be gathered. There's no need to get symbols representing variables if you know you will be needing a method or attribute. | 
| 19:41:17 | dom96 | I can't even google for EPC | 
| 19:41:59 | FromGitter | <Varriount> The only reason EPC is used is because it's halfway friendly/efficient. | 
| 19:42:36 | FromGitter | <Varriount> stdin has the weird formatting meant for interactive use, and tcp has the "lets only send one command per connection" idea. | 
| 19:43:45 | Araq | stdin with --debug is simple to parse, the nimsuggest tester uses it | 
| 19:43:47 | dom96 | where can I find the spec for EPC? | 
| 19:44:46 | dom96 | Argh, no. I need to stop myself from making more projects :) | 
| 19:46:09 | Araq | dom96, good point, I can't find it either | 
| 19:46:11 | FromGitter | <Varriount> dom96: Does your json-rpc module implement the actual JSON-rpc spec? | 
| 19:46:23 | dom96 | Varriount: nope | 
| 19:46:28 | FromGitter | <Varriount> Darn. | 
| 19:46:30 | Araq | does any stdlib module actually implement the spec? | 
| 19:46:42 | dom96 | or maybe it does | 
| 19:46:47 | dom96 | I actually can't remember :) | 
| 19:46:57 | Araq | specs are too hard to implement | 
| 19:47:13 | dom96 | Araq: All of them do? | 
| 19:47:41 | Araq | they all implement "useful" subsets of the specs | 
| 19:51:11 | FromGitter | <Varriount> Well the first part of implementing this language server would be to modify the compiler to support accepting a graph of modules already in memory. | 
| 19:52:04 | Araq | why? huh? | 
| 19:52:35 | FromGitter | <Varriount> Because reading from dirty files is inefficient. | 
| 19:52:55 | FromGitter | <Varriount> The editor sends the server changesinsteads | 
| 19:53:00 | FromGitter | <Varriount> *changes instead | 
| 19:58:43 | Araq | just ignore that part of the spec, it's stupid | 
| 20:00:04 | Araq | no compiler really has support for this, that's not how compilers work | 
| 20:06:22 | FromGitter | <mratsim>  (https://files.gitter.im/nim-lang/Nim/xFxo/2017-11-25_21-06-12.png) | 
| 20:08:06 | FromGitter | <Varriount> Araq: That's because compilers aren't language servers | 
| 20:08:30 | Araq | mratsim: that's a GC in action. turning bugs into leaks instead of crashes. | 
| 20:08:57 | Araq | (until it crashes with OOM, that is) | 
| 20:08:59 | * | Jesin quit (Quit: Leaving) | 
| 20:10:13 | Araq | varriount: if you don't want to use a compiler to serve these suggestions, what is the point of this protocol? | 
| 20:10:16 | FromGitter | <Varriount> Araq: Language servers don't need to generate C code or do exhaustive semantic analysis. All they need to do is get a list of symbols. | 
| 20:12:09 | FromGitter | <Varriount> Well, and find references/definitions of symbols | 
| 20:12:51 | Araq | well if you want state-of-the-art quality, it involves all the frontend aspects of a real compiler | 
| 20:13:40 | FromGitter | <Varriount> Which might include submitting a graph of in-memory modules? | 
| 20:14:47 | * | Vladar quit (Quit: Leaving) | 
| 20:15:26 | Araq | the last time I checked the protocol submits file diffs | 
| 20:16:37 | * | MJCaley quit (Quit: MJCaley) | 
| 20:16:43 | Araq | that's not useful for a language frontend at all, frontends cannot use this text diff to produce an AST diff, that would be a ridiculously fragile process | 
| 20:17:01 | Araq | instead they reparse the file from top to bottom. | 
| 20:17:50 | * | MJCaley joined #nim | 
| 20:17:57 | FromGitter | <Varriount> So the language server portion maintains  in-memory versions of the files, applies the diff, and submits them to the compiler | 
| 20:19:28 | FromGitter | <Varriount> All the current editors using nimsuggest do that, albeit inefficiently. Nimsuggest requires files to be present in the filesystem | 
| 20:19:35 | Araq | yeah, and you know what is simpler? temporary files | 
| 20:19:45 | FromGitter | <Varriount> It's also much slower | 
| 20:20:27 | Araq | you never gave any numbers. | 
| 20:21:09 | Araq | it's not like you need to write it to disk, it's virtual memory management, files can be in RAM | 
| 20:21:21 | crem | There's no syntax for ref objects similar to  MyObj(myfield: 1), is there?   Something like new(MyObj, myfield:1) or I don't know. | 
| 20:21:43 | Araq | crem, MyObj(field: 1) works if MyObj is a ref object | 
| 20:21:54 | crem | Ah, thanks! | 
| 20:21:56 | Araq | or you can use  (ref MyObj)(field: 1) | 
| 20:22:28 | crem | MyObj is indeed ref object, just it's not obvious that there's implicit new. Thanks. | 
| 20:23:40 | FromGitter | <data-man> @Varriount: Try nim ctags <file.nim> | 
| 20:24:05 | FromGitter | <Varriount> @data-man What is that? | 
| 20:24:19 | FromGitter | <data-man> New command | 
| 20:24:28 | FromGitter | <data-man> In devel | 
| 20:24:31 | Araq | data-man: is that in the changelog? | 
| 20:26:15 | FromGitter | <data-man> @Araq: No. You applied a changes :) | 
| 20:27:33 | FromGitter | <data-man> https://github.com/nim-lang/Nim/pull/6654 | 
| 20:31:00 | crem | Is there anywhere to read why I might be getting Warning: not GC-safe? | 
| 20:32:13 | FromGitter | <Varriount> Araq: What would you consider a relevant benchmark? Editing and the then reading from a graph of strings vs editing and reading from a file handle? | 
| 20:33:20 | Araq | relevant benchmark: "saving this file to /tmp takes more than 10ms which is humanly noticable" | 
| 20:33:37 | Araq | extra points if the file is not 4GB in size. | 
| 20:34:01 | FromGitter | <Varriount> Yes, but then you have to read the file back in. | 
| 20:34:22 | * | jsgrant_ quit (Ping timeout: 240 seconds) | 
| 20:34:46 | Araq | er ... and you think that is a bottleneck for running the Nim compiler over a file? | 
| 20:35:04 | Araq | file IO never shows up in the profiles. | 
| 20:35:23 | FromGitter | <Varriount> Versus having the compiler read the file contents directly from memory? | 
| 20:35:54 | Araq | if you optimize what is in the noise, what do you think happens? nothing. | 
| 20:37:17 | Araq | sorry, but we're talking about feelings here. you feel the lag is too long (and it might be!) and just conclude it has to be because of IO. | 
| 20:39:49 | crem | Hm, where those warnings come from.  nim c -w:on filename.nim  doesn't show any warnings, but nimlime shows them when I save a file. | 
| 20:40:11 | Araq | crem, nimline uses verbosity:2  iirc | 
| 20:40:43 | crem | Indeed, thanks. | 
| 20:41:13 | crem | Now trying to understand where "GcUnsafe" comes from.. | 
| 20:46:52 | Araq | https://gist.github.com/Araq/56b1d263eda728ce7269c5cc7ba5f921 | 
| 20:47:15 | Araq | system.nim has 4000 lines of code, which is realistic | 
| 20:47:26 | niv | hello | 
| 20:47:27 | Araq | on my machine (no SSD) it takes 3ms | 
| 20:47:34 | Araq | sometimes 4ms | 
| 20:49:08 | Araq | if you can notice that you're some professional Broodwar player | 
| 20:49:28 | * | mr_yogurt joined #nim | 
| 20:50:19 | crem | Also   lib/system.nim(2701, 5) Warning: shadowed identifier: 'e' [ShadowIdent]   (0.17.2) | 
| 20:51:49 | Araq | still 4 times shorter than a single frame in an 60FPS shooter | 
| 20:51:49 | crem | Probably it shadowed my var.. as newException is a template. | 
| 20:52:17 | crem | indeed. Sorry for noise. | 
| 20:57:43 | crem | Putting {.gcsafe.} to a random place seems to fix the issue. What does it really mean? | 
| 20:58:46 | crem | There is a doc. Reading. | 
| 21:10:22 | crem | Is there an analog to C++'s gtl::optional in nim? Basically "object or null" but without additional level of indirection like it would be with ref object. | 
| 21:10:29 | crem | oops | 
| 21:10:36 | crem | I mean boost::optional | 
| 21:11:50 | crem | Probably doable with   case valid: bool | 
| 21:12:56 | crem | Indeed. Would be nice to have a template for that in stdlib! | 
| 21:13:50 | crem | If MyObjPtr is ptr type, is it possible to get original non-ptr type from it? | 
| 21:16:08 | FromGitter | <Varriount> There's an option type | 
| 21:17:06 | * | jsgrant_ joined #nim | 
| 21:19:25 | crem | Indeed! Typed too many letters in search. Thanks. | 
| 21:19:57 | crem | Sorry, too many questions today which could be looked up in docs. | 
| 21:20:47 | * | MJCaley quit (Quit: MJCaley) | 
| 21:22:29 | * | jsgrant_ quit (Remote host closed the connection) | 
| 21:22:53 | * | jsgrant_ joined #nim | 
| 21:28:27 | * | MJCaley joined #nim | 
| 21:29:40 | FromGitter | <mratsim> @crem dereference operator is yourvar[] | 
| 21:30:36 | * | claudiuinberlin quit (Quit: Textual IRC Client: www.textualapp.com) | 
| 21:38:33 | * | MJCaley quit (Quit: MJCaley) | 
| 21:46:26 | crem | I need type, not object. | 
| 21:46:41 | * | miran quit (Ping timeout: 240 seconds) | 
| 21:47:00 | crem | needed. Not anymore, but still would be knice to know. | 
| 21:47:04 | crem | s/knice/nice | 
| 21:48:07 | crem | type X = ref object;  type Y = ref object  x: "unref" X | 
| 22:00:23 | FromGitter | <mratsim> no idea. I’m sure we can create a ugly hack like: ⏎  ⏎ ```type ugly_unref[T] = concept x ⏎   x is ref[T]``` ⏎  ⏎ And get the T from the concept. Other ideas include getType/getTypeInst and try to get something useful from the AST. [https://gitter.im/nim-lang/Nim?at=5a19e7f66b5080350f2e1568] | 
| 22:07:25 | FromGitter | <mratsim> There is one killer thing that Nim has and few other langs do in my opinion: ⏎  ⏎ 1) refactoring speed ⏎  ⏎ Python syntax: I don’t look at hundreds of brackets, and I don’t have the Java indirection hell as well. ... [https://gitter.im/nim-lang/Nim?at=5a19e99ddf09362e67523236] | 
| 22:07:34 | FromGitter | <mratsim> Forgot: fast compilation time | 
| 22:13:57 | * | zolk3ri left #nim (#nim) | 
| 22:16:59 | * | endragor quit (Remote host closed the connection) | 
| 22:40:15 | * | mr_yogurt quit (Ping timeout: 260 seconds) | 
| 22:46:35 | * | noonien joined #nim | 
| 23:11:03 | * | jsgrant_ quit (Ping timeout: 268 seconds) | 
| 23:21:33 | * | jjido joined #nim | 
| 23:34:52 | * | jsgrant_ joined #nim | 
| 23:38:40 | * | jjido quit (Ping timeout: 248 seconds) | 
| 23:46:03 | * | MJCaley joined #nim | 
| 23:48:55 | * | vivus joined #nim | 
| 23:58:14 | FromGitter | <brentp> @mratsim I like all those things too, but I found refactoring in go was very good due to tooling support. For example, I could rename a struct member and a tool would propagate it through the code-base. The tooling combined with nice editor (vim) integration is the only thing I really miss from go after mostly moving to nim. |