00:16:49 | FromGitter | <zacharycarter> rayman22201: yeah - I played around with that snippet in the playground and couldn't get anything to compile |
00:18:27 | FromGitter | <timotheecour> see my reply here https://gist.github.com/rayman22201/92f28f0c1d9ccbc5a36fe04c2132c49e#gistcomment-2811762 |
00:19:00 | FromGitter | <zacharycarter> ahhh |
00:19:22 | rayman22201 | weird. I tried casting and it didn't work for me. |
00:19:59 | FromGitter | <timotheecour> maybe u also missed the other change (`(also changed BBLeaf[K,V] = ref object of BBTree to BBLeaf[K,V] = ref object of BBTree[K,V])`) |
00:23:02 | rayman22201 | @timotheecour, yup. You are right. I totally missed that |
00:23:11 | rayman22201 | I feel less crazy now. Thank you |
00:24:16 | FromGitter | <timotheecour> sure; but please file a bug about the err msg, `Error: cannot instantiate: ‘BBTree’` should instead give more type context/diagnostic that the compiler already knows about |
00:25:09 | FromGitter | <timotheecour> err msgs shd not be puzzling but give as much info as needed to fix problem wo inserting `echo` over your code, when feasible |
00:26:04 | rayman22201 | That's a fair point |
00:33:23 | * | leorize joined #nim |
00:35:30 | FromGitter | <timotheecour> found an even better way for upcast instead of `cast`, see my EDIT here https://gist.github.com/rayman22201/92f28f0c1d9ccbc5a36fe04c2132c49e#gistcomment-2811762 |
00:38:21 | rayman22201 | They need to branch based on which subtype it is, `if cur of BBNode2`, to get the exact behavior they want. But other than that, yeah, that's it I think. |
00:45:58 | * | Snircle quit (Read error: Connection reset by peer) |
00:47:01 | * | Snircle joined #nim |
00:49:56 | rayman22201 | https://github.com/nim-lang/Nim/issues/10342 @timotheecour |
01:03:33 | * | Tyresc quit (Quit: WeeChat 2.4-dev) |
01:06:09 | * | noonien quit (Quit: Connection closed for inactivity) |
01:08:22 | * | skellock joined #nim |
01:15:39 | shashlick | are there any known issues if you use a config.nims as well as a main.nims |
01:23:05 | * | zachk quit (Quit: Leaving) |
01:36:21 | FromGitter | <timotheecour> not that i know, please file bug! |
01:39:50 | shashlick | Seems like a bug with 0.19.2 |
01:40:01 | shashlick | Devel and 0.19.0 work fine |
01:40:09 | FromGitter | <timotheecour> then don’t file a bug :) |
01:40:11 | shashlick | Check out nimterop nonimgen branch |
01:40:39 | FromGitter | <timotheecour> (devel should really be top priority for bug reports, due to limited resources in ppl willing to fix bugs) |
01:41:18 | shashlick | Well our stable shouldn't be broken either |
01:44:28 | FromGitter | <timotheecour> well if u do file a bug we need a new label: `fixed_in_devel` for proper triage; but again, limited resources; the same would apply to all bugs we’re fixing in devel that are not backported |
01:45:42 | FromGitter | <timotheecour> (and the answer is not as simple as “all bug fixes go to stable” since some bug fixes rely/assume features that are not yet in stable; in any case, it’s more work) |
01:46:28 | skellock | nim is amazing... ya'll are doing fantastic work! |
01:46:38 | * | xet7 quit (Quit: Leaving) |
01:46:41 | * | ryukoposting joined #nim |
01:47:16 | FromGitter | <timotheecour> PR’s super welcome too! some are tagged as `easy` |
01:47:33 | shashlick | I agree, besides I'm still wondering what is broken |
01:47:37 | FromGitter | <timotheecour> (some issues) |
01:48:00 | shashlick | Anyway, the regex fix is also still blocking me |
01:48:30 | FromGitter | <timotheecour> the fix i did got merged 2 hr ago |
01:48:35 | FromGitter | <timotheecour> still not workin? |
01:48:43 | shashlick | Well nimble only pulls latest tag |
01:48:50 | shashlick | So till nitely tags it |
01:49:01 | Tanger | dom96: Watched that stream you did last year on adding !eval to nimbot. Very interesting watch! |
01:49:23 | FromGitter | <timotheecour> @shashlick then u shd bug nitely so he adds a new patch tag |
01:49:32 | shashlick | Yep will do |
01:49:41 | FromGitter | <timotheecour> (which should always happen after each bug fix i guess?) |
01:50:11 | shashlick | But I'm close to making nimterop free of nimgen and install time bumbling with nimble |
01:50:44 | FromGitter | <timotheecour> wow i’m missing whole context here:) |
01:50:52 | FromGitter | <timotheecour> what’s time bumbling |
01:51:32 | shashlick | Nimble doesn't like nimgen doing stuff in before install |
01:51:36 | shashlick | Bunch of issues there |
01:52:01 | shashlick | Try installing nimterop today, it probably will fail somewhere |
01:54:44 | FromGitter | <timotheecour> just did => `Success: nimterop installed successfully.` |
01:57:29 | FromGitter | <timotheecour> (even from a fresh repo; note that i’ve `nimble develop` nim-regex w the applied fix; not sure whether that was ur issue) |
02:00:00 | * | oculux quit (Ping timeout: 258 seconds) |
02:01:01 | * | oculux joined #nim |
02:03:28 | shashlick | Uninstall tree-sitter and sub projects too |
02:03:43 | shashlick | At least nimarchive breaks completely |
02:03:44 | FromGitter | <timotheecour> ah ya suspected it was smthg like that |
02:07:07 | FromGitter | <timotheecour> instead of `Uninstall tree-sitter and sub projects too` (which is a pain to do for anyone), i used: `export NIMBLE_DIR=$HOME/.nimble_fake2` `nimble install nimterop` and ya it now fails: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c3fe34b95e17b4525633d3d] |
02:08:37 | FromGitter | <timotheecour> actually, re-running `nimble install nimterop` gives: ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c3fe3a58318994524004481] |
02:08:58 | FromGitter | <timotheecour> reminds me of issue wrt reproducible builds... |
02:11:59 | shashlick | Oh ya c2nim compatiblity issues just make it harder |
02:18:36 | * | fanta7531 joined #nim |
02:19:11 | * | xace quit (Ping timeout: 268 seconds) |
02:20:06 | * | cspar_ joined #nim |
02:20:19 | * | cspar quit (Ping timeout: 246 seconds) |
02:21:25 | * | xace joined #nim |
02:23:24 | * | Snircle quit (Quit: Textual IRC Client: www.textualapp.com) |
02:32:37 | * | fanta7531 quit (Quit: ...) |
02:36:02 | * | dddddd quit (Ping timeout: 258 seconds) |
02:39:12 | * | craigger joined #nim |
02:40:07 | * | MightyJoe joined #nim |
02:41:08 | * | TongirMan joined #nim |
02:41:23 | * | xace quit (Ping timeout: 268 seconds) |
02:42:36 | * | xace joined #nim |
02:46:15 | * | Tongir quit (*.net *.split) |
02:46:15 | * | cyraxjoe quit (*.net *.split) |
02:46:15 | * | craigger_ quit (*.net *.split) |
02:46:15 | * | Calinou quit (*.net *.split) |
02:47:37 | * | Calinou joined #nim |
02:48:38 | shashlick | Well if nothing else, I used nimterop to wrap tree-sitter which I then used to build nimterop |
02:48:51 | shashlick | So life's good |
02:49:01 | shashlick | Nothing like bootstrapping |
02:49:03 | rayman22201 | bootstrapping ftw |
02:49:19 | FromGitter | <timotheecour> and dogfooding! |
02:49:56 | * | banc quit (Ping timeout: 246 seconds) |
02:50:06 | * | dddddd joined #nim |
02:52:00 | * | banc joined #nim |
02:55:27 | * | cspar_ quit (Ping timeout: 240 seconds) |
02:59:58 | * | cspar joined #nim |
03:00:34 | * | banc quit (Quit: Bye) |
03:08:28 | * | fanta7531 joined #nim |
03:16:20 | * | banc joined #nim |
03:32:04 | * | skellock quit (Ping timeout: 272 seconds) |
03:39:29 | shashlick | @timotheecour: it is nims specific issue - https://github.com/nim-lang/Nim/issues/10344 |
03:42:28 | * | dddddd quit (Remote host closed the connection) |
03:44:22 | * | lritter quit (Ping timeout: 244 seconds) |
03:45:00 | * | lritter joined #nim |
04:07:01 | FromGitter | <m4d3bug> How can I deposit json data with single quotes into the mysql or mariadb in the Nim? |
04:11:47 | leorize | the db_* modules can properly escape query automatically |
04:12:08 | leorize | you'd want to checkout the db_mysql module |
04:26:15 | * | kapil____ joined #nim |
04:42:02 | * | nsf joined #nim |
04:48:32 | * | skellock joined #nim |
04:55:12 | * | skellock quit (Ping timeout: 268 seconds) |
05:07:56 | * | leorize quit (Quit: WeeChat 2.3) |
05:53:04 | * | narimiran joined #nim |
05:53:13 | * | narimiran quit (Remote host closed the connection) |
05:54:35 | * | narimiran joined #nim |
06:01:12 | * | leorize joined #nim |
06:08:41 | rayman22201 | @timotheecour, we are going to get that bug report closed just on the basis of off topic arguing and bikeshedding... |
06:55:34 | * | BigEpsilon joined #nim |
06:56:03 | * | absolutejam quit (Ping timeout: 244 seconds) |
07:03:34 | FromGitter | <m4d3bug> @leorize i mean write into the mysql |
07:05:06 | * | kapil____ quit (Quit: Connection closed for inactivity) |
07:30:31 | * | skellock joined #nim |
07:34:20 | * | kapil____ joined #nim |
07:35:53 | * | skellock quit (Ping timeout: 245 seconds) |
07:52:33 | * | lritter quit (Ping timeout: 245 seconds) |
08:00:00 | * | gmpreussner quit (Quit: kthxbye) |
08:03:27 | * | absolutejam joined #nim |
08:04:40 | * | gmpreussner joined #nim |
08:07:02 | Zevv | "...experience the best of araq4k: Chat with other fans! Capture your favorite moments!" \o/ |
08:12:12 | * | fanta7531 quit (Quit: ...) |
08:14:25 | absolutejam | is there a short-hand for n to end in a slice? |
08:14:38 | narimiran | [n .. ^1] |
08:14:53 | absolutejam | ahah great, thanks |
08:15:00 | absolutejam | I was using .high but I can't do that when I'm method chaining |
08:15:06 | absolutejam | without saving it as a separate var |
08:15:17 | Tanger | Anybody know of any benchmarks showing how slow system.readChar is compared to system.readChars? |
08:20:43 | Araq | it's terrible, don't use it |
08:20:57 | Araq | in fact, use lexbase.nim |
08:21:07 | Araq | the only true way to do IO (TM) :P |
08:33:59 | * | Vladar joined #nim |
08:46:36 | absolutejam | I must say, I'm really impressed with the vscode extension for nim |
08:47:01 | absolutejam | it's like magic when it picks up a definition in another file |
08:47:02 | * | qwertesser is now known as qwertfisch |
08:47:13 | absolutejam | or the nim parser - whatever performs the wizardry |
08:58:11 | absolutejam | Say I have type A and type B which is descended from type A |
08:58:18 | absolutejam | I can add them both to a seq with no issue |
08:58:46 | absolutejam | but if I create a table[string, TypeA] I get an assignment error when assigning type b to it |
08:58:49 | absolutejam | is this correct? |
08:59:15 | narimiran | show us some code |
09:00:54 | absolutejam | https://hastebin.com/opidupezim.nim |
09:01:26 | absolutejam | Also, anyone else able to get my verification link resent on the forum, please? |
09:02:54 | absolutejam | actually, it's failing for a seq example now, but I tested this yesterday... |
09:03:43 | absolutejam | oh, it works with ref objects |
09:05:12 | narimiran | as for forum verification, dom96 is your man |
09:06:23 | narimiran | hmmm, it seems i can delete you forum account |
09:06:46 | narimiran | (but i cannot send you verification link) |
09:06:47 | Zevv | Could anyone who knows about CI take a peek at my failed build? Works ok for me on 3 different architectures, but travis chokes with a funny error: PR 10338 |
09:06:51 | absolutejam | that's fine |
09:06:56 | absolutejam | if I can recreate |
09:07:52 | narimiran | absolutejam: if you tell me to delete it (i don't know the consequences and if this will make possible to create a new account then), i'll do it. otherwise, i'm not touching that button :) |
09:08:21 | absolutejam | yeah, go for it |
09:08:26 | absolutejam | can't be any worse...right? |
09:08:33 | Zevv | (famous last words) |
09:08:36 | narimiran | ha, "You cannot delete this user." :D |
09:08:36 | * | floppydh joined #nim |
09:09:36 | narimiran | Zevv: you have the same error both on travis and appveyor, right? |
09:10:45 | narimiran | Zevv: try to do this locally: `./koch temp -d:release` (this will create `bin/nim_temp`), then run your file with `bin/nim_temp c lib/pure/bitops.nim` |
09:12:15 | Zevv | Yes but no but yes but: the CIs aren't even able to build the Nim compiler, right? |
09:12:30 | Zevv | I tried the above, without any issues locally |
09:14:09 | narimiran | yeah, true |
09:26:00 | TongirMan | Araq, haha, thanks for the lexbase recommendation. So if I wanted to process and evaluate stdin character by character, I would just create a new BaseLexer and open a stream of stdin with buffer size 1? |
09:28:50 | * | Vladar quit (Remote host closed the connection) |
09:29:11 | * | Vladar joined #nim |
09:32:05 | * | BigEpsilon quit (Ping timeout: 268 seconds) |
09:33:43 | * | BigEpsilon joined #nim |
09:35:32 | Araq | er, I don't think that can work. Don't evaluate stdin character by character. |
09:41:07 | * | PMunch joined #nim |
09:41:20 | * | floppydh quit (Ping timeout: 268 seconds) |
09:43:14 | * | floppydh joined #nim |
09:43:24 | TongirMan | I'm writing a shell with the termios module, I would think that character by character evaluation would be pretty handy for that |
09:43:37 | TongirMan | To catch control codes and the like |
09:44:02 | TongirMan | Or have things like vi-mode |
09:45:53 | absolutejam | have you seen nim-prompt? |
09:45:56 | Araq | then readChar cannot ever be your bottleneck |
09:46:18 | absolutejam | also, there's another one that has some vi support (IIRC) but I went with nim-prompt because it was a bit more feature rich |
09:51:50 | FromGitter | <timotheecour> @araq regarding readChar performance, this may be related: https://github.com/nim-lang/Nim/issues/9975 `osproc: using `readLine` to read stdout of a program is > 100 times slower than in other languages #9975` |
09:52:21 | FromGitter | <timotheecour> I don’t think it’s that hard to fix though, the current implementation is a bit naive |
09:52:41 | Araq | be my guest, I touch these things only when I'm drunk. |
09:52:52 | Araq | and I don't drink. |
10:04:08 | FromGitter | <putao88> How to convert "@[1,2,3]" to seq? |
10:04:40 | PMunch | putao88, that is a seq.. |
10:04:41 | Zevv | it is already |
10:04:43 | TongirMan | Haha |
10:04:50 | FromGitter | <timotheecour> no it’s a string |
10:04:53 | FromGitter | <timotheecour> he’s asking a valid qq |
10:04:54 | Zevv | owwww |
10:04:56 | Zevv | :) |
10:05:15 | PMunch | Oh, I thought he just quoted it for us :P |
10:05:15 | Zevv | trick question, eh? |
10:05:15 | TongirMan | absolutejam: Thanks, will check out nim-prompt |
10:06:27 | PMunch | macros.parseExpr then |
10:06:37 | FromGitter | <timotheecour> @putao88 maybe send a PR to add this to parseutils? |
10:06:46 | FromGitter | <timotheecour> parseExpr would only work at CT |
10:06:52 | Araq | no way. use scanf |
10:06:58 | PMunch | He never specified runtime :) |
10:07:11 | Araq | or scanp. Or give us a real parser DSL. :-/ |
10:07:19 | Araq | Why don't we have that? It sucks. |
10:07:31 | PMunch | We have multiple don't we? |
10:08:11 | FromGitter | <timotheecour> to be clear, `scanf` doesn’t already support `How to convert "@[1,2,3]" to seq?` out of the box does it |
10:08:51 | Araq | PMunch: not complete parser generators. |
10:09:25 | narimiran | sing with me: 1335 open issues on the wall, 1335 open issues on the wall, ask one question on irc, 1336 open issues on the wall.... |
10:09:56 | FromGitter | <putao88> so,how to convert "@[1,2,3]" to seq? |
10:10:13 | PMunch | Depends on what you're actually trying to do |
10:10:30 | PMunch | And how flexible you need it to be |
10:11:39 | FromGitter | <timotheecour> the hacky way is easy to write but won’t be robust; the clean way is w a proper DSL or parser generator |
10:13:18 | PMunch | Araq, what about lilt: lilt.readthedocs.io/en/latest/ |
10:13:23 | narimiran | and the real question is: how did you arrive to string that looks like that? maybe this could be fixed on some previous step |
10:15:40 | FromGitter | <timotheecour> oh and there’s a 3d way which is to reuse compiler api, see tests/compilerapi/tcompilerapi.nim (and adapt that for seq) , it’d work at runtime, but would likely be slow (but, would work with more complex expressions) |
10:16:53 | Araq | it's not that slow, but it would eat much memory |
10:17:10 | * | dddddd joined #nim |
10:17:14 | FromGitter | <timotheecour> @narimiran no there r real use cases for what he’s asking (parsing strings into custom types) |
10:17:24 | Araq | PMunch: never really looked at it. :-) but Parser* = proc(text: string): LiltValue could be improved |
10:17:44 | Araq | and Node uses 'kind*: string' |
10:18:17 | FromGitter | <timotheecour> araq can pegs.nim be used for that? |
10:18:25 | Araq | there is no need for any of that, you have a DSL, you compile it to what you would have written by hand. |
10:19:12 | PMunch | Eh, fair point |
10:19:28 | PMunch | I was just blown away by how well documented it was :P |
10:19:59 | Araq | yeah we should help this guy instead of rolling our own |
10:21:14 | Araq | timotheecour: pegs is too old, I wrote it before I understood Nim. |
10:21:44 | * | Vladar quit (Remote host closed the connection) |
10:21:51 | FromGitter | <alehander42> @putao88 does this string only have seq of integers always? |
10:22:10 | PMunch | The problem with having a DSL that is supposed to end with something that is like what you would have written by hand is that you need to supply all the map to/parse to type information yourself.. |
10:23:04 | PMunch | I guess this could be helped by having more generic `parse` or `to` procedures like @timotheecour have suggested on GitHub |
10:23:28 | Araq | IMO we have 3 DSLs here, not one. |
10:23:42 | PMunch | Huh? |
10:23:47 | FromGitter | <alehander42> if so, you can just `echo input[2 .. ^2].split(',').mapIt(it.strip.parseInt)` |
10:23:48 | Araq | 1 for some lexim / re2c like lexer generation. |
10:24:20 | Araq | 1 DSL for parser generation that mostly does the recursive decent LL type stuff |
10:24:32 | * | platoff joined #nim |
10:24:39 | FromGitter | <alehander42> @putao88 ^ if it's a seq of integers: you might need to tweak the `@[` .. `]` handling ⏎ ⏎ if it's a more general seq you need to basically write/use a parser |
10:24:45 | Araq | 1 DSL for tree construction. |
10:26:00 | Araq | and if you use 'case ref objects' for the tree, it's probably wrong, the tree construction should use the techniques from my packedjson package |
10:26:05 | PMunch | Hmm, yeah I guess a segmented approach like that could work |
10:26:32 | FromGitter | <alehander42> Araq: and would packedjson-like tree work at all on e.g. the JavaScript backend |
10:26:38 | PMunch | Would be possible to make drop in replacements as well in that case |
10:26:58 | PMunch | I never got packed-json to work for jsonschema, but I'm not quite sure why |
10:26:59 | Araq | alehander42: it doesn't contain unsafe code, works out of the box with JS |
10:27:27 | Araq | (well I never tested, but in theory there is no problem...) |
10:27:30 | FromGitter | <alehander42> PMunch: i've always imagined a specific dsl which hints in the grammar how the final tree should look, but it requires careful design |
10:27:49 | FromGitter | <alehander42> the good thing about it is that you can generate parsers in many languages from such a specification |
10:27:53 | Araq | rule: action pairs are still unbeatable |
10:28:06 | Araq | and the 'action's are language specific. |
10:28:32 | FromGitter | <alehander42> the bad thing is it needs to be more general/or to support custom actions which makes it a little bit harder to make it lang-independent |
10:28:37 | Araq | I don't want a "general", language agnostic parse tree, but ymmv. |
10:29:12 | FromGitter | <alehander42> but not too much: one can have langagnostic actions(maybe not very optimized) in a limited dsl(or subset of a lang) which can be easily compiled for every target language |
10:29:39 | FromGitter | <alehander42> Araq: yeah, i had this idea before i started using nim |
10:30:01 | Araq | packedtree construction should be so cheap that you don't have to avoid the tree construction, maybe this fact can simplify the design, not sure |
10:30:49 | FromGitter | <alehander42> but i do find it annoying that i can't just generate a dumb parser in every lang from a very simple spec |
10:31:31 | FromGitter | <alehander42> Araq:having separate dsl-s is also nice |
10:31:44 | Araq | I find "dump parsers" annoying. |
10:31:54 | Araq | er *dumb |
10:32:22 | FromGitter | <alehander42> my initial idea was that each node will have named subnodes (e.g. left, right, op etc ) ⏎ but these days i think pattern matching/indexing is good enough and in this case the tree can be constructed more easily |
10:33:01 | PMunch | I'm curious what you imagine these DSLs looking like Araq. If you wouldn't mind could you type out a rough example (just a couple of lines or something) |
10:33:11 | Araq | and also, don't make the parser produce "errors". |
10:33:24 | Araq | Or Optionals. Or exceptions. |
10:33:39 | FromGitter | <alehander42> Araq: in longterm that's true, but when i just make toy languages/prototypes/experiments i dont care how performant my parser is |
10:33:41 | PMunch | What is it supposed to do then? |
10:33:41 | Araq | Instead embed it into the AST with an error kind node. |
10:33:43 | FromGitter | <putao88> @alehander42 That's the approach I'm using now |
10:33:55 | PMunch | Araq, ah right, that makes sense |
10:34:37 | Araq | alehander42: well it's code generation, do it once and benefit from the optimizations everywhere. |
10:34:48 | FromGitter | <putao88> I just don't feel very intelligent |
10:34:52 | FromGitter | <alehander42> well, one can still config it to raise on the first error: sometimes people dont need error recovery |
10:35:57 | FromGitter | <alehander42> Araq: yeah, algorithmitically you can generate efficient data structures/code, i meant it might not generate lang-specific optimizations |
10:36:19 | PMunch | putao88, for your simple case: http://ix.io/1ywB/Nim |
10:36:30 | PMunch | Not generic in any way though.. |
10:36:48 | FromGitter | <alehander42> @PMunch you can it.strip.parseInt directly |
10:37:10 | PMunch | alehander42 oh yeah that's true |
10:37:27 | PMunch | I had it as two maps initially. But strip doesn't like to be put in a map since it has optional arguments |
10:37:30 | FromGitter | <alehander42> @putao88 but from where is this string coming? is another nim program generating it? |
10:37:34 | PMunch | I have an issue open for that |
10:37:41 | FromGitter | <alehander42> @PMunch i almost never use `map` |
10:38:06 | PMunch | I almost never use either `map` nor `mapIt` :P |
10:40:36 | FromGitter | <alehander42> yeah, i should try to use high order methods more often these days |
10:41:44 | FromGitter | <putao88> A string is stored in the database and can be parsed out using getValue, but the data retrieved with the getAllRows method fails to be parsed using parseJson |
10:42:16 | FromGitter | <gogolxdong> She wrote a stringified seq `$seq[int]` to mysql, parseJson can process the value returned by getValue but cannot process the one from getAllRows. |
10:43:04 | FromGitter | <gogolxdong> the same field . |
10:44:15 | FromGitter | <alehander42> ahh, well parsing nim expressions in general on runtime doesnt seem too optimal currently |
10:44:31 | FromGitter | <alehander42> if one doesnt use the compiler api |
10:44:48 | FromGitter | <alehander42> maybe for now you can store a json string of your values? |
10:44:57 | FromGitter | <alehander42> if you're using parseJson |
10:45:39 | PMunch | Yeah, best would be to either store it as JSON or a simple comma-separated value (or whichever character you prefer). |
10:46:30 | PMunch | Or of course store it directly in a table in MySQL, but that might not always be optimal |
10:47:37 | FromGitter | <alehander42> btw PMunch , what was the topic of your fosdem talk |
10:48:30 | PMunch | "Metaprogramming in Nim" |
10:48:53 | Zevv | in 15 minutes?! |
10:49:06 | narimiran | he talks really really fast :P D |
10:49:27 | PMunch | It's going to be a quick introduction to Nim, then a few words on what metaprogramming is, and then an overview of how it works in Nim with some examples. |
10:49:45 | PMunch | Zevv, I used to be an auctioneer |
10:50:00 | FromGitter | <gogolxdong> only you attend FOSDEM this year? |
10:50:32 | PMunch | Just kidding, but I think it should be doable. It's not going to be a super deep thing, just to wet peoples appetites on how much cool stuff they can do in Nim :) |
10:52:04 | PMunch | I felt like a lot of the people I talked to last year about Nim seemed to like it, but didn't have that one thing that sparked them to try it. So I'm going to pique their interest with one of the "coolest" features, and then they can discover all the other neat aspect for themselves :) |
10:52:29 | PMunch | gogolxdong, well a lot of people are going, but Nim won't have an official booth like last year unfortunately.. |
10:52:57 | FromGitter | <alehander42> nice |
10:53:25 | FromGitter | <gogolxdong> why not? |
10:53:26 | PMunch | Which is a bit sad as I won't have anywhere to send people who might be interested in learning more about Nim.. |
10:53:39 | FromGitter | <alehander42> yeah , metaprogramming is cool: i hope you show some `typed` aspects too, as this is maybe more atypical for some metaprogramming systems |
10:53:42 | FromGitter | <alehander42> macro* systems |
10:53:50 | FromGitter | <gogolxdong> I remember it had last year. |
10:54:06 | PMunch | Huh, apparently we have two Nim related talks: fosdem.org/2019/schedule/event/nimbus/ |
10:54:18 | PMunch | alehander42, what do you mean? |
10:54:43 | PMunch | forum.nim-lang.org/t/4324#27011 |
10:55:16 | PMunch | I definitely think we should do a semi-official meetup at least. Preferably after the talk so I can direct people there :) |
10:55:23 | FromGitter | <alehander42> well, usually macro systems operate on the AST, but loading/manipulating types is not so common (i think?) |
10:55:54 | PMunch | alehander42, example? |
11:05:07 | FromGitter | <alehander42> i mean that nim macros can operate on semantic information : `typed`, `getType` |
11:05:22 | FromGitter | <alehander42> e.g. rust macros can't do that (afaik) |
11:05:47 | FromGitter | <alehander42> but e.g. crystal macros also access some type information, so maybe not so rare |
11:14:19 | FromGitter | <gogolxdong> FOSDEM lauched on 2 & 3 Feburary, why do you use `was`, @alehander42 |
11:15:25 | FromGitter | <alehander42> @gogolxdong it just sounded correct in my head to say it like that, no idea :D |
11:15:47 | absolutejam | I'd love for the talks to get recorded :D |
11:16:17 | PMunch | They are :) |
11:16:25 | FromGitter | <gogolxdong> I thought it happened. |
11:16:28 | PMunch | Even streamed live |
11:17:44 | PMunch | www.youtube.com/user/fosdemtalks |
11:17:57 | absolutejam | all of em? |
11:17:59 | absolutejam | sweet. |
11:18:10 | PMunch | Yup, every single one |
11:18:12 | FromGitter | <alehander42> they have pretty good organization |
11:21:06 | * | BigEpsilon quit (Ping timeout: 244 seconds) |
11:27:09 | * | fanta7531 joined #nim |
11:27:36 | absolutejam | so, howcome I can have different descendent types in a seq when they are ref types and not just objects? |
11:29:45 | * | vegai left #nim (#nim) |
11:30:13 | FromGitter | <mratsim> Are you asking how or how come? :P |
11:30:34 | FromGitter | <mratsim> Your refs are probably using inheritance and share the same base type |
11:30:48 | absolutejam | yeah, they are |
11:31:00 | FromGitter | <mratsim> so at compile-time they are the same type |
11:31:09 | absolutejam | oh |
11:31:24 | absolutejam | but if I don't use a ref, I get an error when trying to assign inherited objects to a seq |
11:31:29 | absolutejam | is that normal? |
11:31:49 | FromGitter | <mratsim> inherited non-ref objects are "Here be dragons" |
11:32:07 | FromGitter | <mratsim> basically they must have the same size, otherwise you will have issues |
11:32:08 | absolutejam | ELI5, I like it |
11:32:15 | absolutejam | fair enough |
11:32:28 | FromGitter | <mratsim> I asked to remove them or hide them but well |
11:32:36 | * | skellock joined #nim |
11:32:40 | * | stefanos82 joined #nim |
11:32:48 | FromGitter | <mratsim> for example Exceptions are using inherited non-ref, but they all have no fields so same size |
11:32:57 | FromGitter | <timotheecour> @araq generic parser: see https://github.com/nim-lang/Nim/pull/10346/files ⏎ see unittest: ⏎ ⏎ > doAssert parseseq[seq[int ("@[ @[1,2], @[3], @[]]") == @[ @[1,2], @[3], @[]] [https://gitter.im/nim-lang/Nim?at=5c4067e9f780a1521f247ab8] |
11:33:39 | FromGitter | <mratsim> A seq will allocate space to hold data of the compile-time size |
11:33:59 | FromGitter | <mratsim> a ref object is basically just a pointer to the actual data, so always same size |
11:34:13 | absolutejam | makes sense |
11:37:08 | * | skellock quit (Ping timeout: 245 seconds) |
11:37:51 | Araq | mratim: we fixed them instead. Maybe dragons are left. |
11:43:42 | narimiran | did anything change in nimsuggest recently? |
11:44:00 | narimiran | i.e. it seems like i'm having some kind of memory leak |
11:47:46 | Araq | it's always been leaking. |
11:47:52 | Araq | PMunch: https://gist.github.com/Araq/daf3e6aa4dde850bfe9cddcb7e0edee7 |
11:48:33 | narimiran | i never noticed this much of a leak before |
11:52:38 | FromGitter | <alehander42> ha i also had something like `*^` but called it `join` |
11:53:08 | PMunch | Hmm, interesting Araq. But what was the third one you talked about? |
11:53:42 | Araq | in this proposal I merged it with DSL 2 |
11:54:20 | Araq | otherwise it would pretty much be the standard sum type, except its implementation would be totally different |
11:54:22 | PMunch | Ah okay, that's what I thought |
11:55:02 | * | Vladar joined #nim |
11:56:20 | Araq | alehander42: there is also ^+ |
11:56:30 | Araq | for the "at least one" variant |
11:56:45 | Araq | I made a typo, in Nim's grammar these are ^+ and ^* |
11:57:57 | FromGitter | <alehander42> hm, I found i rarely need that: usually one wants the typical "join/split"-like behavior |
11:58:03 | FromGitter | <alehander42> e.g. args, params, elements etc |
11:59:05 | Araq | interesting to note that BNFs need all sort of additional non-standard notations for convenience whereas the "non declarative" stuff can use the power of a PL to avoid duplicated subexpressions |
11:59:29 | Araq | in the end imperative programming always wins. :P |
11:59:44 | * | BigEpsilon joined #nim |
11:59:52 | FromGitter | <alehander42> yeah, good thing people write regular expressions with code |
12:01:07 | FromGitter | <alehander42> it's sad that there aren't just 3-4 powerful grammar notations available, all kinds of tools would benefit from easily parsing various sources |
12:01:27 | FromGitter | <alehander42> which is hard when definitions are so imperative |
12:06:13 | Araq | which regular expressions? The ones that can be mapped to SAT with backrefs? |
12:07:12 | Araq | or the ones that you cannot group into logical things via whitespace. They are all terrible. |
12:08:18 | * | nsf quit (Quit: WeeChat 2.3) |
12:10:20 | Araq | and which BNFs, the ones where left recursion is not supported or the ones where left recursion is faster. Or the ones with reduce-reduce conflicts? |
12:10:30 | FromGitter | <zacharycarter> https://twitter.com/chandlerc1024/status/1085496978702663680 |
12:14:38 | FromGitter | <alehander42> Araq: i also dont like overusing regular expressions, but if I need to match an actual regular language, they're great |
12:15:05 | FromGitter | <alehander42> they might have some differences, but 80% of what people usually use is the same, no need to strawman |
12:15:20 | Araq | the theory behind them is great, the syntax is at best mediocre |
12:15:30 | FromGitter | <alehander42> maybe |
12:15:33 | FromGitter | <alehander42> but its 10x better |
12:15:42 | FromGitter | <alehander42> than having 5 competing syntaxes in popular usage |
12:16:14 | FromGitter | <alehander42> of course, parsing and grammars are more general, so just one standard cant cut it all |
12:16:33 | FromGitter | <alehander42> but in today's world every language/lib and project define their own way to do it |
12:16:42 | Araq | it's worse than that IMO. the syntax is heavily tied to algorithmic aspects |
12:17:09 | Araq | like, if you allow backrefs, it becomes NP complete. |
12:17:42 | FromGitter | <alehander42> e.g. if i want to develop a tool that plays with the syntax trees of codebases written in e.g. 15 most popular languages |
12:17:43 | Araq | and if you allow sub captures you cannot produce a DFA. |
12:17:51 | FromGitter | <alehander42> i need to basically go and ** myself |
12:17:53 | Araq | (the last one is a secret) |
12:18:36 | FromGitter | <alehander42> Araq: this is all true, but a lot of those are not actually reg languages |
12:18:41 | FromGitter | <alehander42> they are hacks |
12:18:51 | FromGitter | <alehander42> on top of the regexp stuff |
12:19:16 | FromGitter | <alehander42> the backrefs at least |
12:20:09 | * | xet7 joined #nim |
12:21:34 | FromGitter | <alehander42> but my point is one can have both: one can have custom optimized notations/implementations of parser AND also a relativaly standard way to generate them: ⏎ ⏎ this gives you quick prototyping ⏎ two implementations, so easier to catch bugs/fuzztest ⏎ standartized way to produce ast-s for some tools [https://gitter.im/nim-lang/Nim?at=5c40734ddab15872ceab1969] |
12:22:11 | FromGitter | <alehander42> you can have lang-agnostic ast-based grep-like tools/replacement/10 more things |
12:22:16 | Araq | we are not even close to a "relatively standard way" |
12:22:26 | * | couven92 joined #nim |
12:22:32 | Araq | PEGs tried to fix regexes fwiw |
12:24:07 | FromGitter | <alehander42> well, what's wrong with PEG |
12:24:36 | couven92 | Uhm... I am having auth problems with GitHub right now... Is it just me? Pull fails using HTTPS and took a whole minute (on University internet) over SSH... :O |
12:25:16 | Araq | it kinda sucks for stuff like '[' .* ']' |
12:38:11 | FromGitter | <timotheecour> @araq is there a parseString that works w triple quotes and other kinds of quotes? |
12:38:30 | FromGitter | <timotheecour> that’s the biggest stuff missing in https://github.com/nim-lang/Nim/pull/10346 |
12:38:55 | * | abm joined #nim |
12:39:24 | * | zachcarter quit (Ping timeout: 250 seconds) |
12:44:58 | * | enow joined #nim |
12:52:11 | * | nuxdie joined #nim |
12:55:53 | * | BigEpsilon quit (Ping timeout: 245 seconds) |
12:56:46 | FromGitter | <dom96> Love how you guys went from "need to parse a seq with ints" to "we need a new parser generator!" |
12:56:54 | shashlick | Is there a way to run the CT code of one module and wait for completion before spawning/proceeding to other files? |
12:57:38 | FromGitter | <dom96> Shashlick: don't think so |
12:57:44 | FromGitter | <mratsim> if it's something that is exported it should run first |
12:58:05 | FromGitter | <mratsim> if you want to generate some kind of text files at compile-time you would need a two-stage compilation pipeline |
12:59:09 | shashlick | mratsim: any suggestions on how to do that |
12:59:25 | * | BigEpsilon joined #nim |
12:59:54 | shashlick | I'm trying to do this during nimble install |
13:00:08 | FromGitter | <mratsim> I use nimble scripting: https://github.com/numforge/agent-smith/blob/master/agent_smith.nimble#L34-L41 |
13:00:10 | shashlick | And avoid before install |
13:00:31 | FromGitter | <mratsim> build_ale builds a shared library |
13:00:37 | FromGitter | <mratsim> and then I can build the wrapper |
13:00:45 | FromGitter | <mratsim> (which is not in the script) |
13:00:56 | FromGitter | <mratsim> the files are here |
13:01:06 | FromGitter | <mratsim> 1) ale_build, 2. ale_wrap |
13:04:06 | shashlick | But can you do this while your library is being installed |
13:04:15 | shashlick | By nimble |
13:06:32 | shashlick | Or do you need to manually run the build_ale task |
13:11:40 | FromGitter | <mratsim> nimble install can call build_ale task |
13:11:57 | FromGitter | <mratsim> or you can make it a function and call it in nimble install |
13:13:08 | FromGitter | <mratsim> ah, maybe you can't overrid nimble install like nimble test |
13:13:23 | shashlick | That goes back to using before install which hasn't worked in some scenarios |
13:14:05 | Araq | it's one of these days... |
13:14:08 | shashlick | In fact now I need it in before build |
13:14:22 | FromGitter | <mratsim> but AFAIK before_install is only a Travis hook, not an official nimble hook right? |
13:14:27 | Araq | nothing beats Boehm on gcbench.nim |
13:14:58 | Araq | not even my memory regions. A sad day |
13:16:43 | Araq | probably I'm measuring something different |
13:18:44 | Araq | ah this benchmark is bullshit and I'm measuring the number of mmap() calls... |
13:18:50 | FromGitter | <mratsim> lol |
13:20:56 | FromGitter | <kaushalmodi> @timotheecour You seem to be onto something good with that `parse` library :) |
13:21:14 | FromGitter | <kaushalmodi> Does this mean it will simplify the last "string" row in here: https://scripter.co/notes/nim/#representing-one-type-in-another |
13:22:02 | FromGitter | <dom96> shashlick: please don't back around nimble, fix/implement what you need in nimble instead |
13:23:39 | * | Vladar quit (Remote host closed the connection) |
13:23:47 | shashlick | Will try dom96 |
13:26:45 | * | skellock joined #nim |
13:29:11 | shashlick | But want to make nimterop a regular old hybrid package |
13:30:44 | FromGitter | <alehander42> @kaushalmodi very nice docs there! |
13:31:16 | * | skellock quit (Ping timeout: 268 seconds) |
13:31:40 | FromGitter | <kaushalmodi> thanks! :) |
13:35:12 | FromGitter | <kaushalmodi> @alehander42 Skim through the topics of your interest in there and feel free to report errors/misunderstandings |
13:35:44 | * | BigEpsilon quit (Ping timeout: 250 seconds) |
13:37:12 | FromGitter | <kaushalmodi> Sometimes I don't understand why certain things are how they are and I make up my own theory to explain myself. An example: search for "home-grown theory" towards the bottom of https://scripter.co/notes/nim/#int-types section |
13:40:10 | FromGitter | <mratsim> you can explain it by, conversion with precision loss should be explicit |
13:40:53 | FromGitter | <kaushalmodi> what was confusing was that earlier I thought that int and int64 were the same on 64-bit systems |
13:41:04 | FromGitter | <mratsim> and int doesn't convert to int64 implicitly because if you compile the code on 32-bit platform, int is not int64 |
13:41:06 | FromGitter | <kaushalmodi> but looks like int64 kind of has an higher edge than int |
13:41:40 | FromGitter | <kaushalmodi> ah .. |
13:41:46 | FromGitter | <kaushalmodi> make sense |
13:41:54 | FromGitter | <mratsim> sorry int64 doesn't convert to int |
13:45:01 | FromGitter | <kaushalmodi> does it mean that I should be able to assign int to int32 and vice version on 32-bit systems? |
13:46:36 | FromGitter | <kaushalmodi> .. or may be not, because then `varInt32 = varInt` kind of code won't compile on 64-bit systems, right? |
13:48:26 | * | vlad1777d joined #nim |
13:50:55 | FromGitter | <mratsim> the check is done at compile-time and doesn't depend on your int32/int64 I think |
13:51:31 | FromGitter | <mratsim> the size yes, but I don't think the semantic checking of type conversion checks the size |
13:51:48 | * | itschin joined #nim |
13:52:08 | * | itschin left #nim (#nim) |
14:00:53 | * | cspar quit (Ping timeout: 246 seconds) |
14:06:46 | * | cspar joined #nim |
14:12:06 | absolutejam | mratsim you said at compile time, child objects are the same type as parent objects |
14:12:14 | absolutejam | does this affect them in any way? |
14:12:33 | absolutejam | their fields and procs are all applicable still? |
14:14:53 | * | skellock joined #nim |
14:18:19 | absolutejam | from testing, it looks like it's forcing them into the parent class type |
14:28:26 | leorize | absolutejam: if you want runtime dispatch you'd have to use method |
14:30:50 | * | hwallann joined #nim |
14:31:44 | * | Erik_ joined #nim |
14:32:23 | absolutejam | uhhh |
14:32:33 | absolutejam | Yeah, I tried to understand what that meant from the dos |
14:32:35 | absolutejam | docs |
14:33:04 | absolutejam | so, a method is used when you're utilising inheritance |
14:33:16 | absolutejam | to target the right type of object |
14:33:24 | absolutejam | but a proc defaults to the base object |
14:33:54 | leorize | not exactly |
14:35:01 | leorize | you can call a proc to a derived object and it would still work as expected |
14:36:33 | absolutejam | can I explain what I'm trying to do and see if it's possible? |
14:36:39 | leorize | sure |
14:37:04 | absolutejam | let me try whip an example together actually |
14:37:09 | absolutejam | my working code is a bit convoluted |
14:37:58 | * | cspar quit (Ping timeout: 245 seconds) |
14:42:33 | Zevv | Is there a variant of repr with slightly cleaner output? I'd like to dump readable versions of serialized/deserialized objects to a log file, and repr is noisy with pointers and newlines. Json does'nt work for me because it does not know about things like uint8 |
14:42:52 | leorize | make your own `$`? |
14:43:30 | leorize | repr is a debugging tool, I don't think you should use that for logging |
14:44:10 | Zevv | the logs are for debugging :) |
14:44:20 | Zevv | Yeah i'm making my own `$` now, fieldPairs et al |
14:49:51 | * | krux02 joined #nim |
14:50:01 | absolutejam | https://hastebin.com/azobewuqat.pl |
14:50:38 | absolutejam | Maybe I'm approaching this all wrong, coming from no computer science knowledge and only really using dynamic languages |
14:51:42 | absolutejam | in that example, by declaring Container.foo and Container.bar as seq[MyBaseObj], the fields from their actual clases (Foo & Bar) are stripped |
14:51:51 | leorize | method should fit your use case |
14:52:21 | * | Erik_ quit (Quit: Page closed) |
14:52:54 | leorize | I'll spin up an example for you |
14:54:27 | absolutejam | thanks |
14:57:29 | leorize | absolutejam: http://ix.io/1yxa/nim |
15:00:35 | narimiran | btw, just a few days ago we had the same question and a similar example as a solution — we should have this better documented |
15:01:33 | leorize | yea, I'll leave that to you narimiran ;) |
15:01:43 | narimiran | haha, too much on my plate :) |
15:02:01 | FromGitter | <kaushalmodi> leorize: do you blog? |
15:02:13 | FromGitter | <kaushalmodi> if so, you can do a brief write-up on `method` |
15:02:25 | FromGitter | <kaushalmodi> I've seen it being mentioned here few times, but have never used it |
15:02:27 | narimiran | but i think all this is already written *somewhere* (i know i found it before), it just needs to be brought to some official/visible/known place |
15:02:40 | leorize | I don't do blogs, sorry :P |
15:03:11 | leorize | I never actually used methods, just guessed from experience, so I'm not the best to write about that :) |
15:04:44 | * | BigEpsilon joined #nim |
15:05:10 | FromGitter | <kaushalmodi> going through https://nim-lang.github.io/Nim/manual.html#multiminusmethods, I need to first understand what static/dynamic dispatches are .. hmm |
15:05:19 | FromGitter | <kaushalmodi> adding to my need-to-understand list |
15:05:49 | narimiran | @kaushalmodi rewrite leorize's example to use procs, and you'll get the idea |
15:06:01 | absolutejam | ah right |
15:06:08 | absolutejam | but I _have_ to use a method for that right? |
15:06:27 | absolutejam | Like, I was trying x.name |
15:06:36 | absolutejam | and that b0rked |
15:06:47 | absolutejam | but writing a method to return x.name for Foo worked |
15:06:51 | leorize | kaushalmodi: my understanding of this is basically: static = picked by the compiler based on overloading, dynamic = picked at runtime based on rtti |
15:07:14 | FromGitter | <kaushalmodi> sorry, rtti? |
15:07:14 | leorize | absolutejam: yep, that's the idea |
15:07:27 | leorize | runtime type information |
15:07:43 | absolutejam | Yeah, there was an example of methods, but I just didn't understand the underlying concept |
15:07:46 | FromGitter | <kaushalmodi> narimiran: thanks, I'll do that, for now, adding these snippet links to my notes |
15:07:56 | FromGitter | <kaushalmodi> leorize: thanks |
15:08:04 | absolutejam | a lot of the docs assumes some prior knowledge |
15:08:22 | absolutejam | And I don't want to dumb down the docs too much, but at the same time, it's caught me out |
15:08:36 | absolutejam | s/it's/it/ |
15:08:48 | absolutejam | (not that that's hard) |
15:10:08 | leorize | yea, I only know about the method stuff thanks to some experience with objfpc |
15:11:03 | narimiran | @mratsim was it you posting a nice example showcasing differences between methods and procs? (i can't find it on irclogs) |
15:11:38 | FromGitter | <mratsim> only perf examples |
15:12:10 | absolutejam | just need type filed acces via [] and i'll be happy now ;) |
15:12:42 | leorize | that's certainly possible :) |
15:12:58 | Zevv | watch out when using methods and generics: https://github.com/nim-lang/Nim/issues/10038 |
15:13:27 | narimiran | absolutejam: see how that is done in stdlib |
15:13:52 | absolutejam | there was a macro example on the forums, but it didn't work for me and I'm not quite at metaprogramming level yet haha |
15:13:54 | absolutejam | melted my brain |
15:17:14 | narimiran | (ignore my previous message, i mis-read what you're doing :)) |
15:19:05 | shashlick | got it working! nimterop now is 100% free of nimgen, c2nim and other big dependencies |
15:19:13 | narimiran | shashlick: woooooooooooo |
15:19:30 | FromGitter | <gogolxdong> what can nimterop do? |
15:19:45 | FromGitter | <gogolxdong> saw it many times. |
15:19:53 | narimiran | now it is unstoppable! it can do anything it wants :P |
15:19:56 | shashlick | it installs tree-sitter and other C dependencies during nimble install using itself |
15:20:08 | shashlick | @gogolxdong - it is a combination of c2nim and nimgen |
15:20:18 | shashlick | basically wrapping C libraries seamlessly |
15:20:23 | shashlick | https://github.com/genotrance/nimterop |
15:21:07 | shashlick | now it should get much easier to simply require nimterop in nimble followed by import and cImport |
15:21:47 | FromGitter | <gogolxdong> without *.cfg file? |
15:23:02 | shashlick | yep |
15:23:05 | FromGitter | <gogolxdong> then it can replace c2nim and nimgen completely |
15:23:10 | shashlick | that's the goal |
15:23:35 | shashlick | so simply get the C lib sources and use cCompile() and cImport() and point to .c and .h files |
15:24:12 | shashlick | see https://github.com/genotrance/nimterop/blob/master/tests/tmath.nim for an example |
15:24:16 | FromGitter | <gogolxdong> include cpp? |
15:24:47 | shashlick | not yet added CPP support |
15:25:12 | FromGitter | <gogolxdong> cool |
15:25:22 | shashlick | want to get C support solid and also ensure it works seamlessly in Nim |
15:25:44 | Zevv | An does it need treesitter itself, or is this somehow generated using treesitter? |
15:26:33 | shashlick | check out https://ci.appveyor.com/project/genotrance/nimterop/build/job/xhidbusadw0q3i8u#L502 for the Nim wrapper generated for math.h |
15:26:50 | Zevv | wow |
15:26:52 | shashlick | it does use tree-sitter to parse the C/C++ code |
15:27:35 | Zevv | Now do WebKit :) |
15:27:37 | narimiran | shashlick: offtopic, but about you idea to use SO for questions: take a look at the forum and the most recent stuff.... ;) |
15:27:58 | * | stefanos82 quit (Read error: Connection reset by peer) |
15:28:30 | shashlick | Nim is amazing really - has made this possible in around 2 months |
15:28:41 | shashlick | plus works cross-platform with minimal effort |
15:29:13 | shashlick | Zevv - it might just work - just enable recursion and it will process all #include files inline |
15:29:25 | shashlick | but is webkit C or C++? |
15:29:30 | Zevv | ++ :( |
15:29:40 | * | Zevv can wait :) |
15:29:57 | shashlick | well, we can do 98% of ImageMagick |
15:30:01 | * | stefanos82 joined #nim |
15:30:03 | shashlick | got libjpeg working |
15:30:20 | shashlick | more we run thru this, the more stable it can become |
15:30:27 | Zevv | impressive stuff |
15:30:40 | shashlick | i'll be converting all existing nimgen wrapper projects into nimterop eventually |
15:30:48 | shashlick | but best to prioritize new ones |
15:30:50 | Zevv | parsing C (and C++!) is not for the faint of heart |
15:31:16 | stefanos82 | Araq: the latest HEAD managed to crash my system (Debian testing 64-bit, fully updated) during ./koch tests all |
15:31:18 | * | vlad1777d quit (Ping timeout: 245 seconds) |
15:32:18 | * | spymasterd[m] quit (Ping timeout: 250 seconds) |
15:32:21 | * | toofly[m] quit (Ping timeout: 252 seconds) |
15:32:25 | shashlick | narimiran: didn't see anything after dom96's response - will reply after I see some more inputs |
15:32:34 | * | TheKing[m] quit (Ping timeout: 252 seconds) |
15:32:42 | * | zielmicha[m] quit (Ping timeout: 252 seconds) |
15:32:43 | * | macsek1911[m] quit (Ping timeout: 252 seconds) |
15:32:51 | shashlick | Zevv: that's the thing, that is completely handled by tree-sitter |
15:32:55 | * | jugash[m] quit (Ping timeout: 252 seconds) |
15:32:56 | * | sendell[m] quit (Ping timeout: 264 seconds) |
15:32:58 | * | dyce[m] quit (Ping timeout: 252 seconds) |
15:33:12 | * | hohlerde quit (Ping timeout: 250 seconds) |
15:33:13 | * | xylef quit (Ping timeout: 250 seconds) |
15:33:15 | * | Miguelngel[m] quit (Ping timeout: 250 seconds) |
15:33:15 | * | ee7[m] quit (Ping timeout: 250 seconds) |
15:33:18 | * | TheManiac[m] quit (Ping timeout: 260 seconds) |
15:33:19 | * | k0mpjut0r quit (Ping timeout: 260 seconds) |
15:33:19 | * | serialdev[m] quit (Ping timeout: 260 seconds) |
15:33:19 | * | isaac[m] quit (Ping timeout: 252 seconds) |
15:33:21 | * | yglukhov[m] quit (Ping timeout: 252 seconds) |
15:33:22 | * | GitterIntegratio quit (Ping timeout: 252 seconds) |
15:33:23 | * | petersjt014[m] quit (Ping timeout: 252 seconds) |
15:33:23 | * | narimiran[m] quit (Ping timeout: 252 seconds) |
15:33:23 | * | exothermic[m] quit (Ping timeout: 252 seconds) |
15:33:23 | * | endes[m] quit (Ping timeout: 252 seconds) |
15:33:26 | narimiran | shashlick: i didn't mean in that thread, but just to look at the recent threads/questions. lot of material for SO :) |
15:33:27 | * | pqflx3[m] quit (Ping timeout: 252 seconds) |
15:33:28 | * | Demos[m] quit (Ping timeout: 252 seconds) |
15:33:32 | * | Connor[m] quit (Ping timeout: 264 seconds) |
15:33:40 | * | sg-james[m] quit (Ping timeout: 264 seconds) |
15:33:40 | * | xomachine[m] quit (Ping timeout: 264 seconds) |
15:33:41 | * | ArchieT[m] quit (Ping timeout: 264 seconds) |
15:33:51 | shashlick | what I did was created an engine to search the tree-sitter generated AST for patterns and map known patterns into Nim |
15:34:00 | shashlick | narimiran - I see, ya |
15:34:01 | Zevv | yeah, just reading up |
15:34:06 | * | hohlerde joined #nim |
15:34:22 | * | macsek1911[m] joined #nim |
15:34:24 | * | zielmicha[m] joined #nim |
15:34:27 | Zevv | shashlick: http://paste.ubuntu.com/p/8G25whdry9/, nimble install fails for me in step 1 |
15:34:40 | * | sendell[m] joined #nim |
15:34:52 | * | GitterIntegratio joined #nim |
15:35:09 | shashlick | Zevv - looks like its still pulling the old version |
15:35:18 | * | TheKing[m] joined #nim |
15:35:38 | Zevv | Something I can do about that, or is that a problem on the other side? |
15:36:06 | shashlick | not sure if nimble has cached it already or something |
15:36:08 | * | yglukhov[m] joined #nim |
15:36:08 | * | dyce[m] joined #nim |
15:36:10 | shashlick | cause github is up to date |
15:36:13 | * | isaac[m] joined #nim |
15:36:26 | Zevv | I started with a rm -rf ~/.nimble - so no history here |
15:36:32 | shashlick | I need to update the readme looks like |
15:36:32 | * | Connor[m] joined #nim |
15:36:38 | shashlick | just do nimble install nimterop |
15:36:41 | * | ArchieT[m] joined #nim |
15:36:45 | shashlick | don't need to install treesitter anymore |
15:37:06 | * | sg-james[m] joined #nim |
15:37:06 | * | xomachine[m] joined #nim |
15:37:18 | Zevv | same error :( |
15:37:31 | * | k0mpjut0r joined #nim |
15:37:32 | * | exothermic[m] joined #nim |
15:37:34 | * | narimiran[m] joined #nim |
15:38:11 | * | Demos[m] joined #nim |
15:38:19 | * | toofly[m] joined #nim |
15:38:26 | * | endes[m] joined #nim |
15:39:26 | * | nsf joined #nim |
15:39:36 | shashlick | are you still installing treesitter? |
15:39:36 | * | petersjt014[m] joined #nim |
15:39:58 | Zevv | nope, only doing the nimble install, from a clean system |
15:40:32 | * | Miguelngel[m] joined #nim |
15:41:04 | * | ee7[m] joined #nim |
15:41:04 | * | TheManiac[m] joined #nim |
15:41:05 | * | serialdev[m] joined #nim |
15:41:34 | * | spymasterd[m] joined #nim |
15:42:06 | shashlick | can you share the output - i do see one issue which i'm working on |
15:42:29 | * | pqflx3[m] joined #nim |
15:42:34 | Zevv | Output is in the paste above. I'll build a clean nim 0.19.2 and retry, maybe something is messed up in my compiler somehow |
15:42:55 | * | jugash[m] joined #nim |
15:43:23 | * | xylef joined #nim |
15:46:25 | Zevv | still no luck: http://paste.ubuntu.com/p/t6PF7PbHnD/ |
15:46:30 | Zevv | cannot open: inc/treesitter/src/runtime/stack.c |
15:46:40 | shashlick | ya i'm fixing that one |
15:46:42 | Zevv | ok |
15:46:46 | shashlick | git clone + local install works |
15:46:51 | shashlick | but something to do with paths |
15:46:53 | Zevv | will try |
15:47:55 | Zevv | worked. README still says "installWithDeps", though |
15:48:34 | shashlick | refresh? |
15:50:05 | Zevv | should I file issues for problemns nimpterop runs into? for example zlib: Error: undeclared identifier: 'voidpf' |
15:50:16 | shashlick | yes absolutely |
15:50:25 | Zevv | will do! |
15:50:42 | shashlick | ok i think i fixed the nimble install nimterop issue |
15:51:00 | Zevv | so, where does tree-sitter now live? I don't have a local install of that, is it included in nimterop? |
15:51:18 | shashlick | during install, tree-sitter code is pulled into the repo and compiled in |
15:51:29 | shashlick | it isn't put in the install dir though |
15:51:51 | shashlick | there's just the static wrapper files in ~/.nimble/pkgs/nimterop-0.1.0/nimterop/treesitter |
15:52:06 | Zevv | but where does the actual the C parser end up? |
15:52:20 | shashlick | it is built into a binary called toast |
15:52:28 | Zevv | aah, there it is toast |
15:52:33 | shashlick | so if ~/.nimble/bin is in your path, you can run toast -h |
15:52:37 | Zevv | toast: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 2.6.32, BuildID[sha1]=cfb83f9946a0428987eceb62124571c6e231ae33, not stripped |
15:52:49 | shashlick | so you can use it in the traditional fashion like c2nim |
15:53:02 | shashlick | or use the cimport module to pull stuff into your nim code directly |
15:53:17 | shashlick | it calls toast behind the scenes |
15:53:22 | Zevv | ah and toast prints s expressions of asts |
15:53:43 | Zevv | which nimterop parses back in, right |
15:53:56 | shashlick | ya so you can spit out the gcc preprocessed output with -p, the tree-sitter ast with -a or the nim output with -n |
15:54:24 | shashlick | you can also recurse into #include files with -r |
15:55:50 | Zevv | I'm trying to build a mental graph of what comes from where when and goes where when - almost there |
15:56:05 | Zevv | ./toast -pnr /usr/include/zlib.h \o/ |
15:56:27 | shashlick | what happens? 😉 |
15:56:38 | Zevv | I get a bunch of nim code, that almost compiles |
15:57:47 | Zevv | Feeding it GL.h - stressssstest! |
15:59:55 | * | PMunch quit (Remote host closed the connection) |
16:00:04 | * | Snircle joined #nim |
16:02:23 | Zevv | gTypeMap: "ptrdiff_t": "ByteAddress" |
16:02:29 | Zevv | va_list is harder |
16:03:21 | Zevv | lau5.1 API compiles! |
16:03:36 | shashlick | am looking at the zlib.h bugs |
16:04:40 | Zevv | great stuff this, shashlick! |
16:08:23 | shashlick | thanks Zevv 🙂 |
16:10:50 | shashlick | you probably want to skip the -r for zlib.h - it is pulling in random stuff |
16:12:07 | shashlick | since zlib.h is in the standard location, there's no way to filter out includes from standard files |
16:12:18 | shashlick | you only want zconf.h and zlib.h so probably just import those two |
16:13:22 | * | Trustable joined #nim |
16:15:07 | * | skellock quit (Ping timeout: 240 seconds) |
16:17:35 | Zevv | so what is the typical use case here - intsalling nimterop and then using it for binding what you need in your code, or is it ment to generate bindings that do not need nimterop as a dependency? |
16:18:01 | shashlick | you can do both |
16:18:12 | shashlick | for nimterop itself, i had to do the latter for tree-sitter |
16:18:22 | shashlick | since i need tree-sitter to build in the first place |
16:18:30 | shashlick | but as a consumer you could do either |
16:18:46 | Zevv | er, did you bootstrap nimterop with nimterop? |
16:18:58 | shashlick | some people like seeing the wrapper, others like the zig approach where it just does it internally |
16:19:12 | shashlick | ya - i generated the tree-sitter wrapper with toast |
16:19:29 | shashlick | but that older toast I built with tree-sitter wrapped by nimgen+c2nim |
16:19:55 | Zevv | ah that makes sense |
16:20:00 | shashlick | https://github.com/genotrance/nimterop/tree/master/nimterop/treesitter |
16:20:08 | Zevv | selfhosting and bootstrapping always hurts my brain |
16:20:27 | shashlick | i honestly prefer the former approach since I want it to be seamless but didn't have much choice here 😄 |
16:20:41 | shashlick | but it is a nice showcase for both |
16:21:33 | Zevv | well, time to include /usr/src/linux/include and start working on kernel mode Nim |
16:26:22 | Zevv | I guess you need a list of reserved identifiers to rwrite |
16:26:39 | Zevv | openssl has struct fields called "object", for example |
16:28:20 | Zevv | or thLpt" in libpng |
16:28:27 | Zevv | sorry, "ptr" in libpng |
16:28:53 | shashlick | already have that covered I think |
16:29:52 | Zevv | if conversion fails the error messages of toast go to stdout instead of stderr |
16:30:08 | Zevv | ah cool |
16:31:00 | shashlick | pushed some fixes for C data types |
16:31:36 | shashlick | i think i have everything covered except va_list and internal_state |
16:33:05 | Zevv | wow, ogg and vorbis just go |
16:33:21 | Zevv | things like callbacks are handled as well? |
16:34:03 | shashlick | not sure - it handles func pointers in typedefs |
16:34:07 | shashlick | it might work |
16:35:33 | Zevv | cooking and kids first, playing more later. thanks! |
16:36:16 | shashlick | cool thanks for trying it out |
16:39:38 | * | absolutejam quit (Ping timeout: 245 seconds) |
16:48:35 | * | skellock joined #nim |
16:49:38 | * | Snircle quit (Ping timeout: 245 seconds) |
16:49:55 | * | BigEpsilon quit (Ping timeout: 268 seconds) |
16:51:25 | shashlick | is staticWalkDir() not available at compile time? |
16:56:24 | FromGitter | <mratsim> should be renamed to fakeStaticWalkDir then |
16:56:27 | FromGitter | <mratsim> :P |
16:58:03 | shashlick | doesn't work 😞 |
16:58:04 | shashlick | https://github.com/nim-lang/Nim/blob/devel/compiler/vmops.nim#L119 |
17:02:54 | * | ng0 joined #nim |
17:05:23 | * | sknebel is now known as wow |
17:05:28 | * | wow is now known as sknebel |
17:08:50 | * | skellock quit (Ping timeout: 246 seconds) |
17:22:07 | * | aguspiza joined #nim |
17:22:11 | * | Snircle joined #nim |
17:26:10 | Araq | stefanos82: yeah? it doesn't crash the CIs though |
17:26:18 | * | darithorn joined #nim |
17:26:46 | stefanos82 | Araq: I re-run it and it seems like there's a memory leak somewhere between the "macros" tests |
17:26:59 | stefanos82 | it consumed all of my RAM and made my entire system unstable |
17:27:46 | stefanos82 | before I run the second time, I had to close all of my applications while keeping conky open for surveillance |
17:28:17 | stefanos82 | as soon as I hit the macros tests, boom; it jumped for 1.2GB memory consumption to nearly 8GB |
17:28:23 | stefanos82 | thus, the system freeze |
17:28:45 | stefanos82 | I left it open to finish the tests and after 10 minutes, it returned back to normal |
17:29:05 | stefanos82 | but when you have other applications open and run the tests, it crashes |
17:32:14 | Araq | hmmm |
17:46:15 | narimiran | federico3: @kaushalmodi updated his scripter notes, and Planet Nim again shows his whole "blog" (is is more like page than blog, IMO). |
17:46:49 | federico3 | the whole article or all the articles in the blog? |
17:47:35 | FromGitter | <metasyn> hi nimsters~ is there a pattern / good way to hide or redirect stdout while running tests? for example, I have an error that is printed and a larger number of negative test cases, but it looks really messy when looking at the test output (since the errors are expected, and i don't need to see the output to assert they're correctly failing) |
17:48:26 | federico3 | https://scripter.co/tags/nim/atom.xml narimiran: the blog itself is puttitng whole articles in the rss/atom feed instead of summaries |
17:49:03 | federico3 | https://scripter.co/tags/nim/index.xml <-- inside the description block |
17:51:16 | narimiran | @kaushalmodi can you fix ^, because it makes Planet Nim unreadable? |
17:53:30 | FromGitter | <kaushalmodi> narimiran: oops |
17:53:36 | FromGitter | <kaushalmodi> let me remove notes from that feed |
17:53:48 | federico3 | it might also break some readers by putting escaped html in the feed |
17:53:49 | narimiran | that's certainly the easiest fix :) |
17:53:55 | federico3 | according to https://validator.w3.org/feed/check.cgi |
17:56:11 | FromGitter | <kaushalmodi> Can the planet truncate the feed from each post to first 200 words or so and make the reader jump to the full article if interested? |
17:56:42 | FromGitter | <kaushalmodi> In any case, updating my blog template to allow ignoring certain posts from being added to the feed; might take a bit |
17:57:15 | FromDiscord_ | <++x;> Hi. |
17:57:51 | FromGitter | <brentp> anyone know of a graph library for nim that has, e.g. lowest-common-ancestor and shortest-path functionality? |
18:17:50 | Zevv | not that I know of. I happened to be looking for that for the Advent of Code contests, but didn't find any |
18:25:38 | * | craigger quit (Quit: bye) |
18:25:52 | * | craigger joined #nim |
18:26:32 | FromGitter | <kaushalmodi> narimiran, federico3: my feed should be good now |
18:26:43 | narimiran | great, thanks :) |
18:28:16 | Zevv | shashlick: something keeps pulling ing "ptr int* = clong" if I recurse, how can I see where this originates? |
18:29:16 | shashlick | you can get the preprocessor output with -p and guess positin |
18:29:38 | shashlick | I saw that too on recurse |
18:29:56 | shashlick | on zlib, but didn't see the need for recurse with zlib |
18:30:08 | Zevv | I know, but I see it with others as well |
18:30:17 | shashlick | its from the standard lib somewhere |
18:30:19 | Zevv | recursive is lazy, would be nice if that "just works", ideally |
18:30:23 | shashlick | a bug in nimterop though |
18:30:26 | Zevv | yeah I figured but I can't find where |
18:30:51 | Zevv | sometimes gcc -E returns non-zero, but I don't see an error message |
18:31:10 | Zevv | Oh I do, it was hidden in the noise. #error Please add -D_FILE_OFFSET_BITS=64 to your compile flags! |
18:31:11 | shashlick | it should spit out the entire output |
18:31:13 | Zevv | that's pretty clear |
18:31:52 | shashlick | i need a better way to show the error in preprocessing, that's for sure |
18:32:05 | Zevv | split stdout/stderr also |
18:32:29 | shashlick | right now i'm dealing with not having walkDir |
18:32:30 | Zevv | also help output should go to stderr, convention |
18:32:42 | Zevv | but that's in cligen |
18:33:31 | Zevv | SIGSEGV! :) |
18:35:05 | * | kapil____ quit (Quit: Connection closed for inactivity) |
18:35:25 | * | nsf quit (Quit: WeeChat 2.3) |
18:38:35 | Zevv | typedef long int __intptr_t; |
18:38:43 | Zevv | that's the culprit making the ptr int |
18:39:16 | shashlick | i see how it could be breaking us |
18:39:42 | Zevv | why is that? are the heuristics on names with 'ptr' or something like that? |
18:40:03 | * | floppydh quit (Quit: WeeChat 2.3) |
18:40:13 | Zevv | yes, there are :) |
18:40:16 | shashlick | i am replacing [u]intptr_t with ptr int |
18:40:29 | Zevv | yeah, I see |
18:40:55 | shashlick | thanks for opening the issues, will make it easier to track and fix |
18:41:04 | Zevv | I'll add this one |
18:43:44 | Zevv | Haha, float128 |
18:43:50 | Zevv | That was just deprecated last week from Nim :) |
18:44:16 | * | gmpreussner quit (Ping timeout: 250 seconds) |
18:44:51 | * | gmpreussner joined #nim |
18:49:20 | * | enow quit (Quit: Lost terminal) |
19:21:32 | * | zachk joined #nim |
19:28:03 | * | enow joined #nim |
19:55:09 | FromGitter | <kaushalmodi> federico3: How does the Nim planet update? Does it run via cron everyday? |
19:56:07 | FromGitter | <kaushalmodi> I have removed the long notes from the feed, and am just waiting for that to reflect on https://planet.nim-lang.org/ |
19:58:33 | * | zachk quit (Changing host) |
19:58:33 | * | zachk joined #nim |
20:02:08 | * | fanta7531 quit (Quit: ...) |
20:03:39 | * | skellock joined #nim |
20:04:06 | * | absolutejam joined #nim |
20:13:20 | federico3 | @kaushalmodi: yep, give it some time |
20:26:06 | * | vlad1777d joined #nim |
20:26:57 | * | druonysus quit (Quit: druonysus) |
20:36:11 | * | platoff quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
20:37:37 | * | zachcarter joined #nim |
20:44:47 | * | narimiran quit (Ping timeout: 244 seconds) |
20:49:09 | FromGitter | <Varriount> Zevv: Why was it deprecated? |
20:53:28 | absolutejam | dom96: you alive? :) |
20:59:49 | Zevv | nonstandard |
21:01:24 | Zevv | cpus do float64 and sometimes float80, but 128 has to fallback to sw on most platforms anyway |
21:05:12 | FromGitter | <zacharycarter> I just want to say - the improvements to Nim's explanation of errors is well observed by me, and continues to impress me |
21:05:57 | FromGitter | <zacharycarter> so thank you to everyone who is working on this - `Error: a case selecting discriminator 'kind' with value 'vkBoat' appears in the object construction, but the field(s) 'nCars' are in conflict with this value.` - I don't have any examples to compare this with previous iterations on-hand, but I can assure this is worlds better than what I first encountered when working with variant types in Nim. |
21:06:40 | FromGitter | <zacharycarter> I also just shared several paragraphs with co-workers about algebraic data types / sum types and how Nim utilizes enumerations to model them, in an effort to explain how enums have different implementations / effects |
21:07:00 | FromGitter | <zacharycarter> and pointed this error message improvement out to anyone that read - hopefully they appreciate the clarity as well, I think this is a superb trend |
21:07:18 | * | Trustable quit (Remote host closed the connection) |
21:07:22 | FromGitter | <zacharycarter> and addresses (IMO) one of the most major issues that people have complained about re: Nim for the years I have been following it |
21:08:15 | Zevv | What do you refer to by "several paragraphs [...] about algebraic data types / sum types and how Nim utilizes enumerations to model them" |
21:08:38 | Zevv | or was that your own writings? |
21:08:41 | FromGitter | <zacharycarter> the initial question I fielded was in regards to enumerations in TypeScript |
21:09:01 | FromGitter | <zacharycarter> it was my own writing - I put together a very contrived example of using sum types to model different types of transportation |
21:09:25 | FromGitter | <zacharycarter> and how with a discriminator - you could have different fields for each mode of transport |
21:09:53 | FromGitter | <zacharycarter> just to make the point to my co-worker, that every language flexes enumerations in different ways / has a different idea about how they should be leveraged and used |
21:10:08 | FromGitter | <zacharycarter> I think he was expecting me to be an expert on TS enumerations because I use enumerations elsewhere |
21:10:09 | * | skellock quit (Ping timeout: 268 seconds) |
21:19:05 | FromGitter | <alehander42> the way ts does adt is a bit weird |
21:19:09 | FromGitter | <alehander42> i always forget it |
21:19:17 | FromGitter | <alehander42> something with interfaces + tag |
21:19:18 | FromGitter | <alehander42> and `|` |
21:27:53 | * | oculux quit (Quit: blah) |
21:28:56 | * | oculux joined #nim |
21:36:27 | * | aguspiza quit (Ping timeout: 258 seconds) |
21:45:02 | * | skellock joined #nim |
21:47:31 | * | dom96_w joined #nim |
21:47:55 | dom96_w | absolutejam: I certainly hope I am :) |
21:50:44 | * | zachcart1r joined #nim |
21:51:04 | absolutejam | wahey! great news :P |
21:51:14 | absolutejam | any chance you can please resend activation email for forums? |
21:53:19 | * | zachcarter quit (Ping timeout: 258 seconds) |
21:53:20 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:58:30 | * | skellock quit (Ping timeout: 272 seconds) |
22:01:42 | FromGitter | <brentp> I get a "recursive dependency" error on this: |
22:01:49 | FromGitter | <brentp> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c40fb4c1cb70a372af5e8d4] |
22:01:55 | FromGitter | <brentp> how can I make that work? |
22:09:13 | FromGitter | <brentp> for now, I just did: |
22:09:18 | FromGitter | <brentp> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5c40fd0ecb47ec30005d9f9e] |
22:18:26 | rayman22201 | @brentp Iterators currently don't support recursion iirc. Sorry. |
22:19:12 | FromGitter | <brentp> seems not. this works for me anyway. |
22:19:19 | * | dom96_w joined #nim |
22:22:52 | FromGitter | <deech> Is there any interest in adding a `{.noDefaultInitiaze.}` pragma or the like for variables I don't want to be initialized by default along with a compiler error if the user does not supply an initial argument? |
22:24:11 | * | zachcarter joined #nim |
22:27:05 | * | zachcart1r quit (Ping timeout: 244 seconds) |
22:30:18 | * | dom96_w quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:32:32 | rayman22201 | @deech, in what context are you referring to? There is already a noinit pragma... https://nim-lang.org/docs/manual.html#statements-and-expressions-var-statement |
22:38:50 | rayman22201 | I'm poking around the compiler internals, and using the ```typeToString``` function. This function returns 'ChildType:ObjectType'. how do I get just the 'ChildType' part without the ':ObjectType'... without the obvious string splitting answers lol. The right way, using the PType. |
22:39:41 | FromGitter | <deech> Had no idea that existed. Thanks! |
22:40:13 | rayman22201 | 👍 glad I could help |
22:42:09 | rayman22201 | anybody with knowledge of the compiler internals awake? |
22:44:41 | * | rockcavera quit (Remote host closed the connection) |
22:45:46 | * | dom96_w joined #nim |
22:46:27 | * | dom96_w quit (Client Quit) |
23:28:54 | * | absolutejam quit (Ping timeout: 268 seconds) |
23:31:58 | FromGitter | <timotheecour> not sure i can help but shoot |
23:33:03 | FromGitter | <zacharycarter> if anyone has any recommendations regarding mini ITX builds focused on gaming - or general desktop builds focused on gaming - please see my messages in off-topic |
23:33:51 | FromGitter | <zacharycarter> I need to build / acquire a new machine - but I honestly don't have time to put in the research for a unique build - I'd be satisfied with something that works well for others and meets my needs. |
23:36:34 | * | sagax quit (Quit: Konversation terminated!) |
23:39:24 | * | leorize quit (Quit: WeeChat 2.3) |
23:41:33 | rayman22201 | I got it... I think, lol. Thanks anyway. |
23:48:07 | * | krux02 quit (Remote host closed the connection) |
23:49:31 | FromDiscord_ | <exelotl> is there a way to do backtick interpolation with strings in templates? |
23:49:50 | FromDiscord_ | <exelotl> template incbin(name:untyped) = var name {.importc:"`name`_bin", header:"`name`_bin.h".}: cstring |
23:50:53 | FromDiscord_ | <exelotl> I wanted to do something like this but it literally generates ``` #include "`name`_bin.h" ``` |
23:55:04 | FromGitter | <zacharycarter> exelotl: I think I've faced this challenge before |
23:55:13 | * | skellock joined #nim |
23:55:16 | FromGitter | <zacharycarter> but... not with the C target - with the JS target |
23:55:22 | FromGitter | <zacharycarter> and using backticks for string interpolation :) |
23:55:42 | FromGitter | <zacharycarter> let me try to figure out how I solved it - it wasn't at all ideal and it was plenty messy |
23:56:07 | FromDiscord_ | <exelotl> I see people doing it with the emit pragma.. but only for that |
23:56:32 | FromGitter | <zacharycarter> heh - you can see the hackiness here - https://github.com/zacharycarter/litz/blob/master/src/litz.nim#L108 |
23:56:37 | FromGitter | <zacharycarter> it's terrible... |
23:56:55 | FromDiscord_ | <exelotl> oof xD |
23:57:02 | FromGitter | <zacharycarter> I think importcpp was the key though - it allowed for more flexible import pragmas than importc |
23:57:15 | FromGitter | <zacharycarter> but `eval` made it all work |
23:57:22 | FromGitter | <zacharycarter> which wasn't ideal at all |
23:58:10 | rayman22201 | You could do it with a macro instead. Still more code, but maybe more "nim" like, or at least cleaner |
23:58:38 | FromDiscord_ | <exelotl> yeah I think I'm gonna go the macro route |
23:58:45 | FromGitter | <zacharycarter> probably best |
23:59:23 | * | skellock quit (Ping timeout: 246 seconds) |