<< 09-01-2020 >>

00:00:12FromDiscord<Clyybber> oh, thats more than I expected
00:00:17FromDiscord<Clyybber> thats plenty of space
00:00:26FromDiscord<exelotl> yeah! and we're not doing compression or anything yet
00:00:51FromDiscord<Clyybber> I have this weird old sd card lying around that has 32MB of space
00:01:04FromDiscord<Clyybber> I store my game on it, for funzies
00:01:10FromDiscord<Clyybber> "game"
00:01:36FromDiscord<exelotl> what does the game run on? xD
00:02:03FromDiscord<Clyybber> previously it was lua + loeve2d, then I started porting it to nim and vulkan
00:02:10FromDiscord<Clyybber> but got stock somewhere in engine development
00:02:38FromDiscord<exelotl> ah, classic move
00:02:47FromDiscord<Clyybber> and now I'm constantly switching between wanting to make a music thingy, compiler stuff, engine stuff and a roguelike
00:03:44FromDiscord<Clyybber> I think I'm gonna try implementing a framegraph next
00:15:47*krux02_ joined #nim
00:18:12*krux02 quit (Ping timeout: 248 seconds)
00:29:37FromDiscord<treeform> Does nim's CLI produce performance numbers that can be graphed over days? So we can see it going up or down over time?
00:30:01disruptekthat's the idea of golden, but i got side-tracked.
00:30:09disrupteki do test it every so often.
00:30:31FromDiscord<treeform> do you have a site with a graph?
00:30:46disruptekno, i don't.
00:30:58disrupteki tested openapi today; no significant slowdown.
00:31:53FromDiscord<treeform> disruptek, oh about jwt remember with the google openAPI thingy?
00:32:16disruptekgc:arc json test is ~2.8s versus ~2.2s markAndSweep.
00:32:23FromDiscord<treeform> disruptek, I did a ton of changes on my fork: https://github.com/treeform/jwt
00:32:48disruptekdoes it work?
00:33:04disruptekshould we switch to your fork?
00:33:09FromDiscord<treeform> disruptek, but it turns out that yglukhov done a ton on his, including using bareSSL instead of openSSL, https://github.com/yglukhov/nim-jwt
00:33:28disruptekyeah, we've been using his.
00:33:40FromDiscord<treeform> ok, I though you been using mine
00:34:09disrupteki had to fix something in his, too, but it was due to nim iirc. yours didn't work for me.
00:34:27FromDiscord<treeform> I cut down my lib to about 180 lines, his grew a ton because of bearSSL
00:34:58disruptekoh, y'know what it was?
00:35:07disruptekyou broke his use of base64 when you changed it in stdlib.
00:35:10disruptekfunny.
00:35:29FromDiscord<treeform> yeah 😦 maybe I was too rash with the change.
00:35:33disruptekanyway, if you would rather use yours, that's fine with me.
00:35:49FromDiscord<treeform> naa feel free to use what you feel is best
00:36:13disruptekok, just let me know if gcplat stops working. i don't really test it very often.
00:36:25disrupteki wrote a google search tool to test it, but that's it.
00:36:41FromDiscord<treeform> I don't use gcplat at the moment, some thing about the API makes it harder to use then just passing JSON.
00:36:46FromDiscord<treeform> Maybe we can talk about that more.
00:37:04disruptekyeah, it's not exactly polished.
00:37:04FromDiscord<treeform> I would like to use gcplat, but it's just too awkward at the moment.
00:37:28disruptekgive me some idea of how you want the code to look and we can change it.
00:37:43FromDiscord<mratsim> --gc:plat
00:38:42FromDiscord<treeform> Honestly I think its just easy to build json trees with *%{} while its hard to do so with nim objects. Also unclear how nils are handled.
00:38:52FromDiscord<treeform> Last time I tried to use it you and I ran into errors.
00:39:24disruptekwell, you can pass raw json to it right now.
00:39:41disrupteki think that's what you ended up doing because the alternative was for nilable fields to inherit default(T) values.
00:39:53disruptekand that might provoke a meaningless query.
00:40:37disruptekso what we can do is exclude fields that are equal to their default(T). that's one idea i had, i mean.
00:40:47FromDiscord<treeform> Google APIs are add in that the they take values in headers, in query params and in the post body...
00:41:07disruptekright, but gcplat handles that just fine.
00:41:17disruptekalso openapi handles that for any api.
00:42:30FromDiscord<treeform> well I think there are a ton of defaults that are not "true" defaults, but basically need to go there in order for it it work.
00:42:49FromDiscord<treeform> for example here, https://github.com/treeform/googleapi/blob/master/src/googleapi/sheets.nim#L34
00:43:44FromDiscord<treeform> `valueInputOption=USER_ENTERED` almost everyone should pass, but its kind of tribal knowledge that I think openAPI does not have?
00:44:27disrupteki don't follow...
00:44:49disruptekopenapi knows what that url means and how to fill it with values you've passed.
00:45:11FromDiscord<treeform> I am not sure it know that you need to pass X values to make it even work.
00:45:25FromDiscord<treeform> because google API is dumb and basically requires you to pass X=Y
00:45:29FromDiscord<treeform> if you don't know that it does not work
00:45:42disruptekwell, i know openapi works.
00:45:46disrupteki use it all the time.
00:45:58disrupteki mean, the bot is using it, as an example.
00:46:03disrupteknimph uses it.
00:46:24disruptekand my google api works fine.
00:46:30disruptek!repo disruptek/xs
00:46:31disbothttps://github.com/disruptek/xs -- 9xs: 11xstreamstartup.com 15 1⭐ 0🍴
00:47:09disruptekthe "tribal knowledge" problem is really that we don't know what defaults we should assume for these inputs.
00:47:09FromDiscord<treeform> no your work is great, I am saying google as a company exposes an API that is hard to use.
00:47:23disruptekokay, just checking.
00:47:46disruptekone thing is, there is an enum syntax that i don't think my openapi code really knows how to work with.
00:47:48FromDiscord<treeform> so you almost have to wrap it into some thing else in order to use it first.
00:47:52disrupteki can't remember if that is fully implemented.
00:48:03disruptekyeah, i mean, we could make it so it's option-based.
00:48:12disruptekthat's a totally plausible and complete solution afaik.
00:48:26disruptekbut i don't know if i like the way that api looks, to use.
00:48:35disruptekmaybe it's not crazy.
00:48:55disruptekalso, we could support it alongside the other two apis -- json-based and raw nim-type based.
00:49:22disrupteki just pictured tons of .some everywhere.
00:49:34disruptekmaybe we use a maybe.
00:50:37disruptekmaybe that's how we solve the representation of nil in JsonNode.
00:52:24*couven92 quit (Quit: Client Disconnecting)
01:17:02disruptekgc:arc is still 3.9s versus 1.4s for the base64 benchmark.
01:22:35*krux02_ quit (Remote host closed the connection)
01:28:17*icebattle quit (Ping timeout: 268 seconds)
01:40:45*icebattle joined #nim
01:43:49*icebattle quit (Read error: error:1408F119:SSL routines:ssl3_get_record:decryption failed or bad record mac)
01:48:02FromDiscord<treeform> My base64 lib?
01:49:09disruptekstdlib, yeah.
01:55:18*ng0 quit (Quit: leaving)
02:02:12*gangstacat quit (Ping timeout: 248 seconds)
02:17:25*lxbarbosa quit (Remote host closed the connection)
02:19:56FromDiscord<treeform> What do you think makes it slower?
02:34:41*icebattle joined #nim
02:36:15FromGitter<codenoid> evening
02:41:28*icebattle quit (Ping timeout: 258 seconds)
03:08:45*uu91 quit (Remote host closed the connection)
03:18:54*gangstacat joined #nim
03:54:05*marmotini_ joined #nim
03:55:48*muffindrake quit (Ping timeout: 248 seconds)
03:57:48*thomasross is now known as Guest9174
03:57:48*thomasross_ joined #nim
03:57:48*Guest9174 quit (Killed (hitchcock.freenode.net (Nickname regained by services)))
03:57:49*thomasross_ is now known as thomasross
03:58:06*muffindrake joined #nim
04:16:48*marmotini_ quit (Ping timeout: 265 seconds)
04:49:11*dddddd quit (Remote host closed the connection)
04:50:13*thomasross_ joined #nim
04:50:13*thomasross quit (Killed (orwell.freenode.net (Nickname regained by services)))
04:50:13*thomasross_ is now known as thomasross
04:52:11*gangstacat quit (Quit: Ĝis!)
04:52:26*nsf joined #nim
04:55:51*gangstacat joined #nim
05:36:50*thomasross quit (Ping timeout: 240 seconds)
05:38:24*thomasross joined #nim
05:43:29*narimiran joined #nim
05:49:17*ltriant quit (Quit: leaving)
05:56:12*marmotini_ joined #nim
06:01:12FromGitter<IamRifki> Question: When do I use Const?
06:01:38FromGitter<IamRifki> I understand Let and Var
06:01:44FromGitter<IamRifki> but I'm puzzled with const
06:03:12narimiranfor compile-time constants. see if this maybe helps: https://narimiran.github.io/nim-basics/#_immutable_assignment
06:31:17*Jjp137 quit (Read error: Connection reset by peer)
06:31:45*Jjp137 joined #nim
06:42:46*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
06:46:32FromGitter<matrixbot> `silvernode` Procrastination, for the last 3 weeks I have been putting off continuing learning nim so shame on me.
07:25:10*icebattle joined #nim
07:29:44*icebattle quit (Ping timeout: 258 seconds)
07:31:13*solitudesf joined #nim
07:31:40*PMunch joined #nim
07:53:02*marmotini_ quit (Read error: Connection reset by peer)
08:00:00*gmpreussner quit (Quit: kthxbye)
08:05:06*gmpreussner joined #nim
08:10:20*marmotini_ joined #nim
08:28:23*marmotini_ quit (Remote host closed the connection)
08:32:59FromGitter<adilhasan> Hello I have a quick question. Does anyone else have problems logging into the nim-lang forum? For me the login panel is greyed out.
08:34:58*kapzyl joined #nim
08:35:28*kapzyl quit (Client Quit)
08:41:06*JustASlacker joined #nim
08:41:39FromGitter<garuse> hello. does anyone knows an online nim ide that works?
08:43:58FromGitter<adilhasan> Hello @garuse I am not sure if the playground helps https://play.nim-lang.org/
08:46:47*xet7 quit (Remote host closed the connection)
08:47:49*xet7 joined #nim
08:50:58*ng0 joined #nim
08:50:58*ng0 quit (Changing host)
08:50:58*ng0 joined #nim
08:52:44*xet7 quit (Remote host closed the connection)
08:52:59FromDiscord<demotomohiro> Hello garuse, Wandbox also has Nim https://wandbox.org/
08:53:42*xet7 joined #nim
08:54:01*floppydh joined #nim
08:59:13solitudesfdaily reminder that repl.it is still on 0.17
08:59:57Araq0.17 was good enough for everybody
09:05:35FromDiscord<Rika> keyword: was?
09:07:58*Vladar joined #nim
09:16:32FromGitter<alehander92> so what happened with os:standalone
09:16:58FromGitter<alehander92> much less important than other stuff, just wondering if a consensus was reached :P
09:17:05*marmotini_ joined #nim
09:17:12*marmotini_ quit (Read error: Connection reset by peer)
09:17:19*marmotini_ joined #nim
09:18:19*tiorock joined #nim
09:18:19*tiorock quit (Changing host)
09:18:19*tiorock joined #nim
09:18:19*rockcavera is now known as Guest31271
09:18:19*Guest31271 quit (Read error: Connection reset by peer)
09:18:19*tiorock is now known as rockcavera
09:21:52PMunchsolitudesf, the playground is up to the latest pushed tag at any time (hopefully) :)
09:26:11*marmotini_ quit (Remote host closed the connection)
09:26:37*marmotini_ joined #nim
09:28:36*marmotini_ quit (Remote host closed the connection)
09:28:43*marmotini_ joined #nim
09:29:32*uu91 joined #nim
09:30:56*marmotini_ quit (Remote host closed the connection)
09:31:23*marmotini_ joined #nim
09:36:04*marmotini_ quit (Ping timeout: 268 seconds)
09:41:43Zevvaraq, you got a few seconds for me?
09:42:10ZevvI'd like to get rid of this allocator object if possible, you mentioned something was legacy there
09:42:38Zevvand what should I change in osalloc to make it not wrong
09:43:13*JustASlacker quit (Ping timeout: 245 seconds)
09:46:57*marmotini_ joined #nim
09:50:47AraqZevv, hi
09:51:18AraqI don't understand the question, the allocator is not required but it's also not harmful as it understands -d:useMalloc
09:52:17*marmotini_ quit (Ping timeout: 268 seconds)
09:56:15*krux02 joined #nim
09:56:19*marmotini_ joined #nim
09:57:12federico3Araq: do you see my point about exceptions in https://github.com/nim-lang/RFCs/issues/180 ? Maybe the same safety features can be enabled using nim.cfg instead of a new compiler flag?
09:57:13disbotβž₯ Introduce safety modes
09:58:04Araqprobably not, no. -d:release keeps the runtime checks (since version 0.20 or something)
09:59:26ZevvAraq: it's not harmful per se, but I was hoping to really minimize memory usage so PMunch can put it in its atmel AVR as well
10:00:55Zevvit is now wasting 13 whole kilobytes on this 'allocator'
10:01:39*rubendv joined #nim
10:02:05Zevvfor a lot of targets a bit more code in the .text segment is ok, but RAM is often scarce
10:02:57federico3Araq: my point is that there should be a simple way to ensure safety. The manual is unclear on this.
10:03:35Araqhow is it unclear? there is 'addr', 'ptr' and 'cast', everything else is safe
10:03:49PMunch13 kilobytes is waay to much to be paletable on AVR chips
10:04:04federico3Araq: I'm referring to "Whether a checked runtime error results in an exception or in a fatal error is implementation specific"
10:04:10AraqZevv, where do the 13KB come from?
10:04:51ZevvThe MemRegion `allocator`
10:05:01Araqok so remove it
10:05:36Araqbut it doesn't come from allocators.nim
10:05:41Araqhence my confusion
10:05:58federico3Araq: with some flag or config for safety, the developer should be reassured that risks in RFC #4 are handled
10:06:09Araqfederico3, well it depends on the implementation, currently on the --exceptions switch
10:06:21Zevvno it comes from mmdisp
10:06:56federico3Araq: I get it. I'm saying that, without some global flag, there's no obvious way to ensure good safety.
10:07:23AraqI consider the little wiggle room that the spec gives us is essential for Nim targetting both small and big machines
10:07:36federico3e.g. the developer has to keep up to date with various flags and compiler changes over time and something can slip
10:08:20Araqmeh, he only has to keep up with the changelog when we actually change the defaults
10:09:20Araqand we don't change the defaults frequently, it'll be a new major release
10:10:00Araqbut more importantly: what's the difference between 'raise' and 'quit' when it comes to "safety"?
10:12:26federico3it's a huge difference in how unexpected errors, including bugs, can be recovered. Very often large parts of a program can fail with an exception but the core functions keep running. Without this assurance, a less important component can crash the most important one
10:13:11federico3(and it's enough to completely rule out Nim as an option if that cannot be avoided :( )
10:13:51Araqif Nim is rules out because of that, what isn't ruled out?
10:15:29federico3a lot of languages would very rarely crash out and are used for relatively critical stuff. Python for example.
10:16:34Araqnot sure I'm buying it :-)
10:17:21Araqwho knows how many paths to exit() exist in Python's > 100_000 C codebase
10:17:53federico3not enough to be a problem in production
10:18:17Araqah so it was tested well and then put into production
10:18:54Araqcan we shorten this discussion a little
10:19:17Araqjust say it directly: You want to be able to recover from bugs.
10:19:32AraqThis is a fair thing to want.
10:20:14*marmotini_ quit (Remote host closed the connection)
10:20:40*marmotini_ joined #nim
10:22:07federico3Araq: sorry if I didn't make it more clear. Part of the safety aspect is to be promised that new version of the compiler will not get less safe (at least not without a very big warning)
10:24:57AraqI probably lived too much in internet-land where "exceptions are bad" and "stack unwinding and cleanup cause code bloat"
10:25:24*marmotini_ quit (Ping timeout: 268 seconds)
10:26:32Zevvjust depends on who you ask
10:27:10FromGitter<sheerluck> I like Nim regardless of safety. It brings fun back
10:27:49federico3(on a side note, Nim could probably use the effect system to detect unexpected calls to quit() or similar disasters)
10:31:34Araqhow about this: we push for intrinsics so that we can really get the cost down to "1 instruction per call"
10:32:06Araqand then continue to map IndexError to a catchable exception
10:32:07*rubendv quit (Remote host closed the connection)
10:33:02*marmotini_ joined #nim
10:36:59Araqfederico3, ok, sorry, I'm beginning to understand your point
10:37:12AraqI would prefer to use a different term as "safety" is overloaded
10:37:19Araqbut I get it now
10:37:42federico3oh I see.. I meant safety in general, not memory safety strictly speaking
10:38:15*Vladar quit (Remote host closed the connection)
10:38:38*Vladar joined #nim
10:39:51Araqsomebody wrote an RFC introducing a "recover" statement that can deal with "subsystem" failures
10:40:09Araqbut then we have both 'try' and 'recover'
10:41:00ZevvAraq: I could probably you just get there now with some arch specific inline asm
10:41:10Zevvenglish is hard
10:41:17Zevvs/you could probably just get there now/
10:41:50Zevvso to get the proof of concept right and do performance tests
10:42:14Zevvand fallback to the current implementation when you have no asm available for a target
10:42:54Araqinline asm targetting labels inside the C code?
10:42:59Araqdoes that even work?
10:43:56Zevvit might be possible to add an asm-level label as well
10:44:29Zevvgood question though :)
10:47:22federico3https://github.com/nim-lang/RFCs/issues/77 this one?
10:47:23disbotβž₯ [RFC] Exceptions that inherit from `system.Defect` should not be tracked
10:49:21ZevvAraq: works on gcc: http://ix.io/26Vd
10:49:47Araqfederico3, no but yeah there has been plenty of discussion on this topic
10:50:36AraqZevv, not good enough, this messes with GCC's control flow graph, I think
10:51:21Araqand who knows what optimizations are disabled just because the function contains the __asm__ keyword
10:51:42Zevvsure
10:52:19*krux02 quit (Remote host closed the connection)
10:54:24*krux02 joined #nim
10:54:57*krux02 quit (Remote host closed the connection)
10:58:18FromDiscord<inv> Hello. Quick PR into nimble: https://github.com/nim-lang/nimble/pull/761
10:58:19disbotβž₯ Run can work without additional option if only one bin in .nimble
11:01:22*dddddd joined #nim
11:26:32*marmotini_ quit (Remote host closed the connection)
11:26:50*marmotini_ joined #nim
11:30:02*marmotini_ quit (Remote host closed the connection)
11:30:29*marmotini_ joined #nim
11:35:04*marmotini_ quit (Ping timeout: 258 seconds)
11:44:28*nsf quit (Quit: WeeChat 2.7)
11:45:59*lritter joined #nim
11:55:25*marmotini_ joined #nim
11:56:51*marmotini_ quit (Remote host closed the connection)
11:56:58*marmotini_ joined #nim
12:05:04Zevvwell, pretty neat: I'm just able to use stdlib basics in the linux kernel as-is
12:05:08Zevvseqs, exceptions, all works
12:06:19FromGitter<alehander92> ohh
12:06:21FromGitter<alehander92> example?
12:07:52Zevvlemme push some suff
12:08:34Zevvhttps://github.com/zevv/nim-linux-kernel/blob/master/src/hello.nim
12:09:21Zevvonly needed to stuff some trivial stdlib stuff: https://github.com/zevv/nim-linux-kernel/blob/master/src/stubs/stubs.c
12:09:40Zevvso now we ask someone to do nimterop on the linux headers and all is well :)
12:10:51FromGitter<alehander92> hm, what is an example of an useful kernel module
12:11:17FromGitter<alehander92> like, i see how it is useful, but i cant think of an obvious simple example
12:11:30Araqmove httpbeast into the Linux kernel to remove the context switch overheads
12:11:30Zevvit's more about running nim in an 'alien' environment
12:11:59ZevvI could as well have put it on a bare ARM chip, but I'm visiting my mom for the week and don't have any hardware here :)
12:12:15FromGitter<alehander92> probably good for even finergrained debugging/tracing stuff
12:12:49FromGitter<alehander92> your mum cooks her own hardware chips right
12:13:49Zevvpotato chips, yes
12:14:17FromGitter<alehander92> now thats a foreign environment for a runtime
12:14:44FromGitter<alehander92> ok workk
12:18:41*kahiru quit (Ping timeout: 265 seconds)
12:20:57Zevvcan I pull my own Nim branch through CI without PR'ing to upsteam?
12:22:52Araqdunno I'm awaiting your PR
12:23:40*kahiru joined #nim
12:24:22ZevvI don't dare PR'ing
12:24:27Zevvit's full of shit
12:27:01Araqso ... who can patch llvm and gcc and add some intrinsics?
12:27:15Zevvbut please feel free to help me out: https://github.com/zevv/Nim/commit/4c99533a31e60d49c27fada126bee3c5bca17cc1
12:28:09Zevvfor the mmdisp path I felt it made sense to join the 'nogc' and 'useMalloc' path since that has most of the stuff in place. But that branch of the 'when' was broken already so it might be dead in practice.
12:28:32Zevvthen I had to disable your addQuitProc/SIGABRT hack for the gotoBasedExecptions
12:28:47Zevvand I still don'not know how to fix osalloc, you said I did that wrong
12:28:57Zevvapart from those things, stuff "works for me"
12:29:27ZevvI also moved some things around in excpt to prevent tempFrames from being put in RAM when no excpetions are used
12:29:36Zevvno *stack traces*, that is
12:30:58Araqyeah, seems really useful
12:36:09Zevvso, I'll just PR it like this and see what burns
12:36:41Araqsure
12:47:57AraqZevv, the addQuitProc hack isn't required anymore anyway
12:48:16Araqmight as well remove it and see if it breaks a test
12:49:10Zevvhow is it done now then?
12:49:45Zevvanway, removed it, see what happens
12:50:08Araqby compilerproc injection into main()
12:50:11*abm joined #nim
12:50:45Zevvgood. I'm also running with nomain, let me check what I miss then
12:52:00*lxbarbosa joined #nim
12:54:34FromGitter<zah> https://www.reddit.com/r/programming/comments/em93ke/c_as_assembly_20_hello_nim_a_generalpurpose/
12:55:31FromGitter<zah> Viktor's latest talk on Nim has been uploaded, let's uptove him
12:56:01*Hideki_ joined #nim
12:57:49narimiran@zah thanks for the link, i shared it on twitter
12:58:34FromDiscord<Rika> updooted
12:58:48FromDiscord<Rika> zah, are you dyslexic? ;w;
13:01:14FromDiscord<Rika> is this a small event? the reactions sound pretty weak ;;
13:02:44*uu91 quit (Remote host closed the connection)
13:05:54*Vladar quit (Quit: Leaving)
13:08:27*marmotini_ quit (Remote host closed the connection)
13:08:53*marmotini_ joined #nim
13:09:46FromDiscord<Rika> YOU CAN BORROW EVERYTHING?!?!?
13:10:09FromDiscord<Rika> god ive been writing macros to do that wtf
13:10:09Zevvas long as you bring it back
13:10:47FromDiscord<Rika> zevv ;; no i mean you can borrow all procs of a T of a disctint T
13:10:49*ptdel joined #nim
13:10:58Zevvyeah I know :)
13:11:02FromDiscord<Rika> ;;
13:11:06FromDiscord<Rika> bully
13:11:07PMunchHaha
13:12:05PMunchLooks like a pretty big event just from the very first seconds
13:12:13FromGitter<alehander92> Rika its not the world cup mate
13:12:48FromGitter<alehander92> <3
13:13:23PMunchOh wow, that joke from the host without any laughter..
13:13:26FromGitter<alehander92> btw Araq is there a particular reason func cant report the internal side-effect call on error
13:13:35*marmotini_ quit (Ping timeout: 258 seconds)
13:15:28FromDiscord<gingerBill> "C++ as Assembly 2.0" That's a weird title.
13:15:52PMunchNot really, Nim targts C/C++ instead of Assembly
13:15:55FromDiscord<gingerBill> "C as Assembly 2.0" is more correct and pretty much the true. Most architectures kind of target C now as its "virtual platform"
13:16:06PMunchAh that's fair
13:16:24FromDiscord<gingerBill> Nim targeting C is fine.
13:16:24PMunchBut I guess this might be a C++ based event
13:16:33FromDiscord<gingerBill> Could be.
13:16:56FromDiscord<Rika> alehander92, ive never listened to more than 10 talks
13:17:45PMunchDefinitely seems C++ heavy at the very least: https://codedive.pl
13:17:53PMunch(if you look at the schedule)
13:19:41FromDiscord<gingerBill> Looks like a good talk!
13:20:03FromDiscord<Rika> its info dense but i dont know, the conveying of the information isnt that good
13:20:30FromDiscord<gingerBill> `{} braces? really? :D (nitpicking...)` Ha
13:21:02FromDiscord<gingerBill> I like `{}` or off-side rule. I prefer `{}` but I'm not bothered. Having written enough Pascal-family code with `begin` and `end`, I am not writing that ever again.
13:21:55FromDiscord<gingerBill> If I had the choice between the three styles, that is.
13:21:57FromDiscord<Rika> offside ~= braces >>>>>>>>>> end/begin keywords
13:22:11PMunchHmm, pattern matched borrow would be nice.. Like borrow everything where this type is the only argument.
13:22:48FromDiscord<gingerBill> But I'm not really bothered by syntax the end of the day.
13:25:56FromDiscord<treeform> @gingerBill what are your thoughts on exceptions? Say, vs explicit error returns. Are they good/bad?
13:28:29FromGitter<alehander92> no need for begin/end with indentation
13:30:44*kungtotte quit (Read error: Connection reset by peer)
13:31:13*marmotini_ joined #nim
13:33:27*Hideki_ quit (Remote host closed the connection)
13:33:33*kungtotte_ joined #nim
13:34:21*Hideki_ joined #nim
13:34:40FromDiscord<Clyybber> Zevv: sneak in an os:sanic alias
13:35:25ZevvSanic (the Hedgehog)?
13:36:40FromDiscord<Clyybber> yeah
13:38:24FromDiscord<gingerBill> @treeform I have am article on that: https://www.gingerbill.org/article/2018/09/05/exceptions-and-why-odin-will-never-have-them/
13:38:28FromGitter<sheerluck> https://github.com/huge-success/sanic
13:38:53*Hideki_ quit (Ping timeout: 258 seconds)
13:39:20narimiranZevv: i see you're the xkcd fan :)
13:39:33*marmotini_ quit (Remote host closed the connection)
13:39:59*marmotini_ joined #nim
13:40:16Zevvyou are *what*?
13:40:48FromDiscord<gingerBill> To add the article, exceptions are good in dynamic languages because of the lack of static typing. They add a way of doing a "switch" statement on types.
13:40:52*marmotini_ quit (Read error: Connection reset by peer)
13:40:59*marmotini_ joined #nim
13:41:00narimiranZevv: today's comic https://xkcd.com/
13:41:26FromDiscord<gingerBill> "good" is the wrong term but more of a the least worse compromise
13:41:29Zevvnah, it is just my hobby: whenever I mention anyone called "<name> the <x>", I put "The <x>" in parentheses, like I added it as a clarification
13:41:54narimiran:P
13:43:37Zevvcan anyone verify if http://ix.io/26W0 crashes on devel?
13:44:30narimiranZevv: prints "caught" on the playground with the latest devel: https://play.nim-lang.org/#ix=26W1
13:45:45Zevvyeah I tested playground as well
13:45:46Zevvthus my confusion
13:47:37*rockcavera quit (Ping timeout: 265 seconds)
13:47:37FromGitter<IamRifki> Advice on doing Composition in Nim?
13:47:56FromGitter<IamRifki> All the examples I saw are about inheritance
13:48:14FromGitter<mratsim> just use proc
13:48:41FromGitter<IamRifki> wdym?
13:49:11FromGitter<mratsim> foo().bar().baz()
13:49:19FromGitter<mratsim> function calls compose naturally
13:49:25FromGitter<IamRifki> Oh
13:49:26FromGitter<IamRifki> I see
13:50:42Zevvwell. I compile this snippet in /tmp and it crashes. I compile it somewhere else and it doesn't. \o/
13:52:12Zevvwell there was a nim.cfg in the dir wher it *didn't* crash :(
13:52:51*ng0_ joined #nim
13:52:51*ng0_ quit (Changing host)
13:52:51*ng0_ joined #nim
13:54:59*ng0 quit (Ping timeout: 258 seconds)
13:56:35FromGitter<gogolxdong> Someone saw https://www.youtube.com/watch?v=8SoJR3sCaR4 ?
13:57:33disruptekZevv: wut
13:59:31FromDiscord<Rika> im almost done watching the whole thing
14:00:27FromDiscord<Rika> i liked the C++ discussion portion but it felt like an advertisement to me, i dont know, im prolly being unreasonable
14:00:33*nsf joined #nim
14:02:58FromDiscord<Rika> ok at the qna, the talk improved massively during the C++ discussion, i like it, very nice talk
14:03:15PMunchnarimiran, "latest" on the playground is not devel
14:03:21PMunchIt is the latest tagged version
14:03:21narimiranPMunch: oh!
14:03:52*rockcavera joined #nim
14:04:01Zevvdisruptek: no clue, still hunting
14:04:16*Hideki_ joined #nim
14:05:18*thomasross quit (Ping timeout: 260 seconds)
14:06:02*floppydh quit (Quit: WeeChat 2.6)
14:07:55PMunchHey, he's using my protobuf package :)
14:08:50Zevvyay, you got a user, congrats!
14:08:58PMunchHaha
14:09:15PMunchI'm also surprised about the amount of people who seem to use `dumpAstGen`
14:10:14FromDiscord<Rika> your protobuf package is pretty good though so its no surprise he presented it
14:10:23AraqgingerBill: well "Exceptions require unwinding the stack; this is much slower when an exception happens compared to the fixed small cost of a return value." is objectively false
14:10:36FromGitter<onqtam> I'll greatly appreciate any feedback on what to improve in the talk, since I'll probably be giving it at least once more in 2020
14:11:11disrupteki'm just scanning through this video at 2x, but it seems like the best intro to nim that i've seen boiled down to 1hr.
14:11:15PMunchRika, thanks :) Haven't actually used it much myself
14:11:54PMunchonqtam, cool talk, but you sound a bit stressed to begin with (goes very fast)
14:12:00Zevvarrrgh. There was a fake setjmp.h in my /tmp which got included :)
14:12:35FromGitter<onqtam> well it was an awful lot of content to go through in 1 hour... I always push it too far. I don't know what to cut out of it :|
14:12:39PMunchI'm at about 28m in now, and you've slowed down considerably to a more comfortable pace
14:12:51PMunchYeah that's always the hard part!
14:13:00disruptekit's hard, no doubt.
14:13:46Araq"One β€œadvantage” many people like with exceptions is the ability to catch any error from a block of code" that's also wrong, the virtue of exceptions that they enable function composition
14:14:12disrupteklet's talk when #11081 works.
14:14:13disbothttps://github.com/nim-lang/Nim/issues/11081 -- 3DateTime field on Exception produces inconsistent C/++ handling ; snippet at 12https://play.nim-lang.org/#ix=20PX
14:14:26Araqyou can dislike exception all day long, I don't mind, I personally don't like it either.
14:14:39PMunchSome nitpick, you say that procedures are functions in Nim. Which makes sense in a C++ context, but Nim also has functions (with the `func` keyword), they are just closer to what a functional language would call a function. And you mention that parenthesis are optional when calling, but you don't mention the universal call syntax
14:14:47*thomasross joined #nim
14:14:51Araqbut I dislike false statements even moreso.
14:14:58disrupteki dislike it as much as i dislike anything that introduces three different behaviors from one piece of code.
14:15:41disruptekbelieve me, i wouldn't have created the ticket if i wasn't trying to use exceptions. i wouldn't have tried to use exceptions if i didn't think they had a place.
14:15:51PMunchI had some more nitpick as well, but I've forgotten it :P
14:16:40FromGitter<onqtam> I think I do mention UCS at slide 8: https://slides.com/onqtam/hello_nim#/8
14:16:51FromDiscord<mratsim> coming soon, Araq removes "when false" from the language as it's a false statement
14:17:17FromDiscord<Rika> lmao
14:17:27FromDiscord<Rika> araq removes bools as they allow for false statements
14:18:07Araq"This means that the culture of pass the error up the stack for β€œsomeone else” to handle. I hate this culture ..." this is not a "culture" thing, you can count how often you *have to* pass the error up and can make it the default action. I thought programming is about automation.
14:18:36PMunchonqtam, oh yeah you do mention that func(obj) == obj.func()
14:19:06PMunchI forgot about that, maybe a throwback to that when you mention that func(obj) == func obj
14:19:46Araqdisruptek, I have a fix for that in the works (finally!)
14:19:57disrupteknice.
14:20:01Araqbut supporting 2 or 3 different exception implementations is costly...
14:20:40disrupteksadly, it's a cost every programmer has to bear if they want people to be able to use their exceptions on 3 different implementations that yield different behavior.
14:20:54FromDiscord<treeform> @gingerBill thank you for the link!
14:23:20FromDiscord<Clyybber> One can think of `raise e` as `result.exc = e; return e` no?
14:23:37*thomasross quit (Ping timeout: 268 seconds)
14:23:39FromDiscord<Clyybber> So its completely equivalent?
14:23:45AraqClyybber: exactly
14:23:58FromDiscord<Clyybber> s / return e / return
14:24:22Araqthere is an isomorphism to 'return' (and indeed I don't like 'return' either)
14:24:36FromDiscord<Clyybber> Its bail-out-control-flow
14:24:41Araq(but I'm not removing it from Nim)
14:25:21FromDiscord<gingerBill> @treeform No problem.
14:25:57*thomasross joined #nim
14:26:13FromDiscord<Clyybber> So `try except` could be thunk of as a macro that checks every call in a body for an .exc in its result
14:26:37FromDiscord<treeform> well an parent functions too
14:26:42FromDiscord<treeform> all the way up to main
14:26:59FromDiscord<Clyybber> So theoretically we could try to unify Result[T] and exceptions
14:27:32FromDiscord<treeform> its like each function can returns 2 things result and and exception and everyone everywhere checks for them
14:27:40FromDiscord<Clyybber> yeah
14:27:56FromDiscord<treeform> I like exceptions in scripts that are meant to be used only once in a while
14:28:23FromDiscord<treeform> at my day job, Data Analysis, stuff that happens a ton.
14:29:06FromDiscord<Clyybber> What I wonder about, is what is faster, exceptions or result
14:29:10FromDiscord<treeform> soo many one off scripts
14:29:21FromDiscord<mratsim> We can keep Result and Exceptions, Result makes sense in places were you a failure is normal (user input)
14:30:35FromDiscord<treeform> @gingerBill I like your Memory Allocation Strategies 1-4 reading now.
14:31:39FromDiscord<mratsim> Ha, I knew I knew this @gingerBill name, it was from Odin
14:33:45*Hideki_ quit (Remote host closed the connection)
14:34:02*thomasross_ joined #nim
14:34:02*thomasross quit (Killed (livingstone.freenode.net (Nickname regained by services)))
14:34:02*thomasross_ is now known as thomasross
14:34:23*Hideki_ joined #nim
14:35:23FromDiscord<treeform> I met @gingerBill face to face at Handmade con in Seattle. He seemed cool.
14:36:46*floppydh joined #nim
14:37:13FromDiscord<gingerBill> Thank you πŸ™‚
14:37:42FromDiscord<gingerBill> I need to upload Part 5, the most technical of the series, explaining virtual memory and how it works and how to use it.
14:38:30*ng0_ is now known as ng0
14:39:28*Hideki_ quit (Ping timeout: 268 seconds)
14:45:04FromDiscord<gingerBill> Regarding exceptions, as my article points out, my issue is not with how they are implement (even if unwinding the stack is not great), but how to use them. Handling "errors" ought to be just the same as handling any other code. I don't like languages that treat "error values" as special in terms of either exceptions (`Exception`) or error types (`error`)
14:46:49PMunchonqtam, not really your fault, but some of the questions could be answered better :P
14:47:57FromGitter<onqtam> couldn't agree more :D ⏎ it doesn't help that I'm not active around Nim. Any specific corrections? I'll probably get asked similar things in the future
14:48:55FromDiscord<treeform> @gingerBill its a valid view point. Thank you for the article.
14:48:57FromDiscord<mratsim> @gingerBill, for your pool allocator article, the "free" does not need to have the pool as argument if you align the pool to power of 2, and the backing buffer is intrusive.
14:48:57FromDiscord<mratsim> Then you can just modulo the alignment to get the pool data structure head
14:49:21FromDiscord<mratsim> this way you have the same API as malloc/free
14:49:41PMunchonqtam, hold on, I'll have to rewatch it
14:49:57FromDiscord<treeform> @mratsim, I think he was following his allocator API
14:50:01FromDiscord<treeform> which other allocators share
14:50:58FromDiscord<gingerBill> @mratsim The backing buffer is intrusive but useful in many cases. I usually make it a switchable thing, keep it on during development and see what is "leaking". As for the power of two thing, that is true. My pool was mainly the show the logic rather than make something efficient.
14:52:33*thomasross quit (Ping timeout: 260 seconds)
14:54:28AraqgingerBill: well I no interest in your excuses. you claimed exceptoin handling is slower than return values but since you can map exception handling to return values it's objectively false.
14:58:08*thomasross joined #nim
14:58:39Araqthere are enough valid reasons to exclude exception handling from a language, you don't have to make up falsehoods
14:58:52FromDiscord<gingerBill> That's not what I meant.
14:58:55FromDiscord<treeform> hmm looking at the {.noSideEffect.} I wonder if its possible to create something like {.noLeaks.} or {.noObjectsEscape.} pragma, in the --gc:arc world that can make sure that no heap allocated objects can leak out, so everything that had a sink/lent pair is accounted for.
14:59:16FromDiscord<gingerBill> Zig (another language) has pretty much exception-like behaviour but by returning the error code as part of the type system.
14:59:33FromDiscord<gingerBill> It's a clever approach and pretty much the best approach _iff_ you want exception-like error handling.
15:00:02Araqit's largely the same as Java's checked exceptions or Nim's exception tracking
15:00:20FromDiscord<gingerBill> So I am not sure what "falsehoods" I am making up you speak of.
15:00:51FromDiscord<treeform> falsehood: exceptions are slower then return values?
15:01:05AraqI quoted the sentences from your article.
15:05:09FromDiscord<gingerBill> Exception handling in most implementations is slower. Trampolines and stack unwinding is not free.
15:05:09FromDiscord<gingerBill>
15:05:09FromDiscord<gingerBill> Encoding it in the return value is not the same as what most people commonly mean by "exceptions".
15:05:52Araqthere are different implementation strategies to do it, what "people commonly mean" is irrelevant to me.
15:06:04FromDiscord<treeform> onqtam, I don't know if you are taking criticism, I really dig the slides, but on https://slides.com/onqtam/hello_nim#/22 I think the title() and the p() ... the () could go a way just like you do with p "Example" to make it look cleaner.
15:06:17AraqI would expect that commonly they don't know the implementation at all.
15:06:34FromDiscord<gingerBill> Araq: ignoring the "common meaning" is irrelevant to me πŸ˜›
15:07:16Araqwhen you just made it up, then yes.
15:08:40FromDiscord<gingerBill> Also, I didn't see your quote of my text. I was sorry about that. It got lost in the messages.
15:08:52Araqhttps://swtch.com/~rsc/regexp/regexp1.html "Regular Expression Matching Can Be Simple And Fast
15:08:52Araq(but is slow in Java, Perl, PHP, Python, Ruby, ...)"
15:09:07FromGitter<onqtam> treeform, ofc I take criticism - I'll collect a bunch of such notes for changes to apply to the slides for the future.
15:09:18Araqso now what? it is common knowledge that regexes are slow?
15:09:28Araqshould we all avoid regexes because of that?
15:09:33disruptekis it normal for my object initialization to zero memory twice? just two redundant nimZeroMem calls on the same addresses.
15:09:45ZevvNoo, we move to NPeg instead!
15:09:48Araqdisruptek, yeah and it's optimized away, I checked it
15:09:53disruptekokay.
15:09:54FromDiscord<gingerBill> You are arguing about the abstract idea of exceptions rather than the implementation.
15:10:09FromDiscord<gingerBill> Zig, is a brilliant example of "exceptions" done correctly, in my opinion.
15:10:29FromDiscord<gingerBill> My issue is that I don't like the "unstructured" (wrong term) nature of exceptions.
15:10:42Araq*shrug* in my opinion Swift got it right.
15:11:08Araqand Nim of course :P
15:11:28FromDiscord<gingerBill> Of course πŸ˜›
15:11:36*Hideki_ joined #nim
15:11:40FromDiscord<gingerBill> Nim's approach is very good.
15:11:46FromDiscord<gingerBill> If you like that kind of thing.
15:12:01*ng0_ joined #nim
15:12:01*ng0_ quit (Changing host)
15:12:01*ng0_ joined #nim
15:12:48shadowbaneC++ is my gold standard for what exceptions should look like. Nim's exceptions are largely similar.
15:13:10FromDiscord<gingerBill> So my statement in my article is not "objectively false", but it does assumes a particular view of what an "exception" is and its implementation.
15:13:34Araqit's really false, sorry.
15:13:47FromDiscord<gingerBill> So unwinding the stack is fast now?
15:14:00Araqit's a 'return' either way.
15:14:10Araqis 'return' now really slow and to be avoided?
15:14:50*ng0 quit (Ping timeout: 240 seconds)
15:14:51*endragor_ quit (Remote host closed the connection)
15:15:18*thomasross quit (Killed (orwell.freenode.net (Nickname regained by services)))
15:15:18*thomasross joined #nim
15:15:49shadowbaneStack unwinding speed depends on the approach taken for stack unwinding. C++'s table based stack unwinding is slow because it is pessimized to optimize the non-throwing case. Implementations that don't assume non-throwing and optimize for that are much faster for the throwing case, but slow down the non-throwing case a bit.
15:16:25Araqand they slow it down by that 'bit' that you otherwise do manually.
15:17:57shadowbaneI'm pretty sure that people have put together benchmarks and C++ exceptions are slower than if checks and returns if you have lots of throws, but if you don't have errors the code using exceptions will be faster than the manual if/return error checking code.
15:17:57FromDiscord<gingerBill> Would you be happier if I made a caveat that "most implementations of exceptions are slow"? My issue is that of the languages that implement exceptions, very few implement it in the basic approach you are talking about.
15:18:14FromDiscord<gingerBill> In theory, a stack unwind should be fast as N-returns.
15:18:57Araqwell as it happens, Nim got a faster implementation, C++ is getting one too, Swift already has one and Java and C# always were good at it iirc
15:19:42shadowbanegingerBill: Why? Should the compiler not optimize for what it can recognize as the hot path (the non-error case) if it means that the cold path is slower?
15:21:25AraqgingerBill: but I'll be happy indeed if you fix your article
15:22:15PMunchonqtam, my replies to the questions you were asked: http://ix.io/26WD
15:22:36Araqwe already have enough new languages that lack exceptions or automatic memory management just because LLVM happens not to ship with it and both are somewhat hard to implement (but then so is a good register allocator)
15:22:39*PMunch quit (Quit: Leaving)
15:22:55FromGitter<onqtam> PMunch, much appreciated, will use in the future :)
15:23:07*marmotini_ quit (Remote host closed the connection)
15:24:27Araq(but LLVM has a register allocator so I don't get to read articles like "why X will make you do your own register allocation and it'll make your systems more reliable")
15:25:52disruptek~intro is C++ as Assembly 2.0; one of the better Nim introduction talks, by Viktor Kirilov at code::dive 2019: https://invidio.us/embed/8SoJR3sCaR4 (~1hr)
15:25:53disbotintro: 11C++ as Assembly 2.0; one of the better Nim introduction talks, by Viktor Kirilov at code::dive 2019: https://invidio.us/embed/8SoJR3sCaR4 (~1hr)
15:26:25Zevvthat's what *you* say. I find it overly dense and on the chaotic side.
15:26:26FromDiscord<treeform> onqtam, about "Q: Can you introduce Nim gradually?" I would add js and make it C/C++/JS. I been gradually eating my large JS app by replacing it with nim (js compiled) functions.
15:28:41FromGitter<onqtam> btw on the exceptions debate - have you come across this post? ⏎ http://nibblestew.blogspot.com/2017/01/measuring-execution-performance-of-c.html
15:30:02*Hideki_ quit (Ping timeout: 240 seconds)
15:31:59disruptekokay, i think i know what this arc bug is.
15:32:06disruptekhere's my theory:
15:32:52Araqonqtam: I remember reading it
15:32:56Araqbut thanks for sharing
15:34:43disrupteki think the problem is that we're assuming that we can scribble on sunk iterator variables, but maybe my c data is clashing with that assumption somehow.
15:37:07Zevvdisruptek: do you have something small failing?
15:37:31disrupteki mean, i would call it small but it's not minimal.
15:37:39disruptekgittyup test.
15:37:52Zevvshare?
15:37:58disruptek!repo disruptek/gittyup
15:38:00disbothttps://github.com/disruptek/gittyup -- 9gittyup: 11higher-level git bindings that build upon nimgit2 15 0⭐ 0🍴
15:38:32FromDiscord<Clyybber> disruptek: I think I know your bug
15:38:32Zevv"Error: Exception raised during nimble script execution" ?
15:38:45FromDiscord<Clyybber> Or reasons for your bug
15:39:01disruptekthe iterator yields Result[ValueType, ErrorType] and my value type os an object that holds a ptr to a c-alloc'd c struct.
15:39:13disruptekclyybber: do tell.
15:39:23FromDiscord<Clyybber> x = a[i]; inc i; a[i] = y
15:39:34FromDiscord<Clyybber> here those two statements are wrongly sinked
15:39:36FromDiscord<gingerBill> Dwarf
15:39:36FromDiscord<gingerBill> SJLJ,SEH
15:39:54FromDiscord<gingerBill> Ignore that random thing
15:39:54FromDiscord<Clyybber> well for the first one its wrong
15:40:19Araqclyybber: can we get a bugfix for that that is not part of your refactorings?
15:40:25FromDiscord<Clyybber> it is part
15:40:26*thomasross quit (Ping timeout: 240 seconds)
15:40:30FromDiscord<Clyybber> oh
15:40:40FromDiscord<Clyybber> umm, kinda tricky
15:40:56FromDiscord<Clyybber> because its not enough to patch isAnalysableFieldAccess
15:41:07FromDiscord<Clyybber> it also affects firstWrite analysis
15:41:19Araqok
15:41:55AraqgingerBill: that's like saying regexes are slow because of Perl
15:43:51FromDiscord<mratsim> Is there a way in macros to know if LHS will be returned?
15:43:51FromDiscord<mratsim> I need to know that to improve allocation on stack/heap of my futures/flowvars.
15:44:27Araqwhat do you mean?
15:44:48Araqmacros cannot go up in the AST
15:45:05disruptekpretty sure he knows this. 😁
15:45:16Araqindeed
15:45:56FromDiscord<mratsim> let's say we have "let foo = spawn(myFunc(a, b, c))
15:45:56FromDiscord<mratsim> foo will be a flowvar for the result of myFunc
15:45:56disruptekhe wants a hint. i guess it might not be that hard to provide, but it could later be wrong due to evaluation of the ast post-macro.
15:46:08disruptekso i don't think it makes sense as a feature.
15:46:24FromDiscord<mratsim> but I need to know if foo will outlive the current scope or not
15:46:33disruptekwelcome to the party.
15:46:46Araqmratsim: I used 'parallel' + spawn for that
15:47:06FromDiscord<mratsim> well parallel is a magic, and spawn too so I can't use them
15:47:11Araqand so I know inside 'parallel' there is a join at the end and nothing outlives
15:47:30FromDiscord<mratsim> ah
15:47:33FromDiscord<mratsim> I see
15:47:34Araqof course you cannot use them, but you can reimplement them
15:47:37disruptekthat's clever.
15:48:03FromDiscord<mratsim> so parallel is just a named block that define something that tells spawn that nothing will escape?
15:48:28disruptek~nimcache is the best way to figure out where it is located is to specify that location with --nimcache
15:48:28disbotnimcache: 11the best way to figure out where it is located is to specify that location with --nimcache
15:49:04FromDiscord<mratsim> well, I guess it's simpler for me to always allocate them on the heap, or just say that futures/flowvars cannot escape the spawning function.
15:49:30FromDiscord<mratsim> and maybe relax that later when there are escape analysis
15:49:33FromDiscord<gingerBill> Araq: I think how we view the world is quite different. "X is not hypothetically slow, but the vast majority of real world implementations of X are slow" My first question is "why was it implemented the way it was and not a faster way?". My second question is "what is the cost to implementing it the faster way?". My third question is "if the implementation of this instantiation of 'X' is very different to the commonly known implementatio
15:50:03disruptekerror: buffer exhausted
15:50:45FromDiscord<gingerBill> I am not a big fan of these "definition fights". They just end up arguing of minute semantic things which at the end of the day is not the most productive thing.
15:53:25*ng0_ is now known as ng0
15:54:18Araq"vast majority of real world implementations" is highly debatable but I have no desire in continuing this conversation either
15:55:30Araqso go and allocate registers manually because GCC 1.0 did it poorly, I don't care.
15:55:56FromDiscord<gingerBill> Hahaha
15:57:19FromDiscord<gingerBill> I don't agree with your analogy but okay πŸ™‚
15:57:29*floppydh quit (Quit: WeeChat 2.6)
15:59:58*nsf quit (Quit: WeeChat 2.7)
16:01:01*Trustable joined #nim
16:01:26*NimBot joined #nim
16:04:41*lxbarbosa quit (Ping timeout: 252 seconds)
16:11:21*marmotini_ joined #nim
16:12:38disruptekclyybber: i don't see how your bug points to my bug.
16:13:12FromDiscord<Clyybber> disruptek: I thought many of your bugs are related to iterators?
16:13:43FromDiscord<Clyybber> disruptek: maybe you don't see the a[i] but its there, in the generated code
16:13:59disruptekwhat does it represent?
16:14:09FromDiscord<Clyybber> array/seq access?
16:14:22disruptekthese iterators aren't arrays.
16:14:40*icebattle joined #nim
16:14:53FromDiscord<Clyybber> do you never do `for e in someseq` ?
16:15:11disrupteki do, but that's not where my bug is.
16:15:25FromDiscord<Clyybber> oh, I thought you were hittin multiple bugs
16:15:33FromDiscord<Clyybber> and worked around a few
16:15:33disrupteki wouldn't rule that out.
16:15:55disrupteki've been slowly tightening everything up memory-wise to reduce my surface.
16:16:09disruptekhere's my scenario:
16:16:48disrupteki have a lazy iterator that fetchings some git data (c) and wraps it in a Result and yields it.
16:16:58disruptekanother lazy iterator is consuming that and yielding another Result.
16:17:27disrupteki'm trying to save the values in an array, and after adding a value to that array, i dump the array.
16:17:44disruptekafter the third value is added, corruption is noticed.
16:17:56FromDiscord<Clyybber> hmm
16:17:58disruptekto render the values, i need to call into c.
16:18:33disruptekthere are lots of c calls sprinkled on these iterators.
16:20:56*marmotini_ quit (Remote host closed the connection)
16:32:07ZevvI'm kind of trying to get truly minimal overhead when doing nim on small systems. Currently the biggest stuff is pulled in by the exception handling to print unhandled exceptions: some dollars, addInts. I'm now at 14K .text, 696 bytes .data and 392 bytes .bss. Does it make sense to persue this, are we *really* targeting 8 bit cpus from the 90's?
16:32:30Araqyeah we are
16:40:10disrupteki have a debug branch where there's no seq holding these objects; i still get a double free just trying to render an iterator value.
16:40:24*Hideki_ joined #nim
16:40:27*endragor joined #nim
16:44:50*endragor quit (Ping timeout: 240 seconds)
16:45:00*Hideki_ quit (Ping timeout: 265 seconds)
16:49:26ZevvDid yo mama never tell you? "Little disruptek, boi, do'nt render iterator values when theres no seqs holding objects!"
17:03:02disruptekhttps://github.com/disruptek/gittyup/commit/8324854adbdd58f3c03b1b27414b38154dd3c9c2#diff-3624edfe32a9fc6d2fb4d9f62f2d5aebL1430
17:04:14disruptekthe comment is misleading, actually.
17:04:32disruptekit's the gc that crashes after two iterations.
17:07:01*Vladar joined #nim
17:12:25*marmotini_ joined #nim
17:17:44*Kaivo quit (Quit: WeeChat 2.7)
17:20:21*kapzyl joined #nim
17:20:48Zevvok, how can I reproduce?
17:21:09disruptekclone debug branch and try to run the test with and without arc.
17:21:22ZevvI can't even install nimgit2 :( ... Reading as ini file failed with:
17:21:22Zevv ... Invalid section: .
17:21:23disrupteki use --exceptions:goto in both cases to minimize disturbance.
17:21:33disruptekyes, welcome to the ecosystem.
17:21:46disrupteki'm pushing another simplification.
17:22:49Zevvthe problem is in nimgit2?
17:22:58Zevv Error: Could not read package info file in /tmp/user/1000/nimble_1434713/githubcom_genotrancenimgit2/nimgit2.nimble;
17:23:15disruptekno, that's just snafu.
17:23:36disruptekdon't feel you have to get this stuff working if you don't have the time.
17:23:41ZevvI have time
17:23:47disruptekbut if you want to get sorted, i'm happy to help do that.
17:23:55*tane joined #nim
17:23:55Zevvand I can't stand your complaining here all the time
17:24:00disrupteklol
17:24:15disruptekthe thing is, there aren't enough people bloodletting over this shit.
17:24:15Zevvwell, hold my hand then: how the hell do I install nimgit2?
17:24:20disruptekare you using nimph?
17:24:25Zevvnope, not yet
17:24:32disrupteknimble install nimterop
17:24:43FromDiscord<mratsim> complain to nimble, there is a thread with 50 replies on that issue
17:24:52Zevvthat will help I guess
17:25:00stefantalpalaruHow can I initialise a FFI Nim object in one go, for it to work with const members in the C struct that it represents? I need something like "struct foo f = {1, 2}" but Nim generates multiple assignments instead ("struct foo f; f.bar = 1; f.baz = 2;"). This is obviously rejected by the C compiler.
17:25:01disruptekyeah, that'll help a lot.
17:25:01Zevvok, my nimterop is old, one moment
17:25:14*abm quit (Ping timeout: 240 seconds)
17:25:25*abm joined #nim
17:25:26FromDiscord<mratsim> https://github.com/nim-lang/nimble/issues/696
17:25:27*abm quit (Remote host closed the connection)
17:25:28disbotβž₯ fails to evaluate .nimble file ; snippet at 12https://play.nim-lang.org/#ix=26Xa
17:25:32Zevv#metoo
17:26:03disruptekhonestly, i just don't even bother submitting issues anymore.
17:26:15disruptekit was easier to write a new package manager.
17:26:26Zevvwell, the fun I have: Prompt: Build failed for '[email protected]', would you like to try installing 'nimterop@#head' (latest unstable)? [y/N]
17:26:33disruptekhey, why not.
17:26:46Zevvfailed breaking your leg, do you want to break an arm instead?
17:26:58*FromGitter quit (Read error: Connection reset by peer)
17:27:07Araqstefantalpalaru, put it into a 'const f = ...'? I am sure I don't understand the question
17:27:17*FromGitter joined #nim
17:27:58disruptekwhy does it say it doesn't want to build?
17:28:06Zevvcourse not
17:28:19disrupteklol
17:28:34Araqhttp://mcg.cs.tau.ac.il/papers/amir-levy-msc.pdf narimiran, Latex document detected ;-)
17:28:35disrupteki had to reparse both your response and my question.
17:28:49Araq(page 18)
17:29:21disrupteknothing will ever work if you don't have nimterop installed in ~/.nimble/pkgs
17:29:33Zevvrm -rf ~/.nimble
17:29:55disruptekyou can do that, but even with nimph, you can't get around it.
17:30:04disruptekdue to gentotrance/nimterop#154
17:30:39Zevvok that helped
17:30:48Zevvnimgit2 now also installs
17:31:13stefantalpalaruAraq, the C definition is something like "struct foo {const int bar; const int baz;}" so these const members can only be initialised all at once and never changed again.
17:31:17disruptekokay, good.
17:32:18Zevvok, "nimble test"?
17:32:30disrupteki gues.
17:32:36Zevv/tmp/gittyup/gittyup.nim(30, 8) Error: cannot open file: results
17:33:03narimiranAraq: hahaha, classic :D
17:33:08disrupteknimble install https://github.com/disruptek/results
17:33:27disrupteki wouldn't bother with nimble test; it's verbose and designed for travis.
17:33:35disruptekjust nim c -r tests/tgit.nim
17:34:14disruptekso the current situation is that if the loop loops, gc double frees on scope cleanup.
17:34:23disruptekif the loop doesn't loop, everything is fine.
17:34:50Zevvthere you have it: [FATAL] unpaired dealloc
17:34:55disruptekalso -d:debugGit to see some hot pointer on pointer action.
17:35:46Araqstefantalpalaru, ok well, Nim doesn't support that (yet?), we target C89
17:36:47Araqyou can usually come far when you ignore the .header business and target the ABI instead
17:38:34stefantalpalaruNot in this case.
17:41:01stefantalpalaruAs an API user, I can only provide a VM by initialising this struct: https://github.com/ethereum/evmc/blob/eb64e60621cc347d6ba7d15bc7272a02ad498c7e/include/evmc/evmc.h#L855
17:43:54stefantalpalaru"Maybe write more Nim code." :-) https://github.com/status-im/nim-libbacktrace/issues/1
17:43:55disbotβž₯ success_callback has memory leaks
17:44:07stefantalpalaruOh, how the mighty have fallen back to C...
17:44:23*endragor joined #nim
17:46:24*kapzyl quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/)
17:48:30FromGitter<Albus70007> can somebody help me to install nimtorch? or reference me a guide different to the README one?
17:49:27Zevvdisbot: not sure how much you found out yet
17:49:39Zevvdisarm thing at line 574 triggers the boom
17:50:23*thomasross joined #nim
17:50:32disrupteknot for me.
17:51:31disruptekwhat i cannot understand is that if you just break after one trip through the loop, it's fine. two trips? no beuno.
17:51:46disruptekbut, disarm doesn't do anything.
17:52:14Zevvthen my gdb is talking nonsense
17:52:17disruptekit's just supposed to be a semantic indication that the gc can cleanup the target; it's an `x = nil` template.
17:54:27ZevvBWAAH it makes my nvim crash. I HATE NVIM
17:55:21*Hideki_ joined #nim
17:55:27*kungtotte_ is now known as kungtotte
17:55:44Zevvok, what gdb ment to say is the leaving the 'free()' proc triggers the crash
17:55:48Zevvdisarm was simply the last statement
17:56:03disruptekwhat is it they say?
17:56:09disruptekleave free and die hard?
17:56:26Zevvdie hard III
17:56:32disruptekdie hard free()
17:57:59Zevv:)
17:58:12*nsf joined #nim
17:59:10leorizeZevv: why is your nvim keeps crashing :p
17:59:33Zevvbeats me
17:59:38*Hideki_ quit (Ping timeout: 240 seconds)
17:59:44ZevvI don't have the patience to figure that out
18:00:12leorizemy nvim used to crash a lot, then it stopped doing that for whatever reason :P
18:04:24ZevvGOOD FOR YOU
18:05:04disrupteki think my nvim doesn't do completion anymore.
18:08:02*tane quit (Ping timeout: 240 seconds)
18:08:21Zevvdisruptek: the 'unpaired' error is thrown because of a global counter keeping track of the number of allocs alive
18:08:36Zevvthe free when it throws is not necisserily the one *causing* the issue, i guess
18:08:56leorizedisruptek: did you switch it to manual then forget to trigger it when you need? :p happens to me a lot
18:10:54Araqstefantalpalaru, well as a last resort there is always .emit
18:14:18*abm joined #nim
18:19:22stefantalpalaruYeah.
18:19:51*Trustable quit (Remote host closed the connection)
18:20:36nisstyreis there a reason the terminal package doesn't include a proc to get the cursor position? Too hard to make it cross-platform?
18:24:34FromGitter<Albus70007> how do i set my exe to receive some args: (-port)
18:24:55FromDiscord<mratsim> @Albus70007, the easiest way to install nimtorch is probably through conda
18:25:09FromDiscord<mratsim> for command-line arguments
18:25:12FromDiscord<mratsim> !repo cligen
18:25:13disbothttps://github.com/c-blake/cligen -- 9cligen: 11Nim library to infer/generate command-line-interfaces 15 136⭐ 10🍴 7& 1 more...
18:25:18FromDiscord<mratsim> !repo confutils
18:25:19disbothttps://github.com/status-im/nim-confutils -- 9nim-confutils: 11Simplified handling of command line options and config files 15 10⭐ 1🍴
18:28:07FromGitter<Albus70007> Thank you, i will insist because now its really possible, if someone wants to make rocket league bots (soon even in nim :D) go to rlbot.org
18:29:44FromDiscord<mratsim> so people are using Torch to train their bots?
18:30:39FromGitter<Albus70007> yes, there is a whole framework and community, torch was something i was hoping to learn while i learned nim and developed my bot
18:31:07FromGitter<Albus70007> ML is still not as good as hardcoded bots because of the difficulty of such a task
18:31:43FromDiscord<mratsim> I still need to finish my pong/space-invaders bot :/
18:32:59FromGitter<Albus70007> well, we love newcomers, so you ever want to come, you already know where to find us
18:33:14FromDiscord<mratsim> if you are looking for some ideas, I suggest you download OpenAI-Gym + the Atari module
18:33:34FromDiscord<mratsim> let me ready Arraymancer for reinforcement learning first and then I'll play :p
18:33:51FromDiscord<mratsim> reinforcement learning on GPU*
18:34:08FromDiscord<Chiqqum_Ngbata> People still use Torch?
18:34:16FromGitter<Albus70007> i am not using torch yet, i am going for a hardcoded bot for now...
18:34:24FromGitter<Albus70007> oh, they do
18:34:39FromDiscord<Chiqqum_Ngbata> I was under the impression that everyone moved to Pytorch
18:34:43FromDiscord<mratsim> well, I said Torch but here it's libtorch
18:35:06FromGitter<Albus70007> well, by torch i meant Pytorch and C++torch
18:35:16*golechwi quit (Ping timeout: 248 seconds)
18:35:29FromGitter<Albus70007> i am the only Nim programmer in there and the only Boolang programmer also
18:35:29FromDiscord<mratsim> actually nimtorch uses raw ATen not even libtorch
18:38:07ZevvIm kind of lost disruptek
18:38:42shashlickZevv: what version of nimble do you have
18:39:04Zevvno idea, my laptop batery just died
18:39:25*mv34 joined #nim
18:40:23*mv34 quit (Remote host closed the connection)
18:41:59shashlickokay, will help to know what version of nim/nimble, OS
18:45:56*thomasross quit (Ping timeout: 258 seconds)
18:48:51*Ven`` joined #nim
18:48:53Zevvsure
18:58:39*golechwi joined #nim
19:03:13disrupteki think i fixed it. omg was it stupid.
19:05:06Zevvtell me
19:05:35Zevvi was just about to grok your code when my computer hibernated
19:06:19disrupteknope, i'm dumb.
19:06:38disrupteki thought i was mixing use of cloned and repo; one is the repo we cloned, one is the repo we're sitting in.
19:06:42disruptekbut, that wasn't it.
19:06:42FromDiscord<treeform> Albus70007, I did some Boolang in Unity.
19:06:59Zevvif you dont tell me, your git logs will
19:07:03Zevvtry to hide that
19:07:10disrupteki'll try.
19:07:29disruptekeven without freeing, walking isn't working.
19:09:22disruptekdamn, i was sure it was simple.
19:10:14*marmotini_ quit (Remote host closed the connection)
19:11:17Zevvso not solved?
19:11:27disruptekno.
19:11:30disruptekbut i have an idea.
19:11:30Zevvdang
19:11:58disrupteki'm diffing the two c outputs.
19:12:36disrupteki think i do have it, actually.
19:12:54Zevvis it you or is it nim
19:13:06Araqbikeshed ahead https://github.com/nim-lang/Nim/pull/13092
19:13:07disbotβž₯ added operateOn to sugar.nim to give Nim the chaining mechanism it de…
19:13:10Zevvthe suspense is *killing* me
19:13:29AraqI probably got it completely wrong but it's to start an implementation
19:14:03*nsf quit (Quit: WeeChat 2.7)
19:15:25Zevvi think i hate it, but i cant find a good reason why
19:15:33disruptekjeeze, i guess i don't know after all. this is crazy.
19:16:04disruptekarc is running my free() on a copy of the var that --gc:default frees.
19:16:06Zevvdisruptek: refsv2 or whatever its called has tracing built in with some -d, enabled that yet?
19:16:08disruptekwhy would it matter...
19:16:23disruptekno, i haven't bothered to lookup gc flags. i know that's dumb.
19:17:15Zevvits not that big, you dont have echo in that file but yiu can do c_printf
19:17:46Zevvthats is where that funny global counter is
19:18:07disruptekoriginally, i thought it was as simple as nim trying to free a ptr i alloc'd (and already freed) in c-land.
19:18:27ZevvI think I saw it goes wrong early. The crash comes after 4 loop iteratios for me, but in the first iteration i alreadt saw a double free i thinj
19:18:40disruptekyeah, i'm able to do four loops.
19:18:45Zevvbut to be honest, I do not understand what you are doing yet
19:18:56disruptekmaybe what i'm doing with oid is confusing arc.
19:19:11Araqdo we have something easily reproduced?
19:19:21Zevvpretty easy
19:19:29Zevvclone some repos and run a nim c somethig
19:19:30disrupteki mean, it's easy for people with their feet in the ecosystem.
19:19:36disrupteknot so easy for compiler devs.
19:19:40Zevvhaha
19:20:05FromGitter<timotheecour> @araq quick question: styleCheck and `nim β€”fullhelp` disagree: is the correct thing passC or passc ? passL or passl ? not that i care but some code is broken and i’d like to change it only once
19:20:45disrupteki should look at generated c more; it's still pretty opaque to me.
19:22:04FromDiscord<Clyybber> "easy"
19:22:10Zevv--embedsrc helps sometimes disruptek
19:22:34disruptekyeah, i know i've used this stuff before and for some reason i'm just being stupid on this bug.
19:23:11Zevvif stuff fails I often fall down to the c level completely. run nim once and from then on bughunt in .nimcache
19:23:16FromDiscord<Clyybber> Araq: Afaict its the same as inserting a few outplaces
19:23:24disruptekthat's a little better.
19:23:24FromDiscord<Clyybber> So maybe it should use outplace
19:23:28*xet7 quit (Remote host closed the connection)
19:24:02*icebattle quit (Quit: leaving)
19:24:07Araqtimotheecour: canonPragmaSpelling does not list passC/L so the spelling is 'passc' and 'passl'
19:24:22Araqif in doubt, styleCheck is correct
19:24:22*marmotini_ joined #nim
19:24:28*xet7 joined #nim
19:26:52disrupteki'm starting to wonder if it's not unittest that is complicating this.
19:27:19FromGitter<timotheecour> ok thx; and while we’re at it, i supposed styleCheck could also have a say for things like `defined(js)` etc (ref: https://github.com/nim-lang/Nim/pull/13069#discussion_r364575791)
19:27:20disbotβž₯ System cleanup, part 1
19:27:58AraqI think that's just an oversight given how special-cased 'defined' is
19:29:02FromGitter<timotheecour> btw would u support introducing scoped define (precise semantics TBD) but in short: allows `defined(myproj.myFlag)`
19:29:41disruptekno, it's not unittest.
19:29:42FromGitter<timotheecour> (I meant namespaced, not scoped)
19:30:56Zevvdisruptek: just minimize and throw it over the wall to araq
19:31:06FromDiscord<Clyybber> timotheecour: What for?
19:31:06disruptekyeah, i'm closing in on it.
19:32:07FromGitter<timotheecour> would encourage ppl to namespace their custome defines instead of polluting global namespace, eg : `defined(mypkg.debug)` is not gonna clash but `defined(debug)` is definitely likely to clash
19:32:40*Hideki_ joined #nim
19:32:47FromGitter<timotheecour> (and would be same thing w strdefine, intdefine, booldefine)
19:32:51disruptekwhy the heck is it calling disarm?
19:34:28Zevvdisarm is nothing, its just x = nil to tell the gc it can clean things up
19:34:48Zevvsomeone once told me
19:35:01disrupteklol
19:36:02disrupteki think it might be an --embedsrc defect.
19:36:33Zevvenjoying yourself, are you?
19:36:40disruptekit's pretty great.
19:37:18Zevvmy day in alloc and friends was also great
19:37:33*Hideki_ quit (Ping timeout: 265 seconds)
19:37:41Araqscoped defines? do we have so many of them?
19:37:59AraqI think prefixes serve us well for the time being
19:38:19FromDiscord<Clyybber> yeah
19:38:20Araqesp since there is declared(module.symbol)
19:38:27FromDiscord<Clyybber> namespaces are just prefixes with a dot
19:48:16*thomasross joined #nim
19:51:20*tane joined #nim
19:52:14FromGitter<timotheecour> > *<Araq>* scoped defines? do we have so many of them? ⏎ ⏎ we have 363 unique defined symbols. Just for nim repo. ⏎ ⏎ https://gist.github.com/timotheecour/8b2286478083a6068731a63114ee9dd0 [https://gitter.im/nim-lang/Nim?at=5e17846ea74ac853777f9c32]
19:54:12FromGitter<timotheecour> things like `defined(testing)` are likely to clash; namespaces is simple, obvious way to deal with that
20:00:47FromGitter<timotheecour> (not sure how `declared(module.symbol)` helps with currentl lack of `defined(module.symbol)`; declared doesn’t work with a defined symbol)
20:05:43FromDiscord<mratsim> Gotta love C++ deleting functions under your feet
20:05:47FromDiscord<mratsim>
20:05:47FromDiscord<mratsim> https://cdn.discordapp.com/attachments/371759389889003532/664922792147550250/unknown.png
20:06:49*zyklon quit (Remote host closed the connection)
20:07:10*zyklon joined #nim
20:11:10FromDiscord<demotomohiro> I think it is actually not deleting, but not generating operator= which is automatically generated in default for classess/structs.
20:16:30*Vladar quit (Quit: Leaving)
20:17:52FromDiscord<demotomohiro> C++ lang automatically generate copy constructor or operator= for class/struct. But if you dont want them, you declare them with `delete` keyward.
20:21:57FromDiscord<mratsim> Here it's saying: tyObject_PledgeImpl__Vo57D64UViVBWyaz9c9bgMJQ::operator=(const tyObject_PledgeImpl__Vo57D64UViVBWyaz9c9bgMJQ&)’ is implicitly deleted because the default definition would be ill-formed
20:22:41*marmotini_ quit (Remote host closed the connection)
20:23:23FromDiscord<Clyybber> timotheecour: Namespacing won't change anything here
20:23:38FromDiscord<Clyybber> its exactly the same as a prefix, just with a dot
20:24:09FromDiscord<Clyybber> but since you don't get an error for typos like modul.esymbol there is literally no advantage
20:24:48FromGitter<Clyybber> @timotheecour ping
20:25:52FromDiscord<mratsim> ah, managed to reproduce, somehow it's coming from a typedesc bug
20:26:01*lxbarbosa joined #nim
20:26:39FromDiscord<demotomohiro> I think tyObject_PledgeImpl has a uncopyable member variable (class with operator= deleted) or reference and cannot generate default operator=.
20:27:57*icebattle joined #nim
20:28:09*marmotini_ joined #nim
20:30:04*thomasross quit (Remote host closed the connection)
20:34:37FromDiscord<mratsim> here you go: https://github.com/nim-lang/Nim/issues/13093
20:34:39disbotβž₯ C++ Atomics: is implicitly deleted because the default definition would be ill-formed ; snippet at 12https://play.nim-lang.org/#ix=26Y8
20:37:06*icebattle quit (Ping timeout: 258 seconds)
20:37:24FromDiscord<demotomohiro> if you use 2 modules both have something like `when defined(enableGUI):` and you want to enableGUI in only one of them, not both, namespaced define might usefull.
20:39:46FromDiscord<Clyybber> ah, I see.
20:40:43disruptekjust scope it in the config.
20:40:50FromDiscord<Clyybber> It could also cause many issues
20:41:14FromDiscord<Clyybber> with people using -d:a.symbol = 10
20:41:15*marmotini_ quit (Remote host closed the connection)
20:41:32FromDiscord<Clyybber> but module b also containing a `defined(symbol)`
20:42:27FromDiscord<Clyybber> and putting the scope prefix itself in the defined like so: `defined(a.symbol)` doesn't provide any benefit over a simple prefix
20:44:06*narimiran quit (Ping timeout: 268 seconds)
20:45:29*icebattle joined #nim
20:46:13*sealmove joined #nim
20:49:17FromDiscord<mratsim> I just tag WV everywhere to avoid conflicting with others: https://github.com/mratsim/weave/blob/master/weave/config.nim#L104
20:49:25FromDiscord<mratsim> I have like 40 defines in weave
20:51:09*natrys joined #nim
20:52:45FromDiscord<demotomohiro> Multiple module can have same `defined(symbol)`, and you can specify different values to each module with -d:moduleA.symbol=1 -d:moduleB.symbool=2
21:04:36FromDiscord<Clyybber> exactly
21:04:41FromDiscord<Clyybber> but that might be a problem
21:05:13FromDiscord<Clyybber> because currently many defined(someSymbol) are used in multiple modules
21:06:01disruptekthat's why we just add scoped config.
21:06:59FromDiscord<Clyybber> and it will cause all kinds of unepected behaviour if the values are different
21:07:01disruptekscoped config lets us break diamond dependencies.
21:07:28disruptekthe values won't be different, but yes, the behavior will differ. that's the point.
21:07:50FromDiscord<Clyybber> the value could be different?
21:08:22disruptekthe way it works is, we copy the current config and then lay the new scope over it.
21:08:27FromDiscord<Clyybber> `defined(someSymbol)` in module a != `defined(someSymbol)` in module B
21:08:41FromDiscord<Clyybber> disruptek: I'm talking about scoped defines
21:08:43disruptekyes, the values will differ when intentionally so.
21:08:53FromDiscord<Clyybber> but it might not be intentional
21:09:06disruptekwell, then you've made an error.
21:09:17FromDiscord<Clyybber> but the error is on the user
21:09:22FromDiscord<Clyybber> which kinda sucks
21:09:23disruptekyes, it's user error.
21:09:31disruptekfor all you know, it's intentional.
21:09:34FromDiscord<Clyybber> which won't have an error message
21:09:49disruptekneither does deref'ing nil.
21:10:01FromDiscord<Clyybber> but derefing nil isn't undefined behaviour
21:10:06FromDiscord<Clyybber> this is
21:10:09disruptekneither are scoped defines.
21:10:14FromDiscord<Clyybber> they are
21:10:17disruptekthey are not.
21:10:53FromDiscord<Clyybber> do you know what it does?
21:11:01disrupteksure.
21:11:21FromDiscord<Clyybber> I don't think so
21:11:29disruptekthat's okay.
21:11:45FromDiscord<Clyybber> do -d:someCompilerModule.someCompilerDefine
21:11:53FromDiscord<Clyybber> and expect havok
21:11:58disruptekthat's not what i'm talking about.
21:12:13FromDiscord<Clyybber> its what I was talking about πŸ™‚
21:12:59disrupteki'm talking about having the compiler pick up nim configs from modules and applying the contents over the project's context to form a new config for that module.
21:13:35FromDiscord<Clyybber> disruptek: > disruptek: I'm talking about scoped defines
21:13:39FromDiscord<Clyybber> :p
21:13:49disruptekyou put the defines in the configs.
21:15:02FromDiscord<Clyybber> ah
21:20:22*ptdel quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
21:20:32FromGitter<timotheecour> > @Clyybber its exactly the same as a prefix, just with a dot ⏎ ⏎ that’s not true, prefixSuffix + case insensitivity causes clashes that namespaces don’t , see https://gist.github.com/timotheecour/182fce669ff217c6b0bc87d918303c3e which shows 233 nimble packages that are prefixes of each other, so mypkg.myflag causes 0 conflicts whereas mypkgMyflag can cause conflicts
21:21:24*abm quit (Quit: Leaving)
21:21:28disruptekonly because i registered packages named {'a'..'z'} and {'aa'..'zz'}
21:22:02disruptekyou're welcome, btw.
21:24:23*tane quit (Quit: Leaving)
21:24:48FromDiscord<Clyybber> @timotheecour: I don't get it
21:25:49FromDiscord<Clyybber> so you want to disallow `defined(somePrefix)` too? to make somePrefix.someFlag work?
21:26:23disrupteksuffixes, THAT'S what we need.
21:27:52FromDiscord<Clyybber> nothing
21:27:57FromDiscord<Clyybber> thats what we need
21:28:19disrupteki'm less than 0 when you add up the sum.
21:29:11*filcuc joined #nim
21:35:07*krux02 joined #nim
21:36:43*icebattle quit (Quit: leaving)
21:43:56FromDiscord<demotomohiro> If you define a symbol `soundIOFoo` in sound package and `soundioFoo` in soundio package, these symbol are clash as defined symbols are case insensive.
21:45:39FromDiscord<demotomohiro> If you define them as `sound.IOFoo` and `soundio.Foo`, there is no clash
21:46:38disruptekthey are both problems of naming. whether you use a capital or a period, you're just moving the problem around.
21:48:21disruptekwhat you want is a naming scheme, like, say, URLs.
21:49:32disruptekwe build the package manager into the compiler and the compiler can automate asset collection, trust, distribution, etc.
21:50:17*lritter quit (Quit: Leaving)
21:50:35disruptekyou could have your requirements specified right in the source as an import statement.
21:51:01disruptekinstantly switch requirements simply by altering the source.
21:51:13disruptekand recompiling, of course.
21:51:31disruptekunless those requirements (packages) are shared objects.
21:51:47disruptekin which case, we can precompile them all and just run your program with different dynlibs.
21:52:10disruptektest your code on any set of versions without recompiling anything.
21:52:46disruptekdon't just know under which platforms your code runs, but where it doesn't, and at which git commit it broke, and how.
21:54:15disrupteksorry, i'm a little stoned right now.
21:56:30*Ven`` quit (Read error: Connection reset by peer)
21:56:40disruptekwe could actually checksum the inputs and outputs and then we'd know when a given input gave a novel output.
21:58:26disruptekyou could actually just ask a peer for the output of the given input. so you don't actually need a compiler; you just need to know the input and you can ask a peer for the output.
22:00:01disruptekmaybe that's just a slow way to move truth.
22:01:09disruptekno, i think it's useful.
22:01:39disruptekokay, check this out. we checksum the generated c of a nim program given certain platform qualities, etc.
22:01:54disruptekwe save the output.
22:02:24disrupteknow we can link this output to a test framework that mixes it with other outputs.
22:02:52disrupteknow we can test your program with myriad combinations of other nim programs, c libs, etc.
22:03:22disruptekwe can probably even determine graph characteristics for bugs.
22:04:19disrupteklike, status introduces a lot of fails into the network via x lib. maybe we should fix that lib.
22:04:39Zevv /join #disruptek
22:04:55disruptekyeah?
22:05:03disruptekthis isn't that crazy.
22:05:33disruptekis it?
22:05:44Zevvno, I'm sincerely impressed by all the stuf you're doing and have been doing
22:05:44disrupteki mean, we could build this.
22:07:29disruptekwe'd need to find a really good systems programming language to use, but yeah.
22:07:33disruptekwe could build this.
22:07:42disrupteki've heard good things about rust.
22:07:43ZevvI can see where you want to go, but it will not be lke, simple
22:08:05disruptekokay, let's talk about why.
22:08:40ZevvI'd love to, but not at this time. in my timezone it's way after sesame street
22:08:56disruptekfair enough. πŸ˜„
22:09:02ZevvI'll be taking my daily napnap in a few minutes
22:10:05Zevvand you'll be fixing your free's
22:10:19disruptekyeah, i need to get to that.
22:10:28Zevvso I say: so long and until we meet again! o/
22:10:33disruptekg'nite zevv
22:10:38Zevvsame!
22:12:32disruptekthe aws apis are at version 2.600.0 today.
22:12:47disruptekthey usually go up by 0.1.0 increments.
22:13:31disruptekwhen i cut a new version of the nim<->aws bindings, i give it a new major, because i can't be bothered to changelog what actually changed.
22:13:44disruptekso the atoz package is at version 2600.0.0 today.
22:13:59disruptekso the question is...
22:14:17disruptekhow will my version scheme break first?
22:14:30Araqinteger overflow
22:15:21disrupteki would think that'd be last.
22:15:49disruptekthat's how much faith i have in araq.
22:18:41*filcuc quit (Ping timeout: 258 seconds)
22:22:01*Kaynato joined #nim
22:22:31*krux02 quit (Remote host closed the connection)
22:32:29Araqthanks, unfounded, but thanks
22:33:00disruptekthis isn't a crazy idea.
22:35:07disruptekis it?
22:35:18*natrys quit (Quit: natrys)
22:48:21*disruptek πŸ¦—πŸ¦—πŸ¦—
22:50:51dom96Wish the compiler could infer that HttpRequestError is raised for these: https://nim-lang.org/docs/httpclient.html#getContent%2CAsyncHttpClient%2Cstring
22:53:28FromGitter<Varriount> disruptek: You have an AWS library for Nim?
22:53:47disruptekyeah, via openapi.
22:53:56disruptek!repo disruptek/atoz
22:53:57disbothttps://github.com/disruptek/atoz -- 9atoz: 11Amazon Web Services (AWS) APIs in Nim 15 13⭐ 0🍴
22:55:11FromGitter<Varriount> disruptek: I'll have to look at your signature code, and compare it to mine.
22:55:11*filcuc joined #nim
22:55:28disruptekoh yeah?
22:55:55FromGitter<Varriount> disruptek: Yeah, I wrote some signing code a while back, optimized for memory usage
22:56:04disruptek!repo sigv4
22:56:04disbothttps://github.com/disruptek/sigv4 -- 9sigv4: 11Amazon Web Services Signature Version 4 15 4⭐ 0🍴
22:56:26disruptekbe gentle, i think i wrote it a long time ago.
22:57:20FromGitter<Varriount> disruptek: https://gist.github.com/Varriount/076f406c475b5369301a2fcd7b4527af
22:58:01FromGitter<Varriount> disruptek: The signing scheme is quite convoluted, and not very well documented, especially corner cases.
22:58:07Yardanicooh no, I thought I removed class macro from nimpylib, but it's stil there (and it's one of the most horrible examples of what you can do with macros in nim) - https://github.com/Yardanico/nimpylib/blob/master/examples/example2.nim#L7
22:58:19disruptekwhat if you could specify a trust relationship in your source and as a result, the compiler could just pull in assets from the trust web. failing the web, ... tbd.
22:59:48FromGitter<Varriount> Yardanico: What about allowing tabs in Nim files via template filters?
23:00:33Yardanicothats illegal
23:00:42YardanicoFBI is coming
23:01:07*filcuc quit (Read error: Connection reset by peer)
23:01:21*filcuc joined #nim
23:03:05disruptekvarriount: neat, wish i'd seen this before i wrote mine.
23:05:22*filcuc quit (Remote host closed the connection)
23:05:46*filcuc joined #nim
23:06:38*solitudesf quit (Ping timeout: 260 seconds)
23:06:43disrupteki will have to see if i can steal your path routines to fix my version, which i swear araq sabotaged just to prove a point.
23:07:18disruptekhe flat out told me it was stupid to use path tools from stdlib to build strings.
23:07:34disruptekand i'm like, "huh huh they're all strings huh huh" πŸ‘
23:07:59disruptekand in the next version, my path-based signing mysteriously breaks.
23:08:11disruptekit was, like, the most surgical practical joke ever.
23:08:47disruptekhere. i'm gonna get some sucker to submit a PR to my language that breaks ONLY your library. Ever.
23:09:06disruptekbecause, "see, i told you."
23:11:23*filcuc quit (Quit: Konversation terminated!)
23:11:41*filcuc joined #nim
23:12:32disrupteksavage.
23:12:44disrupteki believe that's what the kids are calling it these days.
23:13:21disruptekoh, and then he teases me about it... "so, did your tests catch it?"
23:13:30disruptekyeah, they caught it. 🀣
23:13:45disruptekyeah, they caught it, buddy. 😁
23:15:27disruptekthen he reverted it.
23:15:52disrupteki mean, i hadn't stopped bleeding and he just twists the knife.
23:16:31*filcuc quit (Client Quit)
23:16:46*filcuc joined #nim
23:16:50*ltriant joined #nim
23:21:44*filcuc quit (Quit: Konversation terminated!)
23:21:54*filcuc joined #nim
23:27:38*filcuc quit (Ping timeout: 240 seconds)
23:34:31*Hideki_ joined #nim
23:37:29shashlicklooks like I need to drop 0.19.6 support for nimterop
23:37:35shashlickmaybe it is time
23:38:45disruptekit's not like what already exists will cease to exist.
23:39:01disruptekpeople can still use everything that you've written to date.
23:39:03*Hideki_ quit (Ping timeout: 268 seconds)
23:42:18shashlicktrue
23:42:50disruptekvarriount: it's funny you mention the documentation of the signing.
23:43:15disruptekso i sat down to write that thing finally, and it was such a joy.
23:43:32FromGitter<Varriount> disruptek: I won't say the code is simple... optimization has its costs
23:43:34disrupteki had totally forgotten what it's like to write on spec.
23:43:53disruptekhow optimized could it possibly need to be?
23:44:10disrupteki mean, you're kidding me right now, right?
23:44:14FromGitter<Varriount> *shrug* It was something of a challenge for myself.
23:44:38disrupteki think i benchmarked my test at about 100,000 signings per second.
23:45:16disruptekhow much memory does it take?
23:45:44*uu91 joined #nim
23:45:58FromGitter<Varriount> I don't recall, I just remember getting the number of heap allocations down to a fairly small amount.
23:46:11FromGitter<Varriount> I think I profiled it, once upon a time. :/
23:46:13disruptekoh, gotcha.
23:47:43disrupteki don't know if i've ever written to spec unless it was my own.
23:47:46disruptekit was zen-like.
23:52:43FromGitter<Varriount> disruptek: For example, the crypto library used supports streaming updates to the sha256 structure, so rather than piece together a string containing the entire structure to feed into a crypto function, already allocated pieces are used: https://gist.github.com/Varriount/076f406c475b5369301a2fcd7b4527af#file-aws-nim-L330
23:54:29*uu91 quit (Remote host closed the connection)
23:56:50disruptekah, sure.