00:03:22 | * | ksandvik quit (Quit: Leaving.) |
00:18:26 | * | dadada_ quit (Ping timeout: 256 seconds) |
00:19:56 | * | sealmove joined #nim |
00:21:32 | blackbeard420 | is `nim doc --project path/to/file` supposed to generate a dochack.js? |
00:23:12 | sealmove | guys, does anyone know how to make an online game, for example like lichess.com? |
00:24:05 | rayman22201 | blackbear420, 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:06 | rayman22201 | nim js tools/dochack/dochak.nim to build it manually |
00:25:33 | rayman22201 | `nim js tools/dochack/dochack.nim` <- typo fix |
00:27:19 | blackbeard420 | hmm 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:11 | blackbeard420 | with nim built from current devel branch |
00:35:36 | * | krux02_ joined #nim |
00:36:30 | * | rnrwashere quit (Remote host closed the connection) |
00:36:41 | FromGitter | <timotheecour> @blackbeard420 i can’t repro |
00:38:04 | * | krux02 quit (Ping timeout: 246 seconds) |
00:39:39 | blackbeard420 | interesting, 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:06 | rayman22201 | I'm using a fresh build from devel as of 24hours ago and it works for me |
00:41:18 | blackbeard420 | oh wow it was because i had --threads:on in my nim.cfg |
00:41:23 | blackbeard420 | removing that and it worked fine |
00:41:26 | blackbeard420 | thanks guys |
00:42:07 | rayman22201 | ah, 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:38 | Yardanico | blackbeard420: 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:39 | FromDiscord | <Rika> why is this so? "continue not supported in a fields loop" |
01:18:26 | * | dadada_ quit (Ping timeout: 256 seconds) |
01:18:33 | FromDiscord | <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:43 | FromDiscord | <KingDarBoja> Hi all, it's me again, got a quick question, does arrays (or sequences) are immutable? |
01:28:41 | Yardanico | if you declare them with let - yes |
01:28:54 | Yardanico | (or const that is, but const is for actual constants) |
01:29:19 | * | rnrwashere joined #nim |
01:30:11 | FromDiscord | <KingDarBoja> 👍 |
01:30:23 | * | rnrwashere quit (Remote host closed the connection) |
01:31:55 | FromDiscord | <KingDarBoja> By declaring a property at some "class" (type in this case) like this: |
01:31:55 | FromDiscord | <KingDarBoja> ```nim |
01:31:56 | FromDiscord | <KingDarBoja> type MyChildClass = ref object of ParentClass |
01:31:56 | FromDiscord | <KingDarBoja> fields: seq(other_type) |
01:31:56 | FromDiscord | <KingDarBoja> ``` |
01:31:56 | FromDiscord | <KingDarBoja> They will be immutable too? |
01:32:14 | Yardanico | please read the description for the channel on discord :) don't paste the code to chat, people in IRC gonna suffer :P |
01:32:25 | FromDiscord | <KingDarBoja> Sorry ! |
01:33:18 | Yardanico | in 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:18 | FromDiscord | <KingDarBoja> Interesting... So in order to ensure "fields" is immutable, what shall I do? |
01:43:22 | FromDiscord | <Rika> make it private |
01:43:30 | FromDiscord | <Rika> and create a getter and setter |
01:44:27 | FromDiscord | <Rika> (rename fields to some other name, perhaps pFields) then make procs "fields" and "\`fields=`" |
01:45:05 | FromDiscord | <Rika> signature: proc fields(self: MyChildClass): seq[OtherType] |
01:45:37 | FromDiscord | <Rika> and dont actually make the 2nd proc to make it immutable |
01:45:50 | FromDiscord | <Rika> now it's immutable for any module that imports it |
01:46:00 | * | rnrwashere joined #nim |
01:46:04 | FromDiscord | <Rika> but you cant guarantee immutability within the same file |
01:46:47 | FromDiscord | <KingDarBoja> Well it is private if it hasn't "*" as far as I know... but let me see the rest of things |
01:47:10 | FromDiscord | <Rika> the rename part is just to ensure the field name doesnt clash with the proc name |
01:48:01 | FromDiscord | <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:56 | FromDiscord | <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:08 | FromGitter | <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:29 | FromGitter | <zetashift> sure* |
02:05:43 | FromDiscord | <KingDarBoja> That is what I am talking about, what does truncate subclass fields mean? |
02:06:23 | FromDiscord | <KingDarBoja> Not being able to use name and age from parent type? |
02:10:16 | * | rnrwashere quit (Remote host closed the connection) |
02:10:44 | FromGitter | <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:03 | FromGitter | <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:34 | FromDiscord | <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:28 | FromGitter | <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:12 | Yardanico | nimx is not a SDK but it's the closest you can get to what you want :D |
02:47:21 | Yardanico | "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:44 | Yardanico | it'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:58 | FromDiscord | <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:14 | FromDiscord | <KingDarBoja> Type properties in this case |
02:50:12 | * | rnrwashere joined #nim |
02:51:50 | FromDiscord | <Rika> you can use backticks |
02:52:19 | Yardanico | yeah, like `end`, `block`, `proc` |
02:54:04 | FromDiscord | <KingDarBoja> Really? backsticks? |
02:54:14 | Yardanico | yes? |
02:54:27 | Yardanico | they're also used for defining operators |
02:54:32 | FromDiscord | <KingDarBoja> Ohhhh niceeee |
02:54:37 | FromGitter | <awr1> @KingDarBoja https://en.wikipedia.org/wiki/Stropping_(syntax) |
02:54:39 | * | dadada joined #nim |
02:55:00 | FromDiscord | <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:23 | FromDiscord | <KingDarBoja> Thanks once again guys, I feel enlighten 😄 |
02:57:37 | FromGitter | <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:01 | FromGitter | <awr1> you learn something new every day |
02:59:15 | FromGitter | <awr1> although it almost seems kinda like there is a return to "recursive descent parsers without lexxing" |
02:59:18 | FromGitter | <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:33 | FromDiscord | <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:17 | FromDiscord | <Rika> huh, what're the different implications of a `ref object of Type` and an `object of Type` |
05:04:20 | Yardanico | why "var Object"? it's already a ref |
05:04:39 | Yardanico | with "var Item" your method basically accepts a pointer to a pointer to an object :P |
05:04:57 | Yardanico | well, maybe the compiler is smart enough to not do that with "ref object", idk |
05:05:53 | FromDiscord | <Rika> hm i made a mistake yeah |
05:06:05 | FromDiscord | <Rika> there used to be just an Item = object |
05:06:21 | FromDiscord | <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:54 | FromGitter | <awr1> yes i think methods only work with refs only, not vars |
05:36:12 | FromGitter | <awr1> also is there a reason you need the getters |
05:40:33 | FromDiscord | <Rika> i dont want them to be settable |
05:40:53 | FromDiscord | <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:37 | Yardanico | wtf |
06:19:40 | Yardanico | oh sorry wrong chat |
06:20:52 | silvernode | https://github.com/QB64Team/qb64 |
06:21:39 | silvernode | Here 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:24 | silvernode | It 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:45 | skrylar[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:25 | FromGitter | <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:45 | FromDiscord | <Varriount> Araq: Did the Z3 code get all pushed? It doesn't look like all the logic is in the PR branch |
08:54:55 | FromDiscord | <Varriount> I wanted to try it out |
09:02:32 | Araq | it's all in my branch |
09:02:40 | Araq | I'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:47 | Zevv | oh nim is going z3 now, woet \o/ |
09:50:51 | Zevv | go araq go! |
09:52:04 | FromDiscord | <Rika> whats this z3 thing? |
09:55:36 | PMunch | Z3 is a theorem prover IIRC |
09:55:53 | PMunch | And if that is indeed the Z3 they're talking about, might be something else as well :P |
09:56:12 | Yardanico | yes, it is indeed the theorem prover one :P |
09:57:12 | Araq | yeah and it's awesome |
09:57:21 | Araq | I figured out how to make it produce counterexamples |
10:03:33 | FromDiscord | <Rika> so i read the wikipedia article on SATs aaaaaaaand i understood nil |
10:06:56 | FromDiscord | <Rika> SAT? i mean SMT |
10:14:44 | * | defection quit (Quit: defection) |
10:15:32 | FromDiscord | <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:48 | FromDiscord | <clyybber> yes, but we wont delete the gc |
10:16:02 | Araq | yeah, website update upcoming with the 1.2 release |
10:16:03 | FromDiscord | <clyybber> not for now at least |
10:16:16 | FromDiscord | <Rika> when is 1.2 releasing again |
10:16:19 | FromDiscord | <clyybber> Araq: Do we really wan't to delete the mention of GC? |
10:16:31 | Araq | we'll find some marketing term |
10:16:37 | FromDiscord | <clyybber> Heh 😄 |
10:16:40 | FromDiscord | <Rika> deterministic 😛 |
10:16:44 | Araq | "pick your memory management strategy" |
10:16:45 | FromDiscord | <Recruit_main707> i know there is people that didnt like nim because of garbage collector |
10:17:04 | FromDiscord | <Rika> and i know people who dont like rust because of a lack of one |
10:17:13 | FromDiscord | <Recruit_main707> although its very fast, but they just read that and think its slow |
10:17:33 | FromDiscord | <Rika> man dont you just hate faulty assumptions |
10:17:49 | FromDiscord | <Recruit_main707> specially about nim |
10:18:23 | * | clyybber joined #nim |
10:19:25 | FromDiscord | <Recruit_main707> anyway, so was that a yes Araq? i could maybe try and convince them again if that changes |
10:20:08 | Araq | yes |
10:20:19 | FromDiscord | <Recruit_main707> noice |
10:21:40 | clyybber | Araq: Is the cycle collector still in there, or did you replace it with the cycle breaker? |
10:22:04 | Araq | both exist, both not production ready |
10:22:24 | clyybber | Does the collector have any crashing bugs or just performance issues? |
10:22:27 | FromDiscord | <Varriount> What's the difference between them? |
10:22:41 | clyybber | Varriount: One breaks up cycles, the other one collects them automatically |
10:23:14 | clyybber | One behaves like a GC the other one like a pseudomanual free |
10:23:16 | Araq | clyybber, it crashes because of a bug in liftdestructors afaict |
10:23:31 | Araq | and it's slow |
10:23:35 | clyybber | Araq: I see |
10:23:52 | Araq | can make it fast via generations but I don't want to :P |
10:26:40 | dadada_ | 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:59 | Yardanico | nim has defer |
10:27:04 | Yardanico | :P |
10:27:09 | dadada_ | I know that |
10:27:21 | Araq | or write a macro that does the same |
10:27:25 | Yardanico | ah I checked it just now, yeah, it's different |
10:27:42 | FromDiscord | <Recruit_main707> thats why they exist |
10:28:24 | Yardanico | the 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:23 | dadada_ | Yardanico: that's shockingly easy (cross compilation) if I understood what zig is doing right |
10:29:38 | dadada_ | zig IS a c compiler with easy cross compilation, and Nim compiles to c |
10:30:06 | Yardanico | lets use nim with zig lol |
10:30:18 | dadada_ | that's what I'm saying :D |
10:30:48 | Araq | it's rumored to work. I don't really see the point |
10:31:07 | Araq | producing the binary for platform X is the *start* |
10:31:12 | Araq | then you also need to test it... |
10:31:42 | Araq | cross-compiles are nice for embedded but LLVM doesn't support as many CPU architectures as GCC does |
10:31:47 | Yardanico | oh lol didn't see https://forum.nim-lang.org/t/6115 |
10:32:08 | dadada_ | 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:37 | dadada_ | s/making/make |
10:32:40 | Araq | it'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:48 | Yardanico | we have wine xd |
10:32:49 | Araq | but it's not all that professional :P |
10:33:52 | Araq | and the fight for the **easiest** C interop is also pointless, C has the best interop with C. |
10:34:20 | Araq | and then maybe C++ follows |
10:34:45 | dadada_ | 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:06 | Araq | (not to mention that many many libraries are in C++ these days) |
10:37:40 | clyybber | dadada_: Whats the difference between odin and nims defer? |
10:38:03 | Yardanico | clyybber: https://odin-lang.org/docs/overview/#defer-statement |
10:38:09 | clyybber | looked at it |
10:38:56 | dadada_ | 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:04 | Yardanico | btw, what is the correct way to replace deepCopy on --gc:arc ? |
10:40:10 | Yardanico | parsetoml uses it here https://github.com/NimParsers/parsetoml/blob/329cc618fe27a6c89708d1fa17ddc72f8da97e08/src/parsetoml.nim#L1898 |
10:40:16 | clyybber | dadada_: Nims defer is scope based too |
10:40:31 | clyybber | And its also "reversed" |
10:42:06 | FromGitter | <Vindaar> @Yardanico: I wondered the same thing before |
10:42:37 | dadada_ | clyybber: then I got the wrong impression, maybe Nim's manual could be updated to more clearly highlight this feature! |
10:43:43 | FromDiscord | <Rika> defer isnt that useful from my experience |
10:44:15 | clyybber | It can be really useful at times |
10:44:23 | Yardanico | it's useful when you want to have things like var client = newHttpClient(); defer: client.close() together |
10:44:34 | Yardanico | so that it's easier to understand the code and the structure is better |
10:44:54 | Araq | Yardanico, it should use result[] = p[] or some variation of it |
10:45:06 | Araq | I personally cannot stand 'defer' at all |
10:45:18 | Araq | no matter how smart you make its scoping |
10:54:23 | euantor | dadada_: Nim's defer expands to a `try: ... finally: ...` construct I believe |
10:58:15 | Yardanico | I suppose it's not ok when code with --gc:arc results in a compiler error "Error: system module needs: newSeq" |
11:07:06 | Araq | Yardanico, not sure, maybe you simply have an installation problem |
11:07:34 | Yardanico | well, 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:33 | Araq | ok 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:15 | jken | clyybber: in your nim/assimp experience, did you ever get material.getTextureCount working? |
11:45:10 | clyybber | Nope, never tried |
11:46:00 | jken | deeper 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:52 | Araq | oh I know! I'll only enable the CI for Windows |
13:00:23 | Araq | as building the static lib takes 10 minutes |
13:04:33 | clyybber | lol |
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:28 | dadada | PMunch: I'm so excited to use your macroutils module, that's in nimble.directory now, thanks so much for this work |
13:34:52 | PMunch | No problem, it's stuff that I've wanted myself for a long while now |
13:35:06 | PMunch | (although I haven't yet used it for anything, so any feedback is highly welcome!) |
13:35:27 | dadada | I'm definitely going to use it today |
13:35:47 | PMunch | Sweet, please tell me how it goes :) |
13:35:52 | dadada | and will be happy to give feedback, hope you continue this, and that it doesn't become stale |
13:36:04 | PMunch | That's the plan |
13:36:44 | PMunch | I 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:25 | dadada | I also tend to write a lot of macros :D |
13:38:33 | dadada | not 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:48 | clyybber | dadada: Who are you on github? |
13:40:05 | dadada | clyybber: 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:00 | clyybber | I see |
13:41:19 | dadada | have to hone my Nim skills before I put anything out there |
13:42:02 | shashlick | PMunch why not add to stdlib |
13:42:08 | * | kungtotte quit (Ping timeout: 246 seconds) |
13:42:31 | Yardanico | oh right, is --gc:arc supposed to work with marshal? I looked at that project which errors with "system module needs: newSeq" |
13:42:39 | PMunch | shashlick, I'm open to add it |
13:42:52 | PMunch | But I wanted to see if people would use it/if it was useful first |
13:42:58 | Araq | Yardanico: no. marshall needs to be rewritten to use macros |
13:43:13 | Yardanico | well, then that's probably due to marshal, but error msg is very cryptic :P |
13:44:27 | Yardanico | so I guess I don't need to report it? |
13:44:31 | PMunch | dadada, 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:25 | dadada | PMunch: 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:09 | PMunch | Yeah.. At that point I was pretty fed up with writing documentation :P |
13:53:13 | PMunch | Sorry about that |
13:53:48 | federico3 | PMunch: a little PR? :) |
13:53:58 | PMunch | For the syntax highlighting? Hmm |
13:54:10 | Zevv | araq: anything Z3 related you can share already? I wonder what your experiments look like |
13:54:11 | federico3 | keep in mind that the readme is rendered by GH |
13:55:00 | Araq | Zevv: https://github.com/nim-lang/Nim/pull/13743/files#diff-7f32e88416af5ba545963b024d7e5bd5 |
13:55:01 | disbot | ➥ DrNim (Nim compiler with Z3 integration) |
13:55:14 | Araq | the Unix build is close to working |
13:55:21 | PMunch | federico3, yeah and GH has syntax highlighting |
13:55:24 | Araq | and then everybody can enjoy DrNim |
13:55:34 | PMunch | But it's probably a JS script that runs on a certain CSS tag |
13:57:53 | clyybber | Araq: Ok to merge https://github.com/nim-lang/Nim/pull/13741 ? |
13:57:53 | disbot | ➥ Fix vm.nim for --gc:arc |
13:57:58 | * | kungtotte joined #nim |
13:58:31 | Araq | clyybber: how is that correct? |
13:58:39 | Araq | your cast loses the seq's len information |
13:58:47 | * | couven92 quit (Read error: Connection reset by peer) |
13:58:58 | clyybber | But its not needed here |
13:59:04 | clyybber | Look at the original cast |
13:59:06 | clyybber | Oh |
13:59:11 | clyybber | Argh |
13:59:15 | * | couven92 joined #nim |
13:59:19 | clyybber | Good catch haha |
14:03:01 | Araq | I think the solution is a compiler refactoring so that 'pointer' isn't used for this |
14:03:19 | * | sunwukong joined #nim |
14:03:57 | clyybber | Yeah |
14:11:55 | disruptek | i know `requires` may be more correct, but it's also long. |
14:12:08 | disruptek | needs? |
14:12:55 | disruptek | must: |
14:13:25 | Araq | 'requires' and 'ensures' are the standard and what DrNim will use |
14:14:20 | disruptek | oh it's a standard? |
14:15:01 | Araq | Spec# uses them so yeah :P |
14:15:28 | disruptek | so we need these as noops for stdlib so that the dr can use them elsewhere? |
14:16:04 | disruptek | i guess you'd just want to import them. |
14:16:59 | Araq | yeah that's the plan, nop for the compiler |
14:17:06 | Araq | but DrNim understand them |
14:18:19 | disruptek | next we need to add them in a transform. |
14:20:32 | clyybber | Araq: Can vm callbacks be supplied in usercode? |
14:20:48 | clyybber | Or only when the compiler is compiled? |
14:24:52 | FromGitter | <cschardt> Aufsteh'n, aufeinander zugeh'n.pri (https://files.gitter.im/nim-lang/Nim/itr9/Aufsteh-n-aufeinander-zugeh-n.pri) |
14:25:44 | Yardanico | wrong window? |
14:28:47 | clyybber | lol |
14:28:54 | clyybber | wrong advice in these times |
14:29:00 | clyybber | especially in bavaria |
14:29:02 | clyybber | haha |
14:29:24 | liblq-dev | I'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:34 | Yardanico | did you try nimterop? :P |
14:29:46 | liblq-dev | I don't want nimterop, it's slow. |
14:30:22 | FromDiscord | <Recruit_main707> how can i make a type's field constant? |
14:30:33 | liblq-dev | @Recruit_main707 that's not possible |
14:30:37 | Yardanico | you mean assign once or what? |
14:31:36 | FromDiscord | <Recruit_main707> something like this |
14:31:37 | FromDiscord | <Recruit_main707> https://play.nim-lang.org/#ix=2feq |
14:31:58 | Yardanico | well, why not just use a proper constant then? |
14:32:10 | FromDiscord | <Rika> you really cannot |
14:32:18 | FromDiscord | <Rika> theres no good reason to |
14:32:44 | FromDiscord | <Recruit_main707> there are values that might be assigned at runtime and dont change |
14:32:54 | Yardanico | const in Nim is compile-time |
14:32:56 | Yardanico | strictly |
14:33:02 | Yardanico | create setters and getters then |
14:33:24 | * | FromDiscord <Recruit_main707> getters and setters |
14:33:46 | Yardanico | https://nim-lang.org/docs/tut2.html#object-oriented-programming-properties |
14:34:58 | FromDiscord | <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:13 | owl_000 | out of topic: www.w3school.com server has nim installed, unfortunately version 0.19.4 |
14:44:19 | Yardanico | You mean https://www.w3schools.com/ ? |
14:44:23 | owl_000 | yes |
14:44:32 | Yardanico | There's quite a lot of websites with online nim compiler |
14:44:45 | owl_000 | not online in their system |
14:44:54 | Yardanico | how do you know? :P |
14:45:48 | owl_000 | in python learning section you can try python code, `import os os.system("nim")` return nim compiler info. |
14:45:52 | Yardanico | lol |
14:46:02 | owl_000 | maybe it is a security issue of w3school |
14:46:14 | owl_000 | you can run many linux commands |
14:46:18 | Yardanico | well, they probably run everything in containers or commands |
14:46:20 | Yardanico | that's not an issues |
14:46:33 | Yardanico | you can do the same on most online compilers/interpreters |
14:46:33 | owl_000 | oh |
14:46:40 | * | andinus quit (Quit: ERC (IRC client for Emacs 26.3)) |
14:46:40 | Yardanico | play.nim-lang.org https://godbolt.org https://repl.it/languages/nim https://tio.run/#nim for Nim compiler online |
14:46:47 | Yardanico | there are more, but these ones are the best ones :P |
14:46:57 | owl_000 | ha ha |
14:47:12 | Yardanico | ah nvm, repl.it still has nim 0.17.2 too, damn |
14:47:58 | owl_000 | that is irony, |
14:48:46 | Yardanico | actually 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:34 | FromGitter | <alehander92> someone should ping them |
14:49:34 | owl_000 | will upgrade coming soon™ |
14:49:55 | FromGitter | <alehander92> if something is requested often they might do it, but probably have a big backlog |
14:50:44 | Yardanico | I remember how we managed to add nim to repl.it :P put the link everythere lol |
14:50:57 | Yardanico | https://replit.canny.io/languages-requests/p/add-support-for-nim-lang-to-replit |
14:51:42 | Yardanico | if you check nicknames of people who voted you'll find a lot of familiar names |
14:52:45 | owl_000 | question: any news about nim official GUI? |
14:52:56 | Yardanico | what do you mean by "official"? |
14:53:17 | Yardanico | There 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:47 | Yardanico | gintro 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:44 | Yardanico | Nim extension for VSCode got 0.6.5 update - https://github.com/pragmagic/vscode-nim/commit/84e5e548818fca1599f7e0f28e30a740dea10961 |
14:56:22 | * | NimBot joined #nim |
14:58:24 | owl_000 | updating now |
14:58:37 | Araq | why not use the Nim playground instead of repl.it? |
14:58:51 | Yardanico | that's why I put nim playground as the first one :) |
14:58:56 | Yardanico | of course it's the preferred choice |
14:59:00 | FromGitter | <alehander92> well its good to have it supported there |
14:59:13 | FromGitter | <alehander92> many people use repl.it for many langs probably |
14:59:35 | FromGitter | <alehander92> its like "why not use nimspecificedit instead of vim" |
14:59:57 | FromGitter | <alehander92> the playground is pretty good tho indeed |
15:00:08 | owl_000 | having nim option in repl is good for publicity too |
15:00:18 | Yardanico | but not when it has 0.17.2 |
15:00:31 | dadada | PMunch: what am I doing wrong in this simple constructed example https://play.nim-lang.org/#ix=2fex ? |
15:00:33 | Yardanico | some newbies might try to do something in Nim on repl, following the docs - but their code might not work |
15:00:42 | Yardanico | because that nim version is quite old |
15:00:42 | clyybber | Araq: Lol, that DrNim comment |
15:01:33 | Yardanico | I like how nim playground has all versions starting from 0.13.0 btw :P |
15:01:39 | dadada | btw. it's an awesome feature not everyone might know about that play.nim-lang.org supports importing nimble directory modules ... |
15:01:41 | clyybber | Araq: 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:55 | Yardanico | dadada: how? :P |
15:02:17 | Yardanico | ah nvm, only these https://github.com/PMunch/nim-playground/blob/master/docker/packages.nimble |
15:02:27 | Yardanico | quite a good collection though |
15:02:29 | PMunch | dadada, just forgot to import macros :) |
15:02:43 | PMunch | https://play.nim-lang.org/#ix=2fey |
15:02:58 | Araq | clyybber: yeah I know, but it remains stupid shit |
15:03:05 | dadada | PMunch: shouldn't macroutils imply import macros, you an export macros in macroutils!? |
15:03:08 | dadada | can |
15:03:22 | Yardanico | dadada: I feel like that will look kinda weird |
15:03:29 | PMunch | Yardanico, yeah it's based on the important packages list |
15:03:45 | clyybber | Araq: You mean dynamically linking? |
15:03:47 | PMunch | But everyone is free to add a PR to have other packages added :) |
15:03:51 | dadada | Yardanico: why? |
15:04:05 | PMunch | dadada, you might not want parts of macros I guess |
15:04:10 | PMunch | But yeah, it possibly should |
15:04:24 | dadada | it definitely should, if it's core feature doesn't work without it |
15:04:32 | dadada | but that's just my opinion MAAN |
15:04:33 | dadada | :D |
15:04:56 | Yardanico | well, nim stdlib also has some modules like this |
15:05:12 | Yardanico | like xmltree - if you don't import "strtabs" you won't be able to use "attrs" table for a xml node |
15:06:11 | owl_000 | question: how do you debug nim in vscode. btw i use echo to check |
15:06:23 | Yardanico | echo is the best debugger out there :) |
15:06:31 | Yardanico | owl_000: but really you can use GDB with nim |
15:06:48 | Yardanico | nim ships with nim-gdb script which kinda should make mangled names easier to read, didn't really try it yet though |
15:07:22 | dadada | Yardanico: 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:27 | owl_000 | vscode gdb says there is no a.out file |
15:07:42 | Yardanico | well, you have to edit default vscode gdb config |
15:08:04 | owl_000 | oh then, echo is better |
15:08:22 | Yardanico | owl_000: just change "program" to the name of the binary |
15:09:07 | clyybber | Araq: Well that was easy: #13741 :D |
15:09:08 | disbot | https://github.com/nim-lang/Nim/pull/13741 -- 3Fix vm.nim for --gc:arc |
15:09:12 | clyybber | No big refactoring required |
15:10:45 | Yardanico | hmm, GDB in vscode works, now need to figure out how to use nim-gdb.py with it |
15:11:11 | shashlick | liblq-dev - why is nimterop slow? isn't stuff cached? |
15:11:26 | liblq-dev | idk `nim check` is show for me on nimterop |
15:11:32 | liblq-dev | s/show/slow |
15:11:32 | clyybber | Yardanico: Just run nim-gdb |
15:11:41 | liblq-dev | same with compilation |
15:11:46 | liblq-dev | same with nim.nvim |
15:11:49 | Yardanico | clyybber: well, VSCode starts gdb itself |
15:11:55 | clyybber | Oh |
15:11:58 | shashlick | then generate a wrapper and write it to file and import that |
15:12:05 | shashlick | you don't have to use it at compile time |
15:12:14 | liblq-dev | how'd I achieve that? |
15:12:24 | liblq-dev | that's what I wanted to do with c2nim btw |
15:12:28 | clyybber | Yardanico: Look at the shell script, the important part should be overriding GDB_PYTHON_MODULE_PATH |
15:12:28 | shashlick | nim c wrapper.nim > out.nim |
15:12:32 | liblq-dev | but it doesn't support some syntax |
15:12:44 | liblq-dev | oh, and just use cDebug in that file? |
15:12:53 | shashlick | yes |
15:12:58 | liblq-dev | right |
15:13:02 | liblq-dev | will try later, thanks |
15:13:22 | Yardanico | clyybber: I think I can specify gdb binary to be "nim-gdb" in VSCode |
15:13:25 | Yardanico | i'll try at least |
15:13:28 | clyybber | Ah nice |
15:13:37 | shashlick | caching for nimsuggest and nim check is in place though |
15:14:15 | Yardanico | how do I check if nim-gdb works? :P |
15:14:50 | liblq-dev | shashlick: I'll try to update nimterop later and report back on whether anything is better. |
15:14:53 | clyybber | Yardanico: It should say "Loading Nim Runtime support." |
15:14:58 | clyybber | As the last line |
15:15:32 | shashlick | okay, big release is coming though with ast2 which will be able to support all of C eventually |
15:15:39 | Yardanico | hmm, it doesn't say that, strange |
15:15:41 | Yardanico | but it shows "set Nim pretty printers for /home/dian/projects/nimstuff/osu_lazer_saver" |
15:16:51 | dadada | shashlick: where can I learn about ast2? |
15:17:23 | dadada | big release of nim or do you talk about something else? |
15:17:28 | Yardanico | ah, seems like it indeed uses nim-gdb |
15:17:29 | dadada | sorry, I may have lost the context |
15:17:38 | Yardanico | but variables are still like T4_ and T5_ in "locals" |
15:18:09 | clyybber | Hmm |
15:18:15 | shashlick | dadada: of nimterop - it parses C and generates Nim wrappers |
15:18:17 | clyybber | krux02 is the guy to ask |
15:18:40 | dadada | shashlick: +1 for nimterop, I look forward to it supporting C++ |
15:18:53 | disruptek | the mangling for locals will probably change, too. |
15:18:56 | FromGitter | <gogolxdong> How to print newline characters in a string variable? |
15:19:01 | Yardanico | \n |
15:19:11 | Yardanico | echo "line\nanotherline\nanotherline" |
15:20:03 | FromGitter | <gogolxdong> There is a string variable , I want to see the newline character is \c\L or \n. |
15:20:26 | Yardanico | use repr I guess? |
15:20:50 | FromGitter | <gogolxdong> It works for python not for Nim. |
15:21:04 | Yardanico | !eval echo repr "hello\nstring\n" |
15:21:07 | NimBot | 0x55d8eecd96f0"hello\10"↵"string\10"↵"" |
15:21:12 | Yardanico | well almost :P |
15:21:21 | * | andinus quit (Remote host closed the connection) |
15:22:19 | dadada | PMunch: what am I doing wrong now? https://play.nim-lang.org/#ix=2feH |
15:22:55 | clyybber | Yardanico: No no no no DD |
15:23:07 | clyybber | poor repr |
15:23:09 | * | nsf joined #nim |
15:23:29 | krux02 | clyybber: what about me? |
15:23:41 | PMunch | Using varargs[untyped]: https://play.nim-lang.org/#ix=2feJ |
15:23:44 | clyybber | krux02: You created gdb-nim |
15:23:51 | krux02 | yes |
15:23:54 | clyybber | And Yardanico is having a problem with it I think |
15:23:57 | krux02 | nim-gdb |
15:24:01 | Yardanico | krux02: well I just wanted to try nim-gdb in VSCode |
15:24:09 | krux02 | ok |
15:24:18 | Yardanico | it seems to actually launch nim-gdb now, but in "Variables" window in VSCode it still shows variable names like "_T4" and stuff |
15:24:27 | Yardanico | I compiled the binary with --debugger:native without any other flags, is that right? |
15:24:33 | Yardanico | I mean the binary for the program I want to debug |
15:24:35 | krux02 | well, first of all nim-gdb is just the start script to start gdb. |
15:24:36 | shashlick | dadada: C++ seems achievable now, the old design wasn't as flexible, though it worked well for the POC that it was |
15:24:40 | PMunch | Well, you could also do `args[0].extract` dadada |
15:25:35 | krux02 | it loads the python pretty printers, and then it is just pure gdb. No fluff attached other than python pretty printers. |
15:25:46 | dadada | ok, 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:00 | krux02 | the problem is, I can't really do anything about nims name disambiguation |
15:26:20 | Yardanico | krux02: https://i.imgur.com/DbrGC5U.png |
15:26:48 | dadada | PMunch: I already have a suggestion for an operation: | cause that's showing in the vertical direction |
15:26:52 | dadada | operator |
15:27:06 | krux02 | ok |
15:27:08 | FromGitter | <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:39 | Yardanico | the more popularity a project has the more issues there are :) |
15:27:44 | * | gpickett00 left #nim (#nim) |
15:27:52 | dadada | thankfully a good number of those issues isn't terrible stuff |
15:27:56 | Yardanico | rust has 5.2k open issues you know :P |
15:28:05 | krux02 | Yardanico, 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:58 | PMunch | Hmm, 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:01 | PMunch | But that seems broken |
15:29:04 | Yardanico | well yeah, I just tried it out of curiosity, I mostly use echo :P |
15:29:04 | PMunch | I have to look into that |
15:29:21 | PMunch | (and then you could run a for loop with extract on that if you wanted) |
15:29:26 | krux02 | Yardanico, I don't have a lot of gdb experience within VSCode |
15:30:11 | krux02 | I only use it from emacs, as this is the only debugger that is basically just window for gdb. |
15:30:54 | krux02 | Yardanico, can you write gdb commands in a gdb terminal from VSCode? |
15:30:58 | Yardanico | krux02: yes |
15:31:01 | krux02 | ok |
15:31:07 | dadada | shashlick: 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:08 | krux02 | then you should be able to type: info locals |
15:31:13 | krux02 | print x |
15:31:22 | krux02 | bt (for backtrace) |
15:31:27 | krux02 | n (for next) |
15:31:32 | krux02 | s (step into function) |
15:31:42 | Yardanico | info locals |
15:31:42 | Yardanico | -var-create: unable to create variable object |
15:31:45 | Yardanico | hmm |
15:31:59 | krux02 | what? |
15:32:02 | Yardanico | it says that for every command |
15:32:09 | krux02 | then something is wrong |
15:32:11 | Yardanico | idk what that means |
15:32:16 | krux02 | me neither |
15:32:35 | krux02 | can you show me another picture? |
15:32:56 | krux02 | You are lucky, I have time right now, you are interested in a screen sharing session with audio? |
15:33:14 | krux02 | I am interested to see how well gdb works in VSCode as well. |
15:33:27 | Yardanico | well I can do that, but my english speaking skills aren't the best :P |
15:33:38 | krux02 | what language do you speak? |
15:34:10 | Yardanico | i'm russian, but I can understand english pretty well, it's just that I don't have a lot of speaking experience |
15:36:07 | owl_000 | speaking is different skill. without being around native speaker it is hard to improve. |
15:36:48 | krux02 | Yardanico, I sent you private message |
15:36:59 | shashlick | dadada: 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:03 | dadada | shashlick: 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:17 | shashlick | anyway, 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:07 | axion | is 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:57 | dadada | shashlick: 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:00 | dadada | :-) |
15:41:05 | narimiran | axion: yes |
15:41:07 | dadada | must have done |
15:41:24 | dadada | well every other day |
15:41:27 | narimiran | axion: 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:32 | shashlick | now 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:40 | FromGitter | <kaushalmodi> axion: https://nim-lang.github.io/Nim/math#sqrt%2Cfloat32 |
15:41:45 | narimiran | axion: or, TL;DR: `import math` |
15:41:53 | axion | yes i am using math |
15:42:43 | axion | hmm maybe there's a custom overload in the way in one of the libraries |
15:42:53 | axion | i'll inspect further, thanks |
15:43:14 | narimiran | axion: try `math.sqrt(1234.56)` |
15:43:15 | * | Tungki joined #nim |
15:43:46 | FromGitter | <kaushalmodi> axion: https://play.nim-lang.org/#ix=2feR |
15:44:01 | FromGitter | <kaushalmodi> you can always use the Nim playground to reproduce the issue and share that link |
15:44:06 | dadada | PMunch: this is what I think it should work like: https://play.nim-lang.org/#ix=2feT |
15:44:07 | axion | `0.5 / math.sqrt(trace)` gives me error| type mismatch: got <float> but expected 'int' |
15:44:32 | narimiran | @kaushalmodi, why not `let num = 2.0`? |
15:44:54 | FromGitter | <kaushalmodi> narimiran: I just wanted to show that ints work too if the var type is float |
15:44:57 | FromGitter | <kaushalmodi> :) |
15:45:11 | clyybber | !eval echo 0.5 / math.sqrt(5) |
15:45:13 | NimBot | Compile failed: /usercode/in.nim(1, 12) Error: undeclared identifier: 'math' |
15:45:18 | dadada | PMunch: 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:30 | clyybber | !eval import math; echo 0.5 / math.sqrt(5) |
15:45:32 | NimBot | Compile 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:41 | narimiran | !eval import math; echo 10.0 / sqrt(25.0) |
15:45:44 | NimBot | 2.0 |
15:45:45 | clyybber | !eval import math; echo 0.5 / math.sqrt(5'f) |
15:45:48 | NimBot | 0.223606794466938 |
15:46:09 | clyybber | axion: I think your error is about the whole expression |
15:46:10 | axion | hmm the error is in the `/` actually. must be an overload somewhere |
15:47:07 | dadada | PMunch: btw, I'm not just testing this on play.nim-lang, I needed the same in some of my code just now |
15:49:06 | axion | I'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:36 | narimiran | go to definition of that `/` |
15:49:51 | axion | it jumps to https://i.lisp.cl/fLrYbm.png |
15:49:52 | clyybber | axion: See, the problem is the whole expression |
15:49:53 | axion | oops |
15:49:54 | narimiran | are you sure `trace` is a float? |
15:49:59 | axion | proc `/`*(x, y: float): float {.magic: "DivF64", noSideEffect.} |
15:50:21 | narimiran | (it shouldn't matter, silly me) |
15:50:26 | clyybber | your s is an int |
15:50:31 | axion | yes. it is defined to be the addition of 3 float32's |
15:50:41 | axion | ohh |
15:50:44 | clyybber | heh |
15:50:45 | narimiran | i think clyybber got it right :) |
15:50:54 | FromGitter | <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:56 | axion | thanks. that was it. sigh |
15:51:32 | FromGitter | <kaushalmodi> heh `s` was int? |
15:51:37 | narimiran | axion: now when we know where the problem is, you can remove that `math.` if you want |
15:52:01 | axion | Yeah, s was an int. I was being dumb 100 lines back it seems. |
15:52:02 | FromGitter | <kaushalmodi> axion: If you don't want to import the whole math, you can even do `from math import sqrt` |
15:52:17 | axion | Yup, I know. Thanks all for the help |
15:52:23 | FromGitter | <kaushalmodi> but yeah, doing `PKG.PROC` is very unnimly |
15:52:49 | narimiran | @kaushalmodi, it doesn't "import the whole math" even if you do `import math` |
15:52:50 | axion | I 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:03 | FromGitter | <kaushalmodi> narimiran: TIL |
15:53:13 | dadada | PMunch: nevermind your original `foo*` way would also do the job, as long as it works :-) |
15:55:44 | FromDiscord | <Rika> yall just `import lenientops` ez fix |
15:56:50 | axion | it'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:00 | axion | err is less specialized* |
16:00:53 | axion | I 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:08 | clyybber | Whoo |
16:01:14 | clyybber | we achieved the impossible |
16:01:20 | axion | Ha |
16:02:09 | clyybber | "Lisper switched to it" <- put that on the website |
16:06:03 | FromGitter | <kaushalmodi> axion: yay! |
16:06:16 | FromGitter | <kaushalmodi> (yay) |
16:07:10 | leorize | axion: does that mean we're gonna see a new blogpost from you? :) |
16:07:31 | FromDiscord | <Rika> lisper switches to nim unprecedented news |
16:08:13 | * | nsf quit (Quit: WeeChat 2.7) |
16:08:39 | axion | leorize: 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:24 | FromGitter | <kaushalmodi> axion: Switch to hugo, it's awesome |
16:10:29 | FromGitter | <kaushalmodi> btw where do you blog? |
16:11:18 | axion | well i haven't in some time, but it was https://www.michaelfiano.com/ |
16:11:27 | shashlick | is 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:01 | leorize | use a macro |
16:12:20 | shashlick | https://github.com/nimterop/nimterop/blob/master/tests/tast2.nim |
16:12:27 | disruptek | pragmas w/o arguments aren't detected correctly. |
16:13:45 | shashlick | note 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:46 | shashlick | looks like I can get to it with getImpl() - let's see if I can if it is dynamically generated |
16:20:58 | FromGitter | <alehander92> krux02 yardanico |
16:21:07 | FromGitter | <alehander92> you have to check if it uses the `-mi` option when |
16:21:16 | FromGitter | <alehander92> starting gdb in vsocde |
16:21:19 | Yardanico | it does |
16:21:24 | Yardanico | --interpreter=mi |
16:21:34 | Yardanico | it passes that to GDB |
16:23:31 | * | ldlework left #nim ("WeeChat 2.5") |
16:24:02 | Yardanico | oh right I get it now |
16:24:06 | FromGitter | <alehander92> sorry |
16:24:16 | Yardanico | when gdb is in MI mode you need to do it like "-exec info locals" |
16:24:23 | FromGitter | <alehander92> yes basically |
16:24:28 | FromGitter | <alehander92> thats the machine input option |
16:24:38 | FromGitter | <alehander92> which uses special format for some things |
16:24:43 | FromGitter | <alehander92> its used by editors/frontends etc |
16:24:44 | Yardanico | but the thing is that VSCode doesn't take info from nim-gdb at all :( |
16:24:52 | FromGitter | <alehander92> i am trying to fix my own nim gdb-mi library lately |
16:25:06 | Yardanico | I mean I can see stuff with "-exec info locals", but in vscode variables window it's still the same |
16:29:27 | FromGitter | <alehander92> i am working a lot on gdb stuff the past several years so i should try to help a bit |
16:29:29 | FromGitter | <alehander92> sorry |
16:29:38 | FromGitter | <alehander92> i'll try to check on my vs code |
16:29:39 | Yardanico | don't worry, it's okay :) |
16:31:06 | FromGitter | <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:37 | FromGitter | <alehander92> so, do you use just the nim package |
16:32:06 | Yardanico | well 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:09 | FromGitter | <alehander92> ! |
16:34:10 | FromGitter | <alehander92> o |
16:34:11 | FromGitter | <alehander92> ok* |
16:34:37 | * | Tungki|2 quit (Read error: Connection reset by peer) |
16:36:20 | FromGitter | <alehander92> so can you send me your example file |
16:36:37 | FromGitter | <alehander92> wait i can just test with a simple one nvm |
16:36:46 | disruptek | the body painting tag is crap, but we'll try it again today. |
16:36:53 | Yardanico | if you still want https://play.nim-lang.org/#ix=2ffl :P |
16:37:27 | * | Trustable joined #nim |
16:38:32 | dadada | PMunch: extracting from a lambda doesn't seem to be working https://play.nim-lang.org/#ix=2ffn |
16:40:31 | dadada | at least I don't know what syntax I should use to make it work |
16:41:14 | FromGitter | <alehander92> how do you build |
16:41:14 | FromGitter | <alehander92> :D |
16:41:22 | FromGitter | <alehander92> i mean, what kind of gdb shortcut do you use in vscoe |
16:41:26 | FromGitter | <alehander92> i am a sublime user |
16:41:49 | Yardanico | well, I have two files configured |
16:42:19 | Yardanico | https://gist.github.com/Yardanico/fa854f1c5fb6f6ac5beffd24241d7a2e |
16:42:33 | FromGitter | <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:22 | FromGitter | <alehander92> awesome!! |
16:47:24 | FromGitter | <alehander92> it works |
16:47:31 | FromGitter | <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:59 | Yardanico | but it kinda loaded, no? |
16:48:02 | FromGitter | <alehander92> ah and source /home/al/nim/tools/nim-gdb.py -var-create: unable to create variable object |
16:48:06 | Yardanico | yeah |
16:48:07 | FromGitter | <alehander92> right? is that your issue? |
16:48:08 | Yardanico | yes |
16:48:22 | Yardanico | so do locals in VSCode for you pretty-print? |
16:48:26 | Yardanico | while debugging |
16:48:39 | * | qbradley joined #nim |
16:48:59 | FromGitter | <alehander92> wait i'll use the new nim |
16:49:00 | FromGitter | <alehander92> nope |
16:49:01 | * | lqdev[m] joined #nim |
16:50:07 | Yardanico | @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:17 | Yardanico | with "-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:39 | FromGitter | <alehander92> oi |
16:58:44 | FromGitter | <alehander92> it seems to work |
16:58:47 | Yardanico | really?! |
16:58:51 | FromGitter | <alehander92> if you do `-exec source path to nim-gdb.py` |
16:58:58 | FromGitter | <alehander92> in the debug console |
16:58:58 | Yardanico | well I tried that hmm |
16:59:05 | Yardanico | but the locals were still the same |
16:59:12 | Yardanico | like do you get pretty printing for seq/table/string? |
16:59:22 | * | BitPuffin joined #nim |
16:59:24 | FromGitter | <alehander92> i see e.g. for enum/seq |
16:59:29 | Yardanico | hmm |
16:59:48 | FromGitter | <alehander92> yes, string as well |
17:00:01 | Yardanico | can you share how you did it? did you change any configs? and what source file? |
17:00:38 | Yardanico | because it seems to be the same for me even after doing that -exec |
17:00:49 | Yardanico | "-exec source /home/dian/.nim/tools/nim-gdb.py" |
17:01:57 | FromGitter | <alehander92> it seems to work actually |
17:01:59 | FromGitter | <alehander92> even without it |
17:02:06 | FromGitter | <alehander92> but in one of my functions |
17:02:08 | FromGitter | <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:52 | FromGitter | <alehander92> hm, we need a good example |
17:05:55 | * | pqflx3[m] joined #nim |
17:05:57 | * | Demos[m] joined #nim |
17:06:17 | FromGitter | <alehander92> i'll try your one later this evening |
17:06:18 | FromGitter | <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:09 | dadada | new release of nim vscode extension was just made :-) |
17:14:11 | dadada | yeah |
17:14:28 | dadada | looks like a nice step forward |
17:15:23 | ksandvik | Nice! |
17:19:06 | PMunch | dadada, 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:02 | PMunch | And yeah, it will only work with a complete tree |
17:21:12 | PMunch | proc () isn't valid without a lambda context |
17:22:00 | PMunch | dadada, so this works: https://play.nim-lang.org/#ix=2ffJ |
17:22:25 | PMunch | (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:08 | dadada | PMunch: 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:06 | dadada | I could maybe fake the tree that extract expects, but that wouldn't be great |
17:26:02 | disruptek | ~stream |
17:26:03 | disbot | stream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek |
17:26:10 | disruptek | nim/compiler rants on demand. |
17:26:22 | * | ksandvik quit (Client Quit) |
17:26:46 | * | ksandvik joined #nim |
17:31:20 | PMunch | dadada, do you have an example? |
17:32:32 | PMunch | Because this doesn't work: https://play.nim-lang.org/#ix=2ffK |
17:33:18 | dadada | PMunch: 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:37 | axion | Hmm, 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:43 | dadada | PMunch: like this https://play.nim-lang.org/#ix=2ffL |
17:39:03 | PMunch | So something like this? https://play.nim-lang.org/#ix=2ffM |
17:39:57 | PMunch | dadada ^ |
17:40:21 | PMunch | The thing is that using `:` or `do:` apparently requires stricter rules than without.. |
17:41:09 | dadada | it's funny that it even makes the extraction code looks closer to the thing that it should parse |
17:41:19 | PMunch | Well that is the point ;) |
17:41:25 | dadada | ... all this special sauce should be documented |
17:41:37 | PMunch | You make your extraction code what you want to extract |
17:41:45 | PMunch | It probably is.. Somewhere.. |
17:42:09 | axion | I 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:27 | dadada | I 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:56 | PMunch | Well it's not so much the `do` but rather the `:` |
17:43:14 | dadada | thanks for leading the way :-) |
17:43:20 | PMunch | And IIRC there was a difference between `:` and `do:` before, but I'm not sure if that's the case any longer. |
17:43:52 | PMunch | The `:` takes a block or statement list as its argument. But without you can pass a single NimNode |
17:44:22 | PMunch | So 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:07 | PMunch | If 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:33 | FromGitter | <sheerluck> "Most loved: Nim" in twitter: ⏎ ⏎ https://twitter.com/me_myself_andY/status/1180098153640411137 ⏎ https://twitter.com/joshbaptiste/status/1180133947998658561 ⏎ https://twitter.com/mcclure111/status/1180146039904505856 ... [https://gitter.im/nim-lang/Nim?at=5e7b9a25c8dae04d8faba2de] |
17:56:50 | dadada | PMunch: 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:15 | FromGitter | <zetashift> Anybody know why I'm getting a type mismatch here? https://play.nim-lang.org/#ix=2ffS |
17:57:33 | axion | Calling all smart Nimmers. I'm need help thinking about this problem please: https://play.nim-lang.org/#ix=2ffT |
17:57:47 | dadada | PMunch: 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:56 | FromGitter | <zetashift> `submatrix` should give a matrix that's equal in dimension now yet it gives the same dimensions :o |
17:58:23 | PMunch | dadada, I was thinking one would use the sameTree macro first to check what the tree matched, then extract to get the nodes.. |
17:58:28 | PMunch | But that might be a bit clunky indeed |
17:59:48 | * | ksandvik quit (Quit: Leaving.) |
18:00:08 | dadada | PMunch: 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:45 | PMunch | Can you wrap it in a template that uses a try/finally? |
18:01:56 | dadada | that could work, I might try it myself :-) would that be efficient though? are exceptions in Nim fast? |
18:02:26 | dadada | I assume they are... I'll try to come up with something |
18:03:01 | PMunch | Well this is all in the VM, so performance is a bit peu à peu to begin with.. |
18:03:13 | dadada | true |
18:09:40 | PMunch | Well, I've got to start making dinner before I starve to death |
18:09:58 | dadada | good appetite |
18:14:10 | clyybber | axion: I think foo would have to be a macro |
18:14:19 | clyybber | With untyped arguments |
18:14:36 | axion | Why? It has to expand to something right? |
18:15:00 | clyybber | So as to support foo(x = 1, x = 2) |
18:15:16 | clyybber | Because theres no way to make that work other than have foo be a macro or template |
18:15:20 | axion | Well as mentioned, that is just pseudo code. Ignoring the syntax, I'm only interested in the semantics |
18:15:26 | clyybber | I see |
18:16:17 | clyybber | I think its still best if you start with foo being a macro |
18:16:20 | clyybber | And work from that |
18:16:33 | leorize | yea macro is the best bet |
18:16:42 | axion | I'm trying to write this library without macros first, as I was struggling with Nim macros. This is my first project |
18:17:03 | clyybber | I see |
18:17:08 | leorize | unconventional syntax will always involve macros :p |
18:17:19 | axion | There is no syntax in pseudo code |
18:18:01 | leorize | the only way to handle multiple of the same key is a macro-only thing :( |
18:18:20 | leorize | unless we dive into tables, but then that wouldn't be too efficient |
18:18:55 | leorize | axion: varargs of tuples might be what you want? |
18:19:25 | clyybber | What does x = 1, x = 2 even mean in that context? |
18:19:42 | clyybber | Does it rotate it around the x axis multiple times? |
18:19:44 | leorize | you can constructs tuples like this: (x: 1, y: 2, z: 3) |
18:21:08 | axion | So 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:35 | axion | and 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:18 | axion | this 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:59 | axion | the 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:18 | krux02 | axion: why so complicated? |
18:37:27 | axion | This 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:36 | leorize | axion: yea that's definitely the land of dsls |
19:08:41 | leorize | you need macros, like it or not |
19:09:54 | axion | macros are for syntactic abstraction and evaluation control, neither of which matter for this |
19:10:18 | axion | i almost got it working |
19:10:33 | leorize | well you're trying to control the evaluation of multiple x-es :P |
19:10:40 | axion | no i'm not |
19:10:45 | leorize | oooh, what api have you figured out? |
19:11:32 | axion | Well 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:47 | clyybber | yeah, thats best |
19:12:41 | leorize | nice :) |
19:12:55 | axion | that almost eliminates the need for the distinction between a single axis and multiple axes at once per iteration |
19:13:10 | axion | as 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:32 | FromDiscord | <Prodigle> Hey, I need some help reading the profiler write out regarding memory usage. A sample: |
19:28:32 | FromDiscord | <Prodigle> ``` |
19:28:32 | FromDiscord | <Prodigle> total executions of each stack trace: |
19:28:32 | FromDiscord | <Prodigle> Entry: 1/4 Calls: 104/7 = 1485.71% [sum: 104; 104/7 = 1485.71%] |
19:28:32 | FromDiscord | <Prodigle> D:\Coding\nim-1.0.6\lib\system\gc.nim: newSeq 156/7 = 2228.57% |
19:28:35 | FromDiscord | <Prodigle> C:\Users\rogue\Desktop\Nim Test\funcs.nim: GetNearbyBoids 176/7 = 2514.29% |
19:28:37 | FromDiscord | <Prodigle> C:\Users\rogue\Desktop\Nim Test\funcs.nim: CalculateBoidMove 176/7 = 2514.29% |
19:28:39 | FromDiscord | <Prodigle> C:\Users\rogue\Desktop\Nim Test\funcs.nim: DoBoids 176/7 = 2514.29% |
19:28:40 | FromDiscord | <Prodigle> C:\Users\rogue\Desktop\Nim Test\index.nim: index 196/7 = 2800.00% |
19:28:42 | * | Vladar quit (Quit: Leaving) |
19:28:42 | FromDiscord | <Prodigle> Entry: 2/4 Calls: 40/7 = 571.43% [sum: 144; 144/7 = 2057.14%] |
19:28:44 | FromDiscord | <Prodigle> D:\Coding\nim-1.0.6\lib\system\gc.nim: newObjNoInit 40/7 = 571.43% |
19:28:46 | FromDiscord | <Prodigle> D:\Coding\nim-1.0.6\lib\system\mmdisp.nim: nimNewSeqOfCap 40/7 = 571.43% |
19:28:48 | FromDiscord | <Prodigle> D:\Coding\nim-1.0.6\lib\system\assign.nim: genericAssignAux 40/7 = 571.43% |
19:28:50 | FromDiscord | <Prodigle> D:\Coding\nim-1.0.6\lib\system\assign.nim: genericAssign 40/7 = 571.43% |
19:28:52 | FromDiscord | <Prodigle> D:\Coding\nim-1.0.6\lib\system\assign.nim: genericSeqAssign 40/7 = 571.43% |
19:28:54 | FromDiscord | <Prodigle> C:\Users\rogue\Desktop\Nim Test\funcs.nim: GetNearbyBoids 176/7 = 2514.29% |
19:28:56 | FromDiscord | <Prodigle> C:\Users\rogue\Desktop\Nim Test\funcs.nim: CalculateBoidMove 176/7 = 2514.29% |
19:28:58 | FromDiscord | <Prodigle> C:\Users\rogue\Desktop\Nim Test\funcs.nim: DoBoids 176/7 = 2514.29% |
19:29:00 | FromDiscord | <Prodigle> C:\Users\rogue\Desktop\Nim Test\index.nim: index 196/7 = 2800.00% |
19:29:01 | FromDiscord | <Prodigle> ``` |
19:29:07 | shashlick | ~paste |
19:29:07 | disbot | paste: 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:38 | FromDiscord | <Prodigle> Hey, I need some help reading the profiler write out regarding memory usage. A sample: |
19:30:38 | FromDiscord | <Prodigle> https://gist.github.com/SirProdigle/371b73bb99450dbba967a48e23c0b005 |
19:30:42 | FromDiscord | <Prodigle> https://gist.github.com/SirProdigle/371b73bb99450dbba967a48e23c0b005 🙂 |
19:37:37 | dsrw | Hi. 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:01 | dsrw | I'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:56 | leorize | you don't even need a macro for that |
19:39:53 | leorize | something like this should work: ```template `@`(field: untyped): untyped = self.field``` |
19:41:56 | Araq | dsrw, personally I'd use 's.field' instead and name the parameter 's' |
19:43:00 | dsrw | I'm partly just experimenting. I certainly agree that using `s.` is a more sensible approach :) |
19:43:33 | Araq | upcoming Nim 1.2 has a 'with' macro, but it only does some similar |
19:43:40 | Araq | *something similar |
19:44:28 | dsrw | @leorize Thank you very much. Let me try that. |
19:46:18 | dsrw | @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:40 | FromDiscord | <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:19 | FromGitter | <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:59 | Araq | you can patch system.nim to use @@ instead of @ *cough* |
19:49:19 | dsrw | That's awesome. Thanks. |
19:49:44 | Araq | Prodigle: there is GC_getStatistics() |
19:50:10 | * | natrys joined #nim |
19:50:22 | FromDiscord | <Varriount> Araq: I assume the Z3 integration could be used to remove unnecessary range checks? |
19:50:35 | FromDiscord | <Varriount> Or even unnecessary numerical checks in general? |
19:50:47 | FromDiscord | <Prodigle> Thanks 🙂 |
19:50:59 | Araq | well 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:30 | FromDiscord | <Prodigle> In my memory profiler, I'm geting a line showing percentages in the thousands |
19:54:31 | FromDiscord | <Prodigle> Entry: 1/3 Calls: 176/7 = 2514.29% [sum: 176; 176/7 = 2514.29%] |
19:54:47 | FromDiscord | <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:27 | Araq | me neither, I don't remember how it works |
19:58:10 | axion | Perhaps 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:53 | shashlick | Araq: 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:05 | FromGitter | <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:49 | axion | Ok perhaps an even dumber question: How did we jump from 1.0.6 to 1.2? |
20:09:08 | shashlick | odd numbers are dev versions |
20:09:23 | shashlick | 1.0.4 => 1.0.6, 1.0.x => 1.2.x |
20:09:31 | FromGitter | <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:46 | axion | I see. I haven't seen that convention in some years |
20:10:00 | FromGitter | <kaushalmodi> 1) 2.2, 1.2.4, .. will be patch releases over 1.2.0 |
20:10:15 | FromGitter | <kaushalmodi> Emacs does something similar |
20:10:34 | * | pbb joined #nim |
20:13:29 | axion | I'm puzzled at the long list of breaking changes after the stability guarantee announcement |
20:13:37 | axion | "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:03 | PMunch | Fuck, this was too good |
20:23:13 | PMunch | It might be that I haven't eating since lunch, but holy hell |
20:23:35 | PMunch | And I'm back by the way :P |
20:23:36 | clyybber | PMunch: What did you do? |
20:23:49 | PMunch | Made home-made dumplings |
20:24:03 | clyybber | oh, nice! |
20:30:19 | Araq | shashlick, I don't use .header but it can give some extra protection against API/ABI changes |
20:30:35 | Araq | axion, which long list of breakages? |
20:31:37 | * | PMunch drools https://play.nim-lang.org/#ix=2ffM |
20:31:52 | Araq | I count 6 |
20:32:00 | * | PMunch drools, with the correct link this time https://uploads.peterme.net/IMG20200325212740.jpg |
20:32:02 | euantor | Good call on `import macros` rather than `import std/macros` |
20:32:36 | euantor | `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:10 | FromDiscord | <Benumbed> Like axion, kinda confused about there being both stdlib and compiler breaking changes in 1.x |
21:02:50 | leorize | PMunch: damn that looks tasty |
21:03:11 | FromDiscord | <Benumbed> Is it just that the language spec was supposed to be stable in 1.x? |
21:04:03 | Araq | as I said, I count about 6 breaking changes, all affecting edge cases only |
21:04:08 | clyybber | Exactly |
21:04:13 | Araq | and could also be considered bugfixes |
21:04:49 | * | dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
21:04:59 | Araq | and --useVersion:1.0 emulates the bugs :-) |
21:05:17 | FromDiscord | <Recruit_main707> bam, backwards compatibility |
21:05:26 | leorize | Araq: have you advertised that in the change log? :P |
21:05:29 | FromDiscord | <Benumbed> Araq: the markdown document just has a whole bunch of stuff under the ‘breaking’ banners :). |
21:06:01 | Araq | yeah, probably we should reword it but 1.2 isn't out yet |
21:06:14 | Araq | as we're fixing more regressions |
21:06:17 | FromDiscord | <Benumbed> I’m not complaining just wanted to set expectations so I knew what to expect in the future |
21:06:32 | Araq | and yeah yeah, "aha! so you have regressions!" |
21:06:47 | Araq | yeah we do, fixes causes regressions that cause more fixes |
21:08:41 | leorize | do you mind if I add a warning to ioselectors_poll? |
21:08:58 | FromDiscord | <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:50 | PMunch | leorize, thanks, it was :D |
21:10:19 | leorize | did you make the whole thing yourselves? |
21:10:28 | leorize | yourself* |
21:10:28 | clyybber | Araq: Is decodeB supposed to ensure the kind of regs[ra] ? |
21:10:54 | Araq | it's supposed to do precisely what it currently does |
21:10:58 | clyybber | Benumbed: No regression means no advancement |
21:11:03 | clyybber | Araq: Ok :D |
21:16:49 | PMunch | leorize, yup, the dough, filling, and folding |
21:17:07 | clyybber | Araq: When we have a var seq parameter does the pointer indirection get optimized away when theres no reassignment? |
21:18:25 | clyybber | Disregard that question.. |
21:18:48 | liblq-dev | shashlick: how'd I approach wrapping a system library using getHeader? |
21:18:52 | Zevv | "and the neckbeards don't understand software development" \o/ |
21:19:39 | liblq-dev | I'd like to wrap wayland-server.h for that matter |
21:20:52 | * | Guest33716 is now known as dadada |
21:21:05 | dadada | +1 for https://github.com/nim-lang/Nim/pull/13757 |
21:21:06 | disbot | ➥ Add support for `zig cc` as C compiler. |
21:22:26 | liblq-dev | I 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:07 | FromDiscord | <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:08 | leorize | does running "nimsuggest" in the command line work? |
21:35:30 | FromGitter | <sheerluck> I thought PMunch was drooling over macro foo with treeRepr |
21:35:31 | FromDiscord | <smiga287> yup |
21:35:44 | PMunch | Haha, not quite |
21:35:58 | PMunch | That was on my clipboard from when I was helping out dadada with using macroutils |
21:36:16 | leorize | smiga287: ah, actually don't bother, and disable nimsuggest-mode |
21:36:30 | leorize | from what I heard about nim in emacs, that mode is broken |
21:37:09 | 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:38:18 | FromDiscord | <smiga287> @leorize oh okay, thanks anyways |
21:39:13 | leorize | PMunch: that's some rather decent work :) |
21:39:39 | dadada | PMunch: I wasn't successful with creating a template/macro for a if-else-ish extract (yet), but this needs to happen |
21:39:43 | FromDiscord | <smiga287> thanks for the motivation, can't wait the explore it more! |
21:39:43 | FromDiscord | <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:43 | FromDiscord | <smiga287> @gitterirc |
21:42:10 | dadada | smiga287: 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:33 | ksandvik | Is ~/.nimble/bin in our PATH? |
21:42:47 | PMunch | leorize, haha thanks. Trying to not go insane from this isolation thing.. |
21:43:28 | PMunch | Yeah I also use the playground surprisingly often |
21:43:47 | PMunch | Just to test out some code, instead of naming a file |
21:44:00 | leorize | the playground indenter is a tad too bad so I don't use it as much |
21:44:18 | PMunch | I 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:32 | PMunch | Yeah it's not great.. |
21:45:39 | dadada | I 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:51 | PMunch | Argh, my Firefox insists on not using a monospace font.. |
21:46:07 | PMunch | dadada, yeah that annoys me as well.. |
21:46:25 | PMunch | I think there is a ready made way to add that to CodeMirror (the editor the playground uses) |
21:47:46 | clyybber | Araq: 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:49 | Araq | clyybber, instead it should be a .cursor variable, maybe |
21:49:02 | clyybber | the s ? |
21:49:07 | Araq | yes |
21:51:47 | clyybber | Araq: I'm not sure, depends on wether a.slots would be used afterwards. From the templates name I suppose not |
21:53:03 | clyybber | So thats why I asked |
21:53:16 | clyybber | To be on the safe path I'm just not gonna touch it :P |
21:56:25 | Araq | make it a cursor |
21:56:42 | clyybber | Ok |
21:57:09 | clyybber | Araq: So `let s {.cursor.} = a.slots` ? |
21:58:16 | Araq | yeah or maybe |
21:58:29 | * | filcuc joined #nim |
21:58:44 | Araq | let s = cast[ptr UncheckedArray[typeof(a.slots[0])](addr a.slots[0]) |
21:59:08 | * | lritter quit (Quit: Leaving) |
21:59:22 | Araq | no known index out of bounds error in this code section for almost a decade, risk is low |
21:59:36 | clyybber | Ok |
21:59:57 | clyybber | I guess thats also a bit better for performance, as what I have now: https://github.com/nim-lang/Nim/pull/13741/files |
21:59:58 | disbot | ➥ Fix vm.nim for --gc:arc |
22:00:02 | clyybber | has two pointer indirections |
22:03:05 | clyybber | Araq: So WDYT, the approach I have now which is just passing the whole seq by address or the UncheckedArray ? |
22:03:29 | shashlick | liblq-dev - is the header in the standard include path |
22:03:52 | shashlick | if you do #include <wayland-server.h> does it work |
22:04:55 | leorize | I though you'll have to run addStandardSearchPath or smt? |
22:05:12 | shashlick | that's for cimport |
22:05:29 | shashlick | this is getHeader which searches standard paths if you specify -d:xxxStd |
22:07:03 | shashlick | the `-` 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:53 | Araq | clyybber, UncheckedArray |
22:13:00 | * | zahary joined #nim |
22:13:22 | clyybber | Araq: Ok |
22:15:04 | clyybber | Araq: I think a `template s(): untyped = a.slots` should do it too. WDYT? |
22:16:03 | shashlick | Araq: are bycopy and incompleteStruct orthogonal? |
22:18:01 | * | dsrw joined #nim |
22:20:15 | Araq | shashlick, no, you cannot copy incomplete structs in C |
22:20:19 | liblq-dev | shashlick: yeah, that works |
22:20:53 | Araq | clyybber, VM is performance sensitive though |
22:21:31 | dadada | stuff 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:57 | shashlick | if I define **`typedef struct A4 A4;`** as incompleteStruct, with importc and header, it still complains about size |
22:22:11 | shashlick | error: storage size of ‘obj’ isn’t known |
22:22:22 | Araq | then you use it in a context where the size must be known |
22:22:54 | * | solitudesf quit (Ping timeout: 240 seconds) |
22:22:58 | shashlick | i'm calling fieldPairs on it, maybe that's why |
22:23:13 | shashlick | cause i'm testing that it shouldn't have any fields |
22:23:44 | Araq | yeah, that's probably it |
22:23:58 | shashlick | i'm now wondering if I should even support importc + header for types |
22:24:05 | shashlick | cause ast2 works just fine without it |
22:24:06 | leorize | `char ***foo` would be `foo: ptr ptr UncheckedArray[cstring]` in Nim, right? |
22:24:22 | leorize | and, no I can't use cstringArray here because it's not one |
22:24:26 | Araq | leorize, nobody knows what it means |
22:24:35 | Araq | maybe you need 2 UncheckedArrays |
22:24:54 | * | Kaivo quit (Quit: WeeChat 2.7.1) |
22:25:04 | leorize | the proc I'm wrapping returns an array of strings and it's size |
22:25:12 | leorize | and I don't know how to express that :P |
22:25:36 | Araq | var ptr UncheckedArray[cstring] |
22:25:50 | leorize | thanks |
22:26:05 | shashlick | can anyone give me one good reason to retain importc / header support for types in nimterop? |
22:26:56 | Araq | posix works via C typedefs that are hidden in headers and it can be hard to figure out the real underlying type |
22:27:06 | Araq | so importing from the header is useful for that |
22:28:19 | shashlick | but 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:42 | shashlick | are 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:57 | PMunch | dadada, were you actually able to catch the error from except? |
22:30:25 | PMunch | Err, extract |
22:31:50 | * | dsrw quit (Quit: My MacBook has gone to sleep. ZZZzzz…) |
22:32:18 | clyybber | Araq: VMArgs is not a ref object though, so storing it a temporary should have no benefit |
22:32:44 | leorize | shashlick: yes, that's the case |
22:33:38 | leorize | the 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:41 | dadada | PMunch: 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:47 | dadada | do 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:46 | PMunch | Hmm, okay. But how were you detecting that it wouldn't be able to extract? |
22:35:46 | dadada | my approach was try: thewrappedextracthere; ifwegethereitsasuccess; except: ifwegethereitsfailure |
22:36:10 | PMunch | Huh, I wasn't able to make that catch an error |
22:36:46 | dadada | me neither, I just assumed that it SHOULD work |
22:37:35 | * | natrys quit (Quit: natrys) |
22:38:22 | PMunch | Haha, okay |
22:38:31 | PMunch | Yeah I don't think that's an exception |
22:39:14 | dadada | is it an expection ?? pun intended |
22:39:49 | dadada | expect/ation -> exception -> expection |
22:41:17 | dadada | could 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:30 | axion | is there a way to pass the --hints:off flag with `nimble test`? |
22:42:08 | leorize | does switch("hints", "off") works? |
22:42:28 | axion | oh i haven't learned me some nims yet. will try that |
22:43:28 | PMunch | Hmm, yeah this needs to be made a bit more robust.. |
22:43:30 | axion | that didn't work |
22:43:35 | PMunch | To not create those crazy errors |
22:43:49 | axion | oh maybe it did. i see hints up until the config.nims file was read |
22:44:22 | axion | well good enough i suppose. |
22:44:24 | * | yumaikas joined #nim |
22:44:26 | clyybber | Araq: 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:34 | dadada | PMunch: 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:13 | PMunch | Yeah this need to be solved in a different way |
22:45:18 | PMunch | Thanks for bringing it up |
22:45:19 | clyybber | Araq: Now we gotta bet that we really don't make mistakes with registerCallback, but I think thats fair :) right? |
22:45:22 | PMunch | I'll look into it |
22:47:00 | dadada | PMunch: I've an idea, how this might still work, but I need to test it first :-) hold on |
22:55:45 | liblq-dev | shashlick: take a look, http://ix.io/2fhH |
22:56:01 | liblq-dev | how am I supposed to make this work? |
22:56:03 | dadada | PMunch: 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:15 | liblq-dev | if the header has a dash in its name |
22:56:43 | * | tane quit (Quit: Leaving) |
22:58:06 | PMunch | Haha, yeah I think this is some weird VM thing |
22:59:50 | * | lritter joined #nim |
23:01:54 | dadada | PMunch: 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:50 | dadada | and no calling of macro.error, the error msg and node would then of course need to be logged in a different way |
23:03:34 | PMunch | Oh right, that's from massert! |
23:03:46 | PMunch | I guess massert could just throw an exception instead |
23:03:57 | * | krux02 quit (Remote host closed the connection) |
23:07:37 | dadada | PMunch: 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:58 | PMunch | Hmm, 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:30 | FromDiscord | <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:03 | FromDiscord | <KingDarBoja> or do I have to use case switch ? |
23:39:08 | axion | is there a f32 Inf/NegInf? |
23:40:59 | dadada | KingDarBoja: 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:08 | FromDiscord | <KingDarBoja> Yup, Python and TypeScript coder here |
23:44:04 | * | lritter quit (Quit: Leaving) |
23:44:33 | FromDiscord | <KingDarBoja> A kind like this -> https://nim-lang.org/docs/tut2.html#object-oriented-programming-type-conversions |
23:44:43 | FromDiscord | <KingDarBoja> ?? |
23:45:35 | leorize[m] | axion: just convert them to float32 |
23:45:45 | leorize[m] | I've verified that they're the same when converted |
23:46:35 | axion | leorize[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:00 | axion | as a default value ^ |
23:47:15 | leorize[m] | = -Inf.float32 .. Inf |
23:47:32 | * | filcuc quit (Quit: Konversation terminated!) |
23:48:08 | leorize[m] | btw HSlice with both boundaries of the same kind is also a Slice[T] |
23:48:28 | axion | seems like you also have to convert the upper bound to please the compiler |
23:48:36 | axion | Ah ok |
23:52:07 | shashlick | liblq-dev does it work if you set the define with a -? |
23:52:30 | shashlick | I'll have to update the code to remove special chars from the filename |
23:52:40 | shashlick | Can you hack build.nim for now |