<< 29-10-2020 >>

00:00:14*luis_ quit (Quit: luis_)
00:14:44FromGitter<ynfle> Ok Thanks I'll take a look
00:15:44FromGitter<ynfle> The issue was the if I would add a `debugEcho` statement in a `func` for a NimNode without calling `.repr` it would tell me that there would be side effects
00:16:14FromGitter<ynfle> Is there a to use mutliple values inside a "`" in a quote do?
00:16:50FromGitter<ynfle> Meaning I want to add a bunch of idents to a proc definition, but there can be varying number of input params,
00:39:00*mbomba joined #nim
00:48:15*mbomba quit (Quit: WeeChat 2.9)
01:11:28*Tanger joined #nim
01:31:37FromGitter<ynfle> How do I check the instatiated type of a generic
01:31:53FromGitter<ynfle> ?
01:34:10FromDiscord<ElegantBeef> `when T is int`?
01:34:37disrupteki think this is a macro.
01:34:52disruptekthere are like 6 different ways that vary depending...
01:35:07disruptekgetType, getTypeImpl, getTypeInst, etc.
01:36:46*krux02 quit (Remote host closed the connection)
01:38:44FromGitter<ynfle> It's a macro, but I want to get the type of input argument that is ageneric
01:59:44*zielmicha__ quit (Read error: Connection reset by peer)
02:00:12*l1x quit (Ping timeout: 260 seconds)
02:00:17*nikki93 quit (Read error: Connection reset by peer)
02:00:24*rayman22201 quit (Ping timeout: 240 seconds)
02:00:46*zielmicha__ joined #nim
02:01:01*nikki93 joined #nim
02:01:01*l1x joined #nim
02:02:44*rayman22201 joined #nim
02:09:31*nuxdie quit (Quit: Connection closed for inactivity)
02:17:27*apahl quit (Ping timeout: 260 seconds)
02:19:08*apahl joined #nim
02:36:58*Axiomatic quit (Remote host closed the connection)
03:02:15*zedeus quit (Ping timeout: 265 seconds)
03:14:52FromGitter<gogolxdong> toast of nimterop is very helpful!
03:17:09FromGitter<gogolxdong> It could expand a c file recursive in place.
03:18:24*muffindrake quit (Ping timeout: 240 seconds)
03:19:20*vicfred joined #nim
03:19:36FromGitter<gogolxdong> the CLI equivelent nimterop code doesn't work though.
03:20:54*muffindrake joined #nim
03:21:06*Tlangir joined #nim
03:21:24FromGitter<gogolxdong> `toast -r -I/mnt/c/SDL2-2.0.12/x86_64-w64-mingw32/include/SDL2 -I/mnt/c/FFmpeg -I/mnt/c/FFmpeg -c -o ffplay2.c ffplay.c` vs ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5f9a3534d5a5a635f289aab4]
03:23:36*Tanger quit (Ping timeout: 260 seconds)
03:23:46FromDiscord<g5becks> So I signed up on the nim-forum a few days ago
03:23:56FromDiscord<g5becks> Wanted to post something today
03:24:12FromDiscord<g5becks> but the email activation link is expired
03:24:27FromDiscord<g5becks> theres now option to resend confirmation
03:24:37FromDiscord<g5becks> So i cant post this question there
03:25:17FromDiscord<g5becks> anyhow
03:25:42FromDiscord<g5becks> does anyone know if it's allowed to use a generic proc in a tuple type?
03:26:13FromDiscord<g5becks> I'm trying to port some typescript code
03:26:29FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2Cmc
03:26:44FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2Cmd
03:27:06FromDiscord<g5becks> getting an error though
03:27:15FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2Cme
03:29:35FromDiscord<Rika> same as top, you're missing the [T] after CacheBackend
03:30:27FromDiscord<g5becks> That wouldnt be the same
03:30:35FromDiscord<g5becks> That would make the tuple generic
03:30:44FromDiscord<Rika> that is required for any fields to be generic
03:30:45FromDiscord<g5becks> instead of just the function
03:31:07FromDiscord<Rika> tuples are not interfaces
03:31:19FromDiscord<g5becks> What's the equivalent then.
03:31:34FromDiscord<g5becks> I used a tuple because it's structurally typed
03:31:41FromDiscord<g5becks> like a typescript interface
03:32:18FromDiscord<Rika> well tuples must be generic for anything in them to be generic as well afaik
03:32:47FromDiscord<Rika> let me test smt
03:32:49FromDiscord<Rika> h
03:34:36*mbomba joined #nim
03:34:47FromDiscord<Rika> sorry yea it needs to be explicitly generic
03:35:05FromDiscord<Rika> and nim doesnt have runtime interfaces (though it is planned)
03:35:30FromDiscord<g5becks> Man, that's a bummer.
03:35:53FromDiscord<g5becks> using tuples for interfaces is fine by me
03:36:00FromDiscord<Rika> what's wrong with the generic thing?
03:36:12FromDiscord<g5becks> Because
03:36:46FromDiscord<Rika> code cant be translated perfectly 1:1 to another language unless the lang you're translating to was designed to translate 1:1
03:37:37FromDiscord<g5becks> There arent many languages that force generics to be specified at the type level
03:37:39FromDiscord<g5becks> but
03:38:00FromDiscord<g5becks> I get the fact that its not really an interface Im dealing with
03:38:08FromDiscord<g5becks> its a tuple
03:38:14FromDiscord<g5becks> so It makes sense
03:38:14FromDiscord<Rika> yeah i assume this wont be like this if it were an actual interface
03:38:32FromDiscord<Rika> do you need it to be a runtime construct, the interface?
03:38:38FromDiscord<g5becks> Well
03:38:44FromDiscord<Rika> we have compile time "interfaces"
03:38:48FromDiscord<g5becks> I want to avoid creating multiple instances
03:39:13FromDiscord<g5becks> CacheBackend[string], CacheBackend[int], etc
03:39:23FromDiscord<g5becks> just create one
03:39:28FromDiscord<Rika> i see
03:39:29FromDiscord<g5becks> and then do
03:39:40FromDiscord<g5becks> get[string], get[int]
03:39:57FromDiscord<g5becks> I will instead have to reverse it now
03:40:06FromDiscord<Rika> i dont think that needs to be runtime no? maybe look into `concept`s?
03:40:19FromDiscord<g5becks> Ill have to look into concept
03:40:51FromDiscord<g5becks> havent dug that far into nim so far
03:42:14*silvernode[m] is now known as Jitty[m]
03:50:16FromDiscord<g5becks> @Rika
03:50:42FromDiscord<g5becks> I actually dont think generics procs are allowed in tuples at all
03:50:58FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2Cmh
03:51:03FromDiscord<g5becks> still getting an error
03:51:58FromDiscord<Rika> eh? really?
03:51:59FromDiscord<Rika> OH
03:52:05FromDiscord<Rika> i'm stupid, sorry
03:52:08*zedeus joined #nim
03:52:20FromDiscord<Rika> okay so unfortunately it isnt allowed since generics arent concrete
03:52:28FromDiscord<Rika> at least not to my knowledge
03:52:50FromDiscord<Rika> wait
03:52:55FromDiscord<Rika> i dont actually know why...
03:52:56FromDiscord<Rika> hmm
03:53:34FromDiscord<Rika> maybe someone more knowledgeable here can answer why this isnt possible (but i assume its due to how it would be stored in memory and how size cant be calculated properly or so)
03:56:53*Axiomatic joined #nim
03:57:38FromDiscord<g5becks> Its cool
03:57:46leorizeg5becks: https://play.nim-lang.org/#ix=2Cmi
03:57:51leorizeis that what you're trying to do?
03:58:31leorizeI haven't followed the conversation closely so I might missed a thing or two
03:58:34FromDiscord<nikki> a custom pragma can't have some (maybe compile time) side effect right? like if `type Foo {.somePragma.} = ... ` where to register `Foo` in some list of types to look up later when deserializing or sth
03:58:41FromDiscord<g5becks> no
03:58:53FromDiscord<g5becks> But its a step in the direction
03:59:21FromDiscord<g5becks> I am trying to avoid having the generic type from being defined at the type level
03:59:29FromDiscord<g5becks> but rather at the function level
04:00:26FromDiscord<g5becks> apparently
04:00:39FromDiscord<g5becks> if you arent providing an implementation
04:01:02FromDiscord<g5becks> nim wants a concrete type
04:01:19leorizehmm can you (re)send an example of how you'd want it to be in Nim?
04:01:38leorizelike a vague idea of how things should be matched?
04:01:42leorizeit doesn't have to compile
04:01:46FromDiscord<g5becks> Im more familiar with typescript and C#
04:01:50FromDiscord<g5becks> but
04:01:57FromGitter<gogolxdong> ```var f = open("undefined", fmAppend) ⏎ for i in s: ⏎ echo i ⏎ write(f,i) ⏎ f.close``` ⏎ ⏎ truncates file content, is this expected? [https://gitter.im/nim-lang/Nim?at=5f9a3eb48d286f207677492e]
04:02:19FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2Cmm
04:02:24FromDiscord<g5becks> thats the typescript code
04:02:39FromDiscord<g5becks> so I can just provide a generic get fuction
04:03:25leorizethat's doable with concepts, but those are a bit rusty atm...
04:04:16FromDiscord<g5becks> No problem
04:04:37FromDiscord<g5becks> Probably wont be hard to find a workaround
04:05:27FromDiscord<g5becks> But this is a good example of why some sort of interface abastraction might be a good Idea
04:05:37FromDiscord<g5becks> Thanks for the help
04:06:02*supakeen quit (Quit: WeeChat 2.9)
04:06:42*supakeen joined #nim
04:51:14*mbomba quit (Quit: WeeChat 2.9)
05:15:54*Tlangir quit (Quit: Leaving)
05:25:59*waleee-cl quit (Quit: Connection closed for inactivity)
05:35:41*Axiomatic quit (Remote host closed the connection)
05:36:12*Axiomatic joined #nim
05:57:45*narimiran joined #nim
06:32:11*solitudesf joined #nim
06:35:25*Q-Master quit (Ping timeout: 260 seconds)
07:09:57*letto joined #nim
07:35:20*krux02 joined #nim
07:36:16*narimiran quit (Ping timeout: 268 seconds)
07:37:27*narimiran joined #nim
07:53:05*abm joined #nim
07:55:59*vicfred_ joined #nim
07:59:05*vicfred quit (Ping timeout: 268 seconds)
08:01:32*NimBot joined #nim
08:03:05ForumUpdaterBotNew thread by Michy: Subrange check during initialisation, see https://forum.nim-lang.org/t/7005
08:49:54*hnOsmium0001 quit (Quit: Connection closed for inactivity)
08:59:01*mmohammadi9812 quit (Ping timeout: 264 seconds)
09:01:06*mmohammadi9812 joined #nim
09:03:39planetis[m]narimiran: Hi, can you add hacktoberfest tag to fusion repo?
09:04:05narimiranplanetis[m]: done!
09:04:24planetis[m]that was fast! thanks
09:07:25*PMunch joined #nim
09:08:12planetis[m]guys, is there a reason alginedAlloc procs wheren't exported, documented, etc, can I make a PR?
09:11:18FromGitter<jrfondren> gogolxdong: it doesn't truncate file content for me. what platform is this on?
09:20:47*fredrikhr quit (Read error: Connection reset by peer)
09:21:01*fredrikhr joined #nim
10:00:22Araq first type mismatch at position: 2
10:00:22Araq required type for loadJsonNode: proc (configPath: string): JsonNode{.closure.}
10:00:22Araq but expression 'parseFile' is of type: proc (filename: string, rawIntegers: bool, rawFloats: bool): JsonNode{.gcsafe, locks: <unknown>.}
10:00:38AraqI remember a Nim where this was impossible thanks to the .procvar pragma
10:00:54Araqso good that we got rid of it and now I cannot add new default parameters to existing procs
10:00:59Araq:-(
10:01:30Araqbut nooooo, .procvar wasn't known from other langs so it can't be good stuff
10:01:41Araqand we removed it
10:02:52FromDiscord<Rika> rfc to readd it why not
10:06:11FromDiscord<Varriount> Araq: What about using trampolines?
10:08:01Araqtrampolines are good, how are we gonna get them?
10:08:52FromDiscord<lqdev> Araq: what did procvar do?
10:09:25Araqenable a proc to be passed around as first class proc, promising its interface wouldn't grow additional args
10:09:47Araqwithout it, you cannot take its address and have to write a lambda
10:09:53Araqinstead.
10:11:59AraqI liked its design, it was a good protection against the FP people who want to treat CPU instructions (system.`+`) as functions because Haskell.
10:19:50*mmohammadi9812 quit (Ping timeout: 264 seconds)
10:20:27*mmohammadi9812 joined #nim
10:21:12PMunchAraq, didn't want to flood my issue with unrelated stuff. What is this std thing? You said it's the "namespace of our stdlib modules" but most of the standard library is not in std
10:22:04Araqmost of it predates the std introduction
10:22:24Araqbut your module doesn't so it should be in std/, it's really not a big thing, is it?
10:22:42PMunchNo I was just curious why some thing were in std and some weren't
10:22:49Araqlegacy
10:22:54PMunchRight
10:23:19PMunchAre there any plans to move all of stdlib into std?
10:23:27Araqbtw you can do 'import std / strutils'
10:23:32PMunchOr do we just have to live with this fairly arbitrary split forever?
10:23:32Araqit works thanks to magic
10:23:41PMunchOh, that was my next question :P
10:23:56PMunchSo we should all be doing that?
10:24:06Araqideally yeah
10:24:25PMunchWhy did we decide to do that by the way?
10:24:48PMunchMakes it feel like foreign packages are more "native" than the standard library as they don't have a prefix
10:25:16Araqwell foreign packages have $PackageName / module
10:25:35FromDiscord<Yardanico> there's also pkg prefix iirc
10:25:49FromDiscord<Yardanico> import pkg / nimblepackage
10:25:54Araqyeah
10:25:56PMunchWell most packages just do `import packagename`
10:26:12Araqtrue
10:26:52AraqI made my peace with the situation by claiming 'strutils' is keyword-like
10:27:03Araqand new things are not keywords
10:27:28Araqbut that's "living with the split forever"
10:27:39FromDiscord<justbrowsing> sent a long message, see http://ix.io/2Cnj
10:27:44FromDiscord<Yardanico> You don't
10:28:07FromDiscord<Yardanico> well, one way you can do it is reassign a const to a let at runtime
10:28:13FromDiscord<Yardanico> But why do you need the addr?
10:28:21Araqjustbrowing: didn't we change this in 1.4?
10:28:28AraqI remember changing this
10:29:25FromDiscord<justbrowsing> Using 1.4 - no luck.
10:30:10Araqyou need the 'let' then, sorry
10:30:34FromDiscord<justbrowsing> @Yardanico For embedded programming a little of RAM. Need to store data in ROM (flash)
10:30:55FromDiscord<Yardanico> well then it wouldn't really work
10:31:03FromDiscord<Yardanico> With let you'll put it in RAM
10:31:10Araq'let's are put into ROM sections too
10:31:15Araqdepending on the type
10:32:19FromDiscord<justbrowsing> @!757977596066660455> ↵let tgaFile = staticRead("../data/test.tga")↵----↵Error: 'staticRead' can only be used in compile-time context
10:33:00FromDiscord<justbrowsing> let is not working with staticRead. I suppose
10:33:07*mmohammadi9812 quit (Ping timeout: 246 seconds)
10:33:16Araqconst x = staticRead("..."); let y = x
10:33:28*mmohammadi9812 joined #nim
10:33:32FromDiscord<lqdev> wouldn't that be `tgaFile[0].unsafeAddr`?
10:34:01PMunchDoesn't work either
10:34:12PMunchEssentially what const does is replace tagFile with the literal
10:34:35PMunchSo that would look like `"whatever the content of test.tga is"[0].unsafeAddr`
10:35:00PMunchAnd every time you use that const you might end up with a copy of all that data
10:35:44PMunchjustbrowsing, what platform are you using? I've had luck using PROGMEM on Arduino for what it appears that you're trying to do
10:37:20FromDiscord<justbrowsing> @!669496590964097024>, what platform are you using? I've had luck using PROGMEM on Arduino for what it appears that you're trying to do↵@PMunch cpu: STM32, HAL, gcc++
10:38:57PMunchAh, so you just need Nim to generate a C `const`
10:39:04PMunch(These are different from Nim const)
10:43:30PMunchBy doing `let tgaFile = static: staticRead("../data/test.tga")` it generates a STRING_LITERAL definition which comes from nimbase.h and is defined as `static const` so that should work
10:43:38PMunch@justbrowsing ^
10:45:46FromDiscord<justbrowsing> sent a long message, see http://ix.io/2Cno
10:57:09*oculux joined #nim
10:57:44*oculuxe quit (Ping timeout: 258 seconds)
11:01:33ForumUpdaterBotNew thread by Drkameleon: Termios missing when building on Windows?, see https://forum.nim-lang.org/t/7006
11:03:36FromDiscord<justbrowsing> > By doing `let tgaFile = static: staticRead("../data/test.tga")` it generates a STRING_LITERAL definition which comes from nimbase.h and is defined as `static const` so that should work↵@PMunch[IRC]: Thats works and seems nicer that: const x = staticRead("..."); let y = x. But adds NimStringV2 (24 bytes per on use of this construction) in RAM in global context.
11:04:58FromDiscord<justbrowsing> Thank you @Araq and @PMunch for help!
11:05:53PMunchNo problem
11:06:03PMunchI guess you could also make a cstring out of it if you like
11:07:32PMunchWhich generates this C code: N_LIB_PRIVATE NIM_CONST NCSTRING test__bCD9cI4PCUgxtd0CnyJNtfQ = "<data>"
11:08:25PMunchOr create an array or UncheckedArray out of it, depends on what the tga data is and how you're using it
11:17:44FromDiscord<justbrowsing> @PMunch let tgaFile = static:cstring staticRead("../data/test.tga"). Perfect solution. No side effects. Thank you!
11:18:32PMunchHelps to have done this before ;)
11:21:51FromDiscord<justbrowsing> sent a long message, see http://ix.io/2Cnz
11:22:05Araqwe should really claim this to be a bug tho and fix it
11:23:20FromDiscord<justbrowsing> @Araq NIM_CONST or the whole situation with addr to const?
11:25:52FromDiscord<justbrowsing> @PMunch As I guess in NIM_CONST is empty in cpp compiller, so no cpp const generated. Back to step 1.
11:27:09PMunchHmm, I guess you might have to use codegendecl then
11:29:03Araqaddr to const
11:29:09AraqC
11:29:19Araq++'s const system so too broken for us
11:29:26Araq*is too
11:32:07PMunch@justbrowsing, you can do `let test {.codeGenDecl: "const $# $#".} = static: staticRead("/tmp/cconsttest.nim").cstring` which will generate `const NCSTRING test__bCD9cI4PCUgxtd0CnyJNtfQ = "<data>"`
11:32:18PMunchWith the cpp target
11:32:37Araqwe could have a .rom pragma, you know...
11:33:09Araqand when the compiler cannot ROM it, it's an error
11:33:25Araqmratsim proposed something similar
11:33:38Araqbut instead he only got .noalias in 1.4
11:35:02*vicfred_ quit (Quit: Leaving)
11:35:58PMunchHmm, I think we talked about this with PROGMEM on Arduino as well
11:36:18Araqyeah
11:36:24FromDiscord<justbrowsing> @Araq Yes, like PROGMEM in arduino. As I understand problem is in implementation. What to emit to c and cpp to get proper result
11:36:46PMunchIt's kinda platform dependent
11:37:00Araqthe problem is that we're hacking around instead of telling Nim what we need
11:41:32FromDiscord<justbrowsing> @PMunch Thank you again. It works!
11:42:22PMunchAraq, oh don't get me wrong, I'd really like to have a .rom pragma :)
11:42:47Araqor maybe a .section("ROM")
11:42:47PMunchI was just saying it might be hard to implement for all platforms, but perhaps an error for unknown platforms is good enough
11:42:56PMunch@justbrowsing, great :)
11:44:17FromDiscord<acek7> Welp im one nervous guy
11:44:31FromDiscord<acek7> got a meeting with a big design agency tomorrow
11:47:00FromGitter<jrfondren> is a ProveInit warning from stdlib worth reporting? it's initTable with an openArray[char] key
11:48:19FromDiscord<justbrowsing> @Araq Since const is used in different ways and one of the expected ways (in embedded devices) is to put data in ROM, the rom pragma looks like the best option. To implement in the cpp backend, the keyword 'const' is enough as I understand it.
11:49:11FromDiscord<justbrowsing> PROGMEM (in arduino) converted to const keyword is not it?
11:58:49PMunch@acek7, good luck!
11:59:32FromDiscord<justbrowsing> @Araq Do we expect more .section options in the future .section("RAM"), .section("DEBUG") ? If yes, then .section("ROM") is way to go, otherwise .rom is faster to type on keyboard. Also, is it possible to hint to the linker to put the variable in a specific section? It depends on the compiler I suspect.
12:01:05PMunch@justbrowsing, no PROGMEM sets __ATTR_PROGMEM__ which is handled by the AVR compiler: http://megaburken.net/~patrik/avr/x1007.html
12:06:01*supakeen quit (Quit: WeeChat 2.9)
12:06:34*supakeen joined #nim
12:06:49FromDiscord<justbrowsing> @PMunch You're right, I remembered differently. So the .rom implementation must be platform-dependent. This is not good.
12:09:21FromDiscord<Carpal> yo
12:09:31FromDiscord<acek7> im stressing about some questions i should ask. Its the product lead from the agency giving some of his time to me to give me advice on doing design and production work
12:09:31FromDiscord<Carpal> i discovered nim some days ago
12:09:38FromDiscord<acek7> as a business
12:09:45FromDiscord<Carpal> and i think it has good potential
12:10:20FromDiscord<Carpal> but there are some things i would author fixes
12:11:53FromDiscord<justbrowsing> We can always say that arduino is outdated and ARM (stm32) is a new bright future.↵Const keyword enough for anybody (640Kb ought to be enough for anybody (Bill Gates))↵LOL
12:14:26FromDiscord<Rika> @Carpal which are
12:14:32*luis_ joined #nim
12:15:12luis_Hi all, do you guys rememeber who shared a nim 1sec email module online? I remember it on github, but I can't find it anymore
12:15:42FromDiscord<Rika> star the repos you're interested in!
12:15:44FromDiscord<Rika> 😛
12:15:48luis_I did!
12:15:59luis_the person must have removed it from git
12:17:38luis_I think I am mistaken, it was bash: https://github.com/KevCui/1secmail
12:20:46FromDiscord<shashlick> @gogolxdong nimterop is generally used on h files - what was your error though
12:23:11*TomDotTom joined #nim
12:29:07FromDiscord<Carpal> is luis written in nim?
12:29:29luis_nope
12:29:47FromDiscord<Carpal> lol
12:29:49luis_😅️
12:37:55PMunchLuis?
12:38:01Zevvthe ar4q is strong on this one: "Well Java has had effectively zero influence on Nim's design and OO textbook examples like yours lost their convincing nature two decades ago."
12:38:22PMunchTBH they kinda did though..
12:38:52PMunchWhenever I end up doing OO for some reason I can't help to think to myself "why am I jumping through all these hoops again?"
12:39:09Zevvsure
13:00:34*luis_ quit (Quit: luis_)
13:01:02*luis_ joined #nim
13:06:11FromDiscord<Carpal> ahhaha what a fuxk is hapening
13:07:31*haxscramper joined #nim
13:07:32*Axiomatic quit (Quit: Leaving)
13:07:52FromDiscord<Carpal> is there the nim author in this comunity?
13:08:30PMunchYes
13:09:14haxscramperThe only convincing reason to do OOP-styling things is when you need to do some kinds of extensions for existing types behavior. Although this one is a bit annoying to do right now since you need to just add interface-like behavior (like in `std/streams`). I still haven't figured out how to deal with things like C++ libraries that heavily rely on inheritance / method overriding etc.
13:09:14haxscramper
13:09:14haxscramperI thought about just hardcoding **one** derived class that overrides **everything**, and in these overrides calls are just passed to implementation procs. Like `class NimWrap : Parent { override method() { nimImpl() } };`
13:10:04haxscramperAnd then you just set correct implementation for type in nim, without overriding things. Or you can derive from it if you want - (for additional fields etc).
13:11:54haxscramperThough I don't know how to correctly initialize supertype in nim, without writing boilerplate code all over (like I tried in #15692 , but hit codegen error)>
13:11:57disbothttps://github.com/nim-lang/Nim/issues/15692 -- 3Codegen error for base type pointer access; missing pointer dereference ; snippet at 12https://play.nim-lang.org/#ix=2CnZ
13:13:18*Axiomatic joined #nim
13:18:39FromGitter<iffy> I'm trying to debug a memory issue, and I just noticed that with --gc:arc, `thing.repr` no longer displays the memory address of thing. Is that expected?
13:19:34*stefantalpalaru quit (Read error: Connection reset by peer)
13:21:38*narimiran quit (Ping timeout: 264 seconds)
13:25:07PMunch@iffy, sounds a bit weird, but might be expected
13:31:26FromGitter<jrfondren> I noticed that and assumed that maybe the addresses weren't as reliable information, but the difference seems to be that arc uses stdlib_repr_v2.nim
13:32:20FromGitter<jrfondren> or lib/system/repr_v2.nim in the repo
13:32:53PMunchProbably because of the lack of RTTI in ARc
13:33:06FromDiscord<Clyybber> thats not the cause for the addresses not being printed
13:33:15FromDiscord<Clyybber> its just that it wasn't implemented
13:33:25FromDiscord<Clyybber> probably because it wasn't deemed that useful
13:35:41FromGitter<jrfondren> my use case was to save and compare repr strings to confirm that a move had happened vs. a copy. arc stripped out the part that would be different in the repr so confused some of that
13:38:08PMunchHmm, can I convert 0x80_00_00_00 (aka -1) to int32 somehow?
13:38:16PMunchAs -1 of course
13:39:14miprithat's not -1
13:39:19mipri-1 is 0xFFFF_FFFF
13:39:22Yardanicoyeah
13:39:24PMunchOh wait, yeah my bad
13:39:29PMunchBut anyways
13:39:30Yardanico@PMunch you can
13:39:36Yardanico!eval echo cast[int32](0x80_00_00_00u32)
13:39:39NimBot-2147483648
13:39:40Yardanico:DD
13:39:44PMunchHmm, I guess
13:39:52Yardanico!eval echo cast[int32](0xFF_FF_FF_FFu32)
13:39:55NimBot-1
13:40:16Yardanico!status
13:40:18FromDiscordUptime - 1 week, 1 day, 18 hours, and 3 minutes
13:43:32FromDiscord<Carpal> !eval echo "Hello World"
13:43:35NimBotHello World
13:44:00FromDiscord<Carpal> i think nimbot should better with the nim logo as image profile
13:44:38Yardanicowell, it's on IRC so then I'll have to explicitly add that in the bridge code :)
13:52:01FromDiscord<dom96> Do it 😄
13:52:50*rockcavera quit (Remote host closed the connection)
13:53:26PMunchBetter yet, let us set our own images with !image <link> :P
13:56:02FromDiscord<shashlick> @dom96 - do you want prereleases of choosenim to have odd version numbers or previous stable release + date or next stable release + date
14:00:34*luis_ quit (Quit: luis_)
14:01:04*luis_ joined #nim
14:01:52FromDiscord<dom96> odd
14:03:26FromDiscord<tinygiant> sent a code paste, see https://play.nim-lang.org/#ix=2Coq
14:03:34*lritter joined #nim
14:03:41FromDiscord<tinygiant> (edit)
14:03:57FromDiscord<tinygiant> (edit) "https://play.nim-lang.org/#ix=2Coq" => "https://play.nim-lang.org/#ix=2Cor"
14:04:30FromDiscord<dom96> hmm, you can try `opt: var string = (var x = ""; x)`
14:05:00FromDiscord<dom96> inb4thatcrashesthecompiler 😛
14:07:13FromGitter<iffy> `new MyObj` allocates on the thread's heap, right? What's the equivalent way to allocate on the shared heap? Some incantation with allocShared0?
14:07:53FromDiscord<tinygiant> @dom96 That worked. Thanks!
14:07:58FromGitter<iffy> (and is this the same with default GC and orc/arc?)
14:09:13PMunchHmm, is @jangko around anymore?
14:09:55FromDiscord<dom96> iffy: cast[ptr MyObj](allocShared(sizeof(MyObj))
14:10:05FromDiscord<dom96> we really need safe APIs for this :/
14:10:21FromDiscord<lqdev> there are safe APIs for this in fusion
14:10:33FromGitter<iffy> What is fusion?
14:10:53FromGitter<iffy> I would love a safe `newShared MyObj`
14:10:57PMunchhttps://github.com/nim-lang/fusion
14:11:02FromDiscord<lqdev> https://github.com/nim-lang/fusion/blob/master/src/fusion/smartptrs.nim
14:11:26FromDiscord<lqdev> don't think it's in stable yet
14:12:22FromDiscord<Rika> why not https://nim-lang.org/docs/system.html#createSharedU%2Ctypedesc ?
14:12:28FromDiscord<Rika> rather
14:12:33FromDiscord<Rika> i mean instead of the cast alloc dom put
14:12:55FromDiscord<Rika> also not createSharedU, just createShared, sorry
14:14:09FromDiscord<dom96> smartptrs still sounds dangerous to me
14:14:25FromDiscord<dom96> What's stopping us from having a `SharedRef[T]`?
14:14:52FromGitter<iffy> oh hey, createShared does look like it will work like dom's cast
14:15:41FromDiscord<Rika> > smartptrs still sounds dangerous to me↵why so
14:16:29FromDiscord<dom96> Both the naming "ptr" and the fact that there are 3 variants
14:19:11FromDiscord<Clyybber> rikas link is what you want
14:23:11FromGitter<iffy> I'm really failing at this: https://play.nim-lang.org/#ix=2CoA How do I make a shared object?
14:23:59FromDiscord<Rika> result should be ptr myobj
14:24:25FromGitter<iffy> Even though I dereference it?
14:24:33FromDiscord<Rika> wait hm
14:24:37FromDiscord<Rika> one moment
14:24:48FromDiscord<Rika> i need to remember, its been a while since i programmed
14:26:14FromDiscord<Rika> wait
14:26:15FromDiscord<Rika> wtf
14:26:17FromDiscord<Rika> okay
14:26:21FromDiscord<Rika> your object should not be ref
14:26:22FromDiscord<Rika> 😛
14:27:21FromDiscord<Rika> https://play.nim-lang.org/#ix=2CoC
14:27:39PMunchHmm, trying to play with CEF (Chromium Embedded Framework), but the Nim wrapper just keeps crashing on me..
14:28:10FromGitter<iffy> Rika: oh, I see. It seems that the `of RootObj` is also a problem. Any idea what that is?
14:28:24FromDiscord<Rika> only usually used with ref
14:31:04PMunchOh wait, this needs a full directory structure..
14:32:40FromGitter<iffy> Rika (or anyone), follow-up question: https://play.nim-lang.org/#ix=2CoF is that Thing I made on line 13 also going to end up in the shared heap? Or does this code introduce problems?
14:33:54FromDiscord<Rika> tables are internally seqs which are thread local pointers (i do not know if this is true, but i know theyre at least pointers ofc)
14:33:59FromDiscord<Rika> i have no idea, i feel like it will work
14:34:27FromDiscord<Rika> anyway i dont know why you're returning the dereferenced object
14:34:44FromDiscord<Rika> it doesnt make sense to me, since you need the pointer to access it in a shared way
14:34:50FromGitter<iffy> Me either :)
14:34:57FromGitter<iffy> oh!
14:35:59FromGitter<iffy> So I should share `ptr MyObj` between threads not a `MyObj` (assuming I really, truly do want to share memory between threads and not use channels)
14:35:59*JustASlacker joined #nim
14:36:12PMunchNope, still crashes..
14:40:54FromDiscord<Rika> iffy yeah afaik? i dont remember, as ive said its been a few weeks since i last programmed seriously
14:47:37PMunchPrestige, did you ever try notifishower?
14:47:47PrestigePMunch: not yet :(
14:48:19PrestigeBeen working on a game mostly
14:48:54PMunchGame?
14:49:15PrestigeRemaking astroships in Nim (I've shown it to you right?)
14:49:24PMunchHmm, don't think so
14:50:57FromDiscord<Rika> notifi🚿
14:52:07*krux02 quit (Remote host closed the connection)
14:55:24*Kaivo quit (Ping timeout: 240 seconds)
14:56:30PMunchHaha :P
14:57:57*Kaivo joined #nim
14:58:22PrestigePMunch: https://github.com/avahe-kellenberger/astroships the original game link is in the README
15:01:08*hnOsmium0001 joined #nim
15:02:27PMunchHuh, pretty neat little game
15:03:24PrestigeThanks. I plan to make it an online battle area with powerups. Recreating the current state with nico
15:04:51disruptekno, you're not doing that.
15:05:00*luis_ quit (Ping timeout: 256 seconds)
15:05:47Prestigewell not currently, but after work :P
15:30:01*sentreen quit (Quit: sentreen)
15:31:05*sentreen joined #nim
15:32:35*waleee-cl joined #nim
15:32:52*astronavt joined #nim
15:34:25FromDiscord<enthus1ast> is disruptek your boss Prestige? 😄
15:39:36PrestigeHe's my nephew
15:44:16*stefantalpalaru joined #nim
15:48:55FromDiscord<Zachary Carter> Porting a game from Nim to Typescript for performance reasons doesn't make much sense I don't think.
15:49:08FromDiscord<Zachary Carter> the native client bit does
15:49:18FromDiscord<Clyybber> the other way around :)
15:49:23FromDiscord<Zachary Carter> err yeah
15:49:27FromDiscord<Zachary Carter> sorry Typescript to Nim
15:49:33FromDiscord<Zachary Carter> but either way - it still doesn't make sense 😛
15:58:16FromDiscord<Idefau> https://play.nim-lang.org/#ix=2Cpc is this supposed to not compile
16:04:42Prestige@Zachary Carter we weren't using webgl or anything, also framerate is capped in the browser
16:05:17FromDiscord<Clyybber> @Idefau should compile
16:07:01*stefantalpalaru quit (Changing host)
16:07:01*stefantalpalaru joined #nim
16:08:35*JustASlacker quit (Remote host closed the connection)
16:11:00FromDiscord<Zachary Carter> Prestige: yeah but Nim isn't going to be more performant than TypeScript
16:11:30FromDiscord<Zachary Carter> that was what I was nitpicking
16:12:33FromDiscord<Clyybber> Nim -> js won't be, but now I am nitpicking
16:12:38FromDiscord<Zachary Carter> well that's what I meant
16:12:44FromDiscord<Clyybber> I know :P
16:12:46FromDiscord<Zachary Carter> 😄
16:12:53FromDiscord<tinygiant> In a conditional statement with multiple `or` conditions, such as `if <simpleCondition> or <reallyComplexCondition>`, will nim stop at `<simpleCondition>` if it's true and not evaluate the other conditions at all?
16:12:55PrestigeYeah I don't expect that to be
16:13:32leorizeyes, nim's `or` short-circuits
16:18:43FromDiscord<tinygiant> Thanks!
16:31:57*narimiran joined #nim
16:40:24*sirn quit (Ping timeout: 240 seconds)
16:41:00*sirn joined #nim
16:41:41*tane joined #nim
16:55:09*jholland__ quit (Read error: Connection reset by peer)
16:55:17*jholland__ joined #nim
17:04:25ForumUpdaterBotNew thread by Sixte: What is Kernel32?, see https://forum.nim-lang.org/t/7009
17:04:42FromDiscord<shashlick> @dom96 - please switch to travis-ci.com for choosenim if you can - jobs take forever now
17:05:37FromDiscord<shashlick> you'd need to go here - https://www.travis-ci.com/account/repositories
17:09:46*apahl quit (Ping timeout: 268 seconds)
17:10:24*apahl joined #nim
17:17:38FromDiscord<dom96> This seems really silly
17:17:53FromDiscord<dom96> Why is that a factor in the speed?
17:17:59FromDiscord<dom96> Why doesn't travis auto-switch the jobs?
17:23:23FromDiscord<shashlick> It was open source vs commercial or something
17:23:41FromDiscord<shashlick> I didn't know about it till a week ago and they announced the migration 2 years ago
17:24:13FromDiscord<shashlick> They are closing down the org instance so jobs sit around waiting for hours
17:24:27FromDiscord<shashlick> I moved all my ci earlier this week
17:25:20FromDiscord<shashlick> Probably not doing it automatically so that any dead projects can be purged that way
17:26:56*astronavt quit (Quit: Leaving)
17:28:41FromDiscord<dom96> dead projects wouldn't get any new commits though 🙂
17:28:58dv^_^is there any guide on arc/orc performance? my program is 100x slower with --gc:orc and 50x with --gc:arc
17:30:08FromDiscord<dom96> ugh, why is so shit
17:30:35FromDiscord<dom96> I don't want to give it access to all my repos
17:30:47FromDiscord<dom96> and yet it refuses to work if I select "Only select repos"
17:34:17PrestigeTravis sucks
17:34:30FromDiscord<Rika> thats a tricky situation dv
17:34:33*rockcavera joined #nim
17:34:57FromDiscord<dom96> dv^_^: sounds like you should report this on github
17:35:37FromDiscord<haxscramper> Is `x11` wrapper installed by default with nim?
17:36:38*narimiran quit (Ping timeout: 264 seconds)
17:37:57FromDiscord<lqdev> nope
17:38:01FromDiscord<lqdev> you need to install it via nimble
17:40:59FromGitter<iffy> shashlick, dom96: do you want to use GitHub Actions instead of Travis?
17:41:13FromGitter<iffy> They already have access to all your repos :P
17:43:22FromDiscord<shashlick> need to move there eventually
17:43:32*mbomba joined #nim
17:43:42PrestigeWouldn't it be an easy change?
17:43:44FromDiscord<shashlick> but i'd rather spend the few minutes a day on real nim work
17:43:59FromDiscord<shashlick> there are travis specific things
17:44:21FromDiscord<shashlick> working on CIs is a tedious, boring and thankless headache
17:44:37FromDiscord<shashlick> cannot think of any other cool adjectives
17:49:42FromGitter<iffy> agreed
17:49:57FromGitter<iffy> point me at a repo and maybe a PR for GitHub Actions will show up?
17:50:16FromDiscord<shashlick> that will be fantastic
17:50:27FromDiscord<shashlick> start with nimble perhaps
17:50:54FromDiscord<shashlick> and check out @leorize's work - https://github.com/alaviss/setup-nim
17:55:12FromGitter<iffy> oooo, that looks nice. I have my own nim-installing action that uses choosenim, but it fails on macOS until the next version of choosenim comes out. I like that the one you linked uses the pre-built binaries. I'll prefer that one over mine in the PR
17:56:22FromDiscord<dom96> Speaking of CI, anyone wanna create a CI/CD startup with me? It's been on my todo list for a while 😄
17:56:25PrestigeI need to switch to that!
17:56:43Prestigedom: like a new travis/circleCI?
17:56:44FromDiscord<dom96> All the existing services suck as far as I'm concerned
17:56:56federico3dom96: hah
17:57:03federico3I'm hopeful for sourcehut
17:57:08PrestigeI've seen issues with travis, I like circleCI though
17:57:55federico3I'd rather have less startups and more FLOSS
17:58:10PrestigeI agree
17:58:40FromDiscord<dom96> I've done enough FLOSS and it's not paying my bills
17:58:51FromDiscord<dom96> Time to play the capitalism game
17:58:54*sealmove joined #nim
17:59:01PrestigeI made my own pipeline on my server with gitea - it's privitive, but I like it
17:59:20sealmoveguys remind me, is there a proc for emptying a seq? or should I use setlen(0)?
17:59:40federico3I'd like a proper deployment pipeline tool.
18:00:20PrestigeI'd be interested, but I'm curious what your gripes are @dom96
18:00:24FromDiscord<lqdev> sealmove: x.setLen(0) is the way
18:00:32sealmovethx
18:00:54FromDiscord<g5becks> Hey, does anyone have a quit sec to help me out with this code?
18:01:03FromDiscord<shashlick> @dom96 - count me in
18:01:05FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2CpP
18:01:25FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2CpQ
18:01:50FromDiscord<g5becks> sent a code paste, see https://play.nim-lang.org/#ix=2CpR
18:02:12Prestigecan you put this all in one?
18:02:14FromDiscord<dom96> ooh, two willing participants cool. I'll keep you both in mind.
18:02:39FromDiscord<dom96> Who knows when I'll start of course, my project ideas list is miles long 🙂
18:02:40FromDiscord<g5becks> In the manual it says that strings are implicitlly converted to cstring
18:02:42sealmoveg5becks: yeah string is different from cstring, you need to convert your literal that you pass
18:03:12sealmovewell, sometimes the compiler needs a little bit help, maybe it's confused because of generics
18:03:35FromDiscord<dom96> Prestige: I haven't fully formulated my main gripes, but I think it boils down to all of these CI/CD systems trying to be both CI and CD systems 🙂
18:03:49Prestige@dom96 but are any of those projects going to pay your bills? :P
18:03:53FromDiscord<dom96> Focusing on just one, CI, and doing it well is what I would like to do
18:04:01FromDiscord<dom96> Prestige: yep, if they succeed 😄
18:04:07Prestigeoh good haha
18:04:16PrestigeYeah, just doing CI sounds nice
18:06:26FromDiscord<dom96> I mean, Stardust was one such project
18:06:41FromGitter<iffy> shashlick: nightlies aren't available for Nim 0.20.2, but I'm guessing nimble still wants to be tested against that?
18:06:46FromDiscord<dom96> Haven't advertised it properly yet, but chances of it becoming the next agar are slim 🙂
18:07:01FromDiscord<dom96> but hey, chances are nil if you don't try
18:08:13Prestigetrue! I think it could use some juice, tho
18:08:16Prestige:wqa
18:08:26Prestigewoops
18:08:36FromDiscord<dom96> juice? lol
18:09:08Prestigegame juice. I'll link a vid that talks about it, just making gameplay feel nicer
18:09:45Prestigehttps://www.youtube.com/watch?v=Fy0aCDmgnxg
18:09:53FromDiscord<Rika> GAMER JUICE
18:09:58FromDiscord<dom96> I'm already working on another project in parallel too, something where I know there is a niche market. Of course, it's also a fun learning experience because it's my first time programming ESP8266 🙂
18:11:44*mbomba quit (Ping timeout: 240 seconds)
18:12:44Prestigethere's another longer video about the same concept that I like, with a platformer shooter as the example (different speaker) if you care for it, dom
18:13:51*natrys joined #nim
18:16:06FromDiscord<g5becks> @sealmove
18:16:10FromDiscord<g5becks> Thanks
18:16:22FromDiscord<dom96> Prestige: that is a cool video
18:16:55FromDiscord<g5becks> So how do I discriminate between a cstring and a node in that case?
18:16:59PrestigeHere's the other, can skip to the good parts (it's long) https://www.youtube.com/watch?v=AJdEqssNZ-U
18:17:02FromDiscord<dom96> problem is that these effect aren't exactly that easy to implement 🙂
18:17:15FromDiscord<dom96> (edit) "effect" => "effects"
18:17:30FromDiscord<dom96> _creates an issue to implement /something/ though :)_
18:17:37PrestigeYeah, depends on the engine and the effect :P screenshake is an easy one though
18:18:36PrestigeI added it to astroships by creating perlin noise, an sampling it to offset the camera every frame. Can use a shrinking scalar till it's centered
18:19:43FromDiscord<dom96> hm, I'll play around with that
18:20:06FromDiscord<dom96> but I do need to implement all this stuff manually
18:20:13FromDiscord<dom96> only got a html5 canvas
18:21:42federico3I miss the CD tool I had in amazon
18:21:44PrestigeThat's what I did - if you mean just screenshake it shouldn't be too hard. I could send you my typescript source if you don't care to look up the implementation :P
18:22:23FromDiscord<dom96> I'm also not sure how well screen shake would work with Stardust
18:22:39FromDiscord<dom96> since the camera is centered on the player
18:22:42federico3dom96: BTW is multiplayer broken in stardust?
18:22:46FromDiscord<dom96> could be disorientating
18:23:16Prestigedom96: well you'd just offset that position by some vector that's changed by the shake
18:23:16FromDiscord<dom96> federico3: just tried it, works well
18:23:20FromDiscord<nikki> @dom96 are you rendering with the usual canvas api or webgl?
18:23:55FromDiscord<dom96> nikki: canvas api
18:24:22federico3"Could not find server" on chrome
18:25:02FromDiscord<dom96> federico3: huh, see anything in the console?
18:26:02federico3yup, CORS errors :) Shall we move to a different channel?
18:27:11FromDiscord<dom96> sure, #nim-offtopic?
18:27:23federico3 -gamedev ?
18:27:24FromGitter<iffy> shashlick: It's a start: https://github.com/nim-lang/nimble/pull/868
18:27:25disbotEnable GitHub actions
18:28:08FromDiscord<dom96> federico3: don't mind, as long as it's relayed to discord
18:59:17FromDiscord<treeform> Any one else getting this on the doc pages?
18:59:19FromDiscord<treeform> https://media.discordapp.net/attachments/371759389889003532/771448093988225044/unknown.png
18:59:22FromDiscord<treeform> https://nim-lang.org/docs/httpclient.html
18:59:29FromDiscord<dom96> yep
18:59:32FromDiscord<dom96> they're broken
18:59:50FromDiscord<treeform> ok, do I need to file a bug?
19:00:00FromDiscord<Rika> no afaik its already filed
19:00:03FromDiscord<treeform> ok great
19:00:12FromDiscord<treeform> sorry for the interruption
19:02:47disruptekit's okay; i was just about to brush my teeth.
19:05:44*Kaivo quit (Ping timeout: 240 seconds)
19:08:20*Kaivo joined #nim
19:09:17FromDiscord<Idefau> let me help you
19:09:41disruptekalright; you hold the brush and i'll move the teeth.
19:09:55FromDiscord<Idefau> alright
19:10:07FromDiscord<Idefau> hows this
19:10:13disruptekc'mon, steadier.
19:10:22disrupteki'm not a fucking gymnast.
19:11:09FromDiscord<Idefau> working out wouldn't be bad either
19:11:31disruptekwe can do that after.
19:12:05sealmovehey @Zevv
19:12:27sealmovethe example for ternary operator was wrong, but I figured out the correct way, it's interesting
19:12:28FromDiscord<juan_carlos> That syntax sugars for cast pointers gonna make Bugs go brrrrrr
19:12:59sealmovehttps://play.nim-lang.org/#ix=2Cqf
19:13:38sealmove@Zevv note where the precedence operator is. it should be applied to first expr instead of second
19:14:08sealmovesorry https://play.nim-lang.org/#ix=2Cqg *
19:15:03*bung joined #nim
19:16:04*haxscramper quit (Remote host closed the connection)
19:16:51sealmovei know it makes sense of course, but I thought it's interesting because i haven't seen trailing expressions (after applying the precedence operator) in a pratt parser before.
19:20:36*NimBot joined #nim
19:23:06FromDiscord<treeform> Hmm when I use `client.getContent` I get 400 bad request... but if I use curl it works.
19:23:13FromDiscord<treeform> how can I debug this?
19:23:47FromDiscord<treeform> this is what I am trying to run: https://play.nim-lang.org/#ix=2Cqj
19:24:55FromDiscord<treeform> other sites work except www.figma.com for some reason...
19:24:58FromDiscord<treeform> very strange!
19:25:29disruptekbad headers.
19:26:18FromDiscord<treeform> i have set User-Agent and Content-Type nothing seems to help
19:26:52disruptekit's probably much simpler; our client impl isn't very obedient.
19:28:35FromDiscord<treeform> oh `["Accept"] = "/"` gave me 401
19:28:38FromDiscord<treeform> progress
19:29:15FromDiscord<treeform> nope I was wrong Accept does nothing
19:29:50disruptekjust compare your headers to curl's.
19:30:18FromDiscord<treeform> I did
19:30:22FromDiscord<treeform> no difference
19:30:27disruptekcontent-length is correct?
19:30:32disruptekno duplicate headers?
19:30:39disruptekmatching accept?
19:32:10FromDiscord<treeform> yes
19:32:21FromDiscord<treeform> curl does not send `content-length` because its a get there is no body
19:32:25FromDiscord<treeform> so I don't send it
19:33:12FromDiscord<treeform> curl uses `GET / HTTP/2`
19:33:17FromDiscord<treeform> could nim be using http1?
19:34:27bungprobaly not there, it should accept http1
19:34:39disruptekit does, yes.
19:35:21*stefantalpalaru quit (Remote host closed the connection)
19:35:44*vesper11 quit (Ping timeout: 240 seconds)
19:35:46*stefantalpalaru joined #nim
19:37:21FromDiscord<treeform> yes nim says HTTP/1.1
19:39:54FromDiscord<treeform> I can force curl to use 1.1 with --http1.1 and it continues to work
19:40:31bunghttp protocol unrelated I think, no website want loss http1.1 users
19:41:03FromDiscord<treeform> oh nim sends more headers then curl
19:41:12FromDiscord<treeform> maybe they are messing this up
19:41:30FromDiscord<treeform> it sends `Connection: Keep-Alive` and `content-length: 0`
19:41:40FromDiscord<treeform> which I don't ask for
19:42:12FromDiscord<dom96> nim sends content-length: 0 on a GET with no body?
19:42:42bungwhy it has such headers
19:44:32FromDiscord<treeform> @dom96 yes
19:44:39FromDiscord<treeform> that was the issue!
19:44:40FromDiscord<treeform> removing it makes it work
19:45:03FromDiscord<treeform> hacked into httpclient.nim
19:45:04FromDiscord<treeform> https://media.discordapp.net/attachments/371759389889003532/771459607305912320/unknown.png
19:45:42bungin what case client should send content-length? I thought it return from server side.
19:47:53FromDiscord<treeform> when you have a body
19:48:01FromDiscord<treeform> usually in a post/put etc... verbs
19:48:10FromDiscord<treeform> `if httpMethod != "get" and key != "content-length":`
19:48:15FromDiscord<treeform> seems to make it work right
19:50:22FromDiscord<treeform> its added in `proc requestAux()` no matter what verb it is.
19:51:01*superbia joined #nim
19:51:02*mbomba joined #nim
19:51:11bungthat looks like a bug
19:52:16*rockcavera quit (Remote host closed the connection)
19:52:19disruptekwell, like i said.. our client is not very obedient.
19:52:21FromDiscord<shashlick> @iffy - 0.20.2 is not needed, don't worry about it - it was just free to support
19:52:26disruptekbe careful about changing it.
19:55:08FromDiscord<treeform> sent a code paste, see https://play.nim-lang.org/#ix=2Cqt
19:55:11FromDiscord<treeform> so its kind of allowed, but kind of should not be sent
19:55:22FromDiscord<treeform> I guess this site/server does not like it.
19:56:01FromDiscord<Digitalcraftsman> sent a long message, see http://ix.io/2Cqu
19:57:56PrestigeIs there a "standard" way to write proc docs?
19:57:57PMunchMight be streaming some development on notificatcher in a little while
19:58:13PrestigePMunch: I'll be free in 1 hour to watch!
19:58:17PMunchAnd I'll drop in on Mumble so other people can chirp in
19:58:24disruptekoh shoot!
19:58:32PMunchHuh?
19:59:01disruptekit's `oh shit` with a southern drawl.
19:59:14PMunchHaha, not the part I was wondering about :P
19:59:22PMunchWhy "oh shoot/shit"?
19:59:53disruptekit's an exclamation of excitement.
20:00:24*disruptek growls at the snow and shakes his fist at the clouds.
20:00:36PMunchYou and me both <_<
20:00:40PMunchGot much snow already?
20:00:51FromDiscord<lqdev> Prestige: standard?
20:01:52Prestigelike a way that is traditionally done
20:02:11FromDiscord<lqdev> ##
20:02:32FromDiscord<lqdev> aka doc comments
20:02:43FromDiscord<lqdev> just explain what the procedure does
20:02:44Prestigelol yeah but I mean the format
20:02:47dv^_^dom96: i added 'ref' to some big tables and now it's close to the old performance. Is it still worth reporting?
20:03:53PrestigeI've been writing it like my TS docs: https://i.imgur.com/66h4vcp.png
20:08:42PMunchJust joined the Mumble channel :)
20:08:49*rockcavera joined #nim
20:10:42PMunchYou can also join the #pmunche IRC channel on the Twitch network to chat
20:12:47Prestigethere's a twitch irc network? :o
20:13:05FromDiscord<Clyybber> planetis: Hey, are you dead-set on the name?
20:13:25FromDiscord<Clyybber> almostEqual vs isClose
20:14:07PMunchStream is live: https://www.twitch.tv/pmunche
20:14:21PMunchPrestige, yes, all Twitch channels are actually an IRC channel
20:14:31PMunchOr rather all Twitch chats
20:14:52ForumUpdaterBotNew thread by JPLRouge: Posix mqueue Thank for Nim , see https://forum.nim-lang.org/t/7010
20:17:01*clyybber joined #nim
20:19:26*stefantalpalaru quit (Changing host)
20:19:27*stefantalpalaru joined #nim
20:20:48*natrys quit (Quit: natrys)
20:25:24disruptekPMunch: chucklehead
20:26:26FromDiscord<shashlick> @leorize - you around?
20:26:51Prestigeim having a hell of a time connecting to this irc network
20:26:58leorize@shashlick o/
20:27:11FromDiscord<shashlick> hey am working on an issue and could use your feedback
20:27:32leorizesure
20:27:58FromDiscord<shashlick> https://github.com/disruptek/golden/issues/21#issuecomment-715320963
20:27:59disbotCan't install with nimble: nimterop versions ; snippet at 12https://play.nim-lang.org/#ix=2Bz8
20:28:33FromDiscord<shashlick> if you use nimterop cImport with dynlib, it provides nim with the absolute path to the library
20:28:47FromDiscord<shashlick> so you cannot move the dll after that
20:29:06FromDiscord<shashlick> and with nimble, binaries are compiled in temp and then moved to ~/.nimble so they don't work
20:29:17FromDiscord<shashlick> i've been working on a fix - basically passing in relative paths
20:29:42FromDiscord<shashlick> since nim uses dlopen() to open the binaries on startup, relative paths seem to work
20:29:52FromDiscord<shashlick> but if dlls are in the same dir, they don't
20:30:09leorizetry making it `"./library.so"`?
20:30:09FromDiscord<shashlick> so i'm passing `-Wl,-rpath='$ORIGIN'`
20:30:16FromDiscord<shashlick> curious on your thoughts
20:30:33FromDiscord<shashlick> i tried that and it didn't work when i ran the binary from a different cwd
20:30:45FromDiscord<shashlick> so ./x doesn't work but ../abc/y works
20:30:50FromDiscord<shashlick> makes no sense or my testing is off
20:31:07leorizeyou should statically link by default tbh
20:31:30FromDiscord<shashlick> that already works great
20:31:31PrestigePMunch: how are you connecting? I've finally connected to the twitch irc network but it kicked me off for invalid auth?
20:31:38FromDiscord<shashlick> this is only for dynlib case
20:31:51PMunchPrestige, not sure TBH
20:31:55PMunchSo long since I did it
20:32:09PMunchSASL probably with your Twitch login or something
20:32:11superbiayou need freenode IRC -> twitch IRC bridge
20:34:37disruptekyou need to get an oauth token and use that for authentication.
20:35:38FromDiscord<alehander42> woww ❤️
20:36:35superbiawhath's the point of connecting to twitch if he reads freenode
20:36:46PrestigePMunch: oh that makes sense, I didn't think I needed to be associated with my twitch acc
20:37:36leorize@shashlick if you want it to just works with nimble install then I don't see any better way than copying
20:37:43leorizebut for long term then rpath might work
20:37:47PMunchProbably to avoid spamming
20:37:47leorizeit's quite a trouble though
20:37:52FromDiscord<alehander42> btw pmunch you can stream in discord
20:37:56FromDiscord<alehander42> and then ppl would be able
20:37:57FromDiscord<alehander42> to just tak
20:38:03FromDiscord<alehander42> (edit) "tak" => "talk"
20:38:09Prestigethat's also a good idea ^
20:38:11FromDiscord<alehander42> like, just sharing a screen in a room
20:38:19FromDiscord<alehander42> it seems simpler to me
20:38:25FromDiscord<alehander42> but mumble + twitch might be also great
20:38:41*mathsaey joined #nim
20:38:45*mathsaey quit (Client Quit)
20:38:48leorize@shashlick rpath=$ORIGIN isn't too bad if you must, but never `dlopen()` with a relative path
20:38:58FromDiscord<alehander42> no problem, i use it because for some reason my obs acceleration doesnt work and discord sharing does
20:39:02FromDiscord<alehander42> cool
20:39:06FromDiscord<alehander42> i just got off work
20:39:13FromDiscord<alehander42> so i am pretty excited sorry
20:39:31PMunchNo one else is on mumble though :(
20:39:40Prestigedo discord :P
20:39:53*mathsaey joined #nim
20:40:08PrestigeI'll be on in 20
20:40:25PMunchDiscussed the pros and cons, think I'm sticking to Twitch and Mumble
20:40:35Prestigedamn
20:41:35disruptekprefer mumble's open platform.
20:41:43*mathsaey quit (Client Quit)
20:42:23PrestigeI just dislike the ux/ui a lot
20:42:39Prestigeand we till have to vid share on another platform
20:42:54superbiayou dislike ux/ui of twitch?
20:42:54Prestigestill*
20:43:02FromDiscord<alehander42> makes sense
20:43:04Prestigeno, mumble
20:43:09FromDiscord<alehander42> it's just simpler to me and my twitch is slow
20:43:13FromDiscord<alehander42> with software encoding
20:43:28FromDiscord<alehander42> i might stream later
20:43:47superbiaso why exactly are you now streaming? is it what you do in corona pandemic?
20:45:24PMunchsuperbia, just some Nim coding
20:45:33PMunchAnd showing off some of my latest projects
20:45:39superbiaborring window manager
20:45:43superbiashow some good stuff
20:46:05FromDiscord<alehander42> window managers sound good
20:46:21FromDiscord<alehander42> very classical
20:46:42Prestigemaybe I should try making the WM more exciting
20:46:50Prestigejump scare windows for halloween
20:50:27FromDiscord<alehander42> say no to halloween PMunch!
20:50:33FromDiscord<alehander42> make it a map
20:50:35FromDiscord<alehander42> of europe
20:50:43FromDiscord<alehander42> can you imagine clicking on finland
20:50:56FromDiscord<alehander42> and then scrolling to the sea
20:51:00FromDiscord<alehander42> i just like maps
20:51:18superbiadefinitely disable hexchat notifications for highlights for next stream
20:51:30FromDiscord<alehander42> awesome !
20:51:45FromDiscord<Clyybber> lol, why no to halloween?
20:51:48FromDiscord<alehander42> you should hire a moderator
20:51:59*mathsaey joined #nim
20:52:11superbiayou get distracted 33% of time you work, with notifications, you won't code 10 lines in one hour
20:53:42PrestigeFor building this into nimdow for things like config errors, would this be able to use the user's notificatcher settings but also allow me to provide defaults (from nimdow)?
20:54:03PrestigePMunch: ^ if that sentence made sense. Lol
20:55:24PrestigeHm neat, thanks
20:55:38Prestigeis it snowing on camera, what am I seeing
20:58:55PrestigeI need to get Nimdow to a state where you are a fulltime user :(
20:59:30Prestigeoooh nice
21:00:14bunghttps://play.nim-lang.org/#ix=2CqI which one is better ?
21:01:06disruptekballs.
21:01:18superbialack of
21:02:05superbiaso what exactly is the purpose of mumble
21:02:08*mathsaey quit (Quit: mathsaey)
21:02:17Prestigevoice chat
21:02:20FromDiscord<Clyybber> talk
21:02:33Zevvirc for lazy people
21:03:01superbiahow can you talk to peter if peter has no earphones
21:03:14superbiawould be very unpleasant to hear yourself echo
21:03:15Prestigewhisper in his ear
21:03:15ZevvVERY LOUD
21:03:24Prestigeloudly whisper
21:03:58*mathsaey joined #nim
21:04:09*mathsaey quit (Client Quit)
21:04:11disruptekmumble offers the best quality voice chat for the bandwidth. unfortunately for me, that's not saying much.
21:04:16superbiaPMunch: FileformaR
21:10:39*superbia quit (Quit: WeeChat 2.9)
21:10:43FromDiscord<alehander42> haha my wife said you look like a character from a tale
21:10:55FromDiscord<alehander42> i'd say amundsen
21:11:12FromDiscord<alehander42> you're just exotic
21:11:28FromDiscord<alehander42> huh such a fake norwegian
21:11:29Prestigeperfect
21:11:45FromDiscord<alehander42> eh the moustache is great
21:12:24FromDiscord<alehander42> it doesn't matter , all faces are cool
21:12:46Prestige12 days?
21:14:14*vesper11 joined #nim
21:15:20FromDiscord<shashlick> @leorize - why not dlopen with relative path?
21:15:46FromDiscord<shashlick> sorry had another thing going on so had to disappear
21:16:18FromDiscord<shashlick> i could do `-rpath='$ORIGIN/../other/path'` and then dynlib just filename
21:16:41FromDiscord<shashlick> cause user can opt to put libs elsewhere with `libdir` param to `getHeader`
21:18:37leorize@shashlick it's a security issue, you've seen how it interacts
21:18:47leorizethe relative dir includes the current working directory
21:18:48*mbomba quit (Quit: WeeChat 2.9)
21:19:24disruptekleorize: point is, we currently use relative paths.
21:19:40leorizeguess its time to get rid of them?
21:19:43disruptekyes.
21:20:19leorizeI'd say static linking is better but then you might want to write proprietary stuff and static linking won't be something you're fond of then.
21:20:40disruptekpersonally, i'd love it if it worked.
21:22:46Prestigewe need better syntax highlighting PMunch
21:23:13Prestigetreesitter would be good I think
21:25:45*mathsaey joined #nim
21:27:57PrestigeYeah treesitter parses based on a grammar you provide, it's fast and is starting to be used for accurate syntax highlighting
21:28:22*mathsaey quit (Remote host closed the connection)
21:28:30FromDiscord<treeform> Does any one know if there is a macro to deserialize a case-object that I can learn from?
21:28:41FromDiscord<shashlick> okay i'll test some more and use -rpath even for libs in other dirs
21:28:44PrestigePMunch: ping
21:28:56disruptektreeform: you can use frosty.
21:28:56FromDiscord<shashlick> does rpath take precedence over system libs
21:29:00disruptek!repo frosty
21:29:00disbothttps://github.com/disruptek/frosty -- 9frosty: 11Serialize native Nim objects to strings, streams, or sockets ⛄ 15 16⭐ 0🍴
21:30:58*mathsaey joined #nim
21:31:44FromDiscord<ElegantBeef> Also disruptek if interested i did implement the binary stream for nimscript <-> nim
21:32:06disruptekis it a literal stream api?
21:32:22FromDiscord<ElegantBeef> Basically
21:32:34FromDiscord<ElegantBeef> https://github.com/beef331/nimscripter/blob/master/src/marshalns.nim
21:32:40disruptekit should maybe go into fusion.
21:32:48FromDiscord<ElegantBeef> Well it requires the compiler
21:32:52disrupteki think leorize is a good gatekeeper there.
21:33:02disruptekfusion is obviously tied to the compiler.
21:33:12disruptekfor better or worse. to me, this is exactly what it's for.
21:33:28disrupteki say that rarely, when it comes to fusion.
21:33:28FromDiscord<ElegantBeef> Ok how about this, i am uncertain how it'd work inside the compiler
21:33:39disruptekwhat do you think nimscript is?
21:34:06FromDiscord<ElegantBeef> I know that, but i dont know exactly how the compiler works
21:34:17disruptekno one does; don't let araq tell you otherwise.
21:34:32disruptekcan i use frosty with your shit or not?
21:34:37disruptekand if not, why not?
21:34:37FromDiscord<ElegantBeef> Nope
21:34:44FromDiscord<ElegantBeef> Well i guess yes
21:34:56disruptekbut i have to pass a string?
21:35:15FromDiscord<ElegantBeef> All data is stored as a string
21:35:19*vesper joined #nim
21:35:19*mathsaey quit (Remote host closed the connection)
21:35:30FromDiscord<ElegantBeef> The save/get are all stubs for nimscript
21:35:36disruptekwell, if you can give me a stream api then we have less overhead.
21:36:04disruptekyou can rely on frosty being in the compiler, too.
21:36:05*vesper11 quit (Ping timeout: 240 seconds)
21:37:58FromDiscord<shashlick> @disruptek: this nimterop fix will take some time to get right
21:38:54disruptekit's fine, dude, i trust you.
21:39:36disruptekare you going to patch the compiler, too?
21:40:51*clyybber quit (Quit: WeeChat 2.9)
21:43:38disruptekshashlick: and, is it me, or have you already solved this problem like three times now?
21:46:57FromDiscord<alehander42> oh so my mumble is on
21:47:04FromDiscord<alehander42> i didn't have idea if works
21:47:31*sagax joined #nim
21:49:51FromDiscord<alehander42> so weird when ppl are ontopic
21:52:41*mathsaey joined #nim
21:53:01*mathsaey quit (Remote host closed the connection)
21:53:24*mathsaey joined #nim
21:55:40FromDiscord<shashlick> Nah it's just come up twice
21:55:45FromDiscord<shashlick> Don't need to patch the compiler
21:56:01FromDiscord<shashlick> It just uses dlopen so rpath is a lot cleaner
21:56:06*mathsaey quit (Remote host closed the connection)
21:56:18*mathsaey joined #nim
21:56:28disruptekso this doesn't solve the same issue with sdl, etc.
21:56:37FromDiscord<shashlick> I've just sat on it, now that I'm in between stuff, it's worthwhile to work on
21:56:39*mathsaey quit (Remote host closed the connection)
21:56:50FromDiscord<shashlick> What's that issue with sdl
21:56:57disrupteksame thing. 🤣
21:57:51disruptekdue to dlopen semantics.
21:57:59disruptekas perpetrated by nim, that is.
21:59:05*mathsaey joined #nim
21:59:34FromDiscord<shashlick> Link?
21:59:51disruptekjust something i've debugged in here a couple times.
21:59:53*mathsaey quit (Client Quit)
22:00:30FromDiscord<shashlick> Ok - still need to test this across the fleet so not looking forward to that
22:00:52FromDiscord<shashlick> Osx and win will surely misbehave
22:00:56disrupteki bet.
22:01:28*mathsaey joined #nim
22:02:40leorizeosx should work fine
22:03:22*mathsaey quit (Client Quit)
22:03:32*MyMind joined #nim
22:06:34*Sembei quit (Ping timeout: 260 seconds)
22:08:42disruptekleorize: so, you don't think the compiler should qualify all paths by default?
22:09:04leorizewdym?
22:09:11disruptekfor dlopens.
22:09:24leorizeyea
22:11:02*lritter quit (Quit: Leaving)
22:18:21disruptekbeef: i don't understand this at all.
22:19:07disruptektest.nim is the recent test?
22:21:27FromDiscord<ElegantBeef> What dont you understand?
22:23:24FromDiscord<ElegantBeef> test.nim has my two currently written tests, the first tests nim -> nimscript -> nim
22:23:36FromDiscord<ElegantBeef> The second tests a seq of objects being sent from nimscript to nim
22:26:00ForumUpdaterBotNew post on r/nim by CrazyEyezKillah: Building an Prologue binary for Alpine in Docker, see https://www.reddit.com/r/nim/comments/jkk9bd/building_an_prologue_binary_for_alpine_in_docker/
22:26:22*solitudesf quit (Ping timeout: 256 seconds)
22:30:41*mbomba joined #nim
22:52:22PMunch@alehander92, one reason why I don't want to go Discord, now I can overlay in the stream what people are saying and have it all contained in one video if I want to upload it elsewhere
22:55:03Prestigecan't you do that with obs and stream your obs window?
22:55:06*tane quit (Quit: Leaving)
22:55:27PMunchStream my OBS window on Discord?
22:55:56PrestigeYeah
22:56:26FromDiscord<ElegantBeef> Pmunch you havent heard the good news, i no longer use json 😄
22:56:40PMunchAt all?
22:56:47PMunchOr for something in particular? :P
22:56:54FromDiscord<ElegantBeef> Nimscripter
22:56:57PMunchI feel I'm forgetting some conversion we had
22:56:58PMunchOooh
22:57:08PMunchThat's great! What do you do now?
22:57:22FromDiscord<ElegantBeef> Dudes' got the memory of a fucking goldfish 😛
22:57:37FromDiscord<ElegantBeef> I use a binarystream which is serialized on the nim side
22:58:15PMunchHaha, I do :P
22:58:25PMunchHmm, how does that work?
22:59:28FromDiscord<ElegantBeef> Recursive proc calls that iterate over objects going to the most primitive type then sending that to be serialized
22:59:59FromDiscord<ElegantBeef> When using a json this demo here wasnt capable of running https://streamable.com/6b73or
23:00:49FromDiscord<ElegantBeef> 100 ships each with their own `invoke` nimscript call
23:02:00FromDiscord<ElegantBeef> It can be more efficient if i just make a call per each ship type, sending an sequence of ships and returning said sequence
23:02:03*astronavt joined #nim
23:03:10PMunchThat's cool though
23:03:33PMunchThe guy behind Enu mentioned in a YouTube comment that he also uses NimScript and thanked me for my help :)
23:03:51PMunchSuper happy that it's catching on and actually being used :)
23:04:10FromDiscord<ElegantBeef> Yea i know he does, kinda sad he isnt active here, as i did want to talk to him in realtime 😄
23:05:02*mathsaey joined #nim
23:05:11PMunchDoes he use your wrapper thing, or did he create his own?
23:05:12FromDiscord<ElegantBeef> Comically he's also Canadian
23:05:17FromDiscord<ElegantBeef> He uses his own
23:05:39PMunchYou Canadians and your scripting :P
23:05:39FromDiscord<ElegantBeef> I was interested in how he did it, but i dont feel like digging in his code
23:06:10*stefantalpalaru quit (Remote host closed the connection)
23:06:19*stefantalpalaru joined #nim
23:06:27*sentreen quit (Quit: sentreen)
23:08:33*stefantalpalaru quit (Changing host)
23:08:33*stefantalpalaru joined #nim
23:14:34PMunchJust looked at the video, you should've told me to move the camera feed up -_-
23:18:07PMunchBut I'm loving the sound with my new microphone :)
23:18:37PMunchOh well, time for bed
23:18:38*PMunch quit (Quit: leaving)
23:27:22FromDiscord<ElegantBeef> Buh bye
23:40:35*grahamalama joined #nim
23:40:58*grahamalama quit (Remote host closed the connection)
23:45:28FromGitter<jrfondren> https://play.nim-lang.org/#ix=2Cri <- a single call is turning into two calls somehow
23:48:39FromDiscord<ElegantBeef> What's the full proc call?
23:49:10FromGitter<jrfondren> what do you mean by that?
23:49:51FromGitter<jrfondren> it's data.read(payload)
23:51:08FromDiscord<ElegantBeef> I mean the proc that calls the proc with the case statement
23:51:30FromDiscord<ElegantBeef> Ah nvm
23:51:39FromDiscord<ElegantBeef> I see the delimiters now that i actually look 😄
23:52:22FromGitter<jrfondren> https://play.nim-lang.org/#ix=2Crj it's a codegen error
23:54:01*astronavt quit (Quit: Leaving)
23:54:03FromGitter<jrfondren> reducing this is going to be a PITA, I'll just tag the commit and come back after some of the other viewtype codegen errors go away
23:54:22FromGitter<jrfondren> but a single call turning into two calls is my cue to stop using this stuff