<< 31-07-2019 >>

00:40:05*krux02 quit (Remote host closed the connection)
00:59:47*abm quit (Ping timeout: 248 seconds)
01:11:14*MyMind joined #nim
01:14:37*gearshift quit (Read error: Connection reset by peer)
02:16:54FromGitter<awr1> @mratsim where is the video version of that presentation if you don't mind me asking?
02:18:04FromGitter<awr1> nvm scrolled up
02:20:21FromGitter<awr1> @zacharycarter there needs to be a new directx binding library
02:20:35FromGitter<awr1> one with less lpVtbl verbosity
02:26:31FromGitter<awr1> i may end up doing one after i publish this vulkan library for nim. i'm kind of using it as an excuse to re-read the vk spec
02:41:33*laaron joined #nim
02:54:35FromGitter<kayabaNerve> I'm surprised you can do a direct cast. I would've thought you had to do addr ref[]
03:04:11*laaron quit (Remote host closed the connection)
03:06:57*laaron joined #nim
03:14:13FromGitter<devcat> Can object field have multiple types?
03:27:13*dddddd quit (Remote host closed the connection)
03:31:45*laaron quit (Remote host closed the connection)
03:35:19*laaron joined #nim
03:35:37FromDiscord_<treeform> devcat, you can do this with case objects I think. I would not recommend it though.
03:35:52FromDiscord_<treeform> why do you think you need multiple types on a field?
03:36:30FromDiscord_<treeform> https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants
03:59:08*laaron- joined #nim
03:59:32*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
04:07:13*a_chou joined #nim
04:13:02*a_chou quit (Quit: a_chou)
04:15:35*fjellfras joined #nim
04:30:16FromGitter<zacharycarter> awr1: that'd be nice but for now this is what we have I suppose :P
04:31:51FromGitter<zacharycarter> if you make one though - I'd gladly use it :)
04:35:11*snifftek joined #nim
04:35:28*nsf joined #nim
04:53:57FromGitter<zacharycarter> https://github.com/zacharycarter/directnimrod - should work with 0.20.2 now
05:19:58*revere quit (Ping timeout: 246 seconds)
05:21:14*altarrel_ joined #nim
05:21:21*altarrel quit (Ping timeout: 250 seconds)
05:21:22*jmiven quit (Ping timeout: 246 seconds)
05:21:22*tribly quit (Ping timeout: 246 seconds)
05:21:43*xace quit (Ping timeout: 246 seconds)
05:22:42*xace joined #nim
05:24:56*revere joined #nim
05:31:22*fjellfras quit (Ping timeout: 268 seconds)
05:32:10*fjellfras joined #nim
05:33:24*jmiven joined #nim
05:35:09*tribly joined #nim
05:42:59*solitudesf joined #nim
05:45:31*fjellfras quit (Ping timeout: 246 seconds)
06:06:34*laaron- quit (Quit: ZNC 1.7.1 - https://znc.in)
06:07:33*laaron joined #nim
06:24:36*Cthalupa quit (Ping timeout: 244 seconds)
06:28:51*fjellfras joined #nim
06:32:02*Trustable joined #nim
06:33:41*Trustable quit (Remote host closed the connection)
06:34:35FromGitter<kayabaNerve> So. Weird thing about Tables.
06:35:01FromGitter<kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d4136949a02440b032dec14]
06:35:18FromGitter<kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d4136a6b0bf183ea371ef21]
06:35:30FromGitter<kayabaNerve> The two table sets are saying they may throw Exceptions.
06:37:16FromGitter<kayabaNerve> ```code paste, see link``` ⏎ ⏎ This compiles fine. [https://gitter.im/nim-lang/Nim?at=5d41371c9a02440b032def90]
06:38:30*nif quit (Quit: ...)
06:38:40*nif_ joined #nim
06:39:25FromGitter<kayabaNerve> The specific location is char 51, which is `rpc.rpc[key]` (`[`), yet I discard it just fine two lines up.
06:40:17FromGitter<kayabaNerve> TL;DR Can discard value but getting the value to set it in another table risks an Exception.
06:42:27*nif_ quit (Client Quit)
06:42:36*nif joined #nim
06:44:07FromGitter<zacharycarter> anyone know how to handle `class##` in a C preprocessor macro that has `class` as a parameter
06:44:18FromGitter<zacharycarter> like `class##_Release
06:44:32FromGitter<zacharycarter> `template zappSafeRelease(class, obj: untyped) =`
06:44:43FromGitter<zacharycarter> I tried using backticks but that didn't work
06:46:58*dyske joined #nim
06:48:26*sagax quit (Remote host closed the connection)
06:48:35*laaron quit (Remote host closed the connection)
06:48:57FromGitter<zacharycarter> never mind - I don't need to do that anyway
06:49:02FromGitter<Riderfighter> Hello everyone!
06:51:38FromGitter<zacharycarter> hello
06:52:00FromGitter<zacharycarter> cool - have a d3d11 swapchain working now in the zapp code I posted last night
06:52:32*laaron joined #nim
07:00:00*gmpreussner quit (Quit: kthxbye)
07:05:04*gmpreussner joined #nim
07:09:25FromGitter<zacharycarter> https://github.com/zacharycarter/z
07:09:47FromGitter<alehander42> ok, i dont get
07:10:19FromGitter<alehander42> if i want to await a future but ignore its result
07:10:19FromGitter<zacharycarter> don't get what?
07:10:27FromGitter<alehander42> what exactly should i use
07:10:37FromGitter<alehander42> discard await is *forbidden* by docs
07:10:59FromGitter<alehander42> but asyncCheck doesnt actually wait afaik
07:11:09FromGitter<zacharycarter> that's correct according to - https://nim-lang.org/docs/asyncdispatch.html#discarding-futures
07:11:20FromGitter<alehander42> so in this case it is written "and you should use ⏎ ⏎ ##``waitFor`` for that purpose"
07:11:32FromGitter<zacharycarter> and that doesn't work?
07:11:40FromGitter<alehander42> but i thought i should only use that in sync function
07:12:06FromGitter<zacharycarter> yes - but the function you're waiting for is async
07:12:08FromGitter<alehander42> even we talked yesterday about making waitFor in async a compile error
07:12:22FromGitter<alehander42> so surely waitFor is also not a solution
07:13:02FromGitter<zacharycarter> well yeah - you wouldn't use it in an async proc but you'd use it for instance in a sync proc calling an async proc
07:13:14FromGitter<zacharycarter> I think anyway
07:13:43FromGitter<alehander42> yes exactly
07:13:47FromGitter<alehander42> but in the docs
07:13:52FromGitter<alehander42> its recommended to actually use it
07:13:56FromGitter<alehander42> instead of asyncCheck
07:13:57FromGitter<zacharycarter> https://github.com/dom96/jester/blob/master/tests/tester.nim#L61
07:14:00FromGitter<alehander42> if i want to wait for completion
07:14:39FromGitter<alehander42> e.g. asyncCheck: " \## This should be used instead of ``discard`` to discard void futures, ⏎ \## or use ``waitFor`` if you need to wait for the future's completion. ⏎ "
07:14:45FromGitter<alehander42> @dom96
07:14:57FromGitter<alehander42> do you have an idea what am i missing
07:15:11FromGitter<alehander42> @zacharycarter yeah this makes sense and thats what i thought should be right usage
07:16:26FromGitter<Riderfighter> guys new top download speed! https://dsh.re/c8726
07:20:07FromGitter<Riderfighter> when naming types how do you guys usually name them? Do you capitalize them or leave them lowercase?
07:20:50FromGitter<alehander42> oh bad speed!
07:20:56FromGitter<alehander42> capitalize them always
07:21:35FromGitter<alehander42> https://nim-lang.org/docs/nep1.html#introduction-naming-conventions
07:25:48FromGitter<Riderfighter> ah ok welp
07:25:54FromGitter<Riderfighter> time to capitalize a few types
07:26:16FromGitter<alehander42> doesnt styleCheck support autofixing ? nari
07:26:22FromGitter<alehander42> hm our core team is on vacation
07:26:24FromGitter<alehander42> i think
07:26:42FromGitter<alehander42> @krux02 are there any autofix options in the linter/nimpretty code?
07:36:54FromGitter<Riderfighter> I have a question about nimpretty, where is it located specifically?
07:37:15FromGitter<Riderfighter> i remember vscode complaining it wasn't in my PATH so I wanted to add it but I have no clue where it is
07:37:49FromGitter<alehander42> i guess tools/
07:38:01FromGitter<alehander42> sorry bin/
07:38:07FromGitter<alehander42> you need to build it with koch tools
07:38:08FromGitter<alehander42> i guess
07:38:32FromGitter<Riderfighter> is it not built when choosenim gets/builds nim itself?
07:38:39FromGitter<alehander42> i am not sure about your install , but you can build koch in the main nim folder
07:38:44FromGitter<alehander42> no idea sorry
07:38:47FromGitter<Riderfighter> rip
07:38:54FromGitter<Riderfighter> its ok, time to do some invertigating
07:42:27*onionhammer1 quit (Ping timeout: 248 seconds)
07:42:45FromGitter<Riderfighter> found nimble haha
07:44:03FromGitter<Riderfighter> alrighty its time to find out how to build nimpretty
07:46:12*onionhammer1 joined #nim
07:47:52FromGitter<zacharycarter> should just be changing to the active toolchain directory and running ./koch tools
07:49:28FromGitter<Riderfighter> Ok so in theory it should be built but I have no idea where it just built to though :L
07:49:54FromGitter<zacharycarter> probably in the bin directory of the active toolchain
07:50:32FromGitter<zacharycarter> I guess it's time to start on the gfx module now
07:50:57FromGitter<alehander42> yeah it should be in nim/bin ;P
07:51:12FromGitter<Riderfighter> @zacharycarter yeah you were right :P gosh i'm such a noob when it comes to this
07:51:28FromGitter<zacharycarter> haha - no worries - we were all noobs at one point
07:51:51FromGitter<zacharycarter> I think this is year 3, maybe even 4 for me using Nim, so I've had some time to learn :)
07:52:18FromGitter<alehander42> a true veteran
07:52:32*onionhammer1 quit (Ping timeout: 245 seconds)
07:52:57FromGitter<Riderfighter> This is probably uhm year 1 ? I've been learning
07:53:54FromGitter<zacharycarter> heh well - I've also taken long breaks and abandoned almost every project I've started :P but at least I can help in some way by answering questions
07:54:06FromGitter<Riderfighter> I started learning for real about 7 months ago so not exactly a year
07:54:16FromGitter<zacharycarter> hopefully the modules I'm making for windowing / input and graphics abstraction will help someone out
07:54:26FromGitter<zacharycarter> cool! never too late to join the party :D
07:55:11*onionhammer1 joined #nim
07:56:12FromGitter<Riderfighter> I know right! I'm having a blast learning, plus people actually respond to my questions here which is really an added bonus, when I first started learning Python people were much less prone to answering a question
07:56:56FromGitter<zacharycarter> it's a fun language to learn IMO - glad you're finding that to be the case as well :) yeah we have a small but very active and helpful community I think
07:59:54FromGitter<Riderfighter> I think its a great language to learn coming from a few others, but when you start from Python and other languages where you don't really care about pointers the learning curve is basically a cliff, but it was this channel that helped me understand how to do it right
08:02:24FromGitter<zacharycarter> ah yeah - I was lucky enough to have some C/C++ knowledge, but Nim helped me improve that knowledge by quite a bit, and I still learn new things every time I write Nim code
08:02:58FromGitter<Riderfighter> This wiki helped me a lot, https://github.com/nim-lang/Nim/wiki/Nim-for-Python-Programmers, I read that and the tutorial for Nim before attempting to write code
08:07:06FromGitter<zacharycarter> yeah that's not a bad tutorial at all
08:10:23FromGitter<Riderfighter> gosh guys I feel so advanced right now, the way i've structured my project makes it so that I can separate incoming/outgoing packet types and data types into their own files for clarity
08:16:44*onionhammer1 quit (Read error: Connection timed out)
08:17:08*onionhammer1 joined #nim
08:17:20livcdthis chan is also unusually active and that's a big plus imho
08:19:25FromGitter<alehander42> good for ya , good structure is cool
08:20:26FromGitter<Riderfighter> livcd: even if no one talked here I probably would talk in here anyways lmaooo
08:22:28*abm joined #nim
08:24:36*ng0 joined #nim
08:30:58*krux02 joined #nim
08:40:09FromGitter<Riderfighter> For NESM if I have a field that is a `seq[string]` and since both a seq and a string are both dynamic types how would one set the prefixed length of each from uint32 to int16
08:40:25FromGitter<Riderfighter> this is too nested for my feeble mind
08:44:31*mheinz joined #nim
08:47:48*mheinz left #nim (#nim)
08:56:19FromGitter<kayabaNerve> Oh. Fun.
08:56:24FromGitter<kayabaNerve> I crashed the compiler.
08:56:27FromGitter<kayabaNerve> `Error: internal error: yield in expr not lowered`
08:56:36FromGitter<kayabaNerve> I have no idea what this means or what caused it.
08:57:20*Cthalupa joined #nim
09:00:32FromGitter<alehander42> you use a closure iterator and a `yield` inside?
09:01:04*sagax joined #nim
09:02:04FromGitter<alehander42> in a .. strange place (?), so the compiler couldn't remove it while transforming the closure
09:02:35FromGitter<kayabaNerve> I don't have any iterators, and this wasn't a closure function.
09:02:38FromGitter<kayabaNerve> It's relevant to async.
09:02:48FromGitter<alehander42> well it has a lot of closure iterators inside
09:02:49FromGitter<alehander42> afaik
09:03:01FromGitter<alehander42> do you have the code that
09:03:05FromGitter<alehander42> led to it
09:03:05FromGitter<kayabaNerve> I had a ref JSONNode and that combined with async...
09:03:18FromGitter<kayabaNerve> Uhhh a few ctrl + z away, as part of a huge project
09:03:19*Vladar joined #nim
09:03:34FromGitter<alehander42> but whats the diff
09:03:37FromGitter<alehander42> which errors
09:05:24FromGitter<kayabaNerve> 1) Get this commit. ⏎ 2) Open src/Interfaces/RPC/RPC.nim. ⏎ 3) Enter this start function. ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5d4159d445775115b370f4cc]
09:05:56FromGitter<kayabaNerve> ```code paste, see link``` ⏎ ⏎ Specifically, although I don't know how minimal I could make it. [https://gitter.im/nim-lang/Nim?at=5d4159f45367476cc983fd09]
09:08:24FromGitter<alehander42> hm, so this json + try snippet
09:08:30FromGitter<alehander42> is the only diff
09:09:52FromGitter<kayabaNerve> It's the immediate ref JSON -> JSON OR ref JSON -> ref JSON and then ref JSON -> JSON
09:11:08*floppydh joined #nim
09:12:06FromGitter<kayabaNerve> ```code paste, see link``` ⏎ ⏎ Successfully triggers a compile time assert, yet not a full crash. [https://gitter.im/nim-lang/Nim?at=5d415b655a72fc7ba4cc14a0]
09:13:07*alexander92 quit (Ping timeout: 248 seconds)
09:13:16*vlad1777d joined #nim
09:13:41FromGitter<kayabaNerve> Here's the full error when using koch temp: https://pastebin.com/QSdV0BVA
09:14:12FromGitter<kayabaNerve> Anyways. I don't have the time to debug the hell out of this. Let me know if anyone else takes a crack.
09:14:35*fjellfras quit (Ping timeout: 244 seconds)
09:14:45*Cthalupa quit (Ping timeout: 258 seconds)
09:21:14Mister_Magistercan you release new versions less often?
09:21:21Mister_Magisteri don't have time to update package ;-;
09:26:44dom96hehe, usually people want releases more often :)
09:26:50dom96How's everyone doing?
09:29:00FromGitter<mratsim> @Riderfighter you can find a few recipes in nim days and Nim's scripter notes as well: https://xmonader.github.io/nimdays/, https://scripter.co/notes/nim/
09:29:08FromGitter<Riderfighter> Pretty good hbu dom96
09:29:37FromGitter<Riderfighter> @mratsim thank you, I'm going to take a look at those asap
09:29:39FromGitter<mratsim> Nim has a release every months or so though :/
09:29:39dom96Good good. Got some holidays this week
09:30:26FromGitter<mratsim> 6 months*
09:31:28FromGitter<Riderfighter> dom96: extra time to code in nim :)
09:35:17*dyske quit (Ping timeout: 250 seconds)
09:35:38ZevvI feel stupid again today. I have a macro that takes a code block and builds a custom data structure from this code block Nim AST. up to now I always used this data structure as an intermediate format to generate Nim code in that macro, but now I'd like to return this data structure from the macro into my nim code.
09:38:44*alexander92 joined #nim
09:39:19FromGitter<Riderfighter> argh I'm feeling stupid too today
09:39:57*Vladar quit (Remote host closed the connection)
09:40:24*Vladar joined #nim
09:40:59alexander92dom96 I tried to understand what to use as "discard await but raise error"
09:41:24dom96asycnCheck
09:41:29dom96*asyncCheck
09:41:32alexander92It seems to me I can't make wait for in async a compile error because in asynccheck docs it's written to use it
09:41:36alexander92But..
09:41:46alexander92It doesn't await for completion
09:42:13alexander92I M
09:42:18dom96You can do `discard await someAsyncProc()` that's fine in case it's not clear
09:42:23alexander92Ahhhh
09:42:30dom96`discard someAsyncProc()` is not fine
09:42:41alexander92So the discard thing is only about direct discard
09:42:44alexander92I see
09:43:04dom96The thing to remember is to never discard a `Future`
09:43:40alexander92And I guess discard await raises if there is an error
09:43:56dom96yep
09:44:01alexander92Yeah in this case I should improve the docs a bit
09:44:09alexander92Because it see they suggest wait for
09:44:15*alexander92 left #nim ("Quit")
09:44:52*alexander92 joined #nim
09:45:10dom96sure, do it
09:47:15*Cthalupa joined #nim
09:48:28*fjellfras joined #nim
09:48:38alexander92Then I guess we can mke
09:48:52alexander92Discard future directly a compile error
09:48:53alexander92Toi
09:55:25*fjellfras quit (Ping timeout: 246 seconds)
09:58:39FromGitter<Riderfighter> I wish the NESM docs were a bit more clear :L
09:59:20FromGitter<Riderfighter> it doesn't address how to customize the serialization of a dynamic type(string) inside of another dynamic type(seq)
10:00:38*dyske joined #nim
10:02:08FromGitter<Riderfighter> Sorry if I'm complaining a lot, I'm just frustrated I think I've been at this for an hour or two
10:03:25*seni joined #nim
10:08:06*Avatarfighter joined #nim
10:14:55*fjellfras joined #nim
10:16:39*Avatarfighter quit (Remote host closed the connection)
10:23:15FromGitter<zacharycarter> well - strings and seqs aren't really dynamically typed
10:23:27FromGitter<zacharycarter> seqs are resizable generic containers
10:23:35FromGitter<zacharycarter> strings are implemented using sequences
10:23:47FromGitter<zacharycarter> but their type is defined at compile time
10:24:24FromGitter<zacharycarter> I doubt this helps with your question though - maybe if you post an xo.io or a gist or something someone might have an idea
10:24:28FromGitter<Riderfighter> Yeah, but its the way this library works, it serializes types and it considers strings and sequences as dynamic because their size can't be calculated by the lib at compile time, that is what I mean by dynamic haha
10:25:21FromGitter<zacharycarter> ah, yeah their size is dynamic
10:25:56FromGitter<Riderfighter> how do you do a multiline comment in nim again?
10:26:05solitudesf#[ ]#
10:26:12FromGitter<Riderfighter> perfect, thank you!
10:26:28FromGitter<zacharycarter> maybe this will help - https://github.com/xomachine/NESM/blob/master/tests/customseqsize.nim#L53
10:26:50FromGitter<mratsim> https://xomachine.gitlab.io/NESM/#customizing-seq-and-string-serialization-schemas
10:26:54FromGitter<Riderfighter> Yeah I saw that, but the thing is xomachine is setting the length of the seq itself
10:27:01FromGitter<Riderfighter> @mratsim I saw that too :(
10:27:24FromGitter<mratsim> it seems to offer the flexibility but maybe just use nim "marshal" stdlib if you have a lot of dynamic types
10:27:45FromGitter<mratsim> implementing serialization of dynamically sized types is always a pain anyway
10:28:21FromGitter<Riderfighter> yeah, its not that the current code doesn't work, it does, its just instead of a string being prefixed by a uint32 I need it as an int16 which is where my headache is haha
10:28:43FromGitter<Riderfighter> dont worry though, I wont give up, I'll probably have to mess with nesm code
10:30:08FromGitter<Riderfighter> to be honest, I can't tell if my issue is a library limitation or I'm just doing this really badly
10:30:43FromGitter<Riderfighter> here is my code if anyone is interested, I'm having issues with the AccountList object https://dsh.re/64512
10:31:10*dddddd joined #nim
10:31:21FromGitter<mratsim> well don't worry, for our YAML deserialization need, we monkey patch Nim's json and NimYAML types to use uint64 instead of int64 for example --> https://github.com/status-im/nim-eth2-official-tests/pull/2/files#diff-d5bc8101555d964ebe1e85c4be4990a7
10:32:22*Avatarfighter joined #nim
10:32:26FromGitter<mratsim> but the serialization/deserialization roundtrip works well right?
10:34:00FromGitter<Riderfighter> in theory the roundtrip serialization/deserialization wont succeed for me because of the server being unable to parse the packet I send, its not a big limitation though since I can use my own binary packing lib if needed, its just that NESM is so cool haha
10:35:02*alexande1 joined #nim
10:35:59FromGitter<alehander42> hey guys
10:36:03FromGitter<Riderfighter> Hola
10:36:05FromGitter<alehander42> please help me override tags
10:36:17*alexander92 quit (Ping timeout: 245 seconds)
10:36:18FromGitter<Riderfighter> I will help to the best of my abilities !
10:36:18FromGitter<alehander42> i am trying to force nim to ignore some
10:36:22FromGitter<alehander42> with {.tags: [].}: code
10:36:26FromGitter<alehander42> but nim cant really accept it
10:36:48FromGitter<alehander42> my goal is to make the function type with tags: []
10:40:27FromGitter<Riderfighter> Upon further analysis, it seems that this may be a bit too advanced for me, sorry alehander42 :(
10:42:30FromGitter<alehander42> no problem
10:48:56*stefanos82 joined #nim
10:50:02*vlad1777d quit (Ping timeout: 245 seconds)
10:55:59Zevvbah, I'm kind of stuck... anyone any ideas about my macro question from 11:35?
11:02:54*Avatarfighter quit (Remote host closed the connection)
11:03:25*Avatarfighter joined #nim
11:03:34*Avatarfighter quit (Remote host closed the connection)
11:05:42FromGitter<mratsim> I'm not too sure about your specific but I have similar needs in Laser: https://github.com/numforge/laser/tree/master/laser/lux_compiler
11:06:15FromGitter<mratsim> what I'm doing is having my own AST: https://github.com/numforge/laser/blob/master/laser/lux_compiler/core/lux_types.nim
11:06:35FromGitter<mratsim> In macro, I can run symbolic execution to build this AST at compile-time
11:06:42FromGitter<mratsim> or running it at runtime
11:07:22FromGitter<mratsim> and then I have a code generation part that can translate it to either NimNode, or at runtime I plan to generate LLVM JIT code
11:07:55FromGitter<mratsim> alternatively you can store NimNodes in a {.compileTime.} data structure
11:08:52Zevvok I'll take a peek at that, thanks
11:12:15Zevvbut where do you build this AST from?
11:13:48Zevvproblem is, I have the ast as a data structure inside the macro execution. but macros only do NimNodes - so I need to get this data structure out to nim in a const somehow
11:15:06Zevvsometimes I feel I got it all in my fingers, and sometimes I'm so utterly confused :/
11:29:25solitudesfis there a standart way to get the base type from distinct type or would i need to write a macro for that?
11:29:38*laaron quit (Remote host closed the connection)
11:32:07*noonien quit (Quit: Connection closed for inactivity)
11:34:35*fjellfras quit (Ping timeout: 268 seconds)
11:35:23*laaron joined #nim
11:38:50*oculux quit (Quit: blah)
11:39:07*oculux joined #nim
11:40:19*alexande1 quit (Ping timeout: 248 seconds)
11:41:59*alexande1 joined #nim
11:43:13*JustASlacker joined #nim
11:51:31*alexande1 quit (Ping timeout: 248 seconds)
11:52:54FromGitter<mratsim> distinctBase @solitudesf in sugar or typetraits i do'nt remember
11:53:18FromGitter<mratsim> @Zevv, why don't you use quote do?
11:53:50solitudesfthanks!
11:53:58FromGitter<mratsim> also is your data structure compile-time only or runtime as well?
11:56:58Zevvits compile time only - it is later used to create nim code from in a macro. Now I have one macro taking a code block with my own syntax, which gets transformed to internal AST, which gets transformed to nim code - all within the macro. I'm now looking for a way to create reusable blocks of this internal AST which I can then put together in a different way and generate nim code in 2 steps. So kind of what I
11:57:04Zevvneed is the internal AST to 'escape' the macro so I can work with it and pass it again later to another macro to convert it into NimNode
12:13:49*laaron quit (Remote host closed the connection)
12:15:55*laaron joined #nim
12:20:23*alexande1 joined #nim
12:53:45FromGitter<Riderfighter> Zevv: Any luck with your issue? It sounds like a pretty interesting
12:55:20FromGitter<alehander42> hey @kayabaNerve
12:55:28FromGitter<alehander42> i got an error in async closureiters as well
12:55:49FromGitter<alehander42> but a wrong assert n.kind == nkStmtListExpr
12:57:08*Avatarfighter joined #nim
12:57:12FromGitter<alehander42> hmm
12:57:30FromGitter<alehander42> and its because of deref :
12:57:30FromGitter<alehander42> id = (await pool.stable.addBreak(path, line)).id
12:57:35FromGitter<alehander42> i remember you had []
12:57:39FromGitter<alehander42> maybe its the same issue
12:57:51ZevvRiderfighter: naah, doing tons of other things. I get paid to do plumbing, not to play with nim code :/
12:58:19FromGitter<alehander42> @kayabaNerve yeah that fixed
12:58:21FromGitter<alehander42> try to use a temp
12:58:41shashlickNim is great and all but when you have memory issues, it is a nightmare
12:59:17FromGitter<Riderfighter> Zevv: rip, I hope you get a solution to your problem soon
12:59:23*nsf quit (Quit: WeeChat 2.4)
12:59:24*laaron quit (Remote host closed the connection)
13:01:08FromDiscord_<exelotl> hey, I have a template that gets the path of the callee using `instantiationInfo(fullPaths=true).filename`
13:01:38ZevvI have this problem where I hacked together a pretty complicated bit of code in a flow of a few days, and half a year later read back and go "how the hell did I come up with that? what does *this* do?"
13:01:46FromDiscord_<exelotl> I was wondering if I could instead get the path of the root of the project (e.g. where is main.nim located?)
13:02:30*laaron joined #nim
13:05:37*dddddd quit (Remote host closed the connection)
13:07:15*kungtotte quit (Quit: WeeChat 2.5)
13:09:07solitudesfhttps://nim-lang.github.io/Nim/macros.html#getProjectPath this?
13:12:12FromDiscord_<exelotl> ah that sounds like what I need :)
13:12:24FromDiscord_<exelotl> thanks
13:12:51FromGitter<Riderfighter> What is the best way to access the type inside of a bracketexpression e.g. seq[*string*]?
13:13:48solitudesfgenerics probably
13:13:49solitudesfproc test[T](s: seq[T])
13:13:55solitudesfyour type is T
13:14:30Zevvthat's smart
13:14:30FromGitter<SolitudeSF> nice one gitter
13:14:45FromGitter<SolitudeSF> `proc testT (s: seq[T])
13:14:50FromGitter<Riderfighter> I'll try that thank you
13:15:04FromGitter<Riderfighter> yeah gitter parsed that incorrectly lol
13:17:02*zielmicha__ quit (Ping timeout: 258 seconds)
13:17:54*zielmicha__ joined #nim
13:42:32*alexande1 quit (Ping timeout: 245 seconds)
13:50:18*laaron quit (Remote host closed the connection)
13:52:48*laaron joined #nim
13:54:53*laaron quit (Remote host closed the connection)
13:55:20*laaron joined #nim
14:03:23*laaron quit (Remote host closed the connection)
14:06:19*laaron joined #nim
14:15:29*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
14:16:12*laaron joined #nim
14:20:12*nsf joined #nim
14:31:41*dyske quit (Quit: dyske)
14:39:28lqdev[m]it's not gitter, it's the IRC↔Gitter bridge. it does not escape certain characters properly
14:42:08FromGitter<Riderfighter> ah til
14:42:12FromGitter<Riderfighter> today i learned*
14:56:30lqdev[m]building a register machine is hard, I almost want to build a stack machine instead to avoid the terrible complexity
14:57:36*MyMind quit (Read error: Connection reset by peer)
14:57:44krux02I learned a lot about that when fixing bugs for the vm in the Nim compiler
14:57:47lqdev[m]I guess I'm not ready for register machines yet
14:58:01lqdev[m]It's good I didn't build the VM yet, tho
14:59:14lqdev[m]yeah, but when I look at various register-based VMs I just can't understand why things are so different between implementations, OTOH stack machines are rather similar to each other
15:00:30krux02yea, I would build a stack machine as well.
15:00:56krux02might be slower, but it is not supposed to be the fasted anyway.
15:01:04lqdev[m]I blame Araq for convincing me to build a register-based VM
15:01:10krux02much more important is: little bugs.
15:01:17*JustASlacker quit (Remote host closed the connection)
15:01:21lqdev[m]^ indeed
15:01:31krux02well that is what he has most experience with.
15:01:36lqdev[m]but at least I learned something new from building one
15:01:38krux02for him it makes sense.
15:01:46krux02But I am not a big fan of the VM in Nim.
15:02:03krux02in my opinion it has too many problems.
15:02:06lqdev[m]yes
15:02:20krux02the problems get fixed, one at a time.
15:02:28krux02but it is not easy to work with it.
15:02:57lqdev[m]I'm not looking to make the fastest VM ever anyways, I'm just looking to create a simple embeddable scripting language with a straightforward implementation that is decently fast.
15:07:40FromGitter<mratsim> @krux02, I probably have a flawed view but for me most of the issues I see in the compiler are not due to the VM per se but due do stuff linked to symbol resolutions or the type system
15:09:22krux02I am very pessimistic right now.
15:09:30krux02I see far too bany bugs and problems in Nim.
15:09:37krux02also in the vm.
15:10:01krux02That is also a reason why I fighting hard against any new features.
15:10:10krux02They all cause problems.
15:10:17FromGitter<arnetheduck> wait what? the other day when I mentioned I might rip it out and use llvm instead, you said you liked the nim vm?
15:10:31krux02Introducing features is easy. Fixing the problems in existing features is very hard.
15:11:04lqdev[m]^ the universal truth of software development
15:11:05FromGitter<arnetheduck> introducing features without introducing problems is easy if you take care to refactor your code to make room for the new features - that hasn't really happened in the compiler
15:11:16krux02arnetheduck: that is not a fix, that is just a source of another family of problems.
15:12:13krux02recent activiy is in the alias feature. No I don't want it.
15:12:28krux02I don't care how much effort somebody put into it.
15:12:39krux02I want the compiler to work reliable.
15:13:16krux02Work that doesn't go into the direction of reliability is work in the wrong direction.
15:13:31krux02sorry for my rant
15:15:19*laaron- joined #nim
15:16:15FromGitter<arnetheduck> like I said, it's not for nimc.. but imagine that the work was done to have a swappable VM - that would make sure that the whole VM part was well-defined enough that it can stand as its own layer / module / api.. that's generally how you make things more reliable, by dividing into orthogonal pieces that are each more simple to develop - it's pretty boring and simple actually
15:16:17*laaron quit (Quit: ZNC 1.7.1 - https://znc.in)
15:17:56FromGitter<brentp> @shashlick I am planning to write a full nim wrapper for bigwig. is it common to use nimgen / nimterop to generate the wrapper and then just include that in the repo to avoid extra deps?
15:18:41shashlickare you planning on leveraging the nimbigwig wrapper
15:19:14shashlickhttps://github.com/genotrance/nimbigwig
15:19:30FromGitter<brentp> that's sort of what I'm asking. but I wondered if I could just use that to generate the code and then include it in the repo.
15:19:49FromGitter<arnetheduck> if you want reliable, you can't really have when jungles for 20 different tools (suggest, compiler etc) that use the same code with subtly different expectations - you can't really have deep mutablility where even the cgen modifies the ast in non-trivial ways.. there's simply no way anyone can reason about that code and make sense of it.. and above all, you can't have 20 unfinished features that each make it harder
15:19:49FromGitter... to debug and develop things without adding any value
15:20:16krux02arnetheduck: If you make a plugin for the compiler to use the LLVM for compile time code execution, good. If you make a fork of Nim that uses the LLVM also good.
15:20:54krux02If you rip out NimVM and replace it with a half hearted implementation for LLVM that get's hello world running but dosn't work for anything else, not good at all.
15:22:11krux02arnetheduck: I am actively working on removing unfinished features that did not work out.
15:22:11shashlick@brentp - feel free to do that
15:22:23shashlickbut the way nimgen works, it generates the wrapper for the target system at the time of install
15:22:35FromGitter<arnetheduck> well, it's not gonna happen any time soon anyway, but spending some time on removing and cleaning up stuff from the compiler, and splitting up the parts will no doubt do wonders after the initial shock - good luck :)
15:22:57krux02just today I worked on squishing "callsite()" out of the language.
15:23:17krux02it is still there, but only with a compilation flag.
15:24:28FromGitter<brentp> @shashlick. understood. I'll start by adding some sugar to nimbigwig. this will be my side project for next little while.
15:24:35shashlick@brentp - so that's why i don't have a cached copy in github, even though you can see it in the docs - http://nimgen.genotrance.com/nimbigwig/
15:24:48krux02I is just for 10 years, Nim has been a testbed for many developers with many different ideas and ideologies, and the entrance barrier for features was low.
15:25:48krux02With me on board of the Nim development, this won't happen anymore. There will be resistence to new features. And if they get introduced, I want to be sure that they won't cause harm for people who didn't ask for those features.
15:27:07shashlicki think cruft should also get thrown out
15:27:32shashlicksome renewed effort to offload more stdlib modules into nimble will be cool as well
15:30:34FromDiscord_<treeform> @krux02, cruft like the `new` and `do` keyword?
15:31:43*sagax quit (Remote host closed the connection)
15:32:13krux02well, the do keyword is ugly, I didn't see too many implications in the compiler yet because of it.
15:33:25krux02What I am more worried about are the different iterator types with sometimes implicit calling of the iterator sometimes not.
15:33:46krux02and the hard to grasp logic in overload resolution
15:33:50krux02some things are types
15:33:58krux02soem things are untyped
15:34:31*laaron- quit (Remote host closed the connection)
15:35:14krux02my biggest enemy currently is ``typedesc``.
15:35:28krux02it causes implications in the compiler everywhere.
15:36:19FromDiscord_<treeform> For me I find that the new/default constructor is the biggest wart in nim.
15:36:29krux02There is no specification of what it is, and there are literally hundread of lines ot just get rid of typedesc, because you never want it but constantly get it.
15:36:33FromDiscord_<treeform> As a newbie I found new and uses of new really confusing.
15:36:44FromDiscord_<treeform> And the solution is basically never use it.
15:37:05FromDiscord_<treeform> And when you get `Error: attempting to call undeclared routine: ‘X’`
15:37:09FromDiscord_<treeform> and you define X
15:37:11FromDiscord_<treeform> and then get
15:37:19FromDiscord_<treeform> Error: redefinition of ‘X’
15:37:37FromDiscord_<treeform> super confusing its all part of the new/default constructo wart
15:37:57krux02yea I never use new, so I didn´t realize that it causes problems.
15:38:09krux02But good point, maybe something needs to be done about it.
15:38:17FromDiscord_<treeform> exactly we all learned not to use new
15:38:25FromDiscord_<treeform> but it still there as a rock for new people to hit
15:38:45FromDiscord_<treeform> because Java,C++,C#,JavaScript all use new to create things
15:38:52FromDiscord_<treeform> people coming in want to use new, and its there and its a problem
15:38:58krux02I also don't use new very much in C++, so it is not something that I hit.
15:39:23FromDiscord_<treeform> I came from JavaScript so I though you supposed to use new
15:39:24krux02treeform, can you make an issue about it?
15:39:32FromDiscord_<treeform> Here is a blog post I was warning about it: https://blog.istrolid.com/blog/nim-things-is-new-keyword-needed.html
15:39:34krux02probably there is an issue about it
15:39:40FromGitter<mratsim> > I am actively working on removing unfinished features that did not work out. ⏎ ⏎ Are you talking about concepts? :P
15:39:43FromDiscord_<treeform> still draft I don't like how it comes off
15:39:43krux02but I really do care about usability issues.
15:39:58FromDiscord_<treeform> can you give me your thoughts on the blog post?
15:40:13krux02mratsim: I want concepts to be gone, yes.
15:40:47krux02but with concepts it is similar to ``new``, I don't use it, I don't see the problem.
15:41:11krux02I pushed araq to hide concepts behind an experimental flag.
15:41:25lqdev[m]I prefer `(ref SomeType)(field1: value)` over `var obj = new(SomeType); obj.field1 = value` since it allows you to set a case object's discriminator without the compiler yelling at you. also it takes less space
15:41:48krux02For me that is a step towards pushing them out. But they can stay in the language for now.
15:42:25krux02as long as they don't actively cause problems and are just rotting away, I don't think it is much of a problem. Maybe for those people who care about the concepts.
15:43:19FromGitter<mratsim> They are unfinished so they are useful but not that useful
15:43:24krux02lqdev: I don't use ref
15:43:36FromDiscord_<treeform> I just define ref objects
15:43:41FromDiscord_<treeform> and use them as regular objects
15:43:58FromDiscord_<treeform> I feel like the `ref`iness is part of the type not how I use the type.
15:44:00lqdev[m]I use it only with exceptions
15:44:14lqdev[m]otherwise I do as @treeform
15:44:49krux02I don't use the keyword ``ref`` at all in the code that I write.
15:45:04FromDiscord_<treeform> what do you use ptr?
15:45:04FromGitter<mratsim> @lqdev, strange I switched to the second way to avoid case object errors
15:45:52FromGitter<mratsim> real men use shaders :p
15:46:00lqdev[m]@mratsim it gave me a warning when I did `var err = newException(RodError); err.kind = reSyntax`
15:46:04FromGitter<brentp> @shashlick, do you have an example opening a bigwig without a callback? I can't send nil as 2nd argument to `bwOpen` (http://nimgen.genotrance.com/nimbigwig/bigWig.html#bwOpen,cstring,proc(pointer),cstring)
15:46:35FromDiscord_<treeform> i use `raise newException(Foo, "message")` ?
15:47:07lqdev[m]@treeform it's fine that way if you don't want to add any extra metadata to your error
15:47:44shashlick@brentp - sorry, i've not really used the lib beyond basic wrapping
15:47:46lqdev[m]but I care about customizability and extensibility so I add line info into rod errors
15:48:00krux02If I am not working in the compiler, I define a panic somewhere that I will then call instead of exceptions.
15:48:07krux02a panic with a message.
15:48:25krux02I never cared about exception classes, and I think it is super annoying to deal with them.
15:48:44FromGitter<mratsim> nowarning here @lqdev: https://github.com/numforge/laser/blob/e797ca61f3f6a2dfc9f55ba57d14059e6278319f/laser/lux_compiler/core/lux_core_helpers.nim#L69-L73
15:49:18lqdev[m]that's why I avoid making several `RodError`s and just have one with a separate `kind` field
15:50:28krux02yea the problem of the kind is then it is not extendable.
15:50:59krux02(I wouldn't mind if all exceptions were just "Problem")
15:53:26krux02the problem I have with raising exceptions is the verbosity: `raise newException(StackOverflowError, "stack overflow")`
15:53:44krux02when you call raise, you already know that it is going to pe an exception
15:53:55krux02so whay this redundant ``newException``
15:54:20krux02Also the name StackOverflowError, I know it is an Error, that is why there is raise
15:54:49krux02and then the text, in many cases just repeating the exception call, but without "Exception".
15:55:40FromDiscord_<treeform> it should be `raise StackOverflowError("stack overflow")`
15:55:52krux02I would be happy with this: ``rause "stack overflow"``, it has all information needed.
15:55:54FromGitter<mratsim> It's better than "StackOverflowError(msg: "stack overflow", lineinfo: "...", fieldX: 1234)
15:55:56lqdev[m]`template error(kind: untyped, msg: string) = raise newException(`kind Error`, msg)`
15:56:17FromGitter<mratsim> the object constructor syntax is quite verbose in general as well
15:56:42lqdev[m]@krux02 except any auxiliary information you may need if you want to catch the exception
15:57:10krux02I generally don't catch exceptions.
15:57:33lqdev[m]I still catch myself writing `raise new ValueError` since I programmed in Java for quite some time
15:57:45disruptekyou can just template exceptions and get rid of the noise, right? i don't do it because i think it's unnecessary obfuscation, but it's always a possibility...
15:57:46lqdev[m]fortunately I stopped
15:58:04krux02disruptek, yes I can.
15:58:26disruptekmy goal is to never raise.
15:58:36krux02but usually I don't have such a template in scope. And then instead of doing that, I just write ``quit("problem here")``
15:58:37lqdev[m]`template panic(msg: string) = raise newException(Exception, msg)` there you go
15:58:39disruptektoo many issues with the current exceptions.
15:59:12disruptekleave the raise outside the template; otherwise, a ready cannot understand control flow.
15:59:16disrupteks/ready/reader/g
15:59:49krux02actually I had such a template already
15:59:52lqdev[m]you can avoid using raise but then it becomes either rusty and verbose or the end user of your library can't catch potential errors at all
15:59:54FromGitter<Riderfighter> Hello disruptek and krux02 👋
16:00:11disrupteksup 'fighter
16:00:28krux02Riderfighter: hi
16:00:28disrupteknah, that's not true. most of the time, you can code out exceptions.
16:01:21FromGitter<Riderfighter> lqdev: how is your vm going?
16:01:27krux02in emacs-lisp I really got used to the or operator.
16:01:33lqdev[m]I'll keep using exceptions since that's the language's primary way of signifying errors.
16:01:43krux02(or (might-return-nil) fallback)
16:02:09krux02for me that is nicer to read than an api that returns an exception
16:02:23disruptekit's the language's way of signifying exceptions. this should not have bearing on code which, by definition, you except to follow an "error" code path.
16:02:42disrupteks/except/expect/
16:02:44disruptekoi
16:03:07FromGitter<mratsim> I feel like the errors vs exceptions monthly discussion got a new twist with uncatchable panics right here and there :P
16:03:08lqdev[m]@Riderfighter rewriting it to a stack-based VM since I understand them better than register-based
16:03:29krux02In my opinion, there is very little code, where exceptions are actually the good clean solution. Most of the time they are not.
16:03:54krux02I had once in my life a code snippet, where I thought exceptions here are actually helping me here.
16:04:06disruptekexactly.
16:04:07*Trustable joined #nim
16:04:12disruptekthey are generally a sign of laziness.
16:04:37FromGitter<mratsim> I'd rather debug exception-based code with a nice call stack than dealing with bubbling errors that pollute return types
16:05:00krux02I am lazy, I don't want to deal with try catch blocks, therefore I don't write ``raise``.
16:05:02FromGitter<mratsim> and people ignores error return value left and right
16:05:04disruptekif you think an error is pollution, that's a problem.
16:05:42krux02mratsim: people also ignore exceptions unless they make there program crash.
16:05:51FromGitter<mratsim> if err = mylib.add(result, a, b): ⏎ ... ⏎ ⏎ is pollution compared to result = a + b [https://gitter.im/nim-lang/Nim?at=5d41bc5f1241645b16f0f717]
16:06:00FromGitter<Riderfighter> Sounds awesome lqdev, I'd be interested in checking out your implementation when its complete if that's possible
16:06:33disruptekif an error is possible, why demote its handling in such a way that hides, obfuscates, elides, or confuses that handling?
16:06:52FromGitter<mratsim> @krux02, regarding that I hope one day the effect system will allow to force checking exceptions that can be raised in the code
16:07:04FromGitter<mratsim> AFAIK the seperation between Defect and Exception was to prepare that
16:07:34disruptekthe issue is with broken .raises., broken .async. exceptions, and incomplete dfa.
16:07:46FromGitter<mratsim> why obfuscate the actual result and make an error takes it's place
16:07:57FromGitter<mratsim> its*
16:07:59krux02AFAIK, I don't know the difference between an exception and a defect.
16:08:01disruptekan error is, by definition, an actual result.
16:08:25krux02well I do know the difference
16:08:30disruptekalso c, cpp, and --noCppExceptions codegen is broken as per my issue.
16:08:31krux02but I don't want to bother about it.
16:09:02FromGitter<mratsim> one is related to user/network input and you should be able to recover from (say FileNotFOund) the other is related to unrecoverable situation (out of memory, file handle exhausted)
16:09:52FromGitter<mratsim> anyway, I'm off from that discussion, I feel like it's really become a monthly one
16:10:26krux02good
16:10:39disruptekyes, it's easier, safer, and (imo) better, to simply not use exceptions.
16:11:06FromGitter<zetashift> I also stumbled over treeforms problems with object initialization and using new. It's still a bit unclear but I've just accepted it as is
16:11:36disrupteki cannot afford to reread, redebug, or rewrite nim for a new exception semantic a year or two down the road.
16:12:11FromDiscord_<treeform> zetashift, thanks, am not alone.
16:12:55disruptekwhat's the obj init problem?
16:13:23disruptekall i saw was the known-defect with variants, but it can be fixed in the future.
16:15:43dom96treeform: krux02: sounds like we should remove `new` from the language
16:17:24disruptekprobably should be deprecated with a switch and analyzed in stdlib, for starters.
16:18:22disrupteki can't find a single case where i've used it in anything i've written so far.
16:20:25krux02I used ``new`` on result.
16:20:34disruptekyeah, that's the common idiom.
16:21:11krux02but I can rewrite it with type initializers as well.
16:21:35krux02result = typeof(result)()
16:21:36krux02:P
16:21:55krux02don't know if it even compiles
16:22:53dom96disruptek, a deprecation path is a given in Nim land :)
16:24:10FromDiscord_<treeform> dom96, your thoughts on: https://blog.istrolid.com/blog/nim-things-is-new-keyword-needed.html
16:24:26disrupteksure, but it's too pervasive not to hide it behind a switch, then a hint, then a warning, etc.
16:25:20dom96treeform: my thoughts are: write about something positive :)
16:25:33dom96This doesn't need a blog post, an issue/forum post is enough
16:25:56*abm quit (Quit: Leaving)
16:26:18*abm joined #nim
16:27:31krux02treeform: I think that is a bad example, since I wrote nim glm
16:27:43krux02the constructor is lower case and the type is upper case.
16:27:57FromDiscord_<treeform> krux02, yeah that's what I do right now
16:28:27FromDiscord_<treeform> https://github.com/treeform/vmath/blob/master/src/vmath.nim#L184
16:28:30FromDiscord_<treeform> but I don't like it.
16:29:07krux02why don't you use glm?
16:29:16FromDiscord_<treeform> I had problems using it when I started.
16:29:26krux02what problems?
16:29:32FromDiscord_<treeform> I tried using it but it would create errors I did not understand at the time.
16:30:01krux02I put quite some effort into glm, so that everything that glsl has is alos available in nim-glm
16:30:13dom96the convention is to use `initVec3` in that case
16:30:58krux02dom96: but that is not the convention for glm
16:31:26FromDiscord_<treeform> dom96, we want a basic type like int or float for vec3
16:31:26krux02it would be very annoying to type
16:31:36FromDiscord_<treeform> yeah initVec3 is very annoying to type when you type it a ton
16:32:24dom96true
16:33:03krux02it is not just the typing, when you have it 4 times in a single line, then it also sreaches the line quite a lot.
16:33:51lqdev[m]also glsl
16:34:10FromDiscord_<treeform> lines that contain vec code contain it multiple times
16:36:37krux02I have a macro that compiles nim code to glsl. Therefore I had to have an accurate reimplementation of glsl builtins, so that I could compile calls to these functions to their matching glsl builtin equivalent.
16:37:06krux02I have to go now
16:38:57FromDiscord_<exelotl> I like the way nico does things: https://github.com/ftsf/nico/blob/master/nico/vec.nim
16:39:38FromDiscord_<exelotl> e.g. Vec2f is the type, vec2f() is the constructor
16:41:23FromDiscord_<treeform> yeah that works
16:41:41FromDiscord_<treeform> I just never used the d and i variants...
16:41:58dom96I guess I've been torturing myself with writing Point[float](x: ..., y: ...) everywhere
16:42:07FromDiscord_<treeform> yes
16:43:17FromDiscord_<treeform> we all like to create slightly different but mostly the same vector libraries
16:43:26dom96I've thought about changing it, but these kinds of refactorings are always boring
16:43:47FromDiscord_<treeform> it all stems from the fact that you can't define vec3 as a type and as a constructor.
16:44:00dom96I did just spend the past few hours optimizing my protocol to use smaller integers instead of floats/int64s though
16:44:07dom96also pretty boring
16:45:07FromDiscord_<Avatarfighter> dom96: congrats I guess haha
16:45:13FromDiscord_<treeform> I like optimizing
16:45:31dom96What I should really be doing is figuring out why the simulation cannot handle 100+ players :(
16:45:35FromDiscord_<treeform> Give me speed or space optimization problem and I am good.
16:46:15dom96But the protocol optimizations are related to that
16:46:26FromDiscord_<Avatarfighter> What are you working on dom96?
16:46:30dom96`send` is taking a significant chunk of time
16:46:37FromDiscord_<treeform> He is building an MMORPG.
16:46:38dom96Avatarfighter: an agar.io-like game
16:46:41FromDiscord_<Avatarfighter> oh dang
16:46:44FromDiscord_<Avatarfighter> I wanna help haha
16:47:11dom96Don't think MMORPG is the right description :P
16:47:56dom96Avatarfighter, I can ping you when it's ready for testing if you're up for it? :)
16:48:41dom96I think I'll need to implement better lag compensation as well
16:48:43FromGitter<Riderfighter> Sure! that would be awesome
16:48:56FromGitter<Riderfighter> I'll set up a botting framework in no time :P
16:49:15dom96Riderfighter: that will be a good test actually, I want to be ready for bots
16:51:09FromDiscord_<treeform> dom96, do you use websockets?
16:51:14dom96yep
16:51:20FromDiscord_<treeform> which one?
16:51:42dom96I tried your library and from what I could tell it had too much bugs
16:51:45*nif quit (Quit: ...)
16:51:54*nif joined #nim
16:52:00dom96(and some lack of features)
16:52:08FromDiscord_<treeform> mind making a list?
16:52:12dom96so I'm using niv's
16:52:18dom96I created an issue IIRC
16:52:44FromDiscord_<treeform> oh I did not see that
16:55:31FromDiscord_<Littleli> Hello Nim people. I have some trivial experience with Golang and some nontrivial with Java. I have probably very common question. How to map some of the features from those languages to Nim. The most important to me is what's there to replace concept of interfaces, I'm pretty sure there is something but now Nim is still too new to me.
16:55:57FromDiscord_<Littleli> Hello Nim people. I have some trivial experience with Golang and some nontrivial with Java. I have probably very common question. How to map some of the features from those languages to Nim? The most important to me is what's there to replace concept of interfaces, I'm pretty sure there is something but now Nim is still too new to me.
16:57:09lqdev[m]@Littleli you can replace interfaces using tuples with proc fields
16:58:52FromGitter<mratsim> Hello wanderer, forget all hope and embrace the absence of interface, soon your horizon will be filled with rainbows and unicorns
17:00:05FromGitter<brentp> nim concepts are closest thing to go interfaces
17:00:06FromGitter<mratsim> You use closures like lqdev said, or methods (+ inheritance) or concepts
17:03:19FromDiscord_<Littleli> hm, I would like to take a look at some example to have better understanding what that means
17:05:02FromGitter<mratsim> Concepts: https://nim-lang.org/docs/manual_experimental.html#concepts
17:05:41FromGitter<mratsim> Methods, second half of the post: https://matthiashager.com/proc-method-nim
17:05:53FromGitter<mratsim> and this one as well: https://nim-lang.org/docs/tut2.html
17:06:50FromGitter<mratsim> and closures/callbacks: https://nim-lang.org/docs/manual.html#types-procedural-type
17:08:42krux02brentp: nim concepts and go interfaces are pretty much a very different thing.
17:09:29FromGitter<brentp> do tell
17:09:52*gokr joined #nim
17:11:16disruptekthere is almost no documentation on method or its semantics; it confused me wrt exceptions.
17:11:50krux02Go interfaces are a reliable and stable type specification for runtime polymorphism. Concepts are an experimental Nim feature for compile time polymorphism.
17:13:40krux02I onece wrote a macro to have go like interfaces in Nim.
17:14:42FromGitter<brentp> fair enough, though I'd say to the naive user (such as myself) they are fairly similar.
17:18:06*sagax joined #nim
17:22:04*nif quit (Quit: ...)
17:22:46*nif joined #nim
17:25:00FromDiscord_<Littleli> Thanks a lot 😃 I'll get through the recommendations. I'm basically researching now, I want to learn language which produces binaries and have decent support for parametric polymorphism and Nim appear to be very nice candidate! I'm not afraid to try anything new and even unlearn stuff ❤
17:28:36krux02Littleli: what is parametric polymorphism?
17:29:30FromDiscord_<Littleli> I'm referring to generics
17:29:45krux02ok
17:38:34FromGitter<mratsim> iirc That's the Haskell name for generics
17:45:28FromDiscord_<Littleli> it's more like a proper term from the type theory. so yeah, Haskell is full of it. In practice it shrinks little bit to have proper container types like generic collections and better functions that can work for multiple types
17:46:46FromDiscord_<Littleli> using collections without generics is quite painful and depending on how they are implemented it can hurt performance (boxing)
17:47:00FromDiscord_<Littleli> using collections without generics is quite painful and depending on how they are implemented they can hurt performance (boxing)
17:55:15FromGitter<zetashift> @dom86 I think treeform's blogpost is quite handy for newcomers, PMunch had a reddit post that clarifies a lot about doing basic stuff with Nim's type system that someone coming from C# or something wouldn't understand.
17:55:45*Avatarfighter quit (Remote host closed the connection)
18:01:04*Avatarfighter joined #nim
18:05:01FromGitter<Riderfighter> Quick clarification question, there is no way to set the default value of a field right?
18:06:40shashlickis --gc:v2 == --gc:markandsweep?
18:11:03*Avatarfighter quit (Remote host closed the connection)
18:11:58krux02Riderfighter: default is zero right now
18:13:49*jjido joined #nim
18:14:07*dgreen joined #nim
18:15:24FromDiscord_<treeform> @Littleli in nim I do none of that Interface stuff I did with Java. I would suggest trying to write code without classes/inheritance/interfaces. This has really opened my mind on things. The code it much simpler for me. I no longer get why we needed classes/inheritance/interfaces in the first place.
18:15:41FromDiscord_<treeform> @Littleli in nim I do none of that Interface stuff I did with Java. I would suggest trying to write code without classes/inheritance/interfaces. This has really opened my mind on things. The code is much simpler for me. I no longer get why we needed classes/inheritance/interfaces in the first place.
18:17:38krux02yea I also don't get it.
18:18:11krux02There is a lot of complex technology out there that can be replaced with nothingness.
18:19:03FromDiscord_<treeform> I agree.
18:20:46*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
18:24:41*floppydh quit (Quit: WeeChat 2.5)
18:24:57*floppydh joined #nim
18:37:53*ikan-keli_ quit (Ping timeout: 258 seconds)
18:38:03*ikan-keli_ joined #nim
18:42:49*nif quit (Quit: ...)
18:43:02*nif joined #nim
18:47:12lqdev[m]I'm trying to wrap soundio with nimterop but it throws a ton of linker errors once I try to compile it
18:47:35lqdev[m]all with some `__imp_` prefix
18:47:57lqdev[m]seems like all the undefined references are coming from soundio.c which I'm definitely compiling
18:49:32krux02lqdev[m], without showing what you are actually compiling and how, I can't help you
18:50:23lqdev[m]this file fails to compile: https://github.com/liquid600pgm/rapid/blob/master/src/rapid/audio/device.nim
18:51:09krux02and what is your error message?
18:51:15lqdev[m]worth noting is that I did `"--passL:-lole32 -lwinmm"` which currently is not present in my wrapper
18:51:19lqdev[m]give me a sec
18:51:53shashlick@krux02 - if I am loading a nim --app:lib dll into my nim program with loadLib, is it possible to get stack traces for code running in the dll?
18:51:59shashlickmy main program shows stack traces just fine
18:52:37krux02shashlick, if you run your application with gdb and your dll is build with debug information, then sure
18:53:08krux02nim stack traces (those automatically printed without using gdb only work for nim code)
18:53:12shashlickya i've been able to step through with gdb but seeing the stack trace would make debugging 1000 times faster
18:53:26shashlickbut the dll is also nim code
18:53:40krux02ah,
18:53:53krux02I didn't write dll with nim yet.
18:54:08shashlicki get something like this - `terminate called after throwing an instance of 'tyObject_IndexError_K39aEGuwNdydKn2WFEpUygg'`
18:54:46krux02looks like an index out of bounds exception
18:54:50krux02that wasn't caught
18:55:30shashlickya but where in the code! i just called into a big chunk of code so i just have a clue where to start stepping through
18:56:00lqdev[m]krux02: https://gist.github.com/liquid600pgm/b329c1b22a256ab5ac509e0dbbbe0246
18:56:21dom96krux02: treeform: interfaces are needed for exactly the use case that `streams` and `logging` shows
18:56:50dom96both modules solve it differently (object of proc types vs. inheritance + methods)
18:56:52*floppydh quit (Quit: WeeChat 2.5)
18:57:13krux02names that start with __ are actually illegal in C
18:57:21*lritter joined #nim
18:57:23lqdev[m]shashlick: maybe try except in your library source code and then writestacktrace?
18:57:33krux02they are reserved for compiler internal names
18:57:54lqdev[m]yeah, it's not present in soundio source code either so I assume this is something compiler related
18:58:01lqdev[m]I did make sure I compile each file
18:58:33*jjido joined #nim
18:58:44lqdev[m]you can find the wrapper here https://github.com/liquid600pgm/rapid/blob/master/src/rapid/lib/soundio.nim
18:59:55krux02where is the soundio.c file?
18:59:55shashlick@lqdev - you might need to link with g++
19:00:23krux02lqdev[m], whatever happens there is wrong
19:00:52lqdev[m]krux02: it's pulled from github https://github.com/andrewrk/libsoundio/blob/master/src/soundio.c
19:01:37krux02the problem is, I don't know what magic niminterop does
19:01:45krux02it is probably the source of your problems
19:02:17lqdev[m]shashlick: compiling with nim cpp does not change anything
19:02:39shashlickcheck this out - https://github.com/nimterop/nimterop/blob/master/config.nims
19:02:59shashlicki am not certain if this is the fix but it sounds familiar
19:04:01lqdev[m]added --gcc.linkerexe:g++ but no effect
19:04:51krux02I also don't know what problem nimterop tries to solve, nim has builtin functionality to import c types and functions.
19:05:04krux02{.importc: "foobar".}
19:05:22krux02I know how to write wrappers with those pragmas, but nof with nimterop
19:06:17lqdev[m]yeah I might need to resort to wrapping like that, I don't need all the things anyway
19:06:25lqdev[m]but with nimterop it's plain convenient
19:06:25shashlick@krux02 - it is the same goal as c2nim, but uses tree-sitter to parse C source and generates nim wrappers from that
19:08:19krux02aparently it does something wrong
19:08:27krux02probably a wrong prefix set somewhere
19:08:44shashlick@lqdev - why -lasound -lpulse -ljack
19:08:45krux02that is why everything get's prefixed with this __
19:08:46lqdev[m]this `__imp_` thing seems to be mingw specific
19:08:47shashlickdo you need all
19:08:58lqdev[m]shashlick: I changed it locally
19:09:16lqdev[m]just need to push the commit that fixes this
19:09:45krux02well, when it is mingw specific, you can try to compile with clang then
19:10:27lqdev[m]another thing to download on my shitty internet, great
19:10:28shashlicklqdev - device.nim compiled just fine on ubuntu
19:10:30shashlickyou on windows?
19:10:33lqdev[m]yes
19:10:56lqdev[m]also the laptop I'm testing on is not mine, so I'd prefer to not download too many things
19:14:38shashlickgetting different linker errors - what windows libs need to be linked?
19:14:49shashlick`__imp_CoInitializeEx'
19:15:10lqdev[m]-lole32 -lwinmm for sure
19:16:02shashlicki added -lole32 and it compiles fine for me
19:16:12lqdev[m]huh
19:16:18lqdev[m]I wonder why it doesn't compile for me
19:16:23shashlicki'm using mingw 8.1.0 though
19:16:35shashlickx86_64-w64-mingw32
19:16:51lqdev[m]what mingw does nim bundle?
19:16:53shashlickgcc version 8.1.0 (x86_64-posix-sjlj-rev0, Built by MinGW-W64 project)
19:16:55lqdev[m]and how can I override it?
19:17:07shashlicknim downloads an older version
19:17:18shashlick6.3.0 or something
19:17:24lqdev[m]that's what i thought
19:17:37lqdev[m]fortunately I installed mingw separately
19:17:44lqdev[m]how can I override the version nim uses/
19:17:45lqdev[m]?
19:17:46shashlickhttps://sourceforge.net/projects/mingw-w64/files/
19:17:52lqdev[m]yeah this one
19:17:58shashlickjust change your path or edit nim.cfg
19:19:27lqdev[m]I have mingw-w64 gcc in my path, where's nim.cfg?
19:19:33lqdev[m]I can't find it
19:20:46lqdev[m]nvm I think I got it
19:21:35*nsf quit (Quit: WeeChat 2.4)
19:22:33shashlickhow do you put a try/catch block around a body passed in a macro
19:22:39shashlickanyone doen that before have code handy?
19:24:33lqdev[m]changed the path, no luck
19:26:44*stefanos82 quit (Quit: Quitting for now...)
19:26:45shashlicktry deleting the source and the nimcache
19:30:07lqdev[m]no luck
19:33:06*dddddd joined #nim
19:38:00lqdev[m]the version of GCC I have is `gcc version 8.1.0 (x86_64-posix-seh-rev0, Built by MinGW-W64 project)`
19:45:41*Avatarfighter joined #nim
19:49:31*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:54:43*kungtotte joined #nim
19:58:47FromGitter<alehander42> guys do you use bindUnix
19:59:04FromGitter<alehander42> i get an error
20:00:11Zevv"an error"
20:00:59Zevvasync or sync bindUnix?
20:01:09Zevvand what error
20:03:04FromGitter<alehander42> sorry, async
20:03:14FromGitter<alehander42> "address family not supported"
20:03:33FromGitter<alehander42> sorry, i dont know what i am doing
20:03:38FromGitter<alehander42> was trying to create a named pipe ? :D
20:03:48FromGitter<alehander42> i will try with port instead
20:03:50FromGitter<alehander42> (tcp?)
20:05:00Zevvah I think the async unix bind is stdlib is mine
20:05:07Zevvmake sure you create the right type of socket to bind on
20:05:53ZevvDomain = AF_UNIX
20:05:56FromGitter<alehander42> i was trying to do
20:05:57FromGitter<Riderfighter> ^ I was going to say that error looks more like an issue with the newSocket that you made
20:06:06FromGitter<alehander42> var socket = newAsyncSocket() ⏎ socket.setSockOpt(OptReuseAddr, true) ⏎ # socket.bindUnix("/var/run/ct_socket") didnt work ⏎ socket.bindAddr(Port(7_000)) ⏎ socket.listen() [https://gitter.im/nim-lang/Nim?at=5d41f4aebea6966fb04d1e93]
20:06:34FromGitter<alehander42> ah
20:06:44disrupteknewAsyncSocket(AF_UNIX, SOCK_STREAM, IPPROTO_IP)
20:06:45*jjido joined #nim
20:06:50Zevvright-o
20:06:56disrupteksock.connectUnix("/some/socket")
20:06:58Zevvand ports make no sense on unix sockets
20:07:25FromGitter<alehander42> yes , i thought i can make a tcp socket instead
20:07:29FromGitter<alehander42> if this doesnt work
20:08:48*Avatarfighter quit (Remote host closed the connection)
20:11:14*solitudesf quit (Remote host closed the connection)
20:13:21*solitudesf joined #nim
20:15:36FromGitter<alehander42> ok now i should think of how to make node listen
20:15:40FromGitter<alehander42> without eaddruse
20:16:00*r3c joined #nim
20:17:12*ofelas joined #nim
20:19:06ZevvI got a message saying " Error: The fields ''offset'' and ''str'' cannot be initialized together, because they are from conflicting branches in the case object", but I suspect the diagnostics are wrong. Can this test be disabled?
20:20:07FromGitter<alehander42> ok i needed to use socket
20:20:11FromGitter<alehander42> not server from 'net'
20:20:16FromGitter<alehander42> in node
20:20:28r3cHi, how to fill this, anybody knows?
20:20:32r3cvar tbl = initTable[int, seq[float32]]()
20:20:35FromGitter<alehander42> no, aren't they in different branches
20:20:54FromGitter<alehander42> they would probably overlap, it uses a c union
20:21:08FromGitter<alehander42> {2: @[0.0]}.toTable()
20:21:13*solitudesf- joined #nim
20:21:21*solitudesf- quit (Remote host closed the connection)
20:21:47Zevvalehander42: they *are* in different branches, but the code triggering this is `Inst(op: opStr, str: s)`. I'm not touching the `offset` field
20:22:22r3ctbl[0][0] = 4.6 # error, key 0 doesnt exist
20:22:26Zevv`op` is the discriminator
20:23:30r3ctbl[0].add(4.6) # error
20:24:03*solitudesf quit (Ping timeout: 248 seconds)
20:24:29FromGitter<Riderfighter> r3c: you're table takes a key of int with a value that must be a sequence of float32s
20:24:38FromGitter<alehander42> r3c well you should first initialize
20:24:39FromGitter<alehander42> 0
20:24:50FromGitter<alehander42> e.g. tbl = {}
20:24:54FromGitter<alehander42> if you do tbl[0].add
20:24:57FromGitter<Riderfighter> That too
20:24:59*Avatarfighter joined #nim
20:25:10FromGitter<alehander42> you add to tbl[0] but this is an error, as tbl doesnt have 0
20:25:12FromGitter<alehander42> yet
20:25:19FromGitter<alehander42> so you need to e.g. tbl[0] = @[]
20:25:25FromGitter<Riderfighter> ^
20:25:28r3cugh
20:25:36r3clet me try
20:25:39FromGitter<Riderfighter> I feel you
20:26:25FromGitter<alehander42> one can make a method that autoinitializes it in principle
20:27:17FromGitter<alehander42> Zevv and you're sure str is in opStr
20:27:27FromGitter<alehander42> it would be a pretty big bug
20:27:33*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:27:36FromGitter<alehander42> imho if that's the error
20:28:31Zevvalehander42: yeah, 100%. Its sued in a lot of places, but this goes through a fishy macro call
20:29:14r3calehander42 tnx
20:29:25Zevvtrying to reduce
20:31:41Zevvreduced: http://ix.io/1QbZ
20:36:51*sschwarzer joined #nim
20:40:04Zevvhttps://github.com/nim-lang/Nim/issues/11862
20:41:07*ng0 quit (Quit: Alexa, when is the end of world?)
20:43:13lqdev[m]shashlick: regarding cross-compilation to windows with nimterop, can't you use `defined(unix) and defined(mingw)` to check when nimterop is being cross-compiled to windows? this is how `-d:mingw` works
20:46:23*Avatarfighter quit (Quit: Ping timeout (120 seconds))
20:50:32*sschwarzer quit (Quit: leaving)
21:01:40FromGitter<awr1> https://blog.golang.org/why-generics
21:01:48FromGitter<awr1> remains to be seen if this proposal is successful
21:03:44*jjido joined #nim
21:07:25*Trustable quit (Remote host closed the connection)
21:11:56shashlick@lqdev - problem is that all OS procs won't work correctly
21:12:27shashlicksince nim will set OS to windows and all osseps no longer work correctly for example
21:12:31FromGitter<awr1> `defined(windows)` should be correct
21:12:37FromGitter<awr1> even if cross compiling
21:12:44shashlickthere's no separation of compile time vs. runtime
21:13:27FromGitter<awr1> hm
21:13:30shashlickif you do -d:mingw, defined(windows) is true, but you are still running on a linux system at compile time
21:13:43shashlickso DirSep = '\\'
21:14:06FromGitter<awr1> it seems like your problem is that `when nimvm` is not used enough in the stdlib
21:14:30FromGitter<awr1> and i guess hopefully that `when nimvm` has "actual OS" correct defines
21:14:39FromGitter<awr1> i see what you mean
21:15:57*lritter quit (Quit: Leaving)
21:16:31FromGitter<alehander42> ah zevv
21:16:35FromGitter<alehander42> probably quote do
21:16:41FromGitter<alehander42> does something like copying all the fields
21:16:43FromGitter<alehander42> of `b`
21:17:37FromGitter<mratsim> https://hackaday.com/2019/07/30/c20-is-feature-complete-heres-what-changes-are-coming/
21:17:46FromGitter<mratsim> C++20 features finalized
21:21:17*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:25:22shashlick@awr1 - actually, if I could tell what OS i am compiling on, i could solve that issue
21:25:43shashlickcause i have my own make shift mkdir and what not since os doesn't work at compile time
21:26:20shashlickthere's nothing i can key off of to tell what the OS is, just the target OS
21:29:33*batok joined #nim
21:43:37*jjido joined #nim
21:48:09*jjido quit (Client Quit)
21:52:37FromGitter<brentp> I am getting a rangeError. how can I compile my code to run as fast as possible (it takes 2.5 hours to get to the part where the bug manifests with -d:danger) but still give a reasonable stack trace?
21:53:02FromGitter<brentp> I tried `-d:release --excessiveStackTrace:on --rangeChecks:on` but get no useful info.
21:59:04*al_ joined #nim
22:00:14*al_ quit (Client Quit)
22:03:55FromGitter<brentp> trying again with `-d:release --stackTrace:on --lineTrace:on --excessiveStackTrace:on --rangeChecks:on`
22:06:00FromGitter<mratsim> excessiveStackTrace :? wow
22:07:19FromGitter<arnetheduck> afair, line/stack tracing causes something like 2-3x slowdown due to how it's implemented
22:09:14*Vladar quit (Remote host closed the connection)
22:11:28*solitudesf joined #nim
22:17:25*solitudesf quit (Ping timeout: 246 seconds)
22:19:20krux02@brentp: -d:dange -g
22:19:28krux02-g puts in debug information
22:19:32krux02(
22:19:34krux02for gdb
22:19:49krux02Nim won't be able to create it's own stack traces though, you have to use gdb them
22:20:08krux02-d:danger turns on all optimizations
22:20:17krux02and disables all runtime checks
22:21:37FromGitter<alehander42> @brentp also try to use rr like `rr <yourprogram> <args>`
22:22:04krux02what is rr?
22:22:14FromGitter<alehander42> it will record it and you'll be able to replay it many times/go back which is pretty important for similar hard to diagnose bugs
22:22:28FromGitter<alehander42> https://github.com/mozilla/rr
22:23:16FromGitter<brentp> ok. if my current incantation does not yield anything informative, I'll try this rr and -g
22:24:32*HP-YC9 quit (Remote host closed the connection)
22:25:25FromGitter<alehander42> you need to compile with debug symbols (like `-g`) and after run under rr: usually it adds only ~1.2x slowdown, but after that you can replay it deterministically with rr replay (which exposes a gdb session)
22:25:55FromGitter<alehander42> which is generally useful for native source
22:26:11FromGitter<alehander42> but it only works on linux currently
22:26:40krux02and intel CPU
22:26:53krux02I am not really sold on this rr thing
22:28:59FromGitter<brentp> ok. i am on linux so i'll give it a try.
22:29:32FromGitter<alehander42> krux02: well, if it works on your platform, its great
22:29:56FromGitter<alehander42> its sad that os-es/arch-s dont always have matching primitives for this stuff
22:30:22shashlick@krux02 - what suggestions for gcasserts
22:30:36krux02I also don't really care about this replay thing, because why would I
22:30:48krux02what I care about is inspecting data
22:30:59krux02and gdb allows be to call arbitrary functions
22:31:04krux02I use that to inspect data
22:31:13FromGitter<alehander42> but its an impressive piece of engineering, i love to read some of its issues, as rocallahan is pretty good in .. well debugging complex stuff
22:31:24FromGitter<alehander42> krux02: rr also lets you call arb functions
22:31:32FromGitter<alehander42> it lets you do everything db
22:31:35FromGitter<alehander42> gdb lets you do
22:31:44FromGitter<alehander42> but also, you can go back
22:31:58krux02I often break the compiler, and then when I want to inspect a nimNode I call a function, the default nim code renderer, to print the node
22:32:02krux02really useful
22:32:10FromGitter<alehander42> but you can do everything you can in gdb, in rr
22:32:18krux02in gdb you can go back as well
22:32:24FromGitter<alehander42> meeeeeeeeeeeeeeeeh
22:32:25FromGitter<alehander42> no
22:32:25krux02I did reversable debugging in gdb
22:32:28FromGitter<alehander42> its very slow
22:32:30FromGitter<alehander42> very limited
22:32:35FromGitter<alehander42> not really usable
22:32:40krux02it worked for what I needed.
22:32:48FromGitter<alehander42> thats why undodb exists and sells for a *lot* of money
22:32:52krux02It works with fork()
22:32:57krux02so it only works on linux
22:33:27krux02so you have to know from where you want to resume, but when that point is known to you, you basically have save states of your program.
22:33:44FromGitter<alehander42> the other thing is: replay is very important when you
22:33:52FromGitter<alehander42> hit a hard to reproduce bug
22:34:02krux02that is true
22:34:05FromGitter<alehander42> because then you can replay the right repro as many times you need
22:34:14krux02but generally bugs in Nim are reported in a reproducable way
22:34:27krux02so that isn't really a problem for Nim development
22:34:30FromGitter<alehander42> yeah, but the reverse thing is still pretty good
22:34:41FromGitter<alehander42> but i agree: its sad that it cant work on osx
22:34:49FromGitter<alehander42> windows do have some similar tech afaik
22:35:02krux02does it support the nim pretty printers that I wrote?
22:35:03FromGitter<alehander42> in windbg, but i havent tried it
22:35:12FromGitter<alehander42> krux02: rr supports everything gdb supports
22:35:15FromGitter<alehander42> it runs a gdb server
22:35:53disrupteknow you're talking his language.
22:36:08FromGitter<alehander42> yeah, it's basically gdb++
22:36:41FromGitter<alehander42> i am very biased, as a project i work on is kinda based on rr, so i also wrote many python scripts for it
22:36:50krux02then why isn't it in gdb?
22:36:50FromGitter<alehander42> but i still think its a useful tool objectively
22:37:02krux02I mean as a PR for it
22:37:15FromGitter<alehander42> well, it uses gdb as a component iirc
22:37:26FromGitter<alehander42> it exposes a gdb server for debugging the replays
22:38:12FromGitter<alehander42> what i meant was that you can use it as gdb++ if thats what you need
22:40:39FromGitter<alehander42> but it has other functions, e.g. chaos mode, which tries to find more rare scheduling-related bugs and to record them etc
22:40:48FromGitter<alehander42> iirc they mostly started it for firefox
22:42:09FromGitter<brentp> wait, so I can compile with -d:danger as long as I have -g as well? (for gdb?)
23:00:36shashlickIs it possible to use a C leak detector with Nim
23:04:18krux02brentp: yes
23:04:56krux02I honestly thing these flags: dager release debug etc, they are all stupid, because what do they mean?
23:05:03krux02differnt things for different people
23:05:21krux02I thing gcc has actually clean flags here
23:05:27krux02-g for debugging symbols
23:05:49krux02and -O1 to -O3 for optimization level.
23:06:09r3c@shashlick You can use Valgrind
23:06:59krux02I made sure that -g is a valid flag for Nim as well. Bascally that flag is forwarded for the C compiler.
23:07:20shashlickValgrind is not known to work with Nim
23:07:55disruptekhow can i properly, fully, completely `make clean` in my Nim directory?
23:09:21FromGitter<alehander42> krux02 btw i use gcc.options.debug = "-O0 -g3"
23:09:27FromGitter<alehander42> because i had some problems with -Og
23:09:28FromGitter<alehander42> iirc
23:09:39FromGitter<alehander42> it still led to some optimized out
23:12:58FromGitter<alehander42> oh yes, finally my node<->nim ipc
23:16:55rayman22201@shashlick, I haven't kept up, but I thought valgrind worked with Nim? A (old) forum post from Araq says it does: https://forum.nim-lang.org/t/3919#24424
23:17:14rayman22201maybe things have changed though
23:18:08FromGitter<alehander42> hm i need to send stuff back
23:18:13disrupteki think clybber uses it with valgrind all the time.
23:18:48FromGitter<alehander42> he uses the new runtime i think
23:19:03FromGitter<alehander42> iirc with malloc ?
23:19:15FromGitter<alehander42> which helped with using it
23:19:18FromGitter<alehander42> but i might be wrong!
23:19:35rayman22201I know 100% that newruntime or gc:none + --usemalloc will work with any C leak detector. I bet that is not what shashlick was hoping for though :-)
23:19:52FromGitter<alehander42> yea :(
23:20:06FromGitter<alehander42> whats the problem with valgrind + gc?
23:21:17FromGitter<alehander42> ok two directions
23:21:25FromGitter<alehander42> now i need to encode with json my ipc messages
23:22:38rayman22201idk for sure, but I would guess valgrind doesn't work because it can't see inside the GC mechanisms. The GC handles the memory management internally, only occasionally mallocing or mmaping large chunks, and never frees back to the OS.
23:23:15rayman22201valgrind and the like expect C like behavior, where you malloc and free in a C like way.
23:33:44FromGitter<awr1> @shashlick maybe an RFC could be useful? nim compiler internals already make a distinction between "host OS" and "compiled-to OS"
23:34:30FromGitter<awr1> i'm spitballing here but something like `when hostOS == windows:`, `when targetOS == windows` etc.
23:52:36*gokr quit (Ping timeout: 258 seconds)