<< 17-10-2019 >>

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:53FromDiscord<Chiqqum_Ngbata> Ideas? https://pastebin.com/2evDPxMv
05:27:54narimirangive your template a name
05:37:35*Hideki_ joined #nim
05:40:56FromDiscord<Chiqqum_Ngbata> It has a name. Unrelated
05:42:11*Hideki_ quit (Ping timeout: 265 seconds)
05:54:52*krux02 joined #nim
06:15:34FromGitter<dumjyl> Gensymed symbols don't work with exportc. They don't make much sense. Use a dirty template or inject the var.
06:16:01FromGitter<dumjyl> https://play.nim-lang.org/#ix=1YV0
06:17:01Araqyeah but we should fix that, it's a one line fix in the compiler...
06:20:10Araqomg! it's green!
06:20:19Araqin the end, it was a silly typo...
06:21:29leorizeAraq: is gc:destructors gonna require an external gc?
06:21:37Araqyes
06:22:17leorizeis there any plans to base the current gcs on top of it? so that we can have destructors-based strings/seqs?
06:23:30Araqit depends on the GC
06:24:00Araq--gc:refc makes little sense with destructors as the destructors do what the "refcounting" did, but much better
06:24:30leorizebut currently we don't have move optimizations without destructors, right?
06:24:43FromGitter<gogolxdong> could not load: libpcre.so(.3|.1|) ⏎ compile with -d:nimDebugDlOpen for more information nim playground
06:24:48Araq--gc:markAndSweep + destructors is like Yin and Yang
06:25:12Araqwork really well and it's the same algorithm that "araqsgc" uses
06:25:17FromGitter<gogolxdong> aha, you know Yin and Yang?
06:25:43livcdAraq i need help. Can you help me ? *sadface*
06:25:53Araqwell I know the symbol, gogolxdong
06:26:09Araqleorize, that's correct...
06:26:17Araqlivcd, ok
06:26:24FromGitter<gogolxdong> It's the essential of the universe.
06:27:23FromGitter<gogolxdong> My icon is Taiji which is composed with Yin and Yang.
06:27:31livcdSo this unchecked pragma was removed: https://github.com/coffeepots/odbc/blob/master/odbc/odbcparams.nim#L13
06:28:05FromGitter<gogolxdong> @PMunch ⏎ nim playground could not load: libpcre.so(.3|.1|)
06:28:37livcdIf i remove it i get an undeclared identifier: 'Time' https://github.com/coffeepots/odbc/blob/master/odbc/odbcfields.nim#L99
06:29:27leorizeAraq: are closures iterator working on newruntime?
06:29:49FromGitter<gogolxdong> Can you fix it?
06:30:03leorizehe's not online atm @gogolxdong
06:30:38leorizeyou 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:59FromGitter<gogolxdong> good.
06:31:29FromDiscord<Chiqqum_Ngbata> Nice, with dirty and inject I've got something compiling. Still have a segfault unfortunately
06:34:58Araqlivcd, remove the full UncheckedArray declaration, it's in system.nim now
06:35:01ZevvI 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:25Zevvany ideas if this can be caused by me doing something wrong?
06:37:29Zevv(probably, but still)
06:41:25AraqZevv, it's probably something else, run in valgrind :P
06:41:33Araqleorize, closure ir
06:41:50Araqiterators have been ported but I doubt they work
06:42:12leorizeyea, I've just crashed it and opened an issue
06:42:44livcdAraq: ah ok I also had to import Times in that module. My bad. Thanks
06:43:48Araqleorize, at this point I'm quite convinced --gc:destructors will win.
06:44:24Araqit's simpler than 'owned' and works with the existing Nim
06:45:13leorizeis it also faster? :p
06:45:47*PMunch joined #nim
06:46:13Araqit's quite identical
06:48:31leorizethat's nice
06:48:47leorizeare we getting a default gc based on --gc:destructors as well?
06:50:02Araqif you tell me how to setup the command line interface...
06:50:25Araqit'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:45leorizenever too late for a new switch :p
06:59:01Zevvwell, 1.0 is out so rename all that stuff before someone notices!
07:00:00*gmpreussner_ quit (Quit: kthxbye)
07:00:43Araqwhat makes most sense is now --mms:shared/threadlocal/boehm/gogc
07:02:17*nc-x joined #nim
07:02:45nc-xwon't too many and too different memory management strategies cause incompatibilities between packages?
07:03:51Araqyeah, indeed, we must reduce them
07:04:44FromDiscord<Chiqqum_Ngbata> How to exportc an initialized c array?
07:04:56leorizejust exportc it
07:04:58*gmpreussner joined #nim
07:10:18FromDiscord<Chiqqum_Ngbata> `const test {.exportc.} = [1,2,3]` doesn't produce anything
07:12:22leorizeconst are compile-time only
07:12:25leorizeuse `var` instead
07:13:07*nc-x quit (Remote host closed the connection)
07:15:22FromDiscord<Chiqqum_Ngbata> `tyArray__8h6OIln69cI7qXhCJRRIrtw test;`
07:19:35leorizeas long as you call NimMain() it'll the populated
07:19:51leorizeNim seems to build the const outside then copymem it in during runtime
07:25:01FromGitter<dumjyl> const get generated on use, so adding `discard test` could work.
07:27:10FromGitter<gogolxdong> Any idea of https://play.nim-lang.org/#ix=1YVi
07:27:36FromDiscord<Chiqqum_Ngbata> Is something obviously wrong here? https://pastebin.com/HGjSuEHf
07:27:57FromDiscord<Chiqqum_Ngbata> Essentially trying to produce this wrapper code via nim https://gist.github.com/tsloughter/5c85ff9ecfe4e80a60ec
07:28:09leorizePMunch: ^ you need pcre in the playground
07:29:18FromGitter<gogolxdong> It's necessary to preprocess html with entity symbols, but &ouml; and &uuml; is not matched.
07:30:05leorizeiirc there's only a handful of html reserved symbols
07:30:25leorizeNim probably assumed utf-8 and don't encode any non-reserved symbols
07:31:25*Hideki_ joined #nim
07:31:50FromGitter<gogolxdong> it's in the case `of "uuml": Rune(0x000FC)`
07:32:27FromGitter<gogolxdong> It's supposed to be matched with re"&\w+;", isn't it?
07:33:24leorizethere aren't any &uuml; in the html from parseHtml()
07:34:20PMunchleorize, done :)
07:35:50leorize@Chiqqum_Ngbata I'm not entirely sure what you're trying to do
07:35:59PMunchHmm, I guess that should be in all the containers and not only the v1.0.0 one
07:36:08PMunchSince it's required by a module in system
07:36:21PMunchOr not in system, but in stdlib
07:37:07PMunchUgh, that means rebuilding all of them..
07:38:10FromDiscord<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:14FromDiscord<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:57leorizerun NimMain() from nif_init()
07:40:09leorizejust `proc NimMain() {.importc.}`, then run it
07:40:23leorizeit's needed to initialize Nim's runtime
07:41:12leorizethe wrapper definitely can be improved
07:42:25leorizealso 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:05FromGitter<gogolxdong> I see, use readFile to find and replace.
07:46:55FromDiscord<Chiqqum_Ngbata> Invoking NimMain() from nif_init() gives me SIGSEGV: Illegal storage access. (Attempt to read from nil?)
07:47:27leorizehmm, how does erlang load everything?
07:47:29leorizevia dynlib?
07:47:52FromDiscord<Chiqqum_Ngbata> Yeah
07:48:01FromDiscord<Chiqqum_Ngbata> I'm compiling with --noMain and --gc:none
07:48:21leorizeleave the gc in...
07:48:38leorizedo you have --app:lib?
07:48:50FromDiscord<Chiqqum_Ngbata> Erlang wants to control the lifetimes of variables. Yeah
07:49:59leorizeref-based stuff from nim can't be controlled by erlang
07:50:13leorizeonly erlang-based strings/pointers can be controlled by them
07:50:24leorizeso don't worry, as long as you get your types right
07:50:46leorizewhat's your current code look like?
07:51:45FromDiscord<Chiqqum_Ngbata> For example, on the Erlang side, "terms" are associated with an ErlNifEnv ("environment"), which are managed by Erlang VM
07:52:09Araqcool, interfacing with Erlang :-)
07:52:16leorizeif they are not `ref T`, nim won't touch them
07:52:26leorizeso don't worry
07:53:25FromDiscord<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:11FromDiscord<Chiqqum_Ngbata> Wish I could get this wrapper code working without emitting C :/
07:58:56leorizeif you can show us the code, maybe we can figure out what's wrong
07:59:06Araqfor emitting C code there is also .emit
08:03:27*gmpreussner_ joined #nim
08:04:02*gmpreussner quit (Ping timeout: 240 seconds)
08:05:34FromDiscord<Chiqqum_Ngbata> It's just here: https://pastebin.com/HGjSuEHf
08:06:05FromDiscord<Chiqqum_Ngbata> Segfaults. BRB
08:07:24Araqof course it does
08:07:37Araqyou are returning a pointer into a stack frame that is about to disappear!
08:07:41Araqreturn addr(entry) # wrong
08:14:36PMunchYeah, a bit depending on how Erlend handles that ErlNifEntry you might need to manually allocate that on the heap
08:14:46PMunchIf Erlang is the one that is meant to free it
08:14:53PMunchs/Erlend/Erlang :P
08:24:42*asymptotically joined #nim
08:29:09leorize@Chiqqum_Ngbata: http://ix.io/1YVD
08:29:18leorizethere, I've made you a nice interface :P
08:29:33leorizeuntested as I know nothing about erlang
08:31:38livcddid anything change for staticRead ? iam just doing staticRead(msi) and writeFile(path,msi) but the msi looks "corrupted" ?
08:31:41leorizebut this is about everything that I extrapolated from your C example
08:31:59livcdtried with a .nim file and that works.
08:32:15leorizeyou're on windows, right?
08:32:30livcdme?
08:32:31livcdi am
08:33:23leorizeiirc there were issues on how windows just loves to meddle with binary input/output :/
08:33:39livcdoh noes....
08:33:44livcdthis worked pre 1.0 btw
08:34:03leorizeAraq might know a thing or two
08:34:03*Hideki_ quit (Ping timeout: 245 seconds)
08:34:03*Vladar joined #nim
08:42:27Araqfix is in 1.0.2
08:44:57*letto joined #nim
08:45:41*Mister_Magister quit (Quit: bye)
08:46:11livcdbut that's not out yet right ?
08:46:46*Mister_Magister joined #nim
08:48:01narimiranlivcd: not officially, but you can grab a preview from nightlies if you want
08:49:02livcdguess i will have to
08:49:39narimiranhere: https://github.com/nim-lang/nightlies/releases/tag/2019-10-13-version-1-0-f16bb4d
08:50:14Mister_Magisteri need to filter out any non alphanumeric+whitespace characters. any idea how to do it nicely? regex replace?
08:51:02narimiranMister_Magister: https://nim-lang.github.io/Nim/strutils.html#isAlphaNumeric%2Cchar ?
08:51:41Mister_Magisternarimiran: that only checks if it's alphanumeric
08:51:49Mister_Magisteri need to make it alphanumeric
08:52:13narimiranwell, use it in combination with `filter`
08:52:24Mister_Magisterfilter?
08:52:39lqdev[m]if c notin {'a'..'z', 'A'..'Z', '0'..'9'}: str[i] = '-'
08:52:42livcdthanks narimiran !
08:52:51lqdev[m]that's how I would do it
08:53:27Araqlqdev[m], me too :-)
08:54:30narimiranMister_Magister: https://play.nim-lang.org/#ix=1YVP
08:55:22Mister_Magisteroh thanks
08:56:04Mister_Magisterbut how do i include space in isAlphanumeric
08:57:06leorizeisAlphaNumeric(c) or c == ' ' :P
08:57:23narimiranMister_Magister: https://play.nim-lang.org/#ix=1YVQ
08:57:58Araqc notin {'a'..'z', 'A'..'Z', '0'..'9', ' '}
08:58:17Araqis much better than isAlphanumeric because nobody knows what that means
08:58:36leorizec notin Letters + Digits + Whitespace
08:58:47Araqor that, yes
08:59:17AraqI hate all this crap in my strutils that came from Python because Python lacks superfast bitsets
09:00:14leorizethe only problem with bitsets is that I've zero idea on how to save them to sqlite :P
09:00:19Araqomg, play.nim-lang got Nim version support and Compilation target? that's awesome
09:00:43Araqleorize, for c in myset: str.add c # turn it into a string
09:00:54Mister_Magisterthank u all
09:01:50Araqleorize, how do you save a func like isAlphanumeric to sqlite btw? :P
09:02:36leorize:P I'm just saving a set of permissions for an user
09:02:53leorizedecided to go with bunch of boolean columns though
09:37:52FromDiscord<Chiqqum_Ngbata> Nice @leorize, let me try
09:42:39*dddddd joined #nim
09:49:30lqdev[m]leorize: cast them to ints
09:52:33lqdev[m]Araq: once I learned about the capabilities of Nim sets I started abusing them like crazy
09:53:29Araqyou can't "abuse" them, ever looked at the compiler code? :P
09:55:47FromDiscord<Chiqqum_Ngbata> Erlang still doesn't like this funcs array
10:00:59*fredrik92 quit (Quit: Client disconnecting)
10:01:20FromDiscord<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:20leorize@Chiqqum_Ngbata: glad it does :)
10:19:08leorizeI'm pretty sure you can evolve it into an even better interface :)
10:19:25leorizelqdev[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:58PMunchAraq, yup, those features are new in the playground from the last couple of days
10:39:26PMunchIt 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:29FromDiscord<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:37leorizehttps://nim-lang.org/docs/manual.html#types-enumeration-types
10:42:44leorizeI think the wording here is more clear
10:44:02narimiranPMunch: should i add those extra packages to important_packages?
10:45:01PMunchNah, I just let people PR and add pretty much whatever to the playground
10:45:33PMunchOnly 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:10PMunchI 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:43AraqPMunch, one feature that I would love to see is "show produced asm"
11:11:20federico3Araq: what happened with csize going from int to uint?
11:11:34Araqfederico3, want to revert that one
11:11:42Araqbut 1.0.x isn't affected
11:11:44federico3ah was it an error?
11:11:56AraqIMO yes
11:11:59federico3I was quite surprised to see the merge without comments
11:12:05federico3and it's breaking a lot of stuff
11:12:40Araqwell all the "important packages" were green but this change wasn't handled well (sorry clybber!)
11:13:26federico3maybe the important packages don't contain many wrappers... everything using csize breaks
11:17:09Araqwe always seek to expand "important packages"
11:18:07PMunchAraq, what would that output?
11:18:24Araqthe produced assembler
11:18:40*ng0 quit (Ping timeout: 260 seconds)
11:18:45Araqpreferably in Intel syntax, not that GNU syntax abomination
11:19:02planetis[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:14PMunchWhere would I get that from?
11:19:38narimiran@mratsim ^^
11:19:55AraqPMunch, via some GCC/CLang switch
11:24:54PMunchHmm
11:26:20Araq-f-keep-asm-in-intel-syntax
11:27:09Araqhttps://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:11planetis[m]use this sw
11:36:37planetis[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:14FromGitter<Willyboar> Hello! Any nim forum mod online?
12:00:31*NimBot joined #nim
12:00:48narimiran@Willyboar i just approved you as a user, if that's what you're asking
12:01:23FromGitter<Willyboar> Yeah! You are fast.. :)
12:02:02narimiranthat's what she said....
12:02:33FromGitter<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:19PMunchMan, 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:46FromDiscord<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:58FromDiscord<badassiel> *installed dependencies
12:30:04PMunchWhat do you mean by scooping?
12:31:16FromDiscord<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:12FromDiscord<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:33FromDiscord<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:27PMunchPlease don't edit your messages on Discord, they come through to IRC as completely new messages
12:34:50FromDiscord<badassiel> oh okay, i didn't know that
12:34:54FromGitter<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:34PMunchWillyboar, 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:45FromDiscord<badassiel> hmm we might not not be on same page. Im talking about dependency not the project code (my lib folder)
12:36:51PMunchI guess nimble develop might be the closest thing
12:37:03FromDiscord<badassiel> ok let me check
12:37:11PMunchOr of course use --nimbleDir:dirname to specify the directory it installs into
12:37:45PMunchAnd then pass --NimblePath:dirname to the nim compiler to tell it where to find these packages
12:39:37FromDiscord<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:09FromDiscord<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:19PMunchWhy would that be more common?
12:47:47*clyybber joined #nim
12:47:54PMunchThe 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:09PMunchBut otherwise it just causes a bunch of duplication
12:49:05clyybberPMunch: Why are they smaller/bigger?
12:52:57PMunchWhy is what smaller/bigger?
12:53:17FromDiscord<Rika> wouldnt it be better if it was scoped because of "what if two packages need 2 versions of a package"
12:53:56FromDiscord<Rika> akin to module `b` needing `a ver1.2` and module `c` needing `a ver 2.0`
12:54:22FromDiscord<Rika> what does nim do regards this?
12:54:56clyybberPMunch: The docker images
12:56:54PMunchRika, 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:04PMunchclyybber, not 100% sure
12:57:38PMunchBut 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:43FromDiscord<badassiel> PMunch: Usually the reason are
12:57:43FromDiscord<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:43FromDiscord<badassiel> 2. Like rika said, different projects needing different versions
12:57:44FromDiscord<badassiel> 3. Not including all globa bloat, though most pkg managers tree shake so not a strong point
12:57:46FromDiscord<badassiel> 4. Updating global dep will not break project dep, because any change different version introduced
12:59:29PMunchclyybber, 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:52PMunchMy v0.20.2 image without packages is at 166MB
13:00:46FromDiscord<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:21FromDiscord<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:43PMunchbadassiel, the docker stuff is only for the playground
13:01:46PMunchplay.nim-lang.org
13:02:35FromDiscord<badassiel> oh sorry thought it was for my point
13:02:50PMunchbadassiel, 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:54FromDiscord<badassiel> okay sounds good, and to reiterate Rika's question, we can have multiple version installed at same time right
13:04:01PMunchYes
13:04:01FromDiscord<Rika> yes
13:04:05FromDiscord<Rika> they said before
13:04:15FromDiscord<badassiel> ok cool 🙂
13:04:34PMunchBut 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:08PMunchSo in a single project, all version of a module required has to be the same
13:05:19FromDiscord<Rika> wouldnt local packages fix those
13:05:22PMunchBut if people tag their versions properly that shouldn't be an issue
13:05:24FromDiscord<Rika> wait
13:05:26FromDiscord<Rika> no it wouldnt
13:05:27PMunchNope
13:05:42FromDiscord<Rika> what if C exported B v2's functions, then what lmao
13:05:44FromDiscord<Rika> rip rip
13:05:46FromDiscord<Rika> that's fine
13:05:46PMunchIt's something that would have to be implemented within Nim itself. I think it is planned for after incremental compilation
13:07:16FromDiscord<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:09FromDiscord<Rika> see node is much older than nim so it's had time to implement that
13:09:07FromDiscord<Rika> well, apparently nim is older; but there's also the fact that node is much much more popular
13:09:16FromDiscord<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:37FromDiscord<Rika> we still only have a bit over 1000 so for now i guess its fine...
13:10:07FromDiscord<Rika> also incremental compiler 😮 compilation is already speedy as hell as it is right now
13:10:11FromDiscord<badassiel> Quality over quantity any day 🙂
13:10:15kungtotteWe also don't have a culture of creating a package that provides only "leftpad"
13:10:23FromDiscord<Rika> is_odd
13:10:37*xace joined #nim
13:10:42FromDiscord<Rika> https://www.npmjs.com/package/is-odd
13:10:46FromDiscord<Rika> 😛
13:10:57kungtotteThe 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:30FromDiscord<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:46kungtotteDear lord. 12 files to provide 15 LOC of which only one is the actual code
13:13:25FromDiscord<Rika> then see is_even
13:13:47FromDiscord<Rika> https://www.npmjs.com/package/is-even
13:13:52FromDiscord<Rika> "dependencies: is-odd"
13:14:39FromDiscord<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:07kungtotteHoly crap, is-number. 20 million downloads per week, because JS doesn't have a real type system
13:27:32PMunchhttps://www.youtube.com/watch?v=2cyib2MgvdM&feature=youtu.be
13:28:25PMunchOh wait, that's not the one I was thinking of
13:30:07PMunchThat's an interesting talk as well though
13:36:31FromDiscord<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:01Araqbadassiel: fwiw I agree with you and will eventually patch Nimble to support this
13:39:59AraqPMunch, IMO we should all use a deduplicating filesystem instead of hacking around it all the time via symlinks, global installation dirs etc
13:40:32FromDiscord<Rika> `deduplicating filesystem` sounds hard to implement 🤔
13:40:44FromDiscord<Rika> do they exist right now?
13:40:59FromDiscord<Rika> wait. zfs is dedup??
13:41:22*nsf quit (Quit: WeeChat 2.6)
13:42:29PMunchYeah, they exist
13:43:43Araqused one in production 7 years ago, the code relied on it, it simply worked
13:43:58Araqwas on Windows Server though
13:44:37PMunchThe newest Apple versions uses one doesn't it?
13:44:46PMunchs/Apple/OSX
13:45:12clyybberYou mean COW?
13:46:12Araqclyybber, usually it's done with COW, yes
13:46:29PMunchI 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:09clyybberbcachefs is a great COW filesystem, I'm using it along btrfs
13:47:30clyybberwhich is also COW and great (nowadays)
13:47:37clyybberbut bcachefs is just faster
13:48:21clyybberAraq: 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:30clyybberOr at least thats how symlinks should be used.
13:51:42Araqmaybe, I don't use symlinks.
13:52:34Araqlife 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:19clyybberThe thing is, symlinks don't cause trouble and solve many problems.
13:53:28Araqhahahahaha
13:53:29disruptekagree; i use them pretty heavily.
13:53:30clyybberBut to be fair, they are a PITA on windows
13:55:23Araq ## If the system supports symlinks it also resolves them until it
13:55:23Araq ## meets the actual file. This behavior can be disabled if desired
13:55:23Araq ## by setting `followSymlinks = false`.
13:55:56Araq^ symlinks are complexity that creep into everything
13:56:14Araqthey also destroy the tree-ness of the filesystem
13:56:36AraqcopyDir(uhmWhatToDoAboutSymLinks = ...)
13:57:15disruptekwhy is treeness so important to you?
13:57:34disruptekto me it's extra complexity.
13:57:39Araqbecause it means I can traverse it without a cycle check
13:57:54disruptekand that's important because what?
13:57:59Araqand it means I can do 'copyTree' and it's clear what the fuck it actually means
13:58:08clyybberYeah, thats a fair critique IMO. Symlinks really add complexity, but its worth it IMO
13:58:49disruptekclearly it's worth it.
13:58:53*EvilKhaosKat quit (Remote host closed the connection)
13:58:54*couven92 quit (Quit: Client disconnecting)
13:58:55clyybberAraq: But tbh, its actually pretty simple. For copyDir you usually don't want to follow symlinks, and just copy the symlink itself.
13:59:06disruptekwe're talking about one bit and araq isn't willing to pass it to his methods.
14:00:13Araqclyybber, if I don't follow symlinks then I have created a broken backup...
14:00:52clyybberDepends on where the symlink points
14:01:07disruptekthis is too silly to even discuss.
14:01:29disruptekonly a windows user would attempt the argument.
14:02:01Araqwhen you lack arguments, draw it to a personal level
14:02:37disrupteki will concede your points, but they have no bearing on my practical experience.
14:02:53disruptekand i've been doing this a very long time.
14:03:07disruptekenjoy your link-free existence.
14:03:20Araqyup, I do, thanks
14:03:41clyybberWindows has Verknuepfungen
14:03:48clyybberAh, links
14:03:59clyybberNo program ever follows them
14:04:07AraqI never even mentioned Windows btw
14:04:16Araqit's all in your head ;-)
14:04:30AraqWindows links also suck, for the same reasons
14:04:40clyybberBut you still use them right?
14:04:55Araqnot to cross-link nim.exe files, no.
14:05:15clyybberBecause windows doesn't support that
14:05:21clyybbersry
14:05:30clyybberI meant windows links
14:05:33AraqI don't even know if windows supports it, I don't use it.
14:05:37clyybberBut symlinks do
14:05:47disruptekclyybber: what is your bcachefs application?
14:06:49clyybberAraq: 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:00clyybberdisruptek: Storing my /home :)
14:07:20disrupteki mean, on what kinda block device?
14:07:24clyybberSSD
14:07:30disruptekah.
14:08:20clyybberI only use SSD's they are the only thing thats left to me after I replaced my families broken HDDs with mine
14:08:56disrupteki haven't used ssds in years.
14:08:57clyybberAnd also, HDDs suck for a laptop. Not that I ever dropped it, but just in case
14:09:07disruptekonce you go nvme, you don't go back.
14:09:44clyybberYou probably use a nvme ssd
14:09:47disrupteki use metal for san. that's what i'd run bcachefs on.
14:10:02disruptekyes, but it may as well be another animal.
14:10:58clyybberWhats metal for san? Do you mean metaSAN?
14:11:22disrupteki mean spinning platters, literal metal.
14:11:25clyybberoh
14:11:30Araqclyybber, 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:47clyybberhandy for the user, not the programmer :)
14:11:54AraqI'm both.
14:12:03clyybberThats the problem :P
14:12:24FromDiscord<krab4t> im confused, how the f you verify if sequence is empty, search on docs website useless
14:12:33clyybber.len == 0?
14:13:11disrupteki'm still looking for modern filesystems that i can layer local->san or local->cloud with a high degree of "just works".
14:13:27FromDiscord<krab4t> after Qt all this about len looks to me a bit stupid but thanks 🙂
14:13:41FromGitter<deech> Is there a way to determine at compile time if an object has a discriminant?
14:14:18disruptekit'd be hard to compile discriminants if there weren't.
14:15:51FromGitter<deech> I understand, I meant in a way that's available to the user and can go into a `when ...`.
14:16:11disrupteki know, i'm just being a jackass, sorry. 😜
14:16:36disruptekAraq: any reason not to submit patches to posix?
14:17:13Araqdeech: macros.getType eventually retuns an nnkRecCase
14:17:28Araqyou need to traverse the tree though
14:17:39Araqdisruptek, what do you mean?
14:18:01clyybberhes just messing around
14:18:05disrupteki want to add times(&tms).
14:18:12disrupteki'm using it in golden.
14:18:33clyybberdisruptek: What would that do?
14:18:50disruptekit lets you measure CPU time of dead child processes.
14:18:53Araqif 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:25disrupteksure. it's just a struct of Clock values, so it should be portable.
14:19:37FromDiscord<Rika> i think i'm obliterating my RAM with the way i use `Rope` (appending single bytes)
14:20:53AraqRika: ropes are bad, don't use them
14:22:19clyybberThe advantage of ropes are that its fast to prepend something right?
14:22:43*rockcavera quit (Remote host closed the connection)
14:22:43FromGitter<deech> Araq: Thanks!
14:22:43FromDiscord<Rika> my program starts slowing down when i use a regular string
14:23:04clyybberRika: Maybe set the cap of the string?
14:23:09FromDiscord<Rika> clyybber, i cant verify if its the ropes that are making my program slow
14:23:23Araqonly when ignore pretty much everything about current hardware, clyybber
14:23:30FromDiscord<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:52FromDiscord<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:08FromGitter<nixfreakz_twitter> var s = "hello, world" var s0 = char[0..3] , why doesn't this work ?
14:56:29narimiranwhat are you trying to do?
14:56:38shashlick@Araq - is it possible to generate a repr of the entire AST tree for a file
14:56:41narimiran`var s0 = s[0..3]` maybe?
14:57:29FromGitter<nixfreakz_twitter> var s = "Hello World." ⏎ var s0: char = s[0] # 'H'
14:58:17FromGitter<nixfreakz_twitter> https://github.com/nim-lang/Nim/wiki/Nim-for-C-programmers
14:59:08FromDiscord<Rika> nixfreakz_twitter, did you fix your problem?
14:59:58FromGitter<nixfreakz_twitter> fix ?
15:00:19FromGitter<nixfreakz_twitter> just wondering why I can't grab more than 1 char at a time
15:00:23narimiranyou can
15:00:29narimirani've written how to do it
15:00:58FromGitter<nixfreakz_twitter> oh so you can't use char then ?
15:01:13narimiranmultiple chars aren't char, are they?
15:01:15FromGitter<nixfreakz_twitter> oh because its only 1 byte
15:01:24FromGitter<nixfreakz_twitter> yeah i'm stupid sorry
15:01:29disruptekshashlick: sure, just save an ast to a file.
15:02:13shashlickhow 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:32Zevvwrap all in a top level macro?
15:52:56*Hideki_ joined #nim
15:54:10*Hideki_ quit (Remote host closed the connection)
15:54:34jkenQuestion re: nimble packaing
15:54:39jkenI want to make use of this package: https://github.com/nimgl/imgui
15:54:51*Hideki_ joined #nim
15:55:03jkenI installed it, added it to my nimble file as a requirement, and can import it and use symbols from it
15:55:19jkenWhen I try to build, I get could not load: cimgui.so
15:55:43jkenI assumed there was some imgui development package on my system (fedora) I needed to install
15:55:47jkenbut none exists
15:56:19jkenis there an additional step to create shared objects for packages like this one?
15:58:57*Hideki_ quit (Ping timeout: 240 seconds)
16:03:33shashlick@Zevv i guess that's the only option
16:06:09FromGitter<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:46disruptekjken: you'll need to build the imgui library.
16:22:57jkendisruptek, seperately on my system or as part of my nimble project?
16:23:11disruptekon your system.
16:26:10lqdev[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:45disrupteklqdev[m]: you need to link it into your executable. i think nimterop adds the args to do that, though.
16:30:26lqdev[m]the documentation mentions that it does .passL with the correct parameters, iirc
16:30:43disruptekis it getting linked in?
16:33:39*Hideki_ joined #nim
16:35:03lqdev[m]yeah! I'm surprised at how seamless that was
16:35:32*gangstacat quit (Quit: Ĝis!)
16:35:40lqdev[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:45lqdev[m]but wow. it just works
16:36:05shashlick@lqdev - with -d:xxxStatic nimterop automatically adds a {.passL.} with the .a file
16:36:18lqdev[m]I thought I'd have to do some magic with cCompile and whatnot but I see that's not necessary :)
16:36:31lqdev[m]nimterop suddenly got even more amazing
16:36:44*gangstacat joined #nim
16:37:20shashlickthe whole point is to delegate finding the header, finding/building the binary (static or dynamic) and then wrapping and linking
16:37:28shashlicknothing should be your problem but we are crawling there
16:37:39shashlickno more cCompile with getHeader
16:38:35lqdev[m]seems like everything is seamless
16:38:59lqdev[m]I should update my FreeType wrapper to use getHeader
16:39:13lqdev[m]I think they have build options for enabling/disabling different modules, but I'd have to check
16:39:33lqdev[m]one thing that's suspicious is how small the resulting executable is; how is it just 100kB?
16:39:38lqdev[m]DCE?
16:40:59shashlickno idea - how big is the .a file
16:41:07shashlickand what happens if you rename the .a file
16:41:13shashlickdoes exec still run
16:41:32jkendisruptek, 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:33lqdev[m]checking
16:41:45jkenHaving never done this before, am I missing something baic?
16:41:46jkenbasic*(
16:42:03lqdev[m]it's almost 20 MB (!)
16:42:18*dddddd joined #nim
16:42:55shashlickthat makes no sense
16:43:09shashlickunless gcc is super smart or something
16:43:20shashlickand throws out all the code that isn't utilized
16:43:21disruptekjken: probably. is your compiler linking against it? you may need a {.passL: "-lcimgui".} somewhere.
16:43:29lqdev[m]is there a way of dumping passL params?
16:46:04ZevvAraq: i'm sure it's a codegen bug
16:46:59Zevvalthough 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:54jkendisruptek, I guess I assumed the nim imgui package handled that
16:48:07jkenhttps://github.com/nimgl/imgui
16:49:28disruptekdo the tests for nimgl/imgui work?
16:49:49disruptekare you on windows?
16:49:57jkendisruptek, trying now, I am on linux
16:50:14disruptekit looks like it includes the imgui src.
16:50:51jkenBoth of their `gen` and `test` nimble tasks fail for me: https://paste.debian.net/1107741/
16:51:33*clyybber joined #nim
16:52:10jkenah, missing git submodule
16:52:20disrupteki was about to say...
16:52:34jkenalright, gen works
16:52:37jkentest does not.
16:52:48jkenhttps://paste.debian.net/1107742/
16:52:57*Hideki_ quit (Ping timeout: 250 seconds)
16:53:15disruptekwell, that test file doesn't exist.
16:53:20shashlick@lqdev - you can run nim with verbosity, it will print the compile/link commands
16:53:36disruptekprobably just an old nimscript. try `nim c -r test/test.nim`
16:53:47shashlickalso `--listCmd` makes it easier
16:54:12jkendisruptek, closer, new error https://paste.debian.net/1107743/
16:54:57disruptekyou have nimgl/glfw installed?
16:55:37jkenI have nimgl installed
16:55:39*clyybber quit (Client Quit)
16:55:50lqdev[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:29shashlickare you building libSDL2 with nimterop?
16:58:41disruptekjken: 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:19lqdev[m]shashlick: yeah
16:59:27lqdev[m]using getHeader
16:59:33shashlickwith getHeader? oh that's nice 🙂
16:59:47jkendisruptek, as I understand it, its all packaged with nimgl
16:59:58shashlickhow come not just using what's installed
17:00:00jkenI am not using nimgl in my project though, I am using the opengl / sdl2 packages
17:00:06shashlickmight be taking a while
17:00:32disruptekthat test imports nimgl/glfw, which is where that symbol is defined...
17:01:34*nsf joined #nim
17:02:02jkendisruptek, ✘  ~/.nimble/pkgs/nimgl-0.3.7/nimgl  ls
17:02:03jkenglfw.nim imgui imgui.nim opengl.nim private stb
17:02:18shashlickwhat's the biggest nimterop issue right now? am thinking of what to focus on next
17:02:34disruptekthat release is prior to the rewrite, and prior to the composition of that test.
17:02:45disruptek(18 days ago versus 21 days ago)
17:02:52lqdev[m]shashlick: cOverride
17:03:07lqdev[m]it's a pain to use
17:03:24jkenoh, let me install nimgl using the git link then, the directory is behind
17:03:25shashlickokay then i have to do what i have to do
17:03:35disrupteki think that will help.
17:03:56lqdev[m]shashlick: what is it? complete rewrite?
17:04:10disruptekshashlick is so effective that he has to ASK what remains to be done.
17:04:28*rockcavera quit (Ping timeout: 245 seconds)
17:04:29jkennimble install https://github.com/nimgl/nimgl.git grabs the same version (0.3.7)
17:04:34jkenHow do I specify HEAD?
17:04:56disrupteki dunno, i try not to use nimble. just clone it and then `nimble develop` inside.
17:05:08jkenah, ill do that.
17:05:21jkenforgot about that feature
17:05:25shashlick@disruptek - no just prioritizing the 1000 known things still left 😛
17:05:29disrupteki think there's a syntax for nimbling a git url.
17:05:45shashlick@lqdev - actually it isn't still clear to me how to pull it off
17:05:58shashlickcOverride ideally inserts the symbols at the spot where they show up in the tree
17:06:12shashlickbut for that to work, nimterop should be able to recognize where those symbols are
17:06:33shashlickwhich means we need to add capability in nimterop to recognize what it doesn't recognize
17:07:28shashlicki'm thinking a catchall is possible but still not clear how to do it
17:07:36jkendisruptek, gcc: error: private/glfw/src/vulkan.c: No such file or directory
17:07:45jkenHEAD of nimgl might be broken?
17:07:53*Trustable joined #nim
17:08:25disruptekdefine glfwDLL
17:09:07disruptekyou do have a libglfw.so.3 on your system, right?
17:09:37disruptekbtw, 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:52lqdev[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:05shashlickit doesn't help cause you want to use cOverride to typically add missing, skipped symbols
17:11:12jkenI do have gldw
17:11:15shashlickoverriding wrong ones is secondary
17:11:15jkenglfw*
17:11:41shashlickand if that's the case, cImport never even finds that symbol cause that structure isn't recognized
17:11:43lqdev[m]hm
17:12:19lqdev[m]that's problematic
17:13:37shashlickwhat's a good example of something you want to override
17:14:10lqdev[m]SDL_GameControllerButtonBind
17:14:31lqdev[m]or, any nested struct
17:21:41FromGitter<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:50FromDiscord<krab4t> npeg xD
17:36:28*clyybber joined #nim
17:36:39FromDiscord<krab4t> ` ('.*?'|".*?"|\S+) `can this pattern be written in npeg\peg expression?
17:37:24leorizeyes
17:37:25clyybberYeah
17:37:47*clyybber quit (Client Quit)
17:37:56leorizealthough that pattern is really flawed
17:37:57*clyybber joined #nim
17:38:01leorizeoh wait nvm
17:38:32clyybberWhy would it not?
17:42:01leorizeaside from the unnecessary `?` it's a working pattern
17:44:21FromDiscord<krab4t> https://regex101.com/r/rYNemg/1 what `?`
17:47:39FromGitter<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:43krux02https://github.com/nim-lang/Nim/pull/12447
17:58:51jkendisruptek, I am slightly further ahead.. https://paste.debian.net/1107762/
17:59:05jkenI have libx11-devel and the x11@head nim package
18:00:59*letto quit (Quit: Konversation terminated!)
18:02:04jkenah.. part of libXCursor-devel on fedora
18:02:54*letto joined #nim
18:04:10jkenaha!
18:04:55jkendisruptek, solved the missing deps. I am now getting "could not load: cimgui.so" when compiling the nim imgui test as well!
18:05:37disrupteki guess that's good; try setting your LD_LIBRARY_PATH
18:09:30jkensame error with that set to the path containing cimgui.so
18:09:42*nsf quit (Quit: WeeChat 2.6)
18:11:56disruptekwhen you `ldd` your binary, does it list a libcimgui.so target?
18:12:47disruptekoh, that's when building. i guess it's not successfully adding the -lcimgui?
18:13:05jkendisruptek, it does not list libcimgui.so
18:14:54disrupteki'm surprised it can build a binary.
18:15:08*Jjp137 quit (Read error: Connection reset by peer)
18:15:13disruptekrun 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:43jkendisruptek, nope, not listed there https://paste.debian.net/plain/1107766
18:17:01jkenThats when compiling the test in the nim-imgui repo
18:18:11clyybberAraq: Which point did we miss? That its a breaking change? The breakage was not bad at all, for such a change
18:18:29Araqclyybber, ask federico3 about it then
18:18:41disrupteknone of that breakage was news.
18:18:59Araqand my solution is better, deprecate the csize symbol, introduce csize_t
18:19:07clyybberAnd accumulate broken cruft
18:19:12disruptekhe 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:35Araqyes, "accumulate broken cruft" that's what a deprecation process does
18:19:53jkendisruptek, is nim-imgui broken, it should be passing that flag to gcc right?
18:20:20disrupteki'm not sure, i'm gonna look in the nimgl/imgui repo now.
18:20:24clyybberAraq: Well ok, but in the end we would remove size and be left with size_t which is ugly IMO
18:20:45jkenI don't know a ton about how linking works, but I see this:
18:20:45jken{.pragma: imgui_lib, dynlib: imgui_dll, cdecl.}
18:20:46lmariscalHi, disruptek and jken
18:20:50jkenhere: https://github.com/nimgl/nimgl/blob/master/src/nimgl/imgui.nim
18:21:05disruptekah, he's your huckleberry.
18:21:05Araqit's as ugly as C's name, what's wrong with it
18:21:09jkenhi lmariscal, I guess its your module in question isn;t it!
18:21:20lmariscalyep, got a notification about it
18:21:30Araqnews: "after version 1.0, Nim removed its deprecation process because 'cruft'"
18:21:39disruptekyou did define cimguiDll?
18:22:00jkendid i? no.
18:22:10Araqcome on, you have to agree with me.
18:22:46disruptekhttps://github.com/nimgl/imgui/blob/master/src/imgui.nim#L30
18:22:58lmariscalif you are compiling nimgl/imgui in C you need to define cimguiDll
18:23:08lmariscalotherwise use CPP backend to build from source
18:23:48jkenWhere do I need to define it?
18:24:16disruptekstart with `nim c -d:cimguiDll -r tests/something.nim` to see if it works.
18:24:21lmariscalin the compilation process `nim c -d:cimguiDll file.nim`
18:24:46clyybberAraq: Maybe we should put it in a when defined statement for backwards compatability
18:24:47lmariscaltake note that cimgui.dll must be present at the same location where the program is running
18:25:02disruptekcsize can turn into csize_t in nim 2.0.
18:25:03lmariscaland if you are running on windows remember to build the dll with visual studio
18:25:14disruptekhe's on linux.
18:25:27jkenlmariscal, on linux, will copy of cimgui.so and try that flag now
18:25:52jkenthrows the same error
18:26:09lmariscalare you using the same architecture in both builds?
18:26:25clyybberAraq: But anyways. The breakage was really not bad, not even in frederico's case according to disruptek
18:26:33jkenlmariscal, yes, I built `cimgui.so` by cloning the cimgui repo and running `make`
18:26:36*ng0 quit (Ping timeout: 260 seconds)
18:26:43jkenhttps://paste.debian.net
18:27:20AraqI don't understand the resistance, we have a deprecation process, it makes sense, now we could all work on something more important
18:27:54lmariscaljken you didnt put the full url
18:28:02FromGitter<awr1> what's wrong with csize?
18:28:13jkenlmariscal, my bad! https://paste.debian.net/1107762/
18:28:14clyybberNothing, anymore :)
18:28:19clyybberawr1
18:28:26FromGitter<awr1> what *was* wrong with csize then
18:28:32clyybberIt was int
18:28:33*ng0 joined #nim
18:28:36FromGitter<awr1> oh
18:28:58lmariscaloh, you are missing some dev dependencies
18:28:59FromGitter<awr1> that always struck me as weird in C
18:29:06Araq(It also works much better as 'int'...)
18:29:08lmariscallet me share with you the ci packages
18:29:08FromGitter<awr1> that it wasn't equivalent to the pointer size
18:29:35clyybberAraq: Better would be suint :)
18:29:35FromGitter<nixfreakz_twitter> does asserts work in inim ?
18:29:39Araq(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:41FromGitter<awr1> it's like uint32_t in amd64 right?
18:30:14clyybberawr1: Not sure what you mean?
18:30:26clyybberIts the size of a pointer I think
18:30:36FromGitter<awr1> i thought size_t in C was uint32_t for "weird reasons"
18:30:42FromGitter<awr1> even on amd64
18:30:46Araqthe size is fine, it's the signed/unsigned question
18:30:50FromGitter<awr1> feel free to correct me if i'm wrong
18:30:51disruptekit's the fact that it's uint.
18:31:14jkenlmariscal, oh thanks, how did you catch tha?
18:31:15jkenthat*
18:31:38*lritter quit (Ping timeout: 240 seconds)
18:31:58lmariscal`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:22clyybberawr1: I don't know about arm64, but as Araq said it was signed, and now its unsigned, like in C
18:32:35Araqlook, 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:39lmariscaljken because the missing header was based in X11
18:32:50Araqjust like we do it for everything else...
18:32:57federico3clyybber: different wrappers generated with c2nim use csize and the code broke with the change
18:33:03FromGitter<awr1> !echo {.emit: "int x = sizeof(size_t);".}; var x: {.importc.} cint; echo(x)
18:33:04jkenlmariscal, oh damn, I am sorry, I had pasted the wrong URL again
18:33:08jkenI have resolved the missing X11 header.
18:33:14FromGitter<awr1> !eval {.emit: "int x = sizeof(size_t);".}; var x: {.importc.} cint; echo(x)
18:33:16NimBotCompile failed: /usercode/in.nim(1, 45) Error: expression expected, but found '{.'
18:33:26clyybberAraq: 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:42jkenlmariscal, this is what I intended to show: https://paste.debian.net/plain/1107770
18:33:44Araqwe have about 1000 Nimble packages
18:33:45jkensorry about that
18:33:56FromGitter<awr1> ...do pragmas not work for nimbot?
18:34:07Araq"the ecosystem adapted" ... no, it didn't.
18:34:19disruptekclyybber: he's making a lot of noise considering he's the one that merged it, huh?
18:34:29FromGitter<awr1> !eval {.pragma: foo, importc.}
18:34:31NimBot<no output>
18:34:59disruptekclyybber adapted some of the obvious breakage, and afaik, i'm the only one impacted outside that group.
18:35:04federico3now we cannot use csize in a backward compatible way
18:35:11FromGitter<awr1> !eval {.emit: "/*VARSECTION*/int x = sizeof(size_t);".}; var x: {.importc.} cint; echo(x)
18:35:11clyybberYou can
18:35:13NimBotCompile failed: /usercode/in.nim(1, 59) Error: expression expected, but found '{.'
18:35:17lmariscaljken, could you please test please with the cpp backend first?
18:35:20clyybberfrederico3: You can
18:35:27disruptekit just happens that the two wrappers i need were affected and aren't in important packages.
18:35:30FromGitter<awr1> sigh
18:35:34Araqdisruptek, I consider it my strength to change my mind, we already have more than enough zealots in IT.
18:35:46disruptekit's your perogative.
18:36:01lmariscalif not the so loading is the issue which could be caused by architecture or different compilers
18:36:03disruptekpointless to blame anyone, though.
18:36:24AraqI'm not blaming anyone
18:36:31AraqI'm trying to convince clyybber.
18:36:41jkenlmariscal, test does run on the cpp backend
18:36:57FromGitter<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:10clyybberI 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:26Araqbut why would it be a bad move?
18:37:30clyybberBecause it would cause breakage to the packages that have adapted
18:37:30FromGitter<awr1> k i'm wrong so whatever
18:37:33jkenI wonder if my project will compile on the cpp backend
18:37:57lmariscaljken it was just a test you should be able to compile in your prefered backend
18:38:11disruptekshades of the 1.0-http-headers issue...
18:38:26Araqclyybber, unfortunately I don't know yet as appveyor is still running
18:38:35jkenlmariscal, looks like my project runs fine on the cpp backend, so I am not dead in the water in the mean time
18:38:42FromGitter<awr1> since people are talking about cpp backend this is a good time to bring up my RFC
18:38:45FromGitter<awr1> again
18:38:46FromGitter<awr1> https://github.com/nim-lang/RFCs/issues/152
18:38:50*fichtl quit (Ping timeout: 240 seconds)
18:39:09disrupteki can't support cpp until exceptions are fixed.
18:39:20lmariscalokay 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:46disruptekawr1: https://github.com/nim-lang/Nim/issues/11081
18:39:51clyybberAraq: 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:01jkenlmariscal, thank you for your time, If I make any headway on the issue ill open an issue in the nimgl repo
18:40:15disruptekyes, there's an adapted cligen.
18:40:26jkenI am using just the imgui package with nims opengl and sdl2 packages, maybe a special case
18:40:30jkenrather than using nimgl
18:40:53Araqclyybber, that means cligen doesn't work with 1.0.0 then
18:40:58*sschwarzer joined #nim
18:41:03disruptekcurrent cligen doesn't, no.
18:41:10Araqso already it must be changed, packages should work with 1.0.0
18:41:25clyybberAraq: Not @#head
18:41:30clyybberIMO
18:41:31disruptek0.9.38 works fine. it's a nimble issue, not a csize issue.
18:41:34FromGitter<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:46disruptekawr1: i don't disagree.
18:41:50lmariscaljken 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:33disruptekprobably c-blake shouldn't have cut it as a patch bump, fwiw.
18:43:23clyybberIMO nimble should allow pkg's to provide newer versions only for newer Nim versions
18:43:28disruptekto me, cligen is a perfect example of a package that should replace existing stdlib solutions.
18:43:34jkenlmariscal, what do you mean compile the same? same arch?
18:43:37clyybbercligen is awesome
18:43:50clyybberAnd cblake puts in so much thought into every single issue
18:44:07disruptekyeah, he really went above and beyond for me on my `--` problem.
18:44:27lmariscaljken yep, same arch and same compiler sometimes nim picks on its own
18:45:11jkenlmariscal, maybe that's it, I just ran `make` in the imgui repo and didn't pick a compiler
18:45:23jkencimgui repo*
18:45:45disruptekclyybber: nimble should allow pkgs to provide newer versions only for newer Nim versions?
18:46:34jkenNot really that familier with makefiles, but I assume $(CXX) evaluates to the systems default compiler?
18:46:59disruptekit lets you override the C++ compiler of choice.
18:47:02sschwarzerI 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:04disrupteknimble needs a `--` too, i guess.
18:48:11*alexander92 quit (Ping timeout: 246 seconds)
18:48:46FromGitter<awr1> @disruptek the DateTime issue is related to inheritance, i fiddled around with it just now
18:49:13jkenlmariscal, can confirm both are built with gcc
18:49:46Zevvis 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:46FromGitter<nixfreakz_twitter> wow asserts are great for testing
18:50:13FromGitter<awr1> {.dirty.} is the closest thing
18:50:25Zevvhm ok
18:50:32FromDiscord<willyboar> Hello everyone. Is there a way to take all the filenames from all the files inside a folder?
18:50:57lmariscaljken https://unix.stackexchange.com/questions/22926/where-do-executables-look-for-shared-objects-at-runtime
18:51:21lmariscalso maybe try moving cimgui.so to `/usr/lib` ?
18:51:53jkenlmariscal, thats where I started
18:51:54FromGitter<awr1> @willyboar `import std / [sequtils, os]; echo(walkDir(CurDir).toSeq())`
18:52:12lmariscalhmmm now I'm lost too
18:52:18jkenlmariscal, 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:29jkenbut either way, the application can't find cimgui.so
18:52:58lmariscaltry naming it libcimgui.so in the path where the test is executed?
18:53:41jkenno dice, with or without LD_LIBRARY_PATH set to the current dir
18:53:44FromGitter<awr1> @lmariscal you need to modify rpath
18:54:19lmariscal@awr1 jken is the one with the issue tbh I'm guessing here I don't really use linux for development
18:54:27FromGitter<awr1> sorry
18:54:47FromGitter<awr1> @jken use `{.passC: "-Wl,-rpath,'$ORIGIN".}`
18:54:55FromGitter<awr1> and then you can put it in the same folder
18:55:01jkenWithout knowing anyhing about it, does modifying the rpath effect what `ld ./theBinary` lists?
18:55:17FromGitter<awr1> uhhhh
18:55:40FromGitter<awr1> i don't think so
18:55:43FromGitter<awr1> you can check though
18:55:56FromGitter<awr1> all it does is add a search path on top of usr/lib
18:57:23jkenawr1, where do I need to add that? In my project that consumes lmgui or in lmgui itself?
18:58:11FromGitter<awr1> you can do it anywhere in the project.
18:58:18FromGitter<awr1> alternatively you can do it in the cfg file
18:59:21FromGitter<awr1> actually i think $ORIGIN is missing a single quote after
19:00:23jkenawr1, I prepended that to test.nim (with the missing single quote) but no dice.
19:00:41jkenThe built binary still says `could not load: cimgui.so` despite it being in the same dir
19:01:28sschwarzerOk, I entered a ticket https://github.com/nim-lang/nimble/issues/725
19:11:58FromDiscord<willyboar> @awr1 Thank you. But doesn't work.
19:12:58FromGitter<nixfreakz_twitter> Stupid question? why are you able to override this ?
19:13:00FromGitter<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:34shashlick@lqdev - i figured it out
19:16:16*alexander92 joined #nim
19:16:41clyybberdisruptek: Yeah thats what I meant, my wording is broken.
19:17:33*EvilKhaosKat quit (Quit: Leaving)
19:18:22disruptekthat sounds kinda tough on people who want to use a stable nim.
19:18:47clyybberThey can upgrade through some flag?
19:18:55clyybberBut its opt-in?
19:19:03clyybberOr let the pkg maintainer decide
19:19:18disruptekwell, the pkg maintainer already has the means to do that.
19:19:25clyybberOh, how?
19:19:36disruptekie. c-blake coulda made 0.9.39 require 1.0.2 ...
19:19:50disruptekrequires "nim >= ..."
19:20:07clyybberAh, sure...
19:20:22clyybberI wonder if nimble honors that
19:20:31disruptekit'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:48shashlickdang - `Error: the resulting AST is cyclic and cannot be processed further`
19:27:00shashlick@Araq - where do you even start debugging that
19:28:10disrupteki have a similar problem with the vm loop interations limit.
19:28:30jkendisruptek, lmariscal, I keep coming back to the fact that `ldd ./theBinary` should list libimgui.so as a shared object.
19:29:36jkenand {.push dynlib: imgui_dll, cdecl, discardable.} should make that happen
19:29:42jkenbut I am making many assumptions
19:29:50shashlickplus doesn't look like I can have a ref object created at compile time
19:29:51disruptekonly 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:26disruptekshashlick: what do you think NimNodes are?
19:32:00shashlicki mean create a `const`of type ref object that can be used at runtime
19:32:53clyybberhow would that work?
19:32:55disruptekyou 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:24clyybberA ref is a ptr to somewhere, that somewhere doesn't exist at compiletime.
19:33:49clyybberAnd if it does, it doesn't at runtime
19:33:57disruptekyes, but he could alloc it on the heap at runtime and then just copy the const over it.
19:34:03clyybberYeah
19:34:05shashlicki understand, i got away another time by getting rid of the ref
19:34:14disruptekheh
19:34:18shashlickbut this time, it is a recursive object
19:34:25shashlickand cannot avoid the ref
19:34:44shashlicki'd rather create it at compile time since all info is known
19:35:00clyybberBut you can't create a ref at compile time.
19:35:03disruptekyou could create a type of the same size but w/o the cycle.
19:35:03lmariscaljken, I am currently in class but will make some tests in the afternoon with Linux
19:35:07clyybberNot for use at runtime
19:35:17clyybbershashlick: Can you give a code example?
19:35:35jkenlmariscal, I am happy to help, I'll be around into the evening (afternoon for you likely)
19:35:38shashlickhttps://github.com/nimterop/nimterop/blob/master/nimterop/globals.nim#L44
19:35:59shashlickjust the nimterop Ast pattern object i create out of grammar.nim
19:36:56disruptekyou're gonna have to encode it somehow and then reconstitute it.
19:37:49disruptekin particular, that proc ref will never fly. 😁
19:38:26shashlicktrue that, meh
19:38:37shashlicki need more speed
19:38:57shashlicknimterop does too many things so toast needs to get some optimization love
19:39:13disruptekhow did it go with your nimterop documentation effort?
19:40:03shashlickgot pulled back into coding by @lqdev - all his fault
19:40:12shashlickmade a bunch of good fixes
19:40:20shashlickfigured out cOverride also so times are good
19:40:40disrupteki do wish you pushed releases more often.
19:41:49clyybbernimterop is especially worth it for cpp wrapping right?
19:41:59shashlicknimterop doesn't know cpp yet
19:42:07shashlickbut it can use c2nim so it does
19:42:21clyybberOh, well c2nim doesn't *really* either
19:43:11shashlicki think some of my biggest concerns are getting addressed now so i might get to c++ faster than I thought
19:43:18shashlickoh ya, another big hump is nested structs
19:43:30shashlicksome idiots write triple nested crap
19:43:48shashlicktoo lazy to think up a symbol name?
19:43:49FromDiscord<krab4t> Zevv, any ideas why PlayEffect len is 3 https://i.imgur.com/NwgA6Ax.png
19:45:04lqdev[m]krab4t: the > in your Bool rule is unnecessary
19:45:44FromDiscord<krab4t> now it works
19:46:14clyybbershashlick: Does treesitter even go that deep?
19:46:39shashlickYa it tells me everything I need to know
19:46:44shashlickAt least so far
19:46:54disruptekit's pretty cool.
19:47:23shashlickWe can easily add simple wrapping of rust and go as well
19:47:47shashlickJust a question of time
19:48:15clyybberHuh, really surprises me.
19:48:33disruptekstanding on the shoulders of giants.
19:48:43clyybberSuch a wonderfull abuse of a poor shy linter
19:49:11clyybberIt is used for linting, right?
19:49:26clyybberAnd code highlighting?
19:49:30disruptekyeah.
19:49:37clyybberPoor treesitter
19:50:01clyybberjust wanted to sit on a tree, now trees of wrappers grow on him..
19:50:07disrupteklol
19:50:13FromDiscord<exelotl> sitting on the branches of trees
19:50:19disruptekat least these trees don't have any symbolic links.
19:50:33disruptekoh wait.
19:50:45clyybberwe have refs guddamnit
19:50:48clyybberand pointers
19:50:53disruptekshhh. don't let araq hear.
19:51:27clyybberbtw, Araq. I'm kinda stuck on my default object fields thing
19:52:53clyybberI 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:18shashlick@disruptek how often should I release
19:53:36shashlickTagging is boring
19:54:02disruptekwhenever you believe the quality is insignificantly worse and the features have gone up.
19:55:02clyybbershashlick: Not at all :p stability first
19:55:02disruptekit's boring, but it's very useful not just for you, but for others. i release all the time.
19:55:26disruptekif no one can run your code, no one can give feedback.
20:03:18disruptekwhen i get comfortable with libgit i'll write a tagger that'll bump a package and push it out, etc.
20:03:26disruptekit annoys me, too.
20:03:37*nsf joined #nim
20:05:17shashlickthat will be great
20:05:24shashlicki'm lazy
20:05:55shashlickokay more design questions
20:06:09shashlickso now nimterop can detect what it doesn't know to wrap
20:06:39shashlicki 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:02shashlickand cOverride can stay the way it is
20:07:06shashlickany concerns?
20:07:13shashlickcc @lqdev
20:08:46lqdev[m]how do you specify how the generated code should look like? `NimNode`s?
20:09:01disruptekyou supply a proc.
20:10:15shashlickbtw 0.2.1 is released
20:10:30shashlickso just like onSymbol, you would type out the code you want
20:10:32disruptekwe would supply a predicate that you run on the symbol name?
20:10:48shashlickyep
20:10:58disruptekhmmm.
20:11:57disruptekwhat's the use-case this solves? libsdl2?
20:12:17shashlickpretty much any case where nimterop doesn't know yet how to wrap something
20:12:27shashlickso you can define it for the near term
20:12:36shashlickor you can override an existing wrapping that is wrong
20:12:47disruptekoh, i see. but on a symbol-by-symbol basis.
20:12:54*narimiran joined #nim
20:13:07shashlicksee https://github.com/nimterop/nimterop/issues/133#issuecomment-509921054 for why
20:13:51shashlickwe can use onSymbol itself
20:14:13disruptekprobably onSymbol can just call some pattern generators, so it won't be too complex.
20:14:36disrupteki guess you'll figure out how that should work once you have a few more failures to twiddle with.
20:14:56shashlicki've run into a bunch already and quickly found cOverride to be useless for more complex stuff
20:15:10shashlicksymbols inevitably refer to other symbols
20:15:14shashlickso context is important
20:16:02disruptekyeah, 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:33disrupteki mean, we're talking about forms that you already can't parse... 😦
20:17:16shashlickhttps://play.nim-lang.org/#ix=1YZf
20:17:42shashlickright now, the limitations are triple pointers (pcre has that), or multi-dimensional arrays, can only do since dimensional now
20:17:43disruptekhey man, if you supply the cool macros, i'm all in. 😀
20:17:53disruptekproblem is writing those in the first place...
20:18:15shashlickya see that's the thing - if you really really want everything wrapped then life's hard
20:18:28shashlickbut if you get most of it and those that you absolutely need you hand write
20:18:36shashlickor perhaps even use c2nim since it's smarter
20:19:10shashlickthat's my approach to all this
20:19:59disruptekwell, it seems sensible to me; i've just been too intimidated by my attempts.
20:20:34disrupteki do some similar stuff in openapi.
20:21:06disruptekyou 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:43Araqclyybber: 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:05Araqsince 0.20 we already pretty much require this anyway
20:24:14disruptekand it's annoying.
20:24:20Araqand he left... oh well
20:24:48disruptekit's sad that i have to case: ... a long ladder of newObj(kind: constant) ... since 0.20.
20:25:09disrupteks/case:/case mykind:/
20:26:51disruptekshashlick: i can't build current nimgit2 because i have no getProjectCacheDir. do i need a new nimble now?
20:27:50shashlickjust latest nimterop
20:28:06Araqdisruptek: it improved by a patch from GULPF
20:28:07disrupteki guess nimgit2 needs a bump, then.
20:28:20Araqif you play it nice with range types you can cut some boilerplate
20:28:22disruptekAraq: recently merged?
20:28:30shashlicknimgit2 points to nimterop#head
20:28:34AraqI think so
20:29:09disrupteki thought jasper was gonna improve this.
20:29:36*Hideki_ joined #nim
20:29:38FromDiscord<krab4t> its possible to record execution time? inside a program? windows probably doesnt have linux's `time`
20:29:49disruptekgetTime
20:30:02FromDiscord<krab4t> perfect
20:30:11disruptekhttps://github.com/nim-lang/Nim/pull/11432
20:32:29disruptekthis 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:17sschwarzerdisruptek: 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:06disruptekbut this is apparently legal: https://github.com/nim-lang/RFCs/issues/19#issuecomment-162621403
20:43:56disruptekaraq's proposal makes the most sense to me.
20:44:38*NimBot joined #nim
20:44:40sschwarzerdisruptek: It's possible as long as the same name isn't listed in several variants.
20:44:56Araqoh wow I did something right ;-)
20:45:29disruptekwell, 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:36disrupteker, N kinds.
20:45:40sschwarzerAlthough I like the syntax with the repeated fields slightly more, I'm fine with either syntax.
20:46:30disruptekthe 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:43disrupteki think these are probably bad reasons to permit that syntax, though.
20:48:42disrupteki use krux02's pattern and it's not just too verbose, it's confusing.
20:49:18lqdev[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:58lqdev[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:54shashlickwhat's the error?
20:56:05lqdev[m]none, it's just not present
20:56:47FromDiscord<krab4t> so its like around 30 milliseconds for 5077 lines (6955 with comments)
20:57:17shashlickcan you please log it?
20:57:28lqdev[m]how can I log it?
20:57:31disruptekkrab4t: https://github.com/disruptek/golden why guess? 😀
20:57:39*sschwarzer quit (Quit: leaving)
21:00:13FromDiscord<krab4t> disruptek, > You will need to install LMDB. On Windows? nope
21:00:29shashlicksorry please create an issue so that i can look at it separately
21:01:15lqdev[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:33lqdev[m]is there any way I could improve `nim check` speeds?
21:01:53disruptekkrab4t: it was more of a joke than a recommendation. 😉
21:02:03disruptekat least you don't have to worry about symbolic links.
21:03:06FromDiscord<krab4t> disruptek, from getTime in milliseconds, fastest 27, slowest 45, no idea why > windows
21:03:56disruptekyes, you do have an idea why.
21:07:52shashlicklqdev - 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:40lqdev[m]shashlick: no, the Nim VS Code plugin does so on save
21:39:02lqdev[m]so I see errors way later than I could
21:39:53lqdev[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:46FromGitter<awr1> hi @willyboar this should work
22:02:49FromGitter<awr1> `import std / [sequtils, os]; echo(toSeq(walkFiles("*")))`
22:05:37FromGitter<awr1> @jken i made a mistake with the rpath thing
22:05:42FromGitter<awr1> use passL, not passC
22:06:03FromGitter<awr1> hope that helps
22:09:47FromGitter<awr1> @krab4t what you want is https://nim-lang.org/docs/times.html#cpuTime
22:10:41FromGitter<awr1> more appropiate for benchmarking than getTime()
22:12:10disrupteknot if what you want to know is how long it takes.
22:12:52FromGitter<awr1> i'm not sure what you mean.
22:13:14FromGitter<awr1> you hit cpuTime() at one location, and then you hit it again and subtract the two
22:13:28disruptekthen what?
22:13:34FromGitter<awr1> you get the time?
22:13:44FromGitter<awr1> duration rather
22:15:35FromGitter<awr1> you can even do something like `template benchmark(code: untyped): untyped = var start = cpuTime(); code; echo("took ", cpuTime() - start, " seconds")`
22:15:54FromDiscord<krab4t> CPU time [s] 0.029 --opt:speed
22:16:12FromDiscord<krab4t> CPU time [s] 0.053 --opt:size
22:17:19FromDiscord<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