<< 05-10-2019 >>

00:07:57rayman22201nvm. I think I figured it out
00:22:32*laaron quit (Remote host closed the connection)
00:35:09*paxis joined #nim
00:44:48FromGitter<zetashift> @Kiloneie yeah worked flawlessly on 1.0 for me, I had to use GCC instead of VCC (installed wth vs 2019) on windows 10 tho
00:44:50FromGitter<zetashift> not sure why
00:45:40*laaron joined #nim
00:50:20*laaron quit (Remote host closed the connection)
01:08:08*abm quit (Read error: Connection reset by peer)
01:37:42*krux02_ quit (Remote host closed the connection)
02:00:43*thomasross quit (Ping timeout: 245 seconds)
02:00:48FromGitter<iffy> I have a SharedList that appears full in one thread (1 item) and empty in another thread. Any guesses why? https://gist.github.com/iffy/c765521a411863e7e0035806f9561b4b
02:03:49*thomasross joined #nim
02:30:43shashlickit's a global var and not automatically shared, i think you need to pass a pointer to the other thread
02:32:55FromGitter<iffy> I don't have much control over the spawning of the other thread (this is in a library used by a NodeJS program). Is there no way for the second thread to reach out to some global *something* to get access to the list?
02:35:20shashlickwell docs does say "Each thread has its own (garbage collected) heap and sharing of memory is restricted to global variables."
02:43:31shashlick@disruptek - you up?
02:48:03FromGitter<iffy> global Locks are shared, right?
02:48:14FromGitter<iffy> (otherwise, how could you use them)
02:53:43rayman22201@iffy, how is nodejs starting the thread? Node has no way to know about Nim global code.
02:54:53FromGitter<iffy> https://nodejs.org/api/n-api.html#n_api_napi_create_async_work and the like
02:55:01*laaron joined #nim
02:55:02FromGitter<iffy> gtg, but anything you type, I'll look at later
02:57:56*laaron quit (Remote host closed the connection)
02:59:43*theelous3 joined #nim
03:08:16*lritter quit (Ping timeout: 240 seconds)
03:09:22*lritter joined #nim
03:15:03*snooptek joined #nim
03:23:33rayman22201@iffy try this: https://gist.github.com/rayman22201/a3c136f20ff6b610bb5caeaae0390990
03:47:23*chemist69 quit (Ping timeout: 252 seconds)
03:49:27*chemist69 joined #nim
04:05:32*Jjp137 quit (Read error: Connection reset by peer)
04:06:01*Jjp137 joined #nim
04:30:09*laaron joined #nim
04:35:21*theelous3 quit (Ping timeout: 265 seconds)
04:55:14*njoseph quit (Ping timeout: 240 seconds)
05:13:11*solitudesf joined #nim
05:13:49*narimiran joined #nim
05:15:26*njoseph joined #nim
05:24:17*lritter quit (Ping timeout: 240 seconds)
05:26:42Zevvrayman22201: not looking under the hood, but it runst stable now
05:27:02*Jjp137 quit (Read error: Connection reset by peer)
05:27:46rayman22201Yay! Thanks for checking.
05:27:48*Jjp137 joined #nim
05:36:39*laaron quit (Remote host closed the connection)
05:47:20*rockcavera quit (Remote host closed the connection)
05:49:29*laaron joined #nim
05:52:41*solitudesf quit (Ping timeout: 265 seconds)
05:53:04Zevvdisruptek: no specific version dependency. The test is crappy also because it compares apples and oranges
06:21:20*laaron quit (Remote host closed the connection)
06:23:19*laaron joined #nim
06:25:36*laaron quit (Remote host closed the connection)
06:41:55*laaron joined #nim
06:49:05*Vladar joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:52*gmpreussner joined #nim
07:09:10*Trustable joined #nim
07:15:32*laaron quit (Remote host closed the connection)
07:28:09*laaron joined #nim
07:31:42*nsf joined #nim
07:45:16*laaron quit (Remote host closed the connection)
07:48:20*dddddd quit (Remote host closed the connection)
07:52:22*laaron joined #nim
07:59:15*PMunch joined #nim
08:04:56*laaron quit (Quit: ZNC 1.7.4 - https://znc.in)
08:05:44*laaron joined #nim
08:14:43*laaron quit (Remote host closed the connection)
08:18:27*swisscowbell[m] joined #nim
08:21:10ZevvaWhat is typically the problem if Nim can find my proc call like `foo(a, b)`, but not like `a.foo(b)`, and tells me `Error: attempting to call undeclared routine`?
08:24:22*Vladar quit (Remote host closed the connection)
08:28:54*laaron joined #nim
08:35:04AraqZevv: some bug in template handling
08:36:59*laaron quit (Quit: ZNC 1.7.4 - https://znc.in)
08:37:16*laaron joined #nim
08:39:30Zevvbah
08:42:05*lf-araujo joined #nim
08:45:47*laaron quit (Remote host closed the connection)
08:50:41FromGitter<Bennyelg> Morning,
08:50:59FromGitter<Bennyelg> I have a ⏎ ⏎ ```var s: Option[seq[int]]``` [https://gitter.im/nim-lang/Nim?at=5d98597392920c36a115afca]
08:51:11FromGitter<Bennyelg> how do I append into it ? add not seems to work
09:00:16FromGitter<sheerluck> it would be nice if Nim had opearator '//' as div: 23/4 = 5.75; 23//4 = 5
09:00:36*lf-araujo quit (Ping timeout: 240 seconds)
09:06:08Zevv!eval echo 23/%4
09:06:11NimBot5
09:06:16Zevvsheerluck: ^
09:07:40Zevvand if you don't like the /% you can do `template `//`[T](a, b: T): T = a /% b`
09:07:45Zevvto have your `//` instead
09:08:48FromGitter<sheerluck> oh thank you
09:16:15*lf-araujo joined #nim
09:29:12*absolutejam joined #nim
09:29:16*lf-araujo quit (Ping timeout: 240 seconds)
09:35:21*absolutejam quit (Ping timeout: 246 seconds)
09:42:05*PMunch quit (Remote host closed the connection)
09:42:45*nsf quit (Quit: WeeChat 2.5)
09:53:05FromDiscord<Rika> Bennyelg maybe try `s.isSome and s.get().add()`
09:53:35FromDiscord<Rika> Not sure, never used Option before
09:57:20*laaron joined #nim
09:57:55leorizeBennyelg: you can't, Option[T] is meant for read-only data
10:00:26*laaron quit (Client Quit)
10:00:56*laaron joined #nim
10:01:31*asymptotically joined #nim
10:02:34*krux02 joined #nim
10:04:01*laaron quit (Client Quit)
10:04:28*laaron joined #nim
10:07:57*narimiran quit (Ping timeout: 240 seconds)
10:11:54*Kaivo quit (Quit: WeeChat 2.6)
10:18:57*krux02 quit (Remote host closed the connection)
10:21:18*lf-araujo joined #nim
10:26:01*laaron quit (Remote host closed the connection)
10:29:35*laaron joined #nim
10:35:00lqdev[m]Zevv: wow, seeing all the neat changes done to npeg I want to try doing something with it again
10:38:55*laaron quit (Quit: ZNC 1.7.4 - https://znc.in)
10:39:32*laaron joined #nim
10:44:53*laaron quit (Remote host closed the connection)
10:45:49*clyybber joined #nim
11:01:32*lf-araujo quit (Ping timeout: 265 seconds)
11:05:51*laaron joined #nim
11:06:45clyybberAraq: Is genObjectInit the right place for default field initialization?
11:08:21*solitudesf joined #nim
11:16:49*shomodj joined #nim
11:39:31*laaron quit (Quit: ZNC 1.7.4 - https://znc.in)
11:40:02*laaron joined #nim
11:44:53*laaron quit (Remote host closed the connection)
11:51:05FromDiscord<arnetheduck> rayman22201, re "Implicit conversions for const behave correctly now, meaning that code like const SOMECONST = 0.int; procThatTakesInt32(SOMECONST) will be illegal now. Simply write const SOMECONST = 0 instead." - 0.uint32 is still useful if you want to make type inference based on the type: `proc a(x: auto) = when x is uint32: ...`
11:51:49FromGitter<alehander42> so
11:51:55FromGitter<alehander42> i think semver is just not
11:52:00FromGitter<alehander42> that good for prog languages
11:52:05clyybberyeah
11:53:23FromGitter<alehander42> i start to agree with "add new functions/types, fix unsoundness/bugs" in minor
11:53:44FromGitter<alehander42> without changing existing api types/functions if possible
11:53:59FromGitter<alehander42> btw
12:00:43FromDiscord<arnetheduck> fwiw, the difference between a patch and a minor in semver is that a patch/bugfix release changes neither of API or ABI, whereas the minor allows addtions to api. in nim's case, you can't do additions really without breaking stuff because global namespace, so it's less useful of a distinction
12:02:01clyybberyeah
12:02:15FromDiscord<arnetheduck> in other languages that are more explicit about namespacing and importing, you can make a common sense argument that adding stuff is fine for minor patches, even if in languages with complex name resoltion (like c++) that _might_ break some unusual code
12:05:28FromDiscord<arnetheduck> there are ways you can categorize the degree of breakage with greater detail if you want to have a serious discussion - ie gcc uses a more granular scale of "breaks-invalid", "breaks-valid" etc for describing the compatibility implications - having a consistent and sound language about compatibility is a good starting point to approaching it more systematically than simply haveing opinions
12:14:24clyybberThats actually a great way of differentiating breakage
12:31:41FromGitter<alehander42> i agree
12:31:46FromGitter<alehander42> those should be defined precisely
12:32:52*ng0 joined #nim
12:33:16FromGitter<alehander42> that's why i hoped to categorize possible changes e.g. in "adding a new function , adding a new overload, changing an existing overload, adding a new warning, adding a new switch" etc and describe which of those is valid and not
12:38:20*nsf joined #nim
12:47:55FromGitter<iffy> @raymann22201 thanks for that code snippet (using ptrs to pass the SharedList between threads), but it has identical behavior to the original. LOG_FUNCTIONS is empty in the second thread.
12:54:01planetis[m]Hey nimmers check this out: https://github.com/b3liever/eminim
12:54:11planetis[m]new json to macro
12:54:30planetis[m]hope you like it, feedback very welcome
12:58:18lqdev[m]could you make it into a nimble package?
12:59:27FromGitter<iffy> Bah, I blame Node (again). If I create the threads in Nim, my original SharedList logger works, but if I let Node create the threads, it doesn't work.
12:59:44lqdev[m]also, it would be much more useful if it supported types like `Table` and `Option`
12:59:55lqdev[m]but it's a cool concept nonetheless
13:00:46*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:04:40*go|dfish quit (Ping timeout: 268 seconds)
13:05:27planetis[m]These can all be supported
13:05:43*leorize quit (Remote host closed the connection)
13:05:50*shomodj joined #nim
13:06:04planetis[m]case objects need some more work, but I dont use them
13:06:15*leorize joined #nim
13:22:31FromGitter<alehander42> imo case objects are very popular in some nim codebases
13:22:41FromGitter<alehander42> but i agree it depends on the authors
13:22:47FromGitter<alehander42> anyway, nice
13:23:05FromGitter<alehander42> does it work with ref object
13:27:34FromGitter<Bennyelg> (https://files.gitter.im/nim-lang/Nim/Jz2y/image.png)
13:27:50FromGitter<Bennyelg> but what if I want to populate something and it's not always arrived (in case it's not there)
13:33:29*dddddd joined #nim
13:34:06FromGitter<alehander42> please, copy messages and tag the people
13:34:37FromGitter<alehander42> images of chat probably cant be even viewed well by most people which are in irc
13:34:54FromGitter<alehander42> and they dont send a notification to the people you mention
13:36:16FromGitter<alehander42> hm, i didnt realize you cant modify options, good question
13:36:16*Vladar joined #nim
13:40:33*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
13:47:52*PMunch joined #nim
13:50:01planetis[m]alehander42, thanks i will add ref objects and tuples later :)
13:52:41*ng0 quit (Quit: Alexa, when is the end of world?)
13:53:40PMunchHuh, someone is doing live programming in Nim for Ludum Dare 45, anyone know who it is?
13:53:51PMunchCan't say I recognise the nick
13:55:14FromDiscord<treeform> Are they doing a good job?
13:55:43PMunchHaven't started yet
13:55:50PMunchhttps://www.youtube.com/watch?v=jr3W2NCR0AM
13:57:08FromGitter<alehander42> https://www.reddit.com/r/nim/comments/dc474g/nim_error_about_assignment_stumped/ we have to improve this error
13:57:29FromDiscord<exelotl> I'll be doing ludum dare in Nim one of these days X)
13:57:58lqdev[m]hey, another game jammer jammin' in Nim
13:59:29FromDiscord<exelotl> Btw can anyone help with https://github.com/nim-lang/Nim/issues/12315 ? The PR is marked as showstopper but I don't really know what to do now
14:00:33*leorize quit (Remote host closed the connection)
14:01:03*leorize joined #nim
14:05:53*Trustable quit (Remote host closed the connection)
14:07:08FromDiscord<treeform> Does that bug also breaks filestream?
14:14:38disruptekZevv: but, there's no way to specify a dev dependency, right? requirements doesn't require a version.
14:15:35FromDiscord<exelotl> @treeform doesn't seem like it, filesystem uses writebuffer instead of write
14:15:48FromDiscord<exelotl> *filestream
14:15:54FromDiscord<exelotl> Darn autocorrect
14:17:16FromGitter<Bennyelg> anyway to compile with --debug ? for more logs ?
14:17:17disruptekplanetis[m]: please rename it from `to` to something more domain-specific.
14:20:13disruptekkingherring's previous video was creating a cdn in c++, fwiw.
14:21:00FromDiscord<Lunar> Trying to install Nim 1.0.0 on Linux Cinnamon. I get the error: https://pastebin.com/N8fLukwe
14:21:25FromDiscord<Lunar> I've tried installing it via ``make`` and ``build.sh``
14:24:06FromDiscord<treeform> You probably need to install musl-dev.
14:24:15disruptekif you're using a git clone, then it's `sh build_all.sh`, but it looks like you have a dev include missing.
14:24:17FromDiscord<treeform> Does your Linux use musl?
14:25:04FromDiscord<Lunar> Fixed using ``sudo apt-get install python3-dev`` and ``dpkg -S limits.h | grep linux``
14:25:13FromDiscord<Lunar> Just following <https://github.com/jupyterhub/the-littlest-jupyterhub/issues/321>
14:25:42FromDiscord<Lunar> This package was from <https://nim-lang.org/install_unix.html> after downloading the prebuilt binaries
14:25:45FromDiscord<Lunar> x64 version
14:27:12FromDiscord<Lunar> Correction, I'm using Linux **mint**, not Linux **cinnamon**
14:27:20disrupteki don't know anything about the prebuilt stuff, but if it's prebuilt, then you don't need to build anything.
14:27:26disruptekthat's kinda the idea.
14:27:48FromDiscord<Lunar> That's what I thought too, however I keep getting the error that the package is misconfigured or something
14:27:56FromDiscord<Lunar> Let me get the error real quick
14:28:21FromDiscord<Lunar> Erm
14:28:25FromDiscord<Lunar> I can't get the error now
14:28:31FromDiscord<Lunar> Probably because I built it
14:28:31FromDiscord<Lunar> but
14:28:43FromDiscord<Lunar> Let me double check 😅
14:29:02disrupteki recommend building from a git clone.
14:30:39FromDiscord<Lunar> Weird... Now I can't even get the error
14:30:50FromDiscord<Lunar> When installing Nim, does it require internet?
14:30:56FromDiscord<Lunar> *After* downloading of course
14:30:57disrupteknah.
14:31:08FromDiscord<Lunar> That's what I thought
14:31:14FromDiscord<Lunar> I'm at a loss then
14:31:17FromDiscord<Lunar> Sorry guys
14:33:19disruptekthat's good news, right?
14:34:11FromDiscord<galen> Does anyone know what I'm doing wrong? After sucessfully compiling and running a program, the following compilation fails with "oserr.nim(94) raiseOSError
14:34:11FromDiscord<galen> Error: unhandled exception: The filename, directory name, or volume label syntax is incorrect.
14:34:11FromDiscord<galen> [OSError]". I'm on Windows 10
14:34:25disruptekyou need a later nightly build.
14:34:39disrupteksadly, the release build has a buglet on windows. the very one you ran into.
14:42:58*Romanson joined #nim
14:44:07*shomodj joined #nim
14:46:35FromGitter<Bennyelg> is it a bug?: ⏎ ⏎ ```code paste, see link``` ⏎ ⏎ ```/Users/benny/Downloads/Shani - check YIT - hebrew alt/Route.nim(155, 30) template/generic instantiation of `to` from here ... [https://gitter.im/nim-lang/Nim?at=5d98accb5173c33ca1727556]
14:47:17FromGitter<Bennyelg> can't I populate sub_trips with trips on a trip object ?
14:47:31disrupteki can't read gitter. can you use a pastebin?
14:48:19Zevvdisruptek: not sure about the dependency versions
14:49:07FromGitter<Bennyelg> https://pastebin.com/8p79uyBK
14:49:26disruptekthe versions don't matter, i was just wondering if there was a way to get dev deps installed upon `nimble develop`. sorry to waste you time; i annoyingly asked instead of doing my own research.
14:49:29FromGitter<Bennyelg> if I remove the sub_trips its working.
14:49:44FromGitter<Bennyelg> but i have subtrips which I want to assign too
14:50:00FromGitter<Bennyelg> it's a JsonNodes which Im trying to covert into objects
14:50:06disruptekthe error message is accurate.
14:50:08FromGitter<Bennyelg> for trip in dataSetJson["trips"]: ⏎ ⏎ ``` var moduleTrip = trip.to(Trip)``` [https://gitter.im/nim-lang/Nim?at=5d98ad9f940b4c2fc07d43af]
14:50:24disruptekyou will need to parse it manually if you want a self-referential object.
14:50:31FromGitter<Bennyelg> Bah
14:50:32FromGitter<Bennyelg> thanks
14:50:57disruptekyou might try this: https://github.com/b3liever/eminim
14:50:59disruptekit's new.
14:51:55FromGitter<alehander42> i discussed the semver thing in some prog lang channel
14:52:00FromGitter<alehander42> it does seem to me most people
14:52:17FromGitter<alehander42> see additions as fine in minor
14:52:21FromGitter<alehander42> but some dont of course
14:53:24disruptekZevv: i just ran into that same `foo.bar() versus bar(foo) in templates` bug. what's the deal with that?
14:54:41PMunchNot sure what bug you're talking about, but that sounds like the thing where foo would have to be type checked before figuring out which bar to call. But with bar(foo) it sees that bar takes an untyped argument
14:54:48*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
14:54:49ZevvI don't know, I've seen it before and worked around it, but I'm not sure what the cause is
14:55:30disruptekno, neither bar or foo is a template -- it's the UFCS inside a template.
14:56:22FromGitter<Bennyelg> I did it thanks. ⏎ Total Trips: 6857 ⏎ Total SubTrips: 9753 ⏎ Total Stops: 5101 ⏎ Total Routes: 441 ... [https://gitter.im/nim-lang/Nim?at=5d98af16940b4c2fc07d4b8f]
14:56:44ZevvPMunch, disruptek: I'll investigate a bit further, but it seems to work when calling from the same source file, not when imported
14:56:53FromDiscord<galen> thanks disruptek, what's the best way to update?
14:57:16disruptekgalen: i'm sorry, but i really don't know much of anything about nim on windows.
14:57:29FromDiscord<galen> Ok!
14:57:36disruptekis there a link for a nightly? those work.
14:57:43FromDiscord<galen> Whats a buglet btw?
14:57:57disrupteka very small bug.
14:58:00disrupteklike, a bugling.
14:58:03FromDiscord<galen> Right, makes sense
15:00:05Zevvdisruptek: https://nim-lang.github.io/Nim/manual.html#templates-limitations-of-the-method-call-syntax?
15:00:43Zevvbut for me it's not a template I'm invoking, just a proc
15:01:06disruptekme too.
15:01:52Zevvcan you minimize? I have no clue where to start, I'm in over my elbows when this happens
15:01:59disruptekeasily.
15:02:57disruptekthe one i hit was: `template foo(bar: typed) = var s: string; json.toUgly(s, bar.turnItIntoJson)`
15:03:12disruptekturnItIntoJson is likely optional, but included for completeness.
15:03:15FromDiscord<Lunar> I'm currently trying to break apart a string (giving me a char), then convert the char to an int. Error: https://pastebin.com/WwQjJFHm, Code: https://pastebin.com/8JSL0uWM
15:03:23FromDiscord<Lunar> Not really sure what's going wrong
15:03:39disruptek(and it was clearly s.toUgly() but i had to indicate json)
15:03:58Zevvfunny
15:05:20Zevvfor me its using this trivial stack implementation in some cases: http://ix.io/1XGn
15:05:34Zevvpop() can be used in s.pop(), but push not as s.push(...)
15:06:19disruptekdon't you mean s.frames[s.top-1].`field`?
15:07:34Zevvindeed. I don't mean s.frames[s.top-1].`field`
15:07:43disruptekokay.
15:07:47Zevv:)
15:08:00Zevvbut still, I can use this in some cases, but not in others.
15:08:05Zevvnot figured out yet what the difference is
15:10:04disruptekthat's crazy.
15:13:59disruptekthis makes absolutely no sense.
15:17:46clyybberZevv: Is that the bug from yesterday?
15:18:18disruptekoh shoot clyybber on the case
15:21:04ZevvI can't make any sense of it yet, need more time
15:21:51Araqs.frames.setLen s.frames.len * 2 ?
15:22:09Araqseq has this logic for you builtin, no need to reimplement it
15:22:27Araqpush is system.add
15:22:34Araqpop is system.pop, done
15:22:47Araqpeek is s[^1]
15:22:52clyybberAraq: Hey u there?
15:23:02disruptekmaybe this is his minimal repro.
15:23:05Araqobviously
15:23:50clyybberAraq: WDYT should I allow nkIdentDefs in semRecord?
15:24:05Araqyes
15:24:08clyybberk
15:25:49ZevvAraq: I forgot why I reimplemented it, but there was a good reason :)
15:33:10disruptekhow to do https://play.nim-lang.org/#ix=1XGv
15:35:54*nsf quit (Quit: WeeChat 2.5)
15:54:49Araqdisruptek: system.procCall
15:55:05ZevvAraq: I implemented stack because seq[] tries to shrink on pop, which is too much overhead
15:55:08disruptekoh right, thanks. 😀
15:55:41AraqZevv: it doesn't, all it does is it resets its internal length
15:57:00Zevvgood point, I'll check why I did it then
15:58:59disruptekah, procCall is in the multi-methods section.
15:59:05disruptekof the manual.
16:00:02clyybberWhy shoould procCall be needed?
16:00:43clyybberWhy is the conversion not sufficient?
16:01:06disrupteki dunno, but this isn't new. i just get bit by it every time. 😁
16:15:41shashlick@disruptek what's your timeline for nimgit2
16:16:29disruptekyou decide. it can be used to automatically bisect a package to find the performance regression.
16:16:55shashlickI have it working on Linux but not yet tested on win osx
16:17:09shashlickNeeds nimterop bug fixes
16:17:38disruptekoh, i don't expect to support !linux because i have no way to test it. 🤣
16:17:59shashlickSounds fair
16:18:00disruptekit provokes a bug?
16:18:06*PMunch quit (Remote host closed the connection)
16:18:41shashlickWell was super sluggish performance since regex search is slow in vm and libgit2 has 140k files
16:19:18shashlickSo had to outsource to nimgrep and find but obviously nothing works on osx on first try
16:19:36disruptekwow.
16:19:55shashlickIn the process I also broke nimarchive so yeah
16:20:42disruptekmaybe i should just speak to git?
16:22:05shashlickNah, this will work soon but no time this weekend
16:22:52disruptekthat's awesome, thank you.
16:23:06disruptekexcited to see what i can do with it.
16:31:31*thomasross quit (Ping timeout: 252 seconds)
16:37:42*thomasross joined #nim
16:45:37lqdev[m]anyone knows some very fast, dynamic texture packing algorithm?
16:45:57lqdev[m]dynamic = textures can be inserted at any point in time, not exactly preloaded
16:47:51clyybberlqdev[m]: I have a few, not sure what you mean with dynamic.. you mean the dimensions are not known beforehand?
16:49:27lqdev[m]I mean that I need to insert textures while the program's running, not ahead of time
16:49:58clyybberHmm, nope. But I think that should be relatively easy, since you can't do that close to optimal anyways
16:50:09clyybberJust need some fast heuristic
16:50:11lqdev[m]I found one and sent it to #nim-offtopic, but it only works with textures known ahead of time
16:50:58lqdev[m]that's the problem. I tried but ended up with something that works rather poorly
16:51:23clyybberPoorly in terms of performance or in therms of packing ratio?
16:52:33lqdev[m]performance
16:52:59lqdev[m]I don't care that much about ratio; but it would be nice if that were good too (and it is)
16:53:07lqdev[m]this is my current code https://github.com/liquid600pgm/rapid/blob/master/src/rapid/gfx/texpack.nim#L43
16:54:30clyybberlets continue in offtopic
16:54:42lqdev[m]OK
16:55:49*actuallybatman quit (Quit: leaving)
16:57:12FromDiscord<exelotl> sounds like it could be solved in a similar way to Object VRAM management on the GBA
16:57:17FromDiscord<exelotl> https://www.gamasutra.com/view/feature/131491/gameboy_advance_resource_management.php?page=2
17:04:01FromDiscord<exelotl> lqdev[m] oh maybe you want like a quadtree or something
17:05:04FromDiscord<exelotl> your page could hold one 2048x2048 texture, or four 1024x1024 textures
17:05:28FromDiscord<exelotl> and each of those can hold one 1024x1024 or four 512x512
17:05:31FromDiscord<exelotl> and so on
17:11:19FromDiscord<exelotl> I guess it does relate to the GBA article too. If you think in blocks of some minimum texture size (such as 8x8): when finding space for an 8x8 texture you can loop 1 block at a time. When finding space for a 16x16 texture you can loop 4 blocks at a time, etc.
17:11:55FromDiscord<exelotl> in order to avoid fragmentation
17:12:51clyybberexelotl: He doesn't have an upper bound for the width tho
17:14:49FromDiscord<exelotl> ah
17:18:32clyybberAraq: Is genObjectInit in cgen the right place for the default field initialization?
17:19:46Araqnot quite
17:20:07Araqthe usages of genObjectInit have code like:
17:20:14Araq linefmt(p, cpsStmts, "#nimZeroMem((void*)$1, sizeof($2));$n", ...)
17:20:23Araq linefmt(p, cpsStmts, "#genericReset((void*)$1, $2);$n", ...)
17:20:31Araqand that is what needs to be patched
17:20:50Araqand while you're at it, throw away 'genericReset', it's SLOW
17:21:05clyybberWDYM throw away? I know its slow :D
17:21:21Araqjust expand the assignments
17:21:37Araqlike x.fieldA = 0; x.fieldB = 0; x.fieldC = nullptr;
17:21:54Araqand then it's also clear when to use the overridden default value
17:22:09clyybberAh, sure.
17:22:20clyybberWhen is genericReset used as opposed to nimZeroMem?
17:24:37clyybberAh, I see. when it contains a gc ref
17:27:31*thomasross_ joined #nim
17:27:31*thomasross quit (Killed (adams.freenode.net (Nickname regained by services)))
17:27:31*thomasross_ is now known as thomasross
17:29:02*go|dfish joined #nim
17:31:56ZevvAh, now I remember araq, my stack was because of the price of setLen
17:33:06ZevvI only update an int, setLengthSeqV2() is a bit more expensive
17:33:10clyybberAraq: What exact purpose genObjectInit then, when we do #nimZeroMem or #genericReset before it?
17:37:42shashlick@disruptek - https://github.com/genotrance/nimgit2
17:37:49Araqclyybber: it sets the object's tag (aka runtime type info)
17:38:19shashlickyou need to install nimterop@#head since 2.0 isn't out yet
17:38:31clyybberAraq: Aaah.
17:38:48shashlickyou can install nimterop@#findspeed since it is much faster but it is broken on osx
17:39:14shashlick`nimble docs` will also generate docs for nimgit2 in build/htmldocs
17:47:03*narimiran joined #nim
17:54:11*Romanson quit (Quit: Connection closed for inactivity)
17:56:19clyybberAraq: Why does the compiler still use internalError instead of assert?
17:56:46Araqnot "still", it's the preferred way
17:57:14*NimBot joined #nim
18:07:14Araqclyybber: you can attach line info to it, etc
18:07:22Araqit's simply better
18:12:05clyybberOk
18:13:13clyybberAraq: How do I get the loc out of the field? For a linefmt to set the field to its default value?
18:17:12Araqit's complex crap, look at proc genRecordField
18:17:32Araqand vmgen.getNullValue
18:18:22FromDiscord<Kiloneie> Would it be correct if i were to say that "varargs" makes a container or an array, sequences temporarily ?
18:19:17FromDiscord<Kiloneie> i think it has to be a sequence... yay or nay ?
18:20:20disruptekhey that nim game is live: https://www.youtube.com/watch?v=jr3W2NCR0AM
18:22:09clyybberKiloneie: No, its an array
18:28:03*nsf joined #nim
18:43:01FromGitter<alehander42> Araq
18:43:24FromGitter<alehander42> did you ever had a plan to have like prebuilt "objects" for nim
18:43:57FromGitter<alehander42> like, prebuilding a module (like in C) or a lib(like crates in rust) and directly loading type/const state info from it
18:44:04FromGitter<alehander42> when compiling things that depend on it
18:44:09FromGitter<alehander42> instead of recompiling it
18:44:26FromGitter<alehander42> like, this is a bit different than IC
18:44:35FromGitter<alehander42> as you can reuse it between programs
18:44:40*absolutejam joined #nim
18:44:48FromGitter<alehander42> i dont have idea if this makes sense, so i am asking?
18:45:13Araqyes?
18:46:44*traviss quit (Quit: Leaving)
18:47:08*traviss joined #nim
18:49:42FromDiscord<Kiloneie> So you can't give it a value during runtime ? only compile time ?
18:51:40clyybberKiloneie: No, but the lenght is determined at compile time.
18:51:55clyybberYou cant just pass a sequence to an vararg.
18:51:56FromDiscord<Kiloneie> yeah that's what i meant okay good
18:52:05clyybbercool
18:53:02Araqalehander42: I considered it but it seemed even more work and there is no way around it anyway, we *must* cache complex macro results
18:56:33FromGitter<alehander42> Araq yes
18:56:36FromGitter<alehander42> that was my question
18:56:47FromGitter<alehander42> because i imagine two usecases?
18:57:19FromGitter<alehander42> 1 big projects: much easier to iterate if dependencies are not changed and not recompiled: iirc IC kinda solves that maybe
18:57:31FromGitter<alehander42> 2 paralelising compilation
18:57:56FromGitter<alehander42> how often do "complex macro resutls" arise
18:59:12Araqit's Nim, Nim is about macros. it's also a super useful language without macros but still
18:59:19FromGitter<alehander42> isn't it possible to somehow save those cache results as well and load them (maybe even directly memory-map them without deserialization)
18:59:34Araqoh not this again
18:59:50FromGitter<alehander42> well just wondering how hard is this all on theory
18:59:59FromGitter<alehander42> obviously nobody's doing it
19:00:12FromGitter<alehander42> actually implementing something like this :D
19:00:24Araqmemory-mapping solves nothing whatsoever, it's what you bring up when you have no clue, sorry to be blunt
19:00:37*lritter joined #nim
19:00:40Araqthe hard part is getting the logic right
19:00:58FromGitter<alehander42> its not very important, i just meant it as a possible small optimization
19:01:02FromGitter<alehander42> the point is the same
19:01:06Araqand the logic needs to be able to do *partial* reloads
19:01:08FromGitter<alehander42> save it and load it again somehow
19:01:38Araqreloading everything when nothing changed it easy, no need to do anything then, just reuse the built binary
19:02:06Araqthe problem is to reload the modules that didn't change and to compile the modules that did change
19:02:48Araqso if your data model is "wild sharing between modules" you're in world of pain
19:02:49FromGitter<alehander42> well yeah, in the beginning i imagined it could be easy to just prepass and calculate the full module dependency graph
19:02:57FromGitter<alehander42> but i forgot all the const time evaluation
19:03:23clyybberAraq: Dumb question probably, but why can handleConstExpr not deal with an nkIntLiteral?
19:03:33clyybberIs that intentional?
19:03:37Araqbtw Nim's model is "wild sharing between modules"
19:03:43Araq...
19:04:22FromGitter<alehander42> i imagined a much simpler world where a nim module maybe can't generate import / include from macros etc: only from simple const time define/switch checks
19:04:32Araqbecause Nim was written like you all write code, just 'ref's everywhere, we have a GC, no problems
19:05:21Araq"I don't want to think about memory management"
19:05:24FromGitter<alehander42> yeah, but i mean even if it was not
19:05:30FromGitter<alehander42> i dont even talk about memory management here
19:05:43FromGitter<alehander42> even if we imagine a totally new impl
19:05:44*thomasross quit (Ping timeout: 276 seconds)
19:06:02FromGitter<alehander42> i feel modules are still very interconnected on language level
19:06:29Araqbut I do, because that's the root issue. you "don't want to think about X" but you'll never get awesome software with this attitude.
19:06:43FromGitter<alehander42> its like you can have a macro invoking a compile time proc reading a file somewhere in the middle of module B which generates an import for A
19:07:11AraqhandleConstExpr delegates to 'expr' or 'genLiteral', clyybber
19:07:13FromGitter<alehander42> so you have to somehow start semchecking / running code in vm before you even know all the final dependencies of B
19:07:26*krux02 joined #nim
19:07:53FromGitter<alehander42> i am not saying this, i am saying that the problem i see doesnt have to do only with memory management, of course i care for that too
19:07:57clyybberAraq: Yeah, but it checks n.len and that crashes with nkIntLiteral
19:10:06clyybberI wonder which path nkIntLiterals normally take..
19:11:04FromGitter<alehander42> the problem is that i imagine if i could quickly generate a full correct graph of module imports/includes ⏎ then i could start running a subcomponent which
19:11:48Zevvheu, my compilation fails with "Hint: quit() called [QuitCalled]
19:12:08*thomasross joined #nim
19:12:27FromGitter<alehander42> runs vm , semchecks and saves state/types of a single module ⏎ and run this component in parallel for all modules that dont depend on each other
19:12:34FromGitter<alehander42> and then on the next of their children
19:12:34FromGitter<alehander42> etc
19:13:11FromGitter<alehander42> and then maybe run DCE or other things which require children to propagadate info to their parent modules
19:13:31FromGitter<alehander42> and then run the gen / ->C part in parallel again
19:14:26clyybberZevv: Lol, awesome error. Maybe you called quit in the VM?
19:15:07FromGitter<alehander42> maybe each module will maintain its own caches but on the other hand one would utilize all cores and those module caches would be small
19:15:49*Vladar quit (Remote host closed the connection)
19:15:50Zevvclyybber: No I didnt
19:16:15*thomasross quit (Killed (orwell.freenode.net (Nickname regained by services)))
19:16:28Araqclyybber: well it assumes an array/object/tuple
19:16:46Araqsimple literals are not materialized
19:16:56Zevvclyybber: hm it happens inside a newLit where I try to access a variant field that's not accessible
19:16:56*thomasross_ joined #nim
19:16:56*thomasross_ is now known as thomasross
19:16:59Zevvfunny
19:18:04FromGitter<alehander42> and yes i agree one can just not share wildly: just each module would save an self sufficient object with all of its exported defs and its children would load it
19:18:19clyybberAraq: Ah ok. So what should I use instead?
19:19:19Araqwell you only deal with atoms
19:19:52shashlick@disruptek did you get to try?
19:19:54Araqyou don't do: obj.a = [0, 0, 0], you do for (int i = 0; i < 3; ++i) obj.a[i] = 0;
19:20:41disruptekshashlick: no, did you push it somewhere?
19:21:01clyybberah, initLocExpr works
19:21:03disruptekah, i see it. will try it, thanks.
19:21:18*absolutejam quit (Ping timeout: 265 seconds)
19:21:31clyybber((NI) 7) = oo.v;
19:21:41clyybberlol
19:23:13FromGitter<alehander42> and i guess part of the current wild sharing can be replaced with some kind of id-s e.g. unique module id instead of module object ref, function header hash etc
19:24:35FromGitter<alehander42> what am i saying is, if nim was written today, generating "prebuilt" stdlib or parallely compiling several imports would be easier or no?
19:24:37disruptekshashlick: seems that nimble cannot read this .nimble.
19:25:57shashlickWhat version of nimble?
19:26:01shashlickNeed to update?
19:27:10disruptekdid you not release nimterop 0.2.0?
19:29:10disruptek... /home/adavidoff/git/nimgit2/nimgit2_23705.nims(23, 18) Error: cannot open file: nimterop/docs
19:29:15*absolutejam joined #nim
19:30:50disruptekoh, it's my local nimterop. my bad.
19:31:51*absolutejam quit (Read error: Connection reset by peer)
19:31:57disruptekyou are a sneaky devil, shashlick.
19:32:38FromGitter<alehander42> nimble
19:32:45FromGitter<alehander42> gets a lot of activity lately
19:33:45*absolutejam joined #nim
19:36:36Araqalehander42: I would focus on the "Packed AST" idea and cache the hell out of it and I won't bother with multi-threading
19:37:14FromGitter<alehander42> i guess what i am imagining might be similar to "packed" ast
19:37:24Araqyeah.
19:37:28FromGitter<alehander42> but i dont even talk about multithreading
19:37:54FromGitter<alehander42> but like running several "nim_module_compiler" binaries
19:37:56FromGitter<alehander42> in the same time
19:38:06FromGitter<alehander42> and just loading their results after that
19:38:08Araqand it's related indeed, when you do it right, you can parallelise it too
19:38:15FromGitter<alehander42> yeah, exactly
19:39:38*thomasross quit (Ping timeout: 240 seconds)
19:43:26FromGitter<EngelsDev_twitter> Hey
19:45:22*thomasross joined #nim
19:49:30clyybberHi
19:53:09*Jesin quit (Quit: Leaving)
19:53:27shashlick@disruptek I've merged to head but not tagged 0.2.0 yet
19:53:42disruptekseems that i can'get getHeader.
19:56:18shashlicknimble install nimterop@#findspeed
19:56:48disruptekdo i need to -d: some stuff even when you passed args to getHeader()?
20:00:06disruptekahh, it's git2 not nimgit2. 😁
20:04:27FromDiscord<Huuskes> is there any documentation that lays down the differences between c and cpp backends (is C still preferred?)
20:04:41clyybberNice, crude POC of default fields is working..
20:05:27clyybberAraq: Can I remove the nkSym from the Object Record kinds and instead always use nkIdentDefs?
20:06:06*lf-araujo joined #nim
20:06:07clyybberHuuskes: cpp has better performance with exceptions
20:08:01*lf-araujo quit (Remote host closed the connection)
20:11:32*narimiran quit (Remote host closed the connection)
20:11:53disrupteki can't make a -d:foo=bar work in nim.cfg is it only supported on the cli?
20:18:31shashlickShould work on nim.cfg
20:18:42shashlickgit2Git, git2DL
20:18:57disrupteki'm trying to -d:git2SetVer=0.28.3 but no luck.
20:19:13shashlickDownload or git
20:19:17disruptekDL
20:19:23disruptekbut that i can set just fine.
20:19:55disruptekit's working for me, the wrapper i mean, so thank you very much!
20:20:03shashlickExcellent
20:20:07FromGitter<alehander42> clyybber nice
20:20:12disrupteki just want to be able to force a version to code against.
20:21:21FromGitter<alehander42> clyybber
20:21:32FromGitter<alehander42> is there a spec? e.g. what kind of values can be given, only const?
20:22:56*shomodj joined #nim
20:23:20shashlickDl is based on url
20:23:25shashlickSee github releases
20:23:48shashlickGit is git tag
20:24:09disrupteki thought the DL url is composed with the version?
20:24:19Araqclyybber: hmmm, better use fieldSym.ast for the default?
20:24:25shashlickYes
20:24:31shashlickWhat's the error
20:24:49disruptekwell, if i don't provide a define for the version, then it cannot download that release.
20:25:11disrupteknimterop-0.2.0/nimterop/build.nim(553, 14) `version.len != 0` Need version for download url [AssertionError]
20:32:27shashlickYes you need to use SetVer
20:32:53disruptekyes, but i cannot determine the syntax with which to specify it in nim.cfg.
20:33:13shashlickhttps://github.com/libgit2/libgit2/archive/v0.28.3.zip
20:33:19shashlickTry the command line first
20:33:26disrupteki did. that works perfectly.
20:44:03shashlickOk remember the nim.cfg only loads for current module
20:44:06shashlickNot for imports
20:47:12disruptekthis is nuts. i cannot specify a build flag without replacing all the nimble tasks to build my app?
20:48:05shashlickCan you share location of your config file
20:48:39disruptekwell i haven't pushed anything, but it's the nim.cfg in the root of my golden package.
20:48:41shashlickThere is also setDefines
20:49:05*solitudesf quit (Ping timeout: 276 seconds)
20:50:31*uvegbot joined #nim
20:51:14*zyklon quit (Ping timeout: 240 seconds)
20:56:51FromGitter<Lecale> Hello world
20:57:10disruptek!eval echo "howdy lecale"
20:57:12*patrick_ joined #nim
20:57:14NimBothowdy lecale
20:57:20*phero joined #nim
20:57:25*phero left #nim (#nim)
20:57:32*patrick_ is now known as radsoc
20:58:17*Jesin joined #nim
21:07:10*shomodj quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:10:16*nsf quit (Quit: WeeChat 2.5)
21:20:01*radsoc left #nim ("Au revoir")
21:20:13shashlickLet me see
21:20:34*daddoo joined #nim
21:20:59*radsoc joined #nim
21:21:21shashlickDon't you need the leading - for the config commands
21:22:06disruptekno, and it doesn't help anyway.
21:24:51*radsoc quit (Quit: radsoc)
21:27:20lqdev[m]I'm not sure how I should deal with object construction in rod. I was thinking about a simple `new` keyword, that wouldn't be very difficult to implement for version 0.1.0
21:27:29lqdev[m]then I could improve it in newer versions
21:27:41lqdev[m]what do you guys think?
21:28:38Zevvooh 1.1 goes formal proving, go araq go!
21:30:55shashlickOk I'll try later
21:31:20shashlickAs long as you are unblocked
21:31:31disrupteki'm good for awhile, thanks
21:33:32shashlickCool
21:33:43shashlickI still need to get nimterop out officially
21:33:55shashlickLibgit2 was a good test case
21:34:01shashlickFound some limitations
21:34:16shashlickEvery wrapper prompts some more tuning
21:34:40clyybberalehander42: So far only constant values. It wouldn'nt be much harder to make runtime values possible too, but I'm not sure if thats a good idea.
21:34:51disruptekevery new program gives me a new nimble criticism.
21:35:35clyybberAraq: Yeah, that was my original approach, but then I have to compare all nodes in fieldSym.ast with the fields of the object.
21:37:30shashlickWhat's bothering you off late on nimble
21:38:57disruptekwell, i suddenly realized that after compiling it, it wasn't actually replacing the binary.
21:39:06clyybberAraq: Nevermind. I'll try that approach
21:39:29disruptekturns out it hid the binary elsewhere. then i removed the old binary and reinstalled the app and it didn't replace the binary in nimble's bin dir.
21:39:48disrupteknow that i'm running the right binary, i realize that i'm not successfully initializing libgit.
21:40:03*daddoo left #nim ("Leaving")
21:42:17shashlickAre you using nimble build
21:42:28shashlickI typically do nimble develop and build
21:42:38disruptekno, because i have to build it manually so that i can specify the version of libgit2.
21:42:55disruptekkinda irrelevant.
21:43:24*absolutejam quit (Ping timeout: 265 seconds)
21:51:12shashlickWhich file are you compiling
21:51:15shashlickLooking at your repo
21:51:20disrupteksrc/golden.nim
21:51:21shashlickAnd which dir
21:55:07shashlickAnd where is nimgit2 imported
21:55:31disruptekit's not, because i cannot make it work.
21:56:19disruptekie. i can call git_libgit2_init() but it throws an error which i can only read with git_error_last(), but that symbol isn't in the wrapper somehow.
21:57:33disrupteki thought maybe i was binding to my system libgit2 but, nope.
22:02:30*nif quit (Quit: ...)
22:02:40*nif joined #nim
22:05:52*nif quit (Client Quit)
22:06:03*nif_ joined #nim
22:11:04lqdev[m]anyone has some suggestions about my object constructor problem?
22:15:54clyybberlqdev[m]: What problem?
22:16:04clyybberOh, I see
22:16:19disrupteklqdev: your first impl doesn't need to be your last.
22:16:35lqdev[m]I was thinking about something similar to Nim, but I'm worried about syntax ambiguity
22:16:43clyybberWhy dont just make every object have a function that shares the name and constructs the object?
22:16:53lqdev[m]hmm
22:17:07lqdev[m]because field order is annoying
22:17:34clyybberWith optional names?
22:18:00lqdev[m]I want my first implementation to be simple, so that's sorta out of the question
22:18:27lqdev[m]I'll try doing what Nim does with `SomeObj(field1: 42, field2: "hello")`
22:20:01lqdev[m]though for implementation simplicity, I'll likely require all fields to be initialized
22:20:02lqdev[m]it can be improved upon later
22:21:56FromDiscord<Kiloneie> Here you go another tutorial video: https://youtu.be/THOQLLT9RJk
22:21:56FromDiscord<Kiloneie> Don't drink and drive people... or drink and make videos o,o.
22:30:43*thomasross quit (Ping timeout: 245 seconds)
22:34:22*thomasross joined #nim
22:43:01clyybbergn8
22:43:04*clyybber quit (Quit: WeeChat 2.6)
22:45:31disruptekshashlick: https://github.com/disruptek/golden/releases/tag/1.1.2 -- provide a git2SetVer define and this will attempt to link and init it, etc.
22:48:51*asymptotically quit (Quit: Leaving)
22:52:34*actuallybatman joined #nim
23:02:12*Jjp137 quit (Read error: Connection reset by peer)
23:04:25*Jjp137 joined #nim
23:10:57*krux02_ joined #nim
23:12:02shashlickNote that git2Static doesn't work until you rebuild which means deleting build
23:12:13shashlickCause their cmake only builds one or the other
23:12:42disruptekah i just did that and now everything's different.
23:12:55disruptekgot further but now i have a gcc error.
23:13:21disruptekstill not recognizing git_error i guess.
23:14:41*krux02 quit (Ping timeout: 250 seconds)
23:15:37shashlickI think nimterop isn't wrapping it
23:15:46shashlickJust add it manually to cOverride for now
23:15:52shashlickIf possible
23:16:03disruptektried the static build and now i get link errors; i need to add ssl and maybe something else.
23:17:27*drewr quit (Ping timeout: 264 seconds)
23:20:31disruptekokay, static is a mistake. 😀 after i add git_error in cOverride, how can i flesh out the object? i guess i need to export fields?
23:20:53disruptekokay, that works.
23:20:56shashlickYa need to add those to nimgit2
23:21:06shashlickDepends what cmake finds
23:21:36disrupteksegv when i try to access it, though. hmm.
23:21:52disruptekit might actually be null.
23:22:56*Jjp137 quit (Ping timeout: 240 seconds)
23:30:22disruptekomfg it's working. unlike all the other api methods, it returns the number of successful inits. a non-zero return is thus a signal of correctitude.
23:30:32disruptekunbelievable. no wonder there's no error. i'm an idiot.
23:30:42disruptekyou did it, shashlick, thank you again. 😁
23:49:37*actuallybatman quit (Quit: leaving)
23:50:44*actuallybatman joined #nim