00:11:27 | * | Hideki_ joined #nim |
00:22:44 | * | traviss joined #nim |
00:30:56 | * | theelous3_ quit (Ping timeout: 240 seconds) |
00:46:47 | * | Hideki_ quit (Remote host closed the connection) |
00:47:26 | * | Hideki_ joined #nim |
00:52:18 | * | Hideki_ quit (Ping timeout: 268 seconds) |
01:06:56 | * | laaron- joined #nim |
01:11:23 | * | laaron- quit (Remote host closed the connection) |
01:22:06 | * | Hideki_ joined #nim |
01:40:16 | * | Hideki_ quit (Ping timeout: 240 seconds) |
02:42:16 | * | dddddd quit (Remote host closed the connection) |
03:25:39 | * | chemist69 quit (Ping timeout: 250 seconds) |
03:27:45 | * | chemist69 joined #nim |
04:51:01 | * | narimiran joined #nim |
04:53:29 | * | lritter joined #nim |
04:53:36 | * | nsf joined #nim |
04:55:18 | * | oculuxe joined #nim |
04:56:13 | * | oculux quit (Ping timeout: 250 seconds) |
05:20:53 | FromDiscord | <Chiqqum_Ngbata> Ideas? https://pastebin.com/2evDPxMv |
05:27:54 | narimiran | give your template a name |
05:37:35 | * | Hideki_ joined #nim |
05:40:56 | FromDiscord | <Chiqqum_Ngbata> It has a name. Unrelated |
05:42:11 | * | Hideki_ quit (Ping timeout: 265 seconds) |
05:54:52 | * | krux02 joined #nim |
06:15:34 | FromGitter | <dumjyl> Gensymed symbols don't work with exportc. They don't make much sense. Use a dirty template or inject the var. |
06:16:01 | FromGitter | <dumjyl> https://play.nim-lang.org/#ix=1YV0 |
06:17:01 | Araq | yeah but we should fix that, it's a one line fix in the compiler... |
06:20:10 | Araq | omg! it's green! |
06:20:19 | Araq | in the end, it was a silly typo... |
06:21:29 | leorize | Araq: is gc:destructors gonna require an external gc? |
06:21:37 | Araq | yes |
06:22:17 | leorize | is there any plans to base the current gcs on top of it? so that we can have destructors-based strings/seqs? |
06:23:30 | Araq | it depends on the GC |
06:24:00 | Araq | --gc:refc makes little sense with destructors as the destructors do what the "refcounting" did, but much better |
06:24:30 | leorize | but currently we don't have move optimizations without destructors, right? |
06:24:43 | FromGitter | <gogolxdong> could not load: libpcre.so(.3|.1|) ⏎ compile with -d:nimDebugDlOpen for more information nim playground |
06:24:48 | Araq | --gc:markAndSweep + destructors is like Yin and Yang |
06:25:12 | Araq | work really well and it's the same algorithm that "araqsgc" uses |
06:25:17 | FromGitter | <gogolxdong> aha, you know Yin and Yang? |
06:25:43 | livcd | Araq i need help. Can you help me ? *sadface* |
06:25:53 | Araq | well I know the symbol, gogolxdong |
06:26:09 | Araq | leorize, that's correct... |
06:26:17 | Araq | livcd, ok |
06:26:24 | FromGitter | <gogolxdong> It's the essential of the universe. |
06:27:23 | FromGitter | <gogolxdong> My icon is Taiji which is composed with Yin and Yang. |
06:27:31 | livcd | So this unchecked pragma was removed: https://github.com/coffeepots/odbc/blob/master/odbc/odbcparams.nim#L13 |
06:28:05 | FromGitter | <gogolxdong> @PMunch ⏎ nim playground could not load: libpcre.so(.3|.1|) |
06:28:37 | livcd | If i remove it i get an undeclared identifier: 'Time' https://github.com/coffeepots/odbc/blob/master/odbc/odbcfields.nim#L99 |
06:29:27 | leorize | Araq: are closures iterator working on newruntime? |
06:29:49 | FromGitter | <gogolxdong> Can you fix it? |
06:30:03 | leorize | he's not online atm @gogolxdong |
06:30:38 | leorize | you might want to open an issue in the playground tracker instead: https://github.com/PMunch/nim-playground |
06:30:57 | * | solitudesf- joined #nim |
06:30:59 | FromGitter | <gogolxdong> good. |
06:31:29 | FromDiscord | <Chiqqum_Ngbata> Nice, with dirty and inject I've got something compiling. Still have a segfault unfortunately |
06:34:58 | Araq | livcd, remove the full UncheckedArray declaration, it's in system.nim now |
06:35:01 | Zevv | I have a nasty bug where having a variable declard inside a "when true" block causes hard to trace segfaults, moving it outside the when: block solves it. |
06:37:25 | Zevv | any ideas if this can be caused by me doing something wrong? |
06:37:29 | Zevv | (probably, but still) |
06:41:25 | Araq | Zevv, it's probably something else, run in valgrind :P |
06:41:33 | Araq | leorize, closure ir |
06:41:50 | Araq | iterators have been ported but I doubt they work |
06:42:12 | leorize | yea, I've just crashed it and opened an issue |
06:42:44 | livcd | Araq: ah ok I also had to import Times in that module. My bad. Thanks |
06:43:48 | Araq | leorize, at this point I'm quite convinced --gc:destructors will win. |
06:44:24 | Araq | it's simpler than 'owned' and works with the existing Nim |
06:45:13 | leorize | is it also faster? :p |
06:45:47 | * | PMunch joined #nim |
06:46:13 | Araq | it's quite identical |
06:48:31 | leorize | that's nice |
06:48:47 | leorize | are we getting a default gc based on --gc:destructors as well? |
06:50:02 | Araq | if you tell me how to setup the command line interface... |
06:50:25 | Araq | it's all messed up, 'gc' should be 'mms' (memory management strategy) |
06:52:20 | * | NimBot joined #nim |
06:55:54 | * | gangstacat joined #nim |
06:56:45 | leorize | never too late for a new switch :p |
06:59:01 | Zevv | well, 1.0 is out so rename all that stuff before someone notices! |
07:00:00 | * | gmpreussner_ quit (Quit: kthxbye) |
07:00:43 | Araq | what makes most sense is now --mms:shared/threadlocal/boehm/gogc |
07:02:17 | * | nc-x joined #nim |
07:02:45 | nc-x | won't too many and too different memory management strategies cause incompatibilities between packages? |
07:03:51 | Araq | yeah, indeed, we must reduce them |
07:04:44 | FromDiscord | <Chiqqum_Ngbata> How to exportc an initialized c array? |
07:04:56 | leorize | just exportc it |
07:04:58 | * | gmpreussner joined #nim |
07:10:18 | FromDiscord | <Chiqqum_Ngbata> `const test {.exportc.} = [1,2,3]` doesn't produce anything |
07:12:22 | leorize | const are compile-time only |
07:12:25 | leorize | use `var` instead |
07:13:07 | * | nc-x quit (Remote host closed the connection) |
07:15:22 | FromDiscord | <Chiqqum_Ngbata> `tyArray__8h6OIln69cI7qXhCJRRIrtw test;` |
07:19:35 | leorize | as long as you call NimMain() it'll the populated |
07:19:51 | leorize | Nim seems to build the const outside then copymem it in during runtime |
07:25:01 | FromGitter | <dumjyl> const get generated on use, so adding `discard test` could work. |
07:27:10 | FromGitter | <gogolxdong> Any idea of https://play.nim-lang.org/#ix=1YVi |
07:27:36 | FromDiscord | <Chiqqum_Ngbata> Is something obviously wrong here? https://pastebin.com/HGjSuEHf |
07:27:57 | FromDiscord | <Chiqqum_Ngbata> Essentially trying to produce this wrapper code via nim https://gist.github.com/tsloughter/5c85ff9ecfe4e80a60ec |
07:28:09 | leorize | PMunch: ^ you need pcre in the playground |
07:29:18 | FromGitter | <gogolxdong> It's necessary to preprocess html with entity symbols, but ö and ü is not matched. |
07:30:05 | leorize | iirc there's only a handful of html reserved symbols |
07:30:25 | leorize | Nim probably assumed utf-8 and don't encode any non-reserved symbols |
07:31:25 | * | Hideki_ joined #nim |
07:31:50 | FromGitter | <gogolxdong> it's in the case `of "uuml": Rune(0x000FC)` |
07:32:27 | FromGitter | <gogolxdong> It's supposed to be matched with re"&\w+;", isn't it? |
07:33:24 | leorize | there aren't any ü in the html from parseHtml() |
07:34:20 | PMunch | leorize, done :) |
07:35:50 | leorize | @Chiqqum_Ngbata I'm not entirely sure what you're trying to do |
07:35:59 | PMunch | Hmm, I guess that should be in all the containers and not only the v1.0.0 one |
07:36:08 | PMunch | Since it's required by a module in system |
07:36:21 | PMunch | Or not in system, but in stdlib |
07:37:07 | PMunch | Ugh, that means rebuilding all of them.. |
07:38:10 | FromDiscord | <Chiqqum_Ngbata> I'm trying to produce this hello world erlang NIF. It wants a nif_init wrapper function that returns an "entry" which includes a pointer to the functions to import into Erlang VM |
07:39:14 | FromDiscord | <Chiqqum_Ngbata> Having trouble producing an array of functions that it likes. I can get it working via emitting C but I'd rather avoid that |
07:39:57 | leorize | run NimMain() from nif_init() |
07:40:09 | leorize | just `proc NimMain() {.importc.}`, then run it |
07:40:23 | leorize | it's needed to initialize Nim's runtime |
07:41:12 | leorize | the wrapper definitely can be improved |
07:42:25 | leorize | also store the "entry" table outside of `nif_init()`, or give it the `{.global.}` tag so it wouldn't be removed once the function end |
07:44:08 | * | solitudesf- quit (Ping timeout: 276 seconds) |
07:46:05 | FromGitter | <gogolxdong> I see, use readFile to find and replace. |
07:46:55 | FromDiscord | <Chiqqum_Ngbata> Invoking NimMain() from nif_init() gives me SIGSEGV: Illegal storage access. (Attempt to read from nil?) |
07:47:27 | leorize | hmm, how does erlang load everything? |
07:47:29 | leorize | via dynlib? |
07:47:52 | FromDiscord | <Chiqqum_Ngbata> Yeah |
07:48:01 | FromDiscord | <Chiqqum_Ngbata> I'm compiling with --noMain and --gc:none |
07:48:21 | leorize | leave the gc in... |
07:48:38 | leorize | do you have --app:lib? |
07:48:50 | FromDiscord | <Chiqqum_Ngbata> Erlang wants to control the lifetimes of variables. Yeah |
07:49:59 | leorize | ref-based stuff from nim can't be controlled by erlang |
07:50:13 | leorize | only erlang-based strings/pointers can be controlled by them |
07:50:24 | leorize | so don't worry, as long as you get your types right |
07:50:46 | leorize | what's your current code look like? |
07:51:45 | FromDiscord | <Chiqqum_Ngbata> For example, on the Erlang side, "terms" are associated with an ErlNifEnv ("environment"), which are managed by Erlang VM |
07:52:09 | Araq | cool, interfacing with Erlang :-) |
07:52:16 | leorize | if they are not `ref T`, nim won't touch them |
07:52:26 | leorize | so don't worry |
07:53:25 | FromDiscord | <Chiqqum_Ngbata> Right. I still thought it prudent to disable GC for now at least. You're right, can probably run with it |
07:54:11 | FromDiscord | <Chiqqum_Ngbata> Wish I could get this wrapper code working without emitting C :/ |
07:58:56 | leorize | if you can show us the code, maybe we can figure out what's wrong |
07:59:06 | Araq | for emitting C code there is also .emit |
08:03:27 | * | gmpreussner_ joined #nim |
08:04:02 | * | gmpreussner quit (Ping timeout: 240 seconds) |
08:05:34 | FromDiscord | <Chiqqum_Ngbata> It's just here: https://pastebin.com/HGjSuEHf |
08:06:05 | FromDiscord | <Chiqqum_Ngbata> Segfaults. BRB |
08:07:24 | Araq | of course it does |
08:07:37 | Araq | you are returning a pointer into a stack frame that is about to disappear! |
08:07:41 | Araq | return addr(entry) # wrong |
08:14:36 | PMunch | Yeah, a bit depending on how Erlend handles that ErlNifEntry you might need to manually allocate that on the heap |
08:14:46 | PMunch | If Erlang is the one that is meant to free it |
08:14:53 | PMunch | s/Erlend/Erlang :P |
08:24:42 | * | asymptotically joined #nim |
08:29:09 | leorize | @Chiqqum_Ngbata: http://ix.io/1YVD |
08:29:18 | leorize | there, I've made you a nice interface :P |
08:29:33 | leorize | untested as I know nothing about erlang |
08:31:38 | livcd | did anything change for staticRead ? iam just doing staticRead(msi) and writeFile(path,msi) but the msi looks "corrupted" ? |
08:31:41 | leorize | but this is about everything that I extrapolated from your C example |
08:31:59 | livcd | tried with a .nim file and that works. |
08:32:15 | leorize | you're on windows, right? |
08:32:30 | livcd | me? |
08:32:31 | livcd | i am |
08:33:23 | leorize | iirc there were issues on how windows just loves to meddle with binary input/output :/ |
08:33:39 | livcd | oh noes.... |
08:33:44 | livcd | this worked pre 1.0 btw |
08:34:03 | leorize | Araq might know a thing or two |
08:34:03 | * | Hideki_ quit (Ping timeout: 245 seconds) |
08:34:03 | * | Vladar joined #nim |
08:42:27 | Araq | fix is in 1.0.2 |
08:44:57 | * | letto joined #nim |
08:45:41 | * | Mister_Magister quit (Quit: bye) |
08:46:11 | livcd | but that's not out yet right ? |
08:46:46 | * | Mister_Magister joined #nim |
08:48:01 | narimiran | livcd: not officially, but you can grab a preview from nightlies if you want |
08:49:02 | livcd | guess i will have to |
08:49:39 | narimiran | here: https://github.com/nim-lang/nightlies/releases/tag/2019-10-13-version-1-0-f16bb4d |
08:50:14 | Mister_Magister | i need to filter out any non alphanumeric+whitespace characters. any idea how to do it nicely? regex replace? |
08:51:02 | narimiran | Mister_Magister: https://nim-lang.github.io/Nim/strutils.html#isAlphaNumeric%2Cchar ? |
08:51:41 | Mister_Magister | narimiran: that only checks if it's alphanumeric |
08:51:49 | Mister_Magister | i need to make it alphanumeric |
08:52:13 | narimiran | well, use it in combination with `filter` |
08:52:24 | Mister_Magister | filter? |
08:52:39 | lqdev[m] | if c notin {'a'..'z', 'A'..'Z', '0'..'9'}: str[i] = '-' |
08:52:42 | livcd | thanks narimiran ! |
08:52:51 | lqdev[m] | that's how I would do it |
08:53:27 | Araq | lqdev[m], me too :-) |
08:54:30 | narimiran | Mister_Magister: https://play.nim-lang.org/#ix=1YVP |
08:55:22 | Mister_Magister | oh thanks |
08:56:04 | Mister_Magister | but how do i include space in isAlphanumeric |
08:57:06 | leorize | isAlphaNumeric(c) or c == ' ' :P |
08:57:23 | narimiran | Mister_Magister: https://play.nim-lang.org/#ix=1YVQ |
08:57:58 | Araq | c notin {'a'..'z', 'A'..'Z', '0'..'9', ' '} |
08:58:17 | Araq | is much better than isAlphanumeric because nobody knows what that means |
08:58:36 | leorize | c notin Letters + Digits + Whitespace |
08:58:47 | Araq | or that, yes |
08:59:17 | Araq | I hate all this crap in my strutils that came from Python because Python lacks superfast bitsets |
09:00:14 | leorize | the only problem with bitsets is that I've zero idea on how to save them to sqlite :P |
09:00:19 | Araq | omg, play.nim-lang got Nim version support and Compilation target? that's awesome |
09:00:43 | Araq | leorize, for c in myset: str.add c # turn it into a string |
09:00:54 | Mister_Magister | thank u all |
09:01:50 | Araq | leorize, how do you save a func like isAlphanumeric to sqlite btw? :P |
09:02:36 | leorize | :P I'm just saving a set of permissions for an user |
09:02:53 | leorize | decided to go with bunch of boolean columns though |
09:37:52 | FromDiscord | <Chiqqum_Ngbata> Nice @leorize, let me try |
09:42:39 | * | dddddd joined #nim |
09:49:30 | lqdev[m] | leorize: cast them to ints |
09:52:33 | lqdev[m] | Araq: once I learned about the capabilities of Nim sets I started abusing them like crazy |
09:53:29 | Araq | you can't "abuse" them, ever looked at the compiler code? :P |
09:55:47 | FromDiscord | <Chiqqum_Ngbata> Erlang still doesn't like this funcs array |
10:00:59 | * | fredrik92 quit (Quit: Client disconnecting) |
10:01:20 | FromDiscord | <Chiqqum_Ngbata> Oh hey, actually this works! |
10:03:38 | * | sagax quit (Ping timeout: 245 seconds) |
10:13:55 | * | solitudesf- joined #nim |
10:16:36 | * | nif quit (Quit: ...) |
10:16:46 | * | nif_ joined #nim |
10:18:20 | leorize | @Chiqqum_Ngbata: glad it does :) |
10:19:08 | leorize | I'm pretty sure you can evolve it into an even better interface :) |
10:19:25 | leorize | lqdev[m]: I've thought of that, until I realized that I'd need to query it later |
10:37:26 | * | solitudesf- quit (Quit: Leaving) |
10:37:47 | * | solitudesf joined #nim |
10:38:58 | PMunch | Araq, yup, those features are new in the playground from the last couple of days |
10:39:26 | PMunch | It now also has most of the packages in the important_packages list, and a couple other, installed on the v1.0.0 version :) |
10:41:29 | FromDiscord | <Kiloneie> If i were to say "Enumerators are ordered symbol types of integers you can make in Nim" does that make any sense or is valid ?... im not sure on my wording here. |
10:42:37 | leorize | https://nim-lang.org/docs/manual.html#types-enumeration-types |
10:42:44 | leorize | I think the wording here is more clear |
10:44:02 | narimiran | PMunch: should i add those extra packages to important_packages? |
10:45:01 | PMunch | Nah, I just let people PR and add pretty much whatever to the playground |
10:45:33 | PMunch | Only requirement is that it doesn't bloat the image too much, and that it makes sense to run in the playground (hence why I removed nimx) |
10:46:10 | PMunch | I mean, feel free to add them, I think there are only two so far |
10:59:50 | * | ng0 joined #nim |
11:10:12 | * | sagax joined #nim |
11:10:43 | Araq | PMunch, one feature that I would love to see is "show produced asm" |
11:11:20 | federico3 | Araq: what happened with csize going from int to uint? |
11:11:34 | Araq | federico3, want to revert that one |
11:11:42 | Araq | but 1.0.x isn't affected |
11:11:44 | federico3 | ah was it an error? |
11:11:56 | Araq | IMO yes |
11:11:59 | federico3 | I was quite surprised to see the merge without comments |
11:12:05 | federico3 | and it's breaking a lot of stuff |
11:12:40 | Araq | well all the "important packages" were green but this change wasn't handled well (sorry clybber!) |
11:13:26 | federico3 | maybe the important packages don't contain many wrappers... everything using csize breaks |
11:17:09 | Araq | we always seek to expand "important packages" |
11:18:07 | PMunch | Araq, what would that output? |
11:18:24 | Araq | the produced assembler |
11:18:40 | * | ng0 quit (Ping timeout: 260 seconds) |
11:18:45 | Araq | preferably in Intel syntax, not that GNU syntax abomination |
11:19:02 | planetis[m] | So.. does arraymancer has a problem with operators precedence too? I mean it uses .* and stuff from matlab |
11:19:08 | * | asymptotically quit (Ping timeout: 260 seconds) |
11:19:08 | * | leorize quit (Ping timeout: 260 seconds) |
11:19:14 | PMunch | Where would I get that from? |
11:19:38 | narimiran | @mratsim ^^ |
11:19:55 | Araq | PMunch, via some GCC/CLang switch |
11:24:54 | PMunch | Hmm |
11:26:20 | Araq | -f-keep-asm-in-intel-syntax |
11:27:09 | Araq | https://stackoverflow.com/questions/10990018/how-to-generate-assembly-code-with-clang-in-intel-syntax |
11:33:58 | * | dddddd quit (Remote host closed the connection) |
11:36:11 | planetis[m] | use this sw |
11:36:37 | planetis[m] | *define: ``when defined(debugAsm): {.passC: "-fverbose-asm -masm=intel -S".}`` |
11:36:42 | * | rockcavera joined #nim |
11:36:50 | * | ng0 joined #nim |
11:48:27 | * | couven92 joined #nim |
11:59:46 | * | EvilKhaosKat joined #nim |
12:00:14 | FromGitter | <Willyboar> Hello! Any nim forum mod online? |
12:00:31 | * | NimBot joined #nim |
12:00:48 | narimiran | @Willyboar i just approved you as a user, if that's what you're asking |
12:01:23 | FromGitter | <Willyboar> Yeah! You are fast.. :) |
12:02:02 | narimiran | that's what she said.... |
12:02:33 | FromGitter | <Willyboar> :P |
12:02:43 | * | leorize joined #nim |
12:10:40 | * | daddoo joined #nim |
12:10:44 | * | daddoo left #nim (#nim) |
12:16:16 | * | theelous3 joined #nim |
12:16:19 | PMunch | Man, these new docker images the playground uses are way smaller than the ones on the docker hub |
12:18:03 | * | EvilKhaosKat quit () |
12:18:20 | * | EvilKhaosKat joined #nim |
12:21:04 | * | EvilKhaosKat quit (Client Quit) |
12:21:43 | * | EvilKhaosKat joined #nim |
12:29:46 | FromDiscord | <badassiel> Hey guys, does nimble support scoping of dependencies? if yes, is it like implicit folder scoping like nodejs or something like python? if no, are there any plans for it? |
12:29:58 | FromDiscord | <badassiel> *installed dependencies |
12:30:04 | PMunch | What do you mean by scooping? |
12:31:16 | FromDiscord | <badassiel> like if i do nimble install <my-package> can I make available only for my project instead of it being available globally |
12:31:19 | * | Hideki_ joined #nim |
12:33:12 | FromDiscord | <badassiel> Hey guys, does nimble support scoping of dependencies? if yes, is it like implicit folder scoping like nodejs or something like python environments? if no, are there any plans for it? |
12:33:33 | FromDiscord | <badassiel> Hey guys, does nimble support scoping of installed dependencies? if yes, is it like implicit folder scoping like nodejs or something like python environments? if no, are there any plans for it? |
12:34:27 | PMunch | Please don't edit your messages on Discord, they come through to IRC as completely new messages |
12:34:50 | FromDiscord | <badassiel> oh okay, i didn't know that |
12:34:54 | FromGitter | <Willyboar> If you cd into your lib and press ⏎ ``` nimble install ``` it will install it without expose your code |
12:35:59 | * | Hideki_ quit (Ping timeout: 276 seconds) |
12:36:34 | PMunch | Willyboar, running nimble install in a director with a nimble file will install that nimble package. Which is not what he wants to d |
12:36:45 | FromDiscord | <badassiel> hmm we might not not be on same page. Im talking about dependency not the project code (my lib folder) |
12:36:51 | PMunch | I guess nimble develop might be the closest thing |
12:37:03 | FromDiscord | <badassiel> ok let me check |
12:37:11 | PMunch | Or of course use --nimbleDir:dirname to specify the directory it installs into |
12:37:45 | PMunch | And then pass --NimblePath:dirname to the nim compiler to tell it where to find these packages |
12:39:37 | FromDiscord | <badassiel> hmm yeah that would work. It will nice if nimble can target project by default (by checking path of nimble file) - like package.json for node. |
12:40:09 | FromDiscord | <badassiel> Installing dependencies per project is more common use case than global installation (which can added via flag) what do you guys think? |
12:41:12 | * | asymptotically joined #nim |
12:47:19 | PMunch | Why would that be more common? |
12:47:47 | * | clyybber joined #nim |
12:47:54 | PMunch | The only reason to do that is if you want to lock one package to a specific version while keeping your globally installed ones up to date |
12:48:09 | PMunch | But otherwise it just causes a bunch of duplication |
12:49:05 | clyybber | PMunch: Why are they smaller/bigger? |
12:52:57 | PMunch | Why is what smaller/bigger? |
12:53:17 | FromDiscord | <Rika> wouldnt it be better if it was scoped because of "what if two packages need 2 versions of a package" |
12:53:56 | FromDiscord | <Rika> akin to module `b` needing `a ver1.2` and module `c` needing `a ver 2.0` |
12:54:22 | FromDiscord | <Rika> what does nim do regards this? |
12:54:56 | clyybber | PMunch: The docker images |
12:56:54 | PMunch | Rika, nimble allows you to have multiple versions installed, and lets Nim use the different versions. But you can't mix and match within the same project |
12:56:55 | * | xace quit (Remote host closed the connection) |
12:57:04 | PMunch | clyybber, not 100% sure |
12:57:38 | PMunch | But I think it's because I use one image to build Nim, then another to install packages, then in the third and final image I simply copy in only what is actually required to run Nim |
12:57:43 | FromDiscord | <badassiel> PMunch: Usually the reason are |
12:57:43 | FromDiscord | <badassiel> 1. Keeping dependency list to required packages only, since project might not have common deps (node - package.json per folder or python - requirements.txt per env) |
12:57:43 | FromDiscord | <badassiel> 2. Like rika said, different projects needing different versions |
12:57:44 | FromDiscord | <badassiel> 3. Not including all globa bloat, though most pkg managers tree shake so not a strong point |
12:57:46 | FromDiscord | <badassiel> 4. Updating global dep will not break project dep, because any change different version introduced |
12:59:29 | PMunch | clyybber, to put it like this, my image with nim v1.0.0 with all the nimble packages is 214MB while the nimlang/nim:latest-alpine-slim image (although 7 months old, so not v1.0.0) is 643MB |
12:59:52 | PMunch | My v0.20.2 image without packages is at 166MB |
13:00:46 | FromDiscord | <badassiel> PMucnh granted, docker is great for isolation, but being dependent on 3rd party tool is a negative right? Think newbies starting with nim and when they start with their second project they will have told to install/learn docker first |
13:01:07 | * | kungtotte quit (Ping timeout: 250 seconds) |
13:01:21 | FromDiscord | <Rika> PMunch, let me just verify, Nim knows what version a package needs right? if so all's good, no issues from me |
13:01:43 | PMunch | badassiel, the docker stuff is only for the playground |
13:01:46 | PMunch | play.nim-lang.org |
13:02:35 | FromDiscord | <badassiel> oh sorry thought it was for my point |
13:02:50 | PMunch | badassiel, with <project>.nimble you can have per-project dependencies. Then building with `nimble build` will only allow access to the dependencies specified in the file, and will install anything that is missing. If you also specify the versions you want in that file you will only get those versions. |
13:03:54 | FromDiscord | <badassiel> okay sounds good, and to reiterate Rika's question, we can have multiple version installed at same time right |
13:04:01 | PMunch | Yes |
13:04:01 | FromDiscord | <Rika> yes |
13:04:05 | FromDiscord | <Rika> they said before |
13:04:15 | FromDiscord | <badassiel> ok cool 🙂 |
13:04:34 | PMunch | But if module A depends on module B v1 and module C, while module C has been updated and now depends on module B v2 you will have a bad time |
13:05:08 | PMunch | So in a single project, all version of a module required has to be the same |
13:05:19 | FromDiscord | <Rika> wouldnt local packages fix those |
13:05:22 | PMunch | But if people tag their versions properly that shouldn't be an issue |
13:05:24 | FromDiscord | <Rika> wait |
13:05:26 | FromDiscord | <Rika> no it wouldnt |
13:05:27 | PMunch | Nope |
13:05:42 | FromDiscord | <Rika> what if C exported B v2's functions, then what lmao |
13:05:44 | FromDiscord | <Rika> rip rip |
13:05:46 | FromDiscord | <Rika> that's fine |
13:05:46 | PMunch | It's something that would have to be implemented within Nim itself. I think it is planned for after incremental compilation |
13:07:16 | FromDiscord | <badassiel> yeah, i think thats why node projects have lock files to maintain entire dep tree, so this scenario wont crash anything |
13:08:00 | * | kungtotte joined #nim |
13:08:09 | FromDiscord | <Rika> see node is much older than nim so it's had time to implement that |
13:09:07 | FromDiscord | <Rika> well, apparently nim is older; but there's also the fact that node is much much more popular |
13:09:16 | FromDiscord | <badassiel> yeah I understand, what we have now in nim should be good for most cases. Only when packages are created left and right everyday then this might cause issues 😄 |
13:09:37 | FromDiscord | <Rika> we still only have a bit over 1000 so for now i guess its fine... |
13:10:07 | FromDiscord | <Rika> also incremental compiler 😮 compilation is already speedy as hell as it is right now |
13:10:11 | FromDiscord | <badassiel> Quality over quantity any day 🙂 |
13:10:15 | kungtotte | We also don't have a culture of creating a package that provides only "leftpad" |
13:10:23 | FromDiscord | <Rika> is_odd |
13:10:37 | * | xace joined #nim |
13:10:42 | FromDiscord | <Rika> https://www.npmjs.com/package/is-odd |
13:10:46 | FromDiscord | <Rika> 😛 |
13:10:57 | kungtotte | The amount of mental gymnastics people went through to defend the Node package culture when leftpad broke half the internet was hilarious. |
13:11:55 | * | nif_ quit (Quit: ...) |
13:12:04 | * | nif joined #nim |
13:12:30 | FromDiscord | <badassiel> yeah speed is an area where nim constantly surprises me. Learning nim is very enjoyable activity, more so since it potentially runs everywhere. |
13:12:46 | kungtotte | Dear lord. 12 files to provide 15 LOC of which only one is the actual code |
13:13:25 | FromDiscord | <Rika> then see is_even |
13:13:47 | FromDiscord | <Rika> https://www.npmjs.com/package/is-even |
13:13:52 | FromDiscord | <Rika> "dependencies: is-odd" |
13:14:39 | FromDiscord | <badassiel> haha yeah some node packages are hilarious, only good thing about its size is there's a package for whatever common requirement you have |
13:15:07 | kungtotte | Holy crap, is-number. 20 million downloads per week, because JS doesn't have a real type system |
13:27:32 | PMunch | https://www.youtube.com/watch?v=2cyib2MgvdM&feature=youtu.be |
13:28:25 | PMunch | Oh wait, that's not the one I was thinking of |
13:30:07 | PMunch | That's an interesting talk as well though |
13:36:31 | FromDiscord | <juan_carlos> I dont know NPM, I know Pythons, has a lot of test123 "Just a test" and fully automated CI uploading "package20958398243", arbitrary build artifact hosting. |
13:39:01 | Araq | badassiel: fwiw I agree with you and will eventually patch Nimble to support this |
13:39:59 | Araq | PMunch, IMO we should all use a deduplicating filesystem instead of hacking around it all the time via symlinks, global installation dirs etc |
13:40:32 | FromDiscord | <Rika> `deduplicating filesystem` sounds hard to implement 🤔 |
13:40:44 | FromDiscord | <Rika> do they exist right now? |
13:40:59 | FromDiscord | <Rika> wait. zfs is dedup?? |
13:41:22 | * | nsf quit (Quit: WeeChat 2.6) |
13:42:29 | PMunch | Yeah, they exist |
13:43:43 | Araq | used one in production 7 years ago, the code relied on it, it simply worked |
13:43:58 | Araq | was on Windows Server though |
13:44:37 | PMunch | The newest Apple versions uses one doesn't it? |
13:44:46 | PMunch | s/Apple/OSX |
13:45:12 | clyybber | You mean COW? |
13:46:12 | Araq | clyybber, usually it's done with COW, yes |
13:46:29 | PMunch | I was thinking of APFS, but apparently that only supports "Clones": "Clones allow the operating system to make efficient file copies on the same volume without occupying additional storage space. Changes to a cloned file are saved as deltas, reducing storage space required for document revisions and copies." |
13:47:09 | clyybber | bcachefs is a great COW filesystem, I'm using it along btrfs |
13:47:30 | clyybber | which is also COW and great (nowadays) |
13:47:37 | clyybber | but bcachefs is just faster |
13:48:21 | clyybber | Araq: Still, symlinks serve a different purpose. If I edit the contents of a symlink I want to edit the file it points at. |
13:48:30 | clyybber | Or at least thats how symlinks should be used. |
13:51:42 | Araq | maybe, I don't use symlinks. |
13:52:34 | Araq | life is easier when you forget about 90% of the crap that your OS offers you and only causes trouble, symlinks, signal handlers, fork(), ... |
13:53:19 | clyybber | The thing is, symlinks don't cause trouble and solve many problems. |
13:53:28 | Araq | hahahahaha |
13:53:29 | disruptek | agree; i use them pretty heavily. |
13:53:30 | clyybber | But to be fair, they are a PITA on windows |
13:55:23 | Araq | ## If the system supports symlinks it also resolves them until it |
13:55:23 | Araq | ## meets the actual file. This behavior can be disabled if desired |
13:55:23 | Araq | ## by setting `followSymlinks = false`. |
13:55:56 | Araq | ^ symlinks are complexity that creep into everything |
13:56:14 | Araq | they also destroy the tree-ness of the filesystem |
13:56:36 | Araq | copyDir(uhmWhatToDoAboutSymLinks = ...) |
13:57:15 | disruptek | why is treeness so important to you? |
13:57:34 | disruptek | to me it's extra complexity. |
13:57:39 | Araq | because it means I can traverse it without a cycle check |
13:57:54 | disruptek | and that's important because what? |
13:57:59 | Araq | and it means I can do 'copyTree' and it's clear what the fuck it actually means |
13:58:08 | clyybber | Yeah, thats a fair critique IMO. Symlinks really add complexity, but its worth it IMO |
13:58:49 | disruptek | clearly it's worth it. |
13:58:53 | * | EvilKhaosKat quit (Remote host closed the connection) |
13:58:54 | * | couven92 quit (Quit: Client disconnecting) |
13:58:55 | clyybber | Araq: But tbh, its actually pretty simple. For copyDir you usually don't want to follow symlinks, and just copy the symlink itself. |
13:59:06 | disruptek | we're talking about one bit and araq isn't willing to pass it to his methods. |
14:00:13 | Araq | clyybber, if I don't follow symlinks then I have created a broken backup... |
14:00:52 | clyybber | Depends on where the symlink points |
14:01:07 | disruptek | this is too silly to even discuss. |
14:01:29 | disruptek | only a windows user would attempt the argument. |
14:02:01 | Araq | when you lack arguments, draw it to a personal level |
14:02:37 | disruptek | i will concede your points, but they have no bearing on my practical experience. |
14:02:53 | disruptek | and i've been doing this a very long time. |
14:03:07 | disruptek | enjoy your link-free existence. |
14:03:20 | Araq | yup, I do, thanks |
14:03:41 | clyybber | Windows has Verknuepfungen |
14:03:48 | clyybber | Ah, links |
14:03:59 | clyybber | No program ever follows them |
14:04:07 | Araq | I never even mentioned Windows btw |
14:04:16 | Araq | it's all in your head ;-) |
14:04:30 | Araq | Windows links also suck, for the same reasons |
14:04:40 | clyybber | But you still use them right? |
14:04:55 | Araq | not to cross-link nim.exe files, no. |
14:05:15 | clyybber | Because windows doesn't support that |
14:05:21 | clyybber | sry |
14:05:30 | clyybber | I meant windows links |
14:05:33 | Araq | I don't even know if windows supports it, I don't use it. |
14:05:37 | clyybber | But symlinks do |
14:05:47 | disruptek | clyybber: what is your bcachefs application? |
14:06:49 | clyybber | Araq: Yeah, I get you. My point is that they are a pretty handy tool to use for some people, especially when the whole ecosystem supports them well (which is the case on linux and other posixes) |
14:07:00 | clyybber | disruptek: Storing my /home :) |
14:07:20 | disruptek | i mean, on what kinda block device? |
14:07:24 | clyybber | SSD |
14:07:30 | disruptek | ah. |
14:08:20 | clyybber | I only use SSD's they are the only thing thats left to me after I replaced my families broken HDDs with mine |
14:08:56 | disruptek | i haven't used ssds in years. |
14:08:57 | clyybber | And also, HDDs suck for a laptop. Not that I ever dropped it, but just in case |
14:09:07 | disruptek | once you go nvme, you don't go back. |
14:09:44 | clyybber | You probably use a nvme ssd |
14:09:47 | disruptek | i use metal for san. that's what i'd run bcachefs on. |
14:10:02 | disruptek | yes, but it may as well be another animal. |
14:10:58 | clyybber | Whats metal for san? Do you mean metaSAN? |
14:11:22 | disruptek | i mean spinning platters, literal metal. |
14:11:25 | clyybber | oh |
14:11:30 | Araq | clyybber, for me there is nothing "handy" about something you have to keep in mind all the time or else you have bugs. (fake backups, endless recursions, ...) |
14:11:47 | clyybber | handy for the user, not the programmer :) |
14:11:54 | Araq | I'm both. |
14:12:03 | clyybber | Thats the problem :P |
14:12:24 | FromDiscord | <krab4t> im confused, how the f you verify if sequence is empty, search on docs website useless |
14:12:33 | clyybber | .len == 0? |
14:13:11 | disruptek | i'm still looking for modern filesystems that i can layer local->san or local->cloud with a high degree of "just works". |
14:13:27 | FromDiscord | <krab4t> after Qt all this about len looks to me a bit stupid but thanks 🙂 |
14:13:41 | FromGitter | <deech> Is there a way to determine at compile time if an object has a discriminant? |
14:14:18 | disruptek | it'd be hard to compile discriminants if there weren't. |
14:15:51 | FromGitter | <deech> I understand, I meant in a way that's available to the user and can go into a `when ...`. |
14:16:11 | disruptek | i know, i'm just being a jackass, sorry. 😜 |
14:16:36 | disruptek | Araq: any reason not to submit patches to posix? |
14:17:13 | Araq | deech: macros.getType eventually retuns an nnkRecCase |
14:17:28 | Araq | you need to traverse the tree though |
14:17:39 | Araq | disruptek, what do you mean? |
14:18:01 | clyybber | hes just messing around |
14:18:05 | disruptek | i want to add times(&tms). |
14:18:12 | disruptek | i'm using it in golden. |
14:18:33 | clyybber | disruptek: What would that do? |
14:18:50 | disruptek | it lets you measure CPU time of dead child processes. |
14:18:53 | Araq | if you want to add it to posix.nim create a PR with a link to the posix page so that I can check |
14:19:25 | disruptek | sure. it's just a struct of Clock values, so it should be portable. |
14:19:37 | FromDiscord | <Rika> i think i'm obliterating my RAM with the way i use `Rope` (appending single bytes) |
14:20:53 | Araq | Rika: ropes are bad, don't use them |
14:22:19 | clyybber | The advantage of ropes are that its fast to prepend something right? |
14:22:43 | * | rockcavera quit (Remote host closed the connection) |
14:22:43 | FromGitter | <deech> Araq: Thanks! |
14:22:43 | FromDiscord | <Rika> my program starts slowing down when i use a regular string |
14:23:04 | clyybber | Rika: Maybe set the cap of the string? |
14:23:09 | FromDiscord | <Rika> clyybber, i cant verify if its the ropes that are making my program slow |
14:23:23 | Araq | only when ignore pretty much everything about current hardware, clyybber |
14:23:30 | FromDiscord | <Rika> clyybber, i cant exactly truncate it since i'm using it to hold image data |
14:25:37 | * | Hideki_ joined #nim |
14:28:57 | * | rockcavera joined #nim |
14:29:14 | * | PMunch quit (Remote host closed the connection) |
14:49:52 | FromDiscord | <Rika> okay replaced rope with seq, literally 1/10ths memory usage; i guess i totally abused rope |
14:52:52 | * | Vladar quit (Quit: Leaving) |
14:56:08 | FromGitter | <nixfreakz_twitter> var s = "hello, world" var s0 = char[0..3] , why doesn't this work ? |
14:56:29 | narimiran | what are you trying to do? |
14:56:38 | shashlick | @Araq - is it possible to generate a repr of the entire AST tree for a file |
14:56:41 | narimiran | `var s0 = s[0..3]` maybe? |
14:57:29 | FromGitter | <nixfreakz_twitter> var s = "Hello World." ⏎ var s0: char = s[0] # 'H' |
14:58:17 | FromGitter | <nixfreakz_twitter> https://github.com/nim-lang/Nim/wiki/Nim-for-C-programmers |
14:59:08 | FromDiscord | <Rika> nixfreakz_twitter, did you fix your problem? |
14:59:58 | FromGitter | <nixfreakz_twitter> fix ? |
15:00:19 | FromGitter | <nixfreakz_twitter> just wondering why I can't grab more than 1 char at a time |
15:00:23 | narimiran | you can |
15:00:29 | narimiran | i've written how to do it |
15:00:58 | FromGitter | <nixfreakz_twitter> oh so you can't use char then ? |
15:01:13 | narimiran | multiple chars aren't char, are they? |
15:01:15 | FromGitter | <nixfreakz_twitter> oh because its only 1 byte |
15:01:24 | FromGitter | <nixfreakz_twitter> yeah i'm stupid sorry |
15:01:29 | disruptek | shashlick: sure, just save an ast to a file. |
15:02:13 | shashlick | how do you get the current state of the full AST |
15:17:33 | * | laaron- joined #nim |
15:18:54 | * | alexander92 joined #nim |
15:19:32 | * | Hideki_ quit (Remote host closed the connection) |
15:21:01 | * | laaron- quit (Remote host closed the connection) |
15:21:32 | * | Hideki_ joined #nim |
15:27:35 | * | Kaivo quit (Ping timeout: 276 seconds) |
15:28:14 | * | Hideki_ quit (Ping timeout: 276 seconds) |
15:31:16 | * | Hideki_ joined #nim |
15:35:59 | * | Hideki_ quit (Ping timeout: 268 seconds) |
15:38:26 | * | narimiran quit (Ping timeout: 240 seconds) |
15:42:46 | * | clyybber quit (Quit: WeeChat 2.6) |
15:44:35 | * | Hideki_ joined #nim |
15:46:06 | * | Hideki_ quit (Remote host closed the connection) |
15:46:46 | * | Hideki_ joined #nim |
15:50:57 | * | Hideki_ quit (Ping timeout: 240 seconds) |
15:51:32 | Zevv | wrap all in a top level macro? |
15:52:56 | * | Hideki_ joined #nim |
15:54:10 | * | Hideki_ quit (Remote host closed the connection) |
15:54:34 | jken | Question re: nimble packaing |
15:54:39 | jken | I want to make use of this package: https://github.com/nimgl/imgui |
15:54:51 | * | Hideki_ joined #nim |
15:55:03 | jken | I installed it, added it to my nimble file as a requirement, and can import it and use symbols from it |
15:55:19 | jken | When I try to build, I get could not load: cimgui.so |
15:55:43 | jken | I assumed there was some imgui development package on my system (fedora) I needed to install |
15:55:47 | jken | but none exists |
15:56:19 | jken | is there an additional step to create shared objects for packages like this one? |
15:58:57 | * | Hideki_ quit (Ping timeout: 240 seconds) |
16:03:33 | shashlick | @Zevv i guess that's the only option |
16:06:09 | FromGitter | <deech> Is there a library for compile parsing of a CSV string that can be used with `staticRead`? |
16:09:10 | * | snooptek joined #nim |
16:10:46 | disruptek | jken: you'll need to build the imgui library. |
16:22:57 | jken | disruptek, seperately on my system or as part of my nimble project? |
16:23:11 | disruptek | on your system. |
16:26:10 | lqdev[m] | shashlick: what do I have to do when I specify -d:xxxStatic when using getHeader in nimterop? do I have to load the library somehow, or what? |
16:29:45 | disruptek | lqdev[m]: you need to link it into your executable. i think nimterop adds the args to do that, though. |
16:30:26 | lqdev[m] | the documentation mentions that it does .passL with the correct parameters, iirc |
16:30:43 | disruptek | is it getting linked in? |
16:33:39 | * | Hideki_ joined #nim |
16:35:03 | lqdev[m] | yeah! I'm surprised at how seamless that was |
16:35:32 | * | gangstacat quit (Quit: Ĝis!) |
16:35:40 | lqdev[m] | I only had to create a `const HeaderPath` because SDL.h is located in a different place in the source archive vs in /usr/include |
16:35:45 | lqdev[m] | but wow. it just works |
16:36:05 | shashlick | @lqdev - with -d:xxxStatic nimterop automatically adds a {.passL.} with the .a file |
16:36:18 | lqdev[m] | I thought I'd have to do some magic with cCompile and whatnot but I see that's not necessary :) |
16:36:31 | lqdev[m] | nimterop suddenly got even more amazing |
16:36:44 | * | gangstacat joined #nim |
16:37:20 | shashlick | the whole point is to delegate finding the header, finding/building the binary (static or dynamic) and then wrapping and linking |
16:37:28 | shashlick | nothing should be your problem but we are crawling there |
16:37:39 | shashlick | no more cCompile with getHeader |
16:38:35 | lqdev[m] | seems like everything is seamless |
16:38:59 | lqdev[m] | I should update my FreeType wrapper to use getHeader |
16:39:13 | lqdev[m] | I think they have build options for enabling/disabling different modules, but I'd have to check |
16:39:33 | lqdev[m] | one thing that's suspicious is how small the resulting executable is; how is it just 100kB? |
16:39:38 | lqdev[m] | DCE? |
16:40:59 | shashlick | no idea - how big is the .a file |
16:41:07 | shashlick | and what happens if you rename the .a file |
16:41:13 | shashlick | does exec still run |
16:41:32 | jken | disruptek, I got cimgui.so built.. tossed it in /usr/lib (had to name it libcimgui.so for ldconfig to see it), but no luck. |
16:41:33 | lqdev[m] | checking |
16:41:45 | jken | Having never done this before, am I missing something baic? |
16:41:46 | jken | basic*( |
16:42:03 | lqdev[m] | it's almost 20 MB (!) |
16:42:18 | * | dddddd joined #nim |
16:42:55 | shashlick | that makes no sense |
16:43:09 | shashlick | unless gcc is super smart or something |
16:43:20 | shashlick | and throws out all the code that isn't utilized |
16:43:21 | disruptek | jken: probably. is your compiler linking against it? you may need a {.passL: "-lcimgui".} somewhere. |
16:43:29 | lqdev[m] | is there a way of dumping passL params? |
16:46:04 | Zevv | Araq: i'm sure it's a codegen bug |
16:46:59 | Zevv | although I might violate semantics. I have a while with one case and a few bits in 'when' blocks. This breaks when I do {.computedGoto.} |
16:47:54 | jken | disruptek, I guess I assumed the nim imgui package handled that |
16:48:07 | jken | https://github.com/nimgl/imgui |
16:49:28 | disruptek | do the tests for nimgl/imgui work? |
16:49:49 | disruptek | are you on windows? |
16:49:57 | jken | disruptek, trying now, I am on linux |
16:50:14 | disruptek | it looks like it includes the imgui src. |
16:50:51 | jken | Both of their `gen` and `test` nimble tasks fail for me: https://paste.debian.net/1107741/ |
16:51:33 | * | clyybber joined #nim |
16:52:10 | jken | ah, missing git submodule |
16:52:20 | disruptek | i was about to say... |
16:52:34 | jken | alright, gen works |
16:52:37 | jken | test does not. |
16:52:48 | jken | https://paste.debian.net/1107742/ |
16:52:57 | * | Hideki_ quit (Ping timeout: 250 seconds) |
16:53:15 | disruptek | well, that test file doesn't exist. |
16:53:20 | shashlick | @lqdev - you can run nim with verbosity, it will print the compile/link commands |
16:53:36 | disruptek | probably just an old nimscript. try `nim c -r test/test.nim` |
16:53:47 | shashlick | also `--listCmd` makes it easier |
16:54:12 | jken | disruptek, closer, new error https://paste.debian.net/1107743/ |
16:54:57 | disruptek | you have nimgl/glfw installed? |
16:55:37 | jken | I have nimgl installed |
16:55:39 | * | clyybber quit (Client Quit) |
16:55:50 | lqdev[m] | shashlick: `gcc -o /home/daknus/Coding/Nim/rapid/src/rapid/lib/sdl2 /home/daknus/.cache/nim/sdl2_d/stdlib_system.nim.c.o /home/daknus/.cache/nim/sdl2_d/stdlib_times.nim.c.o /home/daknus/.cache/nim/sdl2_d/stdlib_os.nim.c.o /home/daknus/.cache/nim/sdl2_d/@msdl2.nim.c.o -lm -lrt /home/daknus/.cache/nim/nimterop/rapid_sdl2/buildcache/libSDL2.a -ldl` seems right to me |
16:55:53 | * | clyybber joined #nim |
16:58:29 | shashlick | are you building libSDL2 with nimterop? |
16:58:41 | disruptek | jken: that symbol is defined in nimgl HEAD. are you certain you have all that glfw stuff installed? |
16:59:03 | * | drewr quit (Ping timeout: 245 seconds) |
16:59:19 | lqdev[m] | shashlick: yeah |
16:59:27 | lqdev[m] | using getHeader |
16:59:33 | shashlick | with getHeader? oh that's nice 🙂 |
16:59:47 | jken | disruptek, as I understand it, its all packaged with nimgl |
16:59:58 | shashlick | how come not just using what's installed |
17:00:00 | jken | I am not using nimgl in my project though, I am using the opengl / sdl2 packages |
17:00:06 | shashlick | might be taking a while |
17:00:32 | disruptek | that test imports nimgl/glfw, which is where that symbol is defined... |
17:01:34 | * | nsf joined #nim |
17:02:02 | jken | disruptek, ✘ ~/.nimble/pkgs/nimgl-0.3.7/nimgl ls |
17:02:03 | jken | glfw.nim imgui imgui.nim opengl.nim private stb |
17:02:18 | shashlick | what's the biggest nimterop issue right now? am thinking of what to focus on next |
17:02:34 | disruptek | that release is prior to the rewrite, and prior to the composition of that test. |
17:02:45 | disruptek | (18 days ago versus 21 days ago) |
17:02:52 | lqdev[m] | shashlick: cOverride |
17:03:07 | lqdev[m] | it's a pain to use |
17:03:24 | jken | oh, let me install nimgl using the git link then, the directory is behind |
17:03:25 | shashlick | okay then i have to do what i have to do |
17:03:35 | disruptek | i think that will help. |
17:03:56 | lqdev[m] | shashlick: what is it? complete rewrite? |
17:04:10 | disruptek | shashlick is so effective that he has to ASK what remains to be done. |
17:04:28 | * | rockcavera quit (Ping timeout: 245 seconds) |
17:04:29 | jken | nimble install https://github.com/nimgl/nimgl.git grabs the same version (0.3.7) |
17:04:34 | jken | How do I specify HEAD? |
17:04:56 | disruptek | i dunno, i try not to use nimble. just clone it and then `nimble develop` inside. |
17:05:08 | jken | ah, ill do that. |
17:05:21 | jken | forgot about that feature |
17:05:25 | shashlick | @disruptek - no just prioritizing the 1000 known things still left 😛 |
17:05:29 | disruptek | i think there's a syntax for nimbling a git url. |
17:05:45 | shashlick | @lqdev - actually it isn't still clear to me how to pull it off |
17:05:58 | shashlick | cOverride ideally inserts the symbols at the spot where they show up in the tree |
17:06:12 | shashlick | but for that to work, nimterop should be able to recognize where those symbols are |
17:06:33 | shashlick | which means we need to add capability in nimterop to recognize what it doesn't recognize |
17:07:28 | shashlick | i'm thinking a catchall is possible but still not clear how to do it |
17:07:36 | jken | disruptek, gcc: error: private/glfw/src/vulkan.c: No such file or directory |
17:07:45 | jken | HEAD of nimgl might be broken? |
17:07:53 | * | Trustable joined #nim |
17:08:25 | disruptek | define glfwDLL |
17:09:07 | disruptek | you do have a libglfw.so.3 on your system, right? |
17:09:37 | disruptek | btw, i know nothing about this. i'm just reading the code pointed to by every error you yield. i don't even have nimgl installed and i've never used it. |
17:09:52 | lqdev[m] | shashlick: maybe keep a table of overriden symbols, and when a symbol is generated by cImport, check if its name is in the table. if that's true, replace the symbol's definition with the one mapped to the symbol's name in the table |
17:11:05 | shashlick | it doesn't help cause you want to use cOverride to typically add missing, skipped symbols |
17:11:12 | jken | I do have gldw |
17:11:15 | shashlick | overriding wrong ones is secondary |
17:11:15 | jken | glfw* |
17:11:41 | shashlick | and if that's the case, cImport never even finds that symbol cause that structure isn't recognized |
17:11:43 | lqdev[m] | hm |
17:12:19 | lqdev[m] | that's problematic |
17:13:37 | shashlick | what's a good example of something you want to override |
17:14:10 | lqdev[m] | SDL_GameControllerButtonBind |
17:14:31 | lqdev[m] | or, any nested struct |
17:21:41 | FromGitter | <Varriount> @deech Try NPeg |
17:21:47 | * | mrgaturus joined #nim |
17:25:01 | * | mrgaturus quit (Client Quit) |
17:28:50 | * | clyybber quit (Ping timeout: 268 seconds) |
17:31:50 | FromDiscord | <krab4t> npeg xD |
17:36:28 | * | clyybber joined #nim |
17:36:39 | FromDiscord | <krab4t> ` ('.*?'|".*?"|\S+) `can this pattern be written in npeg\peg expression? |
17:37:24 | leorize | yes |
17:37:25 | clyybber | Yeah |
17:37:47 | * | clyybber quit (Client Quit) |
17:37:56 | leorize | although that pattern is really flawed |
17:37:57 | * | clyybber joined #nim |
17:38:01 | leorize | oh wait nvm |
17:38:32 | clyybber | Why would it not? |
17:42:01 | leorize | aside from the unnecessary `?` it's a working pattern |
17:44:21 | FromDiscord | <krab4t> https://regex101.com/r/rYNemg/1 what `?` |
17:47:39 | FromGitter | <deech> FYI, Reading a CSV at compile time can be done with `parseCsv` using: ⏎ ⏎ ``` var p: CsvParser ⏎ p.open(newStringStream(s),"input")``` [https://gitter.im/nim-lang/Nim?at=5da8a93b894dee56e55e02e6] |
17:52:42 | * | xace quit (Quit: leaving) |
17:54:43 | krux02 | https://github.com/nim-lang/Nim/pull/12447 |
17:58:51 | jken | disruptek, I am slightly further ahead.. https://paste.debian.net/1107762/ |
17:59:05 | jken | I have libx11-devel and the x11@head nim package |
18:00:59 | * | letto quit (Quit: Konversation terminated!) |
18:02:04 | jken | ah.. part of libXCursor-devel on fedora |
18:02:54 | * | letto joined #nim |
18:04:10 | jken | aha! |
18:04:55 | jken | disruptek, solved the missing deps. I am now getting "could not load: cimgui.so" when compiling the nim imgui test as well! |
18:05:37 | disruptek | i guess that's good; try setting your LD_LIBRARY_PATH |
18:09:30 | jken | same error with that set to the path containing cimgui.so |
18:09:42 | * | nsf quit (Quit: WeeChat 2.6) |
18:11:56 | disruptek | when you `ldd` your binary, does it list a libcimgui.so target? |
18:12:47 | disruptek | oh, that's when building. i guess it's not successfully adding the -lcimgui? |
18:13:05 | jken | disruptek, it does not list libcimgui.so |
18:14:54 | disruptek | i'm surprised it can build a binary. |
18:15:08 | * | Jjp137 quit (Read error: Connection reset by peer) |
18:15:13 | disruptek | run your `nim c` with the --listCmd flag and see if there's a -lcimgui |
18:15:15 | * | krux02 quit (Remote host closed the connection) |
18:16:30 | * | Jjp137 joined #nim |
18:16:43 | jken | disruptek, nope, not listed there https://paste.debian.net/plain/1107766 |
18:17:01 | jken | Thats when compiling the test in the nim-imgui repo |
18:18:11 | clyybber | Araq: Which point did we miss? That its a breaking change? The breakage was not bad at all, for such a change |
18:18:29 | Araq | clyybber, ask federico3 about it then |
18:18:41 | disruptek | none of that breakage was news. |
18:18:59 | Araq | and my solution is better, deprecate the csize symbol, introduce csize_t |
18:19:07 | clyybber | And accumulate broken cruft |
18:19:12 | disruptek | he only knows about it because i ran into it with his lmdb wrapper. really not a big deal. clyybber submitted patches everywhere else. |
18:19:35 | Araq | yes, "accumulate broken cruft" that's what a deprecation process does |
18:19:53 | jken | disruptek, is nim-imgui broken, it should be passing that flag to gcc right? |
18:20:20 | disruptek | i'm not sure, i'm gonna look in the nimgl/imgui repo now. |
18:20:24 | clyybber | Araq: Well ok, but in the end we would remove size and be left with size_t which is ugly IMO |
18:20:45 | jken | I don't know a ton about how linking works, but I see this: |
18:20:45 | jken | {.pragma: imgui_lib, dynlib: imgui_dll, cdecl.} |
18:20:46 | lmariscal | Hi, disruptek and jken |
18:20:50 | jken | here: https://github.com/nimgl/nimgl/blob/master/src/nimgl/imgui.nim |
18:21:05 | disruptek | ah, he's your huckleberry. |
18:21:05 | Araq | it's as ugly as C's name, what's wrong with it |
18:21:09 | jken | hi lmariscal, I guess its your module in question isn;t it! |
18:21:20 | lmariscal | yep, got a notification about it |
18:21:30 | Araq | news: "after version 1.0, Nim removed its deprecation process because 'cruft'" |
18:21:39 | disruptek | you did define cimguiDll? |
18:22:00 | jken | did i? no. |
18:22:10 | Araq | come on, you have to agree with me. |
18:22:46 | disruptek | https://github.com/nimgl/imgui/blob/master/src/imgui.nim#L30 |
18:22:58 | lmariscal | if you are compiling nimgl/imgui in C you need to define cimguiDll |
18:23:08 | lmariscal | otherwise use CPP backend to build from source |
18:23:48 | jken | Where do I need to define it? |
18:24:16 | disruptek | start with `nim c -d:cimguiDll -r tests/something.nim` to see if it works. |
18:24:21 | lmariscal | in the compilation process `nim c -d:cimguiDll file.nim` |
18:24:46 | clyybber | Araq: Maybe we should put it in a when defined statement for backwards compatability |
18:24:47 | lmariscal | take note that cimgui.dll must be present at the same location where the program is running |
18:25:02 | disruptek | csize can turn into csize_t in nim 2.0. |
18:25:03 | lmariscal | and if you are running on windows remember to build the dll with visual studio |
18:25:14 | disruptek | he's on linux. |
18:25:27 | jken | lmariscal, on linux, will copy of cimgui.so and try that flag now |
18:25:52 | jken | throws the same error |
18:26:09 | lmariscal | are you using the same architecture in both builds? |
18:26:25 | clyybber | Araq: But anyways. The breakage was really not bad, not even in frederico's case according to disruptek |
18:26:33 | jken | lmariscal, yes, I built `cimgui.so` by cloning the cimgui repo and running `make` |
18:26:36 | * | ng0 quit (Ping timeout: 260 seconds) |
18:26:43 | jken | https://paste.debian.net |
18:27:20 | Araq | I don't understand the resistance, we have a deprecation process, it makes sense, now we could all work on something more important |
18:27:54 | lmariscal | jken you didnt put the full url |
18:28:02 | FromGitter | <awr1> what's wrong with csize? |
18:28:13 | jken | lmariscal, my bad! https://paste.debian.net/1107762/ |
18:28:14 | clyybber | Nothing, anymore :) |
18:28:19 | clyybber | awr1 |
18:28:26 | FromGitter | <awr1> what *was* wrong with csize then |
18:28:32 | clyybber | It was int |
18:28:33 | * | ng0 joined #nim |
18:28:36 | FromGitter | <awr1> oh |
18:28:58 | lmariscal | oh, you are missing some dev dependencies |
18:28:59 | FromGitter | <awr1> that always struck me as weird in C |
18:29:06 | Araq | (It also works much better as 'int'...) |
18:29:08 | lmariscal | let me share with you the ci packages |
18:29:08 | FromGitter | <awr1> that it wasn't equivalent to the pointer size |
18:29:35 | clyybber | Araq: Better would be suint :) |
18:29:35 | FromGitter | <nixfreakz_twitter> does asserts work in inim ? |
18:29:39 | Araq | (and after a decade somebody found a problem with it, but hey, let's spread some FUD about it really quickly and become drama queens) |
18:29:41 | FromGitter | <awr1> it's like uint32_t in amd64 right? |
18:30:14 | clyybber | awr1: Not sure what you mean? |
18:30:26 | clyybber | Its the size of a pointer I think |
18:30:36 | FromGitter | <awr1> i thought size_t in C was uint32_t for "weird reasons" |
18:30:42 | FromGitter | <awr1> even on amd64 |
18:30:46 | Araq | the size is fine, it's the signed/unsigned question |
18:30:50 | FromGitter | <awr1> feel free to correct me if i'm wrong |
18:30:51 | disruptek | it's the fact that it's uint. |
18:31:14 | jken | lmariscal, oh thanks, how did you catch tha? |
18:31:15 | jken | that* |
18:31:38 | * | lritter quit (Ping timeout: 240 seconds) |
18:31:58 | lmariscal | `sudo apt-get -y install build-essential libglu1-mesa libglu1-mesa-dev libgl1-mesa-glx libgl1-mesa-dev xorg-dev libx11-dev` is what I use in other ci building with glfw too |
18:32:22 | clyybber | awr1: I don't know about arm64, but as Araq said it was signed, and now its unsigned, like in C |
18:32:35 | Araq | look, even if I agree with you that csize is "super wrong" it is what it is and we can have a deprecation process, easily |
18:32:39 | lmariscal | jken because the missing header was based in X11 |
18:32:50 | Araq | just like we do it for everything else... |
18:32:57 | federico3 | clyybber: different wrappers generated with c2nim use csize and the code broke with the change |
18:33:03 | FromGitter | <awr1> !echo {.emit: "int x = sizeof(size_t);".}; var x: {.importc.} cint; echo(x) |
18:33:04 | jken | lmariscal, oh damn, I am sorry, I had pasted the wrong URL again |
18:33:08 | jken | I have resolved the missing X11 header. |
18:33:14 | FromGitter | <awr1> !eval {.emit: "int x = sizeof(size_t);".}; var x: {.importc.} cint; echo(x) |
18:33:16 | NimBot | Compile failed: /usercode/in.nim(1, 45) Error: expression expected, but found '{.' |
18:33:26 | clyybber | Araq: Yeah, I agree. But the change has been done and the ecosystem adapted, so I think its a bad idea to revert it now. |
18:33:42 | jken | lmariscal, this is what I intended to show: https://paste.debian.net/plain/1107770 |
18:33:44 | Araq | we have about 1000 Nimble packages |
18:33:45 | jken | sorry about that |
18:33:56 | FromGitter | <awr1> ...do pragmas not work for nimbot? |
18:34:07 | Araq | "the ecosystem adapted" ... no, it didn't. |
18:34:19 | disruptek | clyybber: he's making a lot of noise considering he's the one that merged it, huh? |
18:34:29 | FromGitter | <awr1> !eval {.pragma: foo, importc.} |
18:34:31 | NimBot | <no output> |
18:34:59 | disruptek | clyybber adapted some of the obvious breakage, and afaik, i'm the only one impacted outside that group. |
18:35:04 | federico3 | now we cannot use csize in a backward compatible way |
18:35:11 | FromGitter | <awr1> !eval {.emit: "/*VARSECTION*/int x = sizeof(size_t);".}; var x: {.importc.} cint; echo(x) |
18:35:11 | clyybber | You can |
18:35:13 | NimBot | Compile failed: /usercode/in.nim(1, 59) Error: expression expected, but found '{.' |
18:35:17 | lmariscal | jken, could you please test please with the cpp backend first? |
18:35:20 | clyybber | frederico3: You can |
18:35:27 | disruptek | it just happens that the two wrappers i need were affected and aren't in important packages. |
18:35:30 | FromGitter | <awr1> sigh |
18:35:34 | Araq | disruptek, I consider it my strength to change my mind, we already have more than enough zealots in IT. |
18:35:46 | disruptek | it's your perogative. |
18:36:01 | lmariscal | if not the so loading is the issue which could be caused by architecture or different compilers |
18:36:03 | disruptek | pointless to blame anyone, though. |
18:36:24 | Araq | I'm not blaming anyone |
18:36:31 | Araq | I'm trying to convince clyybber. |
18:36:41 | jken | lmariscal, test does run on the cpp backend |
18:36:57 | FromGitter | <awr1> lol i even went to glot.io to try doing in plain C++ and it gives me some error with posix_spawn |
18:37:10 | clyybber | I am convinced that I could have done better, though IMO with a when defined thing, but I also think that reverting it now would be a very bad move |
18:37:26 | Araq | but why would it be a bad move? |
18:37:30 | clyybber | Because it would cause breakage to the packages that have adapted |
18:37:30 | FromGitter | <awr1> k i'm wrong so whatever |
18:37:33 | jken | I wonder if my project will compile on the cpp backend |
18:37:57 | lmariscal | jken it was just a test you should be able to compile in your prefered backend |
18:38:11 | disruptek | shades of the 1.0-http-headers issue... |
18:38:26 | Araq | clyybber, unfortunately I don't know yet as appveyor is still running |
18:38:35 | jken | lmariscal, looks like my project runs fine on the cpp backend, so I am not dead in the water in the mean time |
18:38:42 | FromGitter | <awr1> since people are talking about cpp backend this is a good time to bring up my RFC |
18:38:45 | FromGitter | <awr1> again |
18:38:46 | FromGitter | <awr1> https://github.com/nim-lang/RFCs/issues/152 |
18:38:50 | * | fichtl quit (Ping timeout: 240 seconds) |
18:39:09 | disruptek | i can't support cpp until exceptions are fixed. |
18:39:20 | lmariscal | okay okay, sorry if I couldnt help that much but the issues seems to be with the dynamic library and I dont have that much experience with linux |
18:39:46 | disruptek | awr1: https://github.com/nim-lang/Nim/issues/11081 |
18:39:51 | clyybber | Araq: Cligen is gonna fail. Maybe not in the CI, but cblake has done some changes internally like `var something: csize = 1'u` I think. |
18:40:01 | jken | lmariscal, thank you for your time, If I make any headway on the issue ill open an issue in the nimgl repo |
18:40:15 | disruptek | yes, there's an adapted cligen. |
18:40:26 | jken | I am using just the imgui package with nims opengl and sdl2 packages, maybe a special case |
18:40:30 | jken | rather than using nimgl |
18:40:53 | Araq | clyybber, that means cligen doesn't work with 1.0.0 then |
18:40:58 | * | sschwarzer joined #nim |
18:41:03 | disruptek | current cligen doesn't, no. |
18:41:10 | Araq | so already it must be changed, packages should work with 1.0.0 |
18:41:25 | clyybber | Araq: Not @#head |
18:41:30 | clyybber | IMO |
18:41:31 | disruptek | 0.9.38 works fine. it's a nimble issue, not a csize issue. |
18:41:34 | FromGitter | <awr1> part of what i raised in the RFC @disruptek is to put more attention on the C++ backend in general so these bugs + future bugs would be caught sooner |
18:41:46 | disruptek | awr1: i don't disagree. |
18:41:50 | lmariscal | jken people should use it with what they prefer so it's okay, just double check that your .so is compiled the same as the nim code |
18:42:33 | disruptek | probably c-blake shouldn't have cut it as a patch bump, fwiw. |
18:43:23 | clyybber | IMO nimble should allow pkg's to provide newer versions only for newer Nim versions |
18:43:28 | disruptek | to me, cligen is a perfect example of a package that should replace existing stdlib solutions. |
18:43:34 | jken | lmariscal, what do you mean compile the same? same arch? |
18:43:37 | clyybber | cligen is awesome |
18:43:50 | clyybber | And cblake puts in so much thought into every single issue |
18:44:07 | disruptek | yeah, he really went above and beyond for me on my `--` problem. |
18:44:27 | lmariscal | jken yep, same arch and same compiler sometimes nim picks on its own |
18:45:11 | jken | lmariscal, maybe that's it, I just ran `make` in the imgui repo and didn't pick a compiler |
18:45:23 | jken | cimgui repo* |
18:45:45 | disruptek | clyybber: nimble should allow pkgs to provide newer versions only for newer Nim versions? |
18:46:34 | jken | Not really that familier with makefiles, but I assume $(CXX) evaluates to the systems default compiler? |
18:46:59 | disruptek | it lets you override the C++ compiler of choice. |
18:47:02 | sschwarzer | I just found out I _can_ run a binary with arguments with `nimble run mybinary [args]`. However, when I specify the `--help` option for my program, this causes `nimble` to print its help instead of calling my program with _its_ `--help` option. :-D |
18:48:04 | disruptek | nimble needs a `--` too, i guess. |
18:48:11 | * | alexander92 quit (Ping timeout: 246 seconds) |
18:48:46 | FromGitter | <awr1> @disruptek the DateTime issue is related to inheritance, i fiddled around with it just now |
18:49:13 | jken | lmariscal, can confirm both are built with gcc |
18:49:46 | Zevv | is there a way for templates to de a kind of literal in place copy, c-preprocessor style? I have a chunk of code I want to be out of the way, but I don't want to pass tons of variables or state into the template. |
18:49:46 | FromGitter | <nixfreakz_twitter> wow asserts are great for testing |
18:50:13 | FromGitter | <awr1> {.dirty.} is the closest thing |
18:50:25 | Zevv | hm ok |
18:50:32 | FromDiscord | <willyboar> Hello everyone. Is there a way to take all the filenames from all the files inside a folder? |
18:50:57 | lmariscal | jken https://unix.stackexchange.com/questions/22926/where-do-executables-look-for-shared-objects-at-runtime |
18:51:21 | lmariscal | so maybe try moving cimgui.so to `/usr/lib` ? |
18:51:53 | jken | lmariscal, thats where I started |
18:51:54 | FromGitter | <awr1> @willyboar `import std / [sequtils, os]; echo(walkDir(CurDir).toSeq())` |
18:52:12 | lmariscal | hmmm now I'm lost too |
18:52:18 | jken | lmariscal, ldconfig does not see it if I just drop it in /usr/lib, but if I call it libcimgui.so ldconfig does list it |
18:52:29 | jken | but either way, the application can't find cimgui.so |
18:52:58 | lmariscal | try naming it libcimgui.so in the path where the test is executed? |
18:53:41 | jken | no dice, with or without LD_LIBRARY_PATH set to the current dir |
18:53:44 | FromGitter | <awr1> @lmariscal you need to modify rpath |
18:54:19 | lmariscal | @awr1 jken is the one with the issue tbh I'm guessing here I don't really use linux for development |
18:54:27 | FromGitter | <awr1> sorry |
18:54:47 | FromGitter | <awr1> @jken use `{.passC: "-Wl,-rpath,'$ORIGIN".}` |
18:54:55 | FromGitter | <awr1> and then you can put it in the same folder |
18:55:01 | jken | Without knowing anyhing about it, does modifying the rpath effect what `ld ./theBinary` lists? |
18:55:17 | FromGitter | <awr1> uhhhh |
18:55:40 | FromGitter | <awr1> i don't think so |
18:55:43 | FromGitter | <awr1> you can check though |
18:55:56 | FromGitter | <awr1> all it does is add a search path on top of usr/lib |
18:57:23 | jken | awr1, where do I need to add that? In my project that consumes lmgui or in lmgui itself? |
18:58:11 | FromGitter | <awr1> you can do it anywhere in the project. |
18:58:18 | FromGitter | <awr1> alternatively you can do it in the cfg file |
18:59:21 | FromGitter | <awr1> actually i think $ORIGIN is missing a single quote after |
19:00:23 | jken | awr1, I prepended that to test.nim (with the missing single quote) but no dice. |
19:00:41 | jken | The built binary still says `could not load: cimgui.so` despite it being in the same dir |
19:01:28 | sschwarzer | Ok, I entered a ticket https://github.com/nim-lang/nimble/issues/725 |
19:11:58 | FromDiscord | <willyboar> @awr1 Thank you. But doesn't work. |
19:12:58 | FromGitter | <nixfreakz_twitter> Stupid question? why are you able to override this ? |
19:13:00 | FromGitter | <nixfreakz_twitter> proc genHello(name: string, surname = "Doe"): string = ⏎ "Hello " & name & " " & surname ⏎ assert genHello("Peter") == "Hello Peter Doe" ⏎ assert genHello("Peter", "Smith") == "Hello Peter Smith" [https://gitter.im/nim-lang/Nim?at=5da8bd3c809de9699f55e85a] |
19:13:02 | * | EvilKhaosKat joined #nim |
19:13:34 | shashlick | @lqdev - i figured it out |
19:16:16 | * | alexander92 joined #nim |
19:16:41 | clyybber | disruptek: Yeah thats what I meant, my wording is broken. |
19:17:33 | * | EvilKhaosKat quit (Quit: Leaving) |
19:18:22 | disruptek | that sounds kinda tough on people who want to use a stable nim. |
19:18:47 | clyybber | They can upgrade through some flag? |
19:18:55 | clyybber | But its opt-in? |
19:19:03 | clyybber | Or let the pkg maintainer decide |
19:19:18 | disruptek | well, the pkg maintainer already has the means to do that. |
19:19:25 | clyybber | Oh, how? |
19:19:36 | disruptek | ie. c-blake coulda made 0.9.39 require 1.0.2 ... |
19:19:50 | disruptek | requires "nim >= ..." |
19:20:07 | clyybber | Ah, sure... |
19:20:22 | clyybber | I wonder if nimble honors that |
19:20:31 | disruptek | it's easier to just check NimVersion in your code and `when` an aliased type accordingly, though. |
19:21:42 | * | EvilKhaosKat joined #nim |
19:22:09 | * | EvilKhaosKat quit (Client Quit) |
19:22:31 | * | EvilKhaosKat joined #nim |
19:26:48 | shashlick | dang - `Error: the resulting AST is cyclic and cannot be processed further` |
19:27:00 | shashlick | @Araq - where do you even start debugging that |
19:28:10 | disruptek | i have a similar problem with the vm loop interations limit. |
19:28:30 | jken | disruptek, lmariscal, I keep coming back to the fact that `ldd ./theBinary` should list libimgui.so as a shared object. |
19:29:36 | jken | and {.push dynlib: imgui_dll, cdecl, discardable.} should make that happen |
19:29:42 | jken | but I am making many assumptions |
19:29:50 | shashlick | plus doesn't look like I can have a ref object created at compile time |
19:29:51 | disruptek | only thing i can think of is that the linker isn't linking it because you aren't accessing the symbols. otherwise, i dunno how you could even create a binary. |
19:30:26 | disruptek | shashlick: what do you think NimNodes are? |
19:32:00 | shashlick | i mean create a `const`of type ref object that can be used at runtime |
19:32:53 | clyybber | how would that work? |
19:32:55 | disruptek | you could copy the value of a const to a ref at runtime. |
19:33:01 | * | EvilKhaosKat quit (Quit: This computer has gone to sleep) |
19:33:24 | clyybber | A ref is a ptr to somewhere, that somewhere doesn't exist at compiletime. |
19:33:49 | clyybber | And if it does, it doesn't at runtime |
19:33:57 | disruptek | yes, but he could alloc it on the heap at runtime and then just copy the const over it. |
19:34:03 | clyybber | Yeah |
19:34:05 | shashlick | i understand, i got away another time by getting rid of the ref |
19:34:14 | disruptek | heh |
19:34:18 | shashlick | but this time, it is a recursive object |
19:34:25 | shashlick | and cannot avoid the ref |
19:34:44 | shashlick | i'd rather create it at compile time since all info is known |
19:35:00 | clyybber | But you can't create a ref at compile time. |
19:35:03 | disruptek | you could create a type of the same size but w/o the cycle. |
19:35:03 | lmariscal | jken, I am currently in class but will make some tests in the afternoon with Linux |
19:35:07 | clyybber | Not for use at runtime |
19:35:17 | clyybber | shashlick: Can you give a code example? |
19:35:35 | jken | lmariscal, I am happy to help, I'll be around into the evening (afternoon for you likely) |
19:35:38 | shashlick | https://github.com/nimterop/nimterop/blob/master/nimterop/globals.nim#L44 |
19:35:59 | shashlick | just the nimterop Ast pattern object i create out of grammar.nim |
19:36:56 | disruptek | you're gonna have to encode it somehow and then reconstitute it. |
19:37:49 | disruptek | in particular, that proc ref will never fly. 😁 |
19:38:26 | shashlick | true that, meh |
19:38:37 | shashlick | i need more speed |
19:38:57 | shashlick | nimterop does too many things so toast needs to get some optimization love |
19:39:13 | disruptek | how did it go with your nimterop documentation effort? |
19:40:03 | shashlick | got pulled back into coding by @lqdev - all his fault |
19:40:12 | shashlick | made a bunch of good fixes |
19:40:20 | shashlick | figured out cOverride also so times are good |
19:40:40 | disruptek | i do wish you pushed releases more often. |
19:41:49 | clyybber | nimterop is especially worth it for cpp wrapping right? |
19:41:59 | shashlick | nimterop doesn't know cpp yet |
19:42:07 | shashlick | but it can use c2nim so it does |
19:42:21 | clyybber | Oh, well c2nim doesn't *really* either |
19:43:11 | shashlick | i think some of my biggest concerns are getting addressed now so i might get to c++ faster than I thought |
19:43:18 | shashlick | oh ya, another big hump is nested structs |
19:43:30 | shashlick | some idiots write triple nested crap |
19:43:48 | shashlick | too lazy to think up a symbol name? |
19:43:49 | FromDiscord | <krab4t> Zevv, any ideas why PlayEffect len is 3 https://i.imgur.com/NwgA6Ax.png |
19:45:04 | lqdev[m] | krab4t: the > in your Bool rule is unnecessary |
19:45:44 | FromDiscord | <krab4t> now it works |
19:46:14 | clyybber | shashlick: Does treesitter even go that deep? |
19:46:39 | shashlick | Ya it tells me everything I need to know |
19:46:44 | shashlick | At least so far |
19:46:54 | disruptek | it's pretty cool. |
19:47:23 | shashlick | We can easily add simple wrapping of rust and go as well |
19:47:47 | shashlick | Just a question of time |
19:48:15 | clyybber | Huh, really surprises me. |
19:48:33 | disruptek | standing on the shoulders of giants. |
19:48:43 | clyybber | Such a wonderfull abuse of a poor shy linter |
19:49:11 | clyybber | It is used for linting, right? |
19:49:26 | clyybber | And code highlighting? |
19:49:30 | disruptek | yeah. |
19:49:37 | clyybber | Poor treesitter |
19:50:01 | clyybber | just wanted to sit on a tree, now trees of wrappers grow on him.. |
19:50:07 | disruptek | lol |
19:50:13 | FromDiscord | <exelotl> sitting on the branches of trees |
19:50:19 | disruptek | at least these trees don't have any symbolic links. |
19:50:33 | disruptek | oh wait. |
19:50:45 | clyybber | we have refs guddamnit |
19:50:48 | clyybber | and pointers |
19:50:53 | disruptek | shhh. don't let araq hear. |
19:51:27 | clyybber | btw, Araq. I'm kinda stuck on my default object fields thing |
19:52:53 | clyybber | I don't know how to generate field accesses for locs whose lodes are object constructors, aka the locations of expressions like `somefunction(SomeTempObjExpressionThing(v: 1))` |
19:53:18 | shashlick | @disruptek how often should I release |
19:53:36 | shashlick | Tagging is boring |
19:54:02 | disruptek | whenever you believe the quality is insignificantly worse and the features have gone up. |
19:55:02 | clyybber | shashlick: Not at all :p stability first |
19:55:02 | disruptek | it's boring, but it's very useful not just for you, but for others. i release all the time. |
19:55:26 | disruptek | if no one can run your code, no one can give feedback. |
20:03:18 | disruptek | when i get comfortable with libgit i'll write a tagger that'll bump a package and push it out, etc. |
20:03:26 | disruptek | it annoys me, too. |
20:03:37 | * | nsf joined #nim |
20:05:17 | shashlick | that will be great |
20:05:24 | shashlick | i'm lazy |
20:05:55 | shashlick | okay more design questions |
20:06:09 | shashlick | so now nimterop can detect what it doesn't know to wrap |
20:06:39 | shashlick | i can get the symbol name and am thinking of using cPlugin as the way to allow wrappers to specify what that should look like |
20:07:02 | shashlick | and cOverride can stay the way it is |
20:07:06 | shashlick | any concerns? |
20:07:13 | shashlick | cc @lqdev |
20:08:46 | lqdev[m] | how do you specify how the generated code should look like? `NimNode`s? |
20:09:01 | disruptek | you supply a proc. |
20:10:15 | shashlick | btw 0.2.1 is released |
20:10:30 | shashlick | so just like onSymbol, you would type out the code you want |
20:10:32 | disruptek | we would supply a predicate that you run on the symbol name? |
20:10:48 | shashlick | yep |
20:10:58 | disruptek | hmmm. |
20:11:57 | disruptek | what's the use-case this solves? libsdl2? |
20:12:17 | shashlick | pretty much any case where nimterop doesn't know yet how to wrap something |
20:12:27 | shashlick | so you can define it for the near term |
20:12:36 | shashlick | or you can override an existing wrapping that is wrong |
20:12:47 | disruptek | oh, i see. but on a symbol-by-symbol basis. |
20:12:54 | * | narimiran joined #nim |
20:13:07 | shashlick | see https://github.com/nimterop/nimterop/issues/133#issuecomment-509921054 for why |
20:13:51 | shashlick | we can use onSymbol itself |
20:14:13 | disruptek | probably onSymbol can just call some pattern generators, so it won't be too complex. |
20:14:36 | disruptek | i guess you'll figure out how that should work once you have a few more failures to twiddle with. |
20:14:56 | shashlick | i've run into a bunch already and quickly found cOverride to be useless for more complex stuff |
20:15:10 | shashlick | symbols inevitably refer to other symbols |
20:15:14 | shashlick | so context is important |
20:16:02 | disruptek | yeah, but do you have a sense for a pattern to the failure? i imagine crafting these different onSymbols would turn my brain to mush pretty quickly. |
20:16:33 | disruptek | i mean, we're talking about forms that you already can't parse... 😦 |
20:17:16 | shashlick | https://play.nim-lang.org/#ix=1YZf |
20:17:42 | shashlick | right now, the limitations are triple pointers (pcre has that), or multi-dimensional arrays, can only do since dimensional now |
20:17:43 | disruptek | hey man, if you supply the cool macros, i'm all in. 😀 |
20:17:53 | disruptek | problem is writing those in the first place... |
20:18:15 | shashlick | ya see that's the thing - if you really really want everything wrapped then life's hard |
20:18:28 | shashlick | but if you get most of it and those that you absolutely need you hand write |
20:18:36 | shashlick | or perhaps even use c2nim since it's smarter |
20:19:10 | shashlick | that's my approach to all this |
20:19:59 | disruptek | well, it seems sensible to me; i've just been too intimidated by my attempts. |
20:20:34 | disruptek | i do some similar stuff in openapi. |
20:21:06 | disruptek | you can specify the identifier to a proc that you want it to use instead of whatever's built in, ie. because you Know Things. |
20:21:24 | * | clyybber quit (Quit: WeeChat 2.6) |
20:23:43 | Araq | clyybber: I dunno about the implementation problems but in theory you require CaseObject(disc: x) construction so that the defaults are known at runtime at construction |
20:24:05 | Araq | since 0.20 we already pretty much require this anyway |
20:24:14 | disruptek | and it's annoying. |
20:24:20 | Araq | and he left... oh well |
20:24:48 | disruptek | it's sad that i have to case: ... a long ladder of newObj(kind: constant) ... since 0.20. |
20:25:09 | disruptek | s/case:/case mykind:/ |
20:26:51 | disruptek | shashlick: i can't build current nimgit2 because i have no getProjectCacheDir. do i need a new nimble now? |
20:27:50 | shashlick | just latest nimterop |
20:28:06 | Araq | disruptek: it improved by a patch from GULPF |
20:28:07 | disruptek | i guess nimgit2 needs a bump, then. |
20:28:20 | Araq | if you play it nice with range types you can cut some boilerplate |
20:28:22 | disruptek | Araq: recently merged? |
20:28:30 | shashlick | nimgit2 points to nimterop#head |
20:28:34 | Araq | I think so |
20:29:09 | disruptek | i thought jasper was gonna improve this. |
20:29:36 | * | Hideki_ joined #nim |
20:29:38 | FromDiscord | <krab4t> its possible to record execution time? inside a program? windows probably doesnt have linux's `time` |
20:29:49 | disruptek | getTime |
20:30:02 | FromDiscord | <krab4t> perfect |
20:30:11 | disruptek | https://github.com/nim-lang/Nim/pull/11432 |
20:32:29 | disruptek | this doesn't help me, but it's interesting because it demonstrates two variants that share the same field name. |
20:34:23 | * | Hideki_ quit (Ping timeout: 276 seconds) |
20:35:18 | * | narimiran quit (Remote host closed the connection) |
20:41:04 | * | nsf quit (Quit: WeeChat 2.6) |
20:41:17 | sschwarzer | disruptek: I also use something like that in my code, but it's restricted to simple cases. I'd very much like to see this generalized: https://github.com/nim-lang/RFCs/issues/19 |
20:43:06 | disruptek | but this is apparently legal: https://github.com/nim-lang/RFCs/issues/19#issuecomment-162621403 |
20:43:56 | disruptek | araq's proposal makes the most sense to me. |
20:44:38 | * | NimBot joined #nim |
20:44:40 | sschwarzer | disruptek: It's possible as long as the same name isn't listed in several variants. |
20:44:56 | Araq | oh wow I did something right ;-) |
20:45:29 | disruptek | well, they can't be in duplicate case blocks, right? but you also cannot repeat clauses, which means that you can merely make two kinds identical. |
20:45:36 | disruptek | er, N kinds. |
20:45:40 | sschwarzer | Although I like the syntax with the repeated fields slightly more, I'm fine with either syntax. |
20:46:30 | disruptek | the only benefit i can see is tagging the field differently depending upon the kind, eg. exporting it for one kind and not another, or adding a pragma. |
20:46:43 | disruptek | i think these are probably bad reasons to permit that syntax, though. |
20:48:42 | disruptek | i use krux02's pattern and it's not just too verbose, it's confusing. |
20:49:18 | lqdev[m] | shashlick: nimterop doesn't wrap this properly: http://hg.libsdl.org/SDL/file/default/include/SDL.h#l78 |
20:50:42 | * | xace joined #nim |
20:51:03 | * | xace quit (Client Quit) |
20:51:58 | lqdev[m] | this isn't wrapped too http://hg.libsdl.org/SDL/file/default/include/SDL_keycode.h#l342 |
20:53:15 | * | xace joined #nim |
20:53:21 | * | xace quit (Client Quit) |
20:53:54 | shashlick | what's the error? |
20:56:05 | lqdev[m] | none, it's just not present |
20:56:47 | FromDiscord | <krab4t> so its like around 30 milliseconds for 5077 lines (6955 with comments) |
20:57:17 | shashlick | can you please log it? |
20:57:28 | lqdev[m] | how can I log it? |
20:57:31 | disruptek | krab4t: https://github.com/disruptek/golden why guess? 😀 |
20:57:39 | * | sschwarzer quit (Quit: leaving) |
21:00:13 | FromDiscord | <krab4t> disruptek, > You will need to install LMDB. On Windows? nope |
21:00:29 | shashlick | sorry please create an issue so that i can look at it separately |
21:01:15 | lqdev[m] | I also noticed that `nim check` is painfully slow with this wrapper. guess that's because SDL is way bigger than GLFW |
21:01:33 | lqdev[m] | is there any way I could improve `nim check` speeds? |
21:01:53 | disruptek | krab4t: it was more of a joke than a recommendation. 😉 |
21:02:03 | disruptek | at least you don't have to worry about symbolic links. |
21:03:06 | FromDiscord | <krab4t> disruptek, from getTime in milliseconds, fastest 27, slowest 45, no idea why > windows |
21:03:56 | disruptek | yes, you do have an idea why. |
21:07:52 | shashlick | lqdev - are you manually running nim check? |
21:24:03 | * | solitudesf quit (Ping timeout: 264 seconds) |
21:33:10 | * | asymptotically quit (Quit: Leaving) |
21:38:05 | * | xace joined #nim |
21:38:40 | lqdev[m] | shashlick: no, the Nim VS Code plugin does so on save |
21:39:02 | lqdev[m] | so I see errors way later than I could |
21:39:53 | lqdev[m] | I guess I'll have to split up my SDL wrapper into multiple files. Should be easy enough to do, I just need to cImport different parts |
21:40:47 | * | ng0 quit (Quit: Alexa, when is the end of world?) |
21:44:28 | * | nif quit (Quit: ...) |
21:44:37 | * | nif joined #nim |
22:01:49 | * | Trustable quit (Remote host closed the connection) |
22:02:46 | FromGitter | <awr1> hi @willyboar this should work |
22:02:49 | FromGitter | <awr1> `import std / [sequtils, os]; echo(toSeq(walkFiles("*")))` |
22:05:37 | FromGitter | <awr1> @jken i made a mistake with the rpath thing |
22:05:42 | FromGitter | <awr1> use passL, not passC |
22:06:03 | FromGitter | <awr1> hope that helps |
22:09:47 | FromGitter | <awr1> @krab4t what you want is https://nim-lang.org/docs/times.html#cpuTime |
22:10:41 | FromGitter | <awr1> more appropiate for benchmarking than getTime() |
22:12:10 | disruptek | not if what you want to know is how long it takes. |
22:12:52 | FromGitter | <awr1> i'm not sure what you mean. |
22:13:14 | FromGitter | <awr1> you hit cpuTime() at one location, and then you hit it again and subtract the two |
22:13:28 | disruptek | then what? |
22:13:34 | FromGitter | <awr1> you get the time? |
22:13:44 | FromGitter | <awr1> duration rather |
22:15:35 | FromGitter | <awr1> you can even do something like `template benchmark(code: untyped): untyped = var start = cpuTime(); code; echo("took ", cpuTime() - start, " seconds")` |
22:15:54 | FromDiscord | <krab4t> CPU time [s] 0.029 --opt:speed |
22:16:12 | FromDiscord | <krab4t> CPU time [s] 0.053 --opt:size |
22:17:19 | FromDiscord | <krab4t> CPU time [s] 0.14 in vscode 😱 |
23:00:25 | * | Hideki_ joined #nim |
23:15:06 | * | Hideki_ quit (Remote host closed the connection) |
23:15:51 | * | Hideki_ joined #nim |
23:20:57 | * | Hideki_ quit (Ping timeout: 268 seconds) |
23:46:39 | * | Hideki_ joined #nim |