<< 25-03-2020 >>

00:03:22*ksandvik quit (Quit: Leaving.)
00:18:26*dadada_ quit (Ping timeout: 256 seconds)
00:19:56*sealmove joined #nim
00:21:32blackbeard420is `nim doc --project path/to/file` supposed to generate a dochack.js?
00:23:12sealmoveguys, does anyone know how to make an online game, for example like lichess.com?
00:24:05rayman22201blackbear420, looks like koch will build dochack.js, but nim doc doesn't.
00:24:37*dadada joined #nim
00:25:00*dadada is now known as Guest63628
00:25:06rayman22201nim js tools/dochack/dochak.nim to build it manually
00:25:33rayman22201`nim js tools/dochack/dochack.nim` <- typo fix
00:27:19blackbeard420hmm building with koch or that fails with: /home/blackbeard/src/Nim/lib/system/jssys.nim(53, 6) Error: 'getCurrentException' is not GC-safe as it accesses 'lastJSError' which is a global using GC'ed memory
00:29:11blackbeard420with nim built from current devel branch
00:35:36*krux02_ joined #nim
00:36:30*rnrwashere quit (Remote host closed the connection)
00:36:41FromGitter<timotheecour> @blackbeard420 i can’t repro
00:38:04*krux02 quit (Ping timeout: 246 seconds)
00:39:39blackbeard420interesting, thanks. I was able to build it with nim-1.0.6 package from void-linux. but not with my local built nim
00:40:06rayman22201I'm using a fresh build from devel as of 24hours ago and it works for me
00:41:18blackbeard420oh wow it was because i had --threads:on in my nim.cfg
00:41:23blackbeard420removing that and it worked fine
00:41:26blackbeard420thanks guys
00:42:07rayman22201ah, cool. glad you figured it out. Yeah, nim js does not support threads (obviously). maybe we should warn about that...
00:48:24*Guest63628 quit (Ping timeout: 256 seconds)
00:54:42*dadada_ joined #nim
01:01:38Yardanicoblackbeard420: glad to see another void linux user here :P
01:02:38*dadada_ quit (Ping timeout: 256 seconds)
01:04:30*dadada_ joined #nim
01:05:13*couven92 quit (Quit: Client Disconnecting)
01:10:39FromDiscord<Rika> why is this so? "continue not supported in a fields loop"
01:18:26*dadada_ quit (Ping timeout: 256 seconds)
01:18:33FromDiscord<treeform> Is protect()/dispose() a good way to pass nested ref object trees between threads?
01:19:52*krux02_ quit (Remote host closed the connection)
01:20:26*sealmove quit (Quit: WeeChat 2.7.1)
01:24:34*dadada joined #nim
01:24:58*dadada is now known as Guest22115
01:25:18*dddddd quit (Ping timeout: 256 seconds)
01:27:43FromDiscord<KingDarBoja> Hi all, it's me again, got a quick question, does arrays (or sequences) are immutable?
01:28:41Yardanicoif you declare them with let - yes
01:28:54Yardanico(or const that is, but const is for actual constants)
01:29:19*rnrwashere joined #nim
01:30:11FromDiscord<KingDarBoja> 👍
01:30:23*rnrwashere quit (Remote host closed the connection)
01:31:55FromDiscord<KingDarBoja> By declaring a property at some "class" (type in this case) like this:
01:31:55FromDiscord<KingDarBoja> ```nim
01:31:56FromDiscord<KingDarBoja> type MyChildClass = ref object of ParentClass
01:31:56FromDiscord<KingDarBoja> fields: seq(other_type)
01:31:56FromDiscord<KingDarBoja> ```
01:31:56FromDiscord<KingDarBoja> They will be immutable too?
01:32:14Yardanicoplease read the description for the channel on discord :) don't paste the code to chat, people in IRC gonna suffer :P
01:32:25FromDiscord<KingDarBoja> Sorry !
01:33:18Yardanicoin your case MyChildClass object will not really be immutable because with "let a = MyChildClass()" you'll only say that the reference to the object is immutable, not the object itself, so you'll be able to modify "fields" even if you declare the object with "let"
01:35:18FromDiscord<KingDarBoja> Interesting... So in order to ensure "fields" is immutable, what shall I do?
01:43:22FromDiscord<Rika> make it private
01:43:30FromDiscord<Rika> and create a getter and setter
01:44:27FromDiscord<Rika> (rename fields to some other name, perhaps pFields) then make procs "fields" and "\`fields=`"
01:45:05FromDiscord<Rika> signature: proc fields(self: MyChildClass): seq[OtherType]
01:45:37FromDiscord<Rika> and dont actually make the 2nd proc to make it immutable
01:45:50FromDiscord<Rika> now it's immutable for any module that imports it
01:46:00*rnrwashere joined #nim
01:46:04FromDiscord<Rika> but you cant guarantee immutability within the same file
01:46:47FromDiscord<KingDarBoja> Well it is private if it hasn't "*" as far as I know... but let me see the rest of things
01:47:10FromDiscord<Rika> the rename part is just to ensure the field name doesnt clash with the proc name
01:48:01FromDiscord<KingDarBoja> Gotcha
01:48:23*Guest22115 quit (Ping timeout: 250 seconds)
01:54:40*dadada_ joined #nim
01:58:56*zacharycarter joined #nim
02:02:56FromDiscord<KingDarBoja> Last question, the tutorial part II uses "ref" for types with inheritance but never explained why...
02:03:49*zacharycarter quit (Ping timeout: 264 seconds)
02:04:08FromGitter<zetashift> `Ref objects should be used whenever inheritance is used. It isn't strictly necessary, but with non-ref objects assignments such as let person: Person = Student(id: 123) will truncate subclass fields.` niet really such what truncate subclass fields mean tho
02:04:29FromGitter<zetashift> sure*
02:05:43FromDiscord<KingDarBoja> That is what I am talking about, what does truncate subclass fields mean?
02:06:23FromDiscord<KingDarBoja> Not being able to use name and age from parent type?
02:10:16*rnrwashere quit (Remote host closed the connection)
02:10:44FromGitter<zetashift> No idea currently in my raytracer-thingy I have a `type Tuple = object of RootObj` and my types of `Vector` and `Point` both inherit from it with no problems
02:11:03FromGitter<zetashift> but I do get an inheritance problem if I change `Tuple` to a `ref object`
02:11:36*zacharycarter joined #nim
02:16:18*zacharycarter quit (Ping timeout: 256 seconds)
02:18:49*dadada_ quit (Ping timeout: 264 seconds)
02:19:56*zenoxygen[m] joined #nim
02:23:34FromDiscord<Varriount> Zevv: Congrats, your Z3 module is being used by the compiler. 😛
02:24:44*dadada_ joined #nim
02:29:14*dwdv quit (Ping timeout: 240 seconds)
02:29:59*rnrwashere joined #nim
02:35:23*chemist69 quit (Ping timeout: 246 seconds)
02:37:35*chemist69 joined #nim
02:39:08*rnrwashere quit (Remote host closed the connection)
02:39:46*zenoxygen[m] left #nim ("User left")
02:41:28FromGitter<gogolxdong> Is there any SDK to develop APP on Android, ios, web and desktop?
02:45:17*rnrwashere joined #nim
02:46:39*rnrwashere quit (Remote host closed the connection)
02:47:12Yardaniconimx is not a SDK but it's the closest you can get to what you want :D
02:47:21Yardanico"Nimx officially supports Linux, MacOS, Windows, Android, iOS, Javascript (with Nim JS backend) and Asm.js/WebAssembly (with Nim C backend and Emscripten)."
02:47:44Yardanicoit's a GUI framework, sadly there's no multiplatform SDK for Nim like that
02:48:14*dadada_ quit (Ping timeout: 240 seconds)
02:48:58FromDiscord<KingDarBoja> That moment when you doing the migration from some code in another language into Nim and some variable names uses keywords like end, block...
02:49:14FromDiscord<KingDarBoja> Type properties in this case
02:50:12*rnrwashere joined #nim
02:51:50FromDiscord<Rika> you can use backticks
02:52:19Yardanicoyeah, like `end`, `block`, `proc`
02:54:04FromDiscord<KingDarBoja> Really? backsticks?
02:54:14Yardanicoyes?
02:54:27Yardanicothey're also used for defining operators
02:54:32FromDiscord<KingDarBoja> Ohhhh niceeee
02:54:37FromGitter<awr1> @KingDarBoja https://en.wikipedia.org/wiki/Stropping_(syntax)
02:54:39*dadada joined #nim
02:55:00FromDiscord<KingDarBoja> Yeah, I knew that but had no idea about the naming use case
02:55:03*dadada is now known as Guest32471
02:55:23FromDiscord<KingDarBoja> Thanks once again guys, I feel enlighten 😄
02:57:37FromGitter<awr1> huh, from wikipedia: "Line reconstruction converts the input character sequence to a canonical form ready for the parser. Languages which strop their keywords or allow arbitrary spaces within identifiers require this phase. The top-down, recursive-descent, table-driven parsers used in the 1960s typically read the source one character at a time and did not require a separate tokenizing phase."
02:59:01FromGitter<awr1> you learn something new every day
02:59:15FromGitter<awr1> although it almost seems kinda like there is a return to "recursive descent parsers without lexxing"
02:59:18FromGitter<awr1> b/c of PEGs
03:18:14*Guest32471 quit (Ping timeout: 240 seconds)
03:23:02*waleee-cl quit (Quit: Connection closed for inactivity)
03:24:39*dadada_ joined #nim
03:41:14*rockcavera quit (Remote host closed the connection)
03:41:44*rockcavera joined #nim
03:48:11*dadada_ quit (Ping timeout: 246 seconds)
03:48:43*endragor joined #nim
03:54:35*muffindrake quit (Ping timeout: 272 seconds)
03:54:41*dadada joined #nim
03:55:04*dadada is now known as Guest82268
03:56:31*muffindrake joined #nim
04:08:57*nsf joined #nim
04:18:42*Guest82268 quit (Ping timeout: 256 seconds)
04:24:46*dadada_ joined #nim
04:26:05*rnrwashere quit ()
04:26:39*rockcavera quit (Remote host closed the connection)
04:36:04*chemist69 quit (Ping timeout: 246 seconds)
04:37:21*chemist69 joined #nim
04:48:13*dadada_ quit (Ping timeout: 250 seconds)
04:54:33FromDiscord<Rika> https://play.nim-lang.org/#ix=2fcD got no clue what i'm doing wrong wrt. making a "setter proc" that works for both types here
04:54:40*dadada joined #nim
04:55:04*dadada is now known as Guest37118
04:55:17FromDiscord<Rika> huh, what're the different implications of a `ref object of Type` and an `object of Type`
05:04:20Yardanicowhy "var Object"? it's already a ref
05:04:39Yardanicowith "var Item" your method basically accepts a pointer to a pointer to an object :P
05:04:57Yardanicowell, maybe the compiler is smart enough to not do that with "ref object", idk
05:05:53FromDiscord<Rika> hm i made a mistake yeah
05:06:05FromDiscord<Rika> there used to be just an Item = object
05:06:21FromDiscord<Rika> for some reason i automated into putting a ref before object
05:07:53*pbb quit (Remote host closed the connection)
05:17:20*rnrwashere joined #nim
05:18:46*Guest37118 quit (Ping timeout: 256 seconds)
05:19:47*rnrwashere quit (Remote host closed the connection)
05:24:46*dadada_ joined #nim
05:25:07*rnrwashere joined #nim
05:34:54FromGitter<awr1> yes i think methods only work with refs only, not vars
05:36:12FromGitter<awr1> also is there a reason you need the getters
05:40:33FromDiscord<Rika> i dont want them to be settable
05:40:53FromDiscord<Rika> at least the two that dont have setters
05:48:13*dadada_ quit (Ping timeout: 264 seconds)
05:50:10*narimiran joined #nim
05:50:17*silvernode joined #nim
05:54:31*dadada joined #nim
05:54:54*dadada is now known as Guest96580
05:57:28*pbb joined #nim
06:18:16*Guest96580 quit (Ping timeout: 256 seconds)
06:19:37Yardanicowtf
06:19:40Yardanicooh sorry wrong chat
06:20:52silvernodehttps://github.com/QB64Team/qb64
06:21:39silvernodeHere is a recreation of the QBASIC IDE from back in the day. A buddy of mine got a pull request merged that adds Void Linux support for the installer script.
06:22:24silvernodeIt is really well done and takes me back to the first time I ever wrote a line of code
06:24:39*dadada_ joined #nim
06:42:29*andinus joined #nim
06:48:17*dadada_ quit (Ping timeout: 265 seconds)
06:48:48*silvernode quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
06:50:10*solitudesf joined #nim
06:54:44*dadada joined #nim
06:55:07*dadada is now known as Guest95538
07:00:00*gmpreussner quit (Quit: kthxbye)
07:04:52*gmpreussner joined #nim
07:06:44*sleepyqt joined #nim
07:10:34*ehmry quit (Ping timeout: 240 seconds)
07:11:34*gmpreussner quit (Ping timeout: 240 seconds)
07:16:04*vesper11 quit (Ping timeout: 258 seconds)
07:16:14*vesper joined #nim
07:17:11*rnrwashere quit (Remote host closed the connection)
07:17:53*ehmry joined #nim
07:18:02*rnrwashere joined #nim
07:18:44*Guest95538 quit (Ping timeout: 265 seconds)
07:20:16*rnrwashere quit (Remote host closed the connection)
07:23:41*skrylar[m] pushed robin hood hashes up yesterday
07:24:43*dadada_ joined #nim
07:25:45skrylar[m]i kinda remember basic from back in the day, before i hopped off to delphi anyway
08:08:24*PMunch joined #nim
08:37:25FromGitter<Vindaar> @kaushalmodi Indeed, unless I'm sleeping :) ⏎ @IanIAnIAN not sure if you're still around right now, but as indeed, just ping me
08:53:17*Vladar joined #nim
08:54:45FromDiscord<Varriount> Araq: Did the Z3 code get all pushed? It doesn't look like all the logic is in the PR branch
08:54:55FromDiscord<Varriount> I wanted to try it out
09:02:32Araqit's all in my branch
09:02:40AraqI'm adding tests
09:22:47*krux02 joined #nim
09:23:27*dwdv joined #nim
09:33:26*defection joined #nim
09:40:52*defection quit (Quit: defection)
09:41:09*defection joined #nim
09:50:47Zevvoh nim is going z3 now, woet \o/
09:50:51Zevvgo araq go!
09:52:04FromDiscord<Rika> whats this z3 thing?
09:55:36PMunchZ3 is a theorem prover IIRC
09:55:53PMunchAnd if that is indeed the Z3 they're talking about, might be something else as well :P
09:56:12Yardanicoyes, it is indeed the theorem prover one :P
09:57:12Araqyeah and it's awesome
09:57:21AraqI figured out how to make it produce counterexamples
10:03:33FromDiscord<Rika> so i read the wikipedia article on SATs aaaaaaaand i understood nil
10:06:56FromDiscord<Rika> SAT? i mean SMT
10:14:44*defection quit (Quit: defection)
10:15:32FromDiscord<Recruit_main707> is arc stable enough so that the garbage collected thing can be deleted or marked as optional in the oficial web?
10:15:48FromDiscord<clyybber> yes, but we wont delete the gc
10:16:02Araqyeah, website update upcoming with the 1.2 release
10:16:03FromDiscord<clyybber> not for now at least
10:16:16FromDiscord<Rika> when is 1.2 releasing again
10:16:19FromDiscord<clyybber> Araq: Do we really wan't to delete the mention of GC?
10:16:31Araqwe'll find some marketing term
10:16:37FromDiscord<clyybber> Heh 😄
10:16:40FromDiscord<Rika> deterministic 😛
10:16:44Araq"pick your memory management strategy"
10:16:45FromDiscord<Recruit_main707> i know there is people that didnt like nim because of garbage collector
10:17:04FromDiscord<Rika> and i know people who dont like rust because of a lack of one
10:17:13FromDiscord<Recruit_main707> although its very fast, but they just read that and think its slow
10:17:33FromDiscord<Rika> man dont you just hate faulty assumptions
10:17:49FromDiscord<Recruit_main707> specially about nim
10:18:23*clyybber joined #nim
10:19:25FromDiscord<Recruit_main707> anyway, so was that a yes Araq? i could maybe try and convince them again if that changes
10:20:08Araqyes
10:20:19FromDiscord<Recruit_main707> noice
10:21:40clyybberAraq: Is the cycle collector still in there, or did you replace it with the cycle breaker?
10:22:04Araqboth exist, both not production ready
10:22:24clyybberDoes the collector have any crashing bugs or just performance issues?
10:22:27FromDiscord<Varriount> What's the difference between them?
10:22:41clyybberVarriount: One breaks up cycles, the other one collects them automatically
10:23:14clyybberOne behaves like a GC the other one like a pseudomanual free
10:23:16Araqclyybber, it crashes because of a bug in liftdestructors afaict
10:23:31Araqand it's slow
10:23:35clyybberAraq: I see
10:23:52Araqcan make it fast via generations but I don't want to :P
10:26:40dadada_damn, I'm annoyed with all these new langs, some look really cool, mostly because it's impossible for me to learn them all, for example odin's defer statement looks really nice and flexible, but I want that feature in Nim
10:26:59Yardaniconim has defer
10:27:04Yardanico:P
10:27:09dadada_I know that
10:27:21Araqor write a macro that does the same
10:27:25Yardanicoah I checked it just now, yeah, it's different
10:27:42FromDiscord<Recruit_main707> thats why they exist
10:28:24Yardanicothe only thing that I'd like to see in Nim (but it's really related to LLVM) is Zig's FFI and easy cross-compilation
10:29:23dadada_Yardanico: that's shockingly easy (cross compilation) if I understood what zig is doing right
10:29:38dadada_zig IS a c compiler with easy cross compilation, and Nim compiles to c
10:30:06Yardanicolets use nim with zig lol
10:30:18dadada_that's what I'm saying :D
10:30:48Araqit's rumored to work. I don't really see the point
10:31:07Araqproducing the binary for platform X is the *start*
10:31:12Araqthen you also need to test it...
10:31:42Araqcross-compiles are nice for embedded but LLVM doesn't support as many CPU architectures as GCC does
10:31:47Yardanicooh lol didn't see https://forum.nim-lang.org/t/6115
10:32:08dadada_yes, it's not a panacae, but it would be convenient, and I'm not saying let's making it the default, but why not as an option
10:32:37dadada_s/making/make
10:32:40Araqit's great that you can build for foo.exe for your Windows users on your Linux machine and then pray it actually works on Windows
10:32:48Yardanicowe have wine xd
10:32:49Araqbut it's not all that professional :P
10:33:52Araqand the fight for the **easiest** C interop is also pointless, C has the best interop with C.
10:34:20Araqand then maybe C++ follows
10:34:45dadada_Araq: coincidentally I'm currently in the process of writing a defer macro, but it's a different concept from what odin does, and I'm currently stuck with something
10:35:06Araq(not to mention that many many libraries are in C++ these days)
10:37:40clyybberdadada_: Whats the difference between odin and nims defer?
10:38:03Yardanicoclyybber: https://odin-lang.org/docs/overview/#defer-statement
10:38:09clyybberlooked at it
10:38:56dadada_clyybber: bear with me because as you know I'm relatively new to Nim, but it looks to me that Nim always defers stuff to the end of a proc/func, while Odin allows you a more fine-grained scope-based defer that can even contain defers inside a defers
10:40:04Yardanicobtw, what is the correct way to replace deepCopy on --gc:arc ?
10:40:10Yardanicoparsetoml uses it here https://github.com/NimParsers/parsetoml/blob/329cc618fe27a6c89708d1fa17ddc72f8da97e08/src/parsetoml.nim#L1898
10:40:16clyybberdadada_: Nims defer is scope based too
10:40:31clyybberAnd its also "reversed"
10:42:06FromGitter<Vindaar> @Yardanico: I wondered the same thing before
10:42:37dadada_clyybber: then I got the wrong impression, maybe Nim's manual could be updated to more clearly highlight this feature!
10:43:43FromDiscord<Rika> defer isnt that useful from my experience
10:44:15clyybberIt can be really useful at times
10:44:23Yardanicoit's useful when you want to have things like var client = newHttpClient(); defer: client.close() together
10:44:34Yardanicoso that it's easier to understand the code and the structure is better
10:44:54AraqYardanico, it should use result[] = p[] or some variation of it
10:45:06AraqI personally cannot stand 'defer' at all
10:45:18Araqno matter how smart you make its scoping
10:54:23euantordadada_: Nim's defer expands to a `try: ... finally: ...` construct I believe
10:58:15YardanicoI suppose it's not ok when code with --gc:arc results in a compiler error "Error: system module needs: newSeq"
11:07:06AraqYardanico, not sure, maybe you simply have an installation problem
11:07:34Yardanicowell, it works ok for everything else, maybe it's a bug :P i just tried to compile some 3-year old nim project with --gc:arc and this error appeared
11:08:54*tane joined #nim
11:15:33Araqok so report it
11:23:04*abm joined #nim
11:29:58*sleepyqt quit (Read error: Connection reset by peer)
11:30:27*sleepyqt joined #nim
11:32:13*filcuc joined #nim
11:40:44*defection joined #nim
11:41:15jkenclyybber: in your nim/assimp experience, did you ever get material.getTextureCount working?
11:45:10clyybberNope, never tried
11:46:00jkendeeper down the rabbit hole I go
12:02:44*dadada_ quit (Ping timeout: 256 seconds)
12:04:48*liblq-dev joined #nim
12:06:25*filcuc quit (Remote host closed the connection)
12:07:50*filcuc joined #nim
12:09:38*dadada joined #nim
12:10:03*dadada is now known as Guest42595
12:29:58*couven92 joined #nim
12:35:28*rockcavera joined #nim
12:44:56*dddddd joined #nim
12:46:03*nsf quit (Quit: WeeChat 2.7)
12:58:11*endragor quit (Remote host closed the connection)
12:59:25*filcuc quit (Quit: Konversation terminated!)
12:59:52Araqoh I know! I'll only enable the CI for Windows
13:00:23Araqas building the static lib takes 10 minutes
13:04:33clyybberlol
13:10:49*kungtotte quit (Read error: Connection reset by peer)
13:11:35*kungtotte joined #nim
13:12:09*muffindrake quit (Quit: muffindrake)
13:12:44*zacharycarter joined #nim
13:17:33*lritter joined #nim
13:17:35*defection quit (Quit: defection)
13:19:56*tane quit (Quit: Leaving)
13:25:13*waleee-cl joined #nim
13:33:44*Guest42595 is now known as dadada
13:34:28dadadaPMunch: I'm so excited to use your macroutils module, that's in nimble.directory now, thanks so much for this work
13:34:52PMunchNo problem, it's stuff that I've wanted myself for a long while now
13:35:06PMunch(although I haven't yet used it for anything, so any feedback is highly welcome!)
13:35:27dadadaI'm definitely going to use it today
13:35:47PMunchSweet, please tell me how it goes :)
13:35:52dadadaand will be happy to give feedback, hope you continue this, and that it doesn't become stale
13:36:04PMunchThat's the plan
13:36:44PMunchI mean I think I've written more macro code than non-macro code at this point, so if it works as well as I hope I'll probably be including it in all my projects :P
13:37:25dadadaI also tend to write a lot of macros :D
13:38:33dadadanot related strictly to your module, but I think docs on nimble.dir should have syntax highlighting for code samples https://nimble.directory/pkg/macroutils
13:38:48clyybberdadada: Who are you on github?
13:40:05dadadaclyybber: haven't done any nim stuff that you can see on github, and didn't use my github account in a long time, but may revive it some time soon
13:41:00clyybberI see
13:41:19dadadahave to hone my Nim skills before I put anything out there
13:42:02shashlickPMunch why not add to stdlib
13:42:08*kungtotte quit (Ping timeout: 246 seconds)
13:42:31Yardanicooh right, is --gc:arc supposed to work with marshal? I looked at that project which errors with "system module needs: newSeq"
13:42:39PMunchshashlick, I'm open to add it
13:42:52PMunchBut I wanted to see if people would use it/if it was useful first
13:42:58AraqYardanico: no. marshall needs to be rewritten to use macros
13:43:13Yardanicowell, then that's probably due to marshal, but error msg is very cryptic :P
13:44:27Yardanicoso I guess I don't need to report it?
13:44:31PMunchdadada, I agree that nimble.directory should support Nim syntax highlighting in the README. Looking at the source of the site the sections are even tagged by a CSS class, so it shouldn't be too hard to add a syntax highlighter. federico3, pretty please?
13:45:59*m_v_m joined #nim
13:52:25dadadaPMunch: critique number 1) add more asserts into your examples, for example your final example (to pick just one example example) contains one assert packages == ..., but to more clearly highlight the extraction capabilities it should have asserts for everything that was extracted there
13:53:09PMunchYeah.. At that point I was pretty fed up with writing documentation :P
13:53:13PMunchSorry about that
13:53:48federico3PMunch: a little PR? :)
13:53:58PMunchFor the syntax highlighting? Hmm
13:54:10Zevvaraq: anything Z3 related you can share already? I wonder what your experiments look like
13:54:11federico3keep in mind that the readme is rendered by GH
13:55:00AraqZevv: https://github.com/nim-lang/Nim/pull/13743/files#diff-7f32e88416af5ba545963b024d7e5bd5
13:55:01disbotDrNim (Nim compiler with Z3 integration)
13:55:14Araqthe Unix build is close to working
13:55:21PMunchfederico3, yeah and GH has syntax highlighting
13:55:24Araqand then everybody can enjoy DrNim
13:55:34PMunchBut it's probably a JS script that runs on a certain CSS tag
13:57:53clyybberAraq: Ok to merge https://github.com/nim-lang/Nim/pull/13741 ?
13:57:53disbotFix vm.nim for --gc:arc
13:57:58*kungtotte joined #nim
13:58:31Araqclyybber: how is that correct?
13:58:39Araqyour cast loses the seq's len information
13:58:47*couven92 quit (Read error: Connection reset by peer)
13:58:58clyybberBut its not needed here
13:59:04clyybberLook at the original cast
13:59:06clyybberOh
13:59:11clyybberArgh
13:59:15*couven92 joined #nim
13:59:19clyybberGood catch haha
14:03:01AraqI think the solution is a compiler refactoring so that 'pointer' isn't used for this
14:03:19*sunwukong joined #nim
14:03:57clyybberYeah
14:11:55disrupteki know `requires` may be more correct, but it's also long.
14:12:08disruptekneeds?
14:12:55disruptekmust:
14:13:25Araq'requires' and 'ensures' are the standard and what DrNim will use
14:14:20disruptekoh it's a standard?
14:15:01AraqSpec# uses them so yeah :P
14:15:28disruptekso we need these as noops for stdlib so that the dr can use them elsewhere?
14:16:04disrupteki guess you'd just want to import them.
14:16:59Araqyeah that's the plan, nop for the compiler
14:17:06Araqbut DrNim understand them
14:18:19disrupteknext we need to add them in a transform.
14:20:32clyybberAraq: Can vm callbacks be supplied in usercode?
14:20:48clyybberOr only when the compiler is compiled?
14:24:52FromGitter<cschardt> Aufsteh'n, aufeinander zugeh'n.pri (https://files.gitter.im/nim-lang/Nim/itr9/Aufsteh-n-aufeinander-zugeh-n.pri)
14:25:44Yardanicowrong window?
14:28:47clyybberlol
14:28:54clyybberwrong advice in these times
14:29:00clyybberespecially in bavaria
14:29:02clyybberhaha
14:29:24liblq-devI'm trying to wrap wlroots using c2nim, but it's using these weird array definitions like `const float color[static 4]`. how can I make c2nim reflect those as `array[4, cfloat]`?
14:29:34Yardanicodid you try nimterop? :P
14:29:46liblq-devI don't want nimterop, it's slow.
14:30:22FromDiscord<Recruit_main707> how can i make a type's field constant?
14:30:33liblq-dev@Recruit_main707 that's not possible
14:30:37Yardanicoyou mean assign once or what?
14:31:36FromDiscord<Recruit_main707> something like this
14:31:37FromDiscord<Recruit_main707> https://play.nim-lang.org/#ix=2feq
14:31:58Yardanicowell, why not just use a proper constant then?
14:32:10FromDiscord<Rika> you really cannot
14:32:18FromDiscord<Rika> theres no good reason to
14:32:44FromDiscord<Recruit_main707> there are values that might be assigned at runtime and dont change
14:32:54Yardanicoconst in Nim is compile-time
14:32:56Yardanicostrictly
14:33:02Yardanicocreate setters and getters then
14:33:24*FromDiscord <Recruit_main707> getters and setters
14:33:46Yardanicohttps://nim-lang.org/docs/tut2.html#object-oriented-programming-properties
14:34:58FromDiscord<Recruit_main707> ok thanks
14:35:26*m_v_m quit (Remote host closed the connection)
14:41:16*owl_000 joined #nim
14:43:13owl_000out of topic: www.w3school.com server has nim installed, unfortunately version 0.19.4
14:44:19YardanicoYou mean https://www.w3schools.com/ ?
14:44:23owl_000yes
14:44:32YardanicoThere's quite a lot of websites with online nim compiler
14:44:45owl_000not online in their system
14:44:54Yardanicohow do you know? :P
14:45:48owl_000in python learning section you can try python code, `import os os.system("nim")` return nim compiler info.
14:45:52Yardanicolol
14:46:02owl_000maybe it is a security issue of w3school
14:46:14owl_000you can run many linux commands
14:46:18Yardanicowell, they probably run everything in containers or commands
14:46:20Yardanicothat's not an issues
14:46:33Yardanicoyou can do the same on most online compilers/interpreters
14:46:33owl_000oh
14:46:40*andinus quit (Quit: ERC (IRC client for Emacs 26.3))
14:46:40Yardanicoplay.nim-lang.org https://godbolt.org https://repl.it/languages/nim https://tio.run/#nim for Nim compiler online
14:46:47Yardanicothere are more, but these ones are the best ones :P
14:46:57owl_000ha ha
14:47:12Yardanicoah nvm, repl.it still has nim 0.17.2 too, damn
14:47:58owl_000that is irony,
14:48:46Yardanicoactually there was a discussion about the version in https://repl.it/talk/announcements/Two-new-languages-Nim-and-Crystal/11886 comments, and a year ago they said "will upgrade"
14:49:34FromGitter<alehander92> someone should ping them
14:49:34owl_000will upgrade coming soon™
14:49:55FromGitter<alehander92> if something is requested often they might do it, but probably have a big backlog
14:50:44YardanicoI remember how we managed to add nim to repl.it :P put the link everythere lol
14:50:57Yardanicohttps://replit.canny.io/languages-requests/p/add-support-for-nim-lang-to-replit
14:51:42Yardanicoif you check nicknames of people who voted you'll find a lot of familiar names
14:52:45owl_000question: any news about nim official GUI?
14:52:56Yardanicowhat do you mean by "official"?
14:53:17YardanicoThere isn't anything like that, but there's quite a lot of GUI libs too choose from (most of them are not really complete, and are bindings)
14:53:47Yardanicogintro is IMO the best one out there (it's a low-level and high-level GTK/Glib binding)
14:54:42*tane joined #nim
14:55:17*andinus joined #nim
14:55:44YardanicoNim extension for VSCode got 0.6.5 update - https://github.com/pragmagic/vscode-nim/commit/84e5e548818fca1599f7e0f28e30a740dea10961
14:56:22*NimBot joined #nim
14:58:24owl_000updating now
14:58:37Araqwhy not use the Nim playground instead of repl.it?
14:58:51Yardanicothat's why I put nim playground as the first one :)
14:58:56Yardanicoof course it's the preferred choice
14:59:00FromGitter<alehander92> well its good to have it supported there
14:59:13FromGitter<alehander92> many people use repl.it for many langs probably
14:59:35FromGitter<alehander92> its like "why not use nimspecificedit instead of vim"
14:59:57FromGitter<alehander92> the playground is pretty good tho indeed
15:00:08owl_000having nim option in repl is good for publicity too
15:00:18Yardanicobut not when it has 0.17.2
15:00:31dadadaPMunch: what am I doing wrong in this simple constructed example https://play.nim-lang.org/#ix=2fex ?
15:00:33Yardanicosome newbies might try to do something in Nim on repl, following the docs - but their code might not work
15:00:42Yardanicobecause that nim version is quite old
15:00:42clyybberAraq: Lol, that DrNim comment
15:01:33YardanicoI like how nim playground has all versions starting from 0.13.0 btw :P
15:01:39dadadabtw. it's an awesome feature not everyone might know about that play.nim-lang.org supports importing nimble directory modules ...
15:01:41clyybberAraq: Tbf you can make it an option, link dynamically and provide your strdefine to wherever the fuck the .so is, or link statically
15:01:55Yardanicodadada: how? :P
15:02:17Yardanicoah nvm, only these https://github.com/PMunch/nim-playground/blob/master/docker/packages.nimble
15:02:27Yardanicoquite a good collection though
15:02:29PMunchdadada, just forgot to import macros :)
15:02:43PMunchhttps://play.nim-lang.org/#ix=2fey
15:02:58Araqclyybber: yeah I know, but it remains stupid shit
15:03:05dadadaPMunch: shouldn't macroutils imply import macros, you an export macros in macroutils!?
15:03:08dadadacan
15:03:22Yardanicodadada: I feel like that will look kinda weird
15:03:29PMunchYardanico, yeah it's based on the important packages list
15:03:45clyybberAraq: You mean dynamically linking?
15:03:47PMunchBut everyone is free to add a PR to have other packages added :)
15:03:51dadadaYardanico: why?
15:04:05PMunchdadada, you might not want parts of macros I guess
15:04:10PMunchBut yeah, it possibly should
15:04:24dadadait definitely should, if it's core feature doesn't work without it
15:04:32dadadabut that's just my opinion MAAN
15:04:33dadada:D
15:04:56Yardanicowell, nim stdlib also has some modules like this
15:05:12Yardanicolike xmltree - if you don't import "strtabs" you won't be able to use "attrs" table for a xml node
15:06:11owl_000question: how do you debug nim in vscode. btw i use echo to check
15:06:23Yardanicoecho is the best debugger out there :)
15:06:31Yardanicoowl_000: but really you can use GDB with nim
15:06:48Yardaniconim ships with nim-gdb script which kinda should make mangled names easier to read, didn't really try it yet though
15:07:22dadadaYardanico: this is an odd behaviour, hopefully we'll find a better solution, for example if someone uses attrs, it could automatically trigger export strtabs, but I don't know how hard it would be to implement that
15:07:27owl_000vscode gdb says there is no a.out file
15:07:42Yardanicowell, you have to edit default vscode gdb config
15:08:04owl_000oh then, echo is better
15:08:22Yardanicoowl_000: just change "program" to the name of the binary
15:09:07clyybberAraq: Well that was easy: #13741 :D
15:09:08disbothttps://github.com/nim-lang/Nim/pull/13741 -- 3Fix vm.nim for --gc:arc
15:09:12clyybberNo big refactoring required
15:10:45Yardanicohmm, GDB in vscode works, now need to figure out how to use nim-gdb.py with it
15:11:11shashlickliblq-dev - why is nimterop slow? isn't stuff cached?
15:11:26liblq-devidk `nim check` is show for me on nimterop
15:11:32liblq-devs/show/slow
15:11:32clyybberYardanico: Just run nim-gdb
15:11:41liblq-devsame with compilation
15:11:46liblq-devsame with nim.nvim
15:11:49Yardanicoclyybber: well, VSCode starts gdb itself
15:11:55clyybberOh
15:11:58shashlickthen generate a wrapper and write it to file and import that
15:12:05shashlickyou don't have to use it at compile time
15:12:14liblq-devhow'd I achieve that?
15:12:24liblq-devthat's what I wanted to do with c2nim btw
15:12:28clyybberYardanico: Look at the shell script, the important part should be overriding GDB_PYTHON_MODULE_PATH
15:12:28shashlicknim c wrapper.nim > out.nim
15:12:32liblq-devbut it doesn't support some syntax
15:12:44liblq-devoh, and just use cDebug in that file?
15:12:53shashlickyes
15:12:58liblq-devright
15:13:02liblq-devwill try later, thanks
15:13:22Yardanicoclyybber: I think I can specify gdb binary to be "nim-gdb" in VSCode
15:13:25Yardanicoi'll try at least
15:13:28clyybberAh nice
15:13:37shashlickcaching for nimsuggest and nim check is in place though
15:14:15Yardanicohow do I check if nim-gdb works? :P
15:14:50liblq-devshashlick: I'll try to update nimterop later and report back on whether anything is better.
15:14:53clyybberYardanico: It should say "Loading Nim Runtime support."
15:14:58clyybberAs the last line
15:15:32shashlickokay, big release is coming though with ast2 which will be able to support all of C eventually
15:15:39Yardanicohmm, it doesn't say that, strange
15:15:41Yardanicobut it shows "set Nim pretty printers for /home/dian/projects/nimstuff/osu_lazer_saver"
15:16:51dadadashashlick: where can I learn about ast2?
15:17:23dadadabig release of nim or do you talk about something else?
15:17:28Yardanicoah, seems like it indeed uses nim-gdb
15:17:29dadadasorry, I may have lost the context
15:17:38Yardanicobut variables are still like T4_ and T5_ in "locals"
15:18:09clyybberHmm
15:18:15shashlickdadada: of nimterop - it parses C and generates Nim wrappers
15:18:17clyybberkrux02 is the guy to ask
15:18:40dadadashashlick: +1 for nimterop, I look forward to it supporting C++
15:18:53disruptekthe mangling for locals will probably change, too.
15:18:56FromGitter<gogolxdong> How to print newline characters in a string variable?
15:19:01Yardanico\n
15:19:11Yardanicoecho "line\nanotherline\nanotherline"
15:20:03FromGitter<gogolxdong> There is a string variable , I want to see the newline character is \c\L or \n.
15:20:26Yardanicouse repr I guess?
15:20:50FromGitter<gogolxdong> It works for python not for Nim.
15:21:04Yardanico!eval echo repr "hello\nstring\n"
15:21:07NimBot0x55d8eecd96f0"hello\10"↵"string\10"↵""
15:21:12Yardanicowell almost :P
15:21:21*andinus quit (Remote host closed the connection)
15:22:19dadadaPMunch: what am I doing wrong now? https://play.nim-lang.org/#ix=2feH
15:22:55clyybberYardanico: No no no no DD
15:23:07clyybberpoor repr
15:23:09*nsf joined #nim
15:23:29krux02clyybber: what about me?
15:23:41PMunchUsing varargs[untyped]: https://play.nim-lang.org/#ix=2feJ
15:23:44clyybberkrux02: You created gdb-nim
15:23:51krux02yes
15:23:54clyybberAnd Yardanico is having a problem with it I think
15:23:57krux02nim-gdb
15:24:01Yardanicokrux02: well I just wanted to try nim-gdb in VSCode
15:24:09krux02ok
15:24:18Yardanicoit seems to actually launch nim-gdb now, but in "Variables" window in VSCode it still shows variable names like "_T4" and stuff
15:24:27YardanicoI compiled the binary with --debugger:native without any other flags, is that right?
15:24:33YardanicoI mean the binary for the program I want to debug
15:24:35krux02well, first of all nim-gdb is just the start script to start gdb.
15:24:36shashlickdadada: C++ seems achievable now, the old design wasn't as flexible, though it worked well for the POC that it was
15:24:40PMunchWell, you could also do `args[0].extract` dadada
15:25:35krux02it loads the python pretty printers, and then it is just pure gdb. No fluff attached other than python pretty printers.
15:25:46dadadaok, thanks PMunch, is there a way that I could extract all idents and types in order? like you can import `packages*` but instead of horizontal, going into the vertical direction?
15:26:00krux02the problem is, I can't really do anything about nims name disambiguation
15:26:20Yardanicokrux02: https://i.imgur.com/DbrGC5U.png
15:26:48dadadaPMunch: I already have a suggestion for an operation: | cause that's showing in the vertical direction
15:26:52dadadaoperator
15:27:06krux02ok
15:27:08FromGitter<sheerluck> with 1499 issues Nim-1.2 can not be released. 1500 seems a suitably round number. Nim-1.2 will be releases with code name "1500 issues"
15:27:31*gpickett00 joined #nim
15:27:39Yardanicothe more popularity a project has the more issues there are :)
15:27:44*gpickett00 left #nim (#nim)
15:27:52dadadathankfully a good number of those issues isn't terrible stuff
15:27:56Yardanicorust has 5.2k open issues you know :P
15:28:05krux02Yardanico, the biggest problem with debugging nim in gdb is, line information is pretty bad. After all nim generates a lot of line directives, but a single line in Nim is most of the time compiled into multiple C files. This means that you get wrong line information until you hit the next line directive.
15:28:58PMunchHmm, dadada, the idea was that having a single child in there with * should work. Like this: https://play.nim-lang.org/#ix=2feQ
15:29:01PMunchBut that seems broken
15:29:04Yardanicowell yeah, I just tried it out of curiosity, I mostly use echo :P
15:29:04PMunchI have to look into that
15:29:21PMunch(and then you could run a for loop with extract on that if you wanted)
15:29:26krux02Yardanico, I don't have a lot of gdb experience within VSCode
15:30:11krux02I only use it from emacs, as this is the only debugger that is basically just window for gdb.
15:30:54krux02Yardanico, can you write gdb commands in a gdb terminal from VSCode?
15:30:58Yardanicokrux02: yes
15:31:01krux02ok
15:31:07dadadashashlick: nice, may I suggest the Qt lib as a goal to work towards for the C++ support, it's not only requested by me, Qt has so many high quality modules, not just the widgets everybody knows, look at this https://wiki.qt.io/Language_Bindings even obscure languages already have bindings for Qt, even Julia and whatever Ring is, I mean we can't let this continue ... :D
15:31:08krux02then you should be able to type: info locals
15:31:13krux02print x
15:31:22krux02bt (for backtrace)
15:31:27krux02n (for next)
15:31:32krux02s (step into function)
15:31:42Yardanicoinfo locals
15:31:42Yardanico-var-create: unable to create variable object
15:31:45Yardanicohmm
15:31:59krux02what?
15:32:02Yardanicoit says that for every command
15:32:09krux02then something is wrong
15:32:11Yardanicoidk what that means
15:32:16krux02me neither
15:32:35krux02can you show me another picture?
15:32:56krux02You are lucky, I have time right now, you are interested in a screen sharing session with audio?
15:33:14krux02I am interested to see how well gdb works in VSCode as well.
15:33:27Yardanicowell I can do that, but my english speaking skills aren't the best :P
15:33:38krux02what language do you speak?
15:34:10Yardanicoi'm russian, but I can understand english pretty well, it's just that I don't have a lot of speaking experience
15:36:07owl_000speaking is different skill. without being around native speaker it is hard to improve.
15:36:48krux02Yardanico, I sent you private message
15:36:59shashlickdadada: C++ is a long road but even if I got there, Qt has all that moc nonsense, i've heard others say it is not so straightforward
15:39:03dadadashashlick: I know, I think they are making it sound worse than it is, you can look at the methods those other bindings are using, when there are bindings for vastly different langs such as Java and JavaScript, then it must be possible for Nim, I looked at the JavaScript bindings and they didn't seem terribly complicated, there's some special code, but it's far less than you would assume
15:39:17shashlickanyway, my goal is to provide complete C/C++ => Nim and i've been at this for 1.5 years already and still don't have full C
15:40:07axionis there a proc for the sqrt of a float? i'm getting an "expected int" error. I feel like I'm missing something because every language I've used defines sqrt for fp :)
15:40:57dadadashashlick: I'm checking out what happens in github.com/nimterop/nimterop every day, so you must have something right in those 1.5 years, I believe in you!
15:41:00dadada:-)
15:41:05narimiranaxion: yes
15:41:07dadadamust have done
15:41:24dadadawell every other day
15:41:27narimiranaxion: here's how to find stuff in the future: go to https://nim-lang.github.io/Nim/lib.html and use 'search' on the left
15:41:32shashlicknow that i am using the compiler ast, understanding the backend will benefit and be easy for compiler devs as well so i'm hoping for contributions with wrapping
15:41:40FromGitter<kaushalmodi> axion: https://nim-lang.github.io/Nim/math#sqrt%2Cfloat32
15:41:45narimiranaxion: or, TL;DR: `import math`
15:41:53axionyes i am using math
15:42:43axionhmm maybe there's a custom overload in the way in one of the libraries
15:42:53axioni'll inspect further, thanks
15:43:14narimiranaxion: try `math.sqrt(1234.56)`
15:43:15*Tungki joined #nim
15:43:46FromGitter<kaushalmodi> axion: https://play.nim-lang.org/#ix=2feR
15:44:01FromGitter<kaushalmodi> you can always use the Nim playground to reproduce the issue and share that link
15:44:06dadadaPMunch: this is what I think it should work like: https://play.nim-lang.org/#ix=2feT
15:44:07axion`0.5 / math.sqrt(trace)` gives me error| type mismatch: got <float> but expected 'int'
15:44:32narimiran@kaushalmodi, why not `let num = 2.0`?
15:44:54FromGitter<kaushalmodi> narimiran: I just wanted to show that ints work too if the var type is float
15:44:57FromGitter<kaushalmodi> :)
15:45:11clyybber!eval echo 0.5 / math.sqrt(5)
15:45:13NimBotCompile failed: /usercode/in.nim(1, 12) Error: undeclared identifier: 'math'
15:45:18dadadaPMunch: this syntax is clearly indicating what's expected to happen, which isn't the same (IMO) as what `packages*` does, although it's very similar of course, vertical vs horizontal
15:45:30clyybber!eval import math; echo 0.5 / math.sqrt(5)
15:45:32NimBotCompile failed: /usercode/in.nim(1, 34) Error: ambiguous call; both math.sqrt(x: float32) [declared in /playground/nim/lib/pure/math.nim(261, 8)] and math.sqrt(x: float64) [declared in /playground/nim/lib/pure/math.nim(262, 8)] match for: (int literal(5))
15:45:41narimiran!eval import math; echo 10.0 / sqrt(25.0)
15:45:44NimBot2.0
15:45:45clyybber!eval import math; echo 0.5 / math.sqrt(5'f)
15:45:48NimBot0.223606794466938
15:46:09clyybberaxion: I think your error is about the whole expression
15:46:10axionhmm the error is in the `/` actually. must be an overload somewhere
15:47:07dadadaPMunch: btw, I'm not just testing this on play.nim-lang, I needed the same in some of my code just now
15:49:06axionI'm not sure what's going on. I have a `/` proc, but it accepts float32. Not sure how to figure out where this error is coming from: https://i.lisp.cl/fLrYbm.png
15:49:36narimirango to definition of that `/`
15:49:51axionit jumps to https://i.lisp.cl/fLrYbm.png
15:49:52clyybberaxion: See, the problem is the whole expression
15:49:53axionoops
15:49:54narimiranare you sure `trace` is a float?
15:49:59axionproc `/`*(x, y: float): float {.magic: "DivF64", noSideEffect.}
15:50:21narimiran(it shouldn't matter, silly me)
15:50:26clyybberyour s is an int
15:50:31axionyes. it is defined to be the addition of 3 float32's
15:50:41axionohh
15:50:44clyybberheh
15:50:45narimirani think clyybber got it right :)
15:50:54FromGitter<kaushalmodi> narimiran: If trace is not a float, he would have got ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e7b7ddef778a11920b1a072]
15:50:56axionthanks. that was it. sigh
15:51:32FromGitter<kaushalmodi> heh `s` was int?
15:51:37narimiranaxion: now when we know where the problem is, you can remove that `math.` if you want
15:52:01axionYeah, s was an int. I was being dumb 100 lines back it seems.
15:52:02FromGitter<kaushalmodi> axion: If you don't want to import the whole math, you can even do `from math import sqrt`
15:52:17axionYup, I know. Thanks all for the help
15:52:23FromGitter<kaushalmodi> but yeah, doing `PKG.PROC` is very unnimly
15:52:49narimiran@kaushalmodi, it doesn't "import the whole math" even if you do `import math`
15:52:50axionI had to do that exactly once in these 5000 lines of code so far in my first project. It does indeed seem to be rare you'd need to do that
15:53:03FromGitter<kaushalmodi> narimiran: TIL
15:53:13dadadaPMunch: nevermind your original `foo*` way would also do the job, as long as it works :-)
15:55:44FromDiscord<Rika> yall just `import lenientops` ez fix
15:56:50axionit's my understanding that instead of math.sqrt you can turn the custom proc into a generics so it isn't less specialized, or over-specialize the custom proc. it's rare i have to explicitly qualify the module to remove an ambiguity
15:57:00axionerr is less specialized*
16:00:53axionI decided yesterday that I'm sticking with Nim as my primary everyday language. I wrote a lot of code to understand it fairly well so far, so I think Lisp is in my past :)
16:01:08clyybberWhoo
16:01:14clyybberwe achieved the impossible
16:01:20axionHa
16:02:09clyybber"Lisper switched to it" <- put that on the website
16:06:03FromGitter<kaushalmodi> axion: yay!
16:06:16FromGitter<kaushalmodi> (yay)
16:07:10leorizeaxion: does that mean we're gonna see a new blogpost from you? :)
16:07:31FromDiscord<Rika> lisper switches to nim unprecedented news
16:08:13*nsf quit (Quit: WeeChat 2.7)
16:08:39axionleorize: haha i think so, yes. But probably not before I learn jester or whatever the greatest web framework is these days. My blog hasn't been updated in forever due to a maintenance disaster due to like 30 lisp dependencies
16:10:24FromGitter<kaushalmodi> axion: Switch to hugo, it's awesome
16:10:29FromGitter<kaushalmodi> btw where do you blog?
16:11:18axionwell i haven't in some time, but it was https://www.michaelfiano.com/
16:11:27shashlickis it possible to test that a type has a specific pragma? i'm using `doAssert name is type` and fieldPairs to check that nimterop is rendering stuff correctly, but what about pragmas
16:12:01leorizeuse a macro
16:12:20shashlickhttps://github.com/nimterop/nimterop/blob/master/tests/tast2.nim
16:12:27disruptekpragmas w/o arguments aren't detected correctly.
16:13:45shashlicknote that the types are rendered by nimterop so not sure if you can pass that type to a macro and get an ast or not
16:20:46shashlicklooks like I can get to it with getImpl() - let's see if I can if it is dynamically generated
16:20:58FromGitter<alehander92> krux02 yardanico
16:21:07FromGitter<alehander92> you have to check if it uses the `-mi` option when
16:21:16FromGitter<alehander92> starting gdb in vsocde
16:21:19Yardanicoit does
16:21:24Yardanico--interpreter=mi
16:21:34Yardanicoit passes that to GDB
16:23:31*ldlework left #nim ("WeeChat 2.5")
16:24:02Yardanicooh right I get it now
16:24:06FromGitter<alehander92> sorry
16:24:16Yardanicowhen gdb is in MI mode you need to do it like "-exec info locals"
16:24:23FromGitter<alehander92> yes basically
16:24:28FromGitter<alehander92> thats the machine input option
16:24:38FromGitter<alehander92> which uses special format for some things
16:24:43FromGitter<alehander92> its used by editors/frontends etc
16:24:44Yardanicobut the thing is that VSCode doesn't take info from nim-gdb at all :(
16:24:52FromGitter<alehander92> i am trying to fix my own nim gdb-mi library lately
16:25:06YardanicoI mean I can see stuff with "-exec info locals", but in vscode variables window it's still the same
16:29:27FromGitter<alehander92> i am working a lot on gdb stuff the past several years so i should try to help a bit
16:29:29FromGitter<alehander92> sorry
16:29:38FromGitter<alehander92> i'll try to check on my vs code
16:29:39Yardanicodon't worry, it's okay :)
16:31:06FromGitter<alehander92> i should try to help a bit for that tooling, not only for proprietary stuff
16:31:25*Tungki|2 joined #nim
16:31:37FromGitter<alehander92> so, do you use just the nim package
16:32:06Yardanicowell yeah, I compile the latest devel from time to time, it's in my PATH
16:34:01*Tungki quit (Ping timeout: 252 seconds)
16:34:09FromGitter<alehander92> !
16:34:10FromGitter<alehander92> o
16:34:11FromGitter<alehander92> ok*
16:34:37*Tungki|2 quit (Read error: Connection reset by peer)
16:36:20FromGitter<alehander92> so can you send me your example file
16:36:37FromGitter<alehander92> wait i can just test with a simple one nvm
16:36:46disruptekthe body painting tag is crap, but we'll try it again today.
16:36:53Yardanicoif you still want https://play.nim-lang.org/#ix=2ffl :P
16:37:27*Trustable joined #nim
16:38:32dadadaPMunch: extracting from a lambda doesn't seem to be working https://play.nim-lang.org/#ix=2ffn
16:40:31dadadaat least I don't know what syntax I should use to make it work
16:41:14FromGitter<alehander92> how do you build
16:41:14FromGitter<alehander92> :D
16:41:22FromGitter<alehander92> i mean, what kind of gdb shortcut do you use in vscoe
16:41:26FromGitter<alehander92> i am a sublime user
16:41:49Yardanicowell, I have two files configured
16:42:19Yardanicohttps://gist.github.com/Yardanico/fa854f1c5fb6f6ac5beffd24241d7a2e
16:42:33FromGitter<alehander92> wow vscode is good
16:46:28*planetis[m] quit (Ping timeout: 240 seconds)
16:46:28*lqdev[m] quit (Ping timeout: 240 seconds)
16:46:58*reversem3 quit (Ping timeout: 256 seconds)
16:47:01*pqflx3[m] quit (Ping timeout: 256 seconds)
16:47:01*chris2020[m] quit (Ping timeout: 256 seconds)
16:47:05*unclechu quit (Ping timeout: 256 seconds)
16:47:22FromGitter<alehander92> awesome!!
16:47:24FromGitter<alehander92> it works
16:47:31FromGitter<alehander92> ok so the problem is nim-gdb.py not loading
16:47:32*Demos[m] quit (Ping timeout: 256 seconds)
16:47:32*BitPuffin quit (Ping timeout: 256 seconds)
16:47:59Yardanicobut it kinda loaded, no?
16:48:02FromGitter<alehander92> ah and source /home/al/nim/tools/nim-gdb.py -var-create: unable to create variable object
16:48:06Yardanicoyeah
16:48:07FromGitter<alehander92> right? is that your issue?
16:48:08Yardanicoyes
16:48:22Yardanicoso do locals in VSCode for you pretty-print?
16:48:26Yardanicowhile debugging
16:48:39*qbradley joined #nim
16:48:59FromGitter<alehander92> wait i'll use the new nim
16:49:00FromGitter<alehander92> nope
16:49:01*lqdev[m] joined #nim
16:50:07Yardanico@alehander92 the thing is that I even managed to output pretty-printed locals in gdb debug console, but in vscode they're still the same
16:50:17Yardanicowith "-exec info locals" they show pretty-printed in there
16:54:03*unclechu joined #nim
16:54:04*planetis[m] joined #nim
16:55:01*qbradley is now known as tempnick
16:55:37*chris2020[m] joined #nim
16:55:38*qbradley joined #nim
16:56:06*tempnick quit (Remote host closed the connection)
16:58:35*abm quit (Quit: Leaving)
16:58:39FromGitter<alehander92> oi
16:58:44FromGitter<alehander92> it seems to work
16:58:47Yardanicoreally?!
16:58:51FromGitter<alehander92> if you do `-exec source path to nim-gdb.py`
16:58:58FromGitter<alehander92> in the debug console
16:58:58Yardanicowell I tried that hmm
16:59:05Yardanicobut the locals were still the same
16:59:12Yardanicolike do you get pretty printing for seq/table/string?
16:59:22*BitPuffin joined #nim
16:59:24FromGitter<alehander92> i see e.g. for enum/seq
16:59:29Yardanicohmm
16:59:48FromGitter<alehander92> yes, string as well
17:00:01Yardanicocan you share how you did it? did you change any configs? and what source file?
17:00:38Yardanicobecause it seems to be the same for me even after doing that -exec
17:00:49Yardanico"-exec source /home/dian/.nim/tools/nim-gdb.py"
17:01:57FromGitter<alehander92> it seems to work actually
17:01:59FromGitter<alehander92> even without it
17:02:06FromGitter<alehander92> but in one of my functions
17:02:08FromGitter<alehander92> not in the other
17:02:42*ksandvik joined #nim
17:02:43*reversem3 joined #nim
17:04:35*owl_000 quit (Quit: Leaving)
17:05:52FromGitter<alehander92> hm, we need a good example
17:05:55*pqflx3[m] joined #nim
17:05:57*Demos[m] joined #nim
17:06:17FromGitter<alehander92> i'll try your one later this evening
17:06:18FromGitter<alehander92> see ya
17:09:51*ksandvik quit (Quit: Leaving.)
17:10:15*ksandvik joined #nim
17:11:27*ksandvik quit (Client Quit)
17:11:54*ksandvik joined #nim
17:13:11*ksandvik quit (Client Quit)
17:13:35*ksandvik joined #nim
17:14:09dadadanew release of nim vscode extension was just made :-)
17:14:11dadadayeah
17:14:28dadadalooks like a nice step forward
17:15:23ksandvikNice!
17:19:06PMunchdadada, sorry I was out getting some supplies. Yeah horizontal vs. vertical isn't really a thing in the NimNode tree structure. So it's just a matter of making * match more cases.
17:21:02PMunchAnd yeah, it will only work with a complete tree
17:21:12PMunchproc () isn't valid without a lambda context
17:22:00PMunchdadada, so this works: https://play.nim-lang.org/#ix=2ffJ
17:22:25PMunch(note that statements also doesn't need the *, StmtList is automatically lifted)
17:22:34*ksandvik quit (Quit: Leaving.)
17:23:00*ksandvik joined #nim
17:23:00*ksandvik quit (Client Quit)
17:23:46*ksandvik joined #nim
17:24:08dadadaPMunch: the thing is I've a macro that takes a lambda as an argument/input, and this is valid Nim code, as I get it in the macro correctly, but there's no way to parse it with your extract utility
17:25:06dadadaI could maybe fake the tree that extract expects, but that wouldn't be great
17:26:02disruptek~stream
17:26:03disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
17:26:10disrupteknim/compiler rants on demand.
17:26:22*ksandvik quit (Client Quit)
17:26:46*ksandvik joined #nim
17:31:20PMunchdadada, do you have an example?
17:32:32PMunchBecause this doesn't work: https://play.nim-lang.org/#ix=2ffK
17:33:18dadadaPMunch: it looks close to the foo thing I sent you https://play.nim-lang.org/#ix=2ffn, but I use something like d.foo proc(a: int) = statements and the macro is macro foo(d: DObject, args: varargs[untyped]): untyped = ...
17:33:37axionHmm, I ran into an issue porting some Lisp code that uses a heterogenous varargs parameter on the stack. i don't see any way to do this without using the heap in Nim
17:36:43dadadaPMunch: like this https://play.nim-lang.org/#ix=2ffL
17:39:03PMunchSo something like this? https://play.nim-lang.org/#ix=2ffM
17:39:57PMunchdadada ^
17:40:21PMunchThe thing is that using `:` or `do:` apparently requires stricter rules than without..
17:41:09dadadait's funny that it even makes the extraction code looks closer to the thing that it should parse
17:41:19PMunchWell that is the point ;)
17:41:25dadada... all this special sauce should be documented
17:41:37PMunchYou make your extraction code what you want to extract
17:41:45PMunchIt probably is.. Somewhere..
17:42:09axionI need to be able to do something like this (pseudo-code) foo(rot, x=1.0, y=2.0, z=3.0), or foo(rot, z=1.0, y=1.0, x=3.0), or _even_ duplicated keys like foo(root, z=1.0, y=2.0, z=3.0), and the body iterating over them in order. Any ideas?
17:42:27dadadaI get that, but for quote do: the do is regarded as purely sugar AFAIK, so how would a random user know that in the case of extract, the do part is functional and what function it has?
17:42:56PMunchWell it's not so much the `do` but rather the `:`
17:43:14dadadathanks for leading the way :-)
17:43:20PMunchAnd IIRC there was a difference between `:` and `do:` before, but I'm not sure if that's the case any longer.
17:43:52PMunchThe `:` takes a block or statement list as its argument. But without you can pass a single NimNode
17:44:22PMunchSo in your example you couldn't put anything after the lambda, because the lambda is the only NimNode passed to the macro, and to extract
17:45:03*zahary joined #nim
17:45:07PMunchIf you look at the treeRepr of what you get in you will see that with `:` you get a StmtList, possibly with a single element, and without you get whatever node type you passed in directly.
17:51:33FromGitter<sheerluck> "Most loved: Nim" in twitter: ⏎ ⏎ https://twitter.com/me_myself_andY/status/1180098153640411137https://twitter.com/joshbaptiste/status/1180133947998658561https://twitter.com/mcclure111/status/1180146039904505856 ... [https://gitter.im/nim-lang/Nim?at=5e7b9a25c8dae04d8faba2de]
17:56:50dadadaPMunch: to know if extraction is successful I've to use exception as of now, is that correct? I'd prefer something like this pseudocode https://play.nim-lang.org/#ix=2ffR that code runs through dumpTree fine, so maybe it's possible to support it
17:57:15FromGitter<zetashift> Anybody know why I'm getting a type mismatch here? https://play.nim-lang.org/#ix=2ffS
17:57:33axionCalling all smart Nimmers. I'm need help thinking about this problem please: https://play.nim-lang.org/#ix=2ffT
17:57:47dadadaPMunch: sometimes you've macros that can take in multiple possible asts, and so the extraction should be simultaneously a test and fail gracefully
17:57:56FromGitter<zetashift> `submatrix` should give a matrix that's equal in dimension now yet it gives the same dimensions :o
17:58:23PMunchdadada, I was thinking one would use the sameTree macro first to check what the tree matched, then extract to get the nodes..
17:58:28PMunchBut that might be a bit clunky indeed
17:59:48*ksandvik quit (Quit: Leaving.)
18:00:08dadadaPMunch: why type something twice, when you can do it in one go
18:00:11*ksandvik joined #nim
18:00:27*muffindrake joined #nim
18:00:45PMunchCan you wrap it in a template that uses a try/finally?
18:01:56dadadathat could work, I might try it myself :-) would that be efficient though? are exceptions in Nim fast?
18:02:26dadadaI assume they are... I'll try to come up with something
18:03:01PMunchWell this is all in the VM, so performance is a bit peu à peu to begin with..
18:03:13dadadatrue
18:09:40PMunchWell, I've got to start making dinner before I starve to death
18:09:58dadadagood appetite
18:14:10clyybberaxion: I think foo would have to be a macro
18:14:19clyybberWith untyped arguments
18:14:36axionWhy? It has to expand to something right?
18:15:00clyybberSo as to support foo(x = 1, x = 2)
18:15:16clyybberBecause theres no way to make that work other than have foo be a macro or template
18:15:20axionWell as mentioned, that is just pseudo code. Ignoring the syntax, I'm only interested in the semantics
18:15:26clyybberI see
18:16:17clyybberI think its still best if you start with foo being a macro
18:16:20clyybberAnd work from that
18:16:33leorizeyea macro is the best bet
18:16:42axionI'm trying to write this library without macros first, as I was struggling with Nim macros. This is my first project
18:17:03clyybberI see
18:17:08leorizeunconventional syntax will always involve macros :p
18:17:19axionThere is no syntax in pseudo code
18:18:01leorizethe only way to handle multiple of the same key is a macro-only thing :(
18:18:20leorizeunless we dive into tables, but then that wouldn't be too efficient
18:18:55leorizeaxion: varargs of tuples might be what you want?
18:19:25clyybberWhat does x = 1, x = 2 even mean in that context?
18:19:42clyybberDoes it rotate it around the x axis multiple times?
18:19:44leorizeyou can constructs tuples like this: (x: 1, y: 2, z: 3)
18:21:08axionSo the function should take some container as its second argument which maps (possibly duplicate) keys of some sort (not necessarily in a table, could just be string lits) to float values
18:22:59*sunwukong quit (Quit: Leaving)
18:23:35axionand the body will iterate over them in the order supplied, doing something different with the value depending on the key preceding it. key is an axis of rotation, so only possible identifier is X, Y, or Z, maybe some enum or just stringified versions of them
18:25:18axionthis function will rotate around the axes in the order given, and a rotation around the same axis can be done multiple times (hence why duplicate keys are allowed), and also an axis can be represented as a vec3 anywhere in the order, which says to rotate around that vector of Euler angles. in that iteration of the container
18:28:59axionthe original lisp code call would look something like (foo obj :x 1.0 :y 2.0 (vec3 3 4 5) :x 6.0), which says to rotate object 1 radian around the x axis, followed by 2 radians around the y axis, followed by the axes of the vector, followed by 6 radians around the x axis again.
18:36:18krux02axion: why so complicated?
18:37:27axionThis is for dual quaternion skinning to reflect a paper we wrote at our studio. Why would be too long to explain.
18:45:17*zahary quit (Quit: Leaving.)
18:45:40*zahary joined #nim
18:46:05*zahary quit (Client Quit)
18:52:01*ksandvik quit (Quit: Leaving.)
18:56:42*sammich quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
19:00:14*zahary joined #nim
19:08:36leorizeaxion: yea that's definitely the land of dsls
19:08:41leorizeyou need macros, like it or not
19:09:54axionmacros are for syntactic abstraction and evaluation control, neither of which matter for this
19:10:18axioni almost got it working
19:10:33leorizewell you're trying to control the evaluation of multiple x-es :P
19:10:40axionno i'm not
19:10:45leorizeoooh, what api have you figured out?
19:11:32axionWell instead of keys/values, i'll just pass in vectors denoting the rotation around that axis. [1f, 0f, 0f] would mean a positive rotation of 1 radian around the x axis for example.
19:11:47clyybberyeah, thats best
19:12:41leorizenice :)
19:12:55axionthat almost eliminates the need for the distinction between a single axis and multiple axes at once per iteration
19:13:10axionas long as the vector is normalized before used, we're good
19:13:40*dadada quit (Ping timeout: 258 seconds)
19:24:50*dadada joined #nim
19:25:14*dadada is now known as Guest99813
19:28:32FromDiscord<Prodigle> Hey, I need some help reading the profiler write out regarding memory usage. A sample:
19:28:32FromDiscord<Prodigle> ```
19:28:32FromDiscord<Prodigle> total executions of each stack trace:
19:28:32FromDiscord<Prodigle> Entry: 1/4 Calls: 104/7 = 1485.71% [sum: 104; 104/7 = 1485.71%]
19:28:32FromDiscord<Prodigle> D:\Coding\nim-1.0.6\lib\system\gc.nim: newSeq 156/7 = 2228.57%
19:28:35FromDiscord<Prodigle> C:\Users\rogue\Desktop\Nim Test\funcs.nim: GetNearbyBoids 176/7 = 2514.29%
19:28:37FromDiscord<Prodigle> C:\Users\rogue\Desktop\Nim Test\funcs.nim: CalculateBoidMove 176/7 = 2514.29%
19:28:39FromDiscord<Prodigle> C:\Users\rogue\Desktop\Nim Test\funcs.nim: DoBoids 176/7 = 2514.29%
19:28:40FromDiscord<Prodigle> C:\Users\rogue\Desktop\Nim Test\index.nim: index 196/7 = 2800.00%
19:28:42*Vladar quit (Quit: Leaving)
19:28:42FromDiscord<Prodigle> Entry: 2/4 Calls: 40/7 = 571.43% [sum: 144; 144/7 = 2057.14%]
19:28:44FromDiscord<Prodigle> D:\Coding\nim-1.0.6\lib\system\gc.nim: newObjNoInit 40/7 = 571.43%
19:28:46FromDiscord<Prodigle> D:\Coding\nim-1.0.6\lib\system\mmdisp.nim: nimNewSeqOfCap 40/7 = 571.43%
19:28:48FromDiscord<Prodigle> D:\Coding\nim-1.0.6\lib\system\assign.nim: genericAssignAux 40/7 = 571.43%
19:28:50FromDiscord<Prodigle> D:\Coding\nim-1.0.6\lib\system\assign.nim: genericAssign 40/7 = 571.43%
19:28:52FromDiscord<Prodigle> D:\Coding\nim-1.0.6\lib\system\assign.nim: genericSeqAssign 40/7 = 571.43%
19:28:54FromDiscord<Prodigle> C:\Users\rogue\Desktop\Nim Test\funcs.nim: GetNearbyBoids 176/7 = 2514.29%
19:28:56FromDiscord<Prodigle> C:\Users\rogue\Desktop\Nim Test\funcs.nim: CalculateBoidMove 176/7 = 2514.29%
19:28:58FromDiscord<Prodigle> C:\Users\rogue\Desktop\Nim Test\funcs.nim: DoBoids 176/7 = 2514.29%
19:29:00FromDiscord<Prodigle> C:\Users\rogue\Desktop\Nim Test\index.nim: index 196/7 = 2800.00%
19:29:01FromDiscord<Prodigle> ```
19:29:07shashlick~paste
19:29:07disbotpaste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead.
19:30:21*dsrw joined #nim
19:30:38FromDiscord<Prodigle> Hey, I need some help reading the profiler write out regarding memory usage. A sample:
19:30:38FromDiscord<Prodigle> https://gist.github.com/SirProdigle/371b73bb99450dbba967a48e23c0b005
19:30:42FromDiscord<Prodigle> https://gist.github.com/SirProdigle/371b73bb99450dbba967a48e23c0b005 🙂
19:37:37dsrwHi. I'm new to Nim and want to write a macro that expands `@` to `self.`, so that things like `@prop = val` and `@doSomething()` work.
19:38:01dsrwI'm hoping someone could point me to an example of a macro that does something similar that I could use to get started.
19:38:56leorizeyou don't even need a macro for that
19:39:53leorizesomething like this should work: ```template `@`(field: untyped): untyped = self.field```
19:41:56Araqdsrw, personally I'd use 's.field' instead and name the parameter 's'
19:43:00dsrwI'm partly just experimenting. I certainly agree that using `s.` is a more sensible approach :)
19:43:33Araqupcoming Nim 1.2 has a 'with' macro, but it only does some similar
19:43:40Araq*something similar
19:44:28dsrw@leorize Thank you very much. Let me try that.
19:46:18dsrw@Araq I'm trying to make something like a "ruby flavored Nim", and Ruby uses `@` for fields. Thank you, I'll look at the with macro as well.
19:47:40FromDiscord<Prodigle> Is there any way to get data back about garbage collection in a way that I can graph it? usage over time, any relevant data reallly?
19:47:43*Guest99813 is now known as dadada
19:48:19FromGitter<dumjyl> the `@` already has a typed overload so using an undeclared symbol will fail when it tries to typecheck for that overload. You would need to use a different operator.
19:48:59Araqyou can patch system.nim to use @@ instead of @ *cough*
19:49:19dsrwThat's awesome. Thanks.
19:49:44AraqProdigle: there is GC_getStatistics()
19:50:10*natrys joined #nim
19:50:22FromDiscord<Varriount> Araq: I assume the Z3 integration could be used to remove unnecessary range checks?
19:50:35FromDiscord<Varriount> Or even unnecessary numerical checks in general?
19:50:47FromDiscord<Prodigle> Thanks 🙂
19:50:59Araqwell if done right, all of them are unnecessary
19:51:11*Deuns left #nim (#nim)
19:52:52*pbb quit (Remote host closed the connection)
19:53:01*dadada quit (Ping timeout: 264 seconds)
19:54:30FromDiscord<Prodigle> In my memory profiler, I'm geting a line showing percentages in the thousands
19:54:31FromDiscord<Prodigle> Entry: 1/3 Calls: 176/7 = 2514.29% [sum: 176; 176/7 = 2514.29%]
19:54:47FromDiscord<Prodigle> Not sure how to read this
19:54:49*dadada joined #nim
19:55:04*pbb joined #nim
19:55:13*dadada is now known as Guest11273
19:55:27Araqme neither, I don't remember how it works
19:58:10axionPerhaps a dumb question, but is there somewhere that documents all the new features for each new Nim release?
19:58:53*ksandvik joined #nim
20:04:53shashlickAraq: why would you use the {.header.} pragma if everything can work (types and procs) without including the header? what cases is it required
20:06:05FromGitter<kaushalmodi> axion: https://github.com/nim-lang/Nim/blob/devel/changelog.md
20:07:17*madprops is now known as madprops_
20:07:25*madprops_ is now known as madprops
20:08:49axionOk perhaps an even dumber question: How did we jump from 1.0.6 to 1.2?
20:09:08shashlickodd numbers are dev versions
20:09:23shashlick1.0.4 => 1.0.6, 1.0.x => 1.2.x
20:09:31FromGitter<kaushalmodi> yes, so the next major release will be 1.4
20:09:38*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
20:09:46axionI see. I haven't seen that convention in some years
20:10:00FromGitter<kaushalmodi> 1) 2.2, 1.2.4, .. will be patch releases over 1.2.0
20:10:15FromGitter<kaushalmodi> Emacs does something similar
20:10:34*pbb joined #nim
20:13:29axionI'm puzzled at the long list of breaking changes after the stability guarantee announcement
20:13:37axion"New features (which do not break backwards compatibility) will continue in steadily advancing 1.x branches."
20:17:27*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
20:23:03PMunchFuck, this was too good
20:23:13PMunchIt might be that I haven't eating since lunch, but holy hell
20:23:35PMunchAnd I'm back by the way :P
20:23:36clyybberPMunch: What did you do?
20:23:49PMunchMade home-made dumplings
20:24:03clyybberoh, nice!
20:30:19Araqshashlick, I don't use .header but it can give some extra protection against API/ABI changes
20:30:35Araqaxion, which long list of breakages?
20:31:37*PMunch drools https://play.nim-lang.org/#ix=2ffM
20:31:52AraqI count 6
20:32:00*PMunch drools, with the correct link this time https://uploads.peterme.net/IMG20200325212740.jpg
20:32:02euantorGood call on `import macros` rather than `import std/macros`
20:32:36euantor`koch boot` now appears to be in the process of working too
20:32:43*rnrwashere joined #nim
20:33:44*narimiran quit (Ping timeout: 246 seconds)
20:34:34*rnrwashere quit (Remote host closed the connection)
20:48:06*ljoonal quit (Ping timeout: 256 seconds)
20:48:26*yumaikas quit (Ping timeout: 246 seconds)
20:49:55*ljoonal joined #nim
20:50:46*Guest11273 quit (Ping timeout: 240 seconds)
20:54:38*dadada joined #nim
20:55:02*dadada is now known as Guest33716
20:55:14*dsrw joined #nim
21:01:10FromDiscord<Benumbed> Like axion, kinda confused about there being both stdlib and compiler breaking changes in 1.x
21:02:50leorizePMunch: damn that looks tasty
21:03:11FromDiscord<Benumbed> Is it just that the language spec was supposed to be stable in 1.x?
21:04:03Araqas I said, I count about 6 breaking changes, all affecting edge cases only
21:04:08clyybberExactly
21:04:13Araqand could also be considered bugfixes
21:04:49*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:04:59Araqand --useVersion:1.0 emulates the bugs :-)
21:05:17FromDiscord<Recruit_main707> bam, backwards compatibility
21:05:26leorizeAraq: have you advertised that in the change log? :P
21:05:29FromDiscord<Benumbed> Araq: the markdown document just has a whole bunch of stuff under the ‘breaking’ banners :).
21:06:01Araqyeah, probably we should reword it but 1.2 isn't out yet
21:06:14Araqas we're fixing more regressions
21:06:17FromDiscord<Benumbed> I’m not complaining just wanted to set expectations so I knew what to expect in the future
21:06:32Araqand yeah yeah, "aha! so you have regressions!"
21:06:47Araqyeah we do, fixes causes regressions that cause more fixes
21:08:41leorizedo you mind if I add a warning to ioselectors_poll?
21:08:58FromDiscord<Benumbed> No regression means perfection, and, given that’s not possible for humans, I’d have a looot more questions at that point 😄
21:09:50PMunchleorize, thanks, it was :D
21:10:19leorizedid you make the whole thing yourselves?
21:10:28leorizeyourself*
21:10:28clyybberAraq: Is decodeB supposed to ensure the kind of regs[ra] ?
21:10:54Araqit's supposed to do precisely what it currently does
21:10:58clyybberBenumbed: No regression means no advancement
21:11:03clyybberAraq: Ok :D
21:16:49PMunchleorize, yup, the dough, filling, and folding
21:17:07clyybberAraq: When we have a var seq parameter does the pointer indirection get optimized away when theres no reassignment?
21:18:25clyybberDisregard that question..
21:18:48liblq-devshashlick: how'd I approach wrapping a system library using getHeader?
21:18:52Zevv"and the neckbeards don't understand software development" \o/
21:19:39liblq-devI'd like to wrap wayland-server.h for that matter
21:20:52*Guest33716 is now known as dadada
21:21:05dadada+1 for https://github.com/nim-lang/Nim/pull/13757
21:21:06disbotAdd support for `zig cc` as C compiler.
21:22:26liblq-devI tried to do `const WaylandServerH = getHeader("wayland-server.h", altNames = "waylandServer")` but I get a build error, adding a `static: cDefine(@["waylandServerStd"])` before that doesn't help
21:29:07FromDiscord<smiga287> Hi, I wanted to try out Nim and was setting up the Nim layer in Spacemacs, but then it started complaining that nimsuggest isn't there even though I think I set it up correctly in the PATH (I can clearly see the path to nimsuggest and the whole .nibmle/bin folder when I echo the PATH). Can anybody help me with the setup?
21:35:08leorizedoes running "nimsuggest" in the command line work?
21:35:30FromGitter<sheerluck> I thought PMunch was drooling over macro foo with treeRepr
21:35:31FromDiscord<smiga287> yup
21:35:44PMunchHaha, not quite
21:35:58PMunchThat was on my clipboard from when I was helping out dadada with using macroutils
21:36:16leorizesmiga287: ah, actually don't bother, and disable nimsuggest-mode
21:36:30leorizefrom what I heard about nim in emacs, that mode is broken
21:37:09dadadasmiga287: hey, I'm sadly not a emacs/spacemacs user anymore, so I can't be of much help there, however you're making a great decision by checkint out nim, I needed a while to get the hang of it, but the language is more fun to explore every day you're sticking to it
21:38:18FromDiscord<smiga287> @leorize oh okay, thanks anyways
21:39:13leorizePMunch: that's some rather decent work :)
21:39:39dadadaPMunch: I wasn't successful with creating a template/macro for a if-else-ish extract (yet), but this needs to happen
21:39:43FromDiscord<smiga287> thanks for the motivation, can't wait the explore it more!
21:39:43FromDiscord<smiga287> > <dadada> smiga287: hey, I'm sadly not a emacs/spacemacs user anymore, so I can't be of much help there, however you're making a great decision by checkint out nim, I needed a while to get the hang of it, but the language is more fun to explore every day you're sticking to it
21:39:43FromDiscord<smiga287> @gitterirc
21:42:10dadadasmiga287: you can start on play.nim-lang.org while your development environment isn't setup correctly, I continue to use it even though my dev environment works, because it's very convenient, and great for sharing the code in places like this one
21:42:33ksandvikIs ~/.nimble/bin in our PATH?
21:42:47PMunchleorize, haha thanks. Trying to not go insane from this isolation thing..
21:43:28PMunchYeah I also use the playground surprisingly often
21:43:47PMunchJust to test out some code, instead of naming a file
21:44:00leorizethe playground indenter is a tad too bad so I don't use it as much
21:44:18PMunchI guess I could just create an alias for cd-ing to /tmp and creating some random file with a scratch.nim file in it..
21:44:32PMunchYeah it's not great..
21:45:39dadadaI want vim key support on playground, I can live without it, but switching between an environment that has those keys and one that doesn't is annoying sometimes
21:45:51PMunchArgh, my Firefox insists on not using a monospace font..
21:46:07PMunchdadada, yeah that annoys me as well..
21:46:25PMunchI think there is a ready made way to add that to CodeMirror (the editor the playground uses)
21:47:46clyybberAraq: In the VM can usages of the move template that is an alias to shallowCopy like `move(s, a.slots)` be replaced by `s = move a.slots` or does this move template have a different purpose?
21:48:49Araqclyybber, instead it should be a .cursor variable, maybe
21:49:02clyybberthe s ?
21:49:07Araqyes
21:51:47clyybberAraq: I'm not sure, depends on wether a.slots would be used afterwards. From the templates name I suppose not
21:53:03clyybberSo thats why I asked
21:53:16clyybberTo be on the safe path I'm just not gonna touch it :P
21:56:25Araqmake it a cursor
21:56:42clyybberOk
21:57:09clyybberAraq: So `let s {.cursor.} = a.slots` ?
21:58:16Araqyeah or maybe
21:58:29*filcuc joined #nim
21:58:44Araqlet s = cast[ptr UncheckedArray[typeof(a.slots[0])](addr a.slots[0])
21:59:08*lritter quit (Quit: Leaving)
21:59:22Araqno known index out of bounds error in this code section for almost a decade, risk is low
21:59:36clyybberOk
21:59:57clyybberI guess thats also a bit better for performance, as what I have now: https://github.com/nim-lang/Nim/pull/13741/files
21:59:58disbotFix vm.nim for --gc:arc
22:00:02clyybberhas two pointer indirections
22:03:05clyybberAraq: So WDYT, the approach I have now which is just passing the whole seq by address or the UncheckedArray ?
22:03:29shashlickliblq-dev - is the header in the standard include path
22:03:52shashlickif you do #include <wayland-server.h> does it work
22:04:55leorizeI though you'll have to run addStandardSearchPath or smt?
22:05:12shashlickthat's for cimport
22:05:29shashlickthis is getHeader which searches standard paths if you specify -d:xxxStd
22:07:03shashlickthe `-` might be throwing it off - https://github.com/nimterop/nimterop/blob/master/nimterop/build.nim#L935
22:12:40*zahary quit (Quit: Leaving.)
22:12:53Araqclyybber, UncheckedArray
22:13:00*zahary joined #nim
22:13:22clyybberAraq: Ok
22:15:04clyybberAraq: I think a `template s(): untyped = a.slots` should do it too. WDYT?
22:16:03shashlickAraq: are bycopy and incompleteStruct orthogonal?
22:18:01*dsrw joined #nim
22:20:15Araqshashlick, no, you cannot copy incomplete structs in C
22:20:19liblq-devshashlick: yeah, that works
22:20:53Araqclyybber, VM is performance sensitive though
22:21:31dadadastuff like this makes me hopeful for a better future for humanity https://yro.slashdot.org/story/20/03/25/1651232/singapore-government-to-make-its-contact-tracing-app-freely-available-to-developers-worldwide
22:21:57shashlickif I define **`typedef struct A4 A4;`** as incompleteStruct, with importc and header, it still complains about size
22:22:11shashlickerror: storage size of ‘obj’ isn’t known
22:22:22Araqthen you use it in a context where the size must be known
22:22:54*solitudesf quit (Ping timeout: 240 seconds)
22:22:58shashlicki'm calling fieldPairs on it, maybe that's why
22:23:13shashlickcause i'm testing that it shouldn't have any fields
22:23:44Araqyeah, that's probably it
22:23:58shashlicki'm now wondering if I should even support importc + header for types
22:24:05shashlickcause ast2 works just fine without it
22:24:06leorize`char ***foo` would be `foo: ptr ptr UncheckedArray[cstring]` in Nim, right?
22:24:22leorizeand, no I can't use cstringArray here because it's not one
22:24:26Araqleorize, nobody knows what it means
22:24:35Araqmaybe you need 2 UncheckedArrays
22:24:54*Kaivo quit (Quit: WeeChat 2.7.1)
22:25:04leorizethe proc I'm wrapping returns an array of strings and it's size
22:25:12leorizeand I don't know how to express that :P
22:25:36Araqvar ptr UncheckedArray[cstring]
22:25:50leorizethanks
22:26:05shashlickcan anyone give me one good reason to retain importc / header support for types in nimterop?
22:26:56Araqposix works via C typedefs that are hidden in headers and it can be hard to figure out the real underlying type
22:27:06Araqso importing from the header is useful for that
22:28:19shashlickbut Nim still needs to know the fields if you want to use it and for that the wrapper needs to cover the details
22:28:42shashlickare you saying that i can declare a wrapper with a type with 1 field and importc but the type actually has many other fields?
22:28:57PMunchdadada, were you actually able to catch the error from except?
22:30:25PMunchErr, extract
22:31:50*dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:32:18clyybberAraq: VMArgs is not a ref object though, so storing it a temporary should have no benefit
22:32:44leorizeshashlick: yes, that's the case
22:33:38leorizethe stdlib does that because you don't know if a structure have more fields than what POSIX said (spoiler: they almost certainly does)
22:33:41dadadaPMunch: 1) I was using a quote do inside a macro and for errors that happen somewhere in the quote do code the compiler often points at the line where quote do is starting, and not the actual line where the issue occurred, this actually harmed my development speed at other times, too 2) I wrapped an expandMacros macro around the extractIf macro I created, but the output didn't make a lot of sense to me, quote
22:33:47dadadado created let statements where I expected something completely different and I've no clue why ... and then in the end I got tired ... I think it should be possible in principle
22:34:46PMunchHmm, okay. But how were you detecting that it wouldn't be able to extract?
22:35:46dadadamy approach was try: thewrappedextracthere; ifwegethereitsasuccess; except: ifwegethereitsfailure
22:36:10PMunchHuh, I wasn't able to make that catch an error
22:36:46dadadame neither, I just assumed that it SHOULD work
22:37:35*natrys quit (Quit: natrys)
22:38:22PMunchHaha, okay
22:38:31PMunchYeah I don't think that's an exception
22:39:14dadadais it an expection ?? pun intended
22:39:49dadadaexpect/ation -> exception -> expection
22:41:17dadadacould this be an exception handling bug? shouldn't they in principle catch anything that causes a stack trace? does this again have to do with the limitations of the vm?
22:41:30axionis there a way to pass the --hints:off flag with `nimble test`?
22:42:08leorizedoes switch("hints", "off") works?
22:42:28axionoh i haven't learned me some nims yet. will try that
22:43:28PMunchHmm, yeah this needs to be made a bit more robust..
22:43:30axionthat didn't work
22:43:35PMunchTo not create those crazy errors
22:43:49axionoh maybe it did. i see hints up until the config.nims file was read
22:44:22axionwell good enough i suppose.
22:44:24*yumaikas joined #nim
22:44:26clyybberAraq: Its now using ptr UncheckedArray instead. It doesn't matter for the temporaries, as those can all be eliminated with no impact, regardless of wether we use ptr seq or ptr UncheckedArray.
22:44:34dadadaPMunch: another possible way would be to prepend your sameTree, but then the syntax that is allowed for extract would need to be programmatically simplified to work with quote do
22:45:13PMunchYeah this need to be solved in a different way
22:45:18PMunchThanks for bringing it up
22:45:19clyybberAraq: Now we gotta bet that we really don't make mistakes with registerCallback, but I think thats fair :) right?
22:45:22PMunchI'll look into it
22:47:00dadadaPMunch: I've an idea, how this might still work, but I need to test it first :-) hold on
22:55:45liblq-devshashlick: take a look, http://ix.io/2fhH
22:56:01liblq-devhow am I supposed to make this work?
22:56:03dadadaPMunch: I thought maybe you could overload error somehow and force the thing to continue more gracefully maybe set a global success variable to false or something, but it's not so easy to overload, overloading of stdlib stuff is sometimes possible, apparently not in this case
22:56:15liblq-devif the header has a dash in its name
22:56:43*tane quit (Quit: Leaving)
22:58:06PMunchHaha, yeah I think this is some weird VM thing
22:59:50*lritter joined #nim
23:01:54dadadaPMunch: hmm, hold on this should really be possible, you're using massert in macroutils to call error, in failgracefullymode massert simply must behave differently, set a macroutils internal global compiletime variable to indicate failure, and then the extractIf can deduce if it was working if noFailure: doStuff else: testNextIfBranchOrNothing
23:02:50dadadaand no calling of macro.error, the error msg and node would then of course need to be logged in a different way
23:03:34PMunchOh right, that's from massert!
23:03:46PMunchI guess massert could just throw an exception instead
23:03:57*krux02 quit (Remote host closed the connection)
23:07:37dadadaPMunch: you can make it dependend on extractIf mode, macro.error has the advantage of pointing the developer to a spot in the code via the NimNode, but an exception is certainly better than nothing
23:10:58PMunchHmm, good point..
23:11:56*Trustable quit (Remote host closed the connection)
23:20:57*ksandvik quit (Quit: Leaving.)
23:22:01*liblq-dev quit (Quit: WeeChat 2.7.1)
23:23:12*zahary quit (Quit: Leaving.)
23:23:30FromDiscord<KingDarBoja> https://play.nim-lang.org/#ix=2fhP I want to specify the type of my class property "type" to be a Union of ChildTypeA and ChildTypeB
23:25:57*clyybber quit (Quit: WeeChat 2.7.1)
23:26:14*sleepyqt quit (Ping timeout: 240 seconds)
23:27:24*PMunch quit (Quit: leaving)
23:33:43*zahary joined #nim
23:36:03FromDiscord<KingDarBoja> or do I have to use case switch ?
23:39:08axionis there a f32 Inf/NegInf?
23:40:59dadadaKingDarBoja: using a kind field and a case switch is idiomatic Nim, I suppose, there're also "concepts" in Nim, but those are seemingly in a bad state, are you coming from functional programming to Nim?
23:43:08FromDiscord<KingDarBoja> Yup, Python and TypeScript coder here
23:44:04*lritter quit (Quit: Leaving)
23:44:33FromDiscord<KingDarBoja> A kind like this -> https://nim-lang.org/docs/tut2.html#object-oriented-programming-type-conversions
23:44:43FromDiscord<KingDarBoja> ??
23:45:35leorize[m]axion: just convert them to float32
23:45:45leorize[m]I've verified that they're the same when converted
23:46:35axionleorize[m]: I'm trying to write a proc signature with an an HSlice[float32, float32] from -Inf to Inf. How would I do that in the signature exactly?
23:47:00axionas a default value ^
23:47:15leorize[m]= -Inf.float32 .. Inf
23:47:32*filcuc quit (Quit: Konversation terminated!)
23:48:08leorize[m]btw HSlice with both boundaries of the same kind is also a Slice[T]
23:48:28axionseems like you also have to convert the upper bound to please the compiler
23:48:36axionAh ok
23:52:07shashlickliblq-dev does it work if you set the define with a -?
23:52:30shashlickI'll have to update the code to remove special chars from the filename
23:52:40shashlickCan you hack build.nim for now