00:36:29 | * | Zectbumo quit (Remote host closed the connection) |
00:39:25 | * | krux02 quit (Remote host closed the connection) |
00:49:32 | FromDiscord | <Avatarfighter> @Elegant Beef oh that is not what i was expecting |
00:50:09 | FromDiscord | <Elegant Beef> Lol i dont expect it either, cause js sucks and i'm like half doing this just cause i think it'd be nice π |
01:07:35 | * | ^Q-Master^ joined #nim |
01:07:42 | * | Q-Master quit (Read error: Connection reset by peer) |
01:19:38 | * | Zectbumo joined #nim |
01:27:43 | * | apahl quit (Ping timeout: 272 seconds) |
01:29:20 | * | apahl joined #nim |
01:40:19 | * | Tanger joined #nim |
01:56:17 | FromDiscord | <Avatarfighter> I wont lie I have been looking at the js code trying to understand @Elegant Beef lmao |
01:56:32 | FromDiscord | <Avatarfighter> i haven't done ffi with js so this is interesting |
01:56:33 | FromDiscord | <Elegant Beef> Oh it doesnt work |
01:56:40 | FromDiscord | <Avatarfighter> ah |
01:57:28 | FromDiscord | <Elegant Beef> It's pretty hard to actually learn of the types of variables and functions |
02:06:21 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:08:17 | * | muffindrake joined #nim |
02:26:02 | * | Zectbumo quit (Remote host closed the connection) |
02:35:27 | * | Zectbumo_ joined #nim |
02:42:04 | * | Zectbumo_ quit (Excess Flood) |
02:42:44 | * | Zectbumo joined #nim |
02:43:05 | * | Zectbumo quit (Excess Flood) |
02:43:34 | * | Zectbumo joined #nim |
02:44:08 | * | Zectbumo quit (Excess Flood) |
02:44:34 | * | Zectbumo joined #nim |
02:45:10 | * | Zectbumo quit (Excess Flood) |
02:45:34 | * | Zectbumo joined #nim |
02:46:12 | * | Zectbumo quit (Excess Flood) |
02:46:29 | * | Zectbumo joined #nim |
02:47:03 | * | opal quit (Ping timeout: 240 seconds) |
02:47:12 | * | Zectbumo quit (Excess Flood) |
02:47:41 | * | NimBot joined #nim |
02:48:11 | * | Zectbumo quit (Excess Flood) |
02:48:26 | * | Zectbumo joined #nim |
02:49:14 | * | Zectbumo quit (Excess Flood) |
02:49:26 | * | Zectbumo joined #nim |
02:53:18 | * | smitop quit (Quit: Connection closed for inactivity) |
03:28:00 | * | d10n_ joined #nim |
03:28:06 | * | d10n quit (Read error: Connection reset by peer) |
03:42:54 | * | konkrrrrrr joined #nim |
03:43:07 | * | kinkinkijkin quit (Ping timeout: 260 seconds) |
03:43:49 | * | konkrrrrrr is now known as kinkinkijkin |
03:45:37 | * | bung joined #nim |
03:47:44 | * | shad0w_ joined #nim |
03:48:46 | * | a_chou quit (Ping timeout: 246 seconds) |
03:59:29 | * | arecacea1 quit (Remote host closed the connection) |
04:00:01 | * | arecacea1 joined #nim |
04:00:36 | * | rockcavera quit (Remote host closed the connection) |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
04:06:33 | * | supakeen joined #nim |
04:12:03 | * | gour joined #nim |
04:23:33 | * | vicfred quit (Quit: Leaving) |
04:30:30 | * | thomasross quit (Ping timeout: 256 seconds) |
04:35:56 | * | shad0w_ quit (Ping timeout: 272 seconds) |
05:04:34 | * | mmohammadi9812 joined #nim |
05:16:48 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
05:25:40 | * | solitudesf joined #nim |
05:26:07 | * | narimiran joined #nim |
05:33:05 | Tanger | the segfaults module is pretty handy |
05:49:01 | * | Zectbumo quit (Remote host closed the connection) |
05:52:45 | * | kenran joined #nim |
06:01:22 | * | shad0w_ joined #nim |
06:36:03 | * | lritter joined #nim |
06:45:01 | * | apahl quit (Ping timeout: 272 seconds) |
06:45:33 | * | apahl joined #nim |
06:52:11 | bung | https://github.com/bung87/amysql/blob/pool/src/amysql/db_pool.nim#L139 |
06:52:43 | bung | how can I release threads ? it doesn't quit. |
07:04:13 | Tanger | bung, It just hangs at the end? |
07:08:19 | bung | Tanger,not sure, I have a simple test https://github.com/bung87/amysql/blob/pool/tests/test_pool_conn.nim |
07:09:02 | Tanger | I'll have a look-see |
07:10:53 | bung | well, found test_pool.nim passed before |
07:10:58 | bung | thank you ! |
07:12:05 | * | sagax quit (Read error: Connection reset by peer) |
07:13:52 | * | superbia joined #nim |
07:13:57 | * | superbia quit (Client Quit) |
07:28:06 | * | mmohammadi9812 quit (Quit: I quit (β―Β°β‘Β°οΌβ―οΈ΅ β»ββ») |
07:37:19 | Tanger | bung, I think it's to do with this line: let r = conn.writer[].recv() in rawQuery() |
07:37:31 | Tanger | Looks like the writer hangs trying to recv |
07:37:36 | Tanger | I'm not 100% on this |
07:38:03 | Tanger | But my guess is that you need to have the reader and writer channel of the same type? |
07:38:12 | Tanger | Rather than DBStmt and DBResult |
07:40:53 | * | vicfred joined #nim |
07:40:55 | bung | yeah, I just debugEcho something ,it stuck when conn.writer[].recv() |
07:41:05 | Tanger | bung, Yeah, if I swap out those DBResult and DBStmt types with just string (and also gut some of the checks), it sends the data correctly |
07:41:16 | Tanger | Can you merge those two types into a single one? |
07:41:34 | Tanger | Or |
07:41:38 | bung | hmm, let me think of it |
07:41:43 | Tanger | For your writer/reader, you need 2 channels for each of them |
07:41:51 | Tanger | One sends/receives listening for DBStmt |
07:41:58 | Tanger | And one sends/receives listening for DBResult |
07:45:50 | Tanger | I mean, I guess you're doing that |
07:45:52 | bung | I use single one channel that receive results and per thread channel receive statments then send back to shared channel |
07:46:29 | bung | that's what I designed |
07:46:55 | bung | " send back result" |
07:47:23 | * | sagax joined #nim |
07:48:41 | Tanger | Ah, yep |
07:49:48 | bung | In the future work I also need locks, I think it's the right way |
07:50:07 | Tanger | bung, Maybe your writer isn't opened? |
07:51:51 | bung | it's opened when call newDBPool |
07:53:11 | bung | I fixed one problem just now, let me wait forthe ci results |
07:59:17 | bung | hmm,not work, I have question , do I need allocShared0 for Channel[DBStmt] and Channel[DBResult] ? |
08:02:03 | Tanger | bung, Hmmm, I haven't previously |
08:02:55 | * | shad0w_ quit (Ping timeout: 272 seconds) |
08:03:33 | Tanger | I think `open` does all of that for you |
08:07:12 | bung | dont know, maybe I only need allocShared0 for Channel[DBResult] |
08:07:23 | * | PMunch joined #nim |
08:08:03 | Tanger | Based on the examples in the docs, I think you may need alloc0- if you're passing around those channels |
08:08:24 | Tanger | Sorry I'm not much help, I've only ever done one thing with channels |
08:09:38 | bung | that's ok, thank you! |
08:11:05 | FromDiscord | <Ricky Spanish> sent a code paste, see https://play.nim-lang.org/#ix=2yF2 |
08:12:12 | bung | db connection pool is required feature of that lib but am not good at it. |
08:19:59 | bung | Ricky Spanish you know how these methods defined? |
08:25:39 | bung | you can have array of bytes avoid define some properties |
08:29:08 | * | kinkinkijkin quit (Remote host closed the connection) |
08:29:32 | * | kinkinkijkin joined #nim |
08:33:16 | * | kinkinkijkin quit (Remote host closed the connection) |
08:33:40 | * | kinkinkijkin joined #nim |
08:36:08 | FromDiscord | <alehander42> `nim rst2html doc/manual_experimental.rst` |
08:39:22 | FromDiscord | <alehander42> gives many errors in the document for me |
08:39:25 | FromDiscord | <alehander42> is that normal |
08:41:39 | narimiran | i cannot reproduce |
08:42:17 | * | hnOsmium0001 quit (Quit: Connection closed for inactivity) |
08:44:06 | * | gour quit (Remote host closed the connection) |
08:44:37 | * | gour joined #nim |
08:48:22 | FromDiscord | <alehander42> i feel i am missing some kind of arg, env var? |
08:48:31 | FromDiscord | <alehander42> i get stuff like Undefined substitution referenced: "nimversion". |
08:48:48 | FromDiscord | <alehander42> and many Error in "code-block" directive: maximum 1 argument(s) allowed, 9 supplied. |
08:52:48 | * | Tanger quit (Quit: Leaving) |
08:54:05 | * | Vladar joined #nim |
08:55:36 | PMunch | @Ricky, you just need to find a way of telling Nim to generate the correct code |
09:03:00 | FromDiscord | <Elegant Beef> the `--playNice:on` needs to be added pronto |
09:03:56 | FromDiscord | <flywind> Lol, `procs` in `when isMainModule` is listed in docs |
09:04:00 | FromDiscord | <flywind> https://media.discordapp.net/attachments/371759389889003532/758977086781915166/unknown.png |
09:05:53 | FromDiscord | <Rika> so put `and not defined(nimdoc)` or something (forgot) |
09:06:02 | FromDiscord | <alehander42> sorry @narimiran ! |
09:06:03 | FromDiscord | <Rika> but yeah wish it didnt list those too |
09:06:08 | FromDiscord | <alehander42> i was messing with rst2html |
09:06:12 | FromDiscord | <alehander42> and i confused the files |
09:06:14 | FromDiscord | <alehander42> its ok |
09:06:35 | FromDiscord | <alehander42> i also uploaded a separate file which is included: should I eventually do it with other sections later |
09:06:48 | FromDiscord | <flywind> @Rika Thanks, I will try that. |
09:06:56 | FromDiscord | <alehander42> _Araq thinks it becomes too big a file |
09:07:05 | FromDiscord | <alehander42> so he wanted it |
09:09:48 | * | kinkinkijkin quit (Ping timeout: 260 seconds) |
09:10:29 | * | kinkinkijkin joined #nim |
09:15:01 | * | superbia joined #nim |
09:15:09 | * | superbia quit (Client Quit) |
09:15:41 | * | Trustable joined #nim |
09:21:30 | * | kinkinkijkin quit (Remote host closed the connection) |
09:21:55 | * | kinkinkijkin joined #nim |
09:27:55 | * | shad0w_ joined #nim |
09:53:19 | * | superbia joined #nim |
09:57:33 | narimiran | @flywind are you exporting those proc? |
09:58:25 | FromDiscord | <flywind> Yea, I export them by mistake. |
09:58:47 | * | abm joined #nim |
09:59:45 | narimiran | there's your fix ;) |
10:00:28 | FromDiscord | <flywind> It should be, Thanks! π |
10:13:29 | * | shad0w_ quit (Remote host closed the connection) |
10:40:36 | * | superbia quit (Quit: WeeChat 2.9) |
10:44:21 | FromDiscord | <alehander42> Araq is it possible |
10:44:25 | FromDiscord | <alehander42> to have a nil `.typ` |
10:44:35 | FromDiscord | <alehander42> for a node in the end of sempass2 e.g. for a dot expr ot ident |
10:44:37 | FromDiscord | <alehander42> sym* |
10:44:59 | Araq | no |
10:51:10 | * | kinkinkijkin quit (Remote host closed the connection) |
10:51:32 | * | kinkinkijkin joined #nim |
11:04:50 | * | noonien joined #nim |
11:05:20 | FromDiscord | <alehander42> cool |
11:06:31 | Araq | (maybe for some edge cases I forgot, but I doubt it) |
11:07:32 | FromDiscord | <alehander42> yeah, i'll just assert for now |
11:08:41 | * | Northstrider[m] quit (Quit: killed) |
11:10:08 | * | Northstrider[m] joined #nim |
11:25:21 | FromDiscord | <Clyybber> Araq: What were your plans regarding trace again? |
11:25:32 | FromDiscord | <Clyybber> Could we maybe use it for deepCopy without TypeInfoV1? |
11:38:05 | * | krux02 joined #nim |
11:40:58 | * | opal joined #nim |
12:05:40 | * | rockcavera joined #nim |
12:06:02 | * | supakeen quit (Quit: WeeChat 2.9) |
12:06:38 | * | supakeen joined #nim |
12:12:58 | * | shad0w_ joined #nim |
12:17:59 | FromDiscord | <mratsim> genericAssignAux was taking more time than cryptography, again :/ in our app |
12:22:53 | * | FromDiscord quit (Remote host closed the connection) |
12:23:09 | * | FromDiscord joined #nim |
12:28:31 | gour | PMunch: hello, i'm testing nimlsp with different editors (ST4, Emacs) as well as vscode extension, so wonder which editor you're using/testing against? based on minimal testing, it looks that vscode against is still a bit ahead? |
12:32:42 | PMunch | I'm using Vim |
12:32:58 | PMunch | I thought VSCode required an extra plug-in? |
12:37:11 | FromDiscord | <lqdev> it ford |
12:37:21 | FromDiscord | <lqdev> (edit) 'ford' => 'does' |
12:37:26 | FromDiscord | <lqdev> oof what a typo |
12:37:32 | PMunch | Haha, how did you manage that? :P |
12:37:51 | FromDiscord | <lqdev> idk, maybe i had a stroke? or maybe it's just that i don't know how to touch type. |
12:38:17 | PMunch | Ah, you're on QWERTY aren't you :P |
12:38:21 | FromDiscord | <lqdev> yes. |
12:38:40 | FromDiscord | <lqdev> though, i've been considering switching to dvorak recently. |
12:38:46 | PMunch | des and frd are just one letter to the right on the left hand |
12:39:10 | PMunch | I can recommend it :) |
12:44:19 | FromDiscord | <mratsim> I use VSCode except when I benchmark and nimsuggest acts up |
12:45:26 | * | qwertfisch quit (Ping timeout: 240 seconds) |
12:45:26 | * | beatmox quit (Ping timeout: 240 seconds) |
12:46:35 | * | abm quit (Quit: Leaving) |
12:46:55 | * | abm joined #nim |
12:52:38 | gour | PMunch: yeah. for vscode i've installed another extension...it works ok for ST(4) and somewhat for Emacs... |
12:54:27 | FromDiscord | <lqdev> i can recommend https://github.com/alaviss/nim.nvim for neovim |
13:11:55 | * | newUser joined #nim |
13:14:59 | newUser | hi, is it possible to have a variable precision: echo &"hours = {hours:02.6f}", for the 6 I want a variable? |
13:26:23 | PMunch | Well you can generate the specifier as a string and then call `formatValue` |
13:28:54 | Araq | use formatFloat directly |
13:30:21 | newUser | thx, formatFloat will round? |
13:31:37 | Araq | sure |
13:31:56 | newUser | thx |
13:32:14 | FromDiscord | <alehander42> Araq |
13:32:26 | FromDiscord | <alehander42> i get a isNil(b) where b is nkHiddenDeref |
13:32:53 | FromDiscord | <alehander42> is this a bug , or should i just skip it |
13:33:44 | * | bung_ joined #nim |
13:33:57 | * | waleee-cl joined #nim |
13:34:25 | * | shad0w_ quit (Ping timeout: 240 seconds) |
13:34:39 | FromDiscord | <alehander42> sorry, probably it makes sense for the passes, because it is an element in a `for` |
13:34:44 | FromDiscord | <alehander42> i'll try to skip it |
13:35:52 | Araq | you need to look at the type |
13:36:06 | Araq | derefs of 'lent' and 'var' are not nil |
13:36:14 | Araq | *cannot be nil |
13:36:31 | Araq | ping PMunch |
13:37:10 | PMunch | pong |
13:37:15 | FromDiscord | <alehander42> what i mean is for b in a: # where a is seq[Nilable] : just refs no var/lent |
13:37:25 | Araq | you wrote combparser, right? |
13:37:26 | * | bung quit (Ping timeout: 272 seconds) |
13:37:32 | PMunch | Regrettably, yes |
13:37:43 | Araq | when I do 'nimble test' it produces for example |
13:37:56 | Araq | Character set parser couldn't match more than 3 characters with the charset {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9'} on input "123;" |
13:38:09 | Araq | but then it also claims Success: All tests passed |
13:38:13 | Araq | so what is it? |
13:39:21 | PMunch | Hold on, let me have a look |
13:39:48 | PMunch | Ah, it's both |
13:39:55 | FromDiscord | <haxscramper> @alehander42 what do you think about introducing more special cases for `Kind( ... )` - e.g. I already have `Some(@x)` as alias for `(isSome: true, get: @x)`, maybe also rewrite things like `isSome(fld: @x)` to `(isSome: true, fld: @x)` |
13:40:09 | PMunch | If you look it tests/test.nim you can see that "Test 14" is supposed to generate an error |
13:40:33 | FromDiscord | <alehander42> the second one would be a more general case actually |
13:40:40 | FromDiscord | <alehander42> which is better than special case imo |
13:41:16 | FromDiscord | <haxscramper> Well, supporting `Some(@x)` is a must-have IMO, because `Option[T]` is expected to work like this |
13:41:26 | FromDiscord | <fwsgonzo> sent a code paste, see https://play.nim-lang.org/#ix=2yGo |
13:41:32 | FromDiscord | <alehander42> yes, but that's why we need a general way to help with that |
13:41:37 | FromDiscord | <alehander42> and i'll tell you why |
13:41:47 | * | newUser quit (Remote host closed the connection) |
13:41:49 | FromDiscord | <alehander42> did you anticipate result/error? |
13:41:54 | FromDiscord | <alehander42> but there is a relatively |
13:42:02 | Araq | ok thanks. and don't regret it, PMunch, it's our best cursor optimizer bug finder |
13:42:02 | FromDiscord | <alehander42> popular in status lib that provides exactly that |
13:42:11 | FromDiscord | <alehander42> we can't anticipate all important sum types |
13:42:38 | FromDiscord | <haxscramper> I'm talking about `Some(@x)` **AND** `isSome(fld: @x)` |
13:42:46 | FromDiscord | <haxscramper> Not only `Some()` |
13:43:04 | PMunch | Araq, haha good to know it at least has some usefulness |
13:43:17 | FromDiscord | <haxscramper> So you think rewriting `isPredicate` as I said would be a good idea? |
13:43:30 | FromDiscord | <alehander42> hm, but we can just write a macro `Some` which expands |
13:43:30 | FromDiscord | <alehander42> to the isSome thing |
13:43:54 | FromDiscord | <haxscramper> Because I'm usually very sceptical about all the things that rely on identifier name heuristics, |
13:44:08 | FromDiscord | <alehander42> no, don't rely on identifiers only |
13:44:26 | Araq | yeah, something along the lines of @it is preferable |
13:44:31 | FromDiscord | <haxscramper> Well, and how i would do it then? |
13:44:34 | FromDiscord | <alehander42> i am not sure how isPredicate was planned tho |
13:44:52 | FromDiscord | <alehander42> Araq wrote `@it` , huh, we need to fix the bridge |
13:44:55 | FromDiscord | <haxscramper> `isSome(fld: @x)` to `(isSome: true, fld: @x)` |
13:44:58 | FromDiscord | <alehander42> always auto-completing to tags |
13:45:12 | FromDiscord | <haxscramper> Just simple rewrite |
13:45:57 | FromDiscord | <haxscramper> If we have `is*()` (call identifier matches pattern) we rewrite it |
13:47:44 | FromDiscord | <haxscramper> `Some?(@x)` is valid syntax. We can just rewrite `<head>?(@var)` into `(is<head>: true, get: @var)` |
13:50:15 | * | qwertfisch joined #nim |
13:51:15 | FromDiscord | <alehander42> this is very specific |
13:51:25 | * | narimiran quit (Ping timeout: 240 seconds) |
13:51:27 | * | thomasross joined #nim |
13:51:33 | FromDiscord | <alehander42> and does it help with e.g. result |
13:51:41 | FromDiscord | <haxscramper> Yes |
13:52:06 | FromDiscord | <haxscramper> Well, this is a general question about enforinc single code style |
13:52:22 | FromDiscord | <alehander42> i like it |
13:52:25 | FromDiscord | <alehander42> the single style |
13:52:27 | FromDiscord | <haxscramper> Like, if your tyep is an `Option`-like, could you please provide `get:` |
13:52:28 | FromDiscord | <alehander42> but i dont like the |
13:52:32 | FromDiscord | <alehander42> speicific rewrite rule |
13:52:38 | FromDiscord | <alehander42> well, nah, this is super custom |
13:52:45 | FromDiscord | <alehander42> why not use the language |
13:53:14 | FromDiscord | <haxscramper> Ah, you mean `<head>?(` vs `is<head>(` thing |
13:53:17 | FromDiscord | <alehander42> i mean its cool to do so |
13:53:18 | FromDiscord | <alehander42> no |
13:53:23 | FromDiscord | <alehander42> just let pople |
13:53:24 | FromDiscord | <alehander42> (edit) 'pople' => 'people' |
13:53:27 | FromDiscord | <alehander42> write a macro ! |
13:53:39 | FromDiscord | <alehander42> they can write a template `Some` that expands to the |
13:53:45 | FromDiscord | <alehander42> equivalent pattern |
13:53:56 | FromDiscord | <alehander42> without any new features and limitations |
13:54:12 | FromDiscord | <alehander42> this might be not too advanced |
13:54:17 | FromDiscord | <alehander42> but it can be documented |
13:54:22 | FromDiscord | <alehander42> and people can do it anyways |
13:54:34 | FromDiscord | <haxscramper> I rewrite all `Kind(` checks into `hasKind(expr, Kind)` |
13:55:12 | FromDiscord | <haxscramper> So there is no loophole to inject any other rewrite, because there is a catch-all default |
13:55:23 | FromDiscord | <alehander42> but isn't there a way |
13:55:29 | FromDiscord | <alehander42> to have like an immediate template |
13:55:37 | FromDiscord | <alehander42> which can be expanded before |
13:55:43 | FromDiscord | <alehander42> the match even gets the code |
13:56:12 | FromDiscord | <haxscramper> I need to communicate list of all captured variables & contexts |
13:56:22 | * | shad0w_ joined #nim |
13:56:25 | FromDiscord | <alehander42> no, i dont think i |
13:56:33 | FromDiscord | <alehander42> i get it |
13:56:42 | FromDiscord | <alehander42> but i am not talking about that π |
13:56:46 | * | vicfred quit (Quit: Leaving) |
13:57:02 | FromDiscord | <alehander42> before the code gets to the macro at all` |
13:57:04 | FromDiscord | <alehander42> (edit) 'all`' => 'all' |
13:57:10 | * | beatmox joined #nim |
13:57:28 | FromDiscord | <alehander42> sorry, maybe a rewriting mechanism is better |
13:57:34 | FromDiscord | <alehander42> but if its possible to write a template |
13:57:43 | FromDiscord | <alehander42> that expands before your macro starts executing |
13:57:48 | FromDiscord | <alehander42> then one can do |
13:57:52 | FromDiscord | <haxscramper> match arm rewriting is an immediate macro, it executes before anything else AFAIK |
13:58:07 | FromDiscord | <haxscramper> If you are talking about "before `match` expands" |
13:58:21 | FromDiscord | <alehander42> `Some(a) -> isSome(get: a)` |
13:58:22 | FromDiscord | <alehander42> etc |
13:58:24 | FromDiscord | <alehander42> yeah |
13:58:40 | FromDiscord | <alehander42> hm, is it immediate |
13:58:41 | FromDiscord | <mratsim> generic symbol resolution is done earlier than anything else |
13:59:03 | FromDiscord | <haxscramper> Even before `untyped` macro? |
13:59:06 | FromDiscord | <mratsim> yup |
13:59:20 | Araq | no, untyped macros are expanded |
13:59:21 | FromDiscord | <mratsim> https://github.com/nim-lang/Nim/issues/8677 |
13:59:21 | disbot | β₯ [Meta] Generics/Static early symbol resolution |
13:59:22 | FromDiscord | <haxscramper> err |
13:59:38 | Araq | they are expanded before symbol resolution kicks in |
13:59:44 | * | PMunch quit (Quit: leaving) |
13:59:57 | Araq | but for that *all* parameter types must be untyped, not just some |
13:59:59 | FromDiscord | <alehander42> hm |
14:00:00 | FromDiscord | <mratsim> they are not or I wouldn't have this bug: https://github.com/nim-lang/Nim/issues/6387 |
14:00:04 | FromDiscord | <alehander42> so is there a way to |
14:00:14 | FromDiscord | <alehander42> expand a macro |
14:00:19 | FromDiscord | <alehander42> from your own other macro |
14:00:40 | FromDiscord | <haxscramper> no |
14:00:45 | FromDiscord | <haxscramper> I can generate macro call |
14:01:00 | FromDiscord | <haxscramper> or pass list of callbacks to macro |
14:01:15 | FromDiscord | <haxscramper> which would be the "rewriters". I do this in `nimtraits` |
14:01:24 | FromDiscord | <alehander42> hmmmm, sorry then |
14:01:29 | Araq | mratsim: the macro in your example are not all untyped |
14:01:31 | FromDiscord | <alehander42> i've been wrong |
14:01:42 | FromDiscord | <haxscramper> E.g. `.derive(Eq).` is implemented using callbacks which are passed to macro |
14:02:05 | FromDiscord | <alehander42> sorry man |
14:02:06 | FromDiscord | <alehander42> ok |
14:02:14 | FromDiscord | <alehander42> so maybe then a rewrite system |
14:02:15 | FromDiscord | <alehander42> is ok |
14:02:15 | FromDiscord | <haxscramper> And they do all rewriting. And trait implementation is just list of these rewriters that trigger on each pragma. But this is an ugly solution |
14:02:31 | FromDiscord | <alehander42> not ugly, but complicated |
14:02:40 | FromDiscord | <alehander42> and not dry if we already have teemplates |
14:02:58 | FromDiscord | <haxscramper> no, you have to either pass callbacks explicitly each time or introduce global compile-time variable |
14:03:02 | FromDiscord | <mratsim> can't you just implement that on top of concepts? |
14:03:30 | FromDiscord | <mratsim> ah but concept is not explicitly derived |
14:03:36 | FromDiscord | <haxscramper> No. Well, **I** don't know how to do this |
14:04:16 | FromDiscord | <mratsim> maybe that will give you inspiration to implement traits: https://github.com/mratsim/trace-of-radiance/blob/master/trace_of_radiance/support/emulate_classes_with_ADTs.nim |
14:04:42 | FromDiscord | <fwsgonzo> the cpp generator outputs code that casts string literals to char*, which "works" in C because it never made its string literals const |
14:05:13 | FromDiscord | <fwsgonzo> (edit) 'const' => 'const. its the line tracking code' |
14:05:36 | FromDiscord | <alehander42> hm |
14:05:43 | FromDiscord | <alehander42> how would they help for patterns? |
14:07:08 | FromDiscord | <alehander42> Araq i have a fun problem: i check stuff like `for` code twice, so sometimes i get the same warning twice |
14:07:36 | FromDiscord | <alehander42> do you deal with this in your passes (e.g. set of warnings ) |
14:08:01 | FromDiscord | <alehander42> as i remember you had this double visit things somewher |
14:08:04 | FromDiscord | <alehander42> (edit) 'somewher' => 'somewhere' |
14:08:26 | Araq | sometimes I add logic to prevent that from happening |
14:09:37 | FromDiscord | <alehander42> just keeping a set of LineInfo-s seem most obvious to me |
14:09:56 | Araq | yeah |
14:11:50 | FromDiscord | <Kiloneie> there is no ternary operator in Nim right ? |
14:12:45 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2yGB |
14:13:12 | FromDiscord | <Kiloneie> well of course templates and macros can do anything xD |
14:13:30 | Araq | (if cond: a else: b) |
14:13:39 | Araq | if is available as an expression |
14:13:52 | FromDiscord | <haxscramper> You might try and do something with term rewriting macros if you **really** want to have it as operator |
14:13:59 | FromDiscord | <haxscramper> But I"m not sure if it is possible |
14:14:33 | FromDiscord | <Kiloneie> nah i don't care about it, was just curious since i am learning cpp to do a project for my CV( i want a programming job D:...) |
14:14:50 | FromDiscord | <Kiloneie> my programming CV is like... i know these languages... with nothing to show... |
14:15:00 | FromDiscord | <fwsgonzo> finish something |
14:15:47 | FromDiscord | <alehander42> awesome |
14:18:21 | FromDiscord | <Kiloneie> I am planning a game |
14:18:29 | FromDiscord | <alehander42> Araq ok return/break stuff should work now |
14:18:48 | FromDiscord | <alehander42> next is `if/elif/else` and `[]` . |
14:18:56 | Araq | good choice. Few jobs requires as little thinking as programming. You can remain ignorant about everything, "structured" programming, type safety, security, memory management, data structures, basic math, logic. You'll be fine with pasting Stack Overflow snippets into your "program". |
14:20:04 | FromDiscord | <Kiloneie> xD yeah, ima use SDL 2 so i understand it better for Nim usage later |
14:20:27 | FromDiscord | <Kiloneie> getting used to cpp way of syntax is a pain though |
14:20:35 | FromDiscord | <Kiloneie> ide keeps screaming ; at me D:... |
14:42:48 | * | beatmox quit (Ping timeout: 244 seconds) |
14:44:27 | * | qwertfisch quit (Ping timeout: 272 seconds) |
14:47:45 | * | haxscramper joined #nim |
14:48:36 | * | qwertfisch joined #nim |
14:49:03 | * | beatmox joined #nim |
14:53:03 | haxscramper | Araq: there is a thread on nim forum on "Compiler reading" (2016) where among other things you wrote that |
14:53:03 | haxscramper | |
14:53:04 | haxscramper | > ... don't use exceptions either (Nim does use exceptions to some extend). It's hard to ensure that the tool did as much as it could when exceptions are allowed to bubble up the call stack. Instead have an error node kind that marks wrong subtrees. |
14:53:04 | haxscramper | |
14:53:07 | haxscramper | Is it true for nim compiler too or only to tools like nimsuggest etc. which should continue work on malformed data? If I understand correctly most of the error handling is done via call to error handling procs which mostly lead to direct `quit 1` call. Are exceptions better for handling internal compiler errors or both solutions are bad? |
14:53:10 | haxscramper | |
14:53:13 | haxscramper | |
14:54:52 | Araq | it's true for the Nim compiler too, it's all the same code base |
14:55:02 | Araq | however it does use exceptions |
14:55:09 | Araq | if nothing else works as well |
14:56:49 | * | a_chou joined #nim |
15:01:21 | * | dgb joined #nim |
15:02:22 | * | superbia joined #nim |
15:17:26 | FromDiscord | <dom96> exceptions are wonderful |
15:18:15 | Araq | nah, they suck. but the alternatives can suck even more |
15:20:33 | * | kenran quit (Ping timeout: 272 seconds) |
15:22:02 | shad0w_ | lmao. |
15:22:40 | * | ^Q-Master^ quit (Ping timeout: 260 seconds) |
15:24:28 | * | Q-Master joined #nim |
15:29:15 | Araq | what is the *default* that 'nimble test' does? |
15:31:13 | * | shad0w_ quit (Ping timeout: 246 seconds) |
15:34:30 | * | kenran joined #nim |
15:36:13 | FromDiscord | <mratsim> run all nim files starting with a t in the tests folder iirc |
15:37:11 | FromDiscord | <mratsim> I think it should just say "test" task not defined |
15:38:45 | Araq | oh I see |
15:38:47 | Araq | Nimble adds |
15:38:48 | Araq | Success: Execution finished |
15:38:48 | Araq | Success: All tests passed |
15:38:51 | Araq | to the output |
15:38:56 | * | kenran quit (Ping timeout: 265 seconds) |
15:39:05 | Araq | and I thought it's unittest.nim's output |
15:42:27 | FromDiscord | <mratsim> it doesn't just adds |
15:42:42 | FromDiscord | <mratsim> some of the output in case of errors is missing iirc |
15:43:00 | FromDiscord | <mratsim> the stacktraces better when you directly compile the nim file |
15:45:23 | * | gour_ joined #nim |
15:45:53 | Araq | well Nimble is a PM, it has to be annoying, that is its job. PMs are tools designed to annoy me. |
15:46:09 | FromDiscord | <dom96> lol |
15:46:29 | * | hnOsmium0001 joined #nim |
15:46:42 | Araq | could be worse though, could be LaTeX |
15:47:17 | Araq | "yay, a margin, let me write on it. Oh there is an error. Let's block stdin and ask the user for help." |
15:47:41 | Araq | "Oh, you need a table of contents, better run me twice in a row then." |
15:47:46 | FromDiscord | <mratsim> no that's when you need nimble refresh -y |
15:48:25 | * | gour quit (Ping timeout: 240 seconds) |
15:48:36 | Araq | "Here is an error coming from a plugin/module you didn't even know you used" |
15:49:35 | * | tane joined #nim |
15:50:02 | * | vicfred joined #nim |
15:50:03 | Araq | "Oh, you used an Umlaut, well TeX understands Unicode. All you need is this package, no, not that one, that other one" |
15:51:35 | FromDiscord | <flywind> Lol, `nim docs` doesn't want to generate docs for `lent type`. |
15:51:47 | FromDiscord | <flywind> https://planety.github.io/prologue/coreapi/context.html#13 |
15:52:34 | Araq | dom96: remember i told you 'nimble test --gc:orc' doesn't work? now it does :-) |
15:52:47 | Araq | good job whoever did that |
15:53:26 | Araq | (no irony here) |
15:59:58 | Yardanico | Araq: "<Araq> Yardanico, does it work without cursor inference? " yes, combparser passes all of its test cases with --cursorInference:off |
16:01:35 | * | rakgew[m] left #nim ("Kicked by @appservice-irc:matrix.org : Idle for 30+ days") |
16:01:40 | Araq | yeah I know, looking into it |
16:01:42 | Yardanico | nimly's tests/test_lexgen.nim SIGSEGVs with orc after half of the tests even with cursor inference off |
16:01:52 | Yardanico | but it's more complex than combparser :P |
16:02:01 | FromDiscord | <Avatarfighter> What is up everyone how are you all doing this fine day/night? |
16:02:57 | FromDiscord | <himu> Congratulations on reaching 10k stars in Github! π |
16:03:05 | FromDiscord | <himu> Sorry for being late to the party. :) |
16:03:23 | FromDiscord | <ache of head> Wow, congrats! |
16:03:24 | FromDiscord | <ache of head> Didnβt notice that |
16:03:35 | Yardanico | 9993* :P |
16:03:41 | Yardanico | still 7 more to go for the honest celebration |
16:03:58 | FromDiscord | <Rika> someone make 7 more accounsd |
16:04:00 | FromDiscord | <Rika> (edit) 'accounsd' => 'accounts' |
16:05:18 | FromDiscord | <himu> I am spamming my social media accounts! Let's make that happen! |
16:05:23 | Yardanico | no :P |
16:05:28 | Yardanico | stars don't matter that much really |
16:05:43 | Araq | we'll get them once we finally release 1.4 |
16:06:07 | FromDiscord | <dom96> Yardanico: bruh, let the people have their stargazer fun π |
16:06:19 | FromDiscord | <himu> I know stars don't matter. (e.g. LLVM) but still its something that gives you an extra motivation. Just the little bit of happiness. |
16:17:35 | FromDiscord | <fwsgonzo> ```β΅Error: system module needs: getFrameβ΅``` β΅when passing gc:arc wwith -d:useMalloc |
16:19:29 | Yardanico | what nim version? |
16:19:36 | Yardanico | and what are you trying to compile? |
16:19:49 | FromDiscord | <fwsgonzo> i have a custom environment, os:standalone |
16:20:01 | FromDiscord | <fwsgonzo> backend is cpp |
16:20:47 | FromDiscord | <fwsgonzo> looks like nim is generating a lot more nimcache files with os:any |
16:22:24 | FromDiscord | <fwsgonzo> by using os:any with more nimcache files it builds and runs now π |
16:27:36 | FromDiscord | <fwsgonzo> is there a way to get nim to apply `__attribute__((used))` to a function? |
16:32:39 | FromDiscord | <JSGRANT> Araq: What's planned for 1.4 , IC? |
16:34:41 | FromDiscord | <JSGRANT> Actually, in-general is there a loose roadmap anywhere I'm overlooking? |
16:34:53 | Yardanico | yes |
16:35:09 | Yardanico | https://github.com/nim-lang/RFCs/milestone/1 |
16:35:26 | FromDiscord | <JSGRANT> Ah, right on! Ty! |
16:36:47 | FromDiscord | <JSGRANT> Can't wait for Nim 202X; I heard Araq hired Keanu Reeves to make a cameo. |
16:38:23 | * | a_chou quit (Quit: a_chou) |
16:42:54 | FromDiscord | <fwsgonzo> is there a list of function attributes? |
16:43:04 | Yardanico | you mean pragmas |
16:43:09 | Yardanico | they're not limited to procedures/functions |
16:43:21 | Yardanico | https://nim-lang.org/docs/manual.html#pragmas |
16:43:27 | Yardanico | starting from there |
16:49:25 | FromDiscord | <fwsgonzo> i need nim to add `__attribute__((used))` to a function |
16:49:31 | FromDiscord | <fwsgonzo> the used pragma didn't do the trick |
16:51:13 | Yardanico | why do you need that? |
16:51:18 | Yardanico | do you need to export it or something? |
16:51:22 | Yardanico | there are different pragmas for that |
16:51:39 | Yardanico | like if you need that function to be used from other programs/libs, use exportc |
16:51:47 | * | rockcavera quit (Ping timeout: 240 seconds) |
16:52:00 | FromDiscord | <fwsgonzo> i need the linker to not prune it, and while I can do that with --undefined=name, it's nicer to mark the function as public |
16:52:09 | * | shad0w_ joined #nim |
16:52:19 | FromDiscord | <fwsgonzo> it's already .exportc |
16:52:28 | * | Trustable quit (Remote host closed the connection) |
16:56:43 | FromDiscord | <fwsgonzo> how do you add a newline character to fmt string? |
16:57:58 | FromDiscord | <fwsgonzo> (edit) 'how do you add a newline character to fmt string? ... ' => 'how do you add a newline character to fmt string?nvm. it's {'\n'}' |
16:59:10 | Yardanico | well not really, there are simpler ways |
16:59:10 | Yardanico | read https://nim-lang.org/docs/strformat.html#fmt-vsdot-amp |
16:59:31 | Yardanico | fmt("\n") will do what you think it will |
17:02:45 | * | shad0w_ quit (Remote host closed the connection) |
17:02:52 | FromDiscord | <fwsgonzo> π |
17:20:47 | * | leorize quit (Quit: WeeChat 2.8) |
17:41:03 | reversem3 | I do a lot of parsing of various document , Gb of data and millions of lines sometimes, I was looking at python to do this but I run out of memory , unix tools have really helped me out a lot, can nim parse stupidly large documents ? if so can someone point to me documentation about this ? |
17:42:24 | supakeen | It's probably more about how your approach to parsing these large files. If you're going to try and read it all at the same time no programming language will save you :) |
17:42:46 | supakeen | Other than that, what type of documentation are you looking for? |
17:43:58 | reversem3 | json, ascii, docx, database dumps (so ascii or csv) |
17:44:00 | FromDiscord | <mratsim> mmap is your friend |
17:44:25 | FromDiscord | <mratsim> memory map your document don't try to load it in memory |
17:44:30 | FromDiscord | <mratsim> true for any language |
17:45:07 | reversem3 | example I have 7 Gb file and I want to get all the elements of xyx in this file , python crashed my system |
17:45:42 | reversem3 | it was json , jq didn't help either , I did try fjq from nim but no results |
17:45:59 | reversem3 | !help mmap |
17:46:08 | FromDiscord | <mratsim> if it's tabular data, R data.tables should handle it no sweat |
17:46:25 | reversem3 | so i need to learn R ? |
17:46:25 | supakeen | You'd be looking for an event emitting parser for JSON files that large, I'm not sure if any exist for Nim? |
17:46:52 | reversem3 | bummer |
17:47:01 | FromDiscord | <mratsim> you need to find a package that was written to handle a medium amount of data |
17:47:22 | FromDiscord | <mratsim> let me check what I used in Python last time I had to do this |
17:47:27 | supakeen | I don't think there's that many JSON parsers that are iterative out there, I know of one for Python. |
17:47:31 | supakeen | (ijson) |
17:47:46 | reversem3 | yeah I think I tried ijson |
17:48:01 | reversem3 | so only awk and grep are working |
17:48:05 | supakeen | But you'd still need to be careful to not end up putting everything in memory yourself anyways. |
17:48:17 | supakeen | It's because those work on lines, they don't try to validate and parse the entire document. |
17:48:31 | reversem3 | ahh ok |
17:48:53 | reversem3 | so everytime python reads a file , it puts it in memory |
17:50:17 | supakeen | Python, like Nim, can read files line by line or block by block. |
17:50:43 | supakeen | But if you use for example the built-in JSON parser it will try to read in and validate the entire document as this is the normal way JSON is parsed in ~all languages. |
17:51:06 | supakeen | If you have a special case with huge files that ain't going to work so other packages exist that yield all the data as they read over the file without keeping the file. |
17:51:16 | supakeen | However, if you then still keep all that data around you still have a problem. |
17:51:42 | FromDiscord | <mratsim> Nimdata can handle big files without loading in memory https://github.com/bluenote10/NimData |
17:51:47 | FromDiscord | <mratsim> but in csv form |
17:52:02 | reversem3 | ok so read it line by line instead of loading it all at once |
17:52:19 | reversem3 | so I don't have to use a json parser than unless I want to validate it ? |
17:52:26 | FromDiscord | <mratsim> for json iirc I converted them to csv via perl :p |
17:52:37 | FromDiscord | <mratsim> big json files might be in a single line |
17:52:54 | reversem3 | ohhh , I don't want that |
17:52:54 | FromDiscord | <mratsim> also don't use Nim json module, it's not made to handle that much data |
17:53:04 | reversem3 | ok |
17:53:17 | FromDiscord | <mratsim> I guess I'll put that to my list of tasks |
17:54:23 | FromDiscord | <mratsim> FYI, I had large json and csv files when working on this: https://github.com/mratsim/Apartment-Interest-Prediction |
17:54:34 | FromDiscord | <mratsim> at one point geolocation data required 80GB of mem :/ |
17:54:54 | reversem3 | damn |
17:55:45 | reversem3 | ok so basically I need to write scripts or programs to find certain strings ie hex or just text and compile to make a list and how many they are , sort , uniq and so on |
17:56:27 | FromDiscord | <mratsim> for csv I had good luck with xsv and R |
17:56:34 | FromDiscord | <mratsim> for json that was a pain |
17:57:33 | FromDiscord | <mratsim> I suggest you look on Kaggle on post to handle large json files |
17:57:40 | FromDiscord | <mratsim> for example this one is 5GB: https://www.kaggle.com/yelp-dataset/yelp-dataset |
17:58:30 | * | ldlework quit (Ping timeout: 246 seconds) |
17:59:26 | FromDiscord | <mratsim> I remember a post by Yelp on analyzing TB of wikipedia data for phone numbers in Python |
18:02:00 | FromDiscord | <mratsim> mmmh it was this: https://engineeringblog.yelp.com/2015/03/analyzing-the-web-for-the-price-of-a-sandwich.html |
18:03:19 | reversem3 | so basically numpy and pandas |
18:03:20 | supakeen | It'd be interesting to have a good iterative parsing toolkit. |
18:03:25 | supakeen | In general. |
18:08:42 | FromDiscord | <slonik_az> SAX-style streaming JSON parsers can take on a json file of any size in almost constant RAM. You need to provide callbacks to handle events yourself, though. |
18:09:51 | reversem3 | interesting readfile using inim works |
18:09:55 | FromDiscord | <fwsgonzo> if you write "import XX from YY" nim will not give you a useful error |
18:15:36 | * | cgfuh joined #nim |
18:18:47 | FromDiscord | <lqdev> /usercode/in.nim(1, 8) Error: cannot open file: xx |
18:18:53 | FromDiscord | <lqdev> how is that not a useful error? |
18:19:42 | * | leorize joined #nim |
18:23:32 | reversem3 | is this the best docs for learning how to read files and parsing out information ? https://nim-lang.org/docs/io.html#readFile%2Cstring |
18:27:41 | supakeen | I don't think there's comprehensive documentation on that yet? |
18:29:52 | reversem3 | bummer |
18:33:12 | leorize | it depends on what you want to parse |
18:33:24 | leorize | if it's a well known format we probably have libraries for it |
18:33:43 | leorize | if not then you'll have to build a parser, which is pretty easy with npeg and/or nim-regex |
18:33:49 | * | tane quit (Quit: Leaving) |
18:37:54 | supakeen | You missed part of the backlog but they're looking for iterative (or event emitting) parsers. |
18:48:20 | FromDiscord | <haxscramper> `pegs` from standard library has event-emitting parser |
18:48:56 | FromDiscord | <haxscramper> https://nim-lang.org/docs/pegs.html#eventParser.t%2Cuntyped%2Cuntyped |
18:54:08 | * | narimiran joined #nim |
19:06:55 | * | ldlework joined #nim |
19:08:19 | Zevv | npeg can do that? |
19:09:04 | * | kenran joined #nim |
19:11:51 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
19:12:12 | * | ehmry joined #nim |
19:21:16 | * | lritter quit (Ping timeout: 265 seconds) |
19:21:31 | * | tane joined #nim |
19:25:43 | * | gour_ quit (Remote host closed the connection) |
19:38:40 | * | Vladar quit (Quit: Leaving) |
19:45:03 | Zevv | what makes a "streaming" parser then |
19:45:12 | Zevv | or "iterative", I mean |
19:48:51 | Zevv | where'd disruptek go? |
19:50:59 | * | kenran quit (Ping timeout: 240 seconds) |
19:50:59 | FromDiscord | <Rika> he is no more |
20:04:20 | voidpi | eaten by llamas? |
20:06:19 | superbia | worse |
20:06:56 | superbia | voidpi: excommunicado |
20:07:14 | voidpi | lol |
20:07:19 | voidpi | so coming back with a vengeance |
20:12:01 | * | narimiran quit (Ping timeout: 265 seconds) |
20:15:46 | FromDiscord | <slonik_az> > `pegs` from standard library has event-emitting parserβ΅@haxscramper according to the documentation this parser takes input from string rather than stream. A true event-emitting streaming parser does not load all the input into RAM but processes them in chunks. |
20:19:02 | Zevv | ah right. Npeg doesn't "load all the input into ram", but it does expect it to be there already |
20:19:08 | Zevv | Boils down to the same, of course |
20:19:39 | Zevv | it can parse huge files however, since it supports mmaping files out of the box |
20:22:07 | FromDiscord | <haxscramper> sent a long message, see http://ix.io/2yIQ |
20:23:40 | FromDiscord | <slonik_az> I think the original discussion was how to parse json files > 5GB |
20:24:18 | FromDiscord | <slonik_az> Typically very large files have simple schemas π |
20:25:31 | Zevv | that's peanuts for npeg |
20:27:05 | FromDiscord | <slonik_az> depends on your RAM. If you use small AWS EC2 instance with 8GB of RAM and your json file is 20GB than you have a problem |
20:31:22 | supakeen | I'm not up to date enough on PEG parsers for JSON I think. |
20:33:28 | Zevv | supakeen: https://github.com/zevv/npeg/blob/master/tests/performance.nim#L63 |
20:33:38 | FromDiscord | <slonik_az> PEGs are great and economical for stream parsing but the specific `npeg` API is for strings not streams |
20:34:02 | Zevv | slonik_az: no, you can mmap humongous files with few ram |
20:34:07 | Zevv | it's virtual |
20:35:07 | FromDiscord | <slonik_az> (edit) '`npeg`' => '`pegs`' |
20:35:17 | supakeen | Zevv: Can npeg yield the elements as it parses them so I can throw them away again immediately? |
20:35:28 | supakeen | (since I can't build the entire tree, it won't fit) |
20:35:29 | Zevv | it doesn't "save" anything by default |
20:35:42 | Zevv | it passes over it, and can call nim code for matches |
20:36:05 | FromDiscord | <slonik_az> The file is in S3, you cannot mmap S3. |
20:36:25 | Zevv | ha that's progress for you |
20:36:56 | supakeen | Zevv: Nice :) |
20:37:38 | * | Trustable joined #nim |
20:37:50 | Zevv | i tried a few times making it resumable/streamable, but I kind of gave up on that |
20:39:04 | FromDiscord | <slonik_az> Zevv: what is the size of lookahead buffer needed to parse json element in PEG? Is it limited to the size of next element? |
20:39:51 | Zevv | there is no lookahead buffer in npeg, it's also not packrat |
20:40:38 | Zevv | it builds a state machine from your grammar that is translated into Nim at compile time |
20:41:44 | Zevv | the memory requirements for parsing is virtually zero. It's a handful of bytes for every open choice, once a choice is final/commited, the choice unwinds from the stack and it continues from there |
20:42:10 | FromDiscord | <slonik_az> in this case stream parsing should not be difficult, right? |
20:42:32 | Zevv | it shouldn't. The problem with streams is not the parsing, but the capturing |
20:42:58 | FromDiscord | <slonik_az> what do you mean by capturing? |
20:43:01 | Zevv | because captures might refer to stuff that's already "gone" |
20:43:42 | FromDiscord | <slonik_az> in event emitting parser it is the concern of callback providers |
20:43:59 | FromDiscord | <slonik_az> , event handlers |
20:44:08 | Zevv | https://github.com/zevv/npeg#captures |
20:44:34 | FromDiscord | <slonik_az> I am talking mostly about not referential simple formats like JSON |
20:45:18 | Zevv | npeg is a bit of a hybrid I think - typicall use case is to find snippets in your subject, it 'captures' those from rules and passes these to your nim 'callbacks' |
20:45:40 | Zevv | so one capture would be a single json string or a number |
20:46:26 | Zevv | i bet theres a nice solution to make it streaming and all, but I just really didn't like the additional complexity it brings every time I try to put it in. Given that mmap solves a lot of cases, I dropped it |
20:46:50 | FromDiscord | <slonik_az> it means that i do not need to remember the captures past their immediate use in an event handler. It will allow parsing huge JSON files in constant RAM |
20:47:01 | Zevv | right |
20:47:25 | Zevv | and it will also draw pretty graphs for you. that's always my primary selling point |
20:47:39 | supakeen | Sold. |
20:47:42 | Zevv | \o/ |
20:47:52 | FromDiscord | <slonik_az> I should play with `npeg` when I get time. |
20:48:34 | FromDiscord | <slonik_az> /^\ |
20:48:58 | supakeen | I just added `requires "npeg >= 0.23.0"` somewhere ;) |
20:49:24 | Zevv | http://zevv.nl/div/json.png |
20:51:05 | supakeen | Mooi :) |
20:51:10 | Zevv | dankjewel |
20:51:16 | FromDiscord | <SeanOMik> sent a code paste, see https://play.nim-lang.org/#ix=2yJ3 |
20:51:39 | FromDiscord | <SeanOMik> That code runs inside an async method |
20:51:45 | supakeen | I'll try to make some arbitrary 'iterparse' library based on npeg so one can do `for event in iterCSV(...)` or such. |
20:52:49 | FromDiscord | <slonik_az> Zevv: the graphics is stunning both visually and logically π |
20:53:07 | Zevv | hmm I wonder if that would work, there's no way to simply turn control flow inside out for npeg. but keep me informed on your progress by all means! |
20:53:24 | supakeen | That's why it's a try :) |
20:53:34 | Zevv | cool stuff |
20:53:57 | Zevv | slonik_az: yeah in the end it was only about the graphs. I hardly parse anything these days, I just write grammars and admire the view |
21:02:32 | FromDiscord | <dom96> @SeanOMik your assumptions must be incorrect, async code can run concurrently, you sure your output isn't leading you to incorrect assumptions? |
21:02:49 | FromDiscord | <SeanOMik> ? |
21:02:53 | FromDiscord | <SeanOMik> What assumptions? |
21:03:00 | FromDiscord | <SeanOMik> I have no idea whats happening with it |
21:03:10 | FromDiscord | <SeanOMik> I stated that it was async incase it mattered |
21:04:08 | FromDiscord | <dom96> I don't understand your question then, which condition passes when `isHandlingHeartbeat` is false? |
21:05:32 | FromDiscord | <Rika> `not shard.isHandlingHeartbeat` is true when `shard.isHandlingHeartbeat` is false, wdym? |
21:06:31 | FromDiscord | <SeanOMik> I mean that it always prints out "echo "Starting new heartbeat thread! Heartbeat thread is ", shard.heartbeatAcked" |
21:06:44 | FromDiscord | <SeanOMik> (edit) removed '"echo' | '", shard.heartbeatAcked"' => 'true/false"' |
21:06:51 | FromDiscord | <SeanOMik> Even though it should only print it out when its false |
21:07:07 | FromDiscord | <SeanOMik> (edit) 'its' => '`shard.isHandlingHeartbeat`' |
21:07:18 | FromDiscord | <SeanOMik> (edit) 'true/false"' => '" + shard.isHandlingHeartbeat' |
21:08:30 | FromDiscord | <dom96> Are you sure? Did you put a `echo shard.isHandlingHeartbeat` before the `if` statement to verify this? |
21:08:55 | FromDiscord | <SeanOMik> I am sure, I'll put it before that though |
21:09:47 | FromDiscord | <dom96> The reason I ask is because something as fundamental as the if statement being to blame sounds really unlikely π |
21:10:16 | FromDiscord | <SeanOMik> Yeah I know |
21:10:22 | FromDiscord | <SeanOMik> Thats why I feel like I'm going crazy |
21:12:06 | FromDiscord | <SeanOMik> Oh wait, maybe its because my method takes a `shard: Shard` @dom96 ? |
21:12:12 | FromDiscord | <SeanOMik> And because its not mutable |
21:12:25 | FromDiscord | <SeanOMik> Actually |
21:12:37 | FromDiscord | <SeanOMik> I think I could move the variable outside of the Shard type |
21:13:36 | FromDiscord | <dom96> Sounds like you're guessing a little bit here |
21:13:44 | FromDiscord | <dom96> add `echo` statements to understand what your code is really doing |
21:13:55 | FromDiscord | <dom96> remove code if you must to narrow down the problem |
21:16:00 | FromDiscord | <SeanOMik> I fixed it |
21:16:14 | FromDiscord | <SeanOMik> I ended up just moving the field outside of the Shard class |
21:16:23 | FromDiscord | <SeanOMik> Since its literally not used anywhere else |
21:16:29 | FromDiscord | <SeanOMik> Beside this one function that runs all the time |
21:16:58 | FromDiscord | <SeanOMik> I need to get used to putting `echo` statements everywhere |
21:17:06 | FromDiscord | <SeanOMik> Used to C++ where you have an actual debugger |
21:17:23 | FromDiscord | <SeanOMik> Someone needs to make an actual debugger for Nim |
21:17:31 | FromDiscord | <SeanOMik> Anyway, thanks for the help! |
21:17:55 | FromDiscord | <dom96> You do have an actual debugger too |
21:18:04 | FromDiscord | <dom96> you can use gdb just fine |
21:18:18 | FromDiscord | <dom96> But if I was using C++ I would rarely use a debugger either |
21:21:16 | FromDiscord | <Rebel> Is there an easy way when using stream buffer to have the buffer be an arbitrary size passed in as a param in a function? Something like this https://play.nim-lang.org/#ix=2yJ9 |
21:21:22 | FromDiscord | <Rebel> (edit) 'buffer' => 'buffers' |
21:21:33 | FromDiscord | <Rebel> (edit) 'Is there an easy way when using stream buffers ... to' => 'Is there an easy way when using stream buffersto read/write files' |
21:23:39 | * | haxscramper quit (Remote host closed the connection) |
21:29:57 | * | konkrrrrrr joined #nim |
21:30:37 | * | kinkinkijkin quit (Ping timeout: 260 seconds) |
21:42:53 | * | solitudesf quit (Ping timeout: 265 seconds) |
21:46:38 | FromDiscord | <Recruit_main707> try discard readData(strm, addr(buffer[0]), len buffer) that way you get the address of where the actual sequence data starts at, (because a sequence has some extra memory before the data, thats why it didnt work) |
21:50:39 | * | cgfuh quit (Quit: WeeChat 2.9) |
21:54:27 | * | D_ joined #nim |
22:07:57 | * | konkrrrrrr is now known as kinkinkijkin |
22:08:10 | * | Trustable quit (Remote host closed the connection) |
22:20:56 | * | tane quit (Quit: Leaving) |
22:28:32 | * | thomasross quit (Remote host closed the connection) |
22:28:53 | * | thomasross joined #nim |
22:33:56 | * | arecacea1 quit (Remote host closed the connection) |
22:34:23 | * | arecacea1 joined #nim |
22:34:47 | FromGitter | <matrixbot> `ondra05` Hello. |
22:36:15 | FromGitter | <matrixbot> `ondra05` I made a binary project with nimble. Created a file node.nim in src file and made a type Node. But when i import it by `import node` and make an ?instance?, it shows me: Undeclared identifier: Node |
22:44:22 | FromDiscord | <dom96> did you export the `Node` type with a `*`? |
22:46:34 | leorize | @ondra05 you should join our matrix channel to prevent double bridging |
22:46:36 | leorize | ~matrix |
22:46:37 | disbot | matrix: 11the #nim channel on Matrix can be found at #freenode_#nim:matrix.org -- leorize |
22:47:26 | FromGitter | <matrixbot> `ondra05` > <@gitter_fromirc:matrix.org> *<FromDiscord>* <dom96> did you export the `Node` type with a `*`? β β Thank you |
22:47:33 | FromGitter | <matrixbot> `ondra05` > <@gitter_fromirc:matrix.org> *<disbot>* 9matrix: the #nim channel on Matrix can be found at #freenode_#nim:matrix.org -- 7leorize β β I Will do |
23:11:32 | * | NimBot joined #nim |
23:13:17 | * | MTRNord[m] quit (Ping timeout: 246 seconds) |
23:15:40 | * | iwq quit (Ping timeout: 246 seconds) |
23:18:57 | * | iwq joined #nim |
23:38:16 | * | FromDiscord quit (Remote host closed the connection) |
23:38:29 | * | FromDiscord joined #nim |